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

> Authors would then write code like so...
> 
> _full screen case_
> 
> ```
> targetResolution = screen.width * window.deviceVideoPixelRatio;
> ```
> 
> _inline case_
> 
> ```
> targetResolution = element.clientWidth * window.deviceVideoPixelRatio;
> ```

This direction looks good to me.

> Probably only necessary for the "current" Screen (so current Screen semantics should work). Would be nice to have an event if the screen changed though.

I agree. I don't think new events are needed if applications can use the [`video-resolution` media query](https://drafts.csswg.org/mediaqueries-5/#video-resolution), similar to [this example](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes).



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


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

Received on Friday, 10 December 2021 14:15:38 UTC