LibWeb: Implement text-wrap-style CSS property

This commit is contained in:
Callum Law
2025-05-31 20:31:07 +12:00
committed by Sam Atkins
parent 7d99a92135
commit 9ba74316d2
Notes: github-actions[bot] 2025-06-04 11:49:41 +00:00
14 changed files with 140 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text: getComputedStyle().textWrapStyle</title>
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-style">
<meta name="assert" content="text-wrap-style computed value is auto | balance | pretty | stable">
<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("text-wrap-style", "auto");
test_computed_value("text-wrap-style", "balance");
test_computed_value("text-wrap-style", "stable");
</script>
</body>
</html>

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text Module Test: parsing text-wrap-style with invalid values</title>
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-style">
<meta name="assert" content="text-wrap-style supports only the grammar '<text-wrap-style>'.">
<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("text-wrap-style", "normal");
test_invalid_value("text-wrap-style", "none");
test_invalid_value("text-wrap-style", "wrap");
test_invalid_value("text-wrap-style", "nowrap");
test_invalid_value("text-wrap-style", "wrap wrap");
test_invalid_value("text-wrap-style", "nowrap nowrap");
test_invalid_value("text-wrap-style", "wrap nowrap");
test_invalid_value("text-wrap-style", "pretty balance");
test_invalid_value("text-wrap-style", "balance stable");
test_invalid_value("text-wrap-style", "stable pretty");
test_invalid_value("text-wrap-style", "delicious wrap");
test_invalid_value("text-wrap-style", "5px");
</script>
</body>
</html>

View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text Module Test: parsing text-wrap-style with valid values</title>
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-style">
<meta name="assert" content="text-wrap-style supports the full grammar.">
<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("text-wrap-style", "auto");
test_valid_value("text-wrap-style", "balance");
test_valid_value("text-wrap-style", "stable");
test_valid_value("text-wrap-style", "initial");
test_valid_value("text-wrap-style", "inherit");
test_valid_value("text-wrap-style", "unset");
test_valid_value("text-wrap-style", "revert");
test_valid_value("text-wrap-style", "revert-layer");
</script>
</body>
</html>