Does Polymer 1.0 no longer use Shadow DOM? Why?

375 views
Skip to first unread message

Ajedi32

unread,
Jun 16, 2015, 10:53:29 AM6/16/15
to polym...@googlegroups.com
I was playing around with the new version of Polymer, and one thing I noticed was that Polymer doesn't seem to use Shadow DOM at all anymore:


If I open the dev tools in Chrome and inspect the custom elements in these examples, I can see that Polymer 0.5 puts the template content in a special "shadow-root" node, whereas Polymer 1.0 just uses a span element with a couple special classes on it. Why is this?

I'm aware that Polymer 1.0 uses the new shady DOM polyfill instead of the full shadow DOM polyfill, but Chrome supports shadow dom natively AFAIK so that shouldn't effect anything, right?

What's going on here?

Arthur Evans

unread,
Jun 16, 2015, 5:55:32 PM6/16/15
to Ajedi32, polymer-dev
See the top of the local DOM chapter of the docs:

Note: Currently Polymer uses shady DOM by default on all browsers. To opt-in to using shadow DOM where available, seeGlobal settings


You can enable native shadow DOM where available, but the default mode helps people ensure that their code works properly across platforms.

Arthur


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/eeca8cf6-d0d5-4438-9039-35cd0105b1a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ajedi32

unread,
Jun 17, 2015, 11:25:31 AM6/17/15
to polym...@googlegroups.com
Ah okay, that makes sense. Thanks.
Reply all
Reply to author
Forward
0 new messages