| 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 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 m_values.append(*(valueList.valueAt(i))); | 60 m_values.append(*(valueList.valueAt(i))); |
| 61 } | 61 } |
| 62 | 62 |
| 63 PassRefPtr<CSSValue> CSSParserValue::createCSSValue() | 63 PassRefPtr<CSSValue> CSSParserValue::createCSSValue() |
| 64 { | 64 { |
| 65 RefPtr<CSSValue> parsedValue; | 65 RefPtr<CSSValue> parsedValue; |
| 66 if (id) | 66 if (id) |
| 67 return CSSPrimitiveValue::createIdentifier(id); | 67 return CSSPrimitiveValue::createIdentifier(id); |
| 68 | 68 |
| 69 if (unit == CSSParserValue::Operator) { | 69 if (unit == CSSParserValue::Operator) { |
| 70 RefPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createIden
tifier(iValue); | 70 RefPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createPars
erOperator(iValue); |
| 71 primitiveValue->setPrimitiveType(CSSPrimitiveValue::CSS_PARSER_OPERATOR)
; | 71 primitiveValue->setPrimitiveType(CSSPrimitiveValue::CSS_PARSER_OPERATOR)
; |
| 72 return primitiveValue; | 72 return primitiveValue; |
| 73 } | 73 } |
| 74 if (unit == CSSParserValue::Function) | 74 if (unit == CSSParserValue::Function) |
| 75 return CSSFunctionValue::create(function); | 75 return CSSFunctionValue::create(function); |
| 76 if (unit >= CSSParserValue::Q_EMS) | 76 if (unit >= CSSParserValue::Q_EMS) |
| 77 return CSSPrimitiveValue::createAllowingMarginQuirk(fValue, CSSPrimitive
Value::CSS_EMS); | 77 return CSSPrimitiveValue::createAllowingMarginQuirk(fValue, CSSPrimitive
Value::CSS_EMS); |
| 78 | 78 |
| 79 CSSPrimitiveValue::UnitTypes primitiveUnit = static_cast<CSSPrimitiveValue::
UnitTypes>(unit); | 79 CSSPrimitiveValue::UnitTypes primitiveUnit = static_cast<CSSPrimitiveValue::
UnitTypes>(unit); |
| 80 switch (primitiveUnit) { | 80 switch (primitiveUnit) { |
| 81 case CSSPrimitiveValue::CSS_IDENT: | 81 case CSSPrimitiveValue::CSS_IDENT: |
| 82 case CSSPrimitiveValue::CSS_PROPERTY_ID: |
| 83 case CSSPrimitiveValue::CSS_VALUE_ID: |
| 82 return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_PARSER_I
DENTIFIER); | 84 return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_PARSER_I
DENTIFIER); |
| 83 case CSSPrimitiveValue::CSS_NUMBER: | 85 case CSSPrimitiveValue::CSS_NUMBER: |
| 84 return CSSPrimitiveValue::create(fValue, isInt ? CSSPrimitiveValue::CSS_
PARSER_INTEGER : CSSPrimitiveValue::CSS_NUMBER); | 86 return CSSPrimitiveValue::create(fValue, isInt ? CSSPrimitiveValue::CSS_
PARSER_INTEGER : CSSPrimitiveValue::CSS_NUMBER); |
| 85 case CSSPrimitiveValue::CSS_STRING: | 87 case CSSPrimitiveValue::CSS_STRING: |
| 86 case CSSPrimitiveValue::CSS_URI: | 88 case CSSPrimitiveValue::CSS_URI: |
| 87 case CSSPrimitiveValue::CSS_VARIABLE_NAME: | 89 case CSSPrimitiveValue::CSS_VARIABLE_NAME: |
| 88 case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR: | 90 case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR: |
| 89 return CSSPrimitiveValue::create(string, primitiveUnit); | 91 return CSSPrimitiveValue::create(string, primitiveUnit); |
| 90 case CSSPrimitiveValue::CSS_PERCENTAGE: | 92 case CSSPrimitiveValue::CSS_PERCENTAGE: |
| 91 case CSSPrimitiveValue::CSS_EMS: | 93 case CSSPrimitiveValue::CSS_EMS: |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); | 229 CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); |
| 228 do { | 230 do { |
| 229 if (selector->isDistributedPseudoElement()) | 231 if (selector->isDistributedPseudoElement()) |
| 230 return selector; | 232 return selector; |
| 231 } while ((selector = selector->tagHistory())); | 233 } while ((selector = selector->tagHistory())); |
| 232 return 0; | 234 return 0; |
| 233 } | 235 } |
| 234 | 236 |
| 235 } | 237 } |
| 236 | 238 |
| OLD | NEW |