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

Issue 1357423007: Avoid scrollbar construction/destruction thrashing during flex layout. (Closed)

Created:
5 years, 3 months ago by szager1
Modified:
5 years, 2 months ago
Reviewers:
pdr., skobes
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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. 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -118 lines) Patch
M third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h View 1 2 3 5 chunks +53 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp View 1 2 3 15 chunks +167 lines, -108 lines 0 comments Download

Messages

Total messages: 13 (1 generated)
szager1
Post-blink-merge, migrated this from: https://codereview.chromium.org/1351743002/
5 years, 3 months ago (2015-09-23 22:00:38 UTC) #1
szager1
Same logic, but use "attach/detach" rather than suppress. PTAL.
5 years, 3 months ago (2015-09-24 18:59:18 UTC) #2
skobes
On 2015/09/24 18:59:18, szager1 wrote: > Same logic, but use "attach/detach" rather than suppress. PTAL. ...
5 years, 3 months ago (2015-09-24 20:17:55 UTC) #3
szager1
On 2015/09/24 20:17:55, skobes wrote: > On 2015/09/24 18:59:18, szager1 wrote: > > Same logic, ...
5 years, 2 months ago (2015-09-25 19:00:30 UTC) #4
skobes
https://codereview.chromium.org/1357423007/diff/40001/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp (right): https://codereview.chromium.org/1357423007/diff/40001/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp#newcode655 third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp:655: m_scrollbarManager.setCanDetachScrollbars(false); Do we need to update / reconstruct the ...
5 years, 2 months ago (2015-09-26 01:57:06 UTC) #5
szager1
https://codereview.chromium.org/1357423007/diff/40001/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp (right): https://codereview.chromium.org/1357423007/diff/40001/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp#newcode655 third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp:655: m_scrollbarManager.setCanDetachScrollbars(false); On 2015/09/26 01:57:06, skobes wrote: > Do we ...
5 years, 2 months ago (2015-09-26 04:48:32 UTC) #6
szager1
https://codereview.chromium.org/1357423007/diff/40001/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h File third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h (right): https://codereview.chromium.org/1357423007/diff/40001/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h#newcode107 third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h:107: unsigned m_canDetachScrollbars: 1; On 2015/09/26 01:57:06, skobes wrote: > ...
5 years, 2 months ago (2015-09-26 04:53:26 UTC) #7
skobes
lgtm
5 years, 2 months ago (2015-09-28 18:01:40 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1357423007/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1357423007/60001
5 years, 2 months ago (2015-09-28 18:42:53 UTC) #10
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 2 months ago (2015-09-28 20:49:15 UTC) #11
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/662a21f7bbebca99b8d968a8104da7fb53af820c Cr-Commit-Position: refs/heads/master@{#351130}
5 years, 2 months ago (2015-09-28 20:50:07 UTC) #12
Lei Zhang
5 years, 2 months ago (2015-09-29 01:13:11 UTC) #13
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/1370373003/ by thestig@chromium.org.

The reason for reverting is: Broke oilpan:

../../third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h:71:5:
error: [blink-gc] Class 'ScrollbarManager' contains invalid fields.
    class ScrollbarManager {
    ^
../../third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h:110:9:
note: [blink-gc] Member field 'm_hBar' in unmanaged class declared here:
        RefPtrWillBeMember<Scrollbar> m_hBar;
        ^
../../third_party/WebKit/Source/platform/heap/Handle.h:919:28: note: expanded
from macro 'RefPtrWillBeMember'
#define RefPtrWillBeMember blink::Member
                           ^
../../third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.h:111:9:
note: [blink-gc] Member field 'm_vBar' in unmanaged class declared here:
        RefPtrWillBeMember<Scrollbar> m_vBar;
        ^
../../third_party/WebKit/Source/platform/heap/Handle.h:919:28: note: expanded
from macro 'RefPtrWillBeMember'
#define RefPtrWillBeMember blink::Member
                           ^
1 error generated..

Powered by Google App Engine
This is Rietveld 408576698