[Webkit-unassigned] [Bug 160864] Shadow DOM: Toggling class in `.class ::slotted(*)` does not trigger style recalc

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 11 13:02:52 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=160864

--- Comment #5 from Antti Koivisto <koivisto at iki.fi> ---
(In reply to comment #4)
> Comment on attachment 294518 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=294518&action=review
> 
> > Source/WebCore/css/StyleInvalidationAnalysis.cpp:114
> > +        m_didInvalidateHostChildren = true;
> 
> It seems like we don't need to set m_didInvalidateHostChildren if the slot
> isn't in a shadow tree?
> Or is this a kind of optimization to avoid checking whether element is in
> the shadow tree or not?

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

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

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161111/8ebc14be/attachment.html>


More information about the webkit-unassigned mailing list