summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-animations/responsive
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/css/css-animations/responsive
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-animations/responsive')
-rw-r--r--testing/web-platform/tests/css/css-animations/responsive/column-rule-color-001.html61
-rw-r--r--testing/web-platform/tests/css/css-animations/responsive/column-width-001.html76
-rw-r--r--testing/web-platform/tests/css/css-animations/responsive/line-height.html45
3 files changed, 182 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-animations/responsive/column-rule-color-001.html b/testing/web-platform/tests/css/css-animations/responsive/column-rule-color-001.html
new file mode 100644
index 0000000000..9953db4354
--- /dev/null
+++ b/testing/web-platform/tests/css/css-animations/responsive/column-rule-color-001.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Animations: column-rule-color animations respond to style changes</title>
+<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#crc">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ .paused {
+ animation-duration: 4s;
+ animation-timing-function: linear;
+ animation-delay: -2s;
+ animation-play-state: paused;
+ }
+ #container {
+ color: rgb(80, 0, 0);
+ }
+ #first {
+ animation-name: first-anim;
+ color: rgb(60, 0, 0);
+ }
+ #second {
+ animation-name: second-anim;
+ }
+ @keyframes first-anim {
+ from { column-rule-color: currentColor; }
+ to { column-rule-color: rgb(0, 60, 0); }
+ }
+ @keyframes second-anim {
+ from { column-rule-color: inherit; }
+ to { column-rule-color: rgb(0, 0, 80); }
+ }
+</style>
+</head>
+<body>
+<div id="container">
+ <div id="first" class="paused"></div>
+ <div id="second" class="paused"></div>
+</div>
+<script>
+'use strict';
+var container = document.getElementById('container');
+
+test(() => {
+ const first = document.getElementById('first');
+ assert_equals(getComputedStyle(first).columnRuleColor, 'rgb(30, 30, 0)');
+ first.style.color = 'rgb(0, 0, 60)';
+ assert_equals(getComputedStyle(first).columnRuleColor, 'rgb(0, 30, 30)');
+}, 'column-rule-color responds to currentColor changes');
+
+test(() => {
+ const container = document.getElementById('container');
+ const second = document.getElementById('second');
+ assert_equals(getComputedStyle(second).columnRuleColor, 'rgb(40, 0, 40)');
+ container.style.columnRuleColor = 'rgb(0, 80, 0)';
+ assert_equals(getComputedStyle(second).columnRuleColor, 'rgb(0, 40, 40)');
+}, 'column-rule-color responds to inherited changes');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-animations/responsive/column-width-001.html b/testing/web-platform/tests/css/css-animations/responsive/column-width-001.html
new file mode 100644
index 0000000000..272b9bc5a2
--- /dev/null
+++ b/testing/web-platform/tests/css/css-animations/responsive/column-width-001.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Animations: column-width animations respond to style changes</title>
+<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#cw">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ .paused {
+ animation-duration: 4s;
+ animation-timing-function: linear;
+ animation-delay: -2s;
+ animation-play-state: paused;
+ }
+ #container {
+ column-width: 40px;
+ font-size: 10px;
+ }
+ #first {
+ animation-name: first-anim;
+ }
+ #second {
+ animation-name: second-anim;
+ }
+ #third {
+ animation-name: third-anim;
+ }
+ @keyframes first-anim {
+ from { column-width: 3em; }
+ to { column-width: 5em; }
+ }
+ @keyframes second-anim {
+ from { column-width: 40px; }
+ to { column-width: calc(40px - 2em); }
+ }
+ @keyframes third-anim {
+ from { column-width: 20px; }
+ to { column-width: inherit; }
+ }
+</style>
+</head>
+<body>
+<div id="container">
+ <div id="first" class="paused"></div>
+ <div id="second" class="paused"></div>
+ <div id="third" class="paused"></div>
+</div>
+<script>
+'use strict';
+var container = document.getElementById('container');
+
+test(() => {
+ const first = document.getElementById('first');
+ assert_equals(getComputedStyle(first).columnWidth, '40px');
+ first.style.fontSize = '20px';
+ assert_equals(getComputedStyle(first).columnWidth, '80px');
+}, 'column-width responds to font-size changes');
+
+test(() => {
+ const second = document.getElementById('second');
+ assert_equals(getComputedStyle(second).columnWidth, '30px');
+ second.style.fontSize = '90px';
+ assert_equals(getComputedStyle(second).columnWidth, '20px');
+}, 'column-width clamps to 0px');
+
+test(() => {
+ const container = document.getElementById('container');
+ const third = document.getElementById('third');
+ assert_equals(getComputedStyle(third).columnWidth, '30px');
+ container.style.columnWidth = 'auto';
+ assert_equals(getComputedStyle(third).columnWidth, 'auto');
+}, 'column-width responds to inherited changes');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-animations/responsive/line-height.html b/testing/web-platform/tests/css/css-animations/responsive/line-height.html
new file mode 100644
index 0000000000..63097ac808
--- /dev/null
+++ b/testing/web-platform/tests/css/css-animations/responsive/line-height.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Animations: line-height animations respond to style changes</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline/#line-height-property">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ #target {
+ animation-name: line-height-animation;
+ animation-duration: 4s;
+ animation-timing-function: linear;
+ animation-delay: -2s;
+ animation-play-state: paused;
+ }
+ @keyframes line-height-animation {
+ from { line-height: inherit; }
+ to { line-height: 20px; }
+ }
+</style>
+</head>
+<body>
+<div id="container">
+ <div id="target"></div>
+</div>
+<script>
+'use strict';
+const container = document.getElementById('container');
+const target = document.getElementById('target');
+
+test(() => {
+ container.style.lineHeight = '100px';
+ assert_equals(getComputedStyle(target).lineHeight, '60px');
+
+ container.style.lineHeight = '50px';
+ assert_equals(getComputedStyle(target).lineHeight, '35px');
+
+ container.style.lineHeight = '100px';
+ assert_equals(getComputedStyle(target).lineHeight, '60px');
+}, 'line-height responds to inherited changes');
+
+</script>
+</body>
+</html>