Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindings in icon-button fail under ShadowDOMPolyfill #83

Closed
sorvell opened this issue Apr 4, 2013 · 1 comment
Closed

Bindings in icon-button fail under ShadowDOMPolyfill #83

sorvell opened this issue Apr 4, 2013 · 1 comment
Labels

Comments

@sorvell
Copy link
Contributor

sorvell commented Apr 4, 2013

See the example here: workbench/icon-button.html?debug&shadow=polyfill

There are 3 icon-buttons, but only one has the expected image.

This breakage was caused when MDV's creation hook was implemented in the platform repo to upgrade elements (https://github.com/toolkitchen/platform/blob/master/lib/patches-loaded.js#L10).

The expected behavior is that icon-button's src property is bound to icon's src property and that is bound to a div with its style attribute set to "background-image: url({{src}}) ...".

When stepping through the ShadowDOM polyfill code here https://github.com/toolkitchen/ShadowDOM/blob/master/src/wrappers/Element.js#L41, the last call to setAttribute has the expected value and the wrapped node's style attribute has the expected value. This call is a result of the dirtyCheck called when the "WebComponentsReady" event is fired.

At that time, the real node in question is not in document. It is in a document fragment owned by a document without a defaultView. The url is resolve at that time and evaluates to an unexpected value.

We can avoid this problem by ensuring we do not dirtyCheck before shadowDOM distribution occurs. More generally, MDV could, perhaps, avoid processing bindings on nodes without a browsing context.

@sorvell
Copy link
Contributor Author

sorvell commented Apr 4, 2013

This issue is due to the way css is evaluated in created documents.

It should be addressed in HTML Imports.

@sorvell sorvell closed this as completed Apr 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant