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

Issue 1295933003: Add overflow:auto scrollbars to child flex basis. (Closed)

Created:
5 years, 4 months ago by szager1
Modified:
5 years, 1 month ago
CC:
blink-reviews, blink-reviews-paint_chromium.org, blink-reviews-rendering, dshwang, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, skobes, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Add overflow:auto scrollbars to child flex basis. LayoutBlocks delay updating their scrolling information until the uppermost flex box has finished layout. However, if the flex item has overflow:auto, this means that the scrollbar width is not included in the flex item's logical height during flexing. This leads to spurious scrollbars in the flex direction. The original reason for delaying the update of scrolling information was to fix a bug where scroll positions would be lost when a flexbox changed: https://bugs.webkit.org/show_bug.cgi?id=97706 For better or worse, this also turned out to be a performance optimization (albeit at the expense of correctness). Updating the scroll information can cause a block to run layout again, if the existence of scrollbars has changed for the block. If a block in a nested hierarchy of flexboxes runs layout N times during flexing, it would then potentially run one additional layout at the end of flexing, for a total of N+1. However, if the the optimization is removed (i.e., scroll info updating for the flex item is not delayed, but run immediately at the end of layout, potentially triggering a second layout if scrollbars changed), then the potential maximum number of layouts during flexing is N*2. This patch fixes the correctness issue while preserving the optimization: when a flex item runs layout, and its scrollbars have changed, it immediately adds the size of the scrollbars to its logical width/height, but defers the second layout until flexing is finished. The implementation splits the existing code from DeprecatedPaintLayerScrollableArea::updateAfterLayout() into the methods updateScrollDimensions, which is called immediately at the end of layout; and finalizeScrollDimensions, which is called at the end of flexing. When layout happens outside the context of flexing, the two methods are called in immediate sequence, preserving existing behavior. BUG=512229 R=ojan@chromium.org,cbiesinger@chromium.org,leviw@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201824

Patch Set 1 #

Patch Set 2 : Add all tests, even failing ones #

Total comments: 10

Patch Set 3 : Nits scratched, fixed test to pass. #

Patch Set 4 : rebase #

Total comments: 1

Patch Set 5 : Add entries to SlowTests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -40 lines) Patch
M LayoutTests/SlowTests View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/css3/flexbox/overflow-auto-resizes-correctly.html View 1 2 1 chunk +67 lines, -0 lines 0 comments Download
A LayoutTests/css3/flexbox/overflow-auto-resizes-correctly-expected.txt View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutBlock.cpp View 1 2 3 5 chunks +42 lines, -16 lines 0 comments Download
M Source/core/layout/LayoutBox.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/layout/LayoutFlexibleBox.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/layout/LayoutFlexibleBox.cpp View 1 2 3 7 chunks +32 lines, -6 lines 0 comments Download
M Source/core/paint/DeprecatedPaintLayerScrollableArea.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp View 1 2 3 5 chunks +37 lines, -16 lines 0 comments Download

Messages

Total messages: 21 (7 generated)
szager1
Gentlemen, Here is my latest effort, please let me know if this is a waste ...
5 years, 4 months ago (2015-08-20 00:34:55 UTC) #1
leviw_travelin_and_unemployed
I won't get to reviewing this today, but I want to be clear that you're ...
5 years, 4 months ago (2015-08-20 00:39:18 UTC) #2
szager1
cc skobes@, because scrolling.
5 years, 4 months ago (2015-08-20 04:14:21 UTC) #3
leviw_travelin_and_unemployed
lgtm https://codereview.chromium.org/1295933003/diff/20001/Source/core/layout/LayoutBlock.cpp File Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/1295933003/diff/20001/Source/core/layout/LayoutBlock.cpp#newcode100 Source/core/layout/LayoutBlock.cpp:100: bool hasOffset() const { return scrollOffset.width() != 0 ...
5 years, 4 months ago (2015-08-20 18:53:06 UTC) #4
szager1
https://codereview.chromium.org/1295933003/diff/20001/Source/core/layout/LayoutBlock.cpp File Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/1295933003/diff/20001/Source/core/layout/LayoutBlock.cpp#newcode100 Source/core/layout/LayoutBlock.cpp:100: bool hasOffset() const { return scrollOffset.width() != 0 || ...
5 years, 4 months ago (2015-08-20 21:53:29 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295933003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295933003/40001
5 years, 4 months ago (2015-08-20 21:54:50 UTC) #8
leviw_travelin_and_unemployed
On 2015/08/20 at 21:53:29, szager wrote: > https://codereview.chromium.org/1295933003/diff/20001/Source/core/layout/LayoutBlock.cpp > File Source/core/layout/LayoutBlock.cpp (right): > > https://codereview.chromium.org/1295933003/diff/20001/Source/core/layout/LayoutBlock.cpp#newcode100 ...
5 years, 4 months ago (2015-08-20 22:10:57 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/101478)
5 years, 4 months ago (2015-08-21 00:12:25 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295933003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295933003/40001
5 years, 4 months ago (2015-08-21 17:27:43 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/101973)
5 years, 4 months ago (2015-08-21 19:29:54 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295933003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295933003/80001
5 years, 3 months ago (2015-09-04 20:13:14 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://src.chromium.org/viewvc/blink?view=rev&revision=201824
5 years, 3 months ago (2015-09-04 21:45:31 UTC) #19
cbiesinger
https://codereview.chromium.org/1295933003/diff/60001/Source/core/layout/LayoutBlock.cpp File Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/1295933003/diff/60001/Source/core/layout/LayoutBlock.cpp#newcode894 Source/core/layout/LayoutBlock.cpp:894: setLogicalWidth(logicalWidthExcludingScrollbar + scrollbarLogicalWidth()); I thought more about this block ...
5 years, 1 month ago (2015-11-18 18:41:35 UTC) #20
cbiesinger
5 years, 1 month ago (2015-11-18 20:09:51 UTC) #21
Message was sent while issue was closed.
Yeah, the only affected layout test if I remove that setLogicalWidth call is the
one you added here (which I actually find surprising). It also fixes bug 556717

Powered by Google App Engine
This is Rietveld 408576698