Changeset 199650 in webkit


Ignore:
Timestamp:
Apr 17, 2016 11:06:42 PM (8 years ago)
Author:
yoav@yoav.ws
Message:

Initial Link preload support
https://bugs.webkit.org/show_bug.cgi?id=156334

Source/WebCore:

Added basic <link rel=preload> functionality that enables preloading
of resources according to their type.

Reviewed by Darin Adler.

Tests: http/tests/preload/download_resources.html

http/tests/preload/dynamic_adding_preload.html
http/tests/preload/dynamic_remove_preload_href.html
http/tests/preload/dynamic_removing_preload.html

  • bindings/generic/RuntimeEnabledFeatures.cpp: Added a runtime flag for the feature.

(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):

  • bindings/generic/RuntimeEnabledFeatures.h: Added a runtime flag for the feature.

(WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
(WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):

  • html/HTMLAttributeNames.in: Added an as attribute.
  • html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::process): Added as and crossorigin attribute values to the loadLink() call.
(WebCore::HTMLLinkElement::setCrossOrigin): Setter for crossOrigin.
(WebCore::HTMLLinkElement::crossOrigin): Getter for crossOrigin.

  • html/HTMLLinkElement.idl: Added as and crossorigin to HTMLLinkElement.
  • html/HTMLLinkElement.h: Added getter and setter for crossorigin.
  • html/LinkRelAttribute.cpp:

(WebCore::LinkRelAttribute::LinkRelAttribute): Added "preload" as a potential value.

  • html/LinkRelAttribute.h: Added isLinkPreload.
  • loader/LinkLoader.cpp:

(WebCore::LinkLoader::resourceTypeFromAsAttribute): Translates an as value into a resource type.
(WebCore::preloadIfNeeded): Triggers a resource preload when link element is a preload one.
(WebCore::LinkLoader::loadLink): Added a call to preloadIfNeeded.

  • loader/LinkLoader.h: Added signatures.
  • loader/ResourceLoadInfo.cpp:

(WebCore::toResourceType): Added LinkPreload as a possible CachedResource::type.

  • loader/SubresourceLoader.cpp:

(WebCore::logResourceLoaded): Added LinkPreload as a possible CachedResource::type.

  • loader/cache/CachedResource.cpp: Turned defaultPriorityForResourceType into a static member, as it's now also called from LinkLoader.

(WebCore::CachedResource::defaultPriorityForResourceType): Added LinkPreload as a possible CachedResource::type, giving it low priority.
(WebCore::defaultPriorityForResourceType): Deleted.

  • loader/cache/CachedResource.h: Added LinkPreload as a possible CachedResource::type. Added defaultPriorityForResourceType as static.
  • loader/cache/CachedResourceLoader.cpp:

(WebCore::contentTypeFromResourceType): Added LinkPreload as a possible CachedResource::type.
(WebCore::createResource): Added creation of a LinkPreload resource if needed.
(WebCore::CachedResourceLoader::checkInsecureContent): Added LinkPreload as a possible CachedResource::type.
(WebCore::CachedResourceLoader::canRequest): Added LinkPreload as a possible CachedResource::type.

  • testing/Internals.cpp: Added function to turn on the link preload feature.

(WebCore::setLinkPreloadSupport):

  • testing/Internals.idl: Added function to turn on the link preload feature.
  • testing/Internals.h: Added function signature to turn on the link preload feature.

Source/WebKit2:

Reviewed by Darin Adler.

  • WebProcess/Network/WebLoaderStrategy.cpp:

(WebKit::maximumBufferingTime): Added LinkPreload as a possible CachedResource::type.

LayoutTests:

Added tests that make sure that <link rel=preload> performs its basic
tasks and preloads resources.

Reviewed by Darin Adler.

  • http/tests/preload/download_resources-expected.txt: Added.
  • http/tests/preload/download_resources.html: Added.
  • http/tests/preload/dynamic_adding_preload-expected.txt: Added.
  • http/tests/preload/dynamic_adding_preload.html: Added.
  • http/tests/preload/dynamic_remove_preload_href-expected.txt: Added.
  • http/tests/preload/dynamic_remove_preload_href.html: Added.
  • http/tests/preload/dynamic_removing_preload-expected.txt: Added.
  • http/tests/preload/dynamic_removing_preload.html: Added.
  • imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Adjusted expected results to progressions.
  • imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt: Adjusted expected results to progressions.
  • platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Adjusted expected results to progressions.
