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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>103208</bug_id>
          
          <creation_ts>2012-11-25 16:34:39 -0800</creation_ts>
          <short_desc>Don&apos;t use ComposedShadowTreeWalker in NodeRenderingContext when SHADOW_DOM is not enabled</short_desc>
          <delta_ts>2014-05-14 23:12:05 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>103339</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Antti Koivisto">koivisto</reporter>
          <assigned_to name="Antti Koivisto">koivisto</assigned_to>
          <cc>abarth</cc>
    
    <cc>dglazkov</cc>
    
    <cc>eric</cc>
    
    <cc>kenjibaheux</cc>
    
    <cc>kling</cc>
    
    <cc>mjs</cc>
    
    <cc>morrita</cc>
    
    <cc>ojan</cc>
    
    <cc>rniwa</cc>
    
    <cc>sam</cc>
    
    <cc>shinyak</cc>
    
    <cc>webcomponents-bugzilla</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>775046</commentid>
    <comment_count>0</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-25 16:34:39 -0800</bug_when>
    <thetext>It does tons of work that is not needed when SHADOW_DOM is not enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775051</commentid>
    <comment_count>1</comment_count>
      <attachid>175895</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-25 16:45:59 -0800</bug_when>
    <thetext>Created attachment 175895
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775056</commentid>
    <comment_count>2</comment_count>
      <attachid>175895</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2012-11-25 16:50:24 -0800</bug_when>
    <thetext>Comment on attachment 175895
patch

Egads.  I&apos;m not a fan of more #ifdefs, but a 3-4% regression from shadow DOM stuff is clearly not acceptable.  You should file a follow up about the regression, since one day we may need to turn it on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775079</commentid>
    <comment_count>3</comment_count>
      <attachid>175895</attachid>
    <who name="Build Bot">buildbot</who>
    <bug_when>2012-11-25 18:04:17 -0800</bug_when>
    <thetext>Comment on attachment 175895
patch

Attachment 175895 did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14987445

New failing tests:
fast/html/details-add-summary-child-2.html
fast/html/details-add-summary-1.html
fast/html/details-add-details-child-1.html
fast/html/details-add-summary-7.html
fast/html/details-add-summary-5.html
fast/html/details-add-summary-5-and-click.html
fast/html/details-add-summary-6-and-click.html
fast/html/details-add-child-1.html
fast/html/details-add-summary-4.html
fast/html/details-add-summary-6.html
fast/html/details-click-controls.html
fast/html/details-keyboard-show-hide.html
fast/html/details-add-summary-2.html
fast/html/details-add-summary-10.html
fast/html/details-add-summary-10-and-click.html
fast/html/details-add-summary-9.html
fast/html/details-add-child-2.html
fast/block/block-remove-child-delete-line-box-crash.html
fast/html/details-add-details-child-2.html
fast/html/details-add-summary-8-and-click.html
fast/html/details-add-summary-1-and-click.html
fast/html/details-add-summary-2-and-click.html
fast/html/details-add-summary-7-and-click.html
fast/html/details-add-summary-9-and-click.html
fast/events/domactivate-sets-underlying-click-event-as-handled.html
fast/html/details-add-summary-3-and-click.html
fast/html/details-add-summary-4-and-click.html
fast/html/details-add-summary-3.html
fast/html/details-add-summary-child-1.html
fast/html/details-add-summary-8.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775355</commentid>
    <comment_count>4</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-26 04:36:43 -0800</bug_when>
    <thetext>Looks like the internal implementation of the &lt;details&gt; element has been made to depend on a bunch of Web Components features. This is not great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775740</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-11-26 11:53:21 -0800</bug_when>
    <thetext>I suspect morrita is the &lt;details&gt; expert, judging from the revision log: http://trac.webkit.org/log/trunk/Source/WebCore/html/HTMLDetailsElement.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776017</commentid>
    <comment_count>6</comment_count>
    <who name="Hajime Morrita">morrita</who>
    <bug_when>2012-11-26 16:15:17 -0800</bug_when>
    <thetext>Yes, &lt;details&gt; and &lt;summary&gt; uses Shadow DOM internally,
which allowed us to kill a bunch of renderer-side code. 
I agree that the regression here isn&apos;t acceptable though.

Can I take some time to address this? I&apos;ll look into it.
The regression should be killed even if SHADOW_DOM is enabled,
at least eventually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776044</commentid>
    <comment_count>7</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-26 16:27:44 -0800</bug_when>
    <thetext>Web Components code should be fully behind a feature flag like all other experimental features. Platforms that are not interested in this feature shouldn&apos;t need to take the performance and binary size hit from it. Also it is not ok to make other parts of WebKit internals depend on experimental features. The original implementation of &lt;details&gt; did not have such dependency.

