Bug 455314. RemoveIDTargetObserver doesn't need to do the full GetElementByIdInternal because we don't need or want to set up an mIdentifierMap entry if no entry is found for the ID. r+sr=jst

This commit is contained in:
Robert O'Callahan 2008-12-12 21:20:30 +13:00
parent e0206a44c5
commit 9106f372f7

View File

@ -3855,9 +3855,13 @@ nsDocument::RemoveIDTargetObserver(nsIAtom* aID,
if (!CheckGetElementByIdArg(aID))
return;
nsIdentifierMapEntry *entry = GetElementByIdInternal(aID);
if (!entry)
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aID);
if (!entry) {
// We don't need to do the stuff that GetElementByIdInternal does;
// if there's no entry already in mIdentifierMap, then there's no
// callback to remove.
return;
}
entry->RemoveContentChangeCallback(aObserver, aData);
}