diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/css/cssom/getComputedStyle-animations-replaced-into-ib-split.html | |
parent | Initial commit. (diff) | |
download | firefox-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/cssom/getComputedStyle-animations-replaced-into-ib-split.html')
-rw-r--r-- | testing/web-platform/tests/css/cssom/getComputedStyle-animations-replaced-into-ib-split.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom/getComputedStyle-animations-replaced-into-ib-split.html b/testing/web-platform/tests/css/cssom/getComputedStyle-animations-replaced-into-ib-split.html new file mode 100644 index 0000000000..47198803a0 --- /dev/null +++ b/testing/web-platform/tests/css/cssom/getComputedStyle-animations-replaced-into-ib-split.html @@ -0,0 +1,34 @@ +<!doctype html> +<title>getComputedStyle() returns the right style for animating nodes that have been just inserted into the document, and that have an ancestor whose layout tree was recreated (like an IB-split)</title> +<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1585882"> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<style> + @keyframes my-animation { + from { color: green; } + to { color: green; } + } + div { + color: red; + animation: my-animation 1s infinite linear paused; + } +</style> +<span> + <div></div> +</span> +<script> +test(() => { + let oldDiv = document.querySelector("div"); + window.unused = oldDiv.getBoundingClientRect(); // update layout + + assert_equals(getComputedStyle(oldDiv).color, "rgb(0, 128, 0)", "Should take color from the animation"); + + let newDiv = document.createElement("div"); + oldDiv.replaceWith(newDiv); + + assert_equals(getComputedStyle(newDiv).color, "rgb(0, 128, 0)", "Should take color from the animation (just inserted into the document)"); +}, "getComputedStyle() should return animation styles for nodes just inserted into the document, even if they're in an IB-split"); +</script> |