mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb: Skip unneeded style invalidation on custom element state change
If there are no :defined pseudo-class selectors anywhere in the document, we don't have to invalidate style at all when an element's custom element state changes.
This commit is contained in:
committed by
Andreas Kling
parent
202bf901d7
commit
f45e24864b
@@ -2266,7 +2266,9 @@ void Element::set_custom_element_state(CustomElementState state)
|
||||
if (m_custom_element_state == state)
|
||||
return;
|
||||
m_custom_element_state = state;
|
||||
invalidate_style(StyleInvalidationReason::CustomElementStateChange);
|
||||
|
||||
if (document().style_computer().has_defined_selectors())
|
||||
invalidate_style(StyleInvalidationReason::CustomElementStateChange);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
|
||||
|
||||
Reference in New Issue
Block a user