summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-writing-modes/text-combine-upright-parsing-digits-002.html
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-writing-modes/text-combine-upright-parsing-digits-002.html
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-writing-modes/text-combine-upright-parsing-digits-002.html')
-rw-r--r--testing/web-platform/tests/css/css-writing-modes/text-combine-upright-parsing-digits-002.html137
1 files changed, 137 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-writing-modes/text-combine-upright-parsing-digits-002.html b/testing/web-platform/tests/css/css-writing-modes/text-combine-upright-parsing-digits-002.html
new file mode 100644
index 0000000000..327ebdda11
--- /dev/null
+++ b/testing/web-platform/tests/css/css-writing-modes/text-combine-upright-parsing-digits-002.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Writing Modes: parsing text-combine-upright with digits plus calc() computing to valid digits</title>
+<link rel="author" title="Masataka Yakura" href="http://google.com/+MasatakaYakura">
+<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#text-combine-upright">
+<link rel="help" href="http://www.w3.org/TR/css-values-3/#calc-notation">
+<meta name="assert" content="User Agents support text-combine-upright with values `digits calc(...)` if the expression inside `calc()` computes to a valid integer, which is either 2, 3, or 4.">
+<meta name="flags" content="dom">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<style>
+#valid_digits_calc_1_plus_1 {
+ text-combine-upright: digits calc(1 + 1);
+}
+
+#valid_digits_calc_1_plus_1_plus_1 {
+ text-combine-upright: digits calc(1 + 1 + 1);
+}
+
+#valid_digits_calc_2_plus_2 {
+ text-combine-upright: digits calc(2 + 2);
+}
+
+#valid_digits_calc_4_minus_2 {
+ text-combine-upright: digits calc(4 - 2);
+}
+
+#valid_digits_calc_6_minus_3 {
+ text-combine-upright: digits calc(6 - 3);
+}
+
+#valid_digits_calc_7_minus_1_minus_2 {
+ text-combine-upright: digits calc(7 - 1 - 2);
+}
+
+#valid_digits_calc_2_times_1 {
+ text-combine-upright: digits calc(2 * 1);
+}
+
+#valid_digits_calc_3_times_1 {
+ text-combine-upright: digits calc(3 * 1);
+}
+
+#valid_digits_calc_2_times_2_times_1 {
+ text-combine-upright: digits calc(2 * 2 * 1);
+}
+
+#valid_digits_calc_4_dividedby_2 {
+ text-combine-upright: digits calc(4 / 2);
+}
+
+#valid_digits_calc_4_dividedby_2 {
+ text-combine-upright: digits calc(6 / 2);
+}
+
+#valid_digits_calc_24_dividedby_3_dividedby_2 {
+ text-combine-upright: digits calc(24 / 3 / 2);
+}
+
+</style>
+</head>
+<body>
+
+<div id="valid_digits_calc_1_plus_1"></div>
+<div id="valid_digits_calc_1_plus_1_plus_1"></div>
+<div id="valid_digits_calc_2_plus_2"></div>
+<div id="valid_digits_calc_4_minus_2"></div>
+<div id="valid_digits_calc_6_minus_3"></div>
+<div id="valid_digits_calc_7_minus_1_minus_2"></div>
+<div id="valid_digits_calc_2_times_1"></div>
+<div id="valid_digits_calc_3_times_1"></div>
+<div id="valid_digits_calc_2_times_2_times_1"></div>
+<div id="valid_digits_calc_4_dividedby_2"></div>
+<div id="valid_digits_calc_4_dividedby_2"></div>
+<div id="valid_digits_calc_24_dividedby_3_dividedby_2"></div>
+
+<div id="log"></div>
+
+<script>
+var getComputedValueFor = function (id) {
+ var element = document.getElementById(id);
+ return window.getComputedStyle(element).textCombineUpright;
+};
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_1_plus_1'), 'digits 2');
+}, 'Computed value for `text-combine-upright: digits calc(1 + 1)` is `digits 2`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_1_plus_1_plus_1'), 'digits 3');
+}, 'Computed value for `text-combine-upright: digits calc(1 + 1 + 1)` is `digits 3`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_2_plus_2'), 'digits 4');
+}, 'Computed value for `text-combine-upright: digits calc(2 + 2)` is `digits 4`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_4_minus_2'), 'digits 2');
+}, 'Computed value for `text-combine-upright: digits calc(4 - 2)` is `digits 2`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_6_minus_3'), 'digits 3');
+}, 'Computed value for `text-combine-upright: digits calc(6 - 3)` is `digits 3`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_7_minus_1_minus_2'), 'digits 4');
+}, 'Computed value for `text-combine-upright: digits calc(7 - 1 - 2)` is `digits 4`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_2_times_1'), 'digits 2');
+}, 'Computed value for `text-combine-upright: digits calc(2 * 1)` is `digits 2`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_3_times_1'), 'digits 3');
+}, 'Computed value for `text-combine-upright: digits calc(3 * 1)` is `digits 3`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_2_times_2_times_1'), 'digits 4');
+}, 'Computed value for `text-combine-upright: digits calc(2 * 2 * 1)` is `digits 4`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_4_dividedby_2'), 'digits 2');
+}, 'Computed value for `text-combine-upright: digits calc(4 / 2)` is `digits 2`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_4_dividedby_2'), 'digits 3');
+}, 'Computed value for `text-combine-upright: digits calc(6 / 2)` is `digits 3`');
+
+test(function () {
+ assert_equals(getComputedValueFor('valid_digits_calc_24_dividedby_3_dividedby_2'), 'digits 4');
+}, 'Computed value for `text-combine-upright: digits calc(24 / 3 / 2)` is `digits 4`');
+</script>
+</body>
+</html> \ No newline at end of file