<?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>17591</bug_id>
          
          <creation_ts>2012-06-25 05:56:55 +0000</creation_ts>
          <short_desc>[Shadow]: Should insertion point nodes have styles?</short_desc>
          <delta_ts>2015-07-06 08:03:39 +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>MOVED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Takashi Sakamoto">tasak</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>dominicc</cc>
    
    <cc>hayato</cc>
    
    <cc>morrita</cc>
    
    <cc>tasak</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69376</commentid>
    <comment_count>0</comment_count>
    <who name="Takashi Sakamoto">tasak</who>
    <bug_when>2012-06-25 05:56:55 +0000</bug_when>
    <thetext>According to the shadow dom spec: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles, insertion point nodes have styles:

- the styles of the insertion point node are inherited by those child nodes of the shadow host that are assigned to this insertion point
- the styles of the shadow insertion point node are inherited by the child nodes of the shadow root of the shadow DOM subtree, distributed to this shadow insertion point

I think, this behavior looks natural for web developers.

However, the spec also says:
&quot;To enable composition of shadow host&apos;s children and the shadow DOM subtree, a notion of insertion points is added to the abstraction. An insertion point is a defined location in the shadow DOM subtree, to which the shadow host&apos;s children are transposed when rendering.&quot;
in http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees

So no insertion point nodes appear in a composed tree. If insertion point nodes have styles and the styles are inherited by distributed nodes, styles of nodes, which are not in a composed tree, will affect rendering result. I think, it looks a little odd.

The following is an example:

&lt;div&gt;
   &lt;span&gt;This is an example.&lt;/span&gt;
&lt;/div&gt;

And a shadow root is attached to the div and the shadow root&apos;s innerHTML is:

&lt;div&gt;!!!!
  &lt;content style=&quot;color: red&quot;&gt;&lt;/content&gt;
!!!!&lt;/div&gt;

What color is the text: &quot;This is an example.&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69382</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-06-25 16:16:08 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; According to the shadow dom spec:
&gt; http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles,
&gt; insertion point nodes have styles:
&gt; 
&gt; - the styles of the insertion point node are inherited by those child nodes of
&gt; the shadow host that are assigned to this insertion point
&gt; - the styles of the shadow insertion point node are inherited by the child
&gt; nodes of the shadow root of the shadow DOM subtree, distributed to this shadow
&gt; insertion point

I think there&apos;s a bug in spec here. What we need to convey is that the styles of the parent of the insertion point are inherited.

&gt; I think, this behavior looks natural for web developers.
&gt; 
&gt; However, the spec also says:
&gt; &quot;To enable composition of shadow host&apos;s children and the shadow DOM subtree, a
&gt; notion of insertion points is added to the abstraction. An insertion point is a
&gt; defined location in the shadow DOM subtree, to which the shadow host&apos;s children
&gt; are transposed when rendering.&quot;
&gt; in
&gt; http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees
&gt; 
&gt; So no insertion point nodes appear in a composed tree. If insertion point nodes
&gt; have styles and the styles are inherited by distributed nodes, styles of nodes,
&gt; which are not in a composed tree, will affect rendering result. I think, it
&gt; looks a little odd.

Right.

&gt; 
&gt; The following is an example:
&gt; 
&gt; &lt;div&gt;
&gt;    &lt;span&gt;This is an example.&lt;/span&gt;
&gt; &lt;/div&gt;
&gt; 
&gt; And a shadow root is attached to the div and the shadow root&apos;s innerHTML is:
&gt; 
&gt; &lt;div&gt;!!!!
&gt;   &lt;content style=&quot;color: red&quot;&gt;&lt;/content&gt;
&gt; !!!!&lt;/div&gt;
&gt; 
&gt; What color is the text: &quot;This is an example.&quot;?

The color should be whatever the color of &lt;div&gt; in the shadow DOM subtree is. style=&quot;color:red&quot; is not used.

However, we could consider that a &lt;content&gt; element does have styles, but has the initial style of display:contents and thus is not rendered. If the developer chooses to surface the &lt;content&gt; element, they could give it a different &quot;display&quot; value. This seems more flexible and less magical. However, we need to have &quot;display:contents&quot; spec&apos;d in CSS first.

Bug 16294 is related to this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69396</commentid>
    <comment_count>2</comment_count>
    <who name="Takashi Sakamoto">tasak</who>
    <bug_when>2012-06-26 10:54:10 +0000</bug_when>
    <thetext>Thank  you for answering.

(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; According to the shadow dom spec:
&gt; &gt; http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles,
&gt; &gt; insertion point nodes have styles:
&gt; &gt; 
&gt; &gt; - the styles of the insertion point node are inherited by those child nodes of
&gt; &gt; the shadow host that are assigned to this insertion point
&gt; &gt; - the styles of the shadow insertion point node are inherited by the child
&gt; &gt; nodes of the shadow root of the shadow DOM subtree, distributed to this shadow
&gt; &gt; insertion point
&gt; 
&gt; I think there&apos;s a bug in spec here. What we need to convey is that the styles
&gt; of the parent of the insertion point are inherited.

I see. 

&gt; &gt; I think, this behavior looks natural for web developers.
&gt; &gt; 
&gt; &gt; However, the spec also says:
&gt; &gt; &quot;To enable composition of shadow host&apos;s children and the shadow DOM subtree, a
&gt; &gt; notion of insertion points is added to the abstraction. An insertion point is a
&gt; &gt; defined location in the shadow DOM subtree, to which the shadow host&apos;s children
&gt; &gt; are transposed when rendering.&quot;
&gt; &gt; in
&gt; &gt; http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees
&gt; &gt; 
&gt; &gt; So no insertion point nodes appear in a composed tree. If insertion point nodes
&gt; &gt; have styles and the styles are inherited by distributed nodes, styles of nodes,
&gt; &gt; which are not in a composed tree, will affect rendering result. I think, it
&gt; &gt; looks a little odd.
&gt; 
&gt; Right.
&gt; 
&gt; &gt; 
&gt; &gt; The following is an example:
&gt; &gt; 
&gt; &gt; &lt;div&gt;
&gt; &gt;    &lt;span&gt;This is an example.&lt;/span&gt;
&gt; &gt; &lt;/div&gt;
&gt; &gt; 
&gt; &gt; And a shadow root is attached to the div and the shadow root&apos;s innerHTML is:
&gt; &gt; 
&gt; &gt; &lt;div&gt;!!!!
&gt; &gt;   &lt;content style=&quot;color: red&quot;&gt;&lt;/content&gt;
&gt; &gt; !!!!&lt;/div&gt;
&gt; &gt; 
&gt; &gt; What color is the text: &quot;This is an example.&quot;?
&gt; 
&gt; The color should be whatever the color of &lt;div&gt; in the shadow DOM subtree is.
&gt; style=&quot;color:red&quot; is not used.

I see. The color of &lt;div&gt;, the parent of the insertion point node, is applied.

&gt; However, we could consider that a &lt;content&gt; element does have styles, but has
&gt; the initial style of display:contents and thus is not rendered. If the
&gt; developer chooses to surface the &lt;content&gt; element, they could give it a
&gt; different &quot;display&quot; value. This seems more flexible and less magical. However,
&gt; we need to have &quot;display:contents&quot; spec&apos;d in CSS first.
&gt; 
&gt; Bug 16294 is related to this.

I will look at the bug.

Best regards,
Takashi Sakamoto</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121629</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-07-06 08:03:39 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcomponents/issues/250</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>