diff --git a/content/svg/content/src/SVGLength.cpp b/content/svg/content/src/SVGLength.cpp index 5696b0859ee..5ad4b9289f4 100644 --- a/content/svg/content/src/SVGLength.cpp +++ b/content/svg/content/src/SVGLength.cpp @@ -86,6 +86,10 @@ SVGLength::SetValueFromString(const nsAString &aValue) } nsCAutoString unitStr(unit, theRest - unit); tmpUnit = GetUnitTypeForString(unitStr.get()); + if (tmpUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_UNKNOWN) { + // nsSVGUtils::ReportToConsole + return PR_FALSE; + } } else { tmpUnit = nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER; } @@ -272,7 +276,6 @@ GetUnitTypeForString(const char* unitStr) return i; } } - NS_NOTREACHED("Returning unknown unit type"); return nsIDOMSVGLength::SVG_LENGTHTYPE_UNKNOWN; } diff --git a/content/svg/content/test/Makefile.in b/content/svg/content/test/Makefile.in index adfad1316f0..c3b538878fc 100644 --- a/content/svg/content/test/Makefile.in +++ b/content/svg/content/test/Makefile.in @@ -68,6 +68,7 @@ _TEST_FILES = \ test_pointer-events.xhtml \ test_scientific.html \ scientific-helper.svg \ + test_SVGLengthList.xhtml \ test_SVGPathSegList.xhtml \ test_SVGStyleElement.xhtml \ test_SVGxxxList.xhtml \ diff --git a/content/svg/content/test/test_SVGLengthList.xhtml b/content/svg/content/test/test_SVGLengthList.xhtml new file mode 100644 index 00000000000..fc4758cc2f6 --- /dev/null +++ b/content/svg/content/test/test_SVGLengthList.xhtml @@ -0,0 +1,55 @@ + + + + Tests specific to SVGLengthList + + + + + +Mozilla Bug 515116 +

+ +
+
+
+ +