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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 8136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8147 return false; | 8147 return false; |
8148 } | 8148 } |
8149 | 8149 |
8150 if (validPrimitive) { | 8150 if (validPrimitive) { |
8151 if (id) | 8151 if (id) |
8152 parsedValue = CSSPrimitiveValue::createIdentifier(id); | 8152 parsedValue = CSSPrimitiveValue::createIdentifier(id); |
8153 else if (value->unit == CSSPrimitiveValue::CSS_STRING) | 8153 else if (value->unit == CSSPrimitiveValue::CSS_STRING) |
8154 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive
Value::UnitType) value->unit); | 8154 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive
Value::UnitType) value->unit); |
8155 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) | 8155 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) |
8156 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType) value->unit); | 8156 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType) value->unit); |
8157 else if (value->unit == CSSPrimitiveValue::CSS_REMS) | 8157 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS
SPrimitiveValue::CSS_CHS) |
8158 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType)value->unit); | 8158 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType)value->unit); |
8159 else if (value->unit >= CSSParserValue::Q_EMS) | 8159 else if (value->unit >= CSSParserValue::Q_EMS) |
8160 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV
alue, CSSPrimitiveValue::CSS_EMS); | 8160 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV
alue, CSSPrimitiveValue::CSS_EMS); |
8161 if (isCalculation(value)) { | 8161 if (isCalculation(value)) { |
8162 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri
mitiveValue here, ie | 8162 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri
mitiveValue here, ie |
8163 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea
se()); | 8163 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea
se()); |
8164 m_parsedCalculation.release(); | 8164 m_parsedCalculation.release(); |
8165 parsedValue = nullptr; | 8165 parsedValue = nullptr; |
8166 } | 8166 } |
8167 m_valueList->next(); | 8167 m_valueList->next(); |
(...skipping 11 matching lines...) Expand all Loading... |
8179 CSSParserValue* value = m_valueList->current(); | 8179 CSSParserValue* value = m_valueList->current(); |
8180 bool validPrimitive = true; | 8180 bool validPrimitive = true; |
8181 while (value) { | 8181 while (value) { |
8182 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri
buteMode); | 8182 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri
buteMode); |
8183 if (!validPrimitive) | 8183 if (!validPrimitive) |
8184 break; | 8184 break; |
8185 if (value->id) | 8185 if (value->id) |
8186 ret->append(CSSPrimitiveValue::createIdentifier(value->id)); | 8186 ret->append(CSSPrimitiveValue::createIdentifier(value->id)); |
8187 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) | 8187 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) |
8188 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType) value->unit)); | 8188 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType) value->unit)); |
8189 else if (value->unit == CSSPrimitiveValue::CSS_REMS) | 8189 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS
SPrimitiveValue::CSS_CHS) |
8190 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType)value->unit)); | 8190 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType)value->unit)); |
8191 value = m_valueList->next(); | 8191 value = m_valueList->next(); |
8192 bool commaConsumed = consumeComma(m_valueList); | 8192 bool commaConsumed = consumeComma(m_valueList); |
8193 value = m_valueList->current(); | 8193 value = m_valueList->current(); |
8194 if (commaConsumed && !value) | 8194 if (commaConsumed && !value) |
8195 return nullptr; | 8195 return nullptr; |
8196 } | 8196 } |
8197 if (!validPrimitive) | 8197 if (!validPrimitive) |
8198 return nullptr; | 8198 return nullptr; |
8199 return ret.release(); | 8199 return ret.release(); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8485 } | 8485 } |
8486 } | 8486 } |
8487 | 8487 |
8488 if (!list->length()) | 8488 if (!list->length()) |
8489 return nullptr; | 8489 return nullptr; |
8490 | 8490 |
8491 return list.release(); | 8491 return list.release(); |
8492 } | 8492 } |
8493 | 8493 |
8494 } // namespace blink | 8494 } // namespace blink |
OLD | NEW |