Commit Graph
100 Commits
Author SHA1 Message Date
Steven Orvell c8008b9736 lint fix 2018-01-29 18:25:07 -08:00
Steven Orvell a0d6af66a0 Merge branch '1.x' into 5017-kschaaf-custom-style-1.x 2018-01-29 16:02:58 -08:00
Steven Orvell bba3f5ab0e Fix tests on Firefox. 2017-10-19 15:13:10 -07:00
Steven Orvell 90697bf2da Add support for styles with a shady-unscoped attribute
Since `/deep/` has been removed from Shady DOM v0, users must share styles between elements via style modules (e.g. `<style include="shared-style">`).

Under ShadyDOM, these styles are scoped and duplicated between elements. If these styles are intended to replace global styling done with `html /deep/ ...` this is inefficient since the styles are needlessly copied to each element style.

Therefore, this adds support for a `shady-unscoped` attribute. If this attribute is placed on a style and native Shadow DOM is not in use, then the style is copied once to the document and are left unscoped.

Please note, css custom properties are not supported in `shady-unscoped` styles.
2017-10-18 12:12:48 -07:00
Steven Orvell 40058aeb78 Skip tests of ::shadow and /deep/ under native Shadow DOM
These features have been removed from the only native implementation of Shadow DOM v0 (Chrome).
2017-10-18 11:58:12 -07:00
Steven Orvell 633ce4f750 Add more tests. 2017-05-22 16:29:24 -07:00
Steven Orvell 4e0abe441f Avoid calling detached before an element is readied. When an element is readied, if attachment is pending only call attached if the element is actually attached.
Note, this means that an element that is attached + detached before `ready` will not fire any attach/detach callback; however, this is a very corner case and previously in this case these callbacks were called out of order.
2017-05-22 16:14:43 -07:00
Steven Orvell b967c5ee48 Fixes #4550. Ensure that detached cannot run before an element is “readied.” This fixes an issue that allowed an element with disable-upgrade to process the detached callback. 2017-05-17 16:02:05 -07:00
Steve Orvell 9dda1d43c3 Merge pull request #4537 from Polymer/4536-kschaaf-hybrid-dom-bind
Add 2.x hybrid affordances for stamping template content. Fixes #4536
2017-04-17 16:45:43 -07:00
Steve Orvell f9bc45244f Merge pull request #4533 from Polymer/4532-kschaaf-resolve-url
Use `_importPath` in `resolveUrl` so it available early. Fixes #4532
2017-04-14 11:53:02 -07:00
Steven Orvell ac067652c1 * allow setting rootPath
* disallow setting `importPath` (this is supported in 2.x but not 1.x)
2017-03-03 16:42:11 -08:00
Steven Orvell daaf460ac8 Add importPath and rootPath to support 2.x hybrid compatible elements. 2017-03-02 16:46:27 -08:00
Steve Orvell fe535a2487 Merge pull request #4314 from Polymer/1.x-uc-browser-fix
Read properties off of proto during configuration.
2017-02-22 15:59:25 -08:00
Steven Orvell 20de9287d0 add tests 2017-02-22 15:20:40 -08:00
Steven Orvell 2315547e47 Adds a setting preserveStyleIncludes which, when used with a shadow dom targeted css build and native custom properties, will copy styles into the Shadow DOM template rather than collapsing them into a single style. This will (1) allow the browser to optimize parsing of shared styles because they remain intact, (2) reduce the size of the css build resources when shared styles are used since they are not pre-collapsed. This option does perform registration runtime work to add included styles to element templates. 2017-02-22 10:03:48 -08:00
Steve Orvell 6fc567fbf4 Merge pull request #4311 from Polymer/4302-kschaaf-disabled-configure
Ensure disable-upgrade elements are not "configured". Fixes #4302
2017-02-13 14:26:53 -08:00
Steven Orvell 632f0e471a remove cruft. 2017-02-13 13:05:07 -08:00
Steven Orvell a42cb20975 Add comment. 2017-02-06 15:46:55 -08:00
Steven Orvell 62e9b84b35 Only keep disable-upgrade attribute if it is an attribute binding. 2017-02-06 15:45:14 -08:00
Steven Orvell 5030c1b9d3 spacing. 2017-02-06 15:42:45 -08:00
Steven Orvell ca7dbb8479 Update webcomponentsjs dependency 2017-02-06 15:36:51 -08:00
Steven Orvell b8e31fa9d5 Merge branch 'master' into 1.x-isInert
Conflicts:
	src/lib/polymer-bootstrap.html
