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

Issue 369423002: Have srcset respond to viewport changes (Closed)

Created:
6 years, 5 months ago by Yoav Weiss
Modified:
6 years, 4 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, eae+blinkwatch, ed+blinkwatch_opera.com, rwlbuis, rune+blink, sof
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Have srcset respond to viewport changes This CL gives srcset+sizes based images the ability to react to viewport changes, by selecting a more fitting resource, and by modifying their intrinsic sizing according to the viewport. BUG=392474 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179422

Patch Set 1 #

Patch Set 2 : Added a layout test and a fixme #

Patch Set 3 : Fixed layout test #

Patch Set 4 : Intrinsic sizing works even if image not changed #

Patch Set 5 : merge error #

Patch Set 6 : Self review nits #

Total comments: 7

Patch Set 7 : Oilpan comments #

Total comments: 20

Patch Set 8 : review comments #

Total comments: 4

Patch Set 9 : Oilpan comments #

Total comments: 1

Patch Set 10 : more oilpan #

Patch Set 11 : Add viewport listeners to MQMatcher #

Patch Set 12 : Self review nits #

Total comments: 2

Patch Set 13 : Haraken's comments #

Total comments: 14

Patch Set 14 : Fixed review comments #

Total comments: 1

Patch Set 15 : Got rid of assert #

Total comments: 2

Patch Set 16 : Bug fix and review nit fix #

