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

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

Issue 2711803007: Add ClearanceOffset to LayoutNG Constraint space. (Closed)
Patch Set: Created 3 years, 10 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 3fafff05294a22c166bfb946610dfc71e698c024..16aec06a269e646b3d58982fab9151bcdce400c1 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
@@ -71,6 +71,18 @@ NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetMarginStrut(
return *this;
}
+NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetBfcOffset(
+ const NGLogicalOffset& offset) {
+ bfc_offset_ = offset;
+ return *this;
+}
+
+NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetClearanceOffset(
+ const WTF::Optional<LayoutUnit>& clearance_offset) {
+ clearance_offset_ = clearance_offset;
+ return *this;
+}
+
NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsFixedSizeInline(
bool is_fixed_size_inline) {
is_fixed_size_inline_ = is_fixed_size_inline;
@@ -158,6 +170,8 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace(
is_new_fc_ ? std::make_shared<NGExclusions>() : exclusions_);
NGLogicalOffset bfc_offset = is_new_fc_ ? NGLogicalOffset() : bfc_offset_;
NGMarginStrut margin_strut = is_new_fc_ ? NGMarginStrut() : margin_strut_;
+ WTF::Optional<LayoutUnit> clearance_offset =
ikilpatrick 2017/02/24 17:36:57 worth adding more comments here for the is_new_fc_
Gleb Lanbin 2017/02/24 18:37:00 Done.
+ is_new_fc_ ? WTF::nullopt : clearance_offset_;
if (is_in_parallel_flow) {
return new NGConstraintSpace(
@@ -169,7 +183,7 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace(
is_inline_direction_triggers_scrollbar_,
is_block_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_,
- margin_strut, bfc_offset, exclusions);
+ margin_strut, bfc_offset, exclusions, clearance_offset);
}
return new NGConstraintSpace(
out_writing_mode, static_cast<TextDirection>(text_direction_),
@@ -179,7 +193,7 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace(
is_block_direction_triggers_scrollbar_,
is_inline_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_,
- margin_strut, bfc_offset, exclusions);
+ margin_strut, bfc_offset, exclusions, clearance_offset);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698