Skip to content
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

Specify if getComputedTextLength() should return a float or an integer #25

Closed
tigt opened this issue Sep 27, 2015 · 2 comments
Closed

Comments

@tigt
Copy link

tigt commented Sep 27, 2015

The getComputedTextLength method (and by proxy, the getSubStringLength method) only specify returning a number in user units. Current implementations differ: Chrome and WebKit return integers, and Firefox and IE/Edge return floats.

It would be better to return a float; depending on viewport dimensions and transformations, an integer can be very inaccurate.

@erikdahlstrom
Copy link
Contributor

The getComputedTextLength method is defined as returning a float value in the IDL.

This sounds more like an implementation issue.

@tigt
Copy link
Author

tigt commented Sep 30, 2015

Ah, right you are. Would be nice if it was more explicit in the text, but that's probably up to W3C style. I'll take it up with Chrome and Safari.

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

3 participants