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

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

Issue 2807113002: [LayoutNG] Use NGLogical[Offset|Size] for NGFragment
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
Index: third_party/WebKit/Source/core/layout/ng/geometry/ng_physical_offset.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/geometry/ng_physical_offset.cc b/third_party/WebKit/Source/core/layout/ng/geometry/ng_physical_offset.cc
index 79c94e7b87670cb5fab76588afdbbd2d9f28f63f..9ede836b6e6ab39414f360c30193b5e8f4308def 100644
--- a/third_party/WebKit/Source/core/layout/ng/geometry/ng_physical_offset.cc
+++ b/third_party/WebKit/Source/core/layout/ng/geometry/ng_physical_offset.cc
@@ -4,10 +4,16 @@
#include "core/layout/ng/geometry/ng_physical_offset.h"
+#include "core/layout/ng/geometry/ng_logical_offset.h"
#include "wtf/text/WTFString.h"
namespace blink {
+NGLogicalOffset NGPhysicalOffset::ConvertToLogical(NGWritingMode mode) const {
+ return mode == kHorizontalTopBottom ? NGLogicalOffset(left, top)
+ : NGLogicalOffset(top, left);
cbiesinger 2017/04/10 20:55:51 Is that correct? For vertical-rl, I am not sure th
atotic 2017/04/10 22:44:35 I agree. Computing physical offset of fragment f
+}
+
NGPhysicalOffset NGPhysicalOffset::operator+(
const NGPhysicalOffset& other) const {
return NGPhysicalOffset{this->left + other.left, this->top + other.top};

Powered by Google App Engine
This is Rietveld 408576698