Title: [291420] trunk
Revision
291420
Author
grao...@webkit.org
Date
2022-03-17 10:44:42 -0700 (Thu, 17 Mar 2022)

Log Message

REGRESSION (iOS 15.4 / r287669): Mobile app stopped working due to CSS / angular animation
https://bugs.webkit.org/show_bug.cgi?id=237920
LayoutTests/imported/w3c:

<rdar://problem/90335275>

Reviewed by Antti Koivisto.

Add a test that looks at the default computed style for the "transition" and "animation"
shorthands.

* web-platform-tests/css/css-animations/parsing/animation-computed-expected.txt:
* web-platform-tests/css/css-animations/parsing/animation-computed.html:
* web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-computed-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-computed.html:

Source/WebCore:

Reviewed by Antti Koivisto.

We refactored the computed style output for the "transition" and "animation" shorthand
properties in r287669 and always returned a CSSValueList, even when the list of transitions
or animations was empty. This meant that for an element without any transition or animation
properties, we'd return the empty string for those properties.

Now we return the computed style for a default animation instead.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::animationShorthandValue):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-17 17:44:42 UTC (rev 291420)
@@ -1,3 +1,21 @@
+2022-03-17  Antoine Quint  <grao...@webkit.org>
+
+        REGRESSION (iOS 15.4 / r287669): Mobile app stopped working due to CSS / angular animation
+        https://bugs.webkit.org/show_bug.cgi?id=237920
+        <rdar://problem/90335275>
+
+        Reviewed by Antti Koivisto.
+
+        Add a test that looks at the default computed style for the "transition" and "animation"
+        shorthands.
+
+        * web-platform-tests/css/css-animations/parsing/animation-computed-expected.txt:
+        * web-platform-tests/css/css-animations/parsing/animation-computed.html:
+        * web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
+        * web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-computed-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-computed.html:
+
 2022-03-17  Ziran Sun  <z...@igalia.com>
 
         [Selection] Fixes selection range settings for TEXTAREA

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-computed-expected.txt (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-computed-expected.txt	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-computed-expected.txt	2022-03-17 17:44:42 UTC (rev 291420)
@@ -1,4 +1,5 @@
 
+PASS Default animation value
 PASS Property animation value '1s'
 PASS Property animation value 'cubic-bezier(0, -2, 1, 3)'
 PASS Property animation value '1s -3s'

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-computed.html (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-computed.html	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-computed.html	2022-03-17 17:44:42 UTC (rev 291420)
@@ -16,6 +16,11 @@
 // <single-animation-iteration-count> || <single-animation-direction> ||
 // <single-animation-fill-mode> || <single-animation-play-state> ||
 // [ none | <keyframes-name> ]
+
+test(() => {
+  assert_equals(getComputedStyle(document.getElementById('target')).animation, "0s ease 0s 1 normal none running none");
+}, "Default animation value");
+
 test_computed_value("animation", "1s", "1s ease 0s 1 normal none running none");
 test_computed_value("animation", "cubic-bezier(0, -2, 1, 3)", "0s cubic-bezier(0, -2, 1, 3) 0s 1 normal none running none");
 test_computed_value("animation", "1s -3s", "1s ease -3s 1 normal none running none");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt	2022-03-17 17:44:42 UTC (rev 291420)
@@ -32,7 +32,7 @@
 PASS verticalAlign should be applied to first-letter pseudo elements.
 PASS wordSpacing should be applied to first-letter pseudo elements.
 FAIL position should not be applied to first-letter pseudo elements. assert_equals: expected "static" but got "absolute"
-FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "" but got "transform 1s ease 0s"
+FAIL transition should not be applied to first-letter pseudo elements. assert_equals: expected "all 0s ease 0s" but got "transform 1s ease 0s"
 PASS transform should not be applied to first-letter pseudo elements.
 FAIL wordBreak should not be applied to first-letter pseudo elements. assert_equals: expected "normal" but got "break-all"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt	2022-03-17 17:44:42 UTC (rev 291420)
@@ -34,7 +34,7 @@
 FAIL margin should not be applied to first-line pseudo elements. assert_equals: expected "0px" but got "10px 20px 30px 40px"
 FAIL padding should not be applied to first-line pseudo elements. assert_equals: expected "0px" but got "10px 20px 30px 40px"
 FAIL position should not be applied to first-line pseudo elements. assert_equals: expected "static" but got "absolute"
-FAIL transition should not be applied to first-line pseudo elements. assert_equals: expected "" but got "transform 1s ease 0s"
+FAIL transition should not be applied to first-line pseudo elements. assert_equals: expected "all 0s ease 0s" but got "transform 1s ease 0s"
 PASS transform should not be applied to first-line pseudo elements.
 FAIL wordBreak should not be applied to first-line pseudo elements. assert_equals: expected "normal" but got "break-all"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-computed-expected.txt (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-computed-expected.txt	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-computed-expected.txt	2022-03-17 17:44:42 UTC (rev 291420)
@@ -1,4 +1,5 @@
 
+PASS Default transition value
 PASS Property transition value '1s'
 PASS Property transition value 'cubic-bezier(0, -2, 1, 3)'
 PASS Property transition value '1s -3s'

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-computed.html (291419 => 291420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-computed.html	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-computed.html	2022-03-17 17:44:42 UTC (rev 291420)
@@ -14,6 +14,11 @@
 <script>
 // <single-transition> = [ none | <single-transition-property> ] ||
 // <time> || <easing-function> || <time>
+
+test(() => {
+  assert_equals(getComputedStyle(document.getElementById('target')).transition, "all 0s ease 0s");
+}, "Default transition value");
+
 test_computed_value("transition", "1s", "all 1s ease 0s");
 test_computed_value("transition", "cubic-bezier(0, -2, 1, 3)", "all 0s cubic-bezier(0, -2, 1, 3) 0s");
 test_computed_value("transition", "1s -3s", "all 1s ease -3s");

Modified: trunk/Source/WebCore/ChangeLog (291419 => 291420)


--- trunk/Source/WebCore/ChangeLog	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/Source/WebCore/ChangeLog	2022-03-17 17:44:42 UTC (rev 291420)
@@ -1,3 +1,20 @@
+2022-03-17  Antoine Quint  <grao...@webkit.org>
+
+        REGRESSION (iOS 15.4 / r287669): Mobile app stopped working due to CSS / angular animation
+        https://bugs.webkit.org/show_bug.cgi?id=237920
+
+        Reviewed by Antti Koivisto.
+
+        We refactored the computed style output for the "transition" and "animation" shorthand
+        properties in r287669 and always returned a CSSValueList, even when the list of transitions
+        or animations was empty. This meant that for an element without any transition or animation
+        properties, we'd return the empty string for those properties.
+
+        Now we return the computed style for a default animation instead.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::animationShorthandValue):
+
 2022-03-17  Peng Liu  <peng.l...@icloud.com>
 
         PiP on Vimeo freezes when toggled

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (291419 => 291420)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-03-17 17:21:29 UTC (rev 291419)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-03-17 17:44:42 UTC (rev 291420)
@@ -1599,14 +1599,20 @@
 static Ref<CSSValueList> animationShorthandValue(CSSPropertyID property, const AnimationList* animationList)
 {
     auto parentList = CSSValueList::createCommaSeparated();
-    if (animationList) {
-        for (const auto& animation : *animationList) {
-            auto childList = CSSValueList::createSpaceSeparated();
-            for (auto longhand : shorthandForProperty(property))
-                ComputedStyleExtractor::addValueForAnimationPropertyToList(childList.get(), longhand, animation.ptr());
-            parentList->append(childList);
-        }
-    }
+
+    auto addAnimation = [&](Ref<Animation> animation) {
+        auto childList = CSSValueList::createSpaceSeparated();
+        for (auto longhand : shorthandForProperty(property))
+            ComputedStyleExtractor::addValueForAnimationPropertyToList(childList.get(), longhand, animation.ptr());
+        parentList->append(childList);
+    };
+
+    if (animationList && !animationList->isEmpty()) {
+        for (const auto& animation : *animationList)
+            addAnimation(animation);
+    } else
+        addAnimation(Animation::create());
+
     return parentList;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to