diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-26 13:57:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-11-02 11:31:01 +0000 |
commit | 1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch) | |
tree | 8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc | |
parent | 21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff) | |
download | qtwebengine-chromium-1943b3c2a1dcee36c233724fc4ee7613d71b9cf6.tar.gz |
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc b/chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc index 984f06e7d8b..1b67ab8a75a 100644 --- a/chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc +++ b/chromium/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.cc @@ -14,6 +14,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" +#include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" namespace blink { @@ -24,6 +25,9 @@ void NGLineBoxFragmentBuilder::Reset() { oof_positioned_candidates_.Shrink(0); unpositioned_list_marker_ = NGUnpositionedListMarker(); + bfc_block_offset_.reset(); + line_box_bfc_block_offset_.reset(); + size_.inline_size = LayoutUnit(); metrics_ = FontHeight::Empty(); line_box_type_ = NGPhysicalLineBoxFragment::kNormalLineBox; @@ -43,11 +47,15 @@ void NGLineBoxFragmentBuilder::PropagateChildrenData( for (unsigned index = 0; index < children.size(); ++index) { auto& child = children[index]; if (child.layout_result) { - // TODO(almaher): Handle the inline case correctly for OOF fragmentation. - // The relative offset should not always be set to LogicalOffset() here. - PropagateChildData(child.layout_result->PhysicalFragment(), - child.Offset(), - /* relative_offset */ LogicalOffset()); + // An accumulated relative offset is applied to an OOF once it reaches its + // inline container. Subtract out the relative offset to avoid adding it + // twice. + PropagateChildData( + child.layout_result->PhysicalFragment(), + child.Offset() - + ComputeRelativeOffsetForInline(*ConstraintSpace(), + child.PhysicalFragment()->Style()), + /* reltaive_offset */ LogicalOffset()); // Skip over any children, the information should have already been // propagated into this layout result. @@ -65,7 +73,8 @@ void NGLineBoxFragmentBuilder::PropagateChildrenData( } DCHECK(oof_positioned_descendants_.IsEmpty()); - MoveOutOfFlowDescendantCandidatesToDescendants(); + MoveOutOfFlowDescendantCandidatesToDescendants( + /* relative_offset */ LogicalOffset()); } scoped_refptr<const NGLayoutResult> |