Skip to content

[cssom-view] Need to define how fractional lengths are converted to integers. #5259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emilio opened this issue Jun 25, 2020 · 0 comments
Open

Comments

@emilio
Copy link
Collaborator

emilio commented Jun 25, 2020

There are various APIs in the OM which return integer sizes. Some of them:

  • Window.{inner,outer}{Width,Height}.
  • Window.screen{X,Y,Top,Left}.
  • Screen.avail{Width,Height}.
  • Screen.{width,height}.
  • Element.offset{Top,Left,Bottom,Right}.
  • Element.scroll{Width,Height}.

These return CSS pixels, and that means that in the current world of HiDPI screens and different screen resolutions, are all lossy.

Browsers do different things when converting these from fractional CSS pixels to an integer:

It seems ideally we should have interop. I think some (if not all) of these (specially window sizes) would benefit from returning doubles, will file an issue on this. But it seems some agreement on what to do here would be on point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant