[css-text-decor-4] Fix the expected serialization of text-decoration. #18866
Conversation
@ericwilligers This may need your review. cc @emilio |
Are you suggesting the serialization of text-decoration from gCS should be different in the following two cases? Is there a precedent?
|
This is a good example. I didn't notice any precedent, at least now. Emilio suggests to me that it'd be better to always serialize |
9e5b12c
to
32c6de3
Updated the description. |
Are you saying that for the specified value, |
Sorry for the confusing description. I reply these below.
For specified shorthand, we omit none and solid if the color is not currentcolor. For example:
For example:
In this example, all keywords, including color, are default value, so we just serialize it as Sorry, we landed this change into gCS() is a different case.
Note: I intend to land the serialization for gCS() on |
Do the specs specify where text-decoration-thickness appears in the text-decoration shorthand? I only see "This property, which is also a sub-property of the text-decoration shorthand, ..." |
I think the answer is no. This is another spec issue, so I need to file one for this. Anyway, I put it in the last one in the text-decoration shorthand for now. BTW, I found there are some other test cases also need to be updated. I will upload an extra patch for review. Thanks. |
We add some test cases for `text-decoration-thickness` in `text-decoration`. Conceptually the process of serializing a shorthand in getComputedStyle should be something like: * Calling to_resolved_value() on all the values for the properties of the shorthand. This should turn the color as an rgb(a) thing, as colors are always serialized as resolved from getComputedStyle(). * Going from the resolved value al the way to the specified value. This makes the color still an rgba color, not currentColor. * Serialize the same way we serialize specified shorthands. So we always serizlize `text-decoration-color` because it is impossible to be `currentColor`. For other keywords, if they are initial values, we omit them.
…nd variable-presentation-attribute.html. text-decoration-serialization should be updated because we would like to update the serialization of text-decoration. variable-presentation-attribute.html tests CSS variable and SVG presentation attributes. In SVG2, the text decoration is determined respectively by the text-decoration-line and text-decoration-style, so we test these two longhands instead, to avoid hitting the change of the serialization of text-decoration.
a588ae2
to
a179204
Rebased and try to rerun tests because we hit the Github API issue: #18704 |
28cd992
into
web-platform-tests:master
… r=emilio,dholbert The wpt will be updated in web-platform-tests/wpt#18866. Besides, there are some other test cases use text-decoration, so we have to update them as well. The rule is: if the test case is not related to old `text-decoration` longhand, we use `text-decoration-line` instead. If the test case is for testing the change of `text-decoration` from longhand to shorthand, we should use the correct serialization. Differential Revision: https://phabricator.services.mozilla.com/D44909 --HG-- extra : moz-landing-system : lando
… r=emilio,dholbert The wpt will be updated in web-platform-tests/wpt#18866. Besides, there are some other test cases use text-decoration, so we have to update them as well. The rule is: if the test case is not related to old `text-decoration` longhand, we use `text-decoration-line` instead. If the test case is for testing the change of `text-decoration` from longhand to shorthand, we should use the correct serialization. Differential Revision: https://phabricator.services.mozilla.com/D44909
… r=emilio,dholbert a=lizzard The wpt will be updated in web-platform-tests/wpt#18866. Besides, there are some other test cases use text-decoration, so we have to update them as well. The rule is: if the test case is not related to old `text-decoration` longhand, we use `text-decoration-line` instead. If the test case is for testing the change of `text-decoration` from longhand to shorthand, we should use the correct serialization. Differential Revision: https://phabricator.services.mozilla.com/D44909 --HG-- extra : source : 43ce5f2968ea046eeea78089e4f80efc09c8fb8a
… r=emilio,dholbert a=lizzard The wpt will be updated in web-platform-tests/wpt#18866. Besides, there are some other test cases use text-decoration, so we have to update them as well. The rule is: if the test case is not related to old `text-decoration` longhand, we use `text-decoration-line` instead. If the test case is for testing the change of `text-decoration` from longhand to shorthand, we should use the correct serialization. Differential Revision: https://phabricator.services.mozilla.com/D44909
We add some test cases for
text-decoration-thickness
intext-decoration
.Conceptually the process of serializing a shorthand in getComputedStyle should be something like:
So we always serizlize
text-decoration-color
because it is impossible to becurrentColor
. For other keywords, if they are initial values, we omit them.