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

Issue 1738133002: Add support for media attribute on link (Closed)

Created:
4 years, 10 months ago by Yoav Weiss
Modified:
4 years, 9 months ago
Reviewers:
Nate Chapin
CC:
chromium-reviews, gavinp+prerender_chromium.org, blink-reviews-html_chromium.org, tyoshino+watch_chromium.org, loading-reviews_chromium.org, dglazkov+blink, gavinp+loader_chromium.org, blink-reviews, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for media attribute on link This CL adds support to the `media` attribute on link preload tags and equivalent Link headers. It avoids preloading the resources when media does not match. In order to accurately do that, even when preload is in the headers, and the actual viewport definition is in markup, this CL delays the Link preload header processing until the prelodScanner processed the first chunk, gets the ViewportDescription from the preloadScanner, and applies it before determining if a resource should be preloaded. BUG=590188 Committed: https://crrev.com/bab2e5a737dae7594d25d90bf27965590d3406b3 Cr-Commit-Position: refs/heads/master@{#382603}

Patch Set 1 #

Patch Set 2 : Modified viewport mechanism. improved test. Cannot test meta viewport #

Patch Set 3 : rebase #

Total comments: 1

Patch Set 4 : rebase and test fix #

Patch Set 5 : rebase #

Patch Set 6 : Fix imports crash #

Patch Set 7 : rebase #

Total comments: 8

Patch Set 8 : review nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -123 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/linkHeader/link-preload-in-iframe.html View 1 1 chunk +11 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/linkHeader/resources/iframe-link-headers.php View 1 1 chunk +18 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/preload/meta-viewport-link-headers.html View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/preload/resources/media-link-headers.php View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValues.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValuesCached.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValuesCached.cpp View 1 1 chunk +1 line, -5 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValuesDynamic.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp View 1 3 chunks +24 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLLinkElement.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLLinkElement.cpp View 1 2 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 6 7 7 chunks +16 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h View 4 chunks +13 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp View 1 2 7 chunks +16 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkHeader.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkHeader.cpp View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkHeaderTest.cpp View 1 2 3 4 5 6 2 chunks +49 lines, -44 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoader.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoader.cpp View 1 2 3 4 7 chunks +25 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp View 1 2 3 4 4 chunks +35 lines, -27 lines 0 comments Download

Messages

Total messages: 24 (6 generated)
Yoav Weiss
Hey Nate! :) Can you take a look? The CL here: * Enables the media ...
4 years, 10 months ago (2016-02-26 12:35:44 UTC) #2
Yoav Weiss
On 2016/02/26 12:35:44, Yoav Weiss wrote: > Hey Nate! :) > > Can you take ...
4 years, 10 months ago (2016-02-26 16:05:44 UTC) #3
Nate Chapin
On 2016/02/26 16:05:44, Yoav Weiss wrote: > On 2016/02/26 12:35:44, Yoav Weiss wrote: > > ...
4 years, 9 months ago (2016-02-29 20:45:55 UTC) #4
Yoav Weiss
On 2016/02/29 20:45:55, Nate Chapin wrote: > On 2016/02/26 16:05:44, Yoav Weiss wrote: > > ...
4 years, 9 months ago (2016-02-29 23:20:03 UTC) #5
Nate Chapin
On 2016/02/29 23:20:03, Yoav Weiss wrote: > On 2016/02/29 20:45:55, Nate Chapin wrote: > > ...
4 years, 9 months ago (2016-02-29 23:23:35 UTC) #6
Yoav Weiss
On 2016/02/29 23:23:35, Nate Chapin wrote: > On 2016/02/29 23:20:03, Yoav Weiss wrote: > > ...
4 years, 9 months ago (2016-03-10 13:28:14 UTC) #7
Nate Chapin
Sorry for the delay, one last test idea... https://codereview.chromium.org/1738133002/diff/40001/third_party/WebKit/LayoutTests/http/tests/preload/meta-viewport-link-headers.html File third_party/WebKit/LayoutTests/http/tests/preload/meta-viewport-link-headers.html (right): https://codereview.chromium.org/1738133002/diff/40001/third_party/WebKit/LayoutTests/http/tests/preload/meta-viewport-link-headers.html#newcode24 third_party/WebKit/LayoutTests/http/tests/preload/meta-viewport-link-headers.html:24: window.open("resources/media-link-headers.php"); ...
4 years, 9 months ago (2016-03-15 22:57:41 UTC) #8
Yoav Weiss
On 2016/03/15 22:57:41, Nate Chapin wrote: > Sorry for the delay, one last test idea... ...
4 years, 9 months ago (2016-03-18 12:36:12 UTC) #9
Nate Chapin
lgtm https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode502 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:502: m_isLoadedLinkHeaders = true; I have trouble parsing m_isLoadedLinkHeaders. ...
4 years, 9 months ago (2016-03-18 19:28:02 UTC) #10
sof
dbc https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode496 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:496: ViewportDescription oldDescription; unused? https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h File third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h (right): https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h#newcode48 ...
4 years, 9 months ago (2016-03-18 20:03:43 UTC) #11
sof
https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/loader/FrameLoader.cpp File third_party/WebKit/Source/core/loader/FrameLoader.cpp (left): https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/loader/FrameLoader.cpp#oldcode465 third_party/WebKit/Source/core/loader/FrameLoader.cpp:465: if (m_documentLoader) { On 2016/03/18 20:03:42, sof wrote: > ...
4 years, 9 months ago (2016-03-18 20:40:30 UTC) #12
Yoav Weiss
https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode496 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:496: ViewportDescription oldDescription; On 2016/03/18 20:03:42, sof wrote: > unused? ...
4 years, 9 months ago (2016-03-18 22:02:49 UTC) #13
Yoav Weiss
On 2016/03/18 22:02:49, Yoav Weiss wrote: > > https://codereview.chromium.org/1738133002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h > File third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h (right): > > ...
4 years, 9 months ago (2016-03-22 11:53:59 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1738133002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1738133002/140001
4 years, 9 months ago (2016-03-22 14:50:26 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-22 17:32:16 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1738133002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1738133002/140001
4 years, 9 months ago (2016-03-22 17:38:11 UTC) #21
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 9 months ago (2016-03-22 17:44:34 UTC) #22
commit-bot: I haz the power
4 years, 9 months ago (2016-03-22 17:47:04 UTC) #24
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/bab2e5a737dae7594d25d90bf27965590d3406b3
Cr-Commit-Position: refs/heads/master@{#382603}

Powered by Google App Engine
This is Rietveld 408576698