DescriptionAvoid scrollbar construction/destruction thrashing during flex layout.
BUG=528940
R=skobes@chromium.org,pdr@chromium.org
Before this change:
https://codereview.chromium.org/1295933003
... blocks with overflow:auto would delay updating their scrollbars until
after all flex layout was finished. After the change, scrollbar info is
updated immediately during the course of layout. Flex items may run
layout multiple times during flex layout; if a flex item has auto scrollbars,
it may create and destroy its scrollbars multiple times.
Aside from being a performance problem, this can cause WebScrollbarThemePainter
to point to a stale Scrollbar object. If a flex item has scrollbars prior to
layout; then the flex item destroys and creates scrollbars during layout; and
at the end of layout, it still has a scrollbar; then
CompositedDeprecatedPaintLayerMapping::updateOverflowControlsLayers will not
update the WebScrollbarThemePainter with the final Scrollbar object.
We could fix this in updateOverflowControlsLayers, but that wouldn't address
the performance issue of needlessly creating and destroying scrollbars during
flex layout. This patch avoids destroying scrollbars that are no longer
deemed necessary, until after all flexing is finished.
Committed: https://crrev.com/662a21f7bbebca99b8d968a8104da7fb53af820c
Cr-Commit-Position: refs/heads/master@{#351130}
Patch Set 1 #Patch Set 2 : Switch from "suppress" to "attach" #Patch Set 3 : Fix paint invalidation in destroyScrollbar #
Total comments: 13
Patch Set 4 : Comment fixes. #
Messages
Total messages: 13 (1 generated)
|