Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/viewport-units-parsing.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Values: parsing width with valid viewport units</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
const prefixes = ["", "s", "l", "d"];
const suffixes = ["vw", "vh", "vi", "vb", "vmin", "vmax"];
const units = [];
for (const prefix of prefixes) {
for (const suffix of suffixes) {
units.push(prefix + suffix);
}
}
for (const unit of units) {
test_valid_value("width", "1" + unit);
}
</script>
</body>
</html>