Index: Source/core/rendering/RenderObject.h |
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h |
index 399c0380079a52efb44ec07c23aca9afcdf972da..b0239d5910d993b294062f7a6305d505be86cd08 100644 |
--- a/Source/core/rendering/RenderObject.h |
+++ b/Source/core/rendering/RenderObject.h |
@@ -1217,6 +1217,18 @@ private: |
LayoutRect m_newRepaintRect; |
}; |
+// Allow equality comparisons of RenderObject's by reference or pointer, interchangeably. |
+inline bool operator==(const RenderObject& a, const RenderObject& b) { return &a == &b; } |
+inline bool operator==(const RenderObject& a, const RenderObject* b) { return &a == b; } |
+inline bool operator==(const RenderObject* a, const RenderObject& b) { return a == &b; } |
+inline bool operator!=(const RenderObject& a, const RenderObject& b) { return !(a == b); } |
+inline bool operator!=(const RenderObject& a, const RenderObject* b) { return !(a == b); } |
+inline bool operator!=(const RenderObject* a, const RenderObject& b) { return !(a == b); } |
+inline bool operator==(const PassRefPtr<RenderObject>& a, const RenderObject& b) { return a.get() == &b; } |
Inactive
2014/02/28 14:16:42
Are the ones taking PassRefPtrs really needed righ
ostap
2014/02/28 15:37:23
Done.
|
+inline bool operator==(const RenderObject& a, const PassRefPtr<RenderObject>& b) { return &a == b.get(); } |
+inline bool operator!=(const PassRefPtr<RenderObject>& a, const RenderObject& b) { return !(a == b); } |
+inline bool operator!=(const RenderObject& a, const PassRefPtr<RenderObject>& b) { return !(a == b); } |
+ |
inline bool RenderObject::documentBeingDestroyed() const |
{ |
return !document().renderer(); |