OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (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 16 matching lines...) Expand all Loading... |
27 #include "wtf/ListHashSet.h" | 27 #include "wtf/ListHashSet.h" |
28 #include "wtf/RefCounted.h" | 28 #include "wtf/RefCounted.h" |
29 #include "wtf/RefPtr.h" | 29 #include "wtf/RefPtr.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 enum CSSTextFormattingFlags { QuoteCSSStringIfNeeded, AlwaysQuoteCSSString }; | 33 enum CSSTextFormattingFlags { QuoteCSSStringIfNeeded, AlwaysQuoteCSSString }; |
34 | 34 |
35 class CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> { | 35 class CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> { |
36 public: | 36 public: |
37 enum Type { | |
38 CSS_INHERIT = 0, | |
39 CSS_PRIMITIVE_VALUE = 1, | |
40 CSS_VALUE_LIST = 2, | |
41 CSS_CUSTOM = 3, | |
42 CSS_INITIAL = 4 | |
43 }; | |
44 | |
45 // Override RefCounted's deref() to ensure operator delete is called on | 37 // Override RefCounted's deref() to ensure operator delete is called on |
46 // the appropriate subclass type. | 38 // the appropriate subclass type. |
47 // When oilpan is enabled the finalize method is called by the garbage | 39 // When oilpan is enabled the finalize method is called by the garbage |
48 // collector and not immediately when deref reached zero. | 40 // collector and not immediately when deref reached zero. |
49 #if !ENABLE(OILPAN) | 41 #if !ENABLE(OILPAN) |
50 void deref() | 42 void deref() |
51 { | 43 { |
52 if (derefBase()) | 44 if (derefBase()) |
53 destroy(); | 45 destroy(); |
54 } | 46 } |
55 #endif // !ENABLE(OILPAN) | 47 #endif // !ENABLE(OILPAN) |
56 | 48 |
57 Type cssValueType() const; | |
58 | |
59 String cssText() const; | 49 String cssText() const; |
60 | 50 |
61 bool isPrimitiveValue() const { return m_classType == PrimitiveClass; } | 51 bool isPrimitiveValue() const { return m_classType == PrimitiveClass; } |
62 bool isValueList() const { return m_classType >= ValueListClass; } | 52 bool isValueList() const { return m_classType >= ValueListClass; } |
63 | 53 |
64 bool isBaseValueList() const { return m_classType == ValueListClass; } | 54 bool isBaseValueList() const { return m_classType == ValueListClass; } |
65 | 55 |
66 bool isBorderImageSliceValue() const { return m_classType == BorderImageSlic
eClass; } | 56 bool isBorderImageSliceValue() const { return m_classType == BorderImageSlic
eClass; } |
67 bool isCanvasValue() const { return m_classType == CanvasClass; } | 57 bool isCanvasValue() const { return m_classType == CanvasClass; } |
68 bool isCursorImageValue() const { return m_classType == CursorImageClass; } | 58 bool isCursorImageValue() const { return m_classType == CursorImageClass; } |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 { | 218 { |
229 return first ? second && first->equals(*second) : !second; | 219 return first ? second && first->equals(*second) : !second; |
230 } | 220 } |
231 | 221 |
232 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ | 222 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ |
233 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) | 223 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) |
234 | 224 |
235 } // namespace blink | 225 } // namespace blink |
236 | 226 |
237 #endif // CSSValue_h | 227 #endif // CSSValue_h |
OLD | NEW |