<?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>17023</bug_id>
          
          <creation_ts>2012-05-10 08:09:15 +0000</creation_ts>
          <short_desc>[Shadow]: Clarify how insertion points behave when they are shadow hosts</short_desc>
          <delta_ts>2012-07-27 22:37:36 +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>INVALID</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>18428</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hayato Ito">hayato</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>dominicc</cc>
    
    <cc>shinyak</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67545</commentid>
    <comment_count>0</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-10 08:09:15 +0000</bug_when>
    <thetext>What should happen if a shadow root is attached to &lt;content&gt; (or &lt;shadow&gt;) elements?

According to the current spec, such insertion points select nodes, but these distributed nodes are not used in rendering. Instead, a shadow subree of InsertionPoint is used in rendering.

This is correct interpretation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67580</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-05-10 18:16:57 +0000</bug_when>
    <thetext>This is a very good question. Since we explicitly say that the insertion points are not rendered (not just their contents), it&apos;s not obvious what the behavior should be when you add a shadow DOM subtree to an insertion point.

We need to fix this bug in spec.

My inclination is to spec it the way WebKit implements it now: you can certainly add a shadow DOM subtree to an insertion point, but you will never be able to see it, since the insertion point itself is never rendered.

WDYT?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67591</commentid>
    <comment_count>2</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-05-11 01:20:21 +0000</bug_when>
    <thetext>That interpretation sounds good to me.

Is it worth specifying what happens when you have a &lt;content&gt; element outside of Shadow DOM (ie not an insertion point) with a ShadowRoot? And what happens when it gets moved inside the ShadowRoot?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67592</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-11 01:55:12 +0000</bug_when>
    <thetext>+shinyak

As we discussed this with shinyak, we don&apos;t have any intentional explicit code which handles this case in current WebKit implementation. So just adapting the way WebKit implement is not appropriate.

I don&apos;t have any clear idea about which should be done in this case. IMO, my first interpretation is the best for us now if we don&apos;t have any alternative idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67593</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-05-11 01:56:49 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; +shinyak
&gt; 
&gt; As we discussed this with shinyak, we don&apos;t have any intentional explicit code
&gt; which handles this case in current WebKit implementation. So just adapting the
&gt; way WebKit implement is not appropriate.
&gt; 
&gt; I don&apos;t have any clear idea about which should be done in this case. IMO, my
&gt; first interpretation is the best for us now if we don&apos;t have any alternative
&gt; idea.

Which one is the first idea?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67594</commentid>
    <comment_count>5</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-05-11 01:58:28 +0000</bug_when>
    <thetext>It doesn’t matter if what WebKit does is deliberate or not… I believe it is just being an example of what the semantics should be.

I don’t like the suggested behavior in Comment 1 (if I understand it.) It seems inconsistent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67597</commentid>
    <comment_count>6</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-11 04:40:11 +0000</bug_when>
    <thetext>In the current WebKit implementation:
  1. A shadow root attached to InsertionPoint is simply ignored and not used at all. InsertionPoints still works as InsertionPoint.
  2. We don&apos;t throw any exception when attaching a shadowRoot to insertionPoints.

For 1). it sounds reasonable for me.
For 2). It might be worth discussing whether we should throw exception or not.