Patch Set 17 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+370 lines, -149 lines) Patch
A LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes.html View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed-expected.txt View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M Source/core/css/MediaQueryListListener.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/MediaQueryMatcher.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -0 lines 0 comments Download
M Source/core/css/MediaQueryMatcher.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +25 lines, -0 lines 0 comments Download
M Source/core/css/parser/SizesAttributeParser.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -8 lines 0 comments Download
M Source/core/css/parser/SizesAttributeParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +22 lines, -9 lines 0 comments Download
M Source/core/css/parser/SizesAttributeParserTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +48 lines, -40 lines 0 comments Download
M Source/core/css/parser/SizesCalcParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +9 lines, -7 lines 0 comments Download
M Source/core/css/parser/SizesCalcParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +14 lines, -7 lines 0 comments Download
M Source/core/css/parser/SizesCalcParserTest.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +53 lines, -50 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/HTMLImageElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +12 lines, -2 lines 0 comments Download
M Source/core/html/HTMLImageElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +55 lines, -3 lines 0 comments Download
M Source/core/html/parser/HTMLPreloadScanner.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/loader/ImageLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -3 lines 0 comments Download
M Source/core/loader/ImageLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +15 lines, -11 lines 0 comments Download
M Source/core/rendering/RenderImage.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Yoav Weiss
The patch turned out to be bigger then I expected, so please let me know ...
6 years, 5 months ago (2014-07-11 01:31:23 UTC) #1
sof
+oilpan-reviews.
6 years, 5 months ago (2014-07-11 05:46:41 UTC) #2
haraken
I guess this CL won't compile in oilpan builds. Once it compiles, I'm happy to ...
6 years, 5 months ago (2014-07-11 06:10:21 UTC) #3
esprehn
This is not correct, you shouldn't be adding more viewport size machinery, just use the ...
6 years, 5 months ago (2014-07-14 08:39:50 UTC) #4
Yoav Weiss
On 2014/07/14 08:39:50, esprehn wrote: > This is not correct, you shouldn't be adding more ...
6 years, 5 months ago (2014-07-14 14:51:37 UTC) #5
sof
Some Oilpan feedback that might be of help. https://codereview.chromium.org/369423002/diff/120001/Source/core/dom/Document.h File Source/core/dom/Document.h (right): https://codereview.chromium.org/369423002/diff/120001/Source/core/dom/Document.h#newcode1331 Source/core/dom/Document.h:1331: OwnPtrWillBeMember<ViewportChangeNotifier> ...
6 years, 5 months ago (2014-07-14 20:38:09 UTC) #6
Yoav Weiss
Thanks esprehn and sof for the review comments! :) I've updated the CL accordingly. Some ...
6 years, 5 months ago (2014-07-15 09:46:31 UTC) #7
sof
https://codereview.chromium.org/369423002/diff/140001/Source/core/html/HTMLImageElement.h File Source/core/html/HTMLImageElement.h (right): https://codereview.chromium.org/369423002/diff/140001/Source/core/html/HTMLImageElement.h#newcode153 Source/core/html/HTMLImageElement.h:153: RefPtrWillBeMember<Listener> m_listener; Whenever a traceable Member is added to ...
6 years, 5 months ago (2014-07-15 10:27:30 UTC) #8
sof
https://codereview.chromium.org/369423002/diff/160001/Source/core/html/HTMLImageElement.h File Source/core/html/HTMLImageElement.h (right): https://codereview.chromium.org/369423002/diff/160001/Source/core/html/HTMLImageElement.h#newcode153 Source/core/html/HTMLImageElement.h:153: RefPtrWillBeRawPtr<Listener> m_listener; I think you meant to keep this ...
6 years, 5 months ago (2014-07-15 10:57:01 UTC) #9
Yoav Weiss
On 2014/07/15 10:57:01, sof wrote: > https://codereview.chromium.org/369423002/diff/160001/Source/core/html/HTMLImageElement.h > File Source/core/html/HTMLImageElement.h (right): > > https://codereview.chromium.org/369423002/diff/160001/Source/core/html/HTMLImageElement.h#newcode153 > ...
6 years, 5 months ago (2014-07-15 14:01:45 UTC) #10
esprehn
Why can't you create a real MQ? This alwaysNotify thing doesn't make sense, the image ...
6 years, 5 months ago (2014-07-16 22:00:04 UTC) #11
Yoav Weiss
On 2014/07/16 22:00:04, esprehn wrote: > Why can't you create a real MQ? This alwaysNotify ...
6 years, 5 months ago (2014-07-16 22:08:05 UTC) #12
Yoav Weiss
I've updated the patch to do the following: * MQMatcher now has another hashSet containing ...
6 years, 5 months ago (2014-07-24 14:05:05 UTC) #13
haraken
Just a drive-by. https://codereview.chromium.org/369423002/diff/220001/Source/core/html/HTMLImageElement.cpp File Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/369423002/diff/220001/Source/core/html/HTMLImageElement.cpp#newcode63 Source/core/html/HTMLImageElement.cpp:63: void clearElement() { m_element = nullptr; ...
6 years, 5 months ago (2014-07-25 01:01:00 UTC) #14
esprehn
https://codereview.chromium.org/369423002/diff/240001/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html File LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html (right): https://codereview.chromium.org/369423002/diff/240001/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html#newcode23 LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html:23: window.requestAnimationFrame(function() { you don't need the window. prefixes on ...
6 years, 5 months ago (2014-07-25 23:51:56 UTC) #15
Yoav Weiss
On 2014/07/25 23:51:56, esprehn wrote: > https://codereview.chromium.org/369423002/diff/240001/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html > File > LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-when-image-not-changed.html > (right): > > ...
6 years, 5 months ago (2014-07-26 05:32:01 UTC) #16
esprehn
This assert doesn't make sense. https://codereview.chromium.org/369423002/diff/260001/Source/core/dom/ScriptedAnimationController.cpp File Source/core/dom/ScriptedAnimationController.cpp (right): https://codereview.chromium.org/369423002/diff/260001/Source/core/dom/ScriptedAnimationController.cpp#newcode176 Source/core/dom/ScriptedAnimationController.cpp:176: ASSERT(m_mediaQueryListListeners.size()); Why does there ...
6 years, 4 months ago (2014-07-27 16:53:06 UTC) #17
Yoav Weiss
On 2014/07/27 16:53:06, esprehn wrote: > This assert doesn't make sense. > > https://codereview.chromium.org/369423002/diff/260001/Source/core/dom/ScriptedAnimationController.cpp > ...
6 years, 4 months ago (2014-07-27 20:48:45 UTC) #18
esprehn
This lgtm, but you have a typo which looks like a bug. In the future ...
6 years, 4 months ago (2014-08-01 14:06:44 UTC) #19
Yoav Weiss
On 2014/08/01 14:06:44, esprehn wrote: > This lgtm, but you have a typo which looks ...
6 years, 4 months ago (2014-08-01 20:59:24 UTC) #20
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 4 months ago (2014-08-01 21:34:52 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/369423002/320001
6 years, 4 months ago (2014-08-01 21:35:16 UTC) #22
commit-bot: I haz the power
6 years, 4 months ago (2014-08-01 22:21:39 UTC) #23
Message was sent while issue was closed.
Change committed as 179422

Powered by Google App Engine
This is Rietveld 408576698