Description
https://web-platform-tests.org/writing-tests/assumptions.html doesn't document anything about what the device pixel ratio of the viewport is (for HiDPI/Hi-DPI/retina/etc. displays).
RFC #41: Print Testing says for print that we rasterise it at 96 dpi, but doesn't say what device pixel ratio we render at:
The WebDriver-based implementation first renders the document to a PDF, and then computes the reftest result by rasterising the test and ref PDFs at 96 dpi.
There is prior discussion in web-platform-tests/wpt#7140, web-platform-tests/wpt#20284, and web-platform-tests/wpt#31457.
As far as I can tell, for Gecko it is set to 1.0 in:
And:
WebKit, for WKTR, sets it in:
This is, however, ignored on iOS. (For DRT, it's set in many places, per-platform, and I'm not gonna link to all of them here!)
Chromium I think does this in many places, depending on how it is being run, but I'm not totally sure. That said, some of the failures on wpt.fyi seem like they might be caused by running at a device pixel ratio which is not 1.0, though we don't have screenshots to see what's going on there.
Currently, on wpt.fyi, Edge and Safari are both run on HiDPI screens, I believe; see web-platform-tests/wpt#5498 and web-platform-tests/wpt#20058.
WebDriver doesn't expose any way to change the device pixel ratio, w3c/webdriver#1547, though WebDriver BiDi does, thus currently our only way to do this is via settings.