Skip unresolved container query CSS

Exclude linked container-query groups when their current applicability cannot be resolved, with a browser regression proving inactive styles do not leak.

AI assistance disclosure: This commit was prepared with Codex under maintainer direction.
This commit is contained in:
Paul Bakaus
2026-09-02 10:04:26 -07:00
parent 95b28ed6d7
commit eec431e778
5 changed files with 33 additions and 0 deletions
+7
View File
@@ -1321,6 +1321,13 @@ if (IS_BROWSER) {
try { return CSS.supports(condition); }
catch { return true; }
}
if (constructorName === 'CSSContainerRule' || /^\s*@container\b/i.test(rule?.cssText || '')) {
// The platform exposes no matchMedia-equivalent for container queries,
// and selector matches do not prove that the element's query container
// satisfies the condition. Omit the group rather than report styles that
// are inactive for the current layout.
return false;
}
return true;
}
@@ -8225,6 +8225,13 @@ if (IS_BROWSER) {
try { return CSS.supports(condition); }
catch { return true; }
}
if (constructorName === 'CSSContainerRule' || /^\s*@container\b/i.test(rule?.cssText || '')) {
// The platform exposes no matchMedia-equivalent for container queries,
// and selector matches do not prove that the element's query container
// satisfies the condition. Omit the group rather than report styles that
// are inactive for the current layout.
return false;
}
return true;
}