Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Issue 2903653005: [preload] Mandatory `as` value and related spec alignments (Closed)

Created:
3 years, 7 months ago by Yoav Weiss
Modified:
3 years, 6 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, blink-reviews-w3ctests_chromium.org, chromium-reviews, dglazkov+blink, gavinp+prerender_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[preload] Mandatory `as` value and related spec alignments The motivation for this change is to avoid double downloads following developer confusion around empty `as` values, enable feature detection of supported `as` values, and simplify the HTML processing model. Details below: * Avoid fetching a resource if `as` is missing - we've seen many cases where developers omit the `as` value from their preload links, which often results in double downloads. We've also had developer feedback that an empty `as` value being mapped to XHR/fetch() feels magical. This change addresses that, by defining a "fetch" value for these cases and ignoring empty/missing `as` values. * Properly reflect a limited set of known `as` values - enable feature detection of supported `as` values (instead of the `onerror` based fallback, which we're deprecating. * Avoid triggering the "onerror" event when an invalid `as` value is encountered - simplify HTML's processing model. BUG=726647, 715690, 698520 Review-Url: https://codereview.chromium.org/2903653005 Cr-Commit-Position: refs/heads/master@{#476840} Committed: https://chromium.googlesource.com/chromium/src/+/1f18863cc9b2a5fe463671f3eb60de2f95bbf283

Patch Set 1 #

Patch Set 2 : Test fixes and removal of duplicate onerror test #

Patch Set 3 : Fix unit tests #

Patch Set 4 : Fixed a bunch of other tests #

Patch Set 5 : Fixed moar tests #

Patch Set 6 : style #

Total comments: 6

Patch Set 7 : Add case-sensitivity tests #

Total comments: 2

Patch Set 8 : IDL changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -265 lines) Patch
M third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt View 1 2 3 1 chunk +61 lines, -189 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/preload/download-resources.html View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/preload/onerror-event.html View 3 chunks +8 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/preload/onload-event.html View 3 chunks +5 lines, -2 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/opaque-response-preloaded-iframe.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-validity.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/preload/link_header_preload_on_commit.php View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction.html View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/preload/memcache_reuse_of_non_cacheable_preload.html View 1 1 chunk +1 line, -0 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/preload/onerror_event.html View 1 1 chunk +0 lines, -44 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/link-crossorigin-preload-anonymous.html View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/link-crossorigin-preload-no-cors.html View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/link-crossorigin-preload-use-credentials.html View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLLinkElement.idl View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoader.cpp View 6 chunks +4 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp View 1 2 3 4 5 2 chunks +11 lines, -4 lines 0 comments Download

Messages

Total messages: 53 (40 generated)
mizilaslan
On 2017/05/24 14:44:15, commit-bot: I haz the power wrote: > Dry run: Try jobs failed ...
3 years, 7 months ago (2017-05-24 22:58:40 UTC) #15
mizilaslan
On 2017/05/24 22:58:40, mizilaslan wrote: > On 2017/05/24 14:44:15, commit-bot: I haz the power wrote: ...
3 years, 7 months ago (2017-05-24 22:59:04 UTC) #16
Mike West
Implementation looks good! I have some questions about the tests, though. https://codereview.chromium.org/2903653005/diff/100001/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt File third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt (right): ...
3 years, 6 months ago (2017-05-28 06:21:09 UTC) #28
Charlie Harrison
I think this change is nice but I'm wondering if we're far enough along in ...
3 years, 6 months ago (2017-05-28 22:22:43 UTC) #29
Yoav Weiss
https://codereview.chromium.org/2903653005/diff/100001/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt File third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt (right): https://codereview.chromium.org/2903653005/diff/100001/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt#newcode37 third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt:37: FAIL link.as: setAttribute() to "DOCUMENT" assert_equals: IDL get expected ...
3 years, 6 months ago (2017-05-31 05:00:41 UTC) #30
Yoav Weiss
On 2017/05/28 22:22:43, Charlie Harrison wrote: > I think this change is nice but I'm ...
3 years, 6 months ago (2017-05-31 05:02:18 UTC) #31
Charlie Harrison
On 2017/05/31 05:02:18, Yoav Weiss wrote: > On 2017/05/28 22:22:43, Charlie Harrison wrote: > > ...
3 years, 6 months ago (2017-05-31 12:26:01 UTC) #37
Charlie Harrison
LGTM but would you wrap the CL desc to 80 cols? I will be happy ...
3 years, 6 months ago (2017-05-31 12:36:51 UTC) #38
Yoav Weiss
On 2017/05/31 12:36:51, Charlie Harrison wrote: > LGTM but would you wrap the CL desc ...
3 years, 6 months ago (2017-05-31 13:01:10 UTC) #42
domenic
https://codereview.chromium.org/2903653005/diff/120001/third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html File third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html (right): https://codereview.chromium.org/2903653005/diff/120001/third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html#newcode1 third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html:1: <!DOCTYPE html> I think this test is redundant with ...
3 years, 6 months ago (2017-06-02 21:27:46 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2903653005/140001
3 years, 6 months ago (2017-06-02 21:47:54 UTC) #49
Yoav Weiss
On 2017/06/02 21:27:46, domenic wrote: > https://codereview.chromium.org/2903653005/diff/120001/third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html > File third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html > (right): > > https://codereview.chromium.org/2903653005/diff/120001/third_party/WebKit/LayoutTests/external/wpt/preload/reflected-as-value.html#newcode1 ...
3 years, 6 months ago (2017-06-02 21:49:51 UTC) #50
commit-bot: I haz the power
3 years, 6 months ago (2017-06-03 00:21:02 UTC) #53
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/1f18863cc9b2a5fe463671f3eb60...

Powered by Google App Engine
This is Rietveld 408576698