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 a8821b681b375806a0ef20feabbf198bb4e12e36..1ee8c1e538dda12907260db06f3530dd736cedcf 100644 |
| --- a/third_party/WebKit/Source/core/layout/ng/ng_units.h |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h |
| @@ -27,6 +27,10 @@ struct NGLogicalSize { |
| NGPhysicalSize ConvertToPhysical(NGWritingMode mode) const; |
| bool operator==(const NGLogicalSize& other) const; |
| + |
| + bool IsEmpty() const { |
| + return inline_size == LayoutUnit(0) || block_size == LayoutUnit(0); |
|
atotic
2016/11/02 23:33:37
Suggestion:
you can also write this as:
return
Gleb Lanbin
2016/11/02 23:46:47
thanks, but I prefer to keep it in this way becaus
|
| + } |
| }; |
| // NGLogicalOffset is the position of a rect (typically a fragment) relative to |
| @@ -53,8 +57,21 @@ struct NGLogicalOffset { |
| NGLogicalOffset operator+(const NGLogicalOffset& other) const; |
| NGLogicalOffset& operator+=(const NGLogicalOffset& other); |
| + |
| + bool operator>(const NGLogicalOffset& other) const; |
| + bool operator>=(const NGLogicalOffset& other) const; |
| + |
| + bool operator<(const NGLogicalOffset& other) const; |
| + bool operator<=(const NGLogicalOffset& other) const; |
| + |
| + String ToString() const; |
| }; |
| +CORE_EXPORT inline std::ostream& operator<<(std::ostream& os, |
| + const NGLogicalOffset& value) { |
| + return os << value.ToString(); |
| +} |
| + |
| // NGPhysicalOffset is the position of a rect (typically a fragment) relative to |
| // its parent rect in the physical coordinate system. |
| struct NGPhysicalOffset { |