Bug 1393424 - Don't try to autoscroll in Print Preview mode. r=kats draft
authorBotond Ballo <botond@mozilla.com>
Fri, 01 Sep 2017 13:19:56 -0400
changeset 657596 da241829abf69cd03ef838bea57e1828356f0e00
parent 657500 34933f6390d52779ea498a6a5fd5f34d54734780
child 657600 a842b54f04e022554bfde03ee7dfa755909ce588
push id77570
push userbballo@mozilla.com
push dateFri, 01 Sep 2017 17:34:18 +0000
reviewerskats
bugs1393424, 1393494
milestone57.0a1
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;