[csswg-drafts] [css-values] Calc serialization algorithm is not web compatible

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values] Calc serialization algorithm is not web compatible ==
In https://drafts.csswg.org/css-values/#calc-serialize, section 3 says:

> Otherwise, serialize as a calc() containing the summation, with the units ordered ASCII case-insensitive alphabetically, the number (if present) coming before all units, and the percentage (if present) coming after all units.

Servo implements this, and when testing it on Firefox, we've come across web compat bugs, in particular: https://bugzilla.mozilla.org/show_bug.cgi?id=1390496

That's a case where something has `calc(100% - 2px)`.

Blink and Gecko serialize it as written. Servo serializes it as `calc(-2px + 100%)`, following that section of the spec, and the page tries to parse that and messes it up, causing flickering. Not sure about what's Edge's behavior.

Needs like we need another algorithm for serializing `calc()` values?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1731 using your GitHub account

Received on Thursday, 17 August 2017 18:38:14 UTC