Open Bug 1341936 Opened 7 years ago Updated 2 years ago

Serialization of declaration block is wrong when shorthand has variable reference but some of its longhands have explicit value

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

People

(Reporter: xidorn, Unassigned)

References

Details

For example,
> div { padding: var(--x); padding-left: 0px; }
would be serialized to
> div { padding-top: ; padding-right: ; padding-bottom: ; padding-left: 1px; }
which is apparently incorrect. It should be serialized to
> div { padding: var(--x); padding-left: 0px; }

This is probably tricky to implement. And actually Blink is wrong in the same way at the moment, so it is probably not a high priority issue.

The spec seems to be correct that
> shorthands that are specified with explicit var() functions must
> serialize to the original, var()-containing value. [1]
but there are probably some edge cases tricky to handle, which would need some investigation, and change proposal to the spec.


[1] https://drafts.csswg.org/css-variables/#variables-in-shorthands
(I noticed this issue while looking at Servo's ShorthandID::get_shorthand_appendable_value function. This can be fixed after Stylo, so that we don't need to fix it twice.)
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.