Bug 1393424 - Don't try to autoscroll in Print Preview mode. r=kats
authorBotond Ballo <botond@mozilla.com>
Fri, 01 Sep 2017 13:19:56 -0400
changeset 378314 f584ae5d61c4dbc2985338e0d7a5cb32946d69cd
parent 378313 8702d05b5df705ab98ebae1e129d0eea7649ec1c
child 378315 2093d5141fb21195b1f84894b2921bcace8c3cfd
push id32428
push userarchaeopteryx@coole-files.de
push dateSat, 02 Sep 2017 08:52:28 +0000
treeherdermozilla-central@b01a7e57425b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1393424, 1393494
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1393424 - Don't try to autoscroll in Print Preview mode. r=kats It doesn't work properly anyways due to a more general coordinate-system problem on the Print Preview page (see bug 1393494). MozReview-Commit-ID: D4i2H8z5mtW
toolkit/content/browser-content.js
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -134,16 +134,22 @@ var ClickEventHandler = {
 
   startScroll(event) {
 
     this.findNearestScrollableElement(event.originalTarget);
 
     if (!this._scrollable)
       return;
 
+    // In some configurations like Print Preview, content.performance
+    // (which we use below) is null. Autoscrolling is broken in Print
+    // Preview anyways (see bug 1393494), so just don't start it at all.
+    if (!content.performance)
+      return;
+
     let domUtils = content.QueryInterface(Ci.nsIInterfaceRequestor)
                           .getInterface(Ci.nsIDOMWindowUtils);
     let scrollable = this._scrollable;
     if (scrollable instanceof Ci.nsIDOMWindow) {
       // getViewId() needs an element to operate on.
       scrollable = scrollable.document.documentElement;
     }
     this._scrollId = null;