Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc

Issue 2945213004: [LayoutNG] Float behavior simplification before larger patch. (Closed)
Patch Set: update test expectations. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
index b277bea983427a2d2679b1e298deb1ef88dbca16..f2543da65ef54e28b6f9ee6494ab46dd7a800974 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
@@ -417,8 +417,9 @@ void NGLineBreaker::HandleFloat(const NGInlineItem& item,
RefPtr<NGUnpositionedFloat> unpositioned_float = NGUnpositionedFloat::Create(
constraint_space_->AvailableSize(),
constraint_space_->PercentageResolutionSize(),
- constraint_space_->BfcOffset(), constraint_space_->BfcOffset(), margins,
- node, /* break_token */ nullptr);
+ constraint_space_->BfcOffset().inline_offset,
+ constraint_space_->BfcOffset().inline_offset, margins, node,
+ /* break_token */ nullptr);
LayoutUnit inline_size = ComputeInlineSizeForUnpositionedFloat(
constraint_space_, unpositioned_float.Get());
@@ -438,14 +439,12 @@ void NGLineBreaker::HandleFloat(const NGInlineItem& item,
} else {
NGLogicalOffset container_bfc_offset =
container_builder_->BfcOffset().value();
- unpositioned_float->origin_offset = container_bfc_offset + content_offset_;
- unpositioned_float->from_offset.block_offset =
- container_bfc_offset.block_offset;
- unpositioned_float->parent_bfc_block_offset =
- container_bfc_offset.block_offset;
+ LayoutUnit origin_block_offset =
+ container_bfc_offset.block_offset + content_offset_.block_offset;
container_builder_->AddPositionedFloat(
- PositionFloat(unpositioned_float.Get(), constraint_space_));
+ PositionFloat(origin_block_offset, container_bfc_offset.block_offset,
+ unpositioned_float.Get(), constraint_space_));
// We need to recalculate the available_width as the float probably
// consumed space on the line.
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698