Changeset 246045 in webkit
- Timestamp:
- Jun 3, 2019 1:49:53 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 32 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246040 r246045 1 2019-06-03 Rob Buis <rbuis@igalia.com> 2 3 Implement imagesrcset and imagesizes attributes on link rel=preload 4 https://bugs.webkit.org/show_bug.cgi?id=192950 5 6 Reviewed by Youenn Fablet. 7 8 Write special expectation for link-header-preload-imagesrcset.html because test runner 9 uses different dimensions on iOS. 10 11 * platform/ios-simulator-12-wk2/imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset-expected.txt: Added. 12 * platform/ios-simulator-12-wk2/imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset-expected.txt: Added. 13 1 14 2019-06-03 Yusuke Suzuki <ysuzuki@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/ChangeLog
r245966 r246045 1 2019-06-03 Rob Buis <rbuis@igalia.com> 2 3 Implement imagesrcset and imagesizes attributes on link rel=preload 4 https://bugs.webkit.org/show_bug.cgi?id=192950 5 6 Reviewed by Youenn Fablet. 7 8 Import relevant tests for this feature. 9 10 * web-platform-tests/preload/dynamic-adding-preload-imagesrcset-expected.txt: Added. 11 * web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html: Added. 12 * web-platform-tests/preload/link-header-preload-expected.txt: Added. 13 * web-platform-tests/preload/link-header-preload-imagesrcset-expected.txt: Added. 14 * web-platform-tests/preload/link-header-preload-imagesrcset.html: Added. 15 * web-platform-tests/preload/link-header-preload-imagesrcset.html.headers: Added. 16 * web-platform-tests/preload/link-header-preload-nonce-expected.txt: Added. 17 * web-platform-tests/preload/link-header-preload-nonce.html: Added. 18 * web-platform-tests/preload/link-header-preload-nonce.html.headers: Added. 19 * web-platform-tests/preload/link-header-preload.html: Added. 20 * web-platform-tests/preload/link-header-preload.html.headers: Added. 21 * web-platform-tests/preload/onload-event-expected.txt: Added. 22 * web-platform-tests/preload/onload-event.html: Added. 23 * web-platform-tests/preload/preload-csp.sub-expected.txt: 24 * web-platform-tests/preload/preload-csp.sub.html: 25 * web-platform-tests/preload/preload-default-csp.sub-expected.txt: 26 * web-platform-tests/preload/preload-default-csp.sub.html: 27 * web-platform-tests/preload/preload-with-type-expected.txt: Added. 28 * web-platform-tests/preload/preload-with-type.html: Added. 29 * web-platform-tests/preload/resources/A4.ogv: Added. 30 * web-platform-tests/preload/resources/A4.ogv.sub.headers: Added. 31 * web-platform-tests/preload/resources/cross-origin-module.py: Added. 32 (main): 33 * web-platform-tests/preload/resources/dummy-preloads-subresource.css: Added. 34 * web-platform-tests/preload/resources/dummy-preloads-subresource.css.sub.headers: Added. 35 * web-platform-tests/preload/resources/empty.html: Added. 36 * web-platform-tests/preload/resources/empty.html.sub.headers: Added. 37 * web-platform-tests/preload/resources/foo.vtt.sub.headers: Added. 38 * web-platform-tests/preload/resources/module1.js: Added. 39 * web-platform-tests/preload/resources/module2.js: Added. 40 * web-platform-tests/preload/resources/preload_helper.js: 41 (verifyNumberOfResourceTimingEntries): 42 (numberOfResourceTimingEntries): 43 1 44 2019-05-31 Joonghun Park <jh718.park@samsung.com> 2 45 -
trunk/LayoutTests/imported/w3c/web-platform-tests/preload/preload-csp.sub-expected.txt
r245825 r246045 13 13 CONSOLE MESSAGE: Refused to load http://localhost:8800/preload/resources/sound_5.oga because it does not appear in the media-src directive of the Content Security Policy. 14 14 CONSOLE MESSAGE: Refused to load http://localhost:8800/preload/resources/foo.vtt because it does not appear in the media-src directive of the Content Security Policy. 15 CONSOLE MESSAGE: line 1 6: <link rel=preload> must have a valid `as` value16 CONSOLE MESSAGE: line 1 7: <link rel=preload> must have a valid `as` value15 CONSOLE MESSAGE: line 14: <link rel=preload> must have a valid `as` value 16 CONSOLE MESSAGE: line 15: <link rel=preload> must have a valid `as` value 17 17 18 18 PASS Makes sure that preload requests respect CSP -
trunk/LayoutTests/imported/w3c/web-platform-tests/preload/preload-csp.sub.html
r245825 r246045 1 1 <!DOCTYPE html> 2 2 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; font-src 'none'; style-src 'none'; img-src 'none'; media-src 'none'; connect-src 'none'"> 3 <title>Makes sure that preload requests respect CSP</title> 3 4 <script src="/resources/testharness.js"></script> 4 5 <script src="/resources/testharnessreport.js"></script> 5 6 <script src="/preload/resources/preload_helper.js"></script> 6 <script>7 var t = async_test('Makes sure that preload requests respect CSP');8 </script>9 7 <link rel=preload href="{{host}}:{{ports[http][1]}}/preload/resources/dummy.js" as=style> 10 8 <link rel=preload href="resources/dummy.css" as=style> … … 18 16 <body> 19 17 <script> 20 window.onload = t.step_func(function() { 21 t.step_timeout(function() { 22 verifyPreloadAndRTSupport(); 18 setup({explicit_done: true}); 19 20 var iterations = 0; 21 22 function check_finished() { 23 if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && 24 numberOfResourceTimingEntries("resources/dummy.css") == 0 && 25 numberOfResourceTimingEntries("resources/square.png") == 0 && 26 numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && 27 numberOfResourceTimingEntries("resources/white.mp4") == 0 && 28 numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && 29 numberOfResourceTimingEntries("resources/foo.vtt") == 0 && 30 numberOfResourceTimingEntries("resources/dummy.xml") == 0) { 31 done(); 32 } 33 iterations++; 34 if (iterations == 10) { 35 // At least one is expected to fail, but this should give details to the exact failure(s). 23 36 verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); 24 37 verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); … … 29 42 verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); 30 43 verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); 31 t.done(); 32 }, 5000); 44 done(); 45 } else { 46 step_timeout(check_finished, 500); 47 } 48 } 49 50 window.addEventListener("load", function() { 51 verifyPreloadAndRTSupport(); 52 step_timeout(check_finished, 500); 33 53 }); 34 54 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/preload/preload-default-csp.sub-expected.txt
r245825 r246045 13 13 CONSOLE MESSAGE: Refused to load http://localhost:8800/preload/resources/sound_5.oga because it appears in neither the media-src directive nor the default-src directive of the Content Security Policy. 14 14 CONSOLE MESSAGE: Refused to load http://localhost:8800/preload/resources/foo.vtt because it appears in neither the media-src directive nor the default-src directive of the Content Security Policy. 15 CONSOLE MESSAGE: line 1 6: <link rel=preload> must have a valid `as` value16 CONSOLE MESSAGE: line 1 7: <link rel=preload> must have a valid `as` value15 CONSOLE MESSAGE: line 14: <link rel=preload> must have a valid `as` value 16 CONSOLE MESSAGE: line 15: <link rel=preload> must have a valid `as` value 17 17 18 18 PASS Makes sure that preload requests respect CSP -
trunk/LayoutTests/imported/w3c/web-platform-tests/preload/preload-default-csp.sub.html
r245825 r246045 1 1 <!DOCTYPE html> 2 2 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; default-src 'none'"> 3 <title>Makes sure that preload requests respect CSP</title> 3 4 <script src="/resources/testharness.js"></script> 4 5 <script src="/resources/testharnessreport.js"></script> 5 6 <script src="/preload/resources/preload_helper.js"></script> 6 <script>7 var t = async_test('Makes sure that preload requests respect CSP');8 </script>9 7 <link rel=preload href="{{host}}:{{ports[http][1]}}/preload/resources/dummy.js" as=style> 10 8 <link rel=preload href="resources/dummy.css" as=style> … … 18 16 <body> 19 17 <script> 20 window.onload = t.step_func(function() { 21 t.step_timeout(function() { 22 verifyPreloadAndRTSupport(); 18 setup({explicit_done: true}); 19 20 var iterations = 0; 21 22 function check_finished() { 23 if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && 24 numberOfResourceTimingEntries("resources/dummy.css") == 0 && 25 numberOfResourceTimingEntries("resources/square.png") == 0 && 26 numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && 27 numberOfResourceTimingEntries("resources/white.mp4") == 0 && 28 numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && 29 numberOfResourceTimingEntries("resources/foo.vtt") == 0 && 30 numberOfResourceTimingEntries("resources/dummy.xml") == 0) { 31 done(); 32 } 33 iterations++; 34 if (iterations == 10) { 35 // At least one is expected to fail, but this should give details to the exact failure(s). 23 36 verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); 24 37 verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); … … 29 42 verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); 30 43 verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); 31 t.done(); 32 }, 5000); 44 done(); 45 } else { 46 step_timeout(check_finished, 500); 47 } 48 } 49 50 window.addEventListener("load", function() { 51 verifyPreloadAndRTSupport(); 52 step_timeout(check_finished, 500); 33 53 }); 34 54 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/preload/resources/preload_helper.js
r245825 r246045 13 13 function verifyNumberOfResourceTimingEntries(url, number) 14 14 { 15 var numEntries = performance.getEntriesByName(getAbsoluteURL(url)).length; 16 assert_equals(numEntries, number, url); 15 assert_equals(numberOfResourceTimingEntries(url), number, url); 16 } 17 18 function numberOfResourceTimingEntries(url) 19 { 20 return performance.getEntriesByName(getAbsoluteURL(url)).length; 17 21 } 18 22 -
trunk/Source/WebCore/ChangeLog
r246043 r246045 1 2019-06-03 Rob Buis <rbuis@igalia.com> 2 3 Implement imagesrcset and imagesizes attributes on link rel=preload 4 https://bugs.webkit.org/show_bug.cgi?id=192950 5 6 Reviewed by Youenn Fablet. 7 8 Implement imagesrcset and imagesizes attributes for both Link header 9 and link element. 10 11 Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html 12 imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html 13 imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html 14 imported/w3c/web-platform-tests/preload/link-header-preload.html 15 imported/w3c/web-platform-tests/preload/onload-event.html 16 imported/w3c/web-platform-tests/preload/preload-with-type.html 17 18 * html/HTMLAttributeNames.in: 19 * html/HTMLLinkElement.cpp: 20 (WebCore::HTMLLinkElement::process): 21 * html/HTMLLinkElement.idl: 22 * loader/LinkHeader.cpp: 23 (WebCore::paramterNameFromString): 24 (WebCore::LinkHeader::setValue): 25 (WebCore::LinkHeader::LinkHeader): 26 * loader/LinkHeader.h: 27 (WebCore::LinkHeader::imageSrcSet const): 28 (WebCore::LinkHeader::imageSizes const): 29 (WebCore::LinkHeader::isViewportDependent const): 30 * loader/LinkLoader.cpp: 31 (WebCore::LinkLoader::loadLinksFromHeader): 32 (WebCore::LinkLoader::preloadIfNeeded): 33 (WebCore::LinkLoader::loadLink): 34 * loader/LinkLoader.h: 35 * page/RuntimeEnabledFeatures.h: 36 (WebCore::RuntimeEnabledFeatures::linkPreloadResponsiveImagesEnabled const): 37 (WebCore::RuntimeEnabledFeatures::setLinkPreloadResponsiveImagesEnabled): 38 1 39 2019-06-02 Andy Estes <aestes@apple.com> 2 40 -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r245825 r246045 145 145 http_equiv 146 146 id 147 imagesizes 148 imagesrcset 147 149 incremental 148 150 indeterminate -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r245825 r246045 263 263 URL url = getNonEmptyURLAttribute(hrefAttr); 264 264 265 if (!m_linkLoader.loadLink(m_relAttribute, url, attributeWithoutSynchronization(asAttr), attributeWithoutSynchronization(mediaAttr), attributeWithoutSynchronization(typeAttr), attributeWithoutSynchronization(crossoriginAttr), document()))265 if (!m_linkLoader.loadLink(m_relAttribute, url, attributeWithoutSynchronization(asAttr), attributeWithoutSynchronization(mediaAttr), attributeWithoutSynchronization(typeAttr), attributeWithoutSynchronization(crossoriginAttr), attributeWithoutSynchronization(imagesrcsetAttr), attributeWithoutSynchronization(imagesizesAttr), document())) 266 266 return; 267 267 -
trunk/Source/WebCore/html/HTMLLinkElement.idl
r245825 r246045 36 36 [CEReactions=NotNeeded] attribute DOMString as; 37 37 [CEReactions=NotNeeded] attribute DOMString? crossOrigin; 38 [CEReactions=NotNeeded, Reflect, EnabledAtRuntime=LinkPreloadResponsiveImages] attribute DOMString imageSrcset; 39 [CEReactions=NotNeeded, Reflect, EnabledAtRuntime=LinkPreloadResponsiveImages] attribute DOMString imageSizes; 38 40 39 41 // DOM Level 2 Style -
trunk/Source/WebCore/loader/LinkHeader.cpp
r245825 r246045 166 166 if (equalLettersIgnoringASCIICase(name, "as")) 167 167 return LinkHeader::LinkParameterAs; 168 if (equalLettersIgnoringASCIICase(name, "imagesrcset")) 169 return LinkHeader::LinkParameterImageSrcSet; 170 if (equalLettersIgnoringASCIICase(name, "imagesizes")) 171 return LinkHeader::LinkParameterImageSizes; 168 172 return LinkHeader::LinkParameterUnknown; 169 173 } … … 265 269 } 266 270 267 void LinkHeader::setValue(LinkParameterName name, String value)271 void LinkHeader::setValue(LinkParameterName name, String&& value) 268 272 { 269 273 switch (name) { 270 274 case LinkParameterRel: 271 275 if (!m_rel) 272 m_rel = value;276 m_rel = WTFMove(value); 273 277 break; 274 278 case LinkParameterAnchor: … … 276 280 break; 277 281 case LinkParameterCrossOrigin: 278 m_crossOrigin = value;282 m_crossOrigin = WTFMove(value); 279 283 break; 280 284 case LinkParameterAs: 281 m_as = value;285 m_as = WTFMove(value); 282 286 break; 283 287 case LinkParameterType: 284 m_mimeType = value;288 m_mimeType = WTFMove(value); 285 289 break; 286 290 case LinkParameterMedia: 287 m_media = value; 291 m_media = WTFMove(value); 292 break; 293 case LinkParameterImageSrcSet: 294 m_imageSrcSet = WTFMove(value); 295 break; 296 case LinkParameterImageSizes: 297 m_imageSizes = WTFMove(value); 288 298 break; 289 299 case LinkParameterTitle: … … 337 347 } 338 348 339 setValue(parameterName, parameterValue);349 setValue(parameterName, WTFMove(parameterValue)); 340 350 } 341 351 findNextHeader(position, end); -
trunk/Source/WebCore/loader/LinkHeader.h
r245825 r246045 42 42 const String& media() const { return m_media; } 43 43 const String& crossOrigin() const { return m_crossOrigin; } 44 const String& imageSrcSet() const { return m_imageSrcSet; } 45 const String& imageSizes() const { return m_imageSizes; } 44 46 bool valid() const { return m_isValid; } 47 bool isViewportDependent() const { return !media().isEmpty() || !imageSrcSet().isEmpty() || !imageSizes().isEmpty(); } 45 48 46 49 enum LinkParameterName { … … 56 59 LinkParameterCrossOrigin, 57 60 LinkParameterAs, 61 LinkParameterImageSrcSet, 62 LinkParameterImageSizes, 58 63 }; 59 64 60 65 private: 61 void setValue(LinkParameterName, String value);66 void setValue(LinkParameterName, String&& value); 62 67 63 68 String m_url; … … 67 72 String m_media; 68 73 String m_crossOrigin; 74 String m_imageSrcSet; 75 String m_imageSizes; 69 76 bool m_isValid { true }; 70 77 }; -
trunk/Source/WebCore/loader/LinkLoader.cpp
r245825 r246045 45 45 #include "FrameLoaderClient.h" 46 46 #include "FrameView.h" 47 #include "HTMLSrcsetParser.h" 47 48 #include "LinkHeader.h" 48 49 #include "LinkPreloadResourceClients.h" … … 50 51 #include "LoaderStrategy.h" 51 52 #include "MIMETypeRegistry.h" 53 #include "MediaList.h" 52 54 #include "MediaQueryEvaluator.h" 53 55 #include "PlatformStrategies.h" … … 55 57 #include "RuntimeEnabledFeatures.h" 56 58 #include "Settings.h" 59 #include "SizesAttributeParser.h" 57 60 #include "StyleResolver.h" 58 61 … … 98 101 if (!header.valid() || header.url().isEmpty() || header.rel().isEmpty()) 99 102 continue; 100 if ((mediaAttributeCheck == MediaAttributeCheck::MediaAttributeNotEmpty && header.media().isEmpty())101 || (mediaAttributeCheck == MediaAttributeCheck::MediaAttributeEmpty && !header.media().isEmpty())) {103 if ((mediaAttributeCheck == MediaAttributeCheck::MediaAttributeNotEmpty && !header.isViewportDependent()) 104 || (mediaAttributeCheck == MediaAttributeCheck::MediaAttributeEmpty && header.isViewportDependent())) { 102 105 continue; 103 106 } … … 109 112 continue; 110 113 preconnectIfNeeded(relAttribute, url, document, header.crossOrigin()); 111 preloadIfNeeded(relAttribute, url, document, header.as(), header.media(), header.mimeType(), header.crossOrigin(), nullptr);114 preloadIfNeeded(relAttribute, url, document, header.as(), header.media(), header.mimeType(), header.crossOrigin(), header.imageSrcSet(), header.imageSizes(), nullptr); 112 115 } 113 116 } … … 228 231 } 229 232 230 std::unique_ptr<LinkPreloadResourceClient> LinkLoader::preloadIfNeeded(const LinkRelAttribute& relAttribute, const URL& href, Document& document, const String& as, const String& media, const String& mimeType, const String& crossOriginMode, LinkLoader* loader)233 std::unique_ptr<LinkPreloadResourceClient> LinkLoader::preloadIfNeeded(const LinkRelAttribute& relAttribute, const URL& href, Document& document, const String& as, const String& media, const String& mimeType, const String& crossOriginMode, const String& imageSrcSet, const String& imageSizes, LinkLoader* loader) 231 234 { 232 235 if (!document.loader() || !relAttribute.isLinkPreload) … … 234 237 235 238 ASSERT(RuntimeEnabledFeatures::sharedFeatures().linkPreloadEnabled()); 236 if (!href.isValid()) {237 document.addConsoleMessage(MessageSource::Other, MessageLevel::Error, "<link rel=preload> has an invalid `href` value"_s);238 return nullptr;239 }240 239 auto type = LinkLoader::resourceTypeFromAsAttribute(as); 241 240 if (!type) { … … 243 242 return nullptr; 244 243 } 244 URL url; 245 if (RuntimeEnabledFeatures::sharedFeatures().linkPreloadResponsiveImagesEnabled() && type == CachedResource::Type::ImageResource && !imageSrcSet.isEmpty()) { 246 auto sourceSize = SizesAttributeParser(imageSizes, document).length(); 247 auto candidate = bestFitSourceForImageAttributes(document.deviceScaleFactor(), href.string(), imageSrcSet, sourceSize); 248 url = document.completeURL(URL({ }, candidate.string.toString())); 249 } else 250 url = document.completeURL(href); 251 252 if (!url.isValid()) { 253 if (imageSrcSet.isEmpty()) 254 document.addConsoleMessage(MessageSource::Other, MessageLevel::Error, "<link rel=preload> has an invalid `href` value"_s); 255 else 256 document.addConsoleMessage(MessageSource::Other, MessageLevel::Error, "<link rel=preload> has an invalid `imagesrcset` value"_s); 257 return nullptr; 258 } 245 259 if (!MediaQueryEvaluator::mediaAttributeMatches(document, media)) 246 260 return nullptr; … … 249 263 250 264 auto options = CachedResourceLoader::defaultCachedResourceOptions(); 251 auto linkRequest = createPotentialAccessControlRequest( document.completeURL(href), document, crossOriginMode, WTFMove(options));265 auto linkRequest = createPotentialAccessControlRequest(url, document, crossOriginMode, WTFMove(options)); 252 266 linkRequest.setPriority(CachedResource::defaultPriorityForResourceType(type.value())); 253 267 linkRequest.setInitiator("link"); … … 300 314 } 301 315 302 bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const URL& href, const String& as, const String& media, const String& mimeType, const String& crossOrigin, Document& document)316 bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const URL& href, const String& as, const String& media, const String& mimeType, const String& crossOrigin, const String& imageSrcSet, const String& imageSizes, Document& document) 303 317 { 304 318 if (relAttribute.isDNSPrefetch) { … … 312 326 313 327 if (m_client.shouldLoadLink()) { 314 auto resourceClient = preloadIfNeeded(relAttribute, href, document, as, media, mimeType, crossOrigin, this);328 auto resourceClient = preloadIfNeeded(relAttribute, href, document, as, media, mimeType, crossOrigin, imageSrcSet, imageSizes, this); 315 329 if (m_preloadResourceClient) 316 330 m_preloadResourceClient->clear(); -
trunk/Source/WebCore/loader/LinkLoader.h
r245825 r246045 51 51 virtual ~LinkLoader(); 52 52 53 bool loadLink(const LinkRelAttribute&, const URL&, const String& as, const String& media, const String& type, const String& crossOrigin, Document&);53 bool loadLink(const LinkRelAttribute&, const URL&, const String& as, const String& media, const String& type, const String& crossOrigin, const String& imageSrcSet, const String& imageSizes, Document&); 54 54 static Optional<CachedResource::Type> resourceTypeFromAsAttribute(const String& as); 55 55 … … 64 64 void notifyFinished(CachedResource&) override; 65 65 static void preconnectIfNeeded(const LinkRelAttribute&, const URL& href, Document&, const String& crossOrigin); 66 static std::unique_ptr<LinkPreloadResourceClient> preloadIfNeeded(const LinkRelAttribute&, const URL& href, Document&, const String& as, const String& media, const String& type, const String& crossOriginMode, LinkLoader*);66 static std::unique_ptr<LinkPreloadResourceClient> preloadIfNeeded(const LinkRelAttribute&, const URL& href, Document&, const String& as, const String& media, const String& type, const String& crossOriginMode, const String& imageSrcSet, const String& imageSizes, LinkLoader*); 67 67 void prefetchIfNeeded(const LinkRelAttribute&, const URL& href, Document&); 68 68 -
trunk/Source/WebCore/page/RuntimeEnabledFeatures.h
r246002 r246045 360 360 bool interruptAudioOnPageVisibilityChangeEnabled() const { return m_interruptAudioOnPageVisibilityChangeEnabled; } 361 361 void setInterruptAudioOnPageVisibilityChangeEnabled(bool enabled) { m_interruptAudioOnPageVisibilityChangeEnabled = enabled; } 362 363 bool linkPreloadResponsiveImagesEnabled() const { return m_linkPreloadResponsiveImagesEnabled; } 364 void setLinkPreloadResponsiveImagesEnabled(bool isEnabled) { m_linkPreloadResponsiveImagesEnabled = isEnabled; } 362 365 363 366 WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); … … 546 549 bool m_interruptAudioOnPageVisibilityChangeEnabled { false }; 547 550 551 bool m_linkPreloadResponsiveImagesEnabled { false }; 552 548 553 friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; 549 554 }; -
trunk/Source/WebKit/ChangeLog
r246034 r246045 1 2019-06-03 Rob Buis <rbuis@igalia.com> 2 3 Implement imagesrcset and imagesizes attributes on link rel=preload 4 https://bugs.webkit.org/show_bug.cgi?id=192950 5 6 Reviewed by Youenn Fablet. 7 8 Add a runtime flag for link preload responsive images. 9 10 * Shared/WebPreferences.yaml: 11 1 12 2019-06-03 Darin Adler <darin@apple.com> 2 13 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r246002 r246045 1680 1680 category: experimental 1681 1681 1682 LinkPreloadResponsiveImagesEnabled: 1683 type: bool 1684 defaultValue: false 1685 humanReadableName: "Link preload responsive images" 1686 humanReadableDescription: "Enable link preload responsive images" 1687 webcoreBinding: RuntimeEnabledFeatures 1688 category: experimental 1689 1682 1690 # Deprecated 1683 1691 -
trunk/Source/WebKitLegacy/mac/ChangeLog
r246014 r246045 1 2019-06-03 Rob Buis <rbuis@igalia.com> 2 3 Implement imagesrcset and imagesizes attributes on link rel=preload 4 https://bugs.webkit.org/show_bug.cgi?id=192950 5 6 Reviewed by Youenn Fablet. 7 8 Add a runtime flag for link preload responsive images. 9 10 * WebView/WebPreferenceKeysPrivate.h: 11 * WebView/WebPreferences.mm: 12 (+[WebPreferences initialize]): 13 (-[WebPreferences linkPreloadResponsiveImagesEnabled]): 14 (-[WebPreferences setLinkPreloadResponsiveImagesEnabled:]): 15 * WebView/WebPreferencesPrivate.h: 16 * WebView/WebView.mm: 17 (-[WebView _preferencesChanged:]): 18 1 19 2019-06-01 Andy Estes <aestes@apple.com> 2 20 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
r244869 r246045 270 270 #define WebKitResizeObserverEnabledPreferenceKey @"WebKitResizeObserverEnabled" 271 271 #define WebKitCoreMathMLEnabledPreferenceKey @"WebKitCoreMathMLEnabled" 272 272 #define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled" 273 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
r244869 r246045 693 693 #endif 694 694 @NO, WebKitCoreMathMLEnabledPreferenceKey, 695 @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey, 695 696 nil]; 696 697 … … 3469 3470 } 3470 3471 3472 - (BOOL)linkPreloadResponsiveImagesEnabled 3473 { 3474 return [self _boolValueForKey:WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey]; 3475 } 3476 3477 - (void)setLinkPreloadResponsiveImagesEnabled:(BOOL)flag 3478 { 3479 [self _setBoolValue:flag forKey:WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey]; 3480 } 3481 3471 3482 @end 3472 3483 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
r244869 r246045 606 606 - (void)setCoreMathMLEnabled:(BOOL)flag; 607 607 - (BOOL)coreMathMLEnabled; 608 609 - (void)setLinkPreloadResponsiveImagesEnabled:(BOOL)flag; 610 - (BOOL)linkPreloadResponsiveImagesEnabled; 608 611 609 612 @property (nonatomic) BOOL visualViewportAPIEnabled; … … 640 643 @property (nonatomic) BOOL resizeObserverEnabled; 641 644 @property (nonatomic) BOOL coreMathMLEnabled; 645 @property (nonatomic) BOOL linkPreloadResponsiveImagesEnabled; 642 646 643 647 #if TARGET_OS_IPHONE -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r245072 r246045 3191 3191 RuntimeEnabledFeatures::sharedFeatures().setFetchAPIKeepAliveEnabled([preferences fetchAPIKeepAliveEnabled]); 3192 3192 RuntimeEnabledFeatures::sharedFeatures().setReferrerPolicyAttributeEnabled([preferences referrerPolicyAttributeEnabled]); 3193 RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadResponsiveImagesEnabled([preferences linkPreloadResponsiveImagesEnabled]); 3193 3194 3194 3195 #if ENABLE(LEGACY_ENCRYPTED_MEDIA) -
trunk/Tools/ChangeLog
r246044 r246045 1 2019-06-03 Rob Buis <rbuis@igalia.com> 2 3 Implement imagesrcset and imagesizes attributes on link rel=preload 4 https://bugs.webkit.org/show_bug.cgi?id=192950 5 6 Reviewed by Youenn Fablet. 7 8 Add a runtime flag for link preload responsive images. 9 10 * DumpRenderTree/mac/DumpRenderTree.mm: 11 (enableExperimentalFeatures): 12 1 13 2019-06-03 Don Olmstead <don.olmstead@sony.com> 2 14 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r245280 r246045 876 876 [preferences setMediaRecorderEnabled:YES]; 877 877 [preferences setReferrerPolicyAttributeEnabled:YES]; 878 [preferences setReferrerPolicyAttributeEnabled:YES]; 879 [preferences setLinkPreloadResponsiveImagesEnabled:YES]; 878 880 } 879 881
Note: See TracChangeset
for help on using the changeset viewer.