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

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

Issue 2709103010: Flip vertical-rl coordinates for Legacy compat (Closed)
Patch Set: CR fix 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
« 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 0d365228ab5da6a1ed7311aac8cb83b1866d7882..67a33262b55619d52b3d2e87240cd676a431d969 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
@@ -32,7 +32,16 @@ void FragmentPositionUpdated(const NGPhysicalFragment& fragment) {
DCHECK(layout_box->parent()) << "Should be called on children only.";
- layout_box->setX(fragment.LeftOffset());
+ // LegacyLayout flips vertical-rl horizontal coordinates before paint.
+ // NGLayout flips X location for LegacyLayout compatibility.
+ LayoutBlock* containing_block = layout_box->containingBlock();
+ if (containing_block->styleRef().isFlippedBlocksWritingMode()) {
+ LayoutUnit container_width = containing_block->size().width();
+ layout_box->setX(container_width - fragment.LeftOffset() -
+ fragment.Width());
+ } else {
+ layout_box->setX(fragment.LeftOffset());
+ }
layout_box->setY(fragment.TopOffset());
}
« 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