-
Notifications
You must be signed in to change notification settings - Fork 715
[css-text-3] 'match-parent' computed value #2577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Edit: changed some minor points for accuracy I agree that the spec's text here is a little loose and with the problems that this causes. I think we should:
As far as I can tell, browsers are not fully interoperable (although they are somewhat close to eachother), and none of them do either what the spec says or what I suggested we fix it to:
None of these seem more useful than what is specified, and all of them would probably get the somewhat surprising handling of Therefore, I suggest we do not align the spec with any particular implementation, but do fix the spec as suggested above. Alternatively, since nobody supports |
…ually works as intended now that it's shorthanded by text-align. #2577 (comment)
…t, a=testonly Automatic update from web-platform-tests Add test for text-align-last:match-parent See w3c/csswg-drafts#2577 -- wpt-commits: 8f02eb034f7de83b52d4eadbd70b745a79424ad6 wpt-pr: 37701
…t, a=testonly Automatic update from web-platform-tests Add test for text-align-last:match-parent See w3c/csswg-drafts#2577 -- wpt-commits: 8f02eb034f7de83b52d4eadbd70b745a79424ad6 wpt-pr: 37701
(Refs to ED text: https://drafts.csswg.org/css-text-3/#text-align-property , https://drafts.csswg.org/css-text-3/#text-align-all-property .)
'text-align' is described as being a shorthand that "sets the text-align-all and text-align-last properties", but it isn't described what the text-align-all property is set to. If text-align sets text-align-all to the same specified value, then the specifications of their computed values would conflict, in the case of 'match-parent': text-align-all says simply "as specified", while text-align says that match-parent computes to either the parent computed value or 'left' or 'right'.
(I'd guess that text-align-all should have behaviour similar to that currently described for text-align, or indeed for the description to be moved from 'text-align' to 'text-align-all'; though this might depend on how the below issues are resolved.)
In the case of 'text-align', this description refers to "its parent’s computed value", but shorthand properties do not have computed values. I suppose that keeping the canonical description with 'text-align' is an
attempt to shield authors from having to think of the underlying longhands. How far should that be taken? If 'match-parent' "behaves the same as 'inherit' [except start or end]", then should that include the case that the parent has ‘text-align: justify-all’ ? If so, then the specification of how 'text-align' sets the specified value of 'text-align-last' will need changing.
When referring to "parent’s direction value", the root case should be mentioned explicitly.
(I think I'd do this as a separate sentence, perhaps "(A specified value of 'match-parent' on the root element is calculated according to the initial values of ..., resulting in [the equivalent of ‘text-align: left’].)"; where the exact wording would depend on whether the description is under 'text-align' or 'text-align-all', and the rule for how text-align:match-parent sets text-align-last.)
It might well be simpler to take the more usual approach that the specification of a shorthand mostly defer to behaviour of individual longhand properties, other than specifying the shorthand's syntax and the rules for how component longhand properties get set.
Sections 7.4.1 and 9.3 still refer to the value of text-align, as if text-align were a property. (For 7.4.1, "text-align properties" might work.)
The text was updated successfully, but these errors were encountered: