Commit cb767e60 authored by Felipe Erias's avatar Felipe Erias Committed by Commit Bot

Fix scrollbar-gutter when LayoutNG is disabled

Update LayoutBlockFlow::DetermineLogicalLeftPositionForChild to
correctly take into account all the cases where the width of the
logical left scrollbar may be different from 0.

This fixes a problem where the "both" value of scrollbar-gutter
was producing the wrong layout when LayoutNG was disabled.

Bug: 710214
Change-Id: If3481ff2486fc3a7a447b892edc8ef98fa658f1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2459793Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Felipe Erias Morandeira <felipeerias@gmail.com>
Cr-Commit-Position: refs/heads/master@{#815060}
parent ea6d4508
......@@ -690,10 +690,16 @@ void LayoutBlockFlow::DetermineLogicalLeftPositionForChild(LayoutBox& child) {
NOT_DESTROYED();
LayoutUnit start_position = BorderStart() + PaddingStart();
LayoutUnit initial_start_position = start_position;
start_position -= LogicalLeftScrollbarWidth();
LayoutUnit total_available_logical_width =
BorderAndPaddingLogicalWidth() + AvailableLogicalWidth();
if (StyleRef().IsHorizontalWritingMode() &&
!StyleRef().IsLeftToRightDirection()) {
start_position -= LogicalLeftScrollbarWidth();
} else {
start_position += LogicalLeftScrollbarWidth();
}
LayoutUnit child_margin_start = MarginStartForChild(child);
LayoutUnit new_position = start_position + child_margin_start;
......
......@@ -434,12 +434,6 @@ crbug.com/591099 external/wpt/css/css-overflow/webkit-line-clamp-013.html [ Fail
crbug.com/591099 external/wpt/css/css-overflow/webkit-line-clamp-014.html [ Failure ]
crbug.com/591099 external/wpt/css/css-overflow/webkit-line-clamp-027.html [ Failure ]
# More than one scrollbar gutter (i.e. the "both" value of scrollbar-gutter)
crbug.com/710214 wpt_internal/css/css-overflow/scrollbar-gutter-004.html [ Failure ]
crbug.com/710214 wpt_internal/css/css-overflow/scrollbar-gutter-005.html [ Failure ]
crbug.com/710214 wpt_internal/css/css-overflow/scrollbar-gutter-009.html [ Failure ]
crbug.com/710214 wpt_internal/css/css-overflow/scrollbar-gutter-010.html [ Failure ]
# White space, absolute position and paint timing failures from June 5, 2020
crbug.com/591099 external/wpt/paint-timing/fcp-only/fcp-pseudo-element-visibility.html [ Failure ]
crbug.com/591099 external/wpt/css/css-position/position-absolute-center-001.tentative.html [ Failure ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment