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 |
@@ -26,6 +26,13 @@ |
bool NGLogicalRect::IsEmpty() const { |
// TODO(layout-dev): equality check shouldn't allocate an object each time. |
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 { |