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

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

Issue 2483683003: [LayoutNG] Split apart storage for AvailableSize and PercentageSize. (Closed)
Patch Set: rebase. Created 4 years, 1 month 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 8f46932ec4e067b19f44c1f0577fd40278d402e0..e3f0f37b7e5266688df3a38823c006c19f4e1bb7 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
@@ -15,9 +15,15 @@ NGConstraintSpaceBuilder::NGConstraintSpaceBuilder(NGWritingMode writing_mode)
fragmentation_type_(NGFragmentationType::FragmentNone),
is_new_fc_(false) {}
-NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetContainerSize(
- NGLogicalSize container_size) {
- container_size_ = container_size;
+NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetAvailableSize(
+ NGLogicalSize available_size) {
+ available_size_ = available_size;
+ return *this;
+}
+
+NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetPercentageResolutionSize(
+ NGLogicalSize percentage_resolution_size) {
+ percentage_resolution_size_ = percentage_resolution_size;
return *this;
}
@@ -62,18 +68,22 @@ NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsNewFormattingContext(
}
NGPhysicalConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
- NGPhysicalSize container_size = container_size_.ConvertToPhysical(
+ NGPhysicalSize available_size = available_size_.ConvertToPhysical(
static_cast<NGWritingMode>(writing_mode_));
+ NGPhysicalSize percentage_resolution_size =
+ percentage_resolution_size_.ConvertToPhysical(
+ static_cast<NGWritingMode>(writing_mode_));
+
if (writing_mode_ == HorizontalTopBottom) {
return new NGPhysicalConstraintSpace(
- container_size, is_fixed_size_inline_, is_fixed_size_block_,
- is_inline_direction_triggers_scrollbar_,
+ available_size, percentage_resolution_size, is_fixed_size_inline_,
+ is_fixed_size_block_, is_inline_direction_triggers_scrollbar_,
is_block_direction_triggers_scrollbar_, FragmentNone,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_);
} else {
return new NGPhysicalConstraintSpace(
- container_size, is_fixed_size_block_, is_fixed_size_inline_,
- is_block_direction_triggers_scrollbar_,
+ available_size, percentage_resolution_size, is_fixed_size_block_,
+ is_fixed_size_inline_, is_block_direction_triggers_scrollbar_,
is_inline_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), FragmentNone,
is_new_fc_);

Powered by Google App Engine
This is Rietveld 408576698