Bug 627306. dispatchEvent should return true when there's no document (and thus nothing that might call preventDefault). r=smaug a=sdwilsh
authorJesse Ruderman <jruderman@gmail.com>
Sat, 22 Jan 2011 15:33:16 -0800
changeset 61143 e3b9490af708327b4ec0c3853b409ccacd0d4c44
parent 61142 fb8e4cdf2346a4752a47aadaeb2866d0255df19d
child 61144 5a20393b0ce0f755d3ca83cdd9884a5c235659e2
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, sdwilsh
bugs627306
milestone2.0b10pre
first release with
nightly linux32
e3b9490af708 / 4.0b10pre / 20110123030331 / files
nightly linux64
e3b9490af708 / 4.0b10pre / 20110123030331 / files
nightly mac
e3b9490af708 / 4.0b10pre / 20110123030331 / files
nightly win32
e3b9490af708 / 4.0b10pre / 20110123030331 / files
nightly win64
e3b9490af708 / 4.0b10pre / 20110123030206 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 627306. dispatchEvent should return true when there's no document (and thus nothing that might call preventDefault). r=smaug a=sdwilsh
content/events/src/nsEventListenerManager.cpp
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -1310,16 +1310,17 @@ nsEventListenerManager::DispatchEvent(ns
   }
   
   // XXX sXBL/XBL2 issue -- do we really want the owner here?  What
   // if that's the XBL document?  Would we want its presshell?  Or what?
   nsCOMPtr<nsIDocument> document = targetNode->GetOwnerDoc();
 
   // Do nothing if the element does not belong to a document
   if (!document) {
+    *_retval = PR_TRUE;
     return NS_OK;
   }
 
   // Obtain a presentation shell
   nsIPresShell *shell = document->GetShell();
   nsRefPtr<nsPresContext> context;
   if (shell) {
     context = shell->GetPresContext();