mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
HTMLInputElement had two call sites spelling out the same checked and unchecked pseudo-class invalidation set. Move that selector policy into FormControlInvalidator. This keeps the input element responsible for detecting state changes, while CSS::Invalidation owns the affected selector features.
26 lines
709 B
C++
26 lines
709 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/CSS/Invalidation/FormControlInvalidator.h>
|
|
#include <LibWeb/CSS/InvalidationSet.h>
|
|
#include <LibWeb/CSS/Selector.h>
|
|
#include <LibWeb/DOM/Element.h>
|
|
|
|
namespace Web::CSS::Invalidation {
|
|
|
|
void invalidate_style_after_checked_state_change(DOM::Element& element, DOM::StyleInvalidationReason reason)
|
|
{
|
|
element.invalidate_style(
|
|
reason,
|
|
{
|
|
{ .type = InvalidationSet::Property::Type::PseudoClass, .value = PseudoClass::Checked },
|
|
{ .type = InvalidationSet::Property::Type::PseudoClass, .value = PseudoClass::Unchecked },
|
|
},
|
|
{});
|
|
}
|
|
|
|
}
|