mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
LibWeb: Implement loading=lazy
for <img>
elements
This commit is contained in:
parent
165abafb80
commit
71f6e5c942
4 changed files with 113 additions and 4 deletions
|
@ -493,6 +493,8 @@ public:
|
|||
|
||||
void run_the_update_intersection_observations_steps(HighResolutionTime::DOMHighResTimeStamp time);
|
||||
|
||||
void start_intersection_observing_a_lazy_loading_element(Element& element);
|
||||
|
||||
protected:
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
@ -670,6 +672,10 @@ private:
|
|||
// https://www.w3.org/TR/intersection-observer/#document-intersectionobservertaskqueued
|
||||
// Each document has an IntersectionObserverTaskQueued flag which is initialized to false.
|
||||
bool m_intersection_observer_task_queued { false };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#lazy-load-intersection-observer
|
||||
// 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;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue