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

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

Issue 2347773002: [LayoutNG] Fix broken layout while using CSS's writing modes. (Closed)
Patch Set: synced to the head Created 4 years, 3 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_box.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.cc b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
index 3b628478e2967cf451e9567814fb6b3dd5be630d..482f2f40c237d835fb48fa013864594ec0ab4d73 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -34,7 +34,8 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space,
algorithm_ = new NGBlockLayoutAlgorithm(Style(), FirstChild());
// Change the coordinate system of the constraint space.
NGConstraintSpace* child_constraint_space = new NGConstraintSpace(
- FromPlatformWritingMode(Style()->getWritingMode()), constraint_space);
+ FromPlatformWritingMode(Style()->getWritingMode()),
+ FromPlatformDirection(Style()->direction()), constraint_space);
NGPhysicalFragment* fragment = nullptr;
if (!algorithm_->Layout(child_constraint_space, &fragment))
@@ -83,10 +84,14 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space,
}
LayoutRect overflow = layout_box_->layoutOverflowRect();
// TODO(layout-ng): This does not handle writing modes correctly (for
- // overflow & the enums)
+ // overflow)
NGFragmentBuilder builder(NGPhysicalFragmentBase::FragmentBox);
builder.SetInlineSize(layout_box_->logicalWidth())
.SetBlockSize(layout_box_->logicalHeight())
+ .SetDirection(
+ FromPlatformDirection(layout_box_->styleRef().direction()))
+ .SetWritingMode(
+ FromPlatformWritingMode(layout_box_->styleRef().getWritingMode()))
.SetInlineOverflow(overflow.width())
.SetBlockOverflow(overflow.height());
fragment_ = builder.ToFragment();

Powered by Google App Engine
This is Rietveld 408576698