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

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: .. 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 0d1e37cc47bd95ef9a776adae99b6cf23583e789..cb24c0af6536720109038f5eaf1c1f0854794d0e 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
@@ -78,10 +80,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