Commit 0f9021aa authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Flip for writing mode when calculating inline bounding box.

LayoutInline::LinesVisualOverflowBoundingBox() is expected to return
coordinates with a logical block coordinate. So we need to flip for
writing-mode vertical-rl.

Discovered while investigating why
wpt/css/css-position/position-sticky-writing-modes.html fails. It had
some weird repaint issues (that I discovered when picking the test
apart) that this CL fixes. That's not enough to fix the test, though.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I9a8930cc6de01991592282491677327e3406acfb
Reviewed-on: https://chromium-review.googlesource.com/1170835Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582222}
parent 33ecf1c0
<!DOCTYPE html>
<title>vertical-rl, relatively positioned inline in block that overflows smaller parent</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1. Principles of Layout in Vertical Writing Modes">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="position:relative; writing-mode:vertical-rl; width:100px; height:100px; background:green;">
<div style="position:absolute; right:0; top:0; width:0.5em; height:1em; background:red;"></div>
<div style="width:200px;">
<span style="position:relative; color:green; background:green;">XXX</span>
</div>
</div>
...@@ -1177,7 +1177,10 @@ LayoutRect LayoutInline::LinesVisualOverflowBoundingBox() const { ...@@ -1177,7 +1177,10 @@ LayoutRect LayoutInline::LinesVisualOverflowBoundingBox() const {
child_rect.offset += child.offset_to_container_box; child_rect.offset += child.offset_to_container_box;
result.Unite(child_rect); result.Unite(child_rect);
} }
return result.ToLayoutRect(); LayoutRect rect = result.ToLayoutRect();
if (HasFlippedBlocksWritingMode())
ContainingBlock()->FlipForWritingMode(rect);
return rect;
} }
if (!AlwaysCreateLineBoxes()) if (!AlwaysCreateLineBoxes())
......
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