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

Side by Side Diff: Source/core/svg/SVGSVGElement.cpp

Issue 262093007: Tighten error checking from SVGLength parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expected file Created 6 years, 7 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 | « Source/core/svg/SVGForeignObjectElement.cpp ('k') | no next file » | 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) 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, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Google, Inc. 5 * Copyright (C) 2014 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 { 263 {
264 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) 264 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr))
265 return true; 265 return true;
266 return SVGGraphicsElement::isPresentationAttribute(name); 266 return SVGGraphicsElement::isPresentationAttribute(name);
267 } 267 }
268 268
269 void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& na me, const AtomicString& value, MutableStylePropertySet* style) 269 void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& na me, const AtomicString& value, MutableStylePropertySet* style)
270 { 270 {
271 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) { 271 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) {
272 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); 272 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther);
273 length->setValueAsString(value, IGNORE_EXCEPTION); 273 TrackExceptionState exceptionState;
274 if (length->unitType() != LengthTypeUnknown) { 274 length->setValueAsString(value, exceptionState);
275 if (!exceptionState.hadException()) {
275 if (name == SVGNames::widthAttr) 276 if (name == SVGNames::widthAttr)
276 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value); 277 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
277 else if (name == SVGNames::heightAttr) 278 else if (name == SVGNames::heightAttr)
278 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight , value); 279 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight , value);
279 } 280 }
280 } else { 281 } else {
281 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle); 282 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle);
282 } 283 }
283 } 284 }
284 285
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 view->preserveAspectRatio()->baseValue()->setMeetOrSlice(preserveAspectR atio()->currentValue()->meetOrSlice()); 765 view->preserveAspectRatio()->baseValue()->setMeetOrSlice(preserveAspectR atio()->currentValue()->meetOrSlice());
765 } 766 }
766 767
767 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) 768 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr))
768 view->setZoomAndPan(viewElement->zoomAndPan()); 769 view->setZoomAndPan(viewElement->zoomAndPan());
769 else 770 else
770 view->setZoomAndPan(zoomAndPan()); 771 view->setZoomAndPan(zoomAndPan());
771 } 772 }
772 773
773 } 774 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGForeignObjectElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698