Title: [256995] branches/safari-609.1.20.0-branch

Diff

Modified: branches/safari-609.1.20.0-branch/LayoutTests/ChangeLog (256994 => 256995)


--- branches/safari-609.1.20.0-branch/LayoutTests/ChangeLog	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/LayoutTests/ChangeLog	2020-02-20 00:41:44 UTC (rev 256995)
@@ -1,3 +1,7 @@
+2020-02-19  Alan Coon  <alanc...@apple.com>
+
+        Revert r256963. rdar://problem/59478837
+
 2020-02-19  Russell Epstein  <repst...@apple.com>
 
         Apply patch. rdar://problem/59478837

Modified: branches/safari-609.1.20.0-branch/LayoutTests/TestExpectations (256994 => 256995)


--- branches/safari-609.1.20.0-branch/LayoutTests/TestExpectations	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/LayoutTests/TestExpectations	2020-02-20 00:41:44 UTC (rev 256995)
@@ -2651,6 +2651,8 @@
 
 webkit.org/b/179069 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox_032.htm [ Pass Failure ]
 
+webkit.org/b/202107 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/style-change-events.html [ Pass Failure ]
+webkit.org/b/202108 imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events.html [ Pass Failure ]
 webkit.org/b/202109 imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html [ Pass Failure ]
 
 webkit.org/b/157068 [ Debug ] imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html [ Pass Crash ]

Modified: branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/ChangeLog (256994 => 256995)


--- branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/ChangeLog	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/ChangeLog	2020-02-20 00:41:44 UTC (rev 256995)
@@ -1,3 +1,7 @@
+2020-02-19  Alan Coon  <alanc...@apple.com>
+
+        Revert r256963. rdar://problem/59478837
+
 2020-02-19  Russell Epstein  <repst...@apple.com>
 
         Apply patch. rdar://problem/59478837

Modified: branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt (256994 => 256995)


--- branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt	2020-02-20 00:41:44 UTC (rev 256995)
@@ -1,26 +1,26 @@
 
 PASS All property keys are recognized 
-PASS Animation.id produces expected style change events
-PASS Animation.effect produces expected style change events
-PASS Animation.timeline produces expected style change events
-PASS Animation.startTime produces expected style change events
-PASS Animation.currentTime produces expected style change events
-PASS Animation.playbackRate produces expected style change events
-PASS Animation.playState produces expected style change events
-PASS Animation.replaceState produces expected style change events
-PASS Animation.pending produces expected style change events
-PASS Animation.onfinish produces expected style change events
-PASS Animation.oncancel produces expected style change events
-PASS Animation.onremove produces expected style change events
-PASS Animation.ready produces expected style change events
-PASS Animation.finished produces expected style change events
-PASS Animation.cancel produces expected style change events
-PASS Animation.finish produces expected style change events
-PASS Animation.play produces expected style change events
-PASS Animation.pause produces expected style change events
-PASS Animation.updatePlaybackRate produces expected style change events
-PASS Animation.reverse produces expected style change events
+FAIL Animation.id produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.effect produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.timeline produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.startTime produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.currentTime produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.playbackRate produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.playState produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.replaceState produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.pending produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.onfinish produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.oncancel produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.onremove produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.ready produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.finished produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.cancel produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.finish produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.play produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.pause produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.updatePlaybackRate produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
+FAIL Animation.reverse produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
 PASS Animation.persist produces expected style change events 
 FAIL Animation.commitStyles produces expected style change events assert_true: A transition should have been triggered expected true got false
-PASS Animation.Animation constructor produces expected style change events
+FAIL Animation.Animation constructor produces expected style change events assert_false: A transition should NOT have been triggered expected false got true
 

Modified: branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events-expected.txt (256994 => 256995)


--- branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events-expected.txt	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events-expected.txt	2020-02-20 00:41:44 UTC (rev 256995)
@@ -1,4 +1,4 @@
 
