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 16 matching lines...) Expand all Loading... |
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 PassRefPtrWillBeRawPtr<CSSCounterValue> create(PassRefPtrWillBeRawPtr
<CSSPrimitiveValue> identifier, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> listSt
yle, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> separator) |
33 { | 33 { |
34 return adoptRefWillBeNoop(new CSSCounterValue(identifier, listStyle, sep
arator)); | 34 return adoptRefWillBeNoop(new CSSCounterValue(identifier, listStyle, sep
arator)); |
35 } | 35 } |
36 | 36 |
37 String identifier() const { return m_identifier ? m_identifier->getStringVal
ue() : String(); } | 37 String identifier() const { return m_identifier->getStringValue(); } |
38 String listStyle() const { return m_listStyle ? m_listStyle->getStringValue(
) : String(); } | 38 String listStyle() const { return m_listStyle->cssText(); } |
39 String separator() const { return m_separator ? m_separator->getStringValue(
) : String(); } | 39 String separator() const { return m_separator->getStringValue(); } |
40 | 40 |
41 CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getVal
ueID() : CSSValueInvalid; } | 41 CSSValueID listStyleIdent() const { return m_listStyle->getValueID(); } |
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(); | 52 DECLARE_TRACE_AFTER_DISPATCH(); |
53 | 53 |
54 private: | 54 private: |
55 CSSCounterValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> identifier, PassRe
fPtrWillBeRawPtr<CSSPrimitiveValue> listStyle, PassRefPtrWillBeRawPtr<CSSPrimiti
veValue> separator) | 55 CSSCounterValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> identifier, PassRe
fPtrWillBeRawPtr<CSSPrimitiveValue> listStyle, PassRefPtrWillBeRawPtr<CSSPrimiti
veValue> separator) |
56 : CSSValue(CounterClass) | 56 : CSSValue(CounterClass) |
57 , m_identifier(identifier) | 57 , m_identifier(identifier) |
58 , m_listStyle(listStyle) | 58 , m_listStyle(listStyle) |
59 , m_separator(separator) { } | 59 , m_separator(separator) |
| 60 { |
| 61 ASSERT(m_identifier->isCustomIdent()); |
| 62 ASSERT(m_listStyle->isValueID()); |
| 63 ASSERT(m_separator->isCustomIdent()); |
| 64 } |
60 | 65 |
61 RefPtrWillBeMember<CSSPrimitiveValue> m_identifier; // string | 66 RefPtrWillBeMember<CSSPrimitiveValue> m_identifier; // string |
62 RefPtrWillBeMember<CSSPrimitiveValue> m_listStyle; // ident | 67 RefPtrWillBeMember<CSSPrimitiveValue> m_listStyle; // ident |
63 RefPtrWillBeMember<CSSPrimitiveValue> m_separator; // string | 68 RefPtrWillBeMember<CSSPrimitiveValue> m_separator; // string |
64 }; | 69 }; |
65 | 70 |
66 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCounterValue, isCounterValue()); | 71 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCounterValue, isCounterValue()); |
67 | 72 |
68 } // namespace blink | 73 } // namespace blink |
69 | 74 |
70 #endif // CSSCounterValue_h | 75 #endif // CSSCounterValue_h |
OLD | NEW |