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

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

Issue 2540653003: Implement collection of out-of-flow descendants (Closed)
Patch Set: Merge conflicts resolved 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 965f2f3e5c7619f7a56dd48b4b061c5dc0287dea..8ddc7091183750865eb047b2fe9918ebd366b937 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 {
@@ -286,6 +293,19 @@ struct NGEdge {
LayoutUnit end;
};
+// Represents static position of an out of flow descendant.
+struct CORE_EXPORT NGStaticPosition {
+ enum Type { kTopLeft, kTopRight, kBottomLeft, kBottomRight };
+
+ Type type; // Logical corner that corresponds to physical top left.
+ NGPhysicalOffset offset;
+
+ // Creates a position with proper type wrt writing mode and direction.
+ static NGStaticPosition Create(NGWritingMode,
+ TextDirection,
+ NGPhysicalOffset);
+};
+
} // namespace blink
#endif // NGUnits_h
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc ('k') | third_party/WebKit/Source/core/layout/ng/ng_units.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698