The feature define should be renamed to WEB_COMPONENTS or similar. SHADOW_DOM is a bad name as we have tons of internal shadow DOMs that don&apos;t depend on most of this code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776049</commentid>
    <comment_count>8</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-11-26 16:33:15 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Web Components code should be fully behind a feature flag like all other experimental features. Platforms that are not interested in this feature shouldn&apos;t need to take the performance and binary size hit from it. Also it is not ok to make other parts of WebKit internals depend on experimental features. The original implementation of &lt;details&gt; did not have such dependency.
&gt; 
&gt; The feature define should be renamed to WEB_COMPONENTS or similar. SHADOW_DOM is a bad name as we have tons of internal shadow DOMs that don&apos;t depend on most of this code.

In general, I agree with this principle. In this specific case, getting rid of custom renderer code and replacing it with components seems like a big win to me. Every time we write custom renderer code for form controls, it&apos;s a source of a long tail of correctness and security bugs.

Once (if) there is more general buy-in to shipping web components, I think replacing custom renderers with web components is a good direction to go. Maybe making those changes was premature though as it seems Apple doesn&apos;t necessarily want to ship web components?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776161</commentid>
    <comment_count>9</comment_count>
    <who name="Hajime Morrita">morrita</who>
    <bug_when>2012-11-26 18:05:24 -0800</bug_when>
    <thetext>For performance, we should definitely get rid of the regression. I&apos;ll take a look to make this patch work with &lt;details&gt;.

For binary size, it&apos;s infeasible for now to hide whole Shadow DOM things behind a flag. It will result tons of ifdefs and hurts the code readability. Sine it replaces certain renderer implementations, it can taken as a nice-to-have WebCore plumbing. That being said, I agree that some more Shadow DOM/Web Components implementation can be moved behind the flag. That will be tracked by a bug 103339. 

On the flag name, please let us use SHADOW_DOM. The API standard is named like that http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html, and WEB_COMPONENTS sounds too generic anyway. There are other Web Components related APIs like custom dom elements and template .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776323</commentid>
    <comment_count>10</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2012-11-26 21:50:54 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Web Components code should be fully behind a feature flag like all other experimental features. Platforms that are not interested in this feature shouldn&apos;t need to take the performance and binary size hit from it. Also it is not ok to make other parts of WebKit internals depend on experimental features. The original implementation of &lt;details&gt; did not have such dependency.
&gt; 
&gt; The feature define should be renamed to WEB_COMPONENTS or similar. SHADOW_DOM is a bad name as we have tons of internal shadow DOMs that don&apos;t depend on most of this code.

