Bug 1124409 - Fix intermittent browser_bug1015721.js failures by ensuring the EventStateManager has a document before trying to dispatch ZoomChangeUsingMouseWheel. r=smaug, a=test-only
authorTim Taubert <ttaubert@mozilla.com>
Tue, 17 Mar 2015 22:05:06 +0100
changeset 250441 46cfbcfb58c5
parent 250440 9fc579f7bf3a
child 250442 e4f1cc6f63a3
push id4589
push userryanvm@gmail.com
push date2015-03-19 02:20 +0000
treeherdermozilla-beta@d76c709556bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs1124409, 1015721
milestone37.0
Bug 1124409 - Fix intermittent browser_bug1015721.js failures by ensuring the EventStateManager has a document before trying to dispatch ZoomChangeUsingMouseWheel. r=smaug, a=test-only
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2026,16 +2026,17 @@ EventStateManager::DoScrollZoom(nsIFrame
       // positive adjustment to decrease zoom, negative to increase
       int32_t change = (adjustment > 0) ? -1 : 1;
 
       if (Preferences::GetBool("browser.zoom.full") || content->OwnerDoc()->IsSyntheticDocument()) {
         ChangeFullZoom(change);
       } else {
         ChangeTextSize(change);
       }
+      EnsureDocument(mPresContext);
       nsContentUtils::DispatchChromeEvent(mDocument, static_cast<nsIDocument*>(mDocument),
                                           NS_LITERAL_STRING("ZoomChangeUsingMouseWheel"),
                                           true, true);
     }
 }
 
 static nsIFrame*
 GetParentFrameToScroll(nsIFrame* aFrame)