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

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

Issue 2655783006: Top down version of algorithm to position margins and floats in LayoutNG (Closed)
Patch Set: Created 3 years, 11 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/ng_constraint_space_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
index ac99cdd46c2c8c7e3304277d7a1a78bca7833097..392ad35373bf40261a2790722b09cdb016b8809a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
@@ -23,6 +23,7 @@ NGConstraintSpaceBuilder::NGConstraintSpaceBuilder(
fragmentation_type_(parent_space->BlockFragmentationType()),
is_new_fc_(parent_space->IsNewFormattingContext()),
text_direction_(static_cast<unsigned>(parent_space->Direction())),
+ bfc_offset_(parent_space->bfc_offset_),
exclusions_(parent_space->Exclusions()) {}
NGConstraintSpaceBuilder::NGConstraintSpaceBuilder(NGWritingMode writing_mode)
@@ -57,6 +58,12 @@ NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetTextDirection(
return *this;
}
+NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetMarginStrut(
+ const NGMarginStrut& margin_strut) {
+ margin_strut_ = margin_strut;
+ return *this;
+}
+
NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsFixedSizeInline(
bool is_fixed_size_inline) {
is_fixed_size_inline_ = is_fixed_size_inline;
@@ -131,7 +138,8 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
is_inline_direction_triggers_scrollbar_,
is_block_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_,
- exclusions);
+ is_new_fc_ ? NGMarginStrut() : margin_strut_,
+ is_new_fc_ ? NGLogicalOffset() : bfc_offset_, exclusions);
ikilpatrick 2017/01/26 00:49:58 TODO ian think....
Gleb Lanbin 2017/01/31 00:25:01 sorry, probably I miss the context here. Can you e
}
return new NGConstraintSpace(
@@ -145,7 +153,7 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
is_block_direction_triggers_scrollbar_,
is_inline_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_,
- exclusions);
+ margin_strut_, bfc_offset_, exclusions);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698