Commit 53c17cbf authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Reset additional members inside NGLineBoxFragmentBuilder::Reset

This was found when I was debugging failures within:
https://chromium-review.googlesource.com/c/chromium/src/+/1553646

Essentially we didn't clear all the members within the Reset call.
The initial bug I found meant that OOF-positioned candidates appeared
multiple times within a layout result.

Bug: 635619
Change-Id: I26acdad2c85045ce155449379cce68c447b39d99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559930
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649155}
parent 5e7c79b2
...@@ -15,11 +15,22 @@ ...@@ -15,11 +15,22 @@
namespace blink { namespace blink {
void NGLineBoxFragmentBuilder::Reset() { void NGLineBoxFragmentBuilder::Reset() {
children_.resize(0); children_.Shrink(0);
offsets_.resize(0); offsets_.Shrink(0);
line_box_type_ = NGPhysicalLineBoxFragment::kNormalLineBox; child_break_tokens_.Shrink(0);
metrics_ = NGLineHeightMetrics(); inline_break_tokens_.Shrink(0);
oof_positioned_candidates_.Shrink(0);
size_.inline_size = LayoutUnit(); size_.inline_size = LayoutUnit();
metrics_ = NGLineHeightMetrics();
line_box_type_ = NGPhysicalLineBoxFragment::kNormalLineBox;
has_last_resort_break_ = false;
has_floating_descendants_ = false;
has_orthogonal_flow_roots_ = false;
has_child_that_depends_on_percentage_block_size_ = false;
has_block_fragmentation_ = false;
may_have_descendant_above_block_start_ = false;
} }
void NGLineBoxFragmentBuilder::SetIsEmptyLineBox() { void NGLineBoxFragmentBuilder::SetIsEmptyLineBox() {
......
...@@ -239,11 +239,10 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder { ...@@ -239,11 +239,10 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
NGFloatTypes adjoining_floats_ = kFloatTypeNone; NGFloatTypes adjoining_floats_ = kFloatTypeNone;
bool has_last_resort_break_ = false;
bool is_pushed_by_floats_ = false; bool is_pushed_by_floats_ = false;
bool is_old_layout_root_ = false; bool is_old_layout_root_ = false;
bool has_last_resort_break_ = false;
bool has_floating_descendants_ = false; bool has_floating_descendants_ = false;
bool has_orthogonal_flow_roots_ = false; bool has_orthogonal_flow_roots_ = false;
bool has_child_that_depends_on_percentage_block_size_ = false; bool has_child_that_depends_on_percentage_block_size_ = false;
......
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