<?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>28591</bug_id>
          
          <creation_ts>2015-05-01 17:22:53 +0000</creation_ts>
          <short_desc>[Shadow]: Figure out a good replacement for /deep/ in testing scenarios</short_desc>
          <delta_ts>2015-05-27 02:53:38 +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>
          
          <blocked>14978</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dimitri Glazkov">dglazkov</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>annevk</cc>
    
    <cc>esprehn</cc>
    
    <cc>hayato</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>120033</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2015-05-01 17:22:53 +0000</bug_when>
    <thetext>One thing that immediately popped up once we started talking about removing shadow-piercing combinators is that WebDriver-based tests are frequently interested in reaching into shadow trees to grab a specific element to test:

https://code.google.com/p/chromium/codesearch#chromium/src/chrome/test/chromedriver/test/run_py_tests.py&amp;sq=package:chromium&amp;q=testShadowDom*&amp;l=877

Web Driver actually has something currently that attempts to solve the problem: http://www.w3.org/TR/webdriver/#switching-to-hosted-shadow-doms

However, the feedback I got from ChromeDriver folks is that it&apos;s way too verbose and awkward to use for the most common case  (see above).

Maybe the solution is just specifying deepQuerySelector for WebDriver spec. However, I want to make sure this is not just a one-off -- seems like this could be needed in other contexts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120043</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-05-02 07:34:03 +0000</bug_when>
    <thetext>1) We shouldn&apos;t do features for testing. That&apos;s bad.

2) I remain convinced that in the open case we should provide a myriad of features that cross the &quot;deep&quot; to aid with selection, event delegation, composition, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120048</commentid>
    <comment_count>2</comment_count>
    <who name="Elliott Sprehn">esprehn</who>
    <bug_when>2015-05-03 00:41:03 +0000</bug_when>
    <thetext>(In reply to Anne from comment #1)
&gt; 1) We shouldn&apos;t do features for testing. That&apos;s bad.
&gt; 
&gt; 2) I remain convinced that in the open case we should provide a myriad of
&gt; features that cross the &quot;deep&quot; to aid with selection, event delegation,
&gt; composition, etc.

