mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
r=vidur, jst. Fix for bug 9076. The nodeName property is now case sensitive for XHTML elements and folded to uppercase for HTML elements.
This commit is contained in:
parent
59cdcf2605
commit
5fc94bfaf5
@ -456,8 +456,6 @@ nsGenericHTMLElement::GetTagName(nsString& aTagName)
|
||||
nsresult
|
||||
nsGenericHTMLElement::GetNodeName(nsString& aNodeName)
|
||||
{
|
||||
// This whole method needs revriting to work properly with XHTML...
|
||||
|
||||
if (kStrictDOMLevel2) {
|
||||
mNodeInfo->GetPrefix(aNodeName);
|
||||
if (aNodeName.Length()) {
|
||||
@ -467,20 +465,30 @@ nsGenericHTMLElement::GetNodeName(nsString& aNodeName)
|
||||
nsAutoString tmp;
|
||||
mNodeInfo->GetName(tmp);
|
||||
|
||||
PRInt32 id;
|
||||
if (NS_SUCCEEDED(mNodeInfo->GetNamespaceID(id)) && id == kNameSpaceID_None) {
|
||||
// Only fold to uppercase if the HTML element has no namespace, i.e.,
|
||||
// it was created as part of an HTML document.
|
||||
tmp.ToUpperCase();
|
||||
}
|
||||
|
||||
aNodeName.Append(tmp);
|
||||
} else {
|
||||
mNodeInfo->GetName(aNodeName);
|
||||
|
||||
PRInt32 id;
|
||||
if (NS_SUCCEEDED(mNodeInfo->GetNamespaceID(id)) && id == kNameSpaceID_None) {
|
||||
// Only fold to uppercase if the HTML element has no namespace, i.e.,
|
||||
// it was created as part of an HTML document.
|
||||
aNodeName.ToUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
if (kStrictDOMLevel2) {
|
||||
PRInt32 pos = aNodeName.FindChar(':');
|
||||
if (pos >= 0) {
|
||||
nsCAutoString tmp; tmp.AssignWithConversion(aNodeName);
|
||||
printf ("Possible DOM Error: .nodeName or .tagName requisted on the HTML alement '%s', is this OK?\n", (const char *)tmp);
|
||||
printf ("Possible DOM Error: .nodeName or .tagName requested on the HTML element '%s', is this OK?\n", (const char *)tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -456,8 +456,6 @@ nsGenericHTMLElement::GetTagName(nsString& aTagName)
|
||||
nsresult
|
||||
nsGenericHTMLElement::GetNodeName(nsString& aNodeName)
|
||||
{
|
||||
// This whole method needs revriting to work properly with XHTML...
|
||||
|
||||
if (kStrictDOMLevel2) {
|
||||
mNodeInfo->GetPrefix(aNodeName);
|
||||
if (aNodeName.Length()) {
|
||||
@ -467,20 +465,30 @@ nsGenericHTMLElement::GetNodeName(nsString& aNodeName)
|
||||
nsAutoString tmp;
|
||||
mNodeInfo->GetName(tmp);
|
||||
|
||||
PRInt32 id;
|
||||
if (NS_SUCCEEDED(mNodeInfo->GetNamespaceID(id)) && id == kNameSpaceID_None) {
|
||||
// Only fold to uppercase if the HTML element has no namespace, i.e.,
|
||||
// it was created as part of an HTML document.
|
||||
tmp.ToUpperCase();
|
||||
}
|
||||
|
||||
aNodeName.Append(tmp);
|
||||
} else {
|
||||
mNodeInfo->GetName(aNodeName);
|
||||
|
||||
PRInt32 id;
|
||||
if (NS_SUCCEEDED(mNodeInfo->GetNamespaceID(id)) && id == kNameSpaceID_None) {
|
||||
// Only fold to uppercase if the HTML element has no namespace, i.e.,
|
||||
// it was created as part of an HTML document.
|
||||
aNodeName.ToUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
if (kStrictDOMLevel2) {
|
||||
PRInt32 pos = aNodeName.FindChar(':');
|
||||
if (pos >= 0) {
|
||||
nsCAutoString tmp; tmp.AssignWithConversion(aNodeName);
|
||||
printf ("Possible DOM Error: .nodeName or .tagName requisted on the HTML alement '%s', is this OK?\n", (const char *)tmp);
|
||||
printf ("Possible DOM Error: .nodeName or .tagName requested on the HTML element '%s', is this OK?\n", (const char *)tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user