OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef CSSParserValues_h | 21 #ifndef CSSParserValues_h |
22 #define CSSParserValues_h | 22 #define CSSParserValues_h |
23 | 23 |
| 24 #include "CSSValueKeywords.h" |
24 #include "core/css/CSSPrimitiveValue.h" | 25 #include "core/css/CSSPrimitiveValue.h" |
25 #include "core/css/CSSSelector.h" | 26 #include "core/css/CSSSelector.h" |
26 #include "core/css/CSSValueList.h" | 27 #include "core/css/CSSValueList.h" |
27 #include <wtf/text/AtomicString.h> | 28 #include "wtf/text/AtomicString.h" |
28 #include <wtf/text/WTFString.h> | 29 #include "wtf/text/WTFString.h" |
29 | 30 |
30 namespace WebCore { | 31 namespace WebCore { |
31 | 32 |
32 class CSSValue; | 33 class CSSValue; |
33 class QualifiedName; | 34 class QualifiedName; |
34 | 35 |
35 struct CSSParserString { | 36 struct CSSParserString { |
36 void init(const LChar* characters, unsigned length) | 37 void init(const LChar* characters, unsigned length) |
37 { | 38 { |
38 m_data.characters8 = characters; | 39 m_data.characters8 = characters; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 const LChar* characters8; | 120 const LChar* characters8; |
120 const UChar* characters16; | 121 const UChar* characters16; |
121 } m_data; | 122 } m_data; |
122 unsigned m_length; | 123 unsigned m_length; |
123 bool m_is8Bit; | 124 bool m_is8Bit; |
124 }; | 125 }; |
125 | 126 |
126 struct CSSParserFunction; | 127 struct CSSParserFunction; |
127 | 128 |
128 struct CSSParserValue { | 129 struct CSSParserValue { |
129 int id; | 130 CSSValueID id; |
130 bool isInt; | 131 bool isInt; |
131 union { | 132 union { |
132 double fValue; | 133 double fValue; |
133 int iValue; | 134 int iValue; |
134 CSSParserString string; | 135 CSSParserString string; |
135 CSSParserFunction* function; | 136 CSSParserFunction* function; |
136 }; | 137 }; |
137 enum { | 138 enum { |
138 Operator = 0x100000, | 139 Operator = 0x100000, |
139 Function = 0x100001, | 140 Function = 0x100001, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 CSSParserSelector* m_functionArgumentSelector; | 233 CSSParserSelector* m_functionArgumentSelector; |
233 }; | 234 }; |
234 | 235 |
235 inline bool CSSParserSelector::hasShadowPseudo() const | 236 inline bool CSSParserSelector::hasShadowPseudo() const |
236 { | 237 { |
237 return m_selector->relation() == CSSSelector::ShadowPseudo; | 238 return m_selector->relation() == CSSSelector::ShadowPseudo; |
238 } | 239 } |
239 | 240 |
240 inline void CSSParserValue::setFromNumber(double value, int unit) | 241 inline void CSSParserValue::setFromNumber(double value, int unit) |
241 { | 242 { |
242 id = 0; | 243 id = CSSValueInvalid; |
243 isInt = false; | 244 isInt = false; |
244 fValue = value; | 245 fValue = value; |
245 this->unit = unit; | 246 this->unit = unit; |
246 } | 247 } |
247 | 248 |
248 } | 249 } |
249 | 250 |
250 #endif | 251 #endif |
OLD | NEW |