Tests: Import WPT tests for CSS env()

This commit is contained in:
Sam Atkins
2025-08-06 11:02:11 +01:00
committed by Alexander Kalenik
parent 5808eff1f4
commit b03e829a49
Notes: github-actions[bot] 2025-08-07 14:42:02 +00:00
18 changed files with 345 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://drafts.csswg.org/css-env-1/">
<title>Test that nested var() fallback values work with CSS env vars</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
body {
--main-bg-color: rgb(0, 128, 0);
background-color: env(test, var(--main-bg-color));
}
</style>
</head>
<body>
<script>
test(() => {
const style = window.getComputedStyle(document.body);
assert_equals(style.getPropertyValue("background-color"), "rgb(0, 128, 0)");
});
</script>
</body>
</html>