Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-conditional/container-queries/style-query-guaranteed-invalid.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Container Queries Test: style() query with guaranteed-invalid value</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<style>
#target { background-color: green; }
@container --root style(--prop: var(--unknown)) {
#target { background-color: red; }
}
</style>
<div id="target"></div>
<script>
setup(() => assert_implements_style_container_queries());
test(() => {
assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 128, 0)");
}, "Querying with a guaranteed-invalid value should evaluate to false");
</script>