Kevin Schaaf
4228d666bc
Avoid initializing properties unnecessarily (perf benefit).
...
Due to the megamorphic nature of code in base classes with many extensions such as these, we saw these initializations _costing_ more than helping with "object shaping."
2018-11-28 17:31:56 -08:00
Steven Orvell
41c75c2606
Lint fixes
2018-11-14 17:50:19 -08:00
Kevin Schaaf
77f343697d
Fix settings to pull from Polymer object for defaults.
2018-11-14 17:08:45 -08:00
Kevin Schaaf
cc1402d991
Merge css-build-dir changes into 2.x
...
* Don't set up observer in ShadyDOM
* Move __activateDir into check instead of replace
* skip some tests that never really worked in ShadyDOM
2018-11-14 15:38:28 -08:00
Steven Orvell
d74aa82ab4
Use closure-safe name
2018-11-14 11:02:25 -08:00
Steven Orvell
bbf1acce3d
Ensure properties and observers are interleaved per behavior
2018-11-13 19:37:04 -08:00
Steven Orvell
6f3057ec7a
Ensure property values are always overridden by extendors/behaviors
2018-11-13 16:24:53 -08:00
Steven Orvell
29d514f70c
Ensure registered is always called on element prototype
...
Previously, it could be called on a superclass' prototype and not the element's prototype.
2018-11-13 15:32:36 -08:00
Steven Orvell
44e4828796
Do lazy behavior copying only when legacyOptimizations is set
2018-11-09 18:48:53 -08:00
Steven Orvell
fbf827d9c7
Behavior property copying fixes
...
* ensure element has `is` on prototype early as this is sometimes checked in user code.
* ensure properties copied onto elements from info/behaviors are forced to configurable so they can be re-configured by later behaviors.
* add `_noAccessors` optimization for faster property copying
2018-11-09 18:18:24 -08:00
Steven Orvell
83c0e9d143
Ensure initial static classes are preserved when a class$ binding is present.
...
This ensures ShadyCSS scoping classes are not removed when a class binding's initial literal value is set.
2018-11-09 18:04:58 -08:00
Steven Orvell
5b34ce9d83
Avoid copying certain properties from behaviors
...
This better matches what Polymer 1.x did for:
* hostAttributes
* listeners
* properties
* observers
2018-11-09 11:39:10 -08:00
Kevin Schaaf
b3568bb32b
Sync memoized properties getter with 3.x version.
2018-11-06 17:51:19 -08:00
Steven Orvell
9d33ecb9a5
Remove unnecessary setting of _template.
2018-11-06 15:30:42 -08:00
Steven Orvell
b12a0b6a3b
Minor renaming based on review.
2018-11-06 15:10:57 -08:00
Steven Orvell
9e141723a3
Slight tweaks based on review.
2018-11-06 14:55:54 -08:00
Steven Orvell
5d5c95caec
Slightly improve how _registered is called.
...
This ensures it's not called on extendors who do not specifically implement `_registered`. This is important since it's expected to do prototype specific work.
2018-11-06 12:58:44 -08:00
Steven Orvell
f62755d4b5
Changed based on review feedback.
2018-11-06 12:27:47 -08:00
Kevin Schaaf
5bd4afd6cd
Merge branch '2.x' into perf-opt
2018-11-05 16:34:12 -08:00
Kevin Schaaf
8882c3db24
Merge pull request #5295 from Polymer/strict-template-policy-2.x
...
[2.x] Introduce strictTemplatePolicy
2018-11-05 11:31:39 -08:00
Kevin Schaaf
08b267f338
Ensure _template from behaviors takes precedence over is in legacy.
2018-11-01 15:46:32 -07:00
Steven Orvell
c274670456
TemplateStamp: fix TreeWalker
...
IE/older Safari require all arguments.
2018-11-01 15:33:01 -07:00
Steven Orvell
ca03e08df8
Factor telemetry to separate module
...
Also use exclusively in `properties-mixin`
2018-11-01 12:45:08 -07:00
Steven Orvell
dadcfc2e7d
Address linting issues.
2018-10-31 18:26:04 -07:00
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
Kevin Schaaf
620ae42ed7
Sync with changes made in master.
2018-10-31 16:25:16 -07:00
Kevin Schaaf
10c4e80bfa
Merge branch '2.x' into strict-template-policy-2.x
2018-10-31 14:19:14 -07:00
Kevin Schaaf
6e4f62d88b
Add comment and handle undefined host case.
2018-10-31 14:18:22 -07:00
Steven Orvell
efb8d71c12
Behaviors
...
* properly de-dup behaviors from superclasses
* apply only "own" behaviors to class
2018-10-31 11:58:26 -07:00
Steven Orvell
20c8bf1038
LegacyElement
...
* fix issue where registered was called on element instance instead of prototype
* fix issue where applyListeners was called in constructor rather than initializeProperties; this made `disable-upgrade` mixin not properly work with litsners.
2018-10-31 11:57:23 -07:00
Kevin Schaaf
55e9dfd151
Apply mixin to TemplatizeInstance
2018-10-31 11:37:40 -07:00
Kevin Schaaf
763e40d198
Merge branch '2.x' into 5262-kschaaf-legacy-undefined
2018-10-31 10:48:55 -07:00
Kevin Schaaf
ed6deea83b
Sync with changes made on master.
2018-10-31 10:16:54 -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
Steven Orvell
7251a3acc2
memoize behavior method lists for fasting runtime calling.
2018-10-30 18:01:08 -07:00
Kevin Schaaf
09a6d1afda
stripWhitespace
2018-10-26 18:11:35 -07:00
Kevin Schaaf
c421f08d2a
noDirMixin
2018-10-26 18:10:55 -07:00
Kevin Schaaf
2a258182bf
noCloneTemplate
2018-10-26 18:08:13 -07:00
Kevin Schaaf
a7847816ef
lazyCopyProps
2018-10-26 18:06:53 -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
c61df6f422
Use TreeWalker for template-stamp.
2018-10-23 15:06:51 -07:00
Kevin Schaaf
527f519c9a
Avoid using mixins for behaviors.
2018-10-19 18:35:25 -07:00
Daniel Freedman
85a59a6636
2.6.1
2018-08-23 12:09:02 -07:00
Tomek Wytrębowicz
ffe8f7e8dc
Make event notification handler read the value from currentTarget, ( #5309 )
...
instead of target which may not be bound to any data.
Fixes https://github.com/Polymer/polymer/issues/5308
2018-08-02 11:46:17 +02:00
Kevin Schaaf
dfc8398bad
Revert to legacy template getter, update tests.
2018-07-24 11:47:29 -07:00
Kevin Schaaf
2ac221bfe7
Ensure template helpers in trusted templates work.
2018-07-23 22:43:05 -07:00
Kevin Schaaf
275491e05e
More updates based on code review.
2018-07-23 21:14:05 -07:00
Alexander Marks
50ba80b864
Annotate another two ephemeral classes.
2018-07-23 17:09:05 -07:00
Alexander Marks
0bf03d3cc3
Mark some ephemeral super classes as private.
2018-07-23 15:58:57 -07:00