Closed Bug 1469877 Opened 6 years ago Closed 6 years ago

XUL accessible highlighter position is incorrect at different zoom levels

Categories

(DevTools :: Accessibility Tools, enhancement)

enhancement
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed

People

(Reporter: mtigley, Assigned: mtigley, Mentored)

References

Details

Attachments

(1 file)

Bounds positioning is incorrect when zoom level is manipulated while using the xul-accessible highlighter. The reason for this is the highlighter calculates zoom level in relation to the top-level window object. Instead, we should calculate the zoom based on the parent window of an accessible object.
Assignee: nobody → mtigley
Status: NEW → ASSIGNED
Comment on attachment 8986882 [details]
Bug 1469877 - XUL accessible highlighter position is incorrect at different zoom levels.

https://reviewboard.mozilla.org/r/252120/#review258820

Looks good! Just a couple of nits, see below:

::: devtools/server/actors/highlighters/utils/accessibility.js:32
(Diff revision 1)
>   * @return {Object|null} Returns, if available, positioning and bounds information for
>   *                 the accessible object.
>   */
> -function getBounds(win, { x, y, w, h }) {
> -  const { mozInnerScreenX, mozInnerScreenY, scrollX, scrollY } = win;
> -  const zoom = getCurrentZoom(win);
> +function getBounds(win, { x, y, w, h, zoom }) {
> +  let { mozInnerScreenX, mozInnerScreenY, scrollX, scrollY } = win;
> +  const zoomFactor = zoom || getCurrentZoom(win);

Perhaps in order to make it a more visible override of zoomFactor, lets just set zoomFactor here as before, e.g. ```let zoomFact = getCurrentZoom(win);``` and then inside the if statement just add ```zoomFactor = zoom;``` right before modifying inner and scroll values.

::: devtools/server/actors/highlighters/xul-accessible.js:83
(Diff revision 1)
>     *
>     * @return {Object|null} Returns, if available, positioning and bounds
>     *                       information for the accessible object.
>     */
>    get _bounds() {
> -    return getBounds(this.win, this.options);
> +    const zoom = getCurrentZoom(this.currentNode);

Lets add a comment here stating that zoom for top level browser window does not change and only inner frames do, thus our best shot is to get the zoom level of the parent window for currentNode.

::: devtools/server/actors/highlighters/xul-accessible.js:85
(Diff revision 1)
>     *                       information for the accessible object.
>     */
>    get _bounds() {
> -    return getBounds(this.win, this.options);
> +    const zoom = getCurrentZoom(this.currentNode);
> +
> +    return getBounds(this.win, {...this.options, zoom});

Niy: add a space after { and before } when using spread syntax.
Attachment #8986882 - Flags: review?(yzenevich) → review+
Comment on attachment 8986882 [details]
Bug 1469877 - XUL accessible highlighter position is incorrect at different zoom levels.

https://reviewboard.mozilla.org/r/252120/#review259180
Attachment #8986882 - Flags: review?(pbrosset) → review+
Keywords: checkin-needed
I couldn't land your patch. mtigley: Please set the issues opened by the reviewer as fixed by commit so review board allows to land them. Thank you.
Flags: needinfo?(mtigley)
Keywords: checkin-needed
Comment on attachment 8986882 [details]
Bug 1469877 - XUL accessible highlighter position is incorrect at different zoom levels.

https://reviewboard.mozilla.org/r/252120/#review260010

Fixed issues.
Attachment #8986882 - Flags: review+
Set issues on reviewboard as fixed. Thank you!
Keywords: checkin-needed
Pushed by aciure@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/50c30489f378
XUL accessible highlighter position is incorrect at different zoom levels. r=pbro,yzen
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/50c30489f378
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Clearing needinfo because it is landed.
Bug landed, clearing ni?
Flags: needinfo?(mtigley)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: