LibWeb: Parse widows CSS property

This commit is contained in:
Callum Law
2025-09-27 02:44:54 +12:00
committed by Sam Atkins
parent 3d85532752
commit c4d6deb5c7
Notes: github-actions[bot] 2025-09-26 15:36:06 +00:00
14 changed files with 416 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Fragmentation Module Level 3: getComputedStyle().widows</title>
<link rel="help" href="https://drafts.csswg.org/css-break/#propdef-widows">
<meta name="assert" content="widows computed value is specified integer.">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../css/support/computed-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("widows", "1");
test_computed_value("widows", "234");
test_computed_value("widows", "calc(1 + 234)", "235");
</script>
</body>
</html>

View File

@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Fragmentation Module Level 3: parsing widows with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-break/#propdef-widows">
<meta name="assert" content="widows supports only the grammar '<integer>'.">
<meta name="assert" content="Negative values and zero are invalid.">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("widows", "auto");
test_invalid_value("widows", "1 234");
test_invalid_value("widows", "-234");
test_invalid_value("widows", "-1");
test_invalid_value("widows", "0");
</script>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Fragmentation Module Level 3: parsing widows with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-break/#propdef-widows">
<meta name="assert" content="widows supports the full grammar '<integer>'.">
<meta name="assert" content="Negative values and zero are invalid.">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("widows", "1");
test_valid_value("widows", "234");
</script>
</body>
</html>