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

[css-syntax][cssom][css-values] Asymmetry of parsing and serializing numbers #5880

Open
bernhardf-ro opened this issue Jan 19, 2021 · 0 comments
Labels

Comments

@bernhardf-ro
Copy link

According to [css-syntax]4.3.12.&4.3.13. as well as [css-values]5. numbers are parsed and processed with the maximum possible precision.
However, [cssom]6.7.2. specifies a maximum precision of 6 digits (7th for rounding) for serialization.

So serializing and re-parsing can change values. For example, JavaScript modifications of style sheets can have unexpected and unavoidable side-effects.

To demonstrate a worst-case: image-orientation:44.99999deg computes to 0deg, but after serialization and re-parsing computes to 90deg, as it was rounded to 45deg.

So the question is: Should parsing also limit precision or is there a different solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants