summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-size-adjust
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/css/css-size-adjust
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-size-adjust')
-rw-r--r--testing/web-platform/tests/css/css-size-adjust/META.yml1
-rw-r--r--testing/web-platform/tests/css/css-size-adjust/animations/text-size-adjust-interpolation.html104
-rw-r--r--testing/web-platform/tests/css/css-size-adjust/inheritance.html21
-rw-r--r--testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-computed.html23
-rw-r--r--testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-invalid.html21
-rw-r--r--testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-valid.html22
6 files changed, 192 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-size-adjust/META.yml b/testing/web-platform/tests/css/css-size-adjust/META.yml
new file mode 100644
index 0000000000..399781a705
--- /dev/null
+++ b/testing/web-platform/tests/css/css-size-adjust/META.yml
@@ -0,0 +1 @@
+spec: https://drafts.csswg.org/css-size-adjust/
diff --git a/testing/web-platform/tests/css/css-size-adjust/animations/text-size-adjust-interpolation.html b/testing/web-platform/tests/css/css-size-adjust/animations/text-size-adjust-interpolation.html
new file mode 100644
index 0000000000..1d7e54b734
--- /dev/null
+++ b/testing/web-platform/tests/css/css-size-adjust/animations/text-size-adjust-interpolation.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>text-size-adjust-interpolation</title>
+<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#adjustment-control">
+<meta name="assert" content="text-size-adjust supports animation">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/interpolation-testcommon.js"></script>
+
+<style type="text/css">
+.container {
+ display: inline-block;
+}
+
+.parent {
+ text-size-adjust: 70%;
+}
+
+.target {
+ text-size-adjust: 60%;
+}
+
+.expected {
+ color: green;
+ margin-right: 30px;
+}
+</style>
+<body></body>
+<template id="target-template">
+ <span class="container">
+ <div class="target">x</span>
+ </div>
+</template>
+<script>
+test_interpolation({
+ property: 'text-size-adjust',
+ from: neutralKeyframe,
+ to: '50%',
+}, [
+ {at: -2, expect: '80%'},
+ {at: -0.3, expect: '63%'},
+ {at: 0, expect: '60%'},
+ {at: 0.3, expect: '57%'},
+ {at: 0.6, expect: '54%'},
+ {at: 1, expect: '50%'},
+ {at: 1.5, expect: '45%'},
+]);
+
+test_no_interpolation({
+ property: 'text-size-adjust',
+ from: 'initial',
+ to: '70%',
+});
+
+test_interpolation({
+ property: 'text-size-adjust',
+ from: 'inherit', // 70%
+ to: '50%',
+}, [
+ {at: -2, expect: '110%'},
+ {at: -0.3, expect: '76%'},
+ {at: 0, expect: '70%'},
+ {at: 0.3, expect: '64%'},
+ {at: 0.6, expect: '58%'},
+ {at: 1, expect: '50%'},
+ {at: 1.5, expect: '40%'},
+]);
+
+test_interpolation({
+ property: 'text-size-adjust',
+ from: 'unset',
+ to: '50%',
+}, [
+ {at: -2, expect: '110%'},
+ {at: -0.3, expect: '76%'},
+ {at: 0, expect: '70%'},
+ {at: 0.3, expect: '64%'},
+ {at: 0.6, expect: '58%'},
+ {at: 1, expect: '50%'},
+ {at: 1.5, expect: '40%'},
+]);
+
+
+test_interpolation({
+ property: 'text-size-adjust',
+ from: '10%',
+ to: '0%'
+}, [
+ {at: -2, expect: '30%'},
+ {at: -0.3, expect: '13%'},
+ {at: 0, expect: '10%'},
+ {at: 0.3, expect: '7%'},
+ {at: 0.6, expect: '4%'},
+ {at: 1, expect: '0%'},
+ {at: 1.5, expect: '0%'}, // text-size-adjust can't be negative
+]);
+
+test_no_interpolation({
+ property: 'text-size-adjust',
+ from: 'none',
+ to: '100%'
+});
+</script>
diff --git a/testing/web-platform/tests/css/css-size-adjust/inheritance.html b/testing/web-platform/tests/css/css-size-adjust/inheritance.html
new file mode 100644
index 0000000000..730bcfe2b5
--- /dev/null
+++ b/testing/web-platform/tests/css/css-size-adjust/inheritance.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Inheritance of CSS Mobile Text Size Adjustment properties</title>
+<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#property-index">
+<meta name="assert" content="text-size-adjust inherits according to the spec.">
+<meta name="assert" content="text-size-adjust has initial value according to the spec.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/inheritance-testcommon.js"></script>
+</head>
+<body>
+<div id="container">
+<div id="target"></div>
+</div>
+<script>
+assert_inherited('text-size-adjust', 'auto', '10%');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-computed.html b/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-computed.html
new file mode 100644
index 0000000000..2d80b86172
--- /dev/null
+++ b/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-computed.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Mobile Text Size Adjustment: getComputedStyle().text-size-adjust</title>
+<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust">
+<meta name="assert" content="text-size-adjust 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("text-size-adjust", 'auto');
+test_computed_value("text-size-adjust", 'none', '100%');
+
+test_computed_value("text-size-adjust", '200%');
+test_computed_value("text-size-adjust", '100%');
+test_computed_value("text-size-adjust", '0%');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-invalid.html b/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-invalid.html
new file mode 100644
index 0000000000..4dfabb5f4e
--- /dev/null
+++ b/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-invalid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Mobile Text Size Adjustment: parsing text-size-adjust with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust">
+<meta name="assert" content="text-size-adjust supports only the grammar 'auto | none | <percentage>'.">
+<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-size-adjust", 'reverse');
+
+test_invalid_value("text-size-adjust", '0');
+test_invalid_value("text-size-adjust", '10px');
+test_invalid_value("text-size-adjust", '-100%');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-valid.html b/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-valid.html
new file mode 100644
index 0000000000..bd58ae5f69
--- /dev/null
+++ b/testing/web-platform/tests/css/css-size-adjust/parsing/text-size-adjust-valid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Mobile Text Size Adjustment: parsing text-size-adjust with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust">
+<meta name="assert" content="text-size-adjust supports the full grammar 'auto | none | <percentage>'.">
+<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-size-adjust", 'auto');
+test_valid_value("text-size-adjust", 'none');
+
+test_valid_value("text-size-adjust", '200%');
+test_valid_value("text-size-adjust", '100%');
+test_valid_value("text-size-adjust", '0%');
+</script>
+</body>
+</html>