[css-contain-3] Inconsistent handling of known and unknown features jeopardizes backward compatibility · Issue #7551 · w3c/csswg-drafts (original) (raw)
Currently, a condition like ((<unknown>) or (width))
will evaluate to true
on a container with inline-size
(assuming horizontal writing mode) or size
, because the <unknown>
is irrelevant to the final result. However, this is not the case with a known but invalid feature. For example, ((height) or (width))
and not ((height) or (width))
will simply be filtered out and never evaluated on an inline-size
container, and so those styles will never be applied.
The issue is that a future version of the specification could make some value of <unknown>
a known feature that happens to be invalid in the context an author used it. If a browser follows the existing behavior of filtering out conditions with such features, the author's styles will likely begin to stop applying for users on that browser, which is unexpected behavior.
Instead of being filtered out when they have known but invalid features, it seems like invalid features should just evaluate to unknown
for consistency. That way, a condition like ((<unknown>) or (width))
will continue to apply (via the semantics of the or
), even if <unknown>
eventually has a semantic meaning in a future browser.