Title: [268808] trunk/Source/WebCore
Revision
268808
Author
[email protected]
Date
2020-10-21 11:09:02 -0700 (Wed, 21 Oct 2020)

Log Message

Rename hasRunningTransitionsForProperty() and hasCompletedTransitionsForProperty() to be singular
https://bugs.webkit.org/show_bug.cgi?id=218014

Reviewed by Geoffrey Garen.

Since there is only running or completed transition per property, the name of these methods was misleading.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForStyleableAndProperty):
* dom/Element.cpp:
(WebCore::Element::hasCompletedTransitionForProperty const):
(WebCore::Element::hasRunningTransitionForProperty const):
(WebCore::Element::hasCompletedTransitionsForProperty const): Deleted.
(WebCore::Element::hasRunningTransitionsForProperty const): Deleted.
* dom/Element.h:
* style/Styleable.h:
(WebCore::Styleable::hasCompletedTransitionForProperty const):
(WebCore::Styleable::hasRunningTransitionForProperty const):
(WebCore::Styleable::hasCompletedTransitionsForProperty const): Deleted.
(WebCore::Styleable::hasRunningTransitionsForProperty const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (268807 => 268808)


--- trunk/Source/WebCore/ChangeLog	2020-10-21 18:07:34 UTC (rev 268807)
+++ trunk/Source/WebCore/ChangeLog	2020-10-21 18:09:02 UTC (rev 268808)
@@ -1,3 +1,26 @@
+2020-10-21  Antoine Quint  <[email protected]>
+
+        Rename hasRunningTransitionsForProperty() and hasCompletedTransitionsForProperty() to be singular
+        https://bugs.webkit.org/show_bug.cgi?id=218014
+
+        Reviewed by Geoffrey Garen.
+
+        Since there is only running or completed transition per property, the name of these methods was misleading.
+
+        * animation/AnimationTimeline.cpp:
+        (WebCore::AnimationTimeline::updateCSSTransitionsForStyleableAndProperty):
+        * dom/Element.cpp:
+        (WebCore::Element::hasCompletedTransitionForProperty const):
+        (WebCore::Element::hasRunningTransitionForProperty const):
+        (WebCore::Element::hasCompletedTransitionsForProperty const): Deleted.
+        (WebCore::Element::hasRunningTransitionsForProperty const): Deleted.
+        * dom/Element.h:
+        * style/Styleable.h:
+        (WebCore::Styleable::hasCompletedTransitionForProperty const):
+        (WebCore::Styleable::hasRunningTransitionForProperty const):
+        (WebCore::Styleable::hasCompletedTransitionsForProperty const): Deleted.
+        (WebCore::Styleable::hasRunningTransitionsForProperty const): Deleted.
+
 2020-10-21  Antti Koivisto  <[email protected]>
 
         [LFC][Integration] Use LineLayout::containing() in more places

Modified: trunk/Source/WebCore/animation/AnimationTimeline.cpp (268807 => 268808)


--- trunk/Source/WebCore/animation/AnimationTimeline.cpp	2020-10-21 18:07:34 UTC (rev 268807)
+++ trunk/Source/WebCore/animation/AnimationTimeline.cpp	2020-10-21 18:09:02 UTC (rev 268808)
@@ -363,7 +363,7 @@
 
     // A CSS Transition might have completed since the last time animations were updated so we must
     // update the running and completed transitions membership in that case.
-    if (is<CSSTransition>(animation) && matchingBackingAnimation && styleable.hasRunningTransitionsForProperty(property) && animation->playState() == WebAnimation::PlayState::Finished) {
+    if (is<CSSTransition>(animation) && matchingBackingAnimation && styleable.hasRunningTransitionForProperty(property) && animation->playState() == WebAnimation::PlayState::Finished) {
         styleable.ensureCompletedTransitionsByProperty().set(property, styleable.ensureRunningTransitionsByProperty().take(property));
         animation = nullptr;
     }
@@ -404,7 +404,7 @@
         return RenderStyle::clone(newStyle);
     }();
 
-    if (!styleable.hasRunningTransitionsForProperty(property)
+    if (!styleable.hasRunningTransitionForProperty(property)
         && !CSSPropertyAnimation::propertiesEqual(property, &beforeChangeStyle, &afterChangeStyle)
         && CSSPropertyAnimation::canPropertyBeInterpolated(property, &beforeChangeStyle, &afterChangeStyle)
         && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureCompletedTransitionsByProperty())
@@ -431,14 +431,14 @@
         auto& reversingAdjustedStartStyle = beforeChangeStyle;
         auto reversingShorteningFactor = 1;
         styleable.ensureRunningTransitionsByProperty().set(property, CSSTransition::create(styleable, property, generationTime, *matchingBackingAnimation, &beforeChangeStyle, afterChangeStyle, delay, duration, reversingAdjustedStartStyle, reversingShorteningFactor));
-    } else if (styleable.hasCompletedTransitionsForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureCompletedTransitionsByProperty())) {
+    } else if (styleable.hasCompletedTransitionForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureCompletedTransitionsByProperty())) {
         // 2. Otherwise, if the element has a completed transition for the property and the end value of the completed transition is different from
         //    the after-change style for the property, then implementations must remove the completed transition from the set of completed transitions.
         styleable.ensureCompletedTransitionsByProperty().remove(property);
     }
 
