<?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>16764</bug_id>
          
          <creation_ts>2012-04-17 23:40:29 +0000</creation_ts>
          <short_desc>[Shadow]: host attribute makes it hard to preserve encapsulation</short_desc>
          <delta_ts>2012-04-25 23:21:25 +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>66777</commentid>
    <comment_count>0</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-04-17 23:40:29 +0000</bug_when>
    <thetext>Take this use case: a component wants to provide a place for extension. For example, a video player may put playback controls in Shadow DOM but wants to let scripts add buttons to the controls.

The component could do this:

&lt;!-- play/pause button --&gt;
&lt;div id=&quot;extensionpoint&quot;&gt;&lt;/div&gt;

and implement the extensionPoint attribute as:

this.extensionPoint = new ShadowRoot(controls.querySelector(&apos;#extensionpoint&apos;))

Scripts can access the extensionPoint and add buttons to it, etc.

However the component can’t preserve its own encapsulation, because the extensionPoint.host property will point into the component’s shadow.

One way around this is for the component to do this:

&lt;!-- play/pause button --&gt;
&lt;content select=&quot;.extensions&quot;&gt;&lt;/content&gt;

And the caller writes:

&lt;…&gt;
  &lt;div class=&quot;extensions&quot;&gt;…&lt;/div&gt;
  …

But it seems a shame that we lose the imperative API by having the &quot;host&quot; property. What is it good for?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67088</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-04-25 23:19:10 +0000</bug_when>
    <thetext>Good use case. I will remove .host attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67089</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-04-25 23:21:25 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/webcomponents/rev/57f8cfc4a7dc</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>