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

Issue 242883002: Remove MediaValues' dependency on RenderStyle (Closed)

Created:
6 years, 8 months ago by Yoav Weiss
Modified:
6 years, 8 months ago
Reviewers:
eseidel
CC:
blink-reviews, kenneth.christiansen, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, rune+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Remove MediaValues' dependency on style MediaValues needed a RenderStyle for default font calculations. However, since a renderer is not always available, and the default font size can also be concluded from the LocalFrame, this dependency can be removed. BUG=357586 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171985

Patch Set 1 #

Patch Set 2 : Use MediaValuesCached in HTMLImageElement #

Total comments: 5

Patch Set 3 : Fixed review comments. Removed style from MediaQueryEvaluator. #

Total comments: 2

Patch Set 4 : Nits and debug assert fix #

Patch Set 5 : Modified minimal recalc tests to represent reduced recalc. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+168 lines, -198 lines) Patch
M LayoutTests/fast/css/add-remove-stylesheets-at-once-minimal-recalc-style.html View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/css/add-remove-stylesheets-at-once-minimal-recalc-style-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/css/add-remove-stylesheets-minimal-recalc-style.html View 1 2 3 4 3 chunks +5 lines, -5 lines 0 comments Download
M LayoutTests/fast/css/add-remove-stylesheets-minimal-recalc-style-expected.txt View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/css/modify-stylesheet-minimal-recalc-style.html View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M LayoutTests/fast/css/modify-stylesheet-minimal-recalc-style-expected.txt View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M Source/core/css/MediaQueryEvaluator.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/MediaQueryEvaluator.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/MediaQueryEvaluatorTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/css/MediaQueryMatcher.cpp View 1 2 1 chunk +1 line, -8 lines 1 comment Download
M Source/core/css/MediaValues.h View 1 2 4 chunks +3 lines, -9 lines 0 comments Download
M Source/core/css/MediaValues.cpp View 1 2 3 5 chunks +70 lines, -13 lines 0 comments Download
M Source/core/css/MediaValuesCached.h View 1 2 3 2 chunks +22 lines, -3 lines 0 comments Download
M Source/core/css/MediaValuesCached.cpp View 1 2 3 4 chunks +23 lines, -71 lines 0 comments Download
M Source/core/css/MediaValuesDynamic.h View 1 2 2 chunks +2 lines, -4 lines 0 comments Download
M Source/core/css/MediaValuesDynamic.cpp View 1 2 3 2 chunks +14 lines, -36 lines 0 comments Download
M Source/core/css/StyleMedia.cpp View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M Source/core/css/parser/SizesAttributeParserTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 1 chunk +1 line, -14 lines 0 comments Download
M Source/core/html/HTMLImageElement.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLLinkElement.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
Yoav Weiss
This is a split from https://codereview.chromium.org/236713005/
6 years, 8 months ago (2014-04-18 08:10:24 UTC) #1
eseidel
I think this code is still a bit confused with the cached vs. dynamic split. ...
6 years, 8 months ago (2014-04-18 16:50:13 UTC) #2
Yoav Weiss
On 2014/04/18 16:50:13, eseidel wrote: > I think this code is still a bit confused ...
6 years, 8 months ago (2014-04-18 20:32:12 UTC) #3
Yoav Weiss
Also - I've removed some code from the MediaQueryEvaluator callers, since they no longer need ...
6 years, 8 months ago (2014-04-18 20:37:00 UTC) #4
eseidel
lgtm https://codereview.chromium.org/242883002/diff/40001/Source/core/css/MediaValuesCached.cpp File Source/core/css/MediaValuesCached.cpp (right): https://codereview.chromium.org/242883002/diff/40001/Source/core/css/MediaValuesCached.cpp#newcode37 Source/core/css/MediaValuesCached.cpp:37: if (!frame) I'm not sure you wnat this. ...
6 years, 8 months ago (2014-04-18 20:41:33 UTC) #5
Yoav Weiss
Seems that eliminating the RenderStyle creation have reduced the number of recalcs. I've changed the ...
6 years, 8 months ago (2014-04-18 22:22:36 UTC) #6
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 8 months ago (2014-04-18 22:24:09 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/242883002/70001
6 years, 8 months ago (2014-04-18 22:24:22 UTC) #8
commit-bot: I haz the power
Change committed as 171985
6 years, 8 months ago (2014-04-18 23:25:44 UTC) #9
eseidel
6 years, 8 months ago (2014-04-19 00:42:15 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/242883002/diff/70001/Source/core/css/MediaQue...
File Source/core/css/MediaQueryMatcher.cpp (left):

https://codereview.chromium.org/242883002/diff/70001/Source/core/css/MediaQue...
Source/core/css/MediaQueryMatcher.cpp:85: RefPtr<RenderStyle> rootStyle =
styleResolver.styleForElement(documentElement, 0 /*defaultParent*/,
DisallowStyleSharing, MatchOnlyUserAgentRules);
Yes, you're removing this recalc, so it's not surprisng that those number go
down.

Powered by Google App Engine
This is Rietveld 408576698