<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Shadow DOM: Toggling class in `.class ::slotted(*)` does not trigger style recalc"
   href="https://bugs.webkit.org/show_bug.cgi?id=160864#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Shadow DOM: Toggling class in `.class ::slotted(*)` does not trigger style recalc"
   href="https://bugs.webkit.org/show_bug.cgi?id=160864">bug 160864</a>
              from <span class="vcard"><a class="email" href="mailto:koivisto&#64;iki.fi" title="Antti Koivisto &lt;koivisto&#64;iki.fi&gt;"> <span class="fn">Antti Koivisto</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=160864#c4">comment #4</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=294518&amp;action=diff" name="attach_294518" title="patch">attachment 294518</a> <a href="attachment.cgi?id=294518&amp;action=edit" title="patch">[details]</a></span>
&gt; patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=294518&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=294518&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/css/StyleInvalidationAnalysis.cpp:114
&gt; &gt; +        m_didInvalidateHostChildren = true;
&gt; 
&gt; It seems like we don't need to set m_didInvalidateHostChildren if the slot
&gt; isn't in a shadow tree?
&gt; Or is this a kind of optimization to avoid checking whether element is in
&gt; the shadow tree or not?</span >

It is used to avoid O(slots*host children) traversal if there are tons of slots/children.

<span class="quote">&gt; Don't we need to check the descendants of a 2nd, 3rd, etc... slot elements?
&gt; i.e. don't we need to check just
&gt; !m_ruleSet.slottedPseudoElementRules().isEmpty()?
&gt; Put it another way, does this work if a single shadow root had multiple slots
&gt; each of which had to be invalidated?</span >

It works because we invalidate all host children when we find the first slot. I don't think optimising more is important at this point.</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>