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

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

Issue 2540653003: Implement collection of out-of-flow descendants (Closed)
Patch Set: Removed unused members from block_layout 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..3f382a8f7c99be7ecc5b6379a028aa8b1b272582 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,10 @@ struct NGPhysicalOffset {
LayoutUnit left;
LayoutUnit top;
+
+ NGPhysicalOffset operator+(const NGPhysicalOffset& other) const {
ikilpatrick 2016/12/02 17:47:06 also define: NGPhysicalOffset& operator+=(const NG
atotic 2016/12/02 19:55:16 done. += is not used yet, our current policy see
ikilpatrick 2016/12/02 21:06:13 Thanks - this comes from: https://google.github.io
+ return NGPhysicalOffset{this->left + other.left, this->top + other.top};
+ }
};
struct NGPhysicalSize {
@@ -267,6 +275,17 @@ struct NGEdge {
LayoutUnit end;
};
+// Represents rectangle's physical corner.
ikilpatrick 2016/12/02 17:47:06 Maybe: This struct is used to represent the stati
atotic 2016/12/02 19:55:16 done
+struct CORE_EXPORT NGCorner {
+ enum Type { kTopLeft, kTopRight, kBottomLeft, kBottomRight };
+
+ Type type; // Logical corner that corresponds to physical top left.
ikilpatrick 2016/12/02 17:47:06 remove this comment?
atotic 2016/12/02 19:55:16 Not done. I will not know what type is a year from
+ 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