Commit e26b06fa authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Properly fall back to legacy when BODY gets paginated.

LayoutNG block fragmentation doesn't cope with pagination of out-of-flow
positioned objects, but in this case we shouldn't even be there, because
block fragmentation should trigger fall-back to legacy layout. One check
was too strict to make that happen.

Bug: 879467
Change-Id: I97ef4435ef5dc4a4122c97b58c22c3adf88fd17f
Reviewed-on: https://chromium-review.googlesource.com/1215026
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589960}
parent 57af9203
......@@ -1065,6 +1065,7 @@ crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/widows-and-orphans
crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/widows.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/auto-height.html [ Crash Pass ]
crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/auto-height-with-break.html [ Failure ]
crbug.com/879467 virtual/layout_ng_experimental/fast/pagination/body-make-paginated-table-abspos-crash.html [ Crash ]
crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/break-in-paged-overflow.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/caret-range-outside-paged-x.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/caret-range-outside-paged-x-rtl.html [ Failure ]
......
<!DOCTYPE html>
<table id="table" style="width:300px;">
<tr>
<td>
<div style="position:relative">
<div style="position:absolute"></div>
</div>
</td>
</tr>
</table>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
// See crbug.com/879467 - NG block fragmentation doesn't handle out-of-flow
// positioned objects correctly (invokes legacy pagination, which doesn't
// cooperate with NG block fragmentation). Falling back to legacy for the
// entire document avoids that situation.
test(() => {
// Lay out.
document.body.offsetTop;
// Paginate the document.
document.body.style.overflow = "-webkit-paged-x";
// Make sure we get a deep layout.
document.getElementById("table").style.width = "301px";
}, "No crash when BODY becomes paginated.");
</script>
......@@ -120,9 +120,7 @@ bool ShouldForceLegacyLayout(const ComputedStyle& style,
if (!RuntimeEnabledFeatures::LayoutNGBlockFragmentationEnabled()) {
// Disable NG for the entire subtree if we're establishing a block
// fragmentation context.
if (style.SpecifiesColumns() ||
(style.IsOverflowPaged() &&
&element != document.ViewportDefiningElement()))
if (style.SpecifiesColumns() || style.IsOverflowPaged())
return true;
if (document.Printing()) {
// This needs to be discovered on the root element.
......
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