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

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

Issue 2525033002: Deprecate NGPhysicalConstraintSpace (Closed)
Patch Set: 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_block_layout_algorithm.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index 93a7142ca0529f8a81ea43abe29796a31f782173..276d2e8fd96cc8d38f77b57af8922e0a714aae85 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -29,8 +29,8 @@ namespace {
void AdjustToClearance(const NGConstraintSpace& space,
const ComputedStyle& style,
LayoutUnit* content_size) {
- const NGExclusion* right_exclusion = space.LastRightFloatExclusion();
- const NGExclusion* left_exclusion = space.LastLeftFloatExclusion();
+ const NGExclusion* right_exclusion = space.Exclusions()->last_right_float;
+ const NGExclusion* left_exclusion = space.Exclusions()->last_left_float;
// Calculates Left/Right block end offset from left/right float exclusions or
// use the default content offset position.
@@ -218,13 +218,11 @@ NGLayoutStatus NGBlockLayoutAlgorithm::Layout(
if (adjusted_block_size != NGSizeIndefinite)
adjusted_block_size -= border_and_padding_.BlockSum();
- space_builder_ =
- new NGConstraintSpaceBuilder(constraint_space_->WritingMode());
+ space_builder_ = new NGConstraintSpaceBuilder(constraint_space_);
space_builder_->SetAvailableSize(
NGLogicalSize(adjusted_inline_size, adjusted_block_size));
space_builder_->SetPercentageResolutionSize(
NGLogicalSize(adjusted_inline_size, adjusted_block_size));
-
content_size_ = border_and_padding_.block_start;
builder_ = new NGFragmentBuilder(NGPhysicalFragmentBase::FragmentBox);
@@ -424,19 +422,11 @@ NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() const {
space_builder_->SetIsNewFormattingContext(
IsNewFormattingContextForInFlowBlockLevelChild(ConstraintSpace(),
CurrentChildStyle()));
- NGConstraintSpace* child_space = new NGConstraintSpace(
- constraint_space_->WritingMode(), constraint_space_->Direction(),
- space_builder_->ToConstraintSpace());
+ NGConstraintSpace* child_space = space_builder_->ToConstraintSpace();
// TODO(layout-ng): Set offset through the space builder.
child_space->SetOffset(
NGLogicalOffset(border_and_padding_.inline_start, content_size_));
-
- // TODO(layout-ng): avoid copying here. A child and parent constraint spaces
- // should share the same backing space.
- for (const auto& exclusion : constraint_space_->Exclusions()) {
- child_space->AddExclusion(*exclusion.get());
- }
return child_space;
}

Powered by Google App Engine
This is Rietveld 408576698