Re: [csswg-drafts] [css-contain-3] Inconsistent handling of known and unknown features jeopardizes backward compatibility (#7551)

Got it. Thanks for catching and reporting this - sorry I didn't see it earlier. I think we do expect new features over time, and I see how this could be an issue. I made a test case on codepen, which shows the problem: 

https://codepen.io/miriamsuzanne/pen/mdKEeby?editors=1100

(the result is a green background in both Blink and WebKit)

The language clarification that I'm trying to make here is that `height` is not _known-but-invalid_ in a general sense - but the fact that it's known means that it can be used to influence container-selection. And, as per spec:

> If no ancestor is an eligible query container, then the [container query](https://www.w3.org/TR/css-contain-3/#container-query) is unknown for that element.

Lack of a valid container causes the entire query to resolve `unknown`, where `<general-unknown>` only causes a single condition to resolve `unknown`. The issue here is _caused by_ the container selection process, which doesn't currently account for `<general-unknown>` in validating containers. So the solution likely requires a change to that process. I see two potential solutions:

1. Account for `or` logic in the container-selection process. An `inline-size` container could be considered valid for a query of `(height) or (width)`, since it's a valid container for one of the conditions. That may have strange implications I haven't considered, and I don't know if it's even viable from an implementation perspective.
2. Account for `<general-enclosed>` in the container-selection process. As you suggest above, unknown features could invalidate container-selection, and cause the entire query to be `unknown`.

I'd be interested in thoughts from the co-authors (@frivoal & @tabatkins) or @fantasai who proposed the auto-selection feature. Also adding Agenda+ to see if we can get a resolution on one of these from the group.

-- 
GitHub Notification of comment by mirisuzanne
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7551#issuecomment-1302594730 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 3 November 2022 19:53:01 UTC