On Sat, Nov 21, 2015 at 3:30 PM Darin Hensley <[email protected]>
wrote:
> var toolbar = Polymer.dom(document).querySelector('#main-toolbar'
>
> -------------------------
>
> var toolbar = document.querySelector('#main-toolbar');
>
> --------------------------
>
> <paper-toolbar id="main-toolbar">
>
>
> 1) why does `document.querySelector` work on `paper-toolbar` when it's a
> shadow dom element? or another way to put it... why does it work on a
> element that is in local dom?
>
Shady DOM doesn't offer proper scoping of DOM like native Shadow DOM does.
It's a limitation of the polyfill. The full web components polyfill did.
> 2) since both of these `querySelector` work, which is better to use?
>
If you're outside of a Polymer element in the main document, use
document.querySelector('#main-toolbar');. The only time you need the
Polymer.dom() APIs is if you're in an element.
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/07285585-7722-4dcd-9c8a-feaf1b196448%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/07285585-7722-4dcd-9c8a-feaf1b196448%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/CACGqRCDKoXVx8Kd-cB0SFXwz_oNyXmBCgZW0taw%3DZBa0_aFhjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.