Implement HTML video and audio element lazy-loading via the loading attribute#29
Closed
credod wants to merge 1 commit intoSquarespace:mainfrom
Conversation
…ttribute https://bugs.webkit.org/show_bug.cgi?id=303995 Reviewed by NOBODY (OOPS!). Implement proposed loading attribute for video and audio elements. This patch implements a proposed loading attribute for video and audio elements, enabling lazy loading of media sources and video poster images, and deferring autoplay. This change is proposed to be added to the HTML spec in the following PR: whatwg/html#11980 This patch is passing video and audio WPT tests from the following PR: web-platform-tests/wpt#57051 * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/dom/Document.cpp: (WebCore::Document::lazyLoadMediaObserver): * Source/WebCore/dom/Document.h: * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didMoveToNewDocument): (WebCore::HTMLMediaElement::attributeChanged): (WebCore::HTMLMediaElement::didFinishInsertingNode): (WebCore::HTMLMediaElement::removedFromAncestor): (WebCore::HTMLMediaElement::hasLazyLoadableAttributeValue): (WebCore::HTMLMediaElement::isLazyLoadable const): (WebCore::HTMLMediaElement::loadDeferredMedia): (WebCore::HTMLMediaElement::resumeLazyLoadingIfNeeded): (WebCore::HTMLMediaElement::loading const): (WebCore::HTMLMediaElement::setLoading): (WebCore::HTMLMediaElement::play): (WebCore::HTMLMediaElement::sourceWasAdded): (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): * Source/WebCore/html/HTMLMediaElement.h: * Source/WebCore/html/HTMLMediaElement.idl: * Source/WebCore/html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::rendererIsNeeded): (WebCore::HTMLVideoElement::supportsFullscreen const): (WebCore::HTMLVideoElement::hasAvailableVideoFrame const): (WebCore::HTMLVideoElement::webkitEnterFullscreen): (WebCore::HTMLVideoElement::loadDeferredMedia): * Source/WebCore/html/HTMLVideoElement.h: * Source/WebCore/html/LazyLoadMediaObserver.cpp: Added. (WebCore::LazyLoadMediaObserver::observe): (WebCore::LazyLoadMediaObserver::unobserve): (WebCore::LazyLoadMediaObserver::intersectionObserver): (WebCore::LazyLoadMediaObserver::isObserved const): * Source/WebCore/html/LazyLoadMediaObserver.h: Added. * Source/WebCore/html/parser/HTMLParserOptions.cpp: * Source/WebCore/html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): * Source/WebCore/html/shadow/DataListButtonElement.cpp: * Source/WebCore/html/shadow/SpinButtonElement.cpp: * Source/WebCore/loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): (WebCore::ImageLoader::didUpdateCachedImage): (WebCore::ImageLoader::notifyFinished): (WebCore::ImageLoader::updatedHasPendingEvent): (WebCore::ImageLoader::decode):
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
59d3992