LibWeb: Move element state style invalidation into a helper

Several HTML element state changes directly selected style invalidation
reasons from their element implementations. Move those mappings into a
new CSS::Invalidation::ElementStateInvalidator helper.

This keeps details, dialog, option, and select code focused on their own
state changes while CSS invalidation owns the style work those changes
require. The existing invalidation breadth is preserved.
This commit is contained in:
Andreas Kling
2026-04-29 12:24:07 +02:00
committed by Alexander Kalenik
parent 79c32f88d2
commit c93dad7600
Notes: github-actions[bot] 2026-04-29 13:49:00 +00:00
7 changed files with 67 additions and 9 deletions

View File

@@ -11,6 +11,7 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/CSSStyleProperties.h>
#include <LibWeb/CSS/ComputedProperties.h>
#include <LibWeb/CSS/Invalidation/ElementStateInvalidator.h>
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
#include <LibWeb/CSS/StyleValues/KeywordStyleValue.h>
#include <LibWeb/DOM/Document.h>
@@ -521,7 +522,7 @@ void HTMLSelectElement::set_is_open(bool open)
return;
m_is_open = open;
invalidate_style(DOM::StyleInvalidationReason::HTMLSelectElementSetIsOpen);
CSS::Invalidation::invalidate_style_after_select_open_state_change(*this);
}
bool HTMLSelectElement::has_activation_behavior() const