Commit 787c7e6c authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Fix shape bug, when inserting a new shelf between others.

This fixes an issue, where we didn't copy across any shape exclusion
data when inserting a new shelf between two other shelves.

Bug: 635619
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Ib26359ab8ac677034ec4e51f2adf1987dadbd91c
Reviewed-on: https://chromium-review.googlesource.com/1255145Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595535}
parent 24330cb7
<!DOCTYPE html>
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
<link rel="match" href="../../../reference/ref-filled-green-100px-square-only.html">
<meta name="assert" content="This checks that a float 'shadowing' a shape-outside float works as expected.">
<style>
#container { width: 100px; line-height: 0; }
#float_1 { float: right; width: 30px; height: 30px; background: green; }
#float_2 { float: left; width: 20px; height: 100px; background: green; shape-outside: inset(0 20px 0 0); }
#float_3 { float: left; width: 30px; height: 50px; background: green; }
.atomic { display: inline-block; background: green; }
</style>
<p>Test passes if there is a filled green square.</p>
<div id="container">
<div id="float_1"></div>
<div id="float_2"></div>
<div id="float_3"></div>
<div class="atomic" style="width: 20px; height: 30px;"></div>
<div class="atomic" style="width: 50px; height: 20px;"></div>
<div class="atomic" style="width: 80px; height: 50px;"></div><div class="atomic" style="width: 20px; height: 50px;"></div>
</div>
......@@ -466,6 +466,12 @@ void NGExclusionSpaceInternal::DerivedGeometry::Add(
CollectSolidEdges(shelf_copy->line_right_edges, new_shelf.block_offset,
&new_shelf.line_right_edges);
// The new shelf adopts the copy exclusions. This may contain
// exclusions which are above this shelf, however we'll filter these
// out when/if we need to calculate the line opportunity.
new_shelf.shape_exclusions = std::move(shelf_copy->shape_exclusions);
new_shelf.has_shape_exclusions = shelf_copy->has_shape_exclusions;
// If we didn't find any edges, the line_left/line_right of the shelf
// are pushed out to be the minimum/maximum.
new_shelf.line_left = new_shelf.line_left_edges.IsEmpty()
......
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