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 8127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8138 return false; | 8138 return false; |
8139 } | 8139 } |
8140 | 8140 |
8141 if (validPrimitive) { | 8141 if (validPrimitive) { |
8142 if (id) | 8142 if (id) |
8143 parsedValue = CSSPrimitiveValue::createIdentifier(id); | 8143 parsedValue = CSSPrimitiveValue::createIdentifier(id); |
8144 else if (value->unit == CSSPrimitiveValue::CSS_STRING) | 8144 else if (value->unit == CSSPrimitiveValue::CSS_STRING) |
8145 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive
Value::UnitType) value->unit); | 8145 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive
Value::UnitType) value->unit); |
8146 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) | 8146 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) |
8147 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType) value->unit); | 8147 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType) value->unit); |
| 8148 else if (value->unit == CSSPrimitiveValue::CSS_REMS) |
| 8149 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType)value->unit); |
8148 else if (value->unit >= CSSParserValue::Q_EMS) | 8150 else if (value->unit >= CSSParserValue::Q_EMS) |
8149 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV
alue, CSSPrimitiveValue::CSS_EMS); | 8151 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV
alue, CSSPrimitiveValue::CSS_EMS); |
8150 if (isCalculation(value)) { | 8152 if (isCalculation(value)) { |
8151 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri
mitiveValue here, ie | 8153 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri
mitiveValue here, ie |
8152 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea
se()); | 8154 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea
se()); |
8153 m_parsedCalculation.release(); | 8155 m_parsedCalculation.release(); |
8154 parsedValue = nullptr; | 8156 parsedValue = nullptr; |
8155 } | 8157 } |
8156 m_valueList->next(); | 8158 m_valueList->next(); |
8157 } | 8159 } |
(...skipping 10 matching lines...) Expand all Loading... |
8168 CSSParserValue* value = m_valueList->current(); | 8170 CSSParserValue* value = m_valueList->current(); |
8169 bool validPrimitive = true; | 8171 bool validPrimitive = true; |
8170 while (value) { | 8172 while (value) { |
8171 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri
buteMode); | 8173 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri
buteMode); |
8172 if (!validPrimitive) | 8174 if (!validPrimitive) |
8173 break; | 8175 break; |
8174 if (value->id) | 8176 if (value->id) |
8175 ret->append(CSSPrimitiveValue::createIdentifier(value->id)); | 8177 ret->append(CSSPrimitiveValue::createIdentifier(value->id)); |
8176 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) | 8178 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) |
8177 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType) value->unit)); | 8179 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType) value->unit)); |
| 8180 else if (value->unit == CSSPrimitiveValue::CSS_REMS) |
| 8181 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType)value->unit)); |
8178 value = m_valueList->next(); | 8182 value = m_valueList->next(); |
8179 bool commaConsumed = consumeComma(m_valueList); | 8183 bool commaConsumed = consumeComma(m_valueList); |
8180 value = m_valueList->current(); | 8184 value = m_valueList->current(); |
8181 if (commaConsumed && !value) | 8185 if (commaConsumed && !value) |
8182 return nullptr; | 8186 return nullptr; |
8183 } | 8187 } |
8184 if (!validPrimitive) | 8188 if (!validPrimitive) |
8185 return nullptr; | 8189 return nullptr; |
8186 return ret.release(); | 8190 return ret.release(); |
8187 } | 8191 } |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8472 } | 8476 } |
8473 } | 8477 } |
8474 | 8478 |
8475 if (!list->length()) | 8479 if (!list->length()) |
8476 return nullptr; | 8480 return nullptr; |
8477 | 8481 |
8478 return list.release(); | 8482 return list.release(); |
8479 } | 8483 } |
8480 | 8484 |
8481 } // namespace blink | 8485 } // namespace blink |
OLD | NEW |