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

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

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.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.cc b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
index 5537f4b37d567414e58bb74a1b4396480b7bf67a..71e9f0b0dea3928c3ff3da73cc714cc119753bea 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
@@ -28,6 +28,13 @@ bool NGLogicalRect::IsEmpty() const {
return *this == NGLogicalRect();
}
+bool NGLogicalRect::IsContained(const NGLogicalRect& other) const {
+ return !(InlineEndOffset() <= other.InlineStartOffset() ||
+ BlockEndOffset() <= other.BlockStartOffset() ||
+ InlineStartOffset() >= other.InlineEndOffset() ||
+ BlockStartOffset() >= other.BlockEndOffset());
+}
+
bool NGLogicalRect::operator==(const NGLogicalRect& other) const {
return std::tie(other.offset, other.size) == std::tie(offset, size);
}

Powered by Google App Engine
This is Rietveld 408576698