Avoid 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. Review URL: https://codereview.chromium.org/1357423007 Cr-Commit-Position: refs/heads/master@{#351130}
Showing
This diff is collapsed.
Please register or sign in to comment