-
Notifications
You must be signed in to change notification settings - Fork 715
[css-contain-2] Combination of shortcuts and values #5506
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
Hm, indeed. I think the example is useful - being able to say "everything that So I'm inclined to allow combination. Further questions, then:
|
I agree that a combination of shorthands and values should be possible. Just yesterday, I wanted to use I am inclined to say that any combination of unique shorthands and values should be possible. I assume UAs already expand the shorthands to a set of values and it is relatively easy to add a single value to this set. And when this value already exists in the set it is ignored (because it is a set and not a list). |
I am slightly inclined to only allowing combinations with additional values as it pushes authors to read a bit about the values, as @TimVevida wrote, it's logically a bit cleaner, and because there are no other properties with such duplications. The syntax would then be
Sebastian |
IMO this depends on #5511. If shortcut values have the same computed value as the expanded list of values, according to the shortest serialization principle the serialization should try to use shortcuts. However, if we allow mixing shortcuts with other values, we may end up having multiple minimal solutions. For example, we have So if we allow mixing shortcuts with other values, I think we should either:
|
Good point about the serialization! As the decision in #5511 will also apply to the changes requested here, let's discuss them there. Sebastian |
Note that currently, all implementations (Gecko and Blink at least, is there another one) reject combining the shortcut values and the other values. I think the syntax shown in #5506 (comment) is pretty reasonable, but that's not the one we specified or that was implemented. It might have been a little better if we started out this way, but I don't see a whole lot of value changing at this point, and I suggest we just fix the non conforming note. That said, if implementations are interested in changing, I don't think it's a bad idea per se, so I'm not opposed. |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: combination of shorthand and longhand values<TabAtkins> github: https://github.com//issues/5506 <fantasai> TabAtkins: I wrote in an example in the spec 'contain: strict style' <fantasai> TabAtkins: because strict doesn't include style <fantasai> TabAtkins: turns out that this is not grammatical <fantasai> TabAtkins: you can't mix the shorthands with additional longhands <fantasai> TabAtkins: question is... should it be? <fantasai> TabAtkins: especially if the shorthand computes to longhand, shouldn't we allow combining them <fantasai> TabAtkins: if we do that, then how strict do we want to be about the combinations, do we allow 'strict paint' even though 'paint' is already included in 'strict' <florian> q+ <myles> q+ <fantasai> TabAtkins: Weakly prefer allowing more combos, but browsers only accept the stricter syntax <fantasai> florian: Weak preference <astearns> ack florian <fantasai> florian: my weak preference goes the other way around because it's stable. <astearns> ack myles <fantasai> florian: If from scratch, would allow the non-redundant combinations, but minor enough not worth fixing <fantasai> myles: Similar to what Florian just said. <fantasai> myles: Also, as far as you know, are you the only person who has this desire? <fantasai> TabAtkins: No idea <fantasai> myles: So probably, no change <fantasai> astearns: until browsers get bugs from ppl other than Tab :) <fantasai> astearns: proposed no change <fantasai> +1 <fantasai> astearns: any objections? <fantasai> RESOLVED: close no change |
marking as needing edits to remember to fix the example |
In the CSS containment spec, the values
strict
andcontent
are shortcut values, indicating multiple values. The spec says either a shortcut value or a combination of values can be used, but not both.However, in the example of the
content
value, the combination ofstrict style
is shown, which should not be possible according to the spec.So either:
The text was updated successfully, but these errors were encountered: