Commit 7b90d247 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Ignore ConsumedBlockSize for sizing when past block-end.

Consumed block-size includes the size taken up in the fragmentainer.
When a node is overflowed, we may still generate fragments past the
block-end, to hold any overflowing content that spills into subsequent
fragmentainers, but using consumed block-size for anything but legacy
*positioning* (in the flow thread coordinate space) will produce
incorrect results. Since such fragments past the block-end of the node
end have no size, we don't have to update the logical height of the
LayoutBox at all.

Bug: 829028
Change-Id: I7f0a9cde9d9a10b37bd19219705b6b0c8556beba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505141Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821745}
parent 85415a2c
...@@ -1086,10 +1086,14 @@ void NGBlockNode::CopyFragmentDataToLayoutBox( ...@@ -1086,10 +1086,14 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
} else { } else {
DCHECK_EQ(box_->LogicalWidth(), fragment_logical_size.inline_size) DCHECK_EQ(box_->LogicalWidth(), fragment_logical_size.inline_size)
<< "Variable fragment inline size not supported"; << "Variable fragment inline size not supported";
LayoutUnit logical_height = fragment_logical_size.block_size; // Update logical height, unless this fragment is past the block-end of the
if (previous_break_token) // generating node (happens with overflow).
logical_height += previous_break_token->ConsumedBlockSize(); if (previous_break_token && !previous_break_token->IsAtBlockEnd()) {
box_->SetLogicalHeight(logical_height); box_->SetLogicalHeight(fragment_logical_size.block_size +
previous_break_token->ConsumedBlockSize());
} else {
DCHECK_EQ(fragment_logical_size.block_size, LayoutUnit());
}
} }
// TODO(mstensho): This should always be done by the parent algorithm, since // TODO(mstensho): This should always be done by the parent algorithm, since
......
...@@ -1146,7 +1146,6 @@ crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/widows.html [ Failur ...@@ -1146,7 +1146,6 @@ crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/widows.html [ Failur
crbug.com/1079031 virtual/layout_ng_block_frag/fragmentation/abspos-after-forced-break.html [ Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fragmentation/abspos-after-forced-break.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fragmentation/auto-scrollbar-shrink-to-fit.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fragmentation/auto-scrollbar-shrink-to-fit.html [ Failure ]
crbug.com/1079031 virtual/layout_ng_block_frag/fragmentation/content-preceding-first-fragmentainer.html [ Crash Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fragmentation/content-preceding-first-fragmentainer.html [ Crash Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fragmentation/float-after-forced-break.html [ Failure ]
crbug.com/1079031 virtual/layout_ng_block_frag/fragmentation/relayout-abspos.html [ Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fragmentation/relayout-abspos.html [ Failure ]
### With LayoutNGFragmentTraversal (and LayoutNGFragmentItem) enabled: ### With LayoutNGFragmentTraversal (and LayoutNGFragmentItem) enabled:
......
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