[css-syntax][cssom][css-values] Asymmetry of parsing and serializing numbers
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
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?
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 reading the linked CSS Syntax, CSS Values, and CSSOM sections and compare their requirements for parsing, computation, and serialization precision. Determine whether the working group should change parsing or serialization rules; done requires an agreed resolution and corresponding updates to the affected specification text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100