Closed Bug 1572840 Opened 4 years ago Closed 4 years ago

RDM pane should scale up/down with changes to full-page zoom


(DevTools :: Responsive Design Mode, defect, P1)



(firefox70 fixed)

Firefox 70
Tracking Status
firefox70 --- fixed


(Reporter: bradwerth, Assigned: bradwerth)


(Blocks 2 open bugs)


(Whiteboard: [rdm-mvp])


(5 files, 1 obsolete file)

When changing full-page zoom with RDM enabled, the RDM pane itself stays the same size. This has the undesirable effect of displaying content on the simulated device screen that could not actually be reached on a real device. It would be better for us to scale up/down the RDM pane itself along with the contents, simulating instead the experience of the device getting bigger/smaller, or perhaps closer to/farther from the viewer.

When changing the size of the RDM pane in this way, the reported pixel resolution of the device should not change.

This is also what Chrome developer tools does and may be better aligned with our users' expectations.

Priority: -- → P1

Okay, the updated patches now kind of work. While we discuss whether or not we want to make this UI change, I will put the code up for review to address anything technically wrong with it.

Depends on D41467

Depends on: 1575097
Attachment #9086179 - Attachment description: Bug 1572840 Part 4: Update test expectations. → Bug 1572840 Part 5: Update test expectations.
Attachment #9086179 - Attachment is obsolete: true

Rounding errors when reconstituting device size in nsGlobalWindowOuter::GetRDMDeviceSize is making this challenging. With the changes in this patch, it's possible with < 100% zoom for the RDM pane to be locked to device pixels at the scaled-down size and that introduces inaccuracy when dividing out the zoom level again. This is the source of the test failures in devtools/client/responsive/test/browser/browser_window_sizing.js.

Ideally nsGlobalWindowOuter::GetRDMDeviceSize could get the size without relying on a lossy multiply by < 1, clamp to integer pixels then divide by < 1. We want screen.width and window.outerWidth to report the proper size at all zoom levels. So I don't want to just loosen up the test to accomodate a larger error value.

Blocks: 1577775
Pushed by
Part 1: Add a zoom viewport action to RDM pane. r=gl
Part 2: Make the RDM viewport render scaled to the viewport.zoom property. r=gl
Part 3: Listen to fullzoom changes in the RDM pane and call the zoom viewport function. r=gl
Part 4: Change nsGlobalWindowOuter::GetRDMDeviceSize to divide out full zoom levels. r=Ehsan
Part 5: Update test expectations. r=gl
Blocks: 1579986
Regressions: 1602799
You need to log in before you can comment on or make changes to this bug.