<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Updating class name of a shadow host does not update the style applied by :host()"
   href="https://bugs.webkit.org/show_bug.cgi?id=158900#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Updating class name of a shadow host does not update the style applied by :host()"
   href="https://bugs.webkit.org/show_bug.cgi?id=158900">bug 158900</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=281623&amp;action=diff" name="attach_281623" title="Patch">attachment 281623</a> <a href="attachment.cgi?id=281623&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/WebCore/style/AttributeChangeInvalidation.cpp:42
&gt; +    if (shadowRuleSets.authorStyle()-&gt;hostPseudoClassRules().isEmpty())
&gt; +        return false;</span >

Is there a solid guarantee that authorStyle is non-null? I noticed this pattern repeating in the code so the question applies not just here but at many other sites too.

<span class="quote">&gt; Source/WebCore/style/AttributeChangeInvalidation.cpp:61
&gt; +    auto* shadowRoot = m_element.shadowRoot();
&gt; +    if (shadowRoot &amp;&amp; mayBeAffectedByHostStyle(*shadowRoot, isHTML, attributeName))
&gt; +        mayAffectStyle = true;</span >

Can we skip this work if mayAffectStyle is already true?

<span class="quote">&gt; Source/WebCore/style/ClassChangeInvalidation.cpp:108
&gt; +        if (shadowRoot &amp;&amp; mayBeAffectedByHostStyle(*shadowRoot, changedClass))
&gt; +            mayAffectStyle = true;</span >

Can we skip this work if mayAffectStyle is already true?

<span class="quote">&gt; Source/WebCore/style/IdChangeInvalidation.cpp:57
&gt; +    auto* shadowRoot = m_element.shadowRoot();
&gt; +    if (shadowRoot &amp;&amp; mayBeAffectedByHostStyle(*shadowRoot, changedId))
&gt; +        mayAffectStyle = true;</span >

Can we skip this work if mayAffectStyle is already true?</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>