Location:
trunk
Files:
9 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199641 r199650  
     12016-04-17  Yoav Weiss  <yoav@yoav.ws>
     2
     3        Initial Link preload support
     4        https://bugs.webkit.org/show_bug.cgi?id=156334
     5
     6        Added tests that make sure that `<link rel=preload>` performs its basic
     7        tasks and preloads resources.
     8
     9        Reviewed by Darin Adler.
     10
     11        * http/tests/preload/download_resources-expected.txt: Added.
     12        * http/tests/preload/download_resources.html: Added.
     13        * http/tests/preload/dynamic_adding_preload-expected.txt: Added.
     14        * http/tests/preload/dynamic_adding_preload.html: Added.
     15        * http/tests/preload/dynamic_remove_preload_href-expected.txt: Added.
     16        * http/tests/preload/dynamic_remove_preload_href.html: Added.
     17        * http/tests/preload/dynamic_removing_preload-expected.txt: Added.
     18        * http/tests/preload/dynamic_removing_preload.html: Added.
     19        * imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Adjusted expected results to progressions.
     20        * imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt: Adjusted expected results to progressions.
     21        * platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Adjusted expected results to progressions.
     22
    1232016-04-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    224
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt

    r198893 r199650  
    13671367PASS HTMLLinkElement interface: existence and properties of interface prototype object's "constructor" property
    13681368PASS HTMLLinkElement interface: attribute href
    1369 FAIL HTMLLinkElement interface: attribute crossOrigin assert_true: The prototype object must have a property "crossOrigin" expected true got false
     1369PASS HTMLLinkElement interface: attribute crossOrigin
    13701370PASS HTMLLinkElement interface: attribute rel
    13711371PASS HTMLLinkElement interface: attribute relList
     
    13801380PASS Stringification of document.createElement("link")
    13811381PASS HTMLLinkElement interface: document.createElement("link") must inherit property "href" with the proper type (0)
    1382 FAIL HTMLLinkElement interface: document.createElement("link") must inherit property "crossOrigin" with the proper type (1) assert_inherits: property "crossOrigin" not found in prototype chain
     1382PASS HTMLLinkElement interface: document.createElement("link") must inherit property "crossOrigin" with the proper type (1)
    13831383PASS HTMLLinkElement interface: document.createElement("link") must inherit property "rel" with the proper type (2)
    13841384PASS HTMLLinkElement interface: document.createElement("link") must inherit property "relList" with the proper type (3)
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt

    r197726 r199650  
    30523052PASS link.href: IDL set to object "test-valueOf" followed by getAttribute()
    30533053PASS link.href: IDL set to object "test-valueOf" followed by IDL get
    3054 FAIL link.crossOrigin: typeof IDL attribute assert_equals: expected "string" but got "undefined"
    3055 FAIL link.crossOrigin: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined
     3054FAIL link.crossOrigin: typeof IDL attribute assert_equals: expected "string" but got "object"
     3055FAIL link.crossOrigin: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (object) null
    30563056PASS link.crossOrigin: setAttribute() to "" followed by getAttribute()
    3057 FAIL link.crossOrigin: setAttribute() to "" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3057PASS link.crossOrigin: setAttribute() to "" followed by IDL get
    30583058PASS link.crossOrigin: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by getAttribute()
    3059 FAIL link.crossOrigin: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3059PASS link.crossOrigin: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by IDL get
    30603060PASS link.crossOrigin: setAttribute() to undefined followed by getAttribute()
    3061 FAIL link.crossOrigin: setAttribute() to undefined followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3061PASS link.crossOrigin: setAttribute() to undefined followed by IDL get
    30623062PASS link.crossOrigin: setAttribute() to 7 followed by getAttribute()
    3063 FAIL link.crossOrigin: setAttribute() to 7 followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3063PASS link.crossOrigin: setAttribute() to 7 followed by IDL get
    30643064PASS link.crossOrigin: setAttribute() to 1.5 followed by getAttribute()
    3065 FAIL link.crossOrigin: setAttribute() to 1.5 followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3065PASS link.crossOrigin: setAttribute() to 1.5 followed by IDL get
    30663066PASS link.crossOrigin: setAttribute() to true followed by getAttribute()
    3067 FAIL link.crossOrigin: setAttribute() to true followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3067PASS link.crossOrigin: setAttribute() to true followed by IDL get
    30683068PASS link.crossOrigin: setAttribute() to false followed by getAttribute()
    3069 FAIL link.crossOrigin: setAttribute() to false followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3069PASS link.crossOrigin: setAttribute() to false followed by IDL get
    30703070PASS link.crossOrigin: setAttribute() to object "[object Object]" followed by getAttribute()
    3071 FAIL link.crossOrigin: setAttribute() to object "[object Object]" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3071PASS link.crossOrigin: setAttribute() to object "[object Object]" followed by IDL get
    30723072PASS link.crossOrigin: setAttribute() to NaN followed by getAttribute()
    3073 FAIL link.crossOrigin: setAttribute() to NaN followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3073PASS link.crossOrigin: setAttribute() to NaN followed by IDL get
    30743074PASS link.crossOrigin: setAttribute() to Infinity followed by getAttribute()
    3075 FAIL link.crossOrigin: setAttribute() to Infinity followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3075PASS link.crossOrigin: setAttribute() to Infinity followed by IDL get
    30763076PASS link.crossOrigin: setAttribute() to -Infinity followed by getAttribute()
    3077 FAIL link.crossOrigin: setAttribute() to -Infinity followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3077PASS link.crossOrigin: setAttribute() to -Infinity followed by IDL get
    30783078PASS link.crossOrigin: setAttribute() to "\0" followed by getAttribute()
    3079 FAIL link.crossOrigin: setAttribute() to "\0" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3079PASS link.crossOrigin: setAttribute() to "\0" followed by IDL get
    30803080PASS link.crossOrigin: setAttribute() to null followed by getAttribute()
    3081 FAIL link.crossOrigin: setAttribute() to null followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3081PASS link.crossOrigin: setAttribute() to null followed by IDL get
    30823082PASS link.crossOrigin: setAttribute() to object "test-toString" followed by getAttribute()
    3083 FAIL link.crossOrigin: setAttribute() to object "test-toString" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3083PASS link.crossOrigin: setAttribute() to object "test-toString" followed by IDL get
    30843084PASS link.crossOrigin: setAttribute() to object "test-valueOf" followed by getAttribute()
    3085 FAIL link.crossOrigin: setAttribute() to object "test-valueOf" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3085PASS link.crossOrigin: setAttribute() to object "test-valueOf" followed by IDL get
    30863086PASS link.crossOrigin: setAttribute() to "anonymous" followed by getAttribute()
    3087 FAIL link.crossOrigin: setAttribute() to "anonymous" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3087PASS link.crossOrigin: setAttribute() to "anonymous" followed by IDL get
    30883088PASS link.crossOrigin: setAttribute() to "xanonymous" followed by getAttribute()
    3089 FAIL link.crossOrigin: setAttribute() to "xanonymous" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3089PASS link.crossOrigin: setAttribute() to "xanonymous" followed by IDL get
    30903090PASS link.crossOrigin: setAttribute() to "anonymous\0" followed by getAttribute()
    3091 FAIL link.crossOrigin: setAttribute() to "anonymous\0" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3091PASS link.crossOrigin: setAttribute() to "anonymous\0" followed by IDL get
    30923092PASS link.crossOrigin: setAttribute() to "nonymous" followed by getAttribute()
    3093 FAIL link.crossOrigin: setAttribute() to "nonymous" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3093PASS link.crossOrigin: setAttribute() to "nonymous" followed by IDL get
    30943094PASS link.crossOrigin: setAttribute() to "ANONYMOUS" followed by getAttribute()
    3095 FAIL link.crossOrigin: setAttribute() to "ANONYMOUS" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3095PASS link.crossOrigin: setAttribute() to "ANONYMOUS" followed by IDL get
    30963096PASS link.crossOrigin: setAttribute() to "use-credentials" followed by getAttribute()
    3097 FAIL link.crossOrigin: setAttribute() to "use-credentials" followed by IDL get assert_equals: expected (string) "use-credentials" but got (undefined) undefined
     3097PASS link.crossOrigin: setAttribute() to "use-credentials" followed by IDL get
    30983098PASS link.crossOrigin: setAttribute() to "xuse-credentials" followed by getAttribute()
    3099 FAIL link.crossOrigin: setAttribute() to "xuse-credentials" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3099PASS link.crossOrigin: setAttribute() to "xuse-credentials" followed by IDL get
    31003100PASS link.crossOrigin: setAttribute() to "use-credentials\0" followed by getAttribute()
    3101 FAIL link.crossOrigin: setAttribute() to "use-credentials\0" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3101PASS link.crossOrigin: setAttribute() to "use-credentials\0" followed by IDL get
    31023102PASS link.crossOrigin: setAttribute() to "se-credentials" followed by getAttribute()
    3103 FAIL link.crossOrigin: setAttribute() to "se-credentials" followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3103PASS link.crossOrigin: setAttribute() to "se-credentials" followed by IDL get
    31043104PASS link.crossOrigin: setAttribute() to "USE-CREDENTIALS" followed by getAttribute()
    3105 FAIL link.crossOrigin: setAttribute() to "USE-CREDENTIALS" followed by IDL get assert_equals: expected (string) "use-credentials" but got (undefined) undefined
     3105PASS link.crossOrigin: setAttribute() to "USE-CREDENTIALS" followed by IDL get
    31063106PASS link.crossOrigin: IDL set to "" should not throw
    3107 FAIL link.crossOrigin: IDL set to "" followed by getAttribute() assert_equals: expected "" but got "USE-CREDENTIALS"
    3108 FAIL link.crossOrigin: IDL set to "" followed by IDL get assert_equals: expected "anonymous" but got ""
     3107PASS link.crossOrigin: IDL set to "" followed by getAttribute()
     3108PASS link.crossOrigin: IDL set to "" followed by IDL get
    31093109PASS link.crossOrigin: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " should not throw
    3110 FAIL link.crossOrigin: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by getAttribute() assert_equals: expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " but got "USE-CREDENTIALS"
    3111 FAIL link.crossOrigin: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by IDL get assert_equals: expected "anonymous" but got " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
     3110PASS link.crossOrigin: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by getAttribute()
     3111PASS link.crossOrigin: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by IDL get
    31123112PASS link.crossOrigin: IDL set to undefined should not throw
    3113 FAIL link.crossOrigin: IDL set to undefined followed by getAttribute() assert_equals: expected "undefined" but got "USE-CREDENTIALS"
    3114 FAIL link.crossOrigin: IDL set to undefined followed by IDL get assert_equals: expected (string) "anonymous" but got (undefined) undefined
     3113FAIL link.crossOrigin: IDL set to undefined followed by getAttribute() assert_equals: expected (string) "undefined" but got (object) null
     3114FAIL link.crossOrigin: IDL set to undefined followed by IDL get assert_equals: expected (string) "anonymous" but got (object) null
    31153115PASS link.crossOrigin: IDL set to 7 should not throw
    3116 FAIL link.crossOrigin: IDL set to 7 followed by getAttribute() assert_equals: expected "7" but got "USE-CREDENTIALS"
    3117 FAIL link.crossOrigin: IDL set to 7 followed by IDL get assert_equals: expected (string) "anonymous" but got (number) 7
     3116PASS link.crossOrigin: IDL set to 7 followed by getAttribute()
     3117PASS link.crossOrigin: IDL set to 7 followed by IDL get
    31183118PASS link.crossOrigin: IDL set to 1.5 should not throw
    3119 FAIL link.crossOrigin: IDL set to 1.5 followed by getAttribute() assert_equals: expected "1.5" but got "USE-CREDENTIALS"
    3120 FAIL link.crossOrigin: IDL set to 1.5 followed by IDL get assert_equals: expected (string) "anonymous" but got (number) 1.5
     3119PASS link.crossOrigin: IDL set to 1.5 followed by getAttribute()
     3120PASS link.crossOrigin: IDL set to 1.5 followed by IDL get
    31213121PASS link.crossOrigin: IDL set to true should not throw
    3122 FAIL link.crossOrigin: IDL set to true followed by getAttribute() assert_equals: expected "true" but got "USE-CREDENTIALS"
    3123 FAIL link.crossOrigin: IDL set to true followed by IDL get assert_equals: expected (string) "anonymous" but got (boolean) true
     3122PASS link.crossOrigin: IDL set to true followed by getAttribute()
     3123PASS link.crossOrigin: IDL set to true followed by IDL get
    31243124PASS link.crossOrigin: IDL set to false should not throw
    3125 FAIL link.crossOrigin: IDL set to false followed by getAttribute() assert_equals: expected "false" but got "USE-CREDENTIALS"
    3126 FAIL link.crossOrigin: IDL set to false followed by IDL get assert_equals: expected (string) "anonymous" but got (boolean) false
     3125PASS link.crossOrigin: IDL set to false followed by getAttribute()
     3126PASS link.crossOrigin: IDL set to false followed by IDL get
    31273127PASS link.crossOrigin: IDL set to object "[object Object]" should not throw
    3128 FAIL link.crossOrigin: IDL set to object "[object Object]" followed by getAttribute() assert_equals: expected "[object Object]" but got "USE-CREDENTIALS"
    3129 FAIL link.crossOrigin: IDL set to object "[object Object]" followed by IDL get assert_equals: expected (string) "anonymous" but got (object) object "[object Object]"
     3128PASS link.crossOrigin: IDL set to object "[object Object]" followed by getAttribute()
     3129PASS link.crossOrigin: IDL set to object "[object Object]" followed by IDL get
    31303130PASS link.crossOrigin: IDL set to NaN should not throw
    3131 FAIL link.crossOrigin: IDL set to NaN followed by getAttribute() assert_equals: expected "NaN" but got "USE-CREDENTIALS"
    3132 FAIL link.crossOrigin: IDL set to NaN followed by IDL get assert_equals: expected (string) "anonymous" but got (number) NaN
     3131PASS link.crossOrigin: IDL set to NaN followed by getAttribute()
     3132PASS link.crossOrigin: IDL set to NaN followed by IDL get
    31333133PASS link.crossOrigin: IDL set to Infinity should not throw
    3134 FAIL link.crossOrigin: IDL set to Infinity followed by getAttribute() assert_equals: expected "Infinity" but got "USE-CREDENTIALS"
    3135 FAIL link.crossOrigin: IDL set to Infinity followed by IDL get assert_equals: expected (string) "anonymous" but got (number) Infinity
     3134PASS link.crossOrigin: IDL set to Infinity followed by getAttribute()
     3135PASS link.crossOrigin: IDL set to Infinity followed by IDL get
    31363136PASS link.crossOrigin: IDL set to -Infinity should not throw
    3137 FAIL link.crossOrigin: IDL set to -Infinity followed by getAttribute() assert_equals: expected "-Infinity" but got "USE-CREDENTIALS"
    3138 FAIL link.crossOrigin: IDL set to -Infinity followed by IDL get assert_equals: expected (string) "anonymous" but got (number) -Infinity
     3137PASS link.crossOrigin: IDL set to -Infinity followed by getAttribute()
     3138PASS link.crossOrigin: IDL set to -Infinity followed by IDL get
    31393139PASS link.crossOrigin: IDL set to "\0" should not throw
    3140 FAIL link.crossOrigin: IDL set to "\0" followed by getAttribute() assert_equals: expected "\0" but got "USE-CREDENTIALS"
    3141 FAIL link.crossOrigin: IDL set to "\0" followed by IDL get assert_equals: expected "anonymous" but got "\0"
     3140PASS link.crossOrigin: IDL set to "\0" followed by getAttribute()
     3141PASS link.crossOrigin: IDL set to "\0" followed by IDL get
    31423142PASS link.crossOrigin: IDL set to null should not throw
    31433143FAIL link.crossOrigin: IDL set to null followed by IDL get assert_equals: expected (string) "anonymous" but got (object) null
    31443144PASS link.crossOrigin: IDL set to object "test-toString" should not throw
    3145 FAIL link.crossOrigin: IDL set to object "test-toString" followed by getAttribute() assert_equals: expected "test-toString" but got "USE-CREDENTIALS"
    3146 FAIL link.crossOrigin: IDL set to object "test-toString" followed by IDL get assert_equals: expected (string) "anonymous" but got (object) object "test-toString"
     3145PASS link.crossOrigin: IDL set to object "test-toString" followed by getAttribute()
     3146PASS link.crossOrigin: IDL set to object "test-toString" followed by IDL get
    31473147PASS link.crossOrigin: IDL set to object "test-valueOf" should not throw
    3148 FAIL link.crossOrigin: IDL set to object "test-valueOf" followed by getAttribute() assert_equals: expected "test-valueOf" but got "USE-CREDENTIALS"
    3149 FAIL link.crossOrigin: IDL set to object "test-valueOf" followed by IDL get assert_equals: expected (string) "anonymous" but got (object) object "test-valueOf"
     3148PASS link.crossOrigin: IDL set to object "test-valueOf" followed by getAttribute()
     3149PASS link.crossOrigin: IDL set to object "test-valueOf" followed by IDL get
    31503150PASS link.crossOrigin: IDL set to "anonymous" should not throw
    3151 FAIL link.crossOrigin: IDL set to "anonymous" followed by getAttribute() assert_equals: expected "anonymous" but got "USE-CREDENTIALS"
     3151PASS link.crossOrigin: IDL set to "anonymous" followed by getAttribute()
    31523152PASS link.crossOrigin: IDL set to "anonymous" followed by IDL get
    31533153PASS link.crossOrigin: IDL set to "xanonymous" should not throw
    3154 FAIL link.crossOrigin: IDL set to "xanonymous" followed by getAttribute() assert_equals: expected "xanonymous" but got "USE-CREDENTIALS"
    3155 FAIL link.crossOrigin: IDL set to "xanonymous" followed by IDL get assert_equals: expected "anonymous" but got "xanonymous"
     3154PASS link.crossOrigin: IDL set to "xanonymous" followed by getAttribute()
     3155PASS link.crossOrigin: IDL set to "xanonymous" followed by IDL get
    31563156PASS link.crossOrigin: IDL set to "anonymous\0" should not throw
    3157 FAIL link.crossOrigin: IDL set to "anonymous\0" followed by getAttribute() assert_equals: expected "anonymous\0" but got "USE-CREDENTIALS"
    3158 FAIL link.crossOrigin: IDL set to "anonymous\0" followed by IDL get assert_equals: expected "anonymous" but got "anonymous\0"
     3157PASS link.crossOrigin: IDL set to "anonymous\0" followed by getAttribute()
     3158PASS link.crossOrigin: IDL set to "anonymous\0" followed by IDL get
    31593159PASS link.crossOrigin: IDL set to "nonymous" should not throw
    3160 FAIL link.crossOrigin: IDL set to "nonymous" followed by getAttribute() assert_equals: expected "nonymous" but got "USE-CREDENTIALS"
    3161 FAIL link.crossOrigin: IDL set to "nonymous" followed by IDL get assert_equals: expected "anonymous" but got "nonymous"
     3160PASS link.crossOrigin: IDL set to "nonymous" followed by getAttribute()
     3161PASS link.crossOrigin: IDL set to "nonymous" followed by IDL get
    31623162PASS link.crossOrigin: IDL set to "ANONYMOUS" should not throw
    3163 FAIL link.crossOrigin: IDL set to "ANONYMOUS" followed by getAttribute() assert_equals: expected "ANONYMOUS" but got "USE-CREDENTIALS"
    3164 FAIL link.crossOrigin: IDL set to "ANONYMOUS" followed by IDL get assert_equals: expected "anonymous" but got "ANONYMOUS"
     3163PASS link.crossOrigin: IDL set to "ANONYMOUS" followed by getAttribute()
     3164PASS link.crossOrigin: IDL set to "ANONYMOUS" followed by IDL get
    31653165PASS link.crossOrigin: IDL set to "use-credentials" should not throw
    3166 FAIL link.crossOrigin: IDL set to "use-credentials" followed by getAttribute() assert_equals: expected "use-credentials" but got "USE-CREDENTIALS"
     3166PASS link.crossOrigin: IDL set to "use-credentials" followed by getAttribute()
    31673167PASS link.crossOrigin: IDL set to "use-credentials" followed by IDL get
    31683168PASS link.crossOrigin: IDL set to "xuse-credentials" should not throw
    3169 FAIL link.crossOrigin: IDL set to "xuse-credentials" followed by getAttribute() assert_equals: expected "xuse-credentials" but got "USE-CREDENTIALS"
    3170 FAIL link.crossOrigin: IDL set to "xuse-credentials" followed by IDL get assert_equals: expected "anonymous" but got "xuse-credentials"
     3169PASS link.crossOrigin: IDL set to "xuse-credentials" followed by getAttribute()
     3170PASS link.crossOrigin: IDL set to "xuse-credentials" followed by IDL get
    31713171PASS link.crossOrigin: IDL set to "use-credentials\0" should not throw
    3172 FAIL link.crossOrigin: IDL set to "use-credentials\0" followed by getAttribute() assert_equals: expected "use-credentials\0" but got "USE-CREDENTIALS"
    3173 FAIL link.crossOrigin: IDL set to "use-credentials\0" followed by IDL get assert_equals: expected "anonymous" but got "use-credentials\0"
     3172PASS link.crossOrigin: IDL set to "use-credentials\0" followed by getAttribute()
     3173PASS link.crossOrigin: IDL set to "use-credentials\0" followed by IDL get
    31743174PASS link.crossOrigin: IDL set to "se-credentials" should not throw
    3175 FAIL link.crossOrigin: IDL set to "se-credentials" followed by getAttribute() assert_equals: expected "se-credentials" but got "USE-CREDENTIALS"
    3176 FAIL link.crossOrigin: IDL set to "se-credentials" followed by IDL get assert_equals: expected "anonymous" but got "se-credentials"
     3175PASS link.crossOrigin: IDL set to "se-credentials" followed by getAttribute()
     3176PASS link.crossOrigin: IDL set to "se-credentials" followed by IDL get
    31773177PASS link.crossOrigin: IDL set to "USE-CREDENTIALS" should not throw
    31783178PASS link.crossOrigin: IDL set to "USE-CREDENTIALS" followed by getAttribute()
    3179 FAIL link.crossOrigin: IDL set to "USE-CREDENTIALS" followed by IDL get assert_equals: expected "use-credentials" but got "USE-CREDENTIALS"
     3179PASS link.crossOrigin: IDL set to "USE-CREDENTIALS" followed by IDL get
    31803180PASS link.rel: typeof IDL attribute
    31813181PASS link.rel: IDL get with DOM attribute unset
  • trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt

    r198893 r199650  
    13671367PASS HTMLLinkElement interface: existence and properties of interface prototype object's "constructor" property
    13681368PASS HTMLLinkElement interface: attribute href
    1369 FAIL HTMLLinkElement interface: attribute crossOrigin assert_true: The prototype object must have a property "crossOrigin" expected true got false
     1369PASS HTMLLinkElement interface: attribute crossOrigin
    13701370PASS HTMLLinkElement interface: attribute rel
    13711371PASS HTMLLinkElement interface: attribute relList
     
    13801380PASS Stringification of document.createElement("link")
    13811381PASS HTMLLinkElement interface: document.createElement("link") must inherit property "href" with the proper type (0)
    1382 FAIL HTMLLinkElement interface: document.createElement("link") must inherit property "crossOrigin" with the proper type (1) assert_inherits: property "crossOrigin" not found in prototype chain
     1382PASS HTMLLinkElement interface: document.createElement("link") must inherit property "crossOrigin" with the proper type (1)
    13831383PASS HTMLLinkElement interface: document.createElement("link") must inherit property "rel" with the proper type (2)
    13841384PASS HTMLLinkElement interface: document.createElement("link") must inherit property "relList" with the proper type (3)
  • trunk/Source/WebCore/ChangeLog

    r199646 r199650  
     12016-04-17  Yoav Weiss  <yoav@yoav.ws>
     2
     3        Initial Link preload support
     4        https://bugs.webkit.org/show_bug.cgi?id=156334
     5
     6        Added basic `<link rel=preload>` functionality that enables preloading
     7        of resources according to their type.
     8
     9        Reviewed by Darin Adler.
     10
     11        Tests: http/tests/preload/download_resources.html
     12               http/tests/preload/dynamic_adding_preload.html
     13               http/tests/preload/dynamic_remove_preload_href.html
     14               http/tests/preload/dynamic_removing_preload.html
     15
     16        * bindings/generic/RuntimeEnabledFeatures.cpp: Added a runtime flag for the feature.
     17        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
     18        * bindings/generic/RuntimeEnabledFeatures.h: Added a runtime flag for the feature.
     19        (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
     20        (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):
     21        * html/HTMLAttributeNames.in: Added an `as` attribute.
     22        * html/HTMLLinkElement.cpp:
     23        (WebCore::HTMLLinkElement::process): Added `as` and `crossorigin` attribute values to the loadLink() call.
     24        (WebCore::HTMLLinkElement::setCrossOrigin): Setter for crossOrigin.
     25        (WebCore::HTMLLinkElement::crossOrigin): Getter for crossOrigin.
     26        * html/HTMLLinkElement.idl: Added `as` and `crossorigin` to HTMLLinkElement.
     27        * html/HTMLLinkElement.h: Added getter and setter for crossorigin.
     28        * html/LinkRelAttribute.cpp:
     29        (WebCore::LinkRelAttribute::LinkRelAttribute): Added "preload" as a potential value.
     30        * html/LinkRelAttribute.h: Added isLinkPreload.
     31        * loader/LinkLoader.cpp:
     32        (WebCore::LinkLoader::resourceTypeFromAsAttribute): Translates an `as` value into a resource type.
     33        (WebCore::preloadIfNeeded): Triggers a resource preload when link element is a preload one.
     34        (WebCore::LinkLoader::loadLink): Added a call to preloadIfNeeded.
     35        * loader/LinkLoader.h: Added signatures.
     36        * loader/ResourceLoadInfo.cpp:
     37        (WebCore::toResourceType): Added LinkPreload as a possible CachedResource::type.
     38        * loader/SubresourceLoader.cpp:
     39        (WebCore::logResourceLoaded): Added LinkPreload as a possible CachedResource::type.
     40        * loader/cache/CachedResource.cpp: Turned defaultPriorityForResourceType into a static member, as it's now also called from LinkLoader.
     41        (WebCore::CachedResource::defaultPriorityForResourceType): Added LinkPreload as a possible CachedResource::type, giving it low priority.
     42        (WebCore::defaultPriorityForResourceType): Deleted.
     43        * loader/cache/CachedResource.h: Added LinkPreload as a possible CachedResource::type. Added defaultPriorityForResourceType as static.
     44        * loader/cache/CachedResourceLoader.cpp:
     45        (WebCore::contentTypeFromResourceType): Added LinkPreload as a possible CachedResource::type.
     46        (WebCore::createResource): Added creation of a LinkPreload resource if needed.
     47        (WebCore::CachedResourceLoader::checkInsecureContent): Added LinkPreload as a possible CachedResource::type.
     48        (WebCore::CachedResourceLoader::canRequest): Added LinkPreload as a possible CachedResource::type.
     49        * testing/Internals.cpp: Added function to turn on the link preload feature.
     50        (WebCore::setLinkPreloadSupport):
     51        * testing/Internals.idl: Added function to turn on the link preload feature.
     52        * testing/Internals.h: Added function signature to turn on the link preload feature.
     53
    1542016-04-17  Conrad Shultz  <conrad_shultz@apple.com>
    255
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp

    r199007 r199650  
    5151    , m_isDeviceMotionEnabled(true)
    5252    , m_isDeviceOrientationEnabled(true)
     53    , m_isLinkPreloadEnabled(false)
    5354    , m_isCSSShapesEnabled(true)
    5455    , m_isCSSRegionsEnabled(false)
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r199571 r199650  
    124124    bool ondeviceorientationEnabled() const { return m_isDeviceOrientationEnabled; }
    125125
     126    void setLinkPreloadEnabled(bool isEnabled) { m_isLinkPreloadEnabled = isEnabled; }
     127    bool linkPreloadEnabled() const { return m_isLinkPreloadEnabled; }
     128
    126129#if ENABLE(JAVASCRIPT_I18N_API)
    127130    bool javaScriptI18NAPIEnabled() const;
     
    249252    bool m_isDeviceMotionEnabled;
    250253    bool m_isDeviceOrientationEnabled;
     254    bool m_isLinkPreloadEnabled;
    251255    bool m_isCSSShapesEnabled;
    252256    bool m_isCSSRegionsEnabled;
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r198974 r199650  
    6060aria-valuenow
    6161aria-valuetext
     62as
    6263async
    6364autocomplete
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r199360 r199650  
    195195}
    196196
     197void HTMLLinkElement::setCrossOrigin(const AtomicString& value)
     198{
     199    setAttributeWithoutSynchronization(crossoriginAttr, value);
     200}
     201
     202String HTMLLinkElement::crossOrigin() const
     203{
     204    return parseCORSSettingsAttribute(fastGetAttribute(crossoriginAttr));
     205}
     206
    197207void HTMLLinkElement::process()
    198208{
     
    204214    URL url = getNonEmptyURLAttribute(hrefAttr);
    205215
    206     if (!m_linkLoader.loadLink(m_relAttribute, url, document()))
     216    if (!m_linkLoader.loadLink(m_relAttribute, url, fastGetAttribute(asAttr), fastGetAttribute(crossoriginAttr), document()))
    207217        return;
    208218
  • trunk/Source/WebCore/html/HTMLLinkElement.h

    r199298 r199650  
    6767    bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript; }
    6868    DOMTokenList& sizes();
     69
     70    void setCrossOrigin(const AtomicString&);
     71    String crossOrigin() const;
    6972
    7073    void dispatchPendingEvent(LinkEventSender*);
  • trunk/Source/WebCore/html/HTMLLinkElement.idl

    r199539 r199650  
    3636    [Reflect] attribute DOMString target;
    3737    [Reflect] attribute DOMString type;
     38    [Reflect] attribute DOMString as;
     39    attribute DOMString? crossOrigin;
    3840
    3941    // DOM Level 2 Style
  • trunk/Source/WebCore/html/LinkRelAttribute.cpp

    r195452 r199650  
    3333#include "LinkRelAttribute.h"
    3434
     35#include "RuntimeEnabledFeatures.h"
    3536#include <wtf/text/WTFString.h>
    3637
     
    5556    else if (equalLettersIgnoringASCIICase(rel, "dns-prefetch"))
    5657        isDNSPrefetch = true;
     58    else if (RuntimeEnabledFeatures::sharedFeatures().linkPreloadEnabled() && equalLettersIgnoringASCIICase(rel, "preload"))
     59        isLinkPreload = true;
    5760    else if (equalLettersIgnoringASCIICase(rel, "alternate stylesheet") || equalLettersIgnoringASCIICase(rel, "stylesheet alternate")) {
    5861        isStyleSheet = true;
  • trunk/Source/WebCore/html/LinkRelAttribute.h

    r182351 r199650  
    4343    bool isAlternate { false };
    4444    bool isDNSPrefetch { false };
     45    bool isLinkPreload { false };
    4546#if ENABLE(LINK_PREFETCH)
    4647    bool isLinkPrefetch { false };
  • trunk/Source/WebCore/loader/LinkLoader.cpp

    r191381 r199650  
    3838#include "CachedResourceRequest.h"
    3939#include "ContainerNode.h"
     40#include "CrossOriginAccessControl.h"
    4041#include "Document.h"
    4142#include "Frame.h"
     
    4344#include "FrameView.h"
    4445#include "LinkRelAttribute.h"
     46#include "RuntimeEnabledFeatures.h"
    4547#include "Settings.h"
    4648#include "StyleResolver.h"
     
    8486}
    8587
    86 bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const URL& href, Document& document)
     88Optional<CachedResource::Type> LinkLoader::resourceTypeFromAsAttribute(const String& as)
     89{
     90    if (as.isEmpty())
     91        return CachedResource::LinkPreload;
     92    if (equalLettersIgnoringASCIICase(as, "image"))
     93        return CachedResource::ImageResource;
     94    if (equalLettersIgnoringASCIICase(as, "script"))
     95        return CachedResource::Script;
     96    if (equalLettersIgnoringASCIICase(as, "style"))
     97        return CachedResource::CSSStyleSheet;
     98    if (equalLettersIgnoringASCIICase(as, "media"))
     99        return CachedResource::MediaResource;
     100    if (equalLettersIgnoringASCIICase(as, "font"))
     101        return CachedResource::FontResource;
     102#if ENABLE(VIDEO_TRACK)
     103    if (equalLettersIgnoringASCIICase(as, "track"))
     104        return CachedResource::TextTrackResource;
     105#endif
     106    return Nullopt;
     107}
     108
     109static void preloadIfNeeded(const LinkRelAttribute& relAttribute, const URL& href, Document& document, const String& as, const String& crossOriginMode)
     110{
     111    if (!document.loader() || !relAttribute.isLinkPreload)
     112        return;
     113
     114    ASSERT(RuntimeEnabledFeatures::sharedFeatures().linkPreloadEnabled());
     115    if (!href.isValid()) {
     116        document.addConsoleMessage(MessageSource::Other, MessageLevel::Error, String("<link rel=preload> has an invalid `href` value"));
     117        return;
     118    }
     119    auto type = LinkLoader::resourceTypeFromAsAttribute(as);
     120    if (!type) {
     121        document.addConsoleMessage(MessageSource::Other, MessageLevel::Error, String("<link rel=preload> must have a valid `as` value"));
     122        return;
     123    }
     124
     125    ResourceRequest resourceRequest(document.completeURL(href));
     126    CachedResourceRequest linkRequest(resourceRequest, CachedResource::defaultPriorityForResourceType(type.value()));
     127    linkRequest.setInitiator("link");
     128
     129    if (!crossOriginMode.isNull()) {
     130        StoredCredentials allowCredentials = equalLettersIgnoringASCIICase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
     131        updateRequestForAccessControl(linkRequest.mutableResourceRequest(), document.securityOrigin(), allowCredentials);
     132    }
     133    linkRequest.setForPreload(true);
     134    document.cachedResourceLoader().preload(type.value(), linkRequest, emptyString());
     135}
     136
     137bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const URL& href, const String& as, const String& crossOrigin, Document& document)
    87138{
    88139    // We'll record this URL per document, even if we later only use it in top level frames
     
    101152            document.frame()->loader().client().prefetchDNS(href.host());
    102153    }
     154
     155    if (m_client.shouldLoadLink())
     156        preloadIfNeeded(relAttribute, href, document, as, crossOrigin);
    103157
    104158#if ENABLE(LINK_PREFETCH)
  • trunk/Source/WebCore/loader/LinkLoader.h

    r197563 r199650  
    3333#define LinkLoader_h
    3434
     35#include "CachedResource.h"
    3536#include "CachedResourceClient.h"
    3637#include "CachedResourceHandle.h"
     
    5051    virtual ~LinkLoader();
    5152
    52     bool loadLink(const LinkRelAttribute&, const URL&, Document&);
     53    bool loadLink(const LinkRelAttribute&, const URL&, const String& as, const String& crossOrigin, Document&);
     54    static Optional<CachedResource::Type> resourceTypeFromAsAttribute(const String& as);
    5355
    5456private:
  • trunk/Source/WebCore/loader/ResourceLoadInfo.cpp

    r198292 r199650  
    5757
    5858    case CachedResource::MediaResource:
     59    case CachedResource::LinkPreload:
    5960    case CachedResource::RawResource:
    6061        return ResourceType::Raw;
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r199612 r199650  
    372372        resourceType = DiagnosticLoggingKeys::svgDocumentKey();
    373373        break;
     374    case CachedResource::LinkPreload:
    374375#if ENABLE(LINK_PREFETCH)
    375376    case CachedResource::LinkPrefetch:
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r198292 r199650  
    6464namespace WebCore {
    6565
    66 static ResourceLoadPriority defaultPriorityForResourceType(CachedResource::Type type)
     66ResourceLoadPriority CachedResource::defaultPriorityForResourceType(Type type)
    6767{
    6868    switch (type) {
     
    8686#endif
    8787    case CachedResource::SVGDocumentResource:
     88        return ResourceLoadPriority::Low;
     89    case CachedResource::LinkPreload:
    8890        return ResourceLoadPriority::Low;
    8991#if ENABLE(LINK_PREFETCH)
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r198292 r199650  
    7676        , XSLStyleSheet
    7777#endif
     78        , LinkPreload
    7879#if ENABLE(LINK_PREFETCH)
    7980        , LinkPrefetch
     
    264265
    265266    unsigned long identifierForLoadWithoutResourceLoader() const { return m_identifierForLoadWithoutResourceLoader; }
     267    static ResourceLoadPriority defaultPriorityForResourceType(Type);
    266268
    267269protected:
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r199612 r199650  
    109109        return new CachedXSLStyleSheet(request, sessionID);
    110110#endif
     111    case CachedResource::LinkPreload:
     112        return new CachedResource(request, CachedResource::LinkPreload, sessionID);
    111113#if ENABLE(LINK_PREFETCH)
    112114    case CachedResource::LinkPrefetch:
     
    314316#endif
    315317
     318    case CachedResource::LinkPreload:
    316319#if ENABLE(LINK_PREFETCH)
    317320    case CachedResource::LinkPrefetch:
     
    354357    case CachedResource::SVGFontResource:
    355358#endif
    356     case CachedResource::FontResource: {
     359    case CachedResource::FontResource:
     360    case CachedResource::LinkPreload: {
    357361        // These resources can corrupt only the frame's pixels.
    358362        if (Frame* f = frame()) {
     
    400404    case CachedResource::FontResource:
    401405    case CachedResource::RawResource:
     406    case CachedResource::LinkPreload:
    402407#if ENABLE(LINK_PREFETCH)
    403408    case CachedResource::LinkPrefetch:
     
    455460    case CachedResource::MainResource:
    456461    case CachedResource::RawResource:
     462    // FIXME: Preload should be subject to connect-src.
     463    case CachedResource::LinkPreload:
    457464#if ENABLE(LINK_PREFETCH)
    458465    case CachedResource::LinkPrefetch:
  • trunk/Source/WebCore/testing/Internals.cpp

    r199642 r199650  
    33293329}
    33303330
    3331 }
     3331void Internals::setLinkPreloadSupport(bool enable)
     3332{
     3333    RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(enable);
     3334}
     3335
     3336}
  • trunk/Source/WebCore/testing/Internals.h

    r199642 r199650  
    472472   
    473473    void setViewportForceAlwaysUserScalable(bool);
     474    void setLinkPreloadSupport(bool);
    474475
    475476private:
  • trunk/Source/WebCore/testing/Internals.idl

    r199539 r199650  
    446446
    447447    void setViewportForceAlwaysUserScalable(boolean scalable);
    448 };
     448    void setLinkPreloadSupport(boolean scalable);
     449};
  • trunk/Source/WebKit2/ChangeLog

    r199644 r199650  
     12016-04-17  Yoav Weiss  <yoav@yoav.ws>
     2
     3        Initial Link preload support
     4        https://bugs.webkit.org/show_bug.cgi?id=156334
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebProcess/Network/WebLoaderStrategy.cpp:
     9        (WebKit::maximumBufferingTime): Added LinkPreload as a possible CachedResource::type.
     10
    1112016-04-17  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp

    r198292 r199650  
    111111    case CachedResource::RawResource:
    112112    case CachedResource::SVGDocumentResource:
     113    case CachedResource::LinkPreload:
    113114#if ENABLE(LINK_PREFETCH)
    114115    case CachedResource::LinkPrefetch:
Note: See TracChangeset for help on using the changeset viewer.