Hello,
I've been experimenting with creating a polyfill to isolate styles from shadow DOM elements. It has been fairly straight-forward creating a script that isolates CSS rules from the children of arbitrary DOM elements in a stand alone package but I've run into some issues with the MutationObserver while trying to integrate with Polymer's webcomponents.js. The 'childList' mutations for shadowRoot children never trigger and attribute mutations to custom element ancestors are not triggered either.
Please take a look at my code:
You can see the webcomponent.js integration in test/mockup/webcomponent.html
View in Firefox <=33 or IE 9/10 to see effects
If you click the 'Attribute Change Test' button first, the MutationObserver picks up the class change and performs the update.
If the 'Insert Test' button is clicked first, the child insertion is never observed. Then click the 'Attribute Change Test' button, no attribute changes are observed.
The 'Ancestor Attribute Change Test' fails completely.
Also, any idea on how to access the original querySelector methods without a shim before loading webcomponents.js would be helpful.
Thanks
Ben