<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>15514</bug_id>
          
          <creation_ts>2012-01-11 07:40:32 +0000</creation_ts>
          <short_desc>[Shadow]: &lt;script&gt; in shadow trees should not be inert</short_desc>
          <delta_ts>2012-01-13 21:20:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14978</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dominic Cooney">dominicc</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62528</commentid>
    <comment_count>0</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-01-11 07:40:32 +0000</bug_when>
    <thetext>&lt;script&gt; is different eg to &lt;base&gt;, which only belongs in &lt;head&gt;. 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 &quot;work&quot; provided that the subtree is a component (ie scoping selectors and ids is OK; stopping scripts running is not.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62565</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-01-11 19:06:47 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; &lt;script&gt; is different eg to &lt;base&gt;, which only belongs in &lt;head&gt;. I think it
&gt; should be a goal of the spec that someone can take a subtree of HTML, slap it
&gt; into a ShadowRoot, and have everything &quot;work&quot; provided that the subtree is a
&gt; component (ie scoping selectors and ids is OK; stopping scripts running is
&gt; 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&apos;t seem useful, but perhaps I am worrying about this too much?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62622</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-01-12 22:27:01 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/webcomponents/rev/18c8d3fd081f</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62647</commentid>
    <comment_count>3</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-01-13 04:35:21 +0000</bug_when>
    <thetext>With reference to http://jsfiddle.net/QkNDP/ the behavior I think is desirable is:

var s = document.createElement(&apos;script&apos;);
s.textContent = &apos;alert(1);&apos;;
var d = d.createElement(&apos;div&apos;);
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 &quot;outermost host&quot; is in the document or not.

As specified, what would the behavior be? Should I file another bug to clarify this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62689</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-01-13 21:20:00 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; http://dvcs.w3.org/hg/webcomponents/rev/18c8d3fd081f

I removed &lt;script&gt; from inert list here ^^^

Does that work?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>