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

Unified Diff: Source/core/svg/SVGForeignObjectElement.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 side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGForeignObjectElement.cpp
diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp
index a588a67984e325a1d144c468e5b4c0d1da6350c1..6e9623ba4a6d3f6ba5ddc324b7f3122715146cae 100644
--- a/Source/core/svg/SVGForeignObjectElement.cpp
+++ b/Source/core/svg/SVGForeignObjectElement.cpp
@@ -96,12 +96,13 @@ void SVGForeignObjectElement::collectStyleForPresentationAttribute(const Qualifi
{
if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) {
RefPtr<SVGLength> length = SVGLength::create(LengthModeOther);
- length->setValueAsString(value, IGNORE_EXCEPTION);
- if (length->unitType() != LengthTypeUnknown) {
+ TrackExceptionState exceptionState;
+ length->setValueAsString(value, exceptionState);
+ if (!exceptionState.hadException()) {
if (name == SVGNames::widthAttr)
- addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, length->valueAsString());
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
else if (name == SVGNames::heightAttr)
- addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, length->valueAsString());
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
}
} else {
SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
« no previous file with comments | « LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698