Open Loirooriol opened 5 years ago
Yeah, I agree that that entry is wrong. A browser that passes that subtest is clearly bogus.
Maybe the test should read something like: border-width: 1px; border-top-width: 1px !important;
?
Blink includes border-image: initial in the cssText serialization
I think this behavior is wrong. Resetting to the initial value is not the same as resetting to the initial keyword.
All in all I agree with your analysis.
Maybe the test should read something like:
border-width: 1px; border-top-width: 1px !important;
?
Adding this subtest seems a good idea, but given the issues with the existing one, I would also keep it (fixing the expected output).
Thinking more about this, Firefox seems right about setting border-image
to none 100% / 1 / 0 stretch
instead of initial
, but not all these values should appear in the serialization according to https://drafts.csswg.org/cssom/#serialize-a-css-value,
If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.
The syntax of border-image
is
<‘border-image-source’> || <‘border-image-slice’> [ / <‘border-image-width’> | / <‘border-image-width’>? / <‘border-image-outset’> ]? || <‘border-image-repeat’>
So there are three possible minimal serializations:
border-image: none
border-image: 100%
border-image: stretch
Which one should be chosen? Edge uses the first one. And I can't really say Firefox is wrong due to
If either of the above syntactic translations would be less backwards-compatible, do not perform them
Seems fairly undefined behavior, maybe the subtest shouldn't be kept after all.
https://github.com/web-platform-tests/wpt/blob/780c03bd757ee85581fece3e5e2f4434de7a1014/css/cssom/shorthand-values.html#L31
It says that
should serialize as
But that's not right because the
border
shorthand also setsborder-*-style
andborder-*-color
longhands, so according to https://drafts.csswg.org/cssom/#serialize-a-css-declaration-block I expect something likeThis is what Firefox and Blink do, and what WebKit will do after https://bugs.webkit.org/show_bug.cgi?id=190496
However, the
border
shorthand also setsborder-image
: https://drafts.csswg.org/css-backgrounds-3/#propdef-borderThere is no interoperability about this:
border-image: none 100% / 1 / 0 stretch
in the cssText serializationborder-image: initial
in the cssText serializationborder-image
toinitial
(like Blink) but this is omitted in cssText serializations (bug 185953)I think the Firefox behavior is the good one (using
initial
instead of the real initial value can cause problems like https://bugs.chromium.org/p/chromium/issues/detail?id=386459), but it's not completely clear.You can see the results in https://wpt.fyi/results/css/cssom/shorthand-values.html?label=experimental
@emilio can you confirm the expected output?