Chromium Code Reviews| 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..cabebac81abf718b9de25ec9ecf62dab8478edfd 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 within the provided rectangle. |
| + bool IsWithin(const NGLogicalRect& other) const; |
|
atotic
2016/10/31 23:42:40
IsWithin had me confused.
Usual Rect APIs use 'c
atotic
2016/10/31 23:42:40
Confusing to me. Does this mean this is fully encl
|
| + |
| 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; |
|
atotic
2016/10/31 23:42:40
Only simple accessors should be inline according t
|
| + } |
| + |
| + 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; |
| }; |