[cssom-view] Need to define how fractional lengths are converted to integers.
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
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:
- Gecko rounds.
- WebKit (and Blink, inherited) truncate, unless you're very close to the next pixel, in which case they round. Which is a bit odd but hey.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the listed CSSOM View APIs with the Gecko, WebKit, and Blink conversion behaviors described in the issue. The work is done when the relevant specifications define an interoperable conversion rule, or resolve whether affected APIs should return doubles instead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100