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, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 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 11 matching lines...) Expand all Loading... |
22 #define CSSCounterValue_h | 22 #define CSSCounterValue_h |
23 | 23 |
24 #include "core/css/CSSPrimitiveValue.h" | 24 #include "core/css/CSSPrimitiveValue.h" |
25 #include "core/css/CSSValue.h" | 25 #include "core/css/CSSValue.h" |
26 #include "wtf/text/WTFString.h" | 26 #include "wtf/text/WTFString.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 class CSSCounterValue : public CSSValue { | 30 class CSSCounterValue : public CSSValue { |
31 public: | 31 public: |
32 static PassRefPtrWillBeRawPtr<CSSCounterValue> create(PassRefPtrWillBeRawPtr
<CSSPrimitiveValue> identifier, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> listSt
yle, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> separator) | 32 static PassRefPtr<CSSCounterValue> create(PassRefPtr<CSSPrimitiveValue> iden
tifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> s
eparator) |
33 { | 33 { |
34 return adoptRefWillBeNoop(new CSSCounterValue(identifier, listStyle, sep
arator)); | 34 return adoptRef(new CSSCounterValue(identifier, listStyle, separator)); |
35 } | 35 } |
36 | 36 |
37 String identifier() const { return m_identifier ? m_identifier->getStringVal
ue() : String(); } | 37 String identifier() const { return m_identifier ? m_identifier->getStringVal
ue() : String(); } |
38 String listStyle() const { return m_listStyle ? m_listStyle->getStringValue(
) : String(); } | 38 String listStyle() const { return m_listStyle ? m_listStyle->getStringValue(
) : String(); } |
39 String separator() const { return m_separator ? m_separator->getStringValue(
) : String(); } | 39 String separator() const { return m_separator ? m_separator->getStringValue(
) : String(); } |
40 | 40 |
41 CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getVal
ueID() : CSSValueInvalid; } | 41 CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getVal
ueID() : CSSValueInvalid; } |
42 | 42 |
43 bool equals(const CSSCounterValue& other) const | 43 bool equals(const CSSCounterValue& other) const |
44 { | 44 { |
45 return identifier() == other.identifier() | 45 return identifier() == other.identifier() |
46 && listStyle() == other.listStyle() | 46 && listStyle() == other.listStyle() |
47 && separator() == other.separator(); | 47 && separator() == other.separator(); |
48 } | 48 } |
49 | 49 |
50 String customCSSText() const; | 50 String customCSSText() const; |
51 | 51 |
52 DECLARE_TRACE_AFTER_DISPATCH(); | |
53 | |
54 private: | 52 private: |
55 CSSCounterValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> identifier, PassRe
fPtrWillBeRawPtr<CSSPrimitiveValue> listStyle, PassRefPtrWillBeRawPtr<CSSPrimiti
veValue> separator) | 53 CSSCounterValue(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrim
itiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator) |
56 : CSSValue(CounterClass) | 54 : CSSValue(CounterClass) |
57 , m_identifier(identifier) | 55 , m_identifier(identifier) |
58 , m_listStyle(listStyle) | 56 , m_listStyle(listStyle) |
59 , m_separator(separator) { } | 57 , m_separator(separator) { } |
60 | 58 |
61 RefPtrWillBeMember<CSSPrimitiveValue> m_identifier; // string | 59 RefPtr<CSSPrimitiveValue> m_identifier; // string |
62 RefPtrWillBeMember<CSSPrimitiveValue> m_listStyle; // ident | 60 RefPtr<CSSPrimitiveValue> m_listStyle; // ident |
63 RefPtrWillBeMember<CSSPrimitiveValue> m_separator; // string | 61 RefPtr<CSSPrimitiveValue> m_separator; // string |
64 }; | 62 }; |
65 | 63 |
66 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCounterValue, isCounterValue()); | 64 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCounterValue, isCounterValue()); |
67 | 65 |
68 } // namespace blink | 66 } // namespace blink |
69 | 67 |
70 #endif // CSSCounterValue_h | 68 #endif // CSSCounterValue_h |
OLD | NEW |