This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
<script> is different eg to <base>, which only belongs in <head>. I think it should be a goal of the spec that someone can take a subtree of HTML, slap it into a ShadowRoot, and have everything "work" provided that the subtree is a component (ie scoping selectors and ids is OK; stopping scripts running is not.)
(In reply to comment #0) > <script> is different eg to <base>, which only belongs in <head>. I think it > should be a goal of the spec that someone can take a subtree of HTML, slap it > into a ShadowRoot, and have everything "work" provided that the subtree is a > component (ie scoping selectors and ids is OK; stopping scripts running is > not.) In this example: http://jsfiddle.net/QkNDP/ The script runs when d is appended to the document.body. Similarly, if we script was not inert in shadow DOM subtrees, it would run as soon as we appended it. That doesn't seem useful, but perhaps I am worrying about this too much?
http://dvcs.w3.org/hg/webcomponents/rev/18c8d3fd081f
With reference to http://jsfiddle.net/QkNDP/ the behavior I think is desirable is: var s = document.createElement('script'); s.textContent = 'alert(1);'; var d = d.createElement('div'); var r = new ShadowRoot(d); r.appendChild(s); document.body.appendChild(d); // script runs at this point My reading of the spec was that script in shadow DOM subtrees was *always* inert, regardless of whether the "outermost host" is in the document or not. As specified, what would the behavior be? Should I file another bug to clarify this?
(In reply to comment #2) > http://dvcs.w3.org/hg/webcomponents/rev/18c8d3fd081f I removed <script> from inert list here ^^^ Does that work?