Make setting attributes via attribute nodes in HTML correctly lowercase the
attr name. Bug 264644, r=sicking, sr=peterv git-svn-id: svn://10.0.0.236/trunk@164275 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -170,8 +170,18 @@ nsDOMAttributeMap::SetNamedItem(nsIDOMNode *aNode, nsIDOMNode **aReturn)
|
||||
|
||||
// Set the new attributevalue
|
||||
attribute->GetValue(value);
|
||||
rv = mContent->SetAttr(ni->NamespaceID(), ni->NameAtom(),
|
||||
ni->GetPrefixAtom(), value, PR_TRUE);
|
||||
if (ni->NamespaceID() == kNameSpaceID_None &&
|
||||
mContent->IsContentOfType(nsIContent::eHTML)) {
|
||||
// Set via setAttribute(), which may do normalization on the
|
||||
// attribute name for HTML
|
||||
nsCOMPtr<nsIDOMElement> ourElement(do_QueryInterface(mContent));
|
||||
NS_ASSERTION(ourElement, "HTML content that's not an element?");
|
||||
ourElement->SetAttribute(name, value);
|
||||
} else {
|
||||
// It's OK to just use SetAttr
|
||||
rv = mContent->SetAttr(ni->NamespaceID(), ni->NameAtom(),
|
||||
ni->GetPrefixAtom(), value, PR_TRUE);
|
||||
}
|
||||
|
||||
// Not all attributes implement nsIAttribute.
|
||||
nsCOMPtr<nsIAttribute> attr = do_QueryInterface(aNode);
|
||||
|
||||
Reference in New Issue
Block a user