rescript-webapi
rescript-webapi copied to clipboard
Should CanvasElement height and width return floats?
Seems like a pretty nuts use case to have a canvas with a greater height or width than ~2million but I think it's possible.
Maybe this applies in other places too? I think in general most of the web APIs should return floats as they map to JS numbers.
The main use case I see for floats in the DOM is not large numbers, but fractions. Setting a fractional pixel isn’t common but having them returned by measurement apis can be.
so it’s not a no, but I’d prefer to see use case examples before changing an int to a float 🤔
Good points. I'm thinking more about the bindings be as spec compliant as possible - where the spec defines a JS number I think it makes sense to use a float without really needing to think about the use cases.