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

[LayoutNG] Forced breaks trump break avoidance.

Even when there's a forced break deep inside a break-inside:avoid
subtree, we should allow the break.

https://www.w3.org/TR/css-break-3/#breaking-controls

Bug: 829028
Change-Id: I2e098113d3bd73b506cffa22aa87c90e1f7186e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829348
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701476}
parent af596df3
......@@ -2022,8 +2022,9 @@ bool NGBlockLayoutAlgorithm::BreakBeforeChildIfNeeded(
DynamicTo<NGBlockBreakToken>(physical_fragment.BreakToken())) {
// The block child broke inside. We now need to decide whether to keep that
// break, or if it would be better to break before it.
if (!child_token->HasLastResortBreak() &&
!IsAvoidBreakValue(ConstraintSpace(), child.Style().BreakInside())) {
if ((!child_token->HasLastResortBreak() &&
!IsAvoidBreakValue(ConstraintSpace(), child.Style().BreakInside())) ||
layout_result.HasForcedBreak()) {
// The break inside is perfect. Keep it.
return false;
}
......
......@@ -1805,7 +1805,6 @@ crbug.com/591099 virtual/layout_ng_experimental/fragmentation/auto-scrollbar-shr
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/become-unfragmented-with-lines.html [ Crash Pass ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/become-unfragmented-with-unbreakable-blocks.html [ Crash Pass ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/block-after-float-first-child.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/break-inside-avoid-with-forced-break.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/change-fragmentainer-height-block-float-2.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/change-fragmentainer-height-block-float.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/change-fragmentainer-height-inline-float.html [ Failure ]
......
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