-PASS DocumentTimeline.currentTime does NOT trigger a style change event 
-PASS DocumentTimeline constructor does NOT trigger a style change event 
+FAIL DocumentTimeline.currentTime does NOT trigger a style change event assert_false: A transition should NOT have been triggered expected false got true
+FAIL DocumentTimeline constructor does NOT trigger a style change event assert_false: A transition should NOT have been triggered expected false got true
 

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/ChangeLog (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/ChangeLog	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/ChangeLog	2020-02-20 00:41:44 UTC (rev 256995)
@@ -1,5 +1,9 @@
 2020-02-19  Alan Coon  <alanc...@apple.com>
 
+        Revert r256963. rdar://problem/59478837
+
+2020-02-19  Alan Coon  <alanc...@apple.com>
+
         Apply patch. rdar://problem/59298138
 
     2020-02-19  Eric Carlson  <eric.carl...@apple.com>

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/animation/AnimationTimeline.cpp (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/animation/AnimationTimeline.cpp	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/animation/AnimationTimeline.cpp	2020-02-20 00:41:44 UTC (rev 256995)
@@ -352,17 +352,15 @@
     keyframeEffectStack.setCSSAnimationList(currentAnimationList);
 }
 
-static KeyframeEffect* keyframeEffectForElementAndProperty(Element& element, CSSPropertyID property)
+RefPtr<WebAnimation> AnimationTimeline::cssAnimationForElementAndProperty(Element& element, CSSPropertyID property)
 {
-    if (auto* keyframeEffectStack = element.keyframeEffectStack()) {
-        auto effects = keyframeEffectStack->sortedEffects();
-        for (const auto& effect : makeReversedRange(effects)) {
-            if (effect->animatesProperty(property))
-                return effect.get();
-        }
+    RefPtr<WebAnimation> matchingAnimation;
+    for (const auto& animation : m_elementToCSSAnimationsMap.get(&element)) {
+        auto* effect = animation->effect();
+        if (is<KeyframeEffect>(effect) && downcast<KeyframeEffect>(effect)->animatedProperties().contains(property))
+            matchingAnimation = animation;
     }
-
-    return nullptr;
+    return matchingAnimation;
 }
 
 static bool propertyInStyleMatchesValueForTransitionInMap(CSSPropertyID property, const RenderStyle& style, AnimationTimeline::PropertyToTransitionMap& transitions)
@@ -462,21 +460,9 @@
             }
         }
 
