Make ParseAttribute handle namespaced attributes too, since SVG needs to

ParseAttribute things like xlink:href.  Bug 314568, r=sicking, sr=jst
This commit is contained in:
bzbarsky@mit.edu
2005-11-29 16:37:15 +00:00
parent e4f89781a1
commit 21c34f6350
39 changed files with 687 additions and 532 deletions

View File

@@ -4033,8 +4033,7 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
NS_ENSURE_SUCCESS(rv, rv);
nsAttrValue attrValue;
if (aNamespaceID != kNameSpaceID_None ||
!ParseAttribute(aName, aValue, attrValue)) {
if (!ParseAttribute(aNamespaceID, aName, aValue, attrValue)) {
attrValue.SetTo(aValue);
}
@@ -4131,11 +4130,13 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
}
PRBool
nsGenericElement::ParseAttribute(nsIAtom* aAttribute,
nsGenericElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aAttribute == GetIDAttributeName() && !aValue.IsEmpty()) {
if (aNamespaceID == kNameSpaceID_None &&
aAttribute == GetIDAttributeName() && !aValue.IsEmpty()) {
// Store id as an atom. id="" means that the element has no id,
// not that it has an emptystring as the id.
aResult.ParseAtom(aValue);