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

Issue 143873016: Implement style invalidation tree walk for targeted style recalc upon class change. (Closed)

Created:
6 years, 11 months ago by chrishtr
Modified:
6 years, 10 months ago
Reviewers:
esprehn, ojan
CC:
blink-reviews, webcomponents-bugzilla_chromium.org, sof, eae+blinkwatch, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, Inactive
Visibility:
Public.

Description

Implement style invalidation tree walk for targeted style recalc upon class change. "Style invalidation" is defined as the process of deciding whether elements need style recalculation, based on the input of a particular DOM mutation. When the class changes for an element, a style invalidation bit is recorded on it. Just before style is subsequently recomputed on the document, walks the tree to determine which elements have style invalidation needed, and for those elements, calls setNeedsStyleRecalc() on the elements of the element subtree that need it. If we can't figure out which elements exactly need style recalculation, we fall back on the whole subtree. All layout tests pass with and without the runtime flag for this feature. BUG=335247 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166247

Patch Set 1 #

Patch Set 2 : Removed debugging code, cleaned up. #

Patch Set 3 : Cleanup. #

Patch Set 4 : Retry (bad chunks). #

Patch Set 5 : Clean up code in Element. #

Patch Set 6 : Fix typo #

Patch Set 7 : Added const, cleaned up. #

Patch Set 8 : Rebased. #

Patch Set 9 : Rebase. #

Patch Set 10 : Merge. #

Patch Set 11 : Merged. #

Patch Set 12 : Fixed lint. #

Patch Set 13 : Adjusted style. #

Patch Set 14 : Renamed some methods. #

Patch Set 15 : Merge. #

Patch Set 16 : Fixed lint. #

Patch Set 17 : Renamed methods to *StyleInvalidation* #

Patch Set 18 : Fixed comment. #

Patch Set 19 : Removed unused methods. #

Total comments: 36

Patch Set 20 : Addressed most comments. #

Patch Set 21 : Addressed comments. #

Total comments: 6

Patch Set 22 : Added test. #

Patch Set 23 : Simplified test, removed extra code. #

Total comments: 27

Patch Set 24 : Addressed latest comments. #

Patch Set 25 : Merge. #

Total comments: 18

Patch Set 26 : Addressed comments. #

Patch Set 27 : Simplified some code. #

