Title: [287761] trunk/Source/WebCore
Revision
287761
Author
grao...@webkit.org
Date
2022-01-07 10:46:00 -0800 (Fri, 07 Jan 2022)

Log Message

Values in WebAnimation::instances should not be null-checked
https://bugs.webkit.org/show_bug.cgi?id=234948

Reviewed by Darin Adler.

The HashSet<WebAnimation*> returned by WebAnimation::instances() cannnot hold nullptr
values so we should not have any check for a null value when iterating over its values.

* dom/Document.cpp:
(WebCore::Document::matchingAnimations):
(WebCore::Document::keyframesRuleDidChange):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287760 => 287761)


--- trunk/Source/WebCore/ChangeLog	2022-01-07 18:44:50 UTC (rev 287760)
+++ trunk/Source/WebCore/ChangeLog	2022-01-07 18:46:00 UTC (rev 287761)
@@ -1,3 +1,17 @@
+2022-01-07  Antoine Quint  <grao...@webkit.org>
+
+        Values in WebAnimation::instances should not be null-checked
+        https://bugs.webkit.org/show_bug.cgi?id=234948
+
+        Reviewed by Darin Adler.
+
+        The HashSet<WebAnimation*> returned by WebAnimation::instances() cannnot hold nullptr
+        values so we should not have any check for a null value when iterating over its values.
+
+        * dom/Document.cpp:
+        (WebCore::Document::matchingAnimations):
+        (WebCore::Document::keyframesRuleDidChange):
+
 2022-01-07  Youenn Fablet  <you...@apple.com>
 
         Allow storing form data responses in Cache Storage

Modified: trunk/Source/WebCore/dom/Document.cpp (287760 => 287761)


--- trunk/Source/WebCore/dom/Document.cpp	2022-01-07 18:44:50 UTC (rev 287760)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-01-07 18:46:00 UTC (rev 287761)
@@ -8555,7 +8555,7 @@
 
     Vector<RefPtr<WebAnimation>> animations;
     for (auto* animation : WebAnimation::instances()) {
-        if (!animation || !animation->isRelevant() || !is<KeyframeEffect>(animation->effect()))
+        if (!animation->isRelevant() || !is<KeyframeEffect>(animation->effect()))
             continue;
 
         auto* target = downcast<KeyframeEffect>(*animation->effect()).targetElementOrPseudoElement();
@@ -8573,7 +8573,7 @@
 void Document::keyframesRuleDidChange(const String& name)
 {
     for (auto* animation : WebAnimation::instances()) {
-        if (!is<CSSAnimation>(animation) || !animation->isRelevant())
+        if (!is<CSSAnimation>(*animation) || !animation->isRelevant())
             continue;
 
         auto& cssAnimation = downcast<CSSAnimation>(*animation);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to