-        if (auto* keyframeEffect = keyframeEffectForElementAndProperty(element, property)) {
-            // If we already have a keyframe effect targeting this property, we should use its unanimated style to determine what the potential
-            // start value of the transition shoud be to make sure that we don't account for animated values that would have been blended onto
-            // the style applied during the last style resolution.
-            if (auto* unanimatedStyle = keyframeEffect->unanimatedStyle())
-                return *unanimatedStyle;
+        if (auto existingAnimation = cssAnimationForElementAndProperty(element, property))
+            return downcast<CSSAnimation>(existingAnimation.get())->unanimatedStyle();
 
-            // If we have a keyframe effect targeting this property, but it doesn't yet have an unanimated style, this is because it has not
-            // had a chance to apply itself with a non-null progress. In this case, the before-change and after-change styles should be the
-            // same in order to prevent a transition from being triggered as the unanimated style for this keyframe effect will most likely
-            // be this after-change style, or any future style change that may happen before the keyframe effect starts blending animated values.
-            return afterChangeStyle;
-        }
-
-        // In any other scenario, the before-change style should be the previously resolved style for this element.
         return currentStyle;
     }();
 

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/animation/AnimationTimeline.h (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/animation/AnimationTimeline.h	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/animation/AnimationTimeline.h	2020-02-20 00:41:44 UTC (rev 256995)
@@ -88,6 +88,7 @@
     using ElementToCSSAnimationsMap = HashMap<Element*, CSSAnimationCollection>;
 
     void updateGlobalPosition(WebAnimation&);
+    RefPtr<WebAnimation> cssAnimationForElementAndProperty(Element&, CSSPropertyID);
     PropertyToTransitionMap& ensureRunningTransitionsByProperty(Element&);
     void updateCSSTransitionsForElementAndProperty(Element&, CSSPropertyID, const RenderStyle& currentStyle, const RenderStyle& afterChangeStyle, PropertyToTransitionMap&, PropertyToTransitionMap&, const MonotonicTime);
     void removeCSSAnimationCreatedByMarkup(Element&, CSSAnimation&);

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/animation/CSSAnimation.cpp (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/animation/CSSAnimation.cpp	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/animation/CSSAnimation.cpp	2020-02-20 00:41:44 UTC (rev 256995)
@@ -38,7 +38,7 @@
 
 Ref<CSSAnimation> CSSAnimation::create(Element& owningElement, const Animation& backingAnimation, const RenderStyle* oldStyle, const RenderStyle& newStyle)
 {
-    auto result = adoptRef(*new CSSAnimation(owningElement, backingAnimation));
+    auto result = adoptRef(*new CSSAnimation(owningElement, backingAnimation, newStyle));
     result->initialize(oldStyle, newStyle);
 
     InspectorInstrumentation::didCreateWebAnimation(result.get());
@@ -46,9 +46,10 @@
     return result;
 }
 
-CSSAnimation::CSSAnimation(Element& element, const Animation& backingAnimation)
+CSSAnimation::CSSAnimation(Element& element, const Animation& backingAnimation, const RenderStyle& unanimatedStyle)
     : DeclarativeAnimation(element, backingAnimation)
     , m_animationName(backingAnimation.name())
+    , m_unanimatedStyle(RenderStyle::clonePtr(unanimatedStyle))
 {
 }
 

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/animation/CSSAnimation.h (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/animation/CSSAnimation.h	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/animation/CSSAnimation.h	2020-02-20 00:41:44 UTC (rev 256995)
@@ -42,6 +42,7 @@
 
     bool isCSSAnimation() const override { return true; }
     const String& animationName() const { return m_animationName; }
+    const RenderStyle& unanimatedStyle() const { return *m_unanimatedStyle; }
 
     ExceptionOr<void> bindingsPlay() final;
     ExceptionOr<void> bindingsPause() final;
@@ -50,9 +51,10 @@
     void syncPropertiesWithBackingAnimation() final;
 
 private:
-    CSSAnimation(Element&, const Animation&);
+    CSSAnimation(Element&, const Animation&, const RenderStyle&);
 
     String m_animationName;
+    std::unique_ptr<RenderStyle> m_unanimatedStyle;
     bool m_stickyPaused { false };
 };
 

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/animation/KeyframeEffect.cpp (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/animation/KeyframeEffect.cpp	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/animation/KeyframeEffect.cpp	2020-02-20 00:41:44 UTC (rev 256995)
@@ -769,20 +769,6 @@
     setBlendingKeyframes(keyframeList);
 }
 
-bool KeyframeEffect::animatesProperty(CSSPropertyID property) const
-{
-    if (!m_blendingKeyframes.isEmpty())
-        return m_blendingKeyframes.properties().contains(property);
-
-    for (auto& keyframe : m_parsedKeyframes) {
-        for (auto keyframeProperty : keyframe.unparsedStyle.keys()) {
-            if (keyframeProperty == property)
-                return true;
-        }
-    }
-    return false;
-}
-
 bool KeyframeEffect::forceLayoutIfNeeded()
 {
     if (!m_needsForcedLayout || !m_target)
@@ -804,7 +790,6 @@
 void KeyframeEffect::clearBlendingKeyframes()
 {
     m_blendingKeyframesSource = BlendingKeyframesSource::WebAnimation;
-    m_unanimatedStyle = nullptr;
     m_blendingKeyframes.clear();
 }
 
@@ -923,12 +908,12 @@
 {
     ASSERT(is<DeclarativeAnimation>(animation()));
     if (is<CSSAnimation>(animation()))
-        computeCSSAnimationBlendingKeyframes(newStyle);
+        computeCSSAnimationBlendingKeyframes();
     else if (is<CSSTransition>(animation()))
         computeCSSTransitionBlendingKeyframes(oldStyle, newStyle);
 }
 
-void KeyframeEffect::computeCSSAnimationBlendingKeyframes(const RenderStyle& unanimatedStyle)
+void KeyframeEffect::computeCSSAnimationBlendingKeyframes()
 {
     ASSERT(is<CSSAnimation>(animation()));
 
@@ -937,7 +922,7 @@
 
     KeyframeList keyframeList(backingAnimation.name());
     if (auto* styleScope = Style::Scope::forOrdinal(*m_target, backingAnimation.nameStyleScopeOrdinal()))
-        styleScope->resolver().keyframeStylesForAnimation(*m_target, &unanimatedStyle, keyframeList);
+        styleScope->resolver().keyframeStylesForAnimation(*m_target, &cssAnimation->unanimatedStyle(), keyframeList);
 
     // Ensure resource loads for all the frames.
     for (auto& keyframe : keyframeList.keyframes()) {
@@ -1104,9 +1089,6 @@
     if (!computedTiming.progress)
         return;
 
-    if (!m_unanimatedStyle)
-        m_unanimatedStyle = RenderStyle::clonePtr(targetStyle);
-
     setAnimatedPropertiesInStyle(targetStyle, computedTiming.progress.value());
 }
 

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/animation/KeyframeEffect.h (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/animation/KeyframeEffect.h	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/animation/KeyframeEffect.h	2020-02-20 00:41:44 UTC (rev 256995)
@@ -144,7 +144,6 @@
     void computeDeclarativeAnimationBlendingKeyframes(const RenderStyle* oldStyle, const RenderStyle& newStyle);
     const KeyframeList& blendingKeyframes() const { return m_blendingKeyframes; }
     const HashSet<CSSPropertyID>& animatedProperties() const { return m_blendingKeyframes.properties(); }
-    bool animatesProperty(CSSPropertyID) const;
 
     bool computeExtentOfTransformAnimation(LayoutRect&) const;
     bool computeTransformedExtentViaTransformList(const FloatRect&, const RenderStyle&, LayoutRect&) const;
@@ -155,8 +154,6 @@
     bool isCurrentlyAffectingProperty(CSSPropertyID, Accelerated = Accelerated::No) const;
     bool isRunningAcceleratedAnimationForProperty(CSSPropertyID) const;
 
-    const RenderStyle* unanimatedStyle() const { return m_unanimatedStyle.get(); }
-
 private:
     KeyframeEffect(Element*);
 
@@ -176,7 +173,7 @@
     void computeStackingContextImpact();
     void clearBlendingKeyframes();
     void updateBlendingKeyframes(RenderStyle&);
-    void computeCSSAnimationBlendingKeyframes(const RenderStyle&);
+    void computeCSSAnimationBlendingKeyframes();
     void computeCSSTransitionBlendingKeyframes(const RenderStyle* oldStyle, const RenderStyle& newStyle);
     void computeAcceleratedPropertiesState();
     void setBlendingKeyframes(KeyframeList&);
@@ -193,8 +190,6 @@
     Vector<AcceleratedAction> m_pendingAcceleratedActions;
     RefPtr<Element> m_target;
 
-    std::unique_ptr<const RenderStyle> m_unanimatedStyle;
-
     AcceleratedAction m_lastRecordedAcceleratedAction { AcceleratedAction::Stop };
     BlendingKeyframesSource m_blendingKeyframesSource { BlendingKeyframesSource::WebAnimation };
     IterationCompositeOperation m_iterationCompositeOperation { IterationCompositeOperation::Replace };

Modified: branches/safari-609.1.20.0-branch/Source/WebCore/style/StyleTreeResolver.cpp (256994 => 256995)


--- branches/safari-609.1.20.0-branch/Source/WebCore/style/StyleTreeResolver.cpp	2020-02-20 00:40:38 UTC (rev 256994)
+++ branches/safari-609.1.20.0-branch/Source/WebCore/style/StyleTreeResolver.cpp	2020-02-20 00:41:44 UTC (rev 256995)
@@ -306,7 +306,7 @@
 ElementUpdate TreeResolver::createAnimatedElementUpdate(std::unique_ptr<RenderStyle> newStyle, Element& element, Change parentChange)
 {
     auto* oldStyle = element.renderOrDisplayContentsStyle();
-
+    
     OptionSet<AnimationImpact> animationImpact;
 
     // New code path for CSS Animations and CSS Transitions.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to