Bug 489925. getElementById should not return anonymous nodes. r=jst
git-svn-id: svn://10.0.0.236/trunk@258337 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
ce23102518
commit
167812c515
@ -1358,6 +1358,11 @@ nsHTMLDocument::ContentAppended(nsIDocument* aDocument,
|
||||
{
|
||||
NS_ASSERTION(aDocument == this, "unexpected doc");
|
||||
|
||||
if (aContainer->GetBindingParent()) {
|
||||
// Anonymous node; bail out
|
||||
return;
|
||||
}
|
||||
|
||||
PRUint32 count = aContainer->GetChildCount();
|
||||
for (PRUint32 i = aNewIndexInContainer; i < count; ++i) {
|
||||
RegisterNamedItems(aContainer->GetChildAt(i));
|
||||
@ -1374,6 +1379,11 @@ nsHTMLDocument::ContentInserted(nsIDocument* aDocument,
|
||||
|
||||
NS_ABORT_IF_FALSE(aContent, "Null content!");
|
||||
|
||||
if (aContent->GetBindingParent()) {
|
||||
// Anonymous node; bail out
|
||||
return;
|
||||
}
|
||||
|
||||
RegisterNamedItems(aContent);
|
||||
}
|
||||
|
||||
@ -1387,6 +1397,11 @@ nsHTMLDocument::ContentRemoved(nsIDocument* aDocument,
|
||||
|
||||
NS_ABORT_IF_FALSE(aChild, "Null content!");
|
||||
|
||||
if (aChild->GetBindingParent()) {
|
||||
// Anonymous node; bail out
|
||||
return;
|
||||
}
|
||||
|
||||
UnregisterNamedItems(aChild);
|
||||
}
|
||||
|
||||
@ -1397,6 +1412,11 @@ nsHTMLDocument::AttributeWillChange(nsIContent* aContent, PRInt32 aNameSpaceID,
|
||||
NS_ABORT_IF_FALSE(aContent, "Null content!");
|
||||
NS_PRECONDITION(aAttribute, "Must have an attribute that's changing!");
|
||||
|
||||
if (aContent->GetBindingParent()) {
|
||||
// Anonymous node; bail out
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsXHTML() && aAttribute == nsGkAtoms::name &&
|
||||
aNameSpaceID == kNameSpaceID_None) {
|
||||
nsIAtom* name = IsNamedItem(aContent);
|
||||
@ -1430,6 +1450,11 @@ nsHTMLDocument::AttributeChanged(nsIDocument* aDocument,
|
||||
NS_ABORT_IF_FALSE(aContent, "Null content!");
|
||||
NS_PRECONDITION(aAttribute, "Must have an attribute that's changing!");
|
||||
|
||||
if (aContent->GetBindingParent()) {
|
||||
// Anonymous node; bail out
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsXHTML() && aAttribute == nsGkAtoms::name &&
|
||||
aNameSpaceID == kNameSpaceID_None) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user