mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 18:47:15 +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
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::IntersectionObserver {
|
||||
|
||||
// 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 };
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user