-    bool hasRunningTransition = styleable.hasRunningTransitionsForProperty(property);
-    if ((hasRunningTransition || styleable.hasCompletedTransitionsForProperty(property)) && !matchingBackingAnimation) {
+    bool hasRunningTransition = styleable.hasRunningTransitionForProperty(property);
+    if ((hasRunningTransition || styleable.hasCompletedTransitionForProperty(property)) && !matchingBackingAnimation) {
         // 3. If the element has a running transition or completed transition for the property, and there is not a matching transition-property
         //    value, then implementations must cancel the running transition or remove the completed transition from the set of completed transitions.
         if (hasRunningTransition)
@@ -447,7 +447,7 @@
             styleable.ensureCompletedTransitionsByProperty().remove(property);
     }
 
-    if (matchingBackingAnimation && styleable.hasRunningTransitionsForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureRunningTransitionsByProperty())) {
+    if (matchingBackingAnimation && styleable.hasRunningTransitionForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureRunningTransitionsByProperty())) {
         auto previouslyRunningTransition = styleable.ensureRunningTransitionsByProperty().take(property);
         auto& previouslyRunningTransitionCurrentStyle = previouslyRunningTransition->currentStyle();
         // 4. If the element has a running transition for the property, there is a matching transition-property value, and the end value of the running

Modified: trunk/Source/WebCore/dom/Element.cpp (268807 => 268808)


--- trunk/Source/WebCore/dom/Element.cpp	2020-10-21 18:07:34 UTC (rev 268807)
+++ trunk/Source/WebCore/dom/Element.cpp	2020-10-21 18:09:02 UTC (rev 268808)
@@ -3847,7 +3847,7 @@
     return nullptr;
 }
 
-bool Element::hasCompletedTransitionsForProperty(PseudoId pseudoId, CSSPropertyID property) const
+bool Element::hasCompletedTransitionForProperty(PseudoId pseudoId, CSSPropertyID property) const
 {
     if (auto* animationData = animationRareData(pseudoId))
         return animationData->completedTransitionsByProperty().contains(property);
@@ -3854,7 +3854,7 @@
     return false;
 }
 
-bool Element::hasRunningTransitionsForProperty(PseudoId pseudoId, CSSPropertyID property) const
+bool Element::hasRunningTransitionForProperty(PseudoId pseudoId, CSSPropertyID property) const
 {
     if (auto* animationData = animationRareData(pseudoId))
         return animationData->runningTransitionsByProperty().contains(property);

Modified: trunk/Source/WebCore/dom/Element.h (268807 => 268808)


--- trunk/Source/WebCore/dom/Element.h	2020-10-21 18:07:34 UTC (rev 268807)
+++ trunk/Source/WebCore/dom/Element.h	2020-10-21 18:09:02 UTC (rev 268808)
@@ -492,8 +492,8 @@
     OptionSet<AnimationImpact> applyKeyframeEffects(PseudoId, RenderStyle&);
 
     const AnimationCollection* animations(PseudoId) const;
-    bool hasCompletedTransitionsForProperty(PseudoId, CSSPropertyID) const;
-    bool hasRunningTransitionsForProperty(PseudoId, CSSPropertyID) const;
+    bool hasCompletedTransitionForProperty(PseudoId, CSSPropertyID) const;
+    bool hasRunningTransitionForProperty(PseudoId, CSSPropertyID) const;
     bool hasRunningTransitions(PseudoId) const;
     AnimationCollection& ensureAnimations(PseudoId);
 

Modified: trunk/Source/WebCore/style/Styleable.h (268807 => 268808)


--- trunk/Source/WebCore/style/Styleable.h	2020-10-21 18:07:34 UTC (rev 268807)
+++ trunk/Source/WebCore/style/Styleable.h	2020-10-21 18:09:02 UTC (rev 268808)
@@ -96,14 +96,14 @@
         return element.animations(pseudoId);
     }
 
-    bool hasCompletedTransitionsForProperty(CSSPropertyID property) const
+    bool hasCompletedTransitionForProperty(CSSPropertyID property) const
     {
-        return element.hasCompletedTransitionsForProperty(pseudoId, property);
+        return element.hasCompletedTransitionForProperty(pseudoId, property);
     }
 
-    bool hasRunningTransitionsForProperty(CSSPropertyID property) const
+    bool hasRunningTransitionForProperty(CSSPropertyID property) const
     {
-        return element.hasRunningTransitionsForProperty(pseudoId, property);
+        return element.hasRunningTransitionForProperty(pseudoId, property);
     }
 
     bool hasRunningTransitions() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to