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

Issue 219993002: Avoid calling markAncestorsWithChildNeedsStyleRecalc() constantly in childrenChanged (Closed)

Created:
6 years, 8 months ago by esprehn
Modified:
6 years, 8 months ago
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Visibility:
Public.

Description

Avoid calling markAncestorsWithChildNeedsStyleRecalc() constantly in childrenChanged This shows up in the Shadow DOM benchmark where childrenChanged is 2% of the profile because we're calling into inActiveDocument() which is not inline and then doing markAncestorsWithChildNeedsStyleRecalc() which is also not inline without checking if the ancestor marking is actually needed. markAncestorsWithChildNeedsStyleRecalc() also blindly calls document().scheduleRenderTreeUpdate() which is not inline and does a bunch of work. This patch fixes the checks in ::childrenChanged to check the childNeedsStyleRecalc() bit before calling markAncestorsWithChildNeedsStyleRecalc. This is equivalent to checking inActiveDocument() as well since all nodes not in the tree have this bit set, and all nodes in an inactive document will also have this bit set, so we'd never call into markAncestorsWithChildNeedsStyleRecalc() in those trees. It also adds an early out so we don't call into scheduleRenderTreeUpdate() so often when invalidating style. R=eseidel@chromium.org,abarth@chromium.org BUG=357087 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170705

Patch Set 1 #

Total comments: 1

Patch Set 2 : fix it #

Patch Set 3 : fix it again #

Patch Set 4 : and again #

Patch Set 5 : and again #

Patch Set 6 : plus test #

Patch Set 7 : Fix accessibility test and causing recalcs on removal #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -3 lines) Patch
A LayoutTests/fast/css/implicit-attach-marking.html View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/implicit-attach-marking-expected.txt View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/accessibility/slow-document-load.html View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 4 6 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 2 chunks +1 line, -2 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 1 chunk +3 lines, -0 lines 1 comment Download

Messages

Total messages: 41 (0 generated)
esprehn
6 years, 8 months ago (2014-03-31 20:57:45 UTC) #1
eseidel
https://codereview.chromium.org/219993002/diff/1/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/219993002/diff/1/Source/core/dom/Node.cpp#newcode747 Source/core/dom/Node.cpp:747: if (document().hasPendingStyleRecalc()) Why this additional check? Does document().scheduleRenderTreeUpdate not ...
6 years, 8 months ago (2014-03-31 21:01:33 UTC) #2
esprehn
On 2014/03/31 21:01:33, eseidel wrote: > https://codereview.chromium.org/219993002/diff/1/Source/core/dom/Node.cpp > File Source/core/dom/Node.cpp (right): > > https://codereview.chromium.org/219993002/diff/1/Source/core/dom/Node.cpp#newcode747 > ...
6 years, 8 months ago (2014-03-31 21:04:08 UTC) #3
eseidel
OK. My only concern is the lifecycle enum and the Document/RnederView's bool being out of ...
6 years, 8 months ago (2014-03-31 22:22:52 UTC) #4
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-03-31 22:29:13 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/1
6 years, 8 months ago (2014-03-31 22:29:15 UTC) #6
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-31 22:47:00 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 8 months ago (2014-03-31 22:47:00 UTC) #8
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-01 00:18:48 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/1
6 years, 8 months ago (2014-04-01 00:19:12 UTC) #10
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-01 00:35:59 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel tryserver.blink on mac_blink_rel
6 years, 8 months ago (2014-04-01 00:35:59 UTC) #12
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-01 01:16:11 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/1
6 years, 8 months ago (2014-04-01 01:17:06 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-01 01:36:47 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 8 months ago (2014-04-01 01:36:47 UTC) #16
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-01 02:23:21 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/1
6 years, 8 months ago (2014-04-01 02:23:27 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-01 02:33:46 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 8 months ago (2014-04-01 02:33:46 UTC) #20
esprehn
Turns out there was a silly logic bug where I was marking ancestors of the ...
6 years, 8 months ago (2014-04-01 06:42:24 UTC) #21
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-01 06:44:37 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/30004
6 years, 8 months ago (2014-04-01 06:44:50 UTC) #23
eseidel
can we test that bug?
6 years, 8 months ago (2014-04-01 06:59:14 UTC) #24
esprehn
The CQ bit was unchecked by esprehn@chromium.org
6 years, 8 months ago (2014-04-01 07:00:17 UTC) #25
esprehn
On 2014/04/01 06:59:14, eseidel wrote: > can we test that bug? Sure, I'll write a ...
6 years, 8 months ago (2014-04-01 07:00:38 UTC) #26
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-02 01:08:52 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/90001
6 years, 8 months ago (2014-04-02 01:08:55 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-02 01:19:34 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 8 months ago (2014-04-02 01:19:34 UTC) #30
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-02 03:44:52 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/90001
6 years, 8 months ago (2014-04-02 03:44:58 UTC) #32
esprehn
The CQ bit was unchecked by esprehn@chromium.org
6 years, 8 months ago (2014-04-02 03:45:25 UTC) #33
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-02 20:26:26 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/110001
6 years, 8 months ago (2014-04-02 20:26:36 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-02 21:06:09 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 8 months ago (2014-04-02 21:06:09 UTC) #37
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 8 months ago (2014-04-02 21:23:26 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/219993002/110001
6 years, 8 months ago (2014-04-02 21:23:29 UTC) #39
commit-bot: I haz the power
Change committed as 170705
6 years, 8 months ago (2014-04-02 21:54:32 UTC) #40
ojan
6 years, 8 months ago (2014-04-03 16:55:04 UTC) #41
Message was sent while issue was closed.
https://codereview.chromium.org/219993002/diff/110001/Source/core/dom/Node.cpp
File Source/core/dom/Node.cpp (right):

https://codereview.chromium.org/219993002/diff/110001/Source/core/dom/Node.cp...
Source/core/dom/Node.cpp:747: if (document().hasPendingStyleRecalc())
I think this needs a comment explaining why it's here even though it's redundant
with checks in scheduleRenderTreeUpdate. Otherwise someone will look at this
code a year from now and see that this check is redundant and remove it.

Powered by Google App Engine
This is Rietveld 408576698