Closed as not planned
Description
In the steps labeled shorthand loop within serialize a css declaration block, there is a case where we will serialize the declaration with an incorrect shorthand property.
For example declarations: border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;
are serialized as border: 1px
despite missing the required border-style-*
and border-color-*
declarations rather than the correct border-width: 1px
.
This is because serialize a css value returns a value for the first shorthand property that exactly maps to all current longhands
(note step 1), not just shorthand
The fix here would be to either:
- Check that
current longhands
can be serialized asshorthand
(i.e.shorthand
exactly maps to all of the longhand properties incurrent longhands
andshorthand
can exactly represent the values of all the properties incurrent shorthand
) before step 7 of shorthand loop. - Pass
shorthand
to serialize a css value and only try to serialize as that shorthand.