Closed Bug 1645817 Opened 5 years ago Closed 5 years ago

browser_test_resolution.js seems to make some invalid assumptions

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: kats, Assigned: eeejay)

References

Details

Attachments

(1 file)

The test browser_test_resolution.js here fails with some of the changes I have inflight for bug 1644271. The bug in question is enabling some of the MobileViewportManager code (in particular, the code that sets the visual viewport size) in preparation for supporting APZ zooming on desktop.

The part of the test that fails as a result is this line on the p1 div. The reason is that the unscaled width taken here is the full browser window width without any scrollbars. After setting the 2.0 resolution scale, the browser now enables scrollbars (because the scaled content no longer fits in the window) and the scaledWidth comes out as 2 * (width - scrollbar_width) instead of 2 * width.

It's not really clear to me what assumptions this test is making, though. In a couple of places it seems to say that setResolution only does stuff on mobile, and so I'm wondering if this test is running on desktop as some sort of proxy, and not counting on the fact that on desktop we have non-overlay scrollbars (which affect layout space) while on mobile we only ever have overlay scrollbars (which do not affect layout space).

:eeejay as the original author of this test do you have any thoughts? I'm unsure what the best fix for this test is; it seems like forcing overlay scrollbars on desktop for the test might be the way to go.

Flags: needinfo?(eitan)

Also to be clear: setResolution does do stuff on desktop now, so maybe that makes the test "valid on desktop" instead of just "proxy test for mobile" and the correct fix is something else.

(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #1)

:eeejay as the original author of this test do you have any thoughts? I'm unsure what the best fix for this test is; it seems like forcing overlay scrollbars on desktop for the test might be the way to go.

I agree. I think overlay scrollbars will keep this test simple. It will still preserve its original purpose and will still have value in desktop cases. The scrollbar is irrelevant.

Flags: needinfo?(eitan)

Using overlay scrollbars will avoid the need to account for the trimmed
space that is introduced after an overflowing zoom caused by scrollbars.

Assignee: nobody → eitan
Status: NEW → ASSIGNED
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3613d0c141e8 Use overlay scrollbars win browser resolution test. r=kats
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Regressions: 1646887
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: