Bug 1356183 - Let MousePosTracker use event.clientX instead of event.screenX - window.mozInnerScreenX to avoid flushing layout. r=florian, a=gchang
authorDão Gottwald <dao@mozilla.com>
Thu, 13 Apr 2017 11:44:56 +0200
changeset 375946 4786c5b193e1385fb9a3990d4c6e6b6048bd2be3
parent 375945 f73bb141ba467cbe45e7f9b89e08642d35625768
child 375947 631c3b43f95ced3665093d5371246cba5a4cba78
push id11063
push userryanvm@gmail.com
push dateMon, 17 Apr 2017 14:39:33 +0000
treeherdermozilla-aurora@d68c89ad6e51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, gchang
bugs1356183
milestone54.0a2
Bug 1356183 - Let MousePosTracker use event.clientX instead of event.screenX - window.mozInnerScreenX to avoid flushing layout. r=florian, a=gchang MozReview-Commit-ID: 5jULHMnWFBW
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -8129,18 +8129,18 @@ var MousePosTracker = {
   },
 
   removeListener(listener) {
     this._listeners.delete(listener);
   },
 
   handleEvent(event) {
     var fullZoom = this._windowUtils.fullZoom;
-    this._x = event.screenX / fullZoom - window.mozInnerScreenX;
-    this._y = event.screenY / fullZoom - window.mozInnerScreenY;
+    this._x = event.clientX / fullZoom;
+    this._y = event.clientY / fullZoom;
 
     this._listeners.forEach(function(listener) {
       try {
         this._callListener(listener);
       } catch (e) {
         Cu.reportError(e);
       }
     }, this);