Commit Graph
119 Commits
Author SHA1 Message Date
Steven Orvell 0190e330e8 Address review feedback
* Uses `window.ShadyCSS.cssBuild` to avoid doing unnecessary work in `processElementStyles`
* Stores the list of active in-use behaviors in a legacy element's `behaviors` property. This only matters in the exotic case when elements with behaviors are extended with more behaviors and previously the list included only the subclasses behaviors (although the element otherwise worked as expected).
2018-10-31 18:03:19 -07:00
Steven Orvell 4f223035c3 Adds legacyOptimizations flag
Set using `Polymer.setLegacyOptimizations(true)`. This flag enables optimizaitons including, always stripping whitespace from templates and avoiding cloning element templates (assumes no inheritance is used)

Also re-enables dir-mixin.
2018-10-30 18:15:25 -07:00
Kevin Schaaf 2a258182bf noCloneTemplate 2018-10-26 18:08:13 -07:00
Kevin Schaaf 2f78573357 Fix prototype registration 2018-10-26 18:03:07 -07:00
Kevin Schaaf f17180341c Fix telemetry registrations to go eagerly 2018-10-25 18:29:12 -07:00
Kevin Schaaf 527f519c9a Avoid using mixins for behaviors. 2018-10-19 18:35:25 -07:00
Alexander Marks 748db7ce2e Updates for improved type generation. 2018-07-20 22:05:18 -07:00
Kevin Schaaf 412bb1e019 Avoid closure warnings. 2018-04-05 14:59:48 -07:00
Kevin Schaaf 616f6662f0 Add ability to define importMeta on legacy elements. Fixes #5163 2018-04-05 14:12:54 -07:00
Kevin Schaaf c8c9e24de5 Update docs. 2018-04-02 18:31:14 -07:00
Kevin Schaaf d9d3e43912 Use Polymer.ResolveUrl.pathFromUrl 2018-04-02 18:08:21 -07:00
Kevin Schaaf 2128ebe2ff Fix test under shadydom. Slight logic refactor. 2018-04-02 16:57:25 -07:00
Kevin Schaaf f7672da9a7 Add importMeta getter to derive importPath from modules. Fixes #5163 2018-04-02 14:12:57 -07:00
Tim van der Lippe 2a6c0a2a10 Returning null in template should nullify parent template 2018-03-15 11:30:06 +01:00
Tim van der Lippe d458bab317 Add note to updateStyles regarding updates to CSS mixins 2018-02-10 16:39:36 +01:00
Kevin Schaaf a829cbcef2 Add comments about resolveUrl idiosyncrasies. 2018-01-31 15:47:49 -08:00
Kevin Schaaf 127bc866b3 Revert "Move absolute url logic to element-mixin" 2018-01-31 15:27:55 -08:00
Steven Orvell 4177d9ce7e [element-mixin] Do not create property accessors unless a property effect exists
Reverts an unintentional breaking change. Previously (2.3.x) property accessors were created only for properties in the properties object which had explicit property effects. In 2.4.0, property accessors were created for any property name returned in the properties object. This was a breaking change in rare cases (for example in https://github.com/PolymerElements/iron-a11y-keys-behavior).

This change reverts the 2.4.0 behavior. Accessors are now again only added for properties which have explicit effects. In addition, `_addPropetyToAttributeMap` was added to `PropertiesChanged` to record a mapping from the attribute to the property name (needed for deserialization).
2018-01-30 15:14:25 -08:00
Kevin Schaaf e76a2b9062 [ci skip] Add comment to aid archeology 2018-01-08 09:09:54 -08:00
Tim van der Lippe 9c189ac94c Move absolute url logic to element-mixin
This is backwards-compatible with the previous URL resolution.
Now, `Polymer.ResolveUrl.resolveUrl` correctly appends the url
to the basePath.
2018-01-08 16:53:33 +01:00
Tim van der Lippe e872982269 Tighten more types for TypeScript and Closure (#4998) 2017-12-18 14:03:02 -08:00
Daniel Freedman 2d6b468449 Handle case where there are no elements in the template
Always put `<link rel="import" type="css">` styles at the top
2017-12-12 16:52:51 -08:00
Daniel Freedman 706e602162 Fix regression with imported css
Fix case where `<link rel="import" type="css">` is the only styling for
an element

Fixes #4986
2017-12-12 11:42:37 -08:00
Daniel Freedman da46204d72 Merge branch 'master' into basic-element 2017-12-08 14:29:07 -08:00
Daniel Freedman 4915b0a018 Merge pull request #4971 from Polymer/html-template-fn
`html` tag function for generating templates
2017-12-07 13:49:04 -08:00
Daniel Freedman 02c06aa3b8 Rename html-fn to html-tag
Add tests
Add a `Polymer.html = Polymer.html` line to `polymer.html` and
`polymer-element.html` for modulizer exporting in Polymer 3.
2017-12-06 17:07:26 -08:00
Daniel Freedman b7c56173c2 Use padding-top to get correct computed style on older safari
Because the element wasn't floating, `top: 10px` was not showing up in
computed styles on Safari 9 and 10
2017-12-06 14:54:27 -08:00
Daniel Freedman 0b1cd70a10 Handle styles that are not direct children of templates correctly
Find the correct spot to add "included" styles in the template by
keeping track of which "concrete" style in the template we have
encountered and inserting the "included" styles before them.

Fixes #4975
2017-12-06 11:40:04 -08:00
Kevin Schaaf a12934c578 Fix most closure warnings. 2017-12-05 17:34:14 -08:00
Kevin Schaaf b158e082d0 Merge with master 2017-12-05 15:49:07 -08:00
Daniel Freedman 5c91985061 [ci skip] TODO for link to docs and comment spellcheck 2017-12-05 11:07:14 -08:00
Daniel Freedman 530a68b44a Add deprecation notice for class.template returning a string
Load `Polymer.html` fn by default with `PolymerElement`.
2017-12-04 17:29:54 -08:00
Steven Orvell d3e1bae48a Merge branch 'master' into basic-element 2017-11-29 16:49:07 -08:00
Steven Orvell 8d57a6e91d Remove propertyNameForAttribute since it's never needed. 2017-11-29 11:01:02 -08:00
43081j a8105e55a4 add return jsdoc to void functions 2017-11-28 20:57:41 +00:00
Steven Orvell feac932859 [PropertiesMixin] Fix mapping property names from attributes
* make static: propertyNameForAttribute, attributeNameForProperty, typeForProperty
* method that take classes should consistently use `constructor` as the arg name.
* when using `properties`, the property name for a given attribute is discovered using the names in `properties` and reverse mapping the `attributeNameForProperty` attribute.
2017-11-20 14:41:07 -08:00
Daniel Freedman 15d8c6af41 Merge branch 'master' into 2.x-shady-unscoped-style 2017-11-17 17:33:16 -08:00
Steven Orvell 4b9170ab24 Cleanup based on review. 2017-11-16 17:12:53 -08:00
Steven Orvell a7b46b156e Factoring improvements around attribute serialize/deserialize 2017-11-16 14:25:16 -08:00
Steven Orvell fb0f90bc6b Remove crufty comment. 2017-11-15 16:43:37 -08:00
Steven Orvell 74fb51512b Expose less protected data.
* Hide _own* getters since they are unnecessary
* declared properties always have accessors unless they would stomp existing accessors (or have property  effects)
2017-11-15 11:09:14 -08:00
Steven Orvell 08c3a02eaf Prep for processing of shady-unscoped moving to ShadyCSS 2017-11-13 11:29:27 -08:00
Steven Orvell d331c673fc Merge branch 'master' into basic-element 2017-11-10 17:04:15 -08:00
Steven Orvell 0fe9434fd7 ElementMixin uses PropertiesMixin for
* finalization
* creating properties
2017-11-10 16:51:13 -08:00
Daniel Freedman cda62d5fd3 Implement type change in Polymer.ElementMixin 2017-11-02 15:01:05 -07:00
Steven Orvell 1c5b731ffb Update externs again. 2017-10-19 14:57:51 -07:00
Steven Orvell 819652eb9f Allow style elements to be separate in the element template.
Previously Polymer collapsed any included shared styles into 1 style element. This prevents the browser from recognizing shared style elements as similar and optimizing them. With this change, we no longer collapse styles. Note, included styles are still currently collapsed by ShadyCSS but the polyfill will likely not do this in the future.
2017-10-19 12:56:30 -07:00
Daniel Freedman e71b84a8b8 Address feedback
- Extend PropertyAccessors for greater flexibility
- Detect if `:dir` is used in order to activate runtime features
- Add to LegacyElement for 1.x compatibility
- clean up `ElementMixin._finalizeTemplate`
2017-10-12 11:17:19 -07:00
Daniel Freedman 2ef65aa62c First draft of a :dir aware element mixin
Related to #4860
2017-10-05 15:59:59 -07:00
Steven Orvell c7b43f78cd Add accessor property to properties object
This forces a property listed in `properties` to create a property accessor regardless of whether or not it is needed for effects. This allows using `_propertiesChanged` to process changes for properties that may not have effects.
2017-09-15 10:54:58 -07:00