<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Factor style sharing code out of StyleResolver"
   href="https://bugs.webkit.org/show_bug.cgi?id=153768#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Factor style sharing code out of StyleResolver"
   href="https://bugs.webkit.org/show_bug.cgi?id=153768">bug 153768</a>
              from <span class="vcard"><a class="email" href="mailto:rniwa&#64;webkit.org" title="Ryosuke Niwa &lt;rniwa&#64;webkit.org&gt;"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=270435&amp;action=diff" name="attach_270435" title="patch">attachment 270435</a> <a href="attachment.cgi?id=270435&amp;action=edit" title="patch">[details]</a></span>
patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=270435&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=270435&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/style/StyleSharingResolver.cpp:50
&gt; +    EInsideLink elementLinkState;</span >

Should we lazily compute this value to avoid looking up the hash table proactively?

<span class="quote">&gt; Source/WebCore/style/StyleSharingResolver.cpp:77
&gt; +    if (!element.parentElement())
&gt; +        return nullptr;</span >

You no longer check the existence of parent style.  Is that expected?

<span class="quote">&gt; Source/WebCore/style/StyleSharingResolver.cpp:362
&gt; +    for (unsigned i = 0; i &lt; classNames.size(); ++i) {</span >

Should we store classNames.size() in a local variable instead?

<span class="quote">&gt; Source/WebCore/style/StyleSharingResolver.h:46
&gt; +    const Element* searchSimilar(const Element&amp;) const;</span >

I got confused by this name because it sounded as if we need to do further verification to make sure we can share a style with it.
How about &quot;findStyleSharableElement&quot; or &quot;findElementToShareStyle&quot;?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>