How do I traverse up out of shadow dom?

javascript, polymer, shadow-dom

Solution

You can use `shadowRoot.host` to give you the `<div>`. Likewise, `div.shadowRoot` would get you the div's shadow root.

Problem

I have a structure: ``` <div> #shadow-root <span> ``` How do I reference the `div` from the `span`? `span.parentNode` is the `#shadow-root`, and `.parentNode` from that is `null`

Original source