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

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

Issue 2457013004: Use NGLogicalRect instead of NGExclusion for exclusions. (Closed)
Patch Set: renamed IsWithing to IsContained Created 4 years, 1 month 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 d52f17d858c99989caea7fcec888dcfde5443383..a8821b681b375806a0ef20feabbf198bb4e12e36 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h
@@ -92,6 +92,7 @@ struct NGPhysicalRect {
NGPhysicalSize size;
};
+// TODO(glebl): move to a separate file in layout/ng/units.
struct CORE_EXPORT NGLogicalRect {
NGLogicalRect() {}
NGLogicalRect(LayoutUnit inline_offset,
@@ -101,9 +102,30 @@ struct CORE_EXPORT NGLogicalRect {
: offset(inline_offset, block_offset), size(inline_size, block_size) {}
bool IsEmpty() const;
+
+ // Whether this rectangle is contained by the provided rectangle.
+ bool IsContained(const NGLogicalRect& other) const;
+
String ToString() const;
bool operator==(const NGLogicalRect& other) const;
+ // Getters
+ LayoutUnit InlineStartOffset() const { return offset.inline_offset; }
+
+ LayoutUnit InlineEndOffset() const {
+ return offset.inline_offset + size.inline_size;
+ }
+
+ LayoutUnit BlockStartOffset() const { return offset.block_offset; }
+
+ LayoutUnit BlockEndOffset() const {
+ return offset.block_offset + size.block_size;
+ }
+
+ LayoutUnit BlockSize() const { return size.block_size; }
+
+ LayoutUnit InlineSize() const { return size.inline_size; }
+
NGLogicalOffset offset;
NGLogicalSize size;
};

Powered by Google App Engine
This is Rietveld 408576698