Commit e739449e authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

LayoutNG: Reposition scrollbars when the location of LayoutBox is updated.

When the location of a box is determined, we should update scrollbar
positions by calling SetLocationAndUpdateOverflowControlsIfNeeded()
instead of SetLocation().

Bug: 1056936
Change-Id: I173d825c123981d55acba2575d673eef0d73a27b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079772
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745397}
parent e422e422
......@@ -195,7 +195,8 @@ void UpdateLegacyMultiColumnFlowThread(
if (!has_processed_first_column_in_flow_thread) {
// The offset of the flow thread should be the same as that of the first
// first column.
flow_thread->SetLocation(child.Offset().ToLayoutPoint());
flow_thread->SetLocationAndUpdateOverflowControlsIfNeeded(
child.Offset().ToLayoutPoint());
flow_thread->SetLogicalWidth(logical_column_fragment.InlineSize());
has_processed_first_column_in_flow_thread = true;
}
......@@ -965,7 +966,7 @@ void NGBlockNode::PlaceChildrenInLayoutBox(
DCHECK(IsA<HTMLFieldSetElement>(content_wrapper->Parent()->GetNode()));
LayoutPoint location = rendered_legend->Location();
location -= content_wrapper->Location();
rendered_legend->SetLocation(location);
rendered_legend->SetLocationAndUpdateOverflowControlsIfNeeded(location);
}
}
......@@ -1021,7 +1022,8 @@ void NGBlockNode::CopyChildFragmentPosition(
offset.left += consumed;
}
layout_box->SetLocation(offset.ToLayoutPoint());
layout_box->SetLocationAndUpdateOverflowControlsIfNeeded(
offset.ToLayoutPoint());
}
// For inline children, NG painters handles fragments directly, but there are
......@@ -1048,7 +1050,8 @@ void NGBlockNode::CopyFragmentDataToLayoutBoxForInlineChildren(
child->Size().width -
maybe_flipped_offset.left;
}
layout_box.SetLocation(maybe_flipped_offset.ToLayoutPoint());
layout_box.SetLocationAndUpdateOverflowControlsIfNeeded(
maybe_flipped_offset.ToLayoutPoint());
}
// Legacy compatibility. This flag is used in paint layer for
......@@ -1095,7 +1098,8 @@ void NGBlockNode::CopyFragmentDataToLayoutBoxForInlineChildren(
child->Size().width -
maybe_flipped_offset.left;
}
layout_box->SetLocation(maybe_flipped_offset.ToLayoutPoint());
layout_box->SetLocationAndUpdateOverflowControlsIfNeeded(
maybe_flipped_offset.ToLayoutPoint());
continue;
}
......
<!DOCTYPE html>
<title>crbug.com/1056936: LayoutNG had an issue about scrollbar positioning</title>
<style>
.spacer {
display: inline-block;
width: 59.5px;
}
.container {
border: 1px solid lime;
display: inline-block;
height: 4em;
width: 39.5px;
overflow-y: scroll
}
</style>
<body>
<div><span class=spacer></span><div class="container"></div></div>
<!-- The test passes if lime border is correctly drawn on top/right/bottom/left
sides. -->
</body>
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