mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 01:01:52 +00:00
Fix for 168352, getElementByID assertions, r/sr=bryner,brendan
This commit is contained in:
parent
cfdbe180d8
commit
fec7cccf7a
@ -3936,23 +3936,32 @@ nsXULDocument::RemoveSubtreeFromDocument(nsIContent* aElement)
|
||||
// in the document.
|
||||
// Do a getElementById to retrieve the broadcaster
|
||||
nsCOMPtr<nsIDOMElement> broadcaster;
|
||||
nsAutoString observesVal;
|
||||
aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::observes, observesVal);
|
||||
GetElementById(observesVal, getter_AddRefs(broadcaster));
|
||||
if (broadcaster) {
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aElement));
|
||||
RemoveBroadcastListenerFor(broadcaster,
|
||||
elt,
|
||||
NS_LITERAL_STRING("*"));
|
||||
nsAutoString observesVal;
|
||||
|
||||
if (aElement->HasAttr(kNameSpaceID_None, nsXULAtoms::observes)) {
|
||||
aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::observes, observesVal);
|
||||
if (!observesVal.IsEmpty()) {
|
||||
GetElementById(observesVal, getter_AddRefs(broadcaster));
|
||||
if (broadcaster) {
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aElement));
|
||||
RemoveBroadcastListenerFor(broadcaster,
|
||||
elt,
|
||||
NS_LITERAL_STRING("*"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::command, observesVal);
|
||||
GetElementById(observesVal, getter_AddRefs(broadcaster));
|
||||
if (broadcaster) {
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aElement));
|
||||
RemoveBroadcastListenerFor(broadcaster,
|
||||
elt,
|
||||
NS_LITERAL_STRING("*"));
|
||||
|
||||
if (aElement->HasAttr(kNameSpaceID_None, nsXULAtoms::command)) {
|
||||
aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::command, observesVal);
|
||||
if (!observesVal.IsEmpty()) {
|
||||
GetElementById(observesVal, getter_AddRefs(broadcaster));
|
||||
if (broadcaster) {
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aElement));
|
||||
RemoveBroadcastListenerFor(broadcaster,
|
||||
elt,
|
||||
NS_LITERAL_STRING("*"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user