Introduce a weak ptr here to avoid extra addref/releases in this loop. r+sr=bzbarsky@mit.edu on irc.
git-svn-id: svn://10.0.0.236/trunk@145297 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -338,16 +338,17 @@ EventTargetIn(nsIPresContext *aPresContext, nsEvent *aEvent,
|
||||
aPresContext->GetEventStateManager(getter_AddRefs(esm));
|
||||
nsCOMPtr<nsIContent> c;
|
||||
esm->GetEventTargetContent(aEvent, getter_AddRefs(c));
|
||||
while (c) {
|
||||
if (c == aChild) {
|
||||
nsIContent *content = c;
|
||||
while (content) {
|
||||
if (content == aChild) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
if (c == aStop) {
|
||||
if (content == aStop) {
|
||||
break;
|
||||
}
|
||||
|
||||
c = c->GetParent();
|
||||
content = content->GetParent();
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user