This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Created attachment 1190 [details] Suggested patch When specifying lengths, CSS allows zero lengths to be specified without a unit. This works fine for "0", but not for "0.0" . The specification clearly states that any numbers may contain a decimal point, so I think that should work. To reproduce, try this: * {margin: 0.0} The reason for this behaviour is what I think is an inappropriate use of the BigDecimal's "equals" method. As the javadoc states, the method returns only true when the value and scale for both arguments are identical. This means that 2.0 does not equal 2.00 or for the example above, 0 == BigDecimal.ZERO but 0.0 does not. I'll attach a patch with all those places corrected that I think need to be reworked. There are still some (few) lines where there are still == checks, but where I was not sure what behaviour was actually intended.
(corrected misleading title. sorry.)
It is indeed an issue, thanks for finding it and for providing a patch! I expanded it a bit to cover Resolution and other improper use of equals.