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, |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 inline bool CSSParserSelector::hasShadowPseudo() const | 262 inline bool CSSParserSelector::hasShadowPseudo() const |
263 { | 263 { |
264 return m_selector->relation() == CSSSelector::ShadowPseudo; | 264 return m_selector->relation() == CSSSelector::ShadowPseudo; |
265 } | 265 } |
266 | 266 |
267 inline void CSSParserValue::setFromNumber(double value, int unit) | 267 inline void CSSParserValue::setFromNumber(double value, int unit) |
268 { | 268 { |
269 id = CSSValueInvalid; | 269 id = CSSValueInvalid; |
270 isInt = false; | 270 isInt = false; |
271 if (std::isfinite(value)) | 271 fValue = value; |
272 fValue = value; | 272 this->unit = std::isfinite(value) ? unit : CSSPrimitiveValue::CSS_UNKNOWN; |
273 else | |
274 fValue = 0; | |
275 this->unit = unit; | |
276 } | 273 } |
277 | 274 |
278 inline void CSSParserValue::setFromOperator(UChar c) | 275 inline void CSSParserValue::setFromOperator(UChar c) |
279 { | 276 { |
280 id = CSSValueInvalid; | 277 id = CSSValueInvalid; |
281 unit = Operator; | 278 unit = Operator; |
282 iValue = c; | 279 iValue = c; |
283 isInt = false; | 280 isInt = false; |
284 } | 281 } |
285 | 282 |
286 inline void CSSParserValue::setFromFunction(CSSParserFunction* function) | 283 inline void CSSParserValue::setFromFunction(CSSParserFunction* function) |
287 { | 284 { |
288 id = CSSValueInvalid; | 285 id = CSSValueInvalid; |
289 this->function = function; | 286 this->function = function; |
290 unit = Function; | 287 unit = Function; |
291 isInt = false; | 288 isInt = false; |
292 } | 289 } |
293 | 290 |
294 inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu
eList) | 291 inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu
eList) |
295 { | 292 { |
296 id = CSSValueInvalid; | 293 id = CSSValueInvalid; |
297 this->valueList = valueList.leakPtr(); | 294 this->valueList = valueList.leakPtr(); |
298 unit = ValueList; | 295 unit = ValueList; |
299 isInt = false; | 296 isInt = false; |
300 } | 297 } |
301 | 298 |
302 } | 299 } |
303 | 300 |
304 #endif | 301 #endif |
OLD | NEW |