Bug 1450927 - use new getBoundsInCSSPixels method for accessible bounds in accessible highlighter. r=jryans
authorYura Zenevich <yura.zenevich@gmail.com>
Tue, 24 Apr 2018 15:07:47 -0400
changeset 415561 1c0476f1f505b5d21a87681ac5084e5e17b4a8db
parent 415560 b58c8b754ce2a07c249a343b35f1517d510fc0bd
child 415562 3a593e7961a2d230a729bd9060d2c83ea7ae86e9
push id102609
push useryura.zenevich@gmail.com
push dateWed, 25 Apr 2018 18:52:17 +0000
treeherdermozilla-inbound@1c0476f1f505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1450927
milestone61.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 1450927 - use new getBoundsInCSSPixels method for accessible bounds in accessible highlighter. r=jryans MozReview-Commit-ID: 4Ixj2ksuDrP
devtools/server/actors/accessibility.js
devtools/server/actors/highlighters/utils/accessibility.js
--- a/devtools/server/actors/accessibility.js
+++ b/devtools/server/actors/accessibility.js
@@ -320,17 +320,17 @@ const AccessibleActor = ActorClassWithSp
 
   get bounds() {
     if (this.isDefunct) {
       return null;
     }
 
     let x = {}, y = {}, w = {}, h = {};
     try {
-      this.rawAccessible.getBounds(x, y, w, h);
+      this.rawAccessible.getBoundsInCSSPixels(x, y, w, h);
       x = x.value;
       y = y.value;
       w = w.value;
       h = h.value;
     } catch (e) {
       return null;
     }
 
--- a/devtools/server/actors/highlighters/utils/accessibility.js
+++ b/devtools/server/actors/highlighters/utils/accessibility.js
@@ -21,29 +21,29 @@ const { getCurrentZoom } = require("devt
  *         - {Number} w
  *           width of the the accessible object
  *         - {Number} h
  *           height of the the accessible object
  * @return {Object|null} Returns, if available, positioning and bounds information for
  *                 the accessible object.
  */
 function getBounds(win, { x, y, w, h }) {
-  let { devicePixelRatio, mozInnerScreenX, mozInnerScreenY, scrollX, scrollY } = win;
+  let { mozInnerScreenX, mozInnerScreenY, scrollX, scrollY } = win;
   let zoom = getCurrentZoom(win);
   let left = x, right = x + w, top = y, bottom = y + h;
 
-  left -= (mozInnerScreenX - scrollX) * devicePixelRatio;
-  right -= (mozInnerScreenX - scrollX) * devicePixelRatio;
-  top -= (mozInnerScreenY - scrollY) * devicePixelRatio;
-  bottom -= (mozInnerScreenY - scrollY) * devicePixelRatio;
+  left -= mozInnerScreenX - scrollX;
+  right -= mozInnerScreenX - scrollX;
+  top -= mozInnerScreenY - scrollY;
+  bottom -= mozInnerScreenY - scrollY;
 
-  left *= zoom / devicePixelRatio;
-  right *= zoom / devicePixelRatio;
-  top *= zoom / devicePixelRatio;
-  bottom *= zoom / devicePixelRatio;
+  left *= zoom;
+  right *= zoom;
+  top *= zoom;
+  bottom *= zoom;
 
   let width = right - left;
   let height = bottom - top;
 
   return { left, right, top, bottom, width, height };
 }
 
 exports.getBounds = getBounds;