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

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

Issue 2438313003: [LayoutNG] Remove derived constraint spaces from opportunity iterator. (Closed)
Patch Set: address comments. Created 4 years, 2 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/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 411b4d4896255c5bfb0711bf62117a1163513578..1f4b0f619675f42d576168e947bc35bb16df4211 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h
@@ -26,6 +26,7 @@ struct NGLogicalSize {
LayoutUnit block_size;
NGPhysicalSize ConvertToPhysical(NGWritingMode mode) const;
+ bool operator==(const NGLogicalSize& other) const;
};
// NGLogicalOffset is the position of a rect (typically a fragment) relative to
@@ -47,6 +48,7 @@ struct NGLogicalOffset {
NGDirection direction,
NGPhysicalSize container_size,
NGPhysicalSize inner_size) const;
+ bool operator==(const NGLogicalOffset& other) const;
};
// NGPhysicalOffset is the position of a rect (typically a fragment) relative to
@@ -82,10 +84,31 @@ struct NGPhysicalLocation {
};
struct NGPhysicalRect {
+ NGPhysicalOffset offset;
NGPhysicalSize size;
- NGPhysicalLocation location;
};
+struct CORE_EXPORT NGLogicalRect {
+ NGLogicalRect() {}
+ NGLogicalRect(LayoutUnit inline_offset,
+ LayoutUnit block_offset,
+ LayoutUnit inline_size,
+ LayoutUnit block_size)
+ : offset(inline_offset, block_offset), size(inline_size, block_size) {}
+
+ bool IsEmpty() const;
+ String ToString() const;
+ bool operator==(const NGLogicalRect& other) const;
+
+ NGLogicalOffset offset;
+ NGLogicalSize size;
+};
+
+inline std::ostream& operator<<(std::ostream& stream,
+ const NGLogicalRect& value) {
+ return stream << value.ToString();
+}
+
struct NGPixelSnappedPhysicalRect {
int top;
int left;

Powered by Google App Engine
This is Rietveld 408576698