diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 35bb33d087d..d31d986263a 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -669,9 +669,7 @@ nsEventListenerManager::SetEventHandler(nsIAtom *aName, } else { nsCOMPtr win = GetTargetAsInnerWindow(); if (win) { - nsCOMPtr domdoc; - win->GetDocument(getter_AddRefs(domdoc)); - doc = do_QueryInterface(domdoc); + doc = win->GetDoc(); global = do_QueryInterface(win); } else { global = do_QueryInterface(mTarget);