1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

LibWeb: Flesh out implementation of ResizeObserver interfaces

Adds the initial implementation for interfaces defined in the
ResizeObserver specification. These interfaces will be used to
construct and send observation events in the upcoming changes.
This commit is contained in:
Aliaksandr Kalenik 2024-02-19 05:06:39 +01:00 committed by Andreas Kling
parent fb4c632309
commit fb8edcea00
15 changed files with 494 additions and 13 deletions

View file

@ -525,6 +525,9 @@ public:
void register_intersection_observer(Badge<IntersectionObserver::IntersectionObserver>, IntersectionObserver::IntersectionObserver&);
void unregister_intersection_observer(Badge<IntersectionObserver::IntersectionObserver>, IntersectionObserver::IntersectionObserver&);
void register_resize_observer(Badge<ResizeObserver::ResizeObserver>, ResizeObserver::ResizeObserver&);
void unregister_resize_observer(Badge<ResizeObserver::ResizeObserver>, ResizeObserver::ResizeObserver&);
void run_the_update_intersection_observations_steps(HighResolutionTime::DOMHighResTimeStamp time);
void start_intersection_observing_a_lazy_loading_element(Element&);
@ -782,6 +785,8 @@ private:
// Each Document has a lazy load intersection observer, initially set to null but can be set to an IntersectionObserver instance.
JS::GCPtr<IntersectionObserver::IntersectionObserver> m_lazy_load_intersection_observer;
Vector<JS::NonnullGCPtr<ResizeObserver::ResizeObserver>> m_resize_observers;
// https://html.spec.whatwg.org/multipage/semantics.html#will-declaratively-refresh
// A Document object has an associated will declaratively refresh (a boolean). It is initially false.
bool m_will_declaratively_refresh { false };