mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Reduce recompilation impact of DOM/Element.h
Remove unused/redundant includes from Element.h: - AK/IterationDecision.h (redundant) - ARIA/AttributeNames.h (redundant via ARIAMixin.h) - CSS/CascadedProperties.h (redundant via PseudoElement.h) - CSS/StylePropertyMapReadOnly.h (pointer types only) - HTML/LazyLoadingElement.h (unused in header) Extract IntersectionObserverRegistration struct from IntersectionObserver.h into its own lightweight header. This breaks the heavy transitive include chain through IntersectionObserverEntry.h and Geometry/DOMRect.h that was pulled into every file including Element.h. Indirect recompilation impact reductions: - IntersectionObserver.h: ~1387 -> ~27 files - LazyLoadingElement.h: ~1387 -> ~1002 files
This commit is contained in:
committed by
Alexander Kalenik
parent
30e4779acb
commit
fde2015846
Notes:
github-actions[bot]
2026-02-11 19:03:40 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/fde20158462 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7894
@@ -9,6 +9,7 @@
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/IntersectionObserver/IntersectionObserverEntry.h>
|
||||
#include <LibWeb/IntersectionObserver/IntersectionObserverRegistration.h>
|
||||
#include <LibWeb/PixelUnits.h>
|
||||
|
||||
namespace Web::IntersectionObserver {
|
||||
@@ -22,22 +23,6 @@ struct IntersectionObserverInit {
|
||||
bool track_visibility = false;
|
||||
};
|
||||
|
||||
// https://www.w3.org/TR/intersection-observer/#intersectionobserverregistration
|
||||
struct IntersectionObserverRegistration {
|
||||
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverregistration-observer
|
||||
// [A]n observer property holding an IntersectionObserver.
|
||||
GC::Ref<IntersectionObserver> observer;
|
||||
|
||||
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverregistration-observer
|
||||
// NOTE: Optional is used in place of the spec using -1 to indicate no previous index.
|
||||
// [A] previousThresholdIndex property holding a number between -1 and the length of the observer’s thresholds property (inclusive).
|
||||
Optional<size_t> previous_threshold_index;
|
||||
|
||||
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverregistration-previousisintersecting
|
||||
// [A] previousIsIntersecting property holding a boolean.
|
||||
bool previous_is_intersecting { false };
|
||||
};
|
||||
|
||||
// https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
|
||||
class IntersectionObserver final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(IntersectionObserver, Bindings::PlatformObject);
|
||||
|
||||
Reference in New Issue
Block a user