(In reply to comment #5)
&gt; It doesn’t matter if what WebKit does is deliberate or not… I believe it is
&gt; just being an example of what the semantics should be.
&gt; 
&gt; I don’t like the suggested behavior in Comment 1 (if I understand it.) It seems
&gt; inconsistent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67598</commentid>
    <comment_count>7</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-11 04:54:00 +0000</bug_when>
    <thetext>Note that I&apos;ve used a *active* InsertionPoint.
For inactive InsertionPoints, attaching a ShadowRoot does take effect.

(In reply to comment #6)
&gt; In the current WebKit implementation:
&gt;   1. A shadow root attached to InsertionPoint is simply ignored and not used at
&gt; all. InsertionPoints still works as InsertionPoint.
&gt;   2. We don&apos;t throw any exception when attaching a shadowRoot to
&gt; insertionPoints.
&gt; 
&gt; For 1). it sounds reasonable for me.
&gt; For 2). It might be worth discussing whether we should throw exception or not.
&gt; 
&gt; (In reply to comment #5)
&gt; &gt; It doesn’t matter if what WebKit does is deliberate or not… I believe it is
&gt; &gt; just being an example of what the semantics should be.
&gt; &gt; 
&gt; &gt; I don’t like the suggested behavior in Comment 1 (if I understand it.) It seems
&gt; &gt; inconsistent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67599</commentid>
    <comment_count>8</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-05-11 04:56:50 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; In the current WebKit implementation:
&gt;   1. A shadow root attached to InsertionPoint is simply ignored and not used at
&gt; all. InsertionPoints still works as InsertionPoint.

It&apos;s not ignored. Things just work exactly as expected. Since an active insertion point is not rendered, there&apos;s no way to render shadow dom subtree. It could totally be created and operated on. It&apos;s just never rendered.

&gt;   2. We don&apos;t throw any exception when attaching a shadowRoot to
&gt; insertionPoints.

Why would we throw an exception? It&apos;s similar to throwing an exception when you&apos;re trying to append a child to an element with style &quot;display:none&quot;.

&gt; 
&gt; For 1). it sounds reasonable for me.
&gt; For 2). It might be worth discussing whether we should throw exception or not.
&gt; 
&gt; (In reply to comment #5)
&gt; &gt; It doesn’t matter if what WebKit does is deliberate or not… I believe it is
&gt; &gt; just being an example of what the semantics should be.
&gt; &gt; 
&gt; &gt; I don’t like the suggested behavior in Comment 1 (if I understand it.) It seems
&gt; &gt; inconsistent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67600</commentid>
    <comment_count>9</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-05-11 05:04:40 +0000</bug_when>
    <thetext>I think we should not throw an exception, because we still have to deal with this case anyway:

&lt;content id=&quot;a&quot;&gt;
&lt;div id=&quot;b&quot;&gt;
&lt;script&gt;
var a = document.querySelector(&apos;#a&apos;);
var b = document.querySelector(&apos;#b&apos;);
var t = new ShadowRoot(a);
var u = new ShadowRoot(b);
a.parentNode.removeChild(a);
u.appendChild(a);
&lt;/script&gt;

ie the ShadowRoot could be attached when the insertion point is inactive, and the insertion point could become active later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67601</commentid>
    <comment_count>10</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-11 05:10:57 +0000</bug_when>
    <thetext>It seems you guys gave me comment when I was writing the followings: :)

My suggestions are:

- For active InsertionPoints, attached ShadowRoots should not be used.
- For inactive InsertionPoint, attached ShadowRoots should take effect.
- It is okay to attach a ShadowRoot to either active or inactive InsertionPoints.
- It is okay to move a InsertionPoint inside the ShadowRoot or outside the
ShadowRoot. That might change its active/inactive status, but that should not
get rid of its attached ShadowRoots.


(In reply to comment #9)
&gt; I think we should not throw an exception, because we still have to deal with
&gt; this case anyway:
&gt; 
&gt; &lt;content id=&quot;a&quot;&gt;
&gt; &lt;div id=&quot;b&quot;&gt;
&gt; &lt;script&gt;
&gt; var a = document.querySelector(&apos;#a&apos;);
&gt; var b = document.querySelector(&apos;#b&apos;);
&gt; var t = new ShadowRoot(a);
&gt; var u = new ShadowRoot(b);
&gt; a.parentNode.removeChild(a);
&gt; u.appendChild(a);
&gt; &lt;/script&gt;
&gt; 
&gt; ie the ShadowRoot could be attached when the insertion point is inactive, and
&gt; the insertion point could become active later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67603</commentid>
    <comment_count>11</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-11 05:16:09 +0000</bug_when>
    <thetext>So we don&apos;t have to change the current WebKit implementaton at all.

(In reply to comment #10)
&gt; It seems you guys gave me comment when I was writing the followings: :)
&gt; 
&gt; My suggestions are:
&gt; 
&gt; - For active InsertionPoints, attached ShadowRoots should not be used.
&gt; - For inactive InsertionPoint, attached ShadowRoots should take effect.
&gt; - It is okay to attach a ShadowRoot to either active or inactive
&gt; InsertionPoints.
&gt; - It is okay to move a InsertionPoint inside the ShadowRoot or outside the
&gt; ShadowRoot. That might change its active/inactive status, but that should not
&gt; get rid of its attached ShadowRoots.
&gt; 
&gt; 
&gt; (In reply to comment #9)
&gt; &gt; I think we should not throw an exception, because we still have to deal with
&gt; &gt; this case anyway:
&gt; &gt; 
&gt; &gt; &lt;content id=&quot;a&quot;&gt;
&gt; &gt; &lt;div id=&quot;b&quot;&gt;
&gt; &gt; &lt;script&gt;
&gt; &gt; var a = document.querySelector(&apos;#a&apos;);
&gt; &gt; var b = document.querySelector(&apos;#b&apos;);
&gt; &gt; var t = new ShadowRoot(a);
&gt; &gt; var u = new ShadowRoot(b);
&gt; &gt; a.parentNode.removeChild(a);
&gt; &gt; u.appendChild(a);
&gt; &gt; &lt;/script&gt;
&gt; &gt; 
&gt; &gt; ie the ShadowRoot could be attached when the insertion point is inactive, and
&gt; &gt; the insertion point could become active later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67604</commentid>
    <comment_count>12</comment_count>
    <who name="Shinya Kawanaka">shinyak</who>
    <bug_when>2012-05-11 05:18:24 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; It seems you guys gave me comment when I was writing the followings: :)
&gt; 
&gt; My suggestions are:
&gt; 
&gt; - For active InsertionPoints, attached ShadowRoots should not be used.
&gt; - For inactive InsertionPoint, attached ShadowRoots should take effect.
&gt; - It is okay to attach a ShadowRoot to either active or inactive
&gt; InsertionPoints.
&gt; - It is okay to move a InsertionPoint inside the ShadowRoot or outside the
&gt; ShadowRoot. That might change its active/inactive status, but that should not
&gt; get rid of its attached ShadowRoots.
&gt; 

The first bullet:
&gt; For active InsertionPoints, attached ShadowRoots should not be used.
means:
  the ShadowRoot will not be rendered, 
  and the distribution algorithm for InsertionPoints will run,
right?

If so, I think these suggestions make sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67605</commentid>
    <comment_count>13</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-05-11 05:22:25 +0000</bug_when>
    <thetext>Yes, 

&gt; - For active InsertionPoints, attached ShadowRoots should not be used.

&apos;Should&apos; might be confusing, the correct sentence is:

For active InsertionPoints, distributed nodes (if exist) are rendered. The InsertionPoint element itself is not rendered. As a result, its attached shadow roots are not used.


(In reply to comment #12)
&gt; (In reply to comment #10)
&gt; &gt; It seems you guys gave me comment when I was writing the followings: :)
&gt; &gt; 
&gt; &gt; My suggestions are:
&gt; &gt; 
&gt; &gt; - For active InsertionPoints, attached ShadowRoots should not be used.
&gt; &gt; - For inactive InsertionPoint, attached ShadowRoots should take effect.
&gt; &gt; - It is okay to attach a ShadowRoot to either active or inactive
&gt; &gt; InsertionPoints.
&gt; &gt; - It is okay to move a InsertionPoint inside the ShadowRoot or outside the
&gt; &gt; ShadowRoot. That might change its active/inactive status, but that should not
&gt; &gt; get rid of its attached ShadowRoots.
&gt; &gt; 
&gt; 
&gt; The first bullet:
&gt; &gt; For active InsertionPoints, attached ShadowRoots should not be used.
&gt; means:
&gt;   the ShadowRoot will not be rendered, 
&gt;   and the distribution algorithm for InsertionPoints will run,
&gt; right?
&gt; 
&gt; If so, I think these suggestions make sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71630</commentid>
    <comment_count>14</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-07-27 22:37:36 +0000</bug_when>
    <thetext>I let this slip through. Sorry!

Post-discussion, it appears that no changes are necessary to the spec. Right? If I am wrong, please re-open.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>