Bug 471239 - nsSVGElement::ParseAttribute doesn't return PR_TRUE for new style SVG strings; r=longsonr sr=roc
authorCraig Topper <craig.topper@gmail.com>
Sat, 27 Dec 2008 23:52:30 +0100
changeset 23133 b5e0fbf1c5c5aff5924fb7a9a4ee9e6c191b58b1
parent 23132 4b66625f9fd46fdef3e2dbf019803b039227168b
child 23134 320d48cdd0ee1f918af1b9f480b2b7faf4b7e49f
push id4354
push usersgautherie.bz@free.fr
push dateSat, 27 Dec 2008 23:29:57 +0000
treeherdermozilla-central@2bbf690dac7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr, roc
bugs471239
milestone1.9.2a1pre
Bug 471239 - nsSVGElement::ParseAttribute doesn't return PR_TRUE for new style SVG strings; r=longsonr sr=roc
content/svg/content/src/nsSVGElement.cpp
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -315,19 +315,19 @@ nsSVGElement::ParseAttribute(PRInt32 aNa
     }
     else {
       aResult.SetTo(svg_value);
     }
     mSuppressNotification = PR_FALSE;
     return PR_TRUE;
   }
 
+  nsresult rv = NS_OK;
   PRBool foundMatch = PR_FALSE;
   if (aNamespaceID == kNameSpaceID_None) {
-    nsresult rv;
 
     // Check for nsSVGLength2 attribute
     LengthAttributesInfo lengthInfo = GetLengthInfo();
 
     PRUint32 i;
     for (i = 0; i < lengthInfo.mLengthCount; i++) {
       if (aAttribute == *lengthInfo.mLengthInfo[i].mName) {
         rv = lengthInfo.mLengths[i].SetBaseValueString(aValue, this, PR_FALSE);
@@ -424,40 +424,40 @@ nsSVGElement::ParseAttribute(PRInt32 aNa
           if (NS_FAILED(rv)) {
             enumInfo.Reset(i);
           }
           foundMatch = PR_TRUE;
           break;
         }
       }
     }
-
-    if (foundMatch) {
-      if (NS_FAILED(rv)) {
-        ReportAttributeParseFailure(GetOwnerDoc(), aAttribute, aValue);
-        return PR_FALSE;
-      }
-      aResult.SetTo(aValue);
-      return PR_TRUE;
-    }
   }
 
   if (!foundMatch) {
     // Check for nsSVGString attribute
     StringAttributesInfo stringInfo = GetStringInfo();
     for (PRUint32 i = 0; i < stringInfo.mStringCount; i++) {
       if (aNamespaceID == stringInfo.mStringInfo[i].mNamespaceID &&
           aAttribute == *stringInfo.mStringInfo[i].mName) {
         stringInfo.mStrings[i].SetBaseValue(aValue, this, PR_FALSE);
         foundMatch = PR_TRUE;
         break;
       }
     }
   }
 
+  if (foundMatch) {
+    if (NS_FAILED(rv)) {
+      ReportAttributeParseFailure(GetOwnerDoc(), aAttribute, aValue);
+      return PR_FALSE;
+    }
+    aResult.SetTo(aValue);
+    return PR_TRUE;
+  }
+
   return nsSVGElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                           aResult);
 }
 
 nsresult
 nsSVGElement::UnsetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
                         PRBool aNotify)
 {