mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
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.
24 lines
565 B
C++
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&) {});
|
|
}
|
|
|
|
}
|