Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 81b89faa3dd4b64e1ab775f72993a1da3484036f
https://github.com/WebKit/WebKit/commit/81b89faa3dd4b64e1ab775f72993a1da3484036f
Author: credod <[email protected]>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-horizontal-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-2-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-3-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-5-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-expected.txt
M Source/WebCore/Modules/model-element/HTMLModelElement.cpp
M Source/WebCore/Modules/model-element/HTMLModelElement.h
R Source/WebCore/Modules/model-element/LazyLoadModelObserver.cpp
R Source/WebCore/Modules/model-element/LazyLoadModelObserver.h
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/dom/Document.cpp
M Source/WebCore/dom/Document.h
M Source/WebCore/html/HTMLIFrameElement.cpp
M Source/WebCore/html/HTMLIFrameElement.h
M Source/WebCore/html/HTMLImageElement.cpp
M Source/WebCore/html/HTMLImageElement.h
M Source/WebCore/html/HTMLVideoElement.cpp
M Source/WebCore/html/HTMLVideoElement.h
A Source/WebCore/html/LazyLoadElementObserver.cpp
A Source/WebCore/html/LazyLoadElementObserver.h
R Source/WebCore/html/LazyLoadFrameObserver.cpp
R Source/WebCore/html/LazyLoadFrameObserver.h
R Source/WebCore/html/LazyLoadImageObserver.cpp
R Source/WebCore/html/LazyLoadImageObserver.h
R Source/WebCore/html/LazyLoadVideoObserver.cpp
R Source/WebCore/html/LazyLoadVideoObserver.h
M Source/WebCore/loader/ImageLoader.cpp
Log Message:
-----------
Consolidate lazy load observers
https://bugs.webkit.org/show_bug.cgi?id=309078
Reviewed by Simon Fraser.
Consolidates LazyLoadImageObserver, LazyLoadVideoObserver,
LazyLoadFrameObserver, and LazyLoadModelObserver to a single
LazyLoadElementObserver.
The test progressions assert that a lazy-loaded iframe nested inside a
scrollable container does load once it's near the edge of that scroller.
Before this PR, `LazyLoadFrameObserver` used a strict 0-margin
`IntersectionObserver` for iframes (no `scrollMargin` at all), so on
WPE these tests never actually loaded the iframe in time, so the wrong
behavior was checked in as the accepted baseline. This PR intentionally
unifies iframes onto the same "100%" scrollMargin `IntersectionObserver`
used for images/video/model, which is the spec-correct behavior.
That means the iframe now correctly loads early and the test passes its
real assertion.
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-horizontal-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-2-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-3-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-5-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-scroller-nested-expected.txt:
* Source/WebCore/Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::~HTMLModelElement):
(WebCore::HTMLModelElement::model const):
(WebCore::HTMLModelElement::stop):
(WebCore::HTMLModelElement::insertionSteps):
(WebCore::HTMLModelElement::removingSteps):
(WebCore::HTMLModelElement::lazyLoadIntersectionCallbackInvoked):
(WebCore::HTMLModelElement::viewportIntersectionChanged): Deleted.
* Source/WebCore/Modules/model-element/HTMLModelElement.h:
* Source/WebCore/Modules/model-element/LazyLoadModelObserver.cpp: Removed.
* Source/WebCore/Modules/model-element/LazyLoadModelObserver.h: Removed.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::commonTeardown):
(WebCore::Document::lazyLoadElementObserver):
(WebCore::Document::lazyLoadImageObserver): Deleted.
(WebCore::Document::lazyLoadModelObserver): Deleted.
(WebCore::Document::lazyLoadVideoObserver): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::attributeChanged):
(WebCore::HTMLIFrameElement::referrerPolicy const):
(WebCore::HTMLIFrameElement::shouldLoadFrameLazily):
(WebCore::HTMLIFrameElement::isLazyLoadObserverActive const):
(WebCore::HTMLIFrameElement::loadDeferredFrame):
(WebCore::HTMLIFrameElement::lazyLoadIntersectionCallbackInvoked):
(WebCore::HTMLIFrameElement::lazyLoadFrameObserver): Deleted.
* Source/WebCore/html/HTMLIFrameElement.h:
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::lazyLoadIntersectionCallbackInvoked):
* Source/WebCore/html/HTMLImageElement.h:
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::~HTMLVideoElement):
(WebCore::HTMLVideoElement::create):
(WebCore::HTMLVideoElement::didMoveToNewDocument):
(WebCore::HTMLVideoElement::lazyLoadIntersectionCallbackInvoked):
(WebCore::HTMLVideoElement::viewportIntersectionChanged): Deleted.
* Source/WebCore/html/HTMLVideoElement.h:
* Source/WebCore/html/LazyLoadElementObserver.cpp: Renamed from
Source/WebCore/html/LazyLoadImageObserver.cpp.
(WebCore::LazyLoadElementObserver::observe):
(WebCore::LazyLoadElementObserver::unobserve):
(WebCore::LazyLoadElementObserver::intersectionObserver):
(WebCore::LazyLoadElementObserver::isObserved const):
* Source/WebCore/html/LazyLoadElementObserver.h: Renamed from
Source/WebCore/html/LazyLoadImageObserver.h.
* Source/WebCore/html/LazyLoadFrameObserver.cpp: Removed.
* Source/WebCore/html/LazyLoadFrameObserver.h: Removed.
* Source/WebCore/html/LazyLoadVideoObserver.cpp: Removed.
* Source/WebCore/html/LazyLoadVideoObserver.h: Removed.
* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::didUpdateCachedImage):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::resetLazyImageLoading):
Canonical link: https://commits.webkit.org/321761@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications