Changeset 270300 in webkit
- Timestamp:
- Dec 1, 2020 9:14:28 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-script-disabled-iframe-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLIFrameElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLImageElement.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r270296 r270300 1 2020-12-01 Rob Buis <rbuis@igalia.com> 2 3 Lazy loaded iframe should not lazy load when scripting is disabled 4 https://bugs.webkit.org/show_bug.cgi?id=217315 5 6 Reviewed by Darin Adler. 7 8 Update improved test expectation. 9 10 * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-script-disabled-iframe-expected.txt: 11 1 12 2020-12-01 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-script-disabled-iframe-expected.txt
r269598 r270300 1 1 2 2 3 FAILIframes with loading='lazy' in script disabled iframe are not handled4 as 'lazy' promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'inner_iframe.contentDocument.body')"3 PASS Iframes with loading='lazy' in script disabled iframe are not handled 4 as 'lazy' 5 5 -
trunk/Source/WebCore/ChangeLog
r270297 r270300 1 2020-12-01 Rob Buis <rbuis@igalia.com> 2 3 Lazy loaded iframe should not lazy load when scripting is disabled 4 https://bugs.webkit.org/show_bug.cgi?id=217315 5 6 Reviewed by Darin Adler. 7 8 Lazy loaded iframe should not lazy load when scripting is disabled [1]. 9 10 Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-script-disabled-iframe.html 11 12 [1] https://html.spec.whatwg.org/#will-lazy-load-element-steps 13 14 This matches Chrome and Firefox. 15 16 * html/HTMLIFrameElement.cpp: 17 (WebCore::isFrameLazyLoadable): 18 (WebCore::HTMLIFrameElement::shouldLoadFrameLazily): 19 * html/HTMLImageElement.cpp: 20 (WebCore::HTMLImageElement::isLazyLoadable const): 21 1 22 2020-12-01 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> 2 23 -
trunk/Source/WebCore/html/HTMLIFrameElement.cpp
r266991 r270300 165 165 } 166 166 167 static bool isFrameLazyLoadable(const URL& completeURL, const AtomString& loadingAttributeValue)167 static bool isFrameLazyLoadable(const Document& document, const URL& completeURL, const AtomString& loadingAttributeValue) 168 168 { 169 169 if (!completeURL.protocolIsInHTTPFamily()) 170 170 return false; 171 171 172 if (!document.frame() || !document.frame()->script().canExecuteScripts(NotAboutToExecuteScript)) 173 return false; 174 172 175 return equalLettersIgnoringASCIICase(loadingAttributeValue, "lazy"); 173 176 } … … 177 180 if (!m_lazyLoadFrameObserver && document().settings().lazyIframeLoadingEnabled()) { 178 181 URL completeURL = document().completeURL(frameURL()); 179 if (isFrameLazyLoadable( completeURL, attributeWithoutSynchronization(HTMLNames::loadingAttr))) {182 if (isFrameLazyLoadable(document(), completeURL, attributeWithoutSynchronization(HTMLNames::loadingAttr))) { 180 183 auto currentReferrerPolicy = referrerPolicy(); 181 184 lazyLoadFrameObserver().observe(completeURL.string(), currentReferrerPolicy); -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r269155 r270300 871 871 bool HTMLImageElement::isLazyLoadable() const 872 872 { 873 if ( document().frame() &&!document().frame()->script().canExecuteScripts(NotAboutToExecuteScript))873 if (!document().frame() || !document().frame()->script().canExecuteScripts(NotAboutToExecuteScript)) 874 874 return false; 875 875 return hasLazyLoadableAttributeValue(attributeWithoutSynchronization(HTMLNames::loadingAttr));
Note: See TracChangeset
for help on using the changeset viewer.