OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 10 matching lines...) Expand all Loading... |
21 #ifndef Rect_h | 21 #ifndef Rect_h |
22 #define Rect_h | 22 #define Rect_h |
23 | 23 |
24 #include "core/css/CSSPrimitiveValue.h" | 24 #include "core/css/CSSPrimitiveValue.h" |
25 #include "wtf/RefPtr.h" | 25 #include "wtf/RefPtr.h" |
26 #include "wtf/text/StringBuilder.h" | 26 #include "wtf/text/StringBuilder.h" |
27 | 27 |
28 namespace WebCore { | 28 namespace WebCore { |
29 | 29 |
30 class RectBase : public RefCountedWillBeGarbageCollected<RectBase> { | 30 class RectBase : public RefCountedWillBeGarbageCollected<RectBase> { |
| 31 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(RectBase); |
31 public: | 32 public: |
32 CSSPrimitiveValue* top() const { return m_top.get(); } | 33 CSSPrimitiveValue* top() const { return m_top.get(); } |
33 CSSPrimitiveValue* right() const { return m_right.get(); } | 34 CSSPrimitiveValue* right() const { return m_right.get(); } |
34 CSSPrimitiveValue* bottom() const { return m_bottom.get(); } | 35 CSSPrimitiveValue* bottom() const { return m_bottom.get(); } |
35 CSSPrimitiveValue* left() const { return m_left.get(); } | 36 CSSPrimitiveValue* left() const { return m_left.get(); } |
36 | 37 |
37 void setTop(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top) { m_top = top; } | 38 void setTop(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top) { m_top = top; } |
38 void setRight(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right) { m_right = r
ight; } | 39 void setRight(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right) { m_right = r
ight; } |
39 void setBottom(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom) { m_bottom
= bottom; } | 40 void setBottom(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom) { m_bottom
= bottom; } |
40 void setLeft(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left) { m_left = left
; } | 41 void setLeft(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left) { m_left = left
; } |
41 | 42 |
42 bool equals(const RectBase& other) const | 43 bool equals(const RectBase& other) const |
43 { | 44 { |
44 return compareCSSValuePtr(m_top, other.m_top) | 45 return compareCSSValuePtr(m_top, other.m_top) |
45 && compareCSSValuePtr(m_right, other.m_right) | 46 && compareCSSValuePtr(m_right, other.m_right) |
46 && compareCSSValuePtr(m_left, other.m_left) | 47 && compareCSSValuePtr(m_left, other.m_left) |
47 && compareCSSValuePtr(m_bottom, other.m_bottom); | 48 && compareCSSValuePtr(m_bottom, other.m_bottom); |
48 } | 49 } |
49 | 50 |
50 void trace(Visitor*); | 51 void trace(Visitor*); |
51 | 52 |
52 ~RectBase() { } | |
53 | |
54 protected: | 53 protected: |
55 RectBase() { } | 54 RectBase() { } |
56 RectBase(const RectBase& cloneFrom) | 55 RectBase(const RectBase& cloneFrom) |
57 : m_top(cloneFrom.m_top ? cloneFrom.m_top->cloneForCSSOM() : nullptr) | 56 : m_top(cloneFrom.m_top ? cloneFrom.m_top->cloneForCSSOM() : nullptr) |
58 , m_right(cloneFrom.m_right ? cloneFrom.m_right->cloneForCSSOM() : nullp
tr) | 57 , m_right(cloneFrom.m_right ? cloneFrom.m_right->cloneForCSSOM() : nullp
tr) |
59 , m_bottom(cloneFrom.m_bottom ? cloneFrom.m_bottom->cloneForCSSOM() : nu
llptr) | 58 , m_bottom(cloneFrom.m_bottom ? cloneFrom.m_bottom->cloneForCSSOM() : nu
llptr) |
60 , m_left(cloneFrom.m_left ? cloneFrom.m_left->cloneForCSSOM() : nullptr) | 59 , m_left(cloneFrom.m_left ? cloneFrom.m_left->cloneForCSSOM() : nullptr) |
61 { | 60 { |
62 } | 61 } |
63 | 62 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 127 } |
129 | 128 |
130 // NOTE: If adding fields to this class please make the RectBase trace | 129 // NOTE: If adding fields to this class please make the RectBase trace |
131 // method virtual and add a trace method in this subclass tracing the new | 130 // method virtual and add a trace method in this subclass tracing the new |
132 // fields. | 131 // fields. |
133 }; | 132 }; |
134 | 133 |
135 } // namespace WebCore | 134 } // namespace WebCore |
136 | 135 |
137 #endif // Rect_h | 136 #endif // Rect_h |
OLD | NEW |