Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1073803002: SVG doesn't recognize ch units. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) 8148 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS SPrimitiveValue::CSS_CHS)
8149 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive Value::UnitType)value->unit); 8149 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive Value::UnitType)value->unit);
8150 else if (value->unit >= CSSParserValue::Q_EMS) 8150 else if (value->unit >= CSSParserValue::Q_EMS)
8151 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV alue, CSSPrimitiveValue::CSS_EMS); 8151 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV alue, CSSPrimitiveValue::CSS_EMS);
8152 if (isCalculation(value)) { 8152 if (isCalculation(value)) {
8153 // 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
8154 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea se()); 8154 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea se());
8155 m_parsedCalculation.release(); 8155 m_parsedCalculation.release();
8156 parsedValue = nullptr; 8156 parsedValue = nullptr;
8157 } 8157 }
8158 m_valueList->next(); 8158 m_valueList->next();
(...skipping 11 matching lines...) Expand all
8170 CSSParserValue* value = m_valueList->current(); 8170 CSSParserValue* value = m_valueList->current();
8171 bool validPrimitive = true; 8171 bool validPrimitive = true;
8172 while (value) { 8172 while (value) {
8173 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri buteMode); 8173 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri buteMode);
8174 if (!validPrimitive) 8174 if (!validPrimitive)
8175 break; 8175 break;
8176 if (value->id) 8176 if (value->id)
8177 ret->append(CSSPrimitiveValue::createIdentifier(value->id)); 8177 ret->append(CSSPrimitiveValue::createIdentifier(value->id));
8178 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)
8179 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) 8180 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS SPrimitiveValue::CSS_CHS)
8181 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa lue::UnitType)value->unit)); 8181 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa lue::UnitType)value->unit));
8182 value = m_valueList->next(); 8182 value = m_valueList->next();
8183 bool commaConsumed = consumeComma(m_valueList); 8183 bool commaConsumed = consumeComma(m_valueList);
8184 value = m_valueList->current(); 8184 value = m_valueList->current();
8185 if (commaConsumed && !value) 8185 if (commaConsumed && !value)
8186 return nullptr; 8186 return nullptr;
8187 } 8187 }
8188 if (!validPrimitive) 8188 if (!validPrimitive)
8189 return nullptr; 8189 return nullptr;
8190 return ret.release(); 8190 return ret.release();
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
8476 } 8476 }
8477 } 8477 }
8478 8478
8479 if (!list->length()) 8479 if (!list->length())
8480 return nullptr; 8480 return nullptr;
8481 8481
8482 return list.release(); 8482 return list.release();
8483 } 8483 }
8484 8484
8485 } // namespace blink 8485 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698