Test land bug 394442, will back out after tp/tp2/tdhtml results

This commit is contained in:
2007-09-01 08:23:29 -07:00
parent b33d0dfc2d
commit 58201c9c46
3 changed files with 34 additions and 2 deletions

View File

@@ -2265,6 +2265,10 @@ nsGenericElement::DispatchDOMEvent(nsEvent* aEvent,
nsIAtom*
nsGenericElement::GetID() const
{
if (!HasFlag(NODE_MAY_HAVE_ID)) {
return nsnull;
}
nsIAtom* IDName = GetIDAttributeName();
if (IDName) {
const nsAttrValue* attrVal = mAttrsAndChildren.GetAttr(IDName);
@@ -2287,6 +2291,9 @@ nsGenericElement::GetID() const
}
}
}
nsINode* node = const_cast<nsINode*>(static_cast<const nsINode*>(this));
node->UnsetFlags(NODE_MAY_HAVE_ID);
return nsnull;
}
@@ -3680,6 +3687,7 @@ nsGenericElement::ParseAttribute(PRInt32 aNamespaceID,
{
if (aNamespaceID == kNameSpaceID_None &&
aAttribute == GetIDAttributeName() && !aValue.IsEmpty()) {
SetFlags(NODE_MAY_HAVE_ID);
// 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);