Patch Set 28 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+359 lines, -72 lines) Patch
A LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +34 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css/invalidation/targeted-class-style-invalidation-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/css/RuleFeature.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 5 chunks +27 lines, -2 lines 0 comments Download
M Source/core/css/RuleFeature.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 6 chunks +178 lines, -6 lines 0 comments Download
M Source/core/css/analyzer/DescendantInvalidationSet.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -1 line 0 comments Download
M Source/core/css/analyzer/DescendantInvalidationSet.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 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 17 18 19 20 21 22 23 24 5 chunks +19 lines, -2 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +6 lines, -56 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +11 lines, -1 line 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +14 lines, -0 lines 0 comments Download
M Source/core/dom/shadow/SelectRuleFeatureSet.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +6 lines, -0 lines 0 comments Download
M Source/core/dom/shadow/SelectRuleFeatureSet.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +50 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
chrishtr
6 years, 11 months ago (2014-01-27 21:55:22 UTC) #1
esprehn
Your change description isn't right. :)
6 years, 11 months ago (2014-01-27 23:51:57 UTC) #2
chrishtr
Updated & elaborated, sorry about that. On Mon, Jan 27, 2014 at 3:51 PM, <esprehn@chromium.org> ...
6 years, 11 months ago (2014-01-28 00:01:52 UTC) #3
esprehn
We need a perf test to go with this change. You also want to add ...
6 years, 11 months ago (2014-01-28 00:11:33 UTC) #4
esprehn
btw, it's nice if you wrap your description at 80 cols or so.
6 years, 11 months ago (2014-01-28 00:11:59 UTC) #5
chrishtr
Addressed all except layout test. https://codereview.chromium.org/143873016/diff/600001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/600001/Source/core/css/RuleFeature.cpp#newcode251 Source/core/css/RuleFeature.cpp:251: && !RuntimeEnabledFeatures::targetedStyleRecalcEnabled()) The situation ...
6 years, 11 months ago (2014-01-28 01:11:54 UTC) #6
ojan
https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp#newcode1579 Source/core/dom/Document.cpp:1579: clearChildNeedsStyleInvalidation(); I think we still need to do the ...
6 years, 10 months ago (2014-01-29 00:50:07 UTC) #7
chrishtr
https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp#newcode1579 Source/core/dom/Document.cpp:1579: clearChildNeedsStyleInvalidation(); On 2014/01/29 00:50:07, ojan wrote: > I think ...
6 years, 10 months ago (2014-01-29 01:56:41 UTC) #8
ojan
https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp#newcode1579 Source/core/dom/Document.cpp:1579: clearChildNeedsStyleInvalidation(); On 2014/01/29 01:56:42, Chris Harrelson wrote: > On ...
6 years, 10 months ago (2014-01-29 02:00:24 UTC) #9
chrishtr
https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/143873016/diff/640001/Source/core/dom/Document.cpp#newcode1579 Source/core/dom/Document.cpp:1579: clearChildNeedsStyleInvalidation(); On 2014/01/29 02:00:25, ojan wrote: > On 2014/01/29 ...
6 years, 10 months ago (2014-01-29 02:02:31 UTC) #10
ojan
> Yes. My plan is to try to land the change that removes the timer, ...
6 years, 10 months ago (2014-01-29 02:19:27 UTC) #11
chrishtr
Added a layout test, and a FIXME to adjust the test to the runtime feature ...
6 years, 10 months ago (2014-01-29 23:14:11 UTC) #12
esprehn
Looking pretty good, get rid of the bools and this should be good to land. ...
6 years, 10 months ago (2014-01-30 05:09:24 UTC) #13
chrishtr
https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode100 Source/core/css/RuleFeature.cpp:100: m_targetedStyleRecalcEnabled = RuntimeEnabledFeatures::targetedStyleRecalcEnabled(); On 2014/01/30 05:09:24, esprehn wrote: > ...
6 years, 10 months ago (2014-01-30 17:28:14 UTC) #14
ojan
A bunch more nits. :) https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode400 Source/core/css/RuleFeature.cpp:400: thisElementNeedsStyleRecalc = true; On ...
6 years, 10 months ago (2014-01-30 19:08:38 UTC) #15
chrishtr
https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode400 Source/core/css/RuleFeature.cpp:400: thisElementNeedsStyleRecalc = true; On 2014/01/30 19:08:39, ojan wrote: > ...
6 years, 10 months ago (2014-01-30 19:25:47 UTC) #16
ojan
https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode400 Source/core/css/RuleFeature.cpp:400: thisElementNeedsStyleRecalc = true; On 2014/01/30 19:25:48, Chris Harrelson wrote: ...
6 years, 10 months ago (2014-01-30 19:51:18 UTC) #17
chrishtr
https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode400 Source/core/css/RuleFeature.cpp:400: thisElementNeedsStyleRecalc = true; On 2014/01/30 19:51:18, ojan wrote: > ...
6 years, 10 months ago (2014-01-30 21:39:44 UTC) #18
ojan
https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode400 Source/core/css/RuleFeature.cpp:400: thisElementNeedsStyleRecalc = true; On 2014/01/30 21:39:44, Chris Harrelson wrote: ...
6 years, 10 months ago (2014-01-30 22:15:54 UTC) #19
chrishtr
https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp File Source/core/css/RuleFeature.cpp (right): https://codereview.chromium.org/143873016/diff/670001/Source/core/css/RuleFeature.cpp#newcode400 Source/core/css/RuleFeature.cpp:400: thisElementNeedsStyleRecalc = true; On 2014/01/30 22:15:55, ojan wrote: > ...
6 years, 10 months ago (2014-01-30 22:25:52 UTC) #20
ojan
lgtm
6 years, 10 months ago (2014-01-30 22:29:52 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/143873016/750001
6 years, 10 months ago (2014-01-30 22:30:02 UTC) #22
commit-bot: I haz the power
Failed to apply patch for Source/core/dom/Node.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-01-30 22:30:09 UTC) #23
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-30 22:30:09 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/143873016/770001
6 years, 10 months ago (2014-01-30 22:35:57 UTC) #25
esprehn
There's no extra tree walk, the ancestor chain walk should stop as soon as it ...
6 years, 10 months ago (2014-01-30 23:14:45 UTC) #26
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=24757
6 years, 10 months ago (2014-01-31 01:47:42 UTC) #27
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 01:47:50 UTC) #28
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 01:48:10 UTC) #29
chrishtr
Ah yes, good point, it can check if needsStyleRecalc is true. I didn't think of ...
6 years, 10 months ago (2014-01-31 18:32:31 UTC) #30
chrishtr
The CQ bit was checked by chrishtr@chromium.org
6 years, 10 months ago (2014-01-31 19:01:44 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/143873016/770001
6 years, 10 months ago (2014-01-31 19:02:04 UTC) #32
chrishtr
FYI I discussed with Ojan and he agrees with me that there is an issue ...
6 years, 10 months ago (2014-01-31 19:03:12 UTC) #33
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-01-31 21:21:55 UTC) #34
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=25068
6 years, 10 months ago (2014-01-31 21:21:56 UTC) #35
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 21:22:05 UTC) #36
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 21:22:05 UTC) #37
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 21:24:06 UTC) #38
chrishtr
The CQ bit was checked by chrishtr@chromium.org
6 years, 10 months ago (2014-01-31 21:25:21 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/143873016/770001
6 years, 10 months ago (2014-01-31 21:25:47 UTC) #40
commit-bot: I haz the power
Change committed as 166247
6 years, 10 months ago (2014-01-31 22:48:26 UTC) #41
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 22:48:31 UTC) #42
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 22:48:32 UTC) #43
commit-bot: I haz the power
6 years, 10 months ago (2014-01-31 22:48:46 UTC) #44
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.

Powered by Google App Engine
This is Rietveld 408576698