From f6ef6aab4ae9af1b1b996eec13637e8b4e684aed Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Sun, 5 Dec 2010 20:28:08 +0000 Subject: [PATCH] Bug 580796 - "ASSERTION: Returning unknown unit type" regression from bug 515116. r=longsonr a=roc --HG-- extra : rebase_source : 5aa4913dab0572bbbf7aed3a961348c69fcb0542 --- content/svg/content/src/SVGLength.cpp | 5 +- content/svg/content/test/Makefile.in | 1 + .../svg/content/test/test_SVGLengthList.xhtml | 55 +++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 content/svg/content/test/test_SVGLengthList.xhtml 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 +

+ +
+
+
+ +