mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 01:55:44 +00:00
Make setting attributes via attribute nodes in HTML correctly lowercase the
attr name. Bug 264644, r=sicking, sr=peterv
This commit is contained in:
parent
2895167f89
commit
4f7fb2d525
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user