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

Issue 273783003: Don't schedule invalidations when attributes changed if not needed or incorrect. (Closed)

Created:
6 years, 7 months ago by chrishtr
Modified:
6 years, 7 months ago
Reviewers:
esprehn, ojan
CC:
blink-reviews, blink-reviews-css, sof, eae+blinkwatch, ed+blinkwatch_opera.com, blink-reviews-dom_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, darktears, rune+blink, rwlbuis
Visibility:
Public.

Description

Don't schedule invalidations when attributes changed if not needed or incorrect. In particular, don't do it when attributes changed if there is no style resolver or the style change type is subtree or greater. In both of these cases, it will either have no additional effect or the code is incorrect. It could be incorrect if the element was not yet attached. It could be not needed because if there is no style resolver, re-making it will recalc the whole document's style. Also, style invalidation cannot trigger a style that is greater than subtree. Also clear style invalidation bits unconditionally in Node::detach. BUG=366788 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173665

Patch Set 1 #

Patch Set 2 : Added test. #

Total comments: 6

Patch Set 3 : Addressed comments from esprehn@ #

Patch Set 4 : Add some styleChangeType() < SubtreeStyleChange checks in ContainerNode. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -23 lines) Patch
A LayoutTests/fast/css/invalidation/style-invalidation-before-attach.html View 1 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/invalidation/style-invalidation-before-attach-expected.html View 1 1 chunk +19 lines, -0 lines 0 comments Download
M Source/core/css/invalidation/StyleInvalidator.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 4 chunks +26 lines, -20 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 chunk +1 line, -1 line 2 comments Download
M Source/core/dom/Node.cpp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
chrishtr
6 years, 7 months ago (2014-05-07 22:48:14 UTC) #1
esprehn
https://codereview.chromium.org/273783003/diff/20001/Source/core/css/invalidation/StyleInvalidator.cpp File Source/core/css/invalidation/StyleInvalidator.cpp (right): https://codereview.chromium.org/273783003/diff/20001/Source/core/css/invalidation/StyleInvalidator.cpp#newcode31 Source/core/css/invalidation/StyleInvalidator.cpp:31: ASSERT(element.inActiveDocument() && element.styleChangeType() < SubtreeStyleChange); Lets split this into ...
6 years, 7 months ago (2014-05-08 05:19:05 UTC) #2
chrishtr
https://codereview.chromium.org/273783003/diff/20001/Source/core/css/invalidation/StyleInvalidator.cpp File Source/core/css/invalidation/StyleInvalidator.cpp (right): https://codereview.chromium.org/273783003/diff/20001/Source/core/css/invalidation/StyleInvalidator.cpp#newcode31 Source/core/css/invalidation/StyleInvalidator.cpp:31: ASSERT(element.inActiveDocument() && element.styleChangeType() < SubtreeStyleChange); On 2014/05/08 05:19:06, esprehn ...
6 years, 7 months ago (2014-05-08 05:29:18 UTC) #3
esprehn
lgtm
6 years, 7 months ago (2014-05-08 07:24:37 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/273783003/40001
6 years, 7 months ago (2014-05-08 07:25:18 UTC) #5
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-08 08:53:58 UTC) #6
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-08 10:22:10 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/6913)
6 years, 7 months ago (2014-05-08 10:22:10 UTC) #8
chrishtr
Added some styleChangeType() < SubtreeStyleChange conditionals in ContainerNode for the case of scheduling style recalc ...
6 years, 7 months ago (2014-05-08 17:40:26 UTC) #9
chrishtr
The CQ bit was checked by chrishtr@chromium.org
6 years, 7 months ago (2014-05-08 17:40:30 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/273783003/50007
6 years, 7 months ago (2014-05-08 17:41:39 UTC) #11
commit-bot: I haz the power
Change committed as 173665
6 years, 7 months ago (2014-05-08 19:00:04 UTC) #12
ojan
https://codereview.chromium.org/273783003/diff/50007/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/273783003/diff/50007/Source/core/dom/Element.cpp#newcode2804 Source/core/dom/Element.cpp:2804: if (inActiveDocument() && document().styleResolver() && styleChangeType() < SubtreeStyleChange) We ...
6 years, 7 months ago (2014-05-08 19:14:56 UTC) #13
esprehn
https://codereview.chromium.org/273783003/diff/50007/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/273783003/diff/50007/Source/core/dom/Element.cpp#newcode2804 Source/core/dom/Element.cpp:2804: if (inActiveDocument() && document().styleResolver() && styleChangeType() < SubtreeStyleChange) On ...
6 years, 7 months ago (2014-05-08 19:17:55 UTC) #14
chrishtr
6 years, 7 months ago (2014-05-08 19:54:10 UTC) #15
Message was sent while issue was closed.
I'll post a patch.

Powered by Google App Engine
This is Rietveld 408576698