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

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

Issue 2821523002: [layoutng] Use correct writing mode for overflow rect (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index de03611e2835241d889832ec21ec312d0a3a5fb8..3905ae5572b212a161a2b323c9e4d24d4b45e10c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -317,13 +317,15 @@ RefPtr<NGLayoutResult> NGBlockNode::RunOldLayout(
const NGConstraintSpace& constraint_space) {
NGLogicalSize available_size = constraint_space.PercentageResolutionSize();
LayoutObject* containing_block = layout_box_->ContainingBlock();
+ NGWritingMode writing_mode =
+ FromPlatformWritingMode(Style().GetWritingMode());
bool parallel_writing_mode;
if (!containing_block) {
parallel_writing_mode = true;
} else {
parallel_writing_mode = IsParallelWritingMode(
FromPlatformWritingMode(containing_block->StyleRef().GetWritingMode()),
- FromPlatformWritingMode(Style().GetWritingMode()));
+ writing_mode);
}
if (parallel_writing_mode) {
layout_box_->SetOverrideContainingBlockContentLogicalWidth(
@@ -356,15 +358,15 @@ RefPtr<NGLayoutResult> NGBlockNode::RunOldLayout(
}
NGLogicalSize box_size(layout_box_->LogicalWidth(),
layout_box_->LogicalHeight());
- // TODO(layout-ng): This does not handle writing modes correctly (for
- // overflow).
- NGLogicalSize overflow_size(layout_box_->LayoutOverflowRect().Width(),
- layout_box_->LayoutOverflowRect().Height());
+ NGPhysicalSize overflow_physical_size(
+ layout_box_->LayoutOverflowRect().Width(),
+ layout_box_->LayoutOverflowRect().Height());
+ NGLogicalSize overflow_size =
+ overflow_physical_size.ConvertToLogical(writing_mode);
NGFragmentBuilder builder(NGPhysicalFragment::kFragmentBox, this);
builder.SetSize(box_size)
.SetDirection(layout_box_->StyleRef().Direction())
- .SetWritingMode(
- FromPlatformWritingMode(layout_box_->StyleRef().GetWritingMode()))
+ .SetWritingMode(writing_mode)
.SetOverflowSize(overflow_size);
return builder.ToBoxFragment();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698