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

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: Rebased 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
« no previous file with comments | « LayoutTests/svg/stroke/stroke-width-ch-type-expected.svg ('k') | Source/core/svg/SVGLength.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8136 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « LayoutTests/svg/stroke/stroke-width-ch-type-expected.svg ('k') | Source/core/svg/SVGLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698