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

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

Issue 2692643002: Change how NGConstraintSpaceBuilder specified destination space. (Closed)
Patch Set: CR fixes, merge w master 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_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 0d92903cecd8964f77c6475e0d1b1b696c4b49fb..b57b6901654a8960230ed1c0d52a23e259deffda 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
@@ -755,20 +755,22 @@ NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() {
DCHECK(current_child_);
if (current_child_->Type() == NGLayoutInputNode::kLegacyInline) {
// TODO(kojii): Setup space_builder_ appropriately for inline child.
- return space_builder_->ToConstraintSpace();
+ return space_builder_->ToConstraintSpace(
+ FromPlatformWritingMode(Style().getWritingMode()));
// Calculate margins in parent's writing mode.
}
- curr_child_margins_ = CalculateMargins(*space_builder_->ToConstraintSpace(),
- CurrentChildStyle());
+ curr_child_margins_ =
+ CalculateMargins(*space_builder_->ToConstraintSpace(
+ FromPlatformWritingMode(Style().getWritingMode())),
+ CurrentChildStyle());
const ComputedStyle& current_child_style = CurrentChildStyle();
+
bool is_new_bfc = IsNewFormattingContextForInFlowBlockLevelChild(
ConstraintSpace(), current_child_style);
space_builder_->SetIsNewFormattingContext(is_new_bfc)
.SetIsShrinkToFit(
ShouldShrinkToFit(ConstraintSpace(), CurrentChildStyle()))
- .SetWritingMode(
- FromPlatformWritingMode(current_child_style.getWritingMode()))
.SetTextDirection(current_child_style.direction());
LayoutUnit space_available = SpaceAvailableForCurrentChild();
space_builder_->SetFragmentainerSpaceAvailable(space_available);
@@ -813,7 +815,8 @@ NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() {
space_builder_->SetBfcOffset(curr_bfc_offset_);
- return space_builder_->ToConstraintSpace();
+ return space_builder_->ToConstraintSpace(
+ FromPlatformWritingMode(current_child_style.getWritingMode()));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698