Commit 25c0bbd3 authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

Adjust out-of-flow position for rtl container with left-hand scrollbar

BUG=832569
R=mstenshoe@chromium.org,eae@chromium.org

Change-Id: I3405923d394b4d14a509ac28d84358ca6a58e846
Reviewed-on: https://chromium-review.googlesource.com/1125335
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572536}
parent f2e45b15
<!DOCTYPE html>
<style>
#outer {
direction: rtl;
width: 200px;
height: 200px;
overflow-y: scroll;
}
#inner {
width: 100%;
height: 300px;
background: green;
}
#absolute {
width: 100px;
height: 100px;
background: blue;
position: absolute;
}
</style>
<div id="outer">
<div id="inner">
<div id="absolute"></div>
</div>
</div>
<!DOCTYPE html>
<style>
#outer {
direction: rtl;
position: relative;
width: 200px;
height: 200px;
overflow-y: scroll;
}
#inner {
width: 100%;
height: 300px;
background: green;
}
#absolute {
width: 100px;
height: 100px;
background: blue;
position: absolute;
}
</style>
<div id="outer">
<div id="inner">
<div id="absolute"></div>
</div>
</div>
...@@ -3985,6 +3985,12 @@ void LayoutBox::ComputeInlineStaticDistance( ...@@ -3985,6 +3985,12 @@ void LayoutBox::ComputeInlineStaticDistance(
LayoutUnit static_position = child->Layer()->StaticInlinePosition() + LayoutUnit static_position = child->Layer()->StaticInlinePosition() +
container_logical_width + container_logical_width +
container_block->BorderLogicalLeft(); container_block->BorderLogicalLeft();
if (container_block->IsBox() &&
ToLayoutBox(container_block)
->ShouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
static_position +=
ToLayoutBox(container_block)->OriginAdjustmentForScrollbars().Width();
}
for (LayoutObject* curr = child->Parent(); curr; curr = curr->Container()) { for (LayoutObject* curr = child->Parent(); curr; curr = curr->Container()) {
if (curr->IsBox()) { if (curr->IsBox()) {
if (curr == enclosing_box) if (curr == enclosing_box)
......
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