Chromium Code Reviews| Index: Source/core/rendering/InlineBox.h |
| diff --git a/Source/core/rendering/InlineBox.h b/Source/core/rendering/InlineBox.h |
| index 82dc339ecc957cd78d5273a541a8981deb060af8..53e450d9031034c4e0b919ed971c933d34636be2 100644 |
| --- a/Source/core/rendering/InlineBox.h |
| +++ b/Source/core/rendering/InlineBox.h |
| @@ -33,6 +33,7 @@ class RootInlineBox; |
| // InlineBox represents a rectangle that occurs on a line. It corresponds to |
| // some RenderObject (i.e., it represents a portion of that RenderObject). |
| class InlineBox { |
| + WTF_MAKE_NONCOPYABLE(InlineBox); |
| public: |
| InlineBox(RenderObject& obj) |
| : m_next(0) |
| @@ -182,8 +183,8 @@ public: |
| } |
| void setParent(InlineFlowBox* par) { m_parent = par; } |
| - const RootInlineBox* root() const; |
| - RootInlineBox* root(); |
| + const RootInlineBox& root() const; |
| + RootInlineBox& root(); |
| // x() is the left side of the box in the containing block's coordinate system. |
| void setX(float x) { m_topLeft.setX(x); } |
| @@ -426,6 +427,14 @@ inline void InlineBox::setHasBadParent() |
| #define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \ |
| DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), box.is##typeName()) |
| +// Allow equality comparisons of InlineBox's by reference or pointer, interchangeably. |
|
Inactive
2014/03/03 20:25:18
I don't mind this but I'd like to hear esprehn's o
esprehn
2014/03/03 20:57:23
This is fine with me, having to marshall between r
|
| +inline bool operator==(const InlineBox& a, const InlineBox& b) { return &a == &b; } |
| +inline bool operator==(const InlineBox& a, const InlineBox* b) { return &a == b; } |
| +inline bool operator==(const InlineBox* a, const InlineBox& b) { return a == &b; } |
| +inline bool operator!=(const InlineBox& a, const InlineBox& b) { return !(a == b); } |
| +inline bool operator!=(const InlineBox& a, const InlineBox* b) { return !(a == b); } |
| +inline bool operator!=(const InlineBox* a, const InlineBox& b) { return !(a == b); } |
| + |
| } // namespace WebCore |
| #ifndef NDEBUG |