| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 class CORE_EXPORT CSSQuadValue : public CSSValue { | 31 class CORE_EXPORT CSSQuadValue : public CSSValue { |
| 32 public: | 32 public: |
| 33 enum TypeForSerialization { | 33 enum TypeForSerialization { |
| 34 SerializeAsRect, | 34 SerializeAsRect, |
| 35 SerializeAsQuad | 35 SerializeAsQuad |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 static RawPtr<CSSQuadValue> create(RawPtr<CSSPrimitiveValue> top, RawPtr<CSS
PrimitiveValue> right, RawPtr<CSSPrimitiveValue> bottom, RawPtr<CSSPrimitiveValu
e> left, TypeForSerialization serializationType) | 38 static CSSQuadValue* create(CSSPrimitiveValue* top, CSSPrimitiveValue* right
, CSSPrimitiveValue* bottom, CSSPrimitiveValue* left, TypeForSerialization seria
lizationType) |
| 39 { | 39 { |
| 40 return new CSSQuadValue(top, right, bottom, left, serializationType); | 40 return new CSSQuadValue(top, right, bottom, left, serializationType); |
| 41 } | 41 } |
| 42 | 42 |
| 43 CSSPrimitiveValue* top() const { return m_top.get(); } | 43 CSSPrimitiveValue* top() const { return m_top.get(); } |
| 44 CSSPrimitiveValue* right() const { return m_right.get(); } | 44 CSSPrimitiveValue* right() const { return m_right.get(); } |
| 45 CSSPrimitiveValue* bottom() const { return m_bottom.get(); } | 45 CSSPrimitiveValue* bottom() const { return m_bottom.get(); } |
| 46 CSSPrimitiveValue* left() const { return m_left.get(); } | 46 CSSPrimitiveValue* left() const { return m_left.get(); } |
| 47 | 47 |
| 48 TypeForSerialization serializationType() { return m_serializationType; } | 48 TypeForSerialization serializationType() { return m_serializationType; } |
| 49 | 49 |
| 50 String customCSSText() const; | 50 String customCSSText() const; |
| 51 | 51 |
| 52 bool equals(const CSSQuadValue& other) const | 52 bool equals(const CSSQuadValue& other) const |
| 53 { | 53 { |
| 54 return compareCSSValuePtr(m_top, other.m_top) | 54 return compareCSSValuePtr(m_top, other.m_top) |
| 55 && compareCSSValuePtr(m_right, other.m_right) | 55 && compareCSSValuePtr(m_right, other.m_right) |
| 56 && compareCSSValuePtr(m_left, other.m_left) | 56 && compareCSSValuePtr(m_left, other.m_left) |
| 57 && compareCSSValuePtr(m_bottom, other.m_bottom); | 57 && compareCSSValuePtr(m_bottom, other.m_bottom); |
| 58 } | 58 } |
| 59 | 59 |
| 60 DECLARE_TRACE_AFTER_DISPATCH(); | 60 DECLARE_TRACE_AFTER_DISPATCH(); |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 CSSQuadValue(RawPtr<CSSPrimitiveValue> top, RawPtr<CSSPrimitiveValue> right,
RawPtr<CSSPrimitiveValue> bottom, RawPtr<CSSPrimitiveValue> left, TypeForSerial
ization serializationType) | 63 CSSQuadValue(CSSPrimitiveValue* top, CSSPrimitiveValue* right, CSSPrimitiveV
alue* bottom, CSSPrimitiveValue* left, TypeForSerialization serializationType) |
| 64 : CSSValue(QuadClass) | 64 : CSSValue(QuadClass) |
| 65 , m_serializationType(serializationType) | 65 , m_serializationType(serializationType) |
| 66 , m_top(top) | 66 , m_top(top) |
| 67 , m_right(right) | 67 , m_right(right) |
| 68 , m_bottom(bottom) | 68 , m_bottom(bottom) |
| 69 , m_left(left) { } | 69 , m_left(left) { } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 TypeForSerialization m_serializationType; | 72 TypeForSerialization m_serializationType; |
| 73 Member<CSSPrimitiveValue> m_top; | 73 Member<CSSPrimitiveValue> m_top; |
| 74 Member<CSSPrimitiveValue> m_right; | 74 Member<CSSPrimitiveValue> m_right; |
| 75 Member<CSSPrimitiveValue> m_bottom; | 75 Member<CSSPrimitiveValue> m_bottom; |
| 76 Member<CSSPrimitiveValue> m_left; | 76 Member<CSSPrimitiveValue> m_left; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 DEFINE_CSS_VALUE_TYPE_CASTS(CSSQuadValue, isQuadValue()); | 79 DEFINE_CSS_VALUE_TYPE_CASTS(CSSQuadValue, isQuadValue()); |
| 80 | 80 |
| 81 } // namespace blink | 81 } // namespace blink |
| 82 | 82 |
| 83 #endif // CSSQuadValue_h | 83 #endif // CSSQuadValue_h |
| OLD | NEW |