| 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 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. | 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 bool parseFontFaceSrcURI(CSSValueList*); | 284 bool parseFontFaceSrcURI(CSSValueList*); |
| 285 bool parseFontFaceSrcLocal(CSSValueList*); | 285 bool parseFontFaceSrcLocal(CSSValueList*); |
| 286 | 286 |
| 287 enum PropertyType { | 287 enum PropertyType { |
| 288 PropertyExplicit, | 288 PropertyExplicit, |
| 289 PropertyImplicit | 289 PropertyImplicit |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 class ImplicitScope { | 292 class ImplicitScope { |
| 293 STACK_ALLOCATED(); |
| 293 WTF_MAKE_NONCOPYABLE(ImplicitScope); | 294 WTF_MAKE_NONCOPYABLE(ImplicitScope); |
| 294 public: | 295 public: |
| 295 ImplicitScope(CSSPropertyParser* parser, PropertyType propertyType) | 296 ImplicitScope(CSSPropertyParser* parser, PropertyType propertyType) |
| 296 : m_parser(parser) | 297 : m_parser(parser) |
| 297 { | 298 { |
| 298 m_parser->m_implicitShorthand = propertyType == CSSPropertyParser::P
ropertyImplicit; | 299 m_parser->m_implicitShorthand = propertyType == CSSPropertyParser::P
ropertyImplicit; |
| 299 } | 300 } |
| 300 | 301 |
| 301 ~ImplicitScope() | 302 ~ImplicitScope() |
| 302 { | 303 { |
| 303 m_parser->m_implicitShorthand = false; | 304 m_parser->m_implicitShorthand = false; |
| 304 } | 305 } |
| 305 | 306 |
| 306 private: | 307 private: |
| 307 CSSPropertyParser* m_parser; | 308 CSSPropertyParser* m_parser; |
| 308 }; | 309 }; |
| 309 | 310 |
| 310 // FIXME: MSVC doesn't like ShorthandScope being private | |
| 311 // since ~OwnPtr can't access its destructor if non-inlined. | |
| 312 public: | |
| 313 class ShorthandScope { | 311 class ShorthandScope { |
| 314 WTF_MAKE_FAST_ALLOCATED; | 312 STACK_ALLOCATED(); |
| 315 public: | 313 public: |
| 316 ShorthandScope(CSSPropertyParser* parser, CSSPropertyID propId) : m_pars
er(parser) | 314 ShorthandScope(CSSPropertyParser* parser, CSSPropertyID propId) : m_pars
er(parser) |
| 317 { | 315 { |
| 318 if (!(m_parser->m_inParseShorthand++)) | 316 if (!(m_parser->m_inParseShorthand++)) |
| 319 m_parser->m_currentShorthand = propId; | 317 m_parser->m_currentShorthand = propId; |
| 320 } | 318 } |
| 321 ~ShorthandScope() | 319 ~ShorthandScope() |
| 322 { | 320 { |
| 323 if (!(--m_parser->m_inParseShorthand)) | 321 if (!(--m_parser->m_inParseShorthand)) |
| 324 m_parser->m_currentShorthand = CSSPropertyInvalid; | 322 m_parser->m_currentShorthand = CSSPropertyInvalid; |
| 325 } | 323 } |
| 326 | 324 |
| 327 private: | 325 private: |
| 328 CSSPropertyParser* m_parser; | 326 CSSPropertyParser* m_parser; |
| 329 }; | 327 }; |
| 330 | 328 |
| 331 private: | |
| 332 enum ReleaseParsedCalcValueCondition { | 329 enum ReleaseParsedCalcValueCondition { |
| 333 ReleaseParsedCalcValue, | 330 ReleaseParsedCalcValue, |
| 334 DoNotReleaseParsedCalcValue | 331 DoNotReleaseParsedCalcValue |
| 335 }; | 332 }; |
| 336 | 333 |
| 337 enum Units { | 334 enum Units { |
| 338 FUnknown = 0x0000, | 335 FUnknown = 0x0000, |
| 339 FInteger = 0x0001, | 336 FInteger = 0x0001, |
| 340 FNumber = 0x0002, // Real Numbers | 337 FNumber = 0x0002, // Real Numbers |
| 341 FPercent = 0x0004, | 338 FPercent = 0x0004, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 CSSPropertyID cssPropertyID(const CSSParserString&); | 395 CSSPropertyID cssPropertyID(const CSSParserString&); |
| 399 CSSPropertyID cssPropertyID(const String&); | 396 CSSPropertyID cssPropertyID(const String&); |
| 400 CSSValueID cssValueKeywordID(const CSSParserString&); | 397 CSSValueID cssValueKeywordID(const CSSParserString&); |
| 401 | 398 |
| 402 bool isKeywordPropertyID(CSSPropertyID); | 399 bool isKeywordPropertyID(CSSPropertyID); |
| 403 bool isValidKeywordPropertyAndValue(CSSPropertyID, int valueID, const CSSParserC
ontext&); | 400 bool isValidKeywordPropertyAndValue(CSSPropertyID, int valueID, const CSSParserC
ontext&); |
| 404 | 401 |
| 405 } // namespace WebCore | 402 } // namespace WebCore |
| 406 | 403 |
| 407 #endif // CSSPropertyParser_h | 404 #endif // CSSPropertyParser_h |
| OLD | NEW |