As I mentioned at this year&apos;s WebKit contributors meeting (http://webkitmemes.tumblr.com/image/21402870608), all of our internal shadow DOMs use the same plumbing. It&apos;s all been painfully specified here (http://www.w3.org/TR/shadow-dom/). SHADOW_DOM intentionally guards only the public-facing API, because most of it had been just a reshaping of the existing custom shadow DOM code we keep writing for every darn HTML element. Most of the Shadow DOM spec is just writing down lessons I learned from that refactoring.

Speaking of which, the initial, hard-coded implementation of &lt;details&gt; was so bad that you would&apos;ve cried tears of blood just looking at it. There are lots of tiny details that we figured out and made sure they worked right with insertion points, from accessibility to hit-testing, to event retargeting and rendering. I somehow doubt that there&apos;s a noticeable binary size hit. I&apos;d bet that a proper &lt;details&gt; implementation in itself would&apos;ve been a hefty chunk of code.

I understand your frustration and I totally agree that we should fix the performance regression though. We suck and we should fix it -- and we will. And may Kling create a thousand ghastly memes featuring me and Morrita if we don&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776596</commentid>
    <comment_count>11</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-27 04:02:43 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; For binary size, it&apos;s infeasible for now to hide whole Shadow DOM things behind a flag. It will result tons of ifdefs and hurts the code readability. 

I&apos;m not buying this.

Quick testing showed that with &lt;details&gt; disabled it was fairly trivial and non-invasive to compile out ComposedShadowTreeWalker, HTMLContentElement, HTMLShadowElement, InsertionPoint, ContentDistributor and ContentSelectorQuery. That&apos;s a more than 1k lines of complex code. The rest of the engine seems happy with just ShadowRoot and parts of ElementShadow.

I&apos;m not sure if the cleaner looking &lt;details&gt; implementation is worth the complexity. I suspect it is completely opaque to many WebKit engineers. I spent long time trying to figure out what was going on to make this patch work with &lt;details&gt; and failed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778744</commentid>
    <comment_count>12</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2012-11-28 23:48:54 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Web Components code should be fully behind a feature flag like all other experimental features. Platforms that are not interested in this feature shouldn&apos;t need to take the performance and binary size hit from it. Also it is not ok to make other parts of WebKit internals depend on experimental features. The original implementation of &lt;details&gt; did not have such dependency.
&gt; &gt; 
&gt; &gt; The feature define should be renamed to WEB_COMPONENTS or similar. SHADOW_DOM is a bad name as we have tons of internal shadow DOMs that don&apos;t depend on most of this code.
&gt; 
&gt; In general, I agree with this principle. In this specific case, getting rid of custom renderer code and replacing it with components seems like a big win to me. Every time we write custom renderer code for form controls, it&apos;s a source of a long tail of correctness and security bugs.
&gt; 
&gt; Once (if) there is more general buy-in to shipping web components, I think replacing custom renderers with web components is a good direction to go. Maybe making those changes was premature though as it seems Apple doesn&apos;t necessarily want to ship web components?

I think it was premature. We&apos;re not necessarily opposed to ever shipping web components related code, but since it is still officially an experimental and optional feature, it seems wrong to me that we&apos;re effectively forced to ship large chunks of it in our binary, and to have unrelated features depend on it.

I definitely see the potential, but I&apos;d each port to be able to choose when/if to get on the bandwagon, at least until the WebKit community as a whole decides this is no longer an experimental or optional feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>779273</commentid>
    <comment_count>13</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-29 11:59:39 -0800</bug_when>
    <thetext>I uploaded a WIP patch to bug 103208. Could people actively working on this feature please pick it up?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>779279</commentid>
    <comment_count>14</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2012-11-29 12:00:17 -0800</bug_when>
    <thetext>I mean bug 103654.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>800041</commentid>
    <comment_count>15</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-04 00:53:15 -0800</bug_when>
    <thetext>Attachment 175895 was posted by a committer and has review+, assigning to Antti Koivisto for commit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009460</commentid>
    <comment_count>16</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2014-05-14 23:12:05 -0700</bug_when>
    <thetext>Hue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>175895</attachid>
            <date>2012-11-25 16:45:59 -0800</date>
            <delta_ts>2012-11-25 18:04:17 -0800</delta_ts>
            <desc>patch</desc>
            <filename>shadow-dom-free-noderenderercontext-2.patch</filename>
            <type>text/plain</type>
            <size>8442</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEzNTY3NCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDMzIEBACisyMDEyLTExLTI1ICBBbnR0aSBL
b2l2aXN0byAgPGFudHRpQGFwcGxlLmNvbT4KKworICAgICAgICBEb24ndCB1c2UgQ29tcG9zZWRT
aGFkb3dUcmVlV2Fsa2VyIGluIE5vZGVSZW5kZXJpbmdDb250ZXh0IHdoZW4gU0hBRE9XX0RPTSBp
cyBub3QgZW5hYmxlZAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5j
Z2k/aWQ9MTAzMjA4CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAg
ICAgICAgQ29tcG9zZWRTa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b2RlRm9yUmVuZGVyaW5nQW5kU3R5bGUoKSBjb25zdAogeworI2lmICFF
TkFCTEUoU0hBRE9XX0RPTSkKKyAgICByZXR1cm4gbV9wYXJlbnROb2RlRm9yUmVuZGVyaW5nQW5k
U3R5bGU7CisjZWxzZQogICAgIHJldHVybiBtX3BhcmVudERldGFpbHMubm9kZSgpOworI2VuZGlm
CiB9CiAKIGlubGluZSBib29sIE5vZGVSZW5kZXJpbmdDb250ZXh0OjpyZXNldFN0eWxlSW5oZXJp
dGFuY2UoKSBjb25zdAogeworI2lmICFFTkFCTEUoU0hBRE9XX0RPTSkKKyAgICByZXR1cm4gZmFs
c2U7CisjZWxzZQogICAgIHJldHVybiBtX3BhcmVudERldGFpbHMucmVzZXRTdHlsZUluaGVyaXRh
bmNlKCk7CisjZW5kaWYKIH0KIAogaW5saW5lIGNvbnN0IFJlbmRlclN0eWxlKiBOb2RlUmVuZGVy
aW5nQ29udGV4dDo6c3R5bGUoKSBjb25zdApAQCAtOTcsNyArMTA5LDExIEBAIGlubGluZSBjb25z
dCBSZW5kZXJTdHlsZSogTm9kZVJlbmRlcmluZ0MKIAogaW5saW5lIEluc2VydGlvblBvaW50KiBO
b2RlUmVuZGVyaW5nQ29udGV4dDo6aW5zZXJ0aW9uUG9pbnQoKSBjb25zdAogeworI2lmICFFTkFC
TEUoU0hBRE9XX0RPTSkKKyAgICByZXR1cm4gMDsKKyNlbHNlCiAgICAgcmV0dXJuIG1fcGFyZW50
RGV0YWlscy5pbnNlcnRpb25Qb2ludCgpOworI2VuZGlmCiB9CiAKIH0gLy8gbmFtZXNwYWNlIFdl
YkNvcmUK
</data>
<flag name="review"
          id="191499"
          type_id="1"
          status="+"
          setter="sam"
    />
    <flag name="commit-queue"
          id="191515"
          type_id="3"
          status="-"
          setter="buildbot"
    />
          </attachment>
      

    </bug>

</bugzilla>