DescriptionWhen 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... #
Messages
Total messages: 22 (0 generated)
|