Index: third_party/WebKit/Source/core/layout/ng/ng_units.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.h b/third_party/WebKit/Source/core/layout/ng/ng_units.h |
index 95151cc9e863cfc917fade2a82b04378dd7993f2..5eb36a25c9d7e1cfe5bc219e988061291dfe57c0 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.h |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h |
@@ -57,6 +57,9 @@ struct NGLogicalOffset { |
// Converts a logical offset to a physical offset. See: |
// https://drafts.csswg.org/css-writing-modes-3/#logical-to-physical |
+ // PhysicalOffset will be the physical top left point of the rectangle |
+ // described by offset + inner_size. Setting inner_size to 0,0 will return |
+ // the same point. |
// @param outer_size the size of the rect (typically a fragment). |
// @param inner_size the size of the inner rect (typically a child fragment). |
CORE_EXPORT NGPhysicalOffset |
@@ -64,6 +67,7 @@ struct NGLogicalOffset { |
TextDirection, |
NGPhysicalSize outer_size, |
NGPhysicalSize inner_size) const; |
+ |
bool operator==(const NGLogicalOffset& other) const; |
NGLogicalOffset operator+(const NGLogicalOffset& other) const; |
@@ -92,6 +96,9 @@ struct NGPhysicalOffset { |
LayoutUnit left; |
LayoutUnit top; |
+ |
+ NGPhysicalOffset operator+(const NGPhysicalOffset& other) const; |
+ NGPhysicalOffset& operator+=(const NGPhysicalOffset& other); |
}; |
struct NGPhysicalSize { |
@@ -267,6 +274,17 @@ struct NGEdge { |
LayoutUnit end; |
}; |
+// Represents static position of an out of flow descendant. |
+struct CORE_EXPORT NGCorner { |
ikilpatrick
2016/12/02 21:06:13
I half wonder if this should be named NGStaticPosi
|
+ enum Type { kTopLeft, kTopRight, kBottomLeft, kBottomRight }; |
+ |
+ Type type; // Logical corner that corresponds to physical top left. |
+ NGPhysicalOffset offset; |
+ |
+ // Creates a corner with proper type wrt writing mode and direction. |
+ static NGCorner Create(NGWritingMode, TextDirection, NGPhysicalOffset); |
+}; |
+ |
} // namespace blink |
#endif // NGUnits_h |