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

Issue 14604003: When there are no more stylesheets schedule the recalc async (Closed)

Created:
7 years, 7 months ago by esprehn
Modified:
7 years, 3 months ago
CC:
blink-reviews, jamesr
Visibility:
Public.

Description

When there are no more stylesheets schedule the recalc async Document::didRemoveAllPendingStylesheet gets called whenever the pending stylesheet counter goes to zero. This can happen many times in a document if it's inserting inline stylesheets dynamically which then causes many recalcStyle(Force) to happen. This patch switches didRemoveAllPendingStylesheet to instead schedule an async recalc style. This prevents the "waterfall of recalc styles" you can see in apps that append many <style> elements while they're loading. I also removed code that scheduled a relayout when adding or removing stylesheets since it doesn't appear needed or make sense to do this outside the normal recalc style flow. In addition making this change appears to fix the fast/regions/ writing mode tests that were broken by r157174 where ojan and I fixed writing modes for lazy attach. BUG=236063, 282708 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157497

Patch Set 1 #

Patch Set 2 : Fix accidental removal of perf optimization #

Patch Set 3 : Actually do it async, broken in the last diff #

Patch Set 4 : Fix test #

Patch Set 5 : New approach #

Patch Set 6 : Refactor based on review #

Total comments: 2

Patch Set 7 : Add document updateStyleIfNeeded to Text #

Patch Set 8 : Now that we lazyAttach... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -29 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 1 chunk +0 lines, -8 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 4 chunks +14 lines, -21 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
esprehn
7 years, 7 months ago (2013-05-08 01:54:52 UTC) #1
ojan
The body() check makes me uncomfortable. :(
7 years, 7 months ago (2013-05-08 02:05:31 UTC) #2
esprehn
On 2013/05/08 02:05:31, ojan wrote: > The body() check makes me uncomfortable. :( It's wrong ...
7 years, 7 months ago (2013-05-08 03:51:10 UTC) #3
esprehn
ping! It'd be good to get this in. :)
7 years, 7 months ago (2013-05-12 09:04:23 UTC) #4
eseidel
This is a big change. :) I think it warrants careful consideration. It looks fine, ...
7 years, 7 months ago (2013-05-12 09:24:58 UTC) #5
adamk
https://codereview.chromium.org/14604003/diff/15001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/14604003/diff/15001/Source/core/dom/Document.cpp#newcode2611 Source/core/dom/Document.cpp:2611: parser->executeScriptsWaitingForStylesheets(); Do you know if there are tests covering ...
7 years, 7 months ago (2013-05-13 20:48:37 UTC) #6
esprehn
On 2013/05/13 20:48:37, adamk wrote: > https://codereview.chromium.org/14604003/diff/15001/Source/core/dom/Document.cpp > File Source/core/dom/Document.cpp (right): > > https://codereview.chromium.org/14604003/diff/15001/Source/core/dom/Document.cpp#newcode2611 > ...
7 years, 7 months ago (2013-05-21 19:25:42 UTC) #7
esprehn
On 2013/05/12 09:24:58, eseidel wrote: > ... > https://codereview.chromium.org/14604003/diff/15001/Source/core/dom/Element.cpp#newcode1288 > Source/core/dom/Element.cpp:1288: document()->updateStyleIfNeeded(); > This only ...
7 years, 7 months ago (2013-05-21 19:28:04 UTC) #8
eseidel
lgtm
7 years, 7 months ago (2013-05-22 19:21:40 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/14604003/24001
7 years, 7 months ago (2013-05-25 01:46:25 UTC) #10
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=10231
7 years, 7 months ago (2013-05-25 02:53:13 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/14604003/24001
7 years, 6 months ago (2013-05-28 18:02:01 UTC) #12
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=10559
7 years, 6 months ago (2013-05-28 19:15:53 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/14604003/24001
7 years, 6 months ago (2013-05-29 00:11:41 UTC) #14
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=10632
7 years, 6 months ago (2013-05-29 01:13:17 UTC) #15
adamk
On 2013/05/29 01:13:17, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 6 months ago (2013-05-29 01:18:01 UTC) #16
esprehn
I updated this patch now that we lazy attach everywhere.
7 years, 3 months ago (2013-09-10 01:47:38 UTC) #17
ojan
lgtm!
7 years, 3 months ago (2013-09-10 01:50:03 UTC) #18
eseidel
When I tried this I got a failure with fast/css/pending-stylesheet-repaint.html. Clearly you fixed that somehow. ...
7 years, 3 months ago (2013-09-10 01:59:51 UTC) #19
esprehn
On 2013/09/10 01:59:51, eseidel wrote: > When I tried this I got a failure with ...
7 years, 3 months ago (2013-09-10 02:05:46 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/14604003/53001
7 years, 3 months ago (2013-09-10 02:44:18 UTC) #21
commit-bot: I haz the power
7 years, 3 months ago (2013-09-10 04:19:36 UTC) #22
Message was sent while issue was closed.
Change committed as 157497

Powered by Google App Engine
This is Rietveld 408576698