Files
sousa-gecko/testing/web-platform/tests/css/css-borders/border-width-hairline.html
T
EyvLil ed821c22e0 Bug 2041857 [wpt PR 60107] - Add basic testing for the hairline keyword, a=testonly
Automatic update from web-platform-tests
Add basic testing for the hairline keyword (#60107)

Test that the hairline keyword is supported in border-width,
and making sure it's within bounds.
--

wpt-commits: d2adc889da42ffced176dcd82078cec472c1ef2b
wpt-pr: 60107
2026-05-27 07:28:39 +00:00

33 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Borders and Box Decorations Test: border-width with hairline"</title>
<link rel="author" title="Eyvind Lillesveen" href="mailto:eyvind.lillesveen@gmail.com">
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#valdef-line-width-hairline">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<style>
#t {
border-left-style: solid;
border-left-width: hairline;
}
</style>
<div id="t"></div>
<script>
test_valid_value("border", "hairline dotted green");
test_valid_value("border-width", "5px hairline");
test_valid_value("border-width", "hairline");
test_valid_value("border-left-width", "hairline");
test(() => {
const pixels = Number(getComputedStyle(t).borderLeftWidth.replace("px", ""));
assert_less_than_equal(pixels, 1)
assert_greater_than(pixels, 0)
}, "Computed hairline width is within bounds");
</script>
</body>
</html>