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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGLength.cpp

Issue 2101143005: 0 -> nullptr for UseCounter pointer in CSSParserContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo Created 4 years, 5 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) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return result; 126 return result;
127 } 127 }
128 128
129 SVGParsingError SVGLength::setValueAsString(const String& string) 129 SVGParsingError SVGLength::setValueAsString(const String& string)
130 { 130 {
131 if (string.isEmpty()) { 131 if (string.isEmpty()) {
132 m_value = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::User Units); 132 m_value = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::User Units);
133 return SVGParseStatus::NoError; 133 return SVGParseStatus::NoError;
134 } 134 }
135 135
136 CSSParserContext svgParserContext(SVGAttributeMode, 0); 136 CSSParserContext svgParserContext(SVGAttributeMode, nullptr);
137 CSSValue* parsed = CSSParser::parseSingleValue(CSSPropertyX, string, svgPars erContext); 137 CSSValue* parsed = CSSParser::parseSingleValue(CSSPropertyX, string, svgPars erContext);
138 if (!parsed || !parsed->isPrimitiveValue()) 138 if (!parsed || !parsed->isPrimitiveValue())
139 return SVGParseStatus::ExpectedLength; 139 return SVGParseStatus::ExpectedLength;
140 140
141 CSSPrimitiveValue* newValue = toCSSPrimitiveValue(parsed); 141 CSSPrimitiveValue* newValue = toCSSPrimitiveValue(parsed);
142 // TODO(fs): Enable calc for SVG lengths 142 // TODO(fs): Enable calc for SVG lengths
143 if (newValue->isCalculated() || !isSupportedCSSUnitType(newValue->typeWithCa lcResolved())) 143 if (newValue->isCalculated() || !isSupportedCSSUnitType(newValue->typeWithCa lcResolved()))
144 return SVGParseStatus::ExpectedLength; 144 return SVGParseStatus::ExpectedLength;
145 145
146 m_value = newValue; 146 m_value = newValue;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 float SVGLength::calculateDistance(SVGPropertyBase* toValue, SVGElement* context Element) 257 float SVGLength::calculateDistance(SVGPropertyBase* toValue, SVGElement* context Element)
258 { 258 {
259 SVGLengthContext lengthContext(contextElement); 259 SVGLengthContext lengthContext(contextElement);
260 SVGLength* toLength = toSVGLength(toValue); 260 SVGLength* toLength = toSVGLength(toValue);
261 261
262 return fabsf(toLength->value(lengthContext) - value(lengthContext)); 262 return fabsf(toLength->value(lengthContext) - value(lengthContext));
263 } 263 }
264 264
265 } // namespace blink 265 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698