Bug 471239 - nsSVGElement::ParseAttribute doesn't return PR_TRUE for new style SVG strings; r=longsonr sr=roc
--- 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)
{