mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
Document.cpp contained the CSS rule-cache matching used to decide which elements need style updates when hover, focus, or target state changes. Move that logic into CSS::Invalidation::PseudoClassInvalidator. Document still owns the current state slots and chooses when a state transition happens. The helper now owns the selector matching and recursive invalidation pass for those pseudo-class transitions.
26 lines
654 B
C++
26 lines
654 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGC/Ptr.h>
|
|
#include <LibWeb/CSS/Selector.h>
|
|
|
|
namespace Web::DOM {
|
|
|
|
class Document;
|
|
class Element;
|
|
class Node;
|
|
|
|
}
|
|
|
|
namespace Web::CSS::Invalidation {
|
|
|
|
void invalidate_style_after_pseudo_class_state_change(CSS::PseudoClass, DOM::Document&, GC::Ptr<DOM::Node>& state_slot, DOM::Node& invalidation_root, GC::Ptr<DOM::Node> new_state);
|
|
void invalidate_style_after_pseudo_class_state_change(CSS::PseudoClass, DOM::Document&, GC::Ptr<DOM::Element>& state_slot, DOM::Node& invalidation_root, GC::Ptr<DOM::Element> new_state);
|
|
|
|
}
|