-
Notifications
You must be signed in to change notification settings - Fork 642
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
[css-contain-3] Should not cq units be interpreted in the flatDom context? #7947
Comments
The relevant section in the spec is §6. The spec now says: The issue is: what is the algorithm for "nearest ancestor"? Now in Chrome, the nearest ancestor container is interpreted as being the nearest container that is also in the same document as the element the This other test illustrates that the Does this mean that it is impossible to access the |
Example use-case:
|
This was decided in #5984. cc @mirisuzanne @lilles |
FWIW I think flat tree is a more natural choice, generally... |
@philkunz gives a good description of the ownership role the shadowDom/web component has when establishing a "slotting context". And we should extend it:
At the top of my head I can think of only one CSS value (in addition to On the other side, CSS selectors are interpreted against the document only context. Only a few, clearly marked CSS selectors such as In my head, this produce the following CSS x document/flatDom model. @query { /*interpreted against the document/lightDom*/
selector { /*interpreted against the document/lightDom*/
property: value; /*interpreted against the flatDom/shadowDom wins*/
}
} If this is the conceptual model, then that would mean that container queries should be interpreted within the document/lightDom context. As with animations. While the container query units such as I don't know. Maybe it is possible to wrap all the things you need to slot in a |
I agree that this is how container queries & units should work. I think it was @tabatkins making the strong argument against querying shadow containers. The argument tho, is that selecting a container is similar to selecting an element, and should be interpreted against the light dom. |
Not sure why I removed agenda+ the first time - maybe waiting for more discussion here. But I think this is worth coming back to. |
Selecting a different container for cq units than for the querying container does not make sense, right? Then, if this needs to be revisited, wouldn't it be better to re-open issue #5984 ? |
Yes, I agree with @lilles the container query and container units should use the same mechanism. I still think that the natural choice for that would be the flat tree tho... |
The CSS Working Group just discussed
The full IRC log of that discussion<emilio> q+<Frances> Tab: cqw units should be interpreted instead in the like tree rather than the flat tree. cqw units have to be consistent with other container queries in the flatDOM instead of in the normalDOM/ <astearns> ack emilio <miriam> q+ <Frances> Emilio: Do queries differentiate? <Frances> Tab: Yes, they do. <Frances> Emilio: Might not be what you want. <astearns> ack miriam <Frances> Tab: Could reopen issue. <Frances> Miriam: Has a strong argument, to reopen. It is more like inheritance. Would like to reopen it. <Frances> Alan: Close the issue saying that we want consistency. <TabAtkins> +1 to closeing this issue for consistency <miriam> s/Has a strong argument/Thinks this use-case is a strong argument/ <Frances> PROPOSAL: Close the issue in favor of consistency and reopen #5984. <Frances> RESOLVED: Close the issue in favor of consistency and reopen #5984. |
It looks like the
cqw
value is interpreted within the logical Dom context, and not the flatDom context. And this behavior seems to differ from the behavior of at least two other relative css units:%
andem
. Here is a test that illustrate the issue (only a single line of code is different in the last three tests):https://jsfiddle.net/fcx7rv2a/ (uses cqw directly)
https://jsfiddle.net/0hfnpumq/1/
https://jsfiddle.net/0hfnpumq/2/
https://jsfiddle.net/0hfnpumq/3/
Have I misunderstood something here? Or is this expected behavior?
The text was updated successfully, but these errors were encountered: