diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index d2b387b534a46..c757413bd4f8e 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -646,8 +646,8 @@ nsRect Accessible::BoundsInAppUnits() const { unionRectTwips.MoveBy(-viewportOffset); // We need to take into account a non-1 resolution set on the presshell. - // This happens in mobile platforms with async pinch zooming. Here we - // scale the bounds before adding the screen-relative offset. + // This happens with async pinch zooming. Here we scale the bounds before + // adding the screen-relative offset. unionRectTwips.ScaleRoundOut(presShell->GetResolution()); // We have the union of the rectangle, now we need to put it in absolute // screen coords. diff --git a/accessible/tests/browser/bounds/browser_test_resolution.js b/accessible/tests/browser/bounds/browser_test_resolution.js index eb929bcffa123..bdcb3e17927dd 100644 --- a/accessible/tests/browser/bounds/browser_test_resolution.js +++ b/accessible/tests/browser/bounds/browser_test_resolution.js @@ -45,6 +45,11 @@ async function testScaledBounds(browser, accDoc, scale, id, type = "object") { } async function runTests(browser, accDoc) { + // The scrollbars get in the way of container bounds calculation. + await SpecialPowers.pushPrefEnv({ + set: [["ui.useOverlayScrollbars", 1]], + }); + await testScaledBounds(browser, accDoc, 2.0, "p1"); await testScaledBounds(browser, accDoc, 0.5, "p2"); await testScaledBounds(browser, accDoc, 3.5, "b1");