Issue #2241 - Part 4.3: Move devtools over to getBounds().

This leaves getAdjustedQuads alone because it lives in its own world and its
result gets sent over IPC. That leaves things in a bit of an intermediate state,
but that should be OK for now.

Backported from Mozilla bug 1186265.
This commit is contained in:
Job Bautista 2023-05-12 11:54:35 +08:00 committed by roytam1
commit 69e45fd84e
8 changed files with 32 additions and 23 deletions

View file

@ -176,9 +176,9 @@ const getRelativeRect = function (node, relativeTo) {
// Width and Height can be taken from the rect.
let {width, height} = node.getBoundingClientRect();
let quads = node.getBoxQuads({relativeTo});
let top = quads[0].bounds.top;
let left = quads[0].bounds.left;
let quadBounds = node.getBoxQuads({relativeTo})[0].getBounds();
let top = quadBounds.top;
let left = quadBounds.left;
// Compute right and bottom coordinates using the rest of the data.
let right = left + width;