Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>CSS Container Queries Test: style() query matching registered custom property initial value</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<style id="style_sheet">
@property --length {
syntax: "<length>";
initial-value: 30px;
inherits: true;
}
#container { container-name: --container; }
#target { color: lime; }
@container --container style(--length: 30px) {
#target { color: green; }
}
</style>
<div id="container">
<div id="target"></div>
</div>
<script>
setup(() => assert_implements_style_container_queries());
test(() => {
assert_equals(getComputedStyle(target).color, "rgb(0, 128, 0)");
}, "Query matching initial value of registered property");
test(() => {
style_sheet.sheet.deleteRule(0);
assert_equals(getComputedStyle(target).color, "rgb(0, 255, 0)");
}, "Query no longer matching initial value after @property rule is removed");
</script>