mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Implement dominant-baseline for SVG text
This property determines the default baseline used to align content within the given box.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
90a211bf47
commit
f05bc7c0cd
Notes:
github-actions[bot]
2026-02-26 08:24:27 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/f05bc7c0cd3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8173 Reviewed-by: https://github.com/gmta ✅
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Inline Layout: getComputedStyle().dominantBaseline</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
|
||||
<meta name="assert" content="dominant-baseline computed value is as specified.">
|
||||
<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("dominant-baseline", "auto");
|
||||
test_computed_value("dominant-baseline", "text-bottom");
|
||||
test_computed_value("dominant-baseline", "alphabetic");
|
||||
test_computed_value("dominant-baseline", "ideographic");
|
||||
test_computed_value("dominant-baseline", "middle");
|
||||
test_computed_value("dominant-baseline", "central");
|
||||
test_computed_value("dominant-baseline", "mathematical");
|
||||
test_computed_value("dominant-baseline", "hanging");
|
||||
test_computed_value("dominant-baseline", "text-top");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Inline Layout: parsing dominant-baseline with invalid values</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
|
||||
<meta name="assert" content="dominant-baseline supports only the grammar 'auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top'.">
|
||||
<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("dominant-baseline", "normal");
|
||||
test_invalid_value("dominant-baseline", "none");
|
||||
test_invalid_value("dominant-baseline", "alphabetic, ideographic");
|
||||
test_invalid_value("dominant-baseline", "middle central");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Inline Layout: parsing dominant-baseline with valid values</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
|
||||
<meta name="assert" content="dominant-baseline supports the full grammar 'auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top'.">
|
||||
<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("dominant-baseline", "auto");
|
||||
test_valid_value("dominant-baseline", "text-bottom");
|
||||
test_valid_value("dominant-baseline", "alphabetic");
|
||||
test_valid_value("dominant-baseline", "ideographic");
|
||||
test_valid_value("dominant-baseline", "middle");
|
||||
test_valid_value("dominant-baseline", "central");
|
||||
test_valid_value("dominant-baseline", "mathematical");
|
||||
test_valid_value("dominant-baseline", "hanging");
|
||||
test_valid_value("dominant-baseline", "text-top");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user