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

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

Issue 1031223003: SVG doesn't recognize rem units (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 8128 matching lines...) Expand 10 before | Expand all | Expand 10 after
8139 addProperty(CSSPropertyMarkerEnd, value, important); 8139 addProperty(CSSPropertyMarkerEnd, value, important);
8140 return true; 8140 return true;
8141 } 8141 }
8142 default: 8142 default:
8143 // If you crash here, it's because you added a css property and are not handling it 8143 // If you crash here, it's because you added a css property and are not handling it
8144 // in either this switch statement or the one in CSSPropertyParser::pars eValue 8144 // in either this switch statement or the one in CSSPropertyParser::pars eValue
8145 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId); 8145 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId);
8146 return false; 8146 return false;
8147 } 8147 }
8148 8148
8149 if (validPrimitive) { 8149 if (validPrimitive) {
Timothy Loh 2015/03/27 09:51:02 Can we just do the same thing as parseValue (parse
8150 if (id) 8150 if (id)
8151 parsedValue = CSSPrimitiveValue::createIdentifier(id); 8151 parsedValue = CSSPrimitiveValue::createIdentifier(id);
8152 else if (value->unit == CSSPrimitiveValue::CSS_STRING) 8152 else if (value->unit == CSSPrimitiveValue::CSS_STRING)
8153 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive Value::UnitType) value->unit); 8153 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive Value::UnitType) value->unit);
8154 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ) 8154 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ)
8155 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive Value::UnitType) value->unit); 8155 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive Value::UnitType) value->unit);
8156 else if (value->unit == CSSPrimitiveValue::CSS_REMS)
8157 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive Value::UnitType)value->unit);
8156 else if (value->unit >= CSSParserValue::Q_EMS) 8158 else if (value->unit >= CSSParserValue::Q_EMS)
8157 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV alue, CSSPrimitiveValue::CSS_EMS); 8159 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV alue, CSSPrimitiveValue::CSS_EMS);
8158 if (isCalculation(value)) { 8160 if (isCalculation(value)) {
8159 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri mitiveValue here, ie 8161 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri mitiveValue here, ie
8160 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea se()); 8162 // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.relea se());
8161 m_parsedCalculation.release(); 8163 m_parsedCalculation.release();
8162 parsedValue = nullptr; 8164 parsedValue = nullptr;
8163 } 8165 }
8164 m_valueList->next(); 8166 m_valueList->next();
8165 } 8167 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
8480 } 8482 }
8481 } 8483 }
8482 8484
8483 if (!list->length()) 8485 if (!list->length())
8484 return nullptr; 8486 return nullptr;
8485 8487
8486 return list.release(); 8488 return list.release();
8487 } 8489 }
8488 8490
8489 } // namespace blink 8491 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698