Skip to content

What is the expected behavior for device pixel emulation from the user's point of view? #638

@whimboo

Description

@whimboo

With the browsingContext.setViewport command and the devicePixelRatio argument it should be possible to override the screen's default device pixel ratio to simulate different screen densities. Setting the DPR is hereby covered under step 6 and 6.2 contains the following:

If device pixel ratio is not null, change the size of the CSS Pixel in context’s layout viewport such that it corresponds to device pixel ratio in device pixels.

This basically means that any change of the device pixel ratio should be reflected in the size of CSS Pixels affecting the layout viewport, eg. if DPR=2 is set a CSS pixel will be twice that large as a device pixel.

While implementing the support for devicePixelRatio in Firefox I noticed that when running the existing WebDriver BiDi tests with Chrome in headful mode that any other value for that argument is not reflected in the layout viewport. So this is basically a behavior that is not expected by the BiDi specification.

It's unclear for us what a user actually gains from that DPR override behavior compared to the spec'ed version. If we indeed don't want to affect the layout rendering, the BiDi spec would have to be updated to match that behavior.

@OrKoN or @jrandolf could you please take a look? Thanks!

CC @sadym-chromium, @jgraham, @juliandescottes, @lutien

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions