Commit 4894916d authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Calculate overflow float box fragment children in IFCs.

When a float in an inline formatting context fragments (or just gets
pushed to the next fragmentainer), it won't become a fragment item
there, but rather a regular box fragment child. See crrev.com/2264367

This fix allows us to remove a DCHECK that would otherwise cause the
following tests to fail:
* virtual/layout_ng_block_frag/fast/multicol/float-big-line.html
* virtual/layout_ng_block_frag/fast/multicol/vertical-lr/float-big-line.html
* virtual/layout_ng_block_frag/fast/multicol/vertical-rl/float-big-line.html

Bug: 1132619
Change-Id: I86268da4c146dba89bd7ec36df166ad90b2b5f98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2433926Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811190}
parent d62dfd2c
...@@ -4645,9 +4645,13 @@ void LayoutBlockFlow::RecalcInlineChildrenVisualOverflow() { ...@@ -4645,9 +4645,13 @@ void LayoutBlockFlow::RecalcInlineChildrenVisualOverflow() {
if (const NGFragmentItems* items = fragment.Items()) { if (const NGFragmentItems* items = fragment.Items()) {
NGInlineCursor cursor(*items); NGInlineCursor cursor(*items);
NGFragmentItem::RecalcInkOverflowForCursor(&cursor); NGFragmentItem::RecalcInkOverflowForCursor(&cursor);
} else if (fragment.HasFloatingDescendantsForPaint()) {
RecalcFloatingDescendantsVisualOverflow(fragment);
} }
// Even if this turned out to be an inline formatting context with
// fragment items (handled above), we need to handle floating descendants.
// If a float is block-fragmented, it is resumed as a regular box fragment
// child, rather than becoming a fragment item.
if (fragment.HasFloatingDescendantsForPaint())
RecalcFloatingDescendantsVisualOverflow(fragment);
} }
return; return;
} }
......
...@@ -130,12 +130,7 @@ PhysicalRect NGInkOverflow::FromOutsets(const PhysicalSize& size) const { ...@@ -130,12 +130,7 @@ PhysicalRect NGInkOverflow::FromOutsets(const PhysicalSize& size) const {
PhysicalRect NGInkOverflow::Self(Type type, const PhysicalSize& size) const { PhysicalRect NGInkOverflow::Self(Type type, const PhysicalSize& size) const {
CheckType(type); CheckType(type);
#if DCHECK_IS_ON() DCHECK_NE(type, kNotSet);
// TODO(crbug.com/1132619): Should compute all ink overflow when
// NGBlockFragmentation is enabled.
if (!RuntimeEnabledFeatures::LayoutNGBlockFragmentationEnabled())
DCHECK_NE(type, kNotSet);
#endif
switch (type) { switch (type) {
case kNotSet: case kNotSet:
case kNone: case kNone:
......
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