Title: [282133] trunk
Revision
282133
Author
n...@apple.com
Date
2021-09-08 00:48:29 -0700 (Wed, 08 Sep 2021)

Log Message

Support animations on ::backdrop
https://bugs.webkit.org/show_bug.cgi?id=229042

Reviewed by Antoine Quint.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-pseudo/backdrop-animate-002-expected.html: Added.
* web-platform-tests/css/css-pseudo/backdrop-animate-002.html: Added.
* web-platform-tests/css/css-pseudo/backdrop-animate-expected.txt: Added.
* web-platform-tests/css/css-pseudo/backdrop-animate.html: Added.

Source/WebCore:

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::resolvePseudoStyle):

LayoutTests:

* TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282132 => 282133)


--- trunk/LayoutTests/ChangeLog	2021-09-08 07:39:41 UTC (rev 282132)
+++ trunk/LayoutTests/ChangeLog	2021-09-08 07:48:29 UTC (rev 282133)
@@ -1,3 +1,12 @@
+2021-09-08  Tim Nguyen  <n...@apple.com>
+
+        Support animations on ::backdrop
+        https://bugs.webkit.org/show_bug.cgi?id=229042
+
+        Reviewed by Antoine Quint.
+
+        * TestExpectations:
+
 2021-09-08  Kimmo Kinnunen  <kkinnu...@apple.com>
 
         webgl/2.0.y/deqp/functional/gles3/rbostatequery.html fails on Metal

Modified: trunk/LayoutTests/TestExpectations (282132 => 282133)


--- trunk/LayoutTests/TestExpectations	2021-09-08 07:39:41 UTC (rev 282132)
+++ trunk/LayoutTests/TestExpectations	2021-09-08 07:48:29 UTC (rev 282133)
@@ -5066,3 +5066,4 @@
 webkit.org/b/229727 imported/w3c/web-platform-tests/css/css-font-loading/fontfaceset-load-var.html [ Skip ]
 
 webkit.org/b/229975 fast/text/FontFaceSet-status-after-style-update.html [ Failure Pass ]
+webkit.org/b/230008 imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (282132 => 282133)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-08 07:39:41 UTC (rev 282132)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-08 07:48:29 UTC (rev 282133)
@@ -1,3 +1,15 @@
+2021-09-08  Tim Nguyen  <n...@apple.com>
+
+        Support animations on ::backdrop
+        https://bugs.webkit.org/show_bug.cgi?id=229042
+
+        Reviewed by Antoine Quint.
+
+        * web-platform-tests/css/css-pseudo/backdrop-animate-002-expected.html: Added.
+        * web-platform-tests/css/css-pseudo/backdrop-animate-002.html: Added.
+        * web-platform-tests/css/css-pseudo/backdrop-animate-expected.txt: Added.
+        * web-platform-tests/css/css-pseudo/backdrop-animate.html: Added.
+
 2021-09-07  Sihui Liu  <sihui_...@apple.com>
 
         Add basic support for Storage API

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002-expected.html (0 => 282133)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002-expected.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002-expected.html	2021-09-08 07:48:29 UTC (rev 282133)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<dialog id="target">Dialog contents</dialog>
+<style>
+#target::backdrop {
+  opacity: 0.1;
+  background-color: green;
+}
+</style>
+<script>
+const target = document.getElementById("target");
+target.showModal();
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002.html (0 => 282133)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-002.html	2021-09-08 07:48:29 UTC (rev 282133)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: A Web Animations on ::backdrop</title>
+<link rel="help" href=""
+<link rel="match" href=""
+<dialog id="target">Dialog contents</dialog>
+<script>
+const target = document.getElementById("target");
+target.showModal();
+target.animate({
+  opacity: [0.1, 0.1],
+  backgroundColor: ["green", "green"]
+}, {
+  pseudoElement: "::backdrop",
+  duration: Infinity
+});
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-expected.txt (0 => 282133)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate-expected.txt	2021-09-08 07:48:29 UTC (rev 282133)
@@ -0,0 +1,3 @@
+
+PASS 'backgroundColor' animation
+Dialog contents

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate.html (0 => 282133)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/backdrop-animate.html	2021-09-08 07:48:29 UTC (rev 282133)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Pseudo-Elements Test: ::backdrop & web animations</title>
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="assert" content="This test checks that ::backdrop can be animated with Web Animations." />
+<div id="log"></div>
+<dialog id="target">Dialog contents</dialog>
+<script src=""
+<script src=""
+<script>
+const target = document.getElementById("target");
+target.showModal();
+
+test(function() {
+  const options = {
+    pseudoElement: "::backdrop",
+    duration: 2,
+    delay: -1,
+  };
+  const cs = getComputedStyle(target, "::backdrop");
+  const anim = target.animate([
+    {backgroundColor: "rgb(0, 100, 200)"},
+    {backgroundColor: "rgb(200, 0, 100)"},
+  ], options);
+  this.add_cleanup(() => anim.cancel());
+  assert_equals(cs.backgroundColor, "rgb(100, 50, 150)", "background-color");
+}, "'backgroundColor' animation");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (282132 => 282133)


--- trunk/Source/WebCore/ChangeLog	2021-09-08 07:39:41 UTC (rev 282132)
+++ trunk/Source/WebCore/ChangeLog	2021-09-08 07:48:29 UTC (rev 282133)
@@ -1,3 +1,14 @@
+2021-09-08  Tim Nguyen  <n...@apple.com>
+
+        Support animations on ::backdrop
+        https://bugs.webkit.org/show_bug.cgi?id=229042
+
+        Reviewed by Antoine Quint.
+
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::TreeResolver::resolveElement):
+        (WebCore::Style::TreeResolver::resolvePseudoStyle):
+
 2021-09-08  Kimmo Kinnunen  <kkinnu...@apple.com>
 
         webgl/2.0.y/deqp/functional/gles3/rbostatequery.html fails on Metal

Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (282132 => 282133)


--- trunk/Source/WebCore/style/StyleTreeResolver.cpp	2021-09-08 07:39:41 UTC (rev 282132)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp	2021-09-08 07:48:29 UTC (rev 282133)
@@ -259,6 +259,8 @@
         pseudoUpdates.set(PseudoId::Before, WTFMove(*beforeElementUpdate));
     if (auto afterElementUpdate = resolvePseudoStyle(element, update, PseudoId::After))
         pseudoUpdates.set(PseudoId::After, WTFMove(*afterElementUpdate));
+    if (auto backdropElementUpdate = resolvePseudoStyle(element, update, PseudoId::Backdrop))
+        pseudoUpdates.set(PseudoId::Backdrop, WTFMove(*backdropElementUpdate));
 
 #if ENABLE(TOUCH_ACTION_REGIONS)
     // FIXME: Track this exactly.
@@ -275,8 +277,8 @@
 
 std::optional<ElementUpdate> TreeResolver::resolvePseudoStyle(Element& element, const ElementUpdate& elementUpdate, PseudoId pseudoId)
 {
-    ASSERT(pseudoId != PseudoId::Backdrop, "This method does not handle ::backdrop currently");
-
+    if (pseudoId == PseudoId::Backdrop && !element.isInTopLayer())
+        return { };
     if (pseudoId == PseudoId::Marker && elementUpdate.style->display() != DisplayType::ListItem)
         return { };
     if (elementUpdate.style->display() == DisplayType::None)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to