Title: [289357] trunk/Source/WebCore
Revision
289357
Author
[email protected]
Date
2022-02-07 20:43:49 -0800 (Mon, 07 Feb 2022)

Log Message

Unreviewed, reverting r289227.
https://bugs.webkit.org/show_bug.cgi?id=236282

Crash on AS debug builds

Reverted changeset:

"Move
DocumentTimeline::runningAnimationsForRendererAreAllAccelerated()
to Styleable"
https://bugs.webkit.org/show_bug.cgi?id=236239
https://commits.webkit.org/r289227

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289356 => 289357)


--- trunk/Source/WebCore/ChangeLog	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 04:43:49 UTC (rev 289357)
@@ -1,3 +1,18 @@
+2022-02-07  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r289227.
+        https://bugs.webkit.org/show_bug.cgi?id=236282
+
+        Crash on AS debug builds
+
+        Reverted changeset:
+
+        "Move
+        DocumentTimeline::runningAnimationsForRendererAreAllAccelerated()
+        to Styleable"
+        https://bugs.webkit.org/show_bug.cgi?id=236239
+        https://commits.webkit.org/r289227
+
 2022-02-07  Cameron McCormack  <[email protected]>
 
         Remove HTMLSourceTracker

Modified: trunk/Source/WebCore/animation/DocumentTimeline.cpp (289356 => 289357)


--- trunk/Source/WebCore/animation/DocumentTimeline.cpp	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/animation/DocumentTimeline.cpp	2022-02-08 04:43:49 UTC (rev 289357)
@@ -386,6 +386,24 @@
         effectStack->stopAcceleratingTransformRelatedProperties(UseAcceleratedAction::No);
 }
 
+bool DocumentTimeline::runningAnimationsForRendererAreAllAccelerated(const RenderBoxModelObject& renderer) const
+{
+    auto styleable = Styleable::fromRenderer(renderer);
+    if (!styleable)
+        return false;
+
+    auto* animations = styleable->animations();
+    if (!animations || animations->isEmpty())
+        return false;
+
+    for (const auto& animation : *animations) {
+        if (!animation->isRunningAccelerated())
+            return false;
+    }
+
+    return true;
+}
+
 void DocumentTimeline::enqueueAnimationEvent(AnimationEventBase& event)
 {
     m_pendingAnimationEvents.append(event);

Modified: trunk/Source/WebCore/animation/DocumentTimeline.h (289356 => 289357)


--- trunk/Source/WebCore/animation/DocumentTimeline.h	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/animation/DocumentTimeline.h	2022-02-08 04:43:49 UTC (rev 289357)
@@ -61,6 +61,7 @@
     void transitionDidComplete(RefPtr<CSSTransition>);
 
     void animationAcceleratedRunningStateDidChange(WebAnimation&);
+    bool runningAnimationsForRendererAreAllAccelerated(const RenderBoxModelObject&) const;
     void detachFromDocument();
 
     void enqueueAnimationEvent(AnimationEventBase&);

Modified: trunk/Source/WebCore/animation/WebAnimation.cpp (289356 => 289357)


--- trunk/Source/WebCore/animation/WebAnimation.cpp	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/animation/WebAnimation.cpp	2022-02-08 04:43:49 UTC (rev 289357)
@@ -1252,6 +1252,11 @@
     invalidateEffect();
 }
 
+bool WebAnimation::isRunningAccelerated() const
+{
+    return is<KeyframeEffect>(m_effect) && downcast<KeyframeEffect>(*m_effect).isRunningAccelerated();
+}
+
 bool WebAnimation::needsTick() const
 {
     return pending() || playState() == PlayState::Running || m_hasScheduledEventsDuringTick;

Modified: trunk/Source/WebCore/animation/WebAnimation.h (289356 => 289357)


--- trunk/Source/WebCore/animation/WebAnimation.h	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/animation/WebAnimation.h	2022-02-08 04:43:49 UTC (rev 289357)
@@ -134,6 +134,7 @@
     void acceleratedStateDidChange();
     void willChangeRenderer();
 
+    bool isRunningAccelerated() const;
     bool isRelevant() const { return m_isRelevant; }
     void updateRelevance();
     void effectTimingDidChange();

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (289356 => 289357)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2022-02-08 04:43:49 UTC (rev 289357)
@@ -31,6 +31,7 @@
 #include "CachedImage.h"
 #include "ColorBlending.h"
 #include "Document.h"
+#include "DocumentTimeline.h"
 #include "FloatRoundedRect.h"
 #include "Frame.h"
 #include "FrameView.h"
@@ -59,7 +60,6 @@
 #include "RenderView.h"
 #include "ScrollingConstraints.h"
 #include "Settings.h"
-#include "Styleable.h"
 #include "TextBoxPainter.h"
 #include "TransformState.h"
 #include <wtf/IsoMallocInlines.h>
@@ -2699,8 +2699,10 @@
 
 bool RenderBoxModelObject::hasRunningAcceleratedAnimations() const
 {
-    if (auto styleable = Styleable::fromRenderer(*this))
-        return styleable->runningAnimationsAreAllAccelerated();
+    if (auto* node = element()) {
+        if (auto* timeline = node->document().existingTimeline())
+            return timeline->runningAnimationsForRendererAreAllAccelerated(*this);
+    }
     return false;
 }
 

Modified: trunk/Source/WebCore/style/Styleable.cpp (289356 => 289357)


--- trunk/Source/WebCore/style/Styleable.cpp	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/style/Styleable.cpp	2022-02-08 04:43:49 UTC (rev 289357)
@@ -163,20 +163,6 @@
     return false;
 }
 
-bool Styleable::runningAnimationsAreAllAccelerated() const
-{
-    auto* effectStack = keyframeEffectStack();
-    if (!effectStack || !effectStack->hasEffects())
-        return false;
-
-    for (const auto& effect : effectStack->sortedEffects()) {
-        if (!effect->isRunningAccelerated())
-            return false;
-    }
-
-    return true;
-}
-
 void Styleable::animationWasAdded(WebAnimation& animation) const
 {
     ensureAnimations().add(&animation);

Modified: trunk/Source/WebCore/style/Styleable.h (289356 => 289357)


--- trunk/Source/WebCore/style/Styleable.h	2022-02-08 04:24:37 UTC (rev 289356)
+++ trunk/Source/WebCore/style/Styleable.h	2022-02-08 04:43:49 UTC (rev 289357)
@@ -79,8 +79,6 @@
 
     bool isRunningAcceleratedTransformAnimation() const;
 
-    bool runningAnimationsAreAllAccelerated() const;
-
     KeyframeEffectStack* keyframeEffectStack() const
     {
         return element.keyframeEffectStack(pseudoId);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to