Re: [csswg-drafts] [mediaqueries] length units in video-* media features. (#5044)

Sorry for the long pause. @frivoal reminded me this remains open. Lets fix it!

Given @jpiesing's  [https://github.com/w3c/csswg-drafts/issues/5044#issuecomment-723032003](comment above), I'd like to pursue the second option I suggested:

> add deviceVideoPixelRatio to Screen. You can then determine the "video" pixels of anything, including screen (width, height), window (availWidth, availHeigh), as well as inline

Only I guess I should revise that add the attribute to Window, not Screen (since that's where devicePixelRatio ended up).

Authors would then right code like so...

_full screen case_

```
targetResolution = screen.width * window.deviceVideoPixelRatio;
```

_inline case_

```
targetResolution = element.clientWidth * window.deviceVideoPixelRatio;
```

And then fetch video assets according to whatever is closest to targetResolution.

@smfr @zcorpan @emilio: would you mind if I send a PR to add this to cssom-view?

-- 
GitHub Notification of comment by chcunningham
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5044#issuecomment-974586139 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 20 November 2021 03:36:51 UTC