2017-02-06 15:34:25 -08:00
Steven Orvell f8f903cf59 Change isInert to disable-upgrade and feature is now supported only via the disable-upgrade attribute. 2017-02-06 15:27:53 -08:00
Steven Orvell 919251487f Prevent annotator from removing the is-inert attribute. 2017-02-02 11:23:41 -08:00
Steven Orvell ca3f59d33a Add support for isInert to allow elements to boot up in an inert state. e.g. <x-foo is-inert></x-foo>. Setting xFoo.isInert = false causes the element to boot up. 2017-01-31 13:57:01 -08:00
Steven Orvell c76ba5b967 improve comments 2017-01-26 16:43:18 -08:00
Steven Orvell 52ea6002f8 Add comments. Behavior fast copy flag changed to _noAccessors. 2017-01-26 12:55:03 -08:00
Steven Orvell e588f1f57a Fix tests on IE10 and simplify constructor shortcut. 2017-01-26 10:48:56 -08:00
Steven Orvell 73b62a6382 Make dom-module work on older Safari. 2017-01-25 15:46:29 -08:00
Steven Orvell a1c1285deb micro-optimizations: (1) favor mixin over extends where possible, (2) unroll behavior lifecycle calls, (3) avoid creating a custom constructor when not used, (4) provide _skipDefineProperty setting on behaviors which copies properties via assignment rather than copyOwnProperty 2017-01-25 14:50:00 -08:00
Steve Orvell 7e732f6b2d Merge pull request #4267 from Polymer/4262-kschaaf-suppress-events
Add global flags to suppress unnecessary notification events. Fixes #4262
2017-01-20 18:39:05 -08:00
Steven Orvell a3b75eb390 Fix strip-whitespace for nested templates. 2017-01-20 12:27:13 -08:00
Steve Orvell 99c9d6726d Merge pull request #4149 from Polymer/slot-content-text-nodes
Make sure text nodes are distributed when translating slot to content
2016-11-15 17:13:10 -08:00
Steve Orvell 77f8a694f0 Merge pull request #4129 from Polymer/fix-4125
Always update style properties when calling getComputedStyleValue
2016-11-04 14:58:01 -07:00
Steve Orvell f24dea115a Merge pull request #4124 from blasten/import-href-listener
Fix #4123: Memory leak when using `importHref`
2016-11-02 16:25:53 -07:00
Steve Orvell e45eeff32e Merge pull request #3997 from Polymer/perf-ie-style-cache
Fix IE style cache performance
2016-09-26 15:27:51 -07:00
Steve Orvell 03989ac238 Merge pull request #3951 from Polymer/html-selector
Support more expressive `:root` and `html` selectors
2016-09-26 15:17:09 -07:00
Steve Orvell 1a018967ac Merge pull request #3983 from Polymer/support-slotted
Transform ::slotted() to ::content
2016-09-22 16:20:54 -07:00
Steve Orvell 18d0af6970 Merge pull request #3974 from Polymer/slot-support
Add support for slot->content transformation.
2016-09-21 17:39:23 -07:00
Steve Orvell b1f06b683f Merge pull request #3785 from jcmoore/preserve-style
Fixes #3676: retain <style in <template preserve-content/> (re-attempt of #3679 to -- automatically -- appease CLA overlords)
2016-08-01 14:14:46 -07:00
Steve Orvell 80fc971411 Merge pull request #3825 from Polymer/resolve-url-abs
Do not resolve urls with leading slash and other prototcols
2016-07-29 11:39:17 -07:00
Steve Orvell c34fff9d14 Merge pull request #3824 from Polymer/apply-shim-initial-inherit
Handle mixins with property values of inherit and initial
2016-07-28 17:44:36 -07:00
Steve Orvell 2a4fffefc4 Merge pull request #3819 from Polymer/property-shim-initial-inherit
[property shim] Make sure "initial" and "inherit" behave as they would natively
2016-07-27 14:18:54 -07:00
Steven Orvell 95eadbd000 fix lint issue. 2016-07-27 12:15:15 -07:00
Steven Orvell 5967f2dda3 Fixes #3801. Ensure style host calculates custom properties before element. This ensures the scope's styles are prepared to be inspected by the element for matching rules. 2016-07-27 11:17:05 -07:00
Steve Orvell 19d9f3c600 Merge pull request #3806 from Polymer/fix-native-update-styles
updateNativeStyles should only remove styles set by updateNativeStyles
2016-07-25 12:25:31 -07:00
Steve Orvell e1d87bcc97 Merge pull request #3646 from jorgecasar/fix-3645
Include iron-component-page in devDependencies
2016-07-22 14:40:34 -07:00
Steve Orvell 2f59f25533 Merge pull request #3799 from Polymer/3677-kschaaf
Remove dirty check for custom events; unnecessary after #3678. Fixes …
2016-07-22 14:38:28 -07:00
Steve Orvell 366b82d539 Merge pull request #3780 from Polymer/3779-kschaaf-prop-wins
Ensure properties override attributes at upgrade time. Fixes #3779.
2016-07-22 14:37:36 -07:00
Steven Orvell b271a88f53 Opt in to "even lazier" behavior by setting lazyRegister to "max". This was done to preserve compatibility with the existing feature. Specifically, when "max" is used, setting is in beforeRegister and defining factoryImpl may only be done on an element's prototype and not its behaviors. In addition, the element's beforeRegister is called *before* its behaviors' beforeRegisters rather than *after* as in the normal case. 2016-07-21 17:20:48 -07:00
Steven Orvell fb95dc888e Fix test in IE10. 2016-07-21 14:33:12 -07:00
Steven Orvell 0e5d377362 Merge branch 'master' into even-lazier 2016-07-21 11:58:47 -07:00
Steven Orvell 8a26759b5f Fix #3786 by adding a noUrlSettings flag to Polymer.Settings 2016-07-21 11:57:07 -07:00
Steven Orvell 54a462dcda Fix test to account for pseudo element differences x-browser. 2016-06-28 18:29:35 -07:00
Steven Orvell ff88e174c0 Restore functionality of selectors like :host(.foo)::after.
Fixes #3749.
2016-06-28 17:55:53 -07:00
Steven Orvell e770343893 add comment. 2016-06-28 14:52:55 -07:00
Steven Orvell 4e51ef6445 re-support selectors like :host[inline] since this was previously supported under shady-dom. 2016-06-27 20:44:53 -07:00
Steve Orvell 645bcd0268 Merge pull request #3740 from Polymer/fix-3739
Fixes #3739: correctly shim `:host(.element-name)` as `element-name.e…
2016-06-27 19:05:17 -07:00
Steven Orvell 4817d6194a fix linting 2016-06-27 18:53:30 -07:00
Steven Orvell 4e08fa1b7e Add test for not matching x-foox-bar given :host(x-bar) used inside x-foo 2016-06-27 18:47:49 -07:00
Steven Orvell ec111f10ac fix test in IE/FF. 2016-06-27 18:29:27 -07:00
Steven Orvell c3355fd1e5 simplify :host fixup 2016-06-27 18:03:35 -07:00
Steven Orvell 997240af75 Fixes #3739: correctly shim :host(.element-name) as element-name.element-name.
Also converts `:host(not-element-name)` to a non-matching selector.
2016-06-24 19:46:34 -07:00
Steven Orvell 9676d6da59 Make lazyRegister have 'even lazier' behavior such that behaviors are not mixed in until first-instance time. 2016-06-24 18:06:46 -07:00
Steven Orvell 45ece8aa74 Merge branch 'master' into even-lazier 2016-06-24 18:04:36 -07:00
Steven Orvell 84662b917c Fixes #3734: address HI/CE timing issue in importHref. Fixes upgrade time dependencies of scripts on previous elements in async imports. 2016-06-24 12:28:13 -07:00
Steven Orvell ac925f74ed Merge branch 'master' into fix-3530 2016-06-22 18:46:42 -07:00
Steven Orvell 6d9048003a Ensure element scope selectors are updated correctly when updateStyles is called when element is not in dom. 2016-06-22 18:39:51 -07:00
Steve Orvell f6df6a97c3 Merge pull request #3708 from Polymer/3705-kschaaf-async-customstyle
Ensure custom styles updated after adding custom-style async. Fixes #3705.
2016-06-22 17:52:53 -07:00
Steven Orvell 620e59f8f0 add comment. 2016-06-22 17:51:27 -07:00
Steve Orvell e9ac9de2d8 Merge pull request #3723 from Polymer/fix-effect-value
Make sure effect functions receive latest values
2016-06-22 14:08:56 -07:00
Steven Orvell b5b8a2ac8c remove unneeded flag. 2016-06-22 10:19:35 -07:00
Steven Orvell ab431ed6a2 Fixes #3730 and inspired by (https://github.com/Polymer/polymer/pull/3585) 2016-06-22 09:20:53 -07:00
Steven Orvell 4852f6cee6 custom-style triggers updateStyles if root scope (StyleDefaults) has style properties when the custom-style is created. 2016-06-22 08:42:41 -07:00
Steve Orvell 1058896b0d Fixes #3555. Ensure selectors including ::content without a prefix … (#3721)
* Fixes #3555. Ensure selectors including `::content` without a prefix inside a complex selector are shimmed correctly and do not leak styling to the global scope.

* remove whitespace fixup since it's unncessesary.
2016-06-20 16:42:14 -07:00
Steven Orvell ae4a07eab6 Fixes #3530. When updateStyles is called and an element is not attached, invalidate its styling so that when it is attached, its custom properties will be updated.
Also fixed a related issue with scope style cache disablement when :host function rules are used:
 * "property prepping" and decoration are now after static shimming so that transformed selectors are available to calculate :host function,
 * the detection of :host function properly accounts for type extension,
 * since "property prepping" was moved after shimming, apply shim was separated from this and moved before shimming so that its output can be used there.
2016-06-17 18:23:43 -07:00
Steven Orvell 129488b0c5 Use whenReady to apply custom styles. 2016-06-17 09:59:48 -07:00
Steven Orvell 5c5b18ef5c Expose an lazierRegister flag to defer additional work until first create time. This change requires that a behavior not implement a custom constructor or set the element's is property. 2016-06-03 17:33:51 -07:00
Steve Orvell cd0064a061 Merge pull request #3662 from Polymer/fix-3661
Fixes 3661
2016-05-24 10:44:08 -07:00
Steven Orvell 1e2aed5670 Fix test in Firefox that was hacked to work in Canary (instead filed https://bugs.chromium.org/p/chromium/issues/detail?id=614198). 2016-05-23 16:24:10 -07:00
Steven Orvell 4a99b834ef remove unneeded argument 2016-05-23 15:49:27 -07:00
Steven Orvell ce0bf86c8d slight optimization, avoid work if no cssText is set. 2016-05-23 15:11:51 -07:00
Steven Orvell 63f91ae6ed More efficient fix for #3661. Re-uses cached style element that needs to be replaced in the document rather than creating a new one. 2016-05-23 15:04:02 -07:00
Steven Orvell 717fc3afba Fixes #3661: ensure that cached style points to the applied style for Shady DOM styling. This ensures that the cache can be used to determine if a style needs to be applied to the document and prevents extra unnecessary styles from being added. This could happen when a property cascaded to a nested element and updateStyles was called after properties have changed. 2016-05-18 15:00:17 -07:00
Steven Orvell 04da86884c Fix flakey attached/detached timing test. 2016-05-18 14:57:29 -07:00
Steve Orvell 409ad8347b Merge pull request #3602 from danbeam/patch-2
add more style[include] doc
2016-04-20 18:09:20 -07:00
Steven Orvell 7ad2bff7ec Only fix prototype when registering at first create time. 2016-03-21 19:07:30 -07:00
Steven Orvell 4834651067 Fixes #3525: Makes lazy registration compatible with platforms (like IE10) on which a custom element's prototype must be simulated. 2016-03-21 18:41:54 -07:00
Steven Orvell a3fce19f00 Fast check in createdCallback to see if registration has finished. 2016-03-17 10:10:58 -07:00
Steven Orvell 103f7902a3 even more lazy: defer template lookup and style collection until finish register time. 2016-03-16 19:02:24 -07:00
Steven Orvell d7a2baa42a fix lint errors. 2016-03-16 17:54:20 -07:00
Steven Orvell 31c785df06 * turn on lazy registration via Polymer.Settings.lazyRegister
* ensure registration finished by calling `Element.prototype.ensureRegisterFinished()`
2016-03-16 17:08:14 -07:00
Steven Orvell 3dd1b61567 remove crufty smoke test. 2016-03-16 15:51:49 -07:00
Steven Orvell 0447228375 fix lint issues 2016-03-15 12:30:55 -07:00
Steven Orvell f6597ec1e3 Change forceRegister to eagerRegister and add Polymer.Settings.eagerRegister flag. 2016-03-15 12:18:56 -07:00
Steven Orvell d53323dc07 Add forceRegister flag to force an element to fully register when Polymer is called. Normally, some work is deferred until the first element instance is created.
Add lazy registration tests.
2016-03-14 19:28:07 -07:00
Steven Orvell 812db6af15 Call registered no prototype. 2016-03-14 19:00:26 -07:00
Steven Orvell 31702ffab5 Lazy register features we can be deferred until first instance. This is an optimization which can speed up page load time when elements are registered but not needed at time of first paint/interaction 2016-03-14 16:08:50 -07:00
Steven Orvell e2c5f9ec11 Fix lint error. 2016-03-01 18:49:20 +11:00
Steven Orvell cc0e9dfa46 Ensure that dom-bind always waits until DOMContentLoaded to render. This ensures a script can install api on the dom-bind prior to it rendering. Previously dom-bind waited for first render, but an early parser yield can make this occur unexpectedly early. 2016-03-01 18:30:08 +11:00