Files
ladybird/Libraries/LibWeb/CSS/Invalidation/CustomElementInvalidator.cpp
Andreas Kling d7f5939e46 LibWeb: Move custom element state invalidation into a helper
Element.cpp still spelled out the :defined pseudo-class invalidation set
when custom element state changed. Move that selector policy into
CustomElementInvalidator.

This keeps Element responsible for the state transition, while
CSS::Invalidation owns the affected selector feature.
2026-04-29 15:47:23 +02:00

26 lines
674 B
C++

/*
* Copyright (c) 2026-present, the Ladybird developers
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/CSS/Invalidation/CustomElementInvalidator.h>
#include <LibWeb/CSS/InvalidationSet.h>
#include <LibWeb/CSS/Selector.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/StyleInvalidationReason.h>
namespace Web::CSS::Invalidation {
void invalidate_style_after_custom_element_state_change(DOM::Element& element)
{
element.invalidate_style(
DOM::StyleInvalidationReason::CustomElementStateChange,
{
{ .type = InvalidationSet::Property::Type::PseudoClass, .value = PseudoClass::Defined },
},
{});
}
}