Skip to content

Commit

Permalink
Bug 1645817 - Use overlay scrollbars win browser resolution test. r=kats
Browse files Browse the repository at this point in the history
Using overlay scrollbars will avoid the need to account for the trimmed
space that is introduced after an overflowing zoom caused by scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D80102
  • Loading branch information
eeejay committed Jun 18, 2020
1 parent 485a39c commit bb5c4e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions accessible/tests/browser/bounds/browser_test_resolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit bb5c4e4

Please sign in to comment.