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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_units.h

Issue 2540653003: Implement collection of out-of-flow descendants (Closed)
Patch Set: Collection of out-of-flow descendants Created 4 years 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_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

Powered by Google App Engine
This is Rietveld 408576698