Files
ladybird/Libraries/LibWeb/CSS/Invalidation/SlotInvalidator.cpp
Andreas Kling c191d51af1 LibWeb: Move slotted style invalidation into a helper
Slottable.cpp still handled the style invalidation fallout from slot
assignment changes directly. Move that ::slotted()-related policy into
CSS::Invalidation::SlotInvalidator.

Slot assignment remains DOM bookkeeping. The helper now owns the
choice to dirty element slottables when they gain or lose assignment
to a slot.
2026-04-29 15:47:23 +02:00

24 lines
565 B
C++

/*
* Copyright (c) 2026-present, the Ladybird developers
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/CSS/Invalidation/SlotInvalidator.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/Slottable.h>
#include <LibWeb/DOM/Text.h>
namespace Web::CSS::Invalidation {
void invalidate_style_after_slottable_assignment_change(DOM::Slottable const& slottable)
{
slottable.visit(
[](GC::Ref<DOM::Element> const& element) {
element->set_needs_style_update(true);
},
[](GC::Ref<DOM::Text> const&) {});
}
}