+1, we should keep /deep/ in the static profile for querySelector. Before we had it authors kept rolling their own (we saw this on multiple occasions).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120056</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-05-04 06:12:37 +0000</bug_when>
    <thetext>Note that an alternative is that we introduce .deepQuery() or some such.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120057</commentid>
    <comment_count>4</comment_count>
    <who name="Elliott Sprehn">esprehn</who>
    <bug_when>2015-05-04 06:21:02 +0000</bug_when>
    <thetext>(In reply to Anne from comment #3)
&gt; Note that an alternative is that we introduce .deepQuery() or some such.

deepQuery is not enough, you don&apos;t want to match a descendant selector across a ShadowRoot boundary since &quot;.a .b&quot; means something really different. You&apos;d still need a special combinator to signal where the scope crossing should be in the selector expression.

ex.
.panel .image

All images inside panels contained in a single scope.

.panel /deep/ .image

All images anywhere below a panel, even if they&apos;re inside a nested widget.

This is important because it maintains the &quot;don&apos;t accidentally cross a boundary&quot; principle.

We need something like ::shadow as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120069</commentid>
    <comment_count>5</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2015-05-05 00:12:16 +0000</bug_when>
    <thetext>(In reply to Elliott Sprehn from comment #4)
&gt; (In reply to Anne from comment #3)
&gt; &gt; Note that an alternative is that we introduce .deepQuery() or some such.
&gt; 
&gt; deepQuery is not enough, you don&apos;t want to match a descendant selector
&gt; across a ShadowRoot boundary since &quot;.a .b&quot; means something really different.
&gt; You&apos;d still need a special combinator to signal where the scope crossing
&gt; should be in the selector expression.
&gt; 
&gt; ex.
&gt; .panel .image
&gt; 
&gt; All images inside panels contained in a single scope.
&gt; 
&gt; .panel /deep/ .image
&gt; 
&gt; All images anywhere below a panel, even if they&apos;re inside a nested widget.
&gt; 
&gt; This is important because it maintains the &quot;don&apos;t accidentally cross a
&gt; boundary&quot; principle.

Yeah, trying to move the shadow-crossing quality to the core of the method doesn&apos;t work.  It&apos;s much less flexible, as you note, and doesn&apos;t compose with anything else similar.  The correct approach is to just embrace the &quot;static profile&quot; of selectors &lt;http://dev.w3.org/csswg/selectors/#static-profile&gt; and leave /deep/ there.  (Or &gt;&gt;&gt;, as it&apos;s now called.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120221</commentid>
    <comment_count>6</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-05-07 08:43:56 +0000</bug_when>
    <thetext>
(In reply to Tab Atkins Jr. from comment #5)
&gt; (In reply to Elliott Sprehn from comment #4)
&gt; &gt; (In reply to Anne from comment #3)
&gt; &gt; &gt; Note that an alternative is that we introduce .deepQuery() or some such.
&gt; &gt; 
&gt; &gt; deepQuery is not enough, you don&apos;t want to match a descendant selector
&gt; &gt; across a ShadowRoot boundary since &quot;.a .b&quot; means something really different.
&gt; &gt; You&apos;d still need a special combinator to signal where the scope crossing
&gt; &gt; should be in the selector expression.
&gt; &gt; 
&gt; &gt; ex.
&gt; &gt; .panel .image
&gt; &gt; 
&gt; &gt; All images inside panels contained in a single scope.
&gt; &gt; 
&gt; &gt; .panel /deep/ .image
&gt; &gt; 
&gt; &gt; All images anywhere below a panel, even if they&apos;re inside a nested widget.
&gt; &gt; 
&gt; &gt; This is important because it maintains the &quot;don&apos;t accidentally cross a
&gt; &gt; boundary&quot; principle.
&gt; 
&gt; Yeah, trying to move the shadow-crossing quality to the core of the method
&gt; doesn&apos;t work.  It&apos;s much less flexible, as you note, and doesn&apos;t compose
&gt; with anything else similar.  The correct approach is to just embrace the
&gt; &quot;static profile&quot; of selectors
&gt; &lt;http://dev.w3.org/csswg/selectors/#static-profile&gt; and leave /deep/ there. 
&gt; (Or &gt;&gt;&gt;, as it&apos;s now called.)

Is there any existing clients who use *static-profile*?
Does it mean &apos;/deep/&apos; can be used in particular APIs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120224</commentid>
    <comment_count>7</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2015-05-07 15:55:04 +0000</bug_when>
    <thetext>(In reply to Hayato Ito from comment #6)
&gt; Is there any existing clients who use *static-profile*?
&gt; Does it mean &apos;/deep/&apos; can be used in particular APIs?

It&apos;s for querySelector()/etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120226</commentid>
    <comment_count>8</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-05-08 02:25:11 +0000</bug_when>
    <thetext>(In reply to Tab Atkins Jr. from comment #7)
&gt; (In reply to Hayato Ito from comment #6)
&gt; &gt; Is there any existing clients who use *static-profile*?
&gt; &gt; Does it mean &apos;/deep/&apos; can be used in particular APIs?
&gt; 
&gt; It&apos;s for querySelector()/etc.

Thanks.

Can everyone agree that &apos;/deep/&apos; is okay to be used in querySelector()?

I think we are assuming that adding something to static profile is zero-overhead to the performance of dynamic profile.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120238</commentid>
    <comment_count>9</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2015-05-08 17:29:16 +0000</bug_when>
    <thetext>(In reply to Hayato Ito from comment #8)
&gt; (In reply to Tab Atkins Jr. from comment #7)
&gt; &gt; (In reply to Hayato Ito from comment #6)
&gt; &gt; &gt; Is there any existing clients who use *static-profile*?
&gt; &gt; &gt; Does it mean &apos;/deep/&apos; can be used in particular APIs?
&gt; &gt; 
&gt; &gt; It&apos;s for querySelector()/etc.
&gt; 
&gt; Thanks.
&gt; 
&gt; Can everyone agree that &apos;/deep/&apos; is okay to be used in querySelector()?
&gt; 
&gt; I think we are assuming that adding something to static profile is
&gt; zero-overhead to the performance of dynamic profile.

Correct. At worst, it&apos;s a check during grammar verification, to note that this isn&apos;t valid in the current context and so the selector should be considered grammar-violating.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120502</commentid>
    <comment_count>10</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-05-27 02:53:38 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcomponents/issues/78</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>