⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268808 in webkit


Ignore:
Timestamp:
Oct 21, 2020, 11:09:02 AM (6 years ago)
Author:
graouts@webkit.org
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.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r268806 r268808  
     12020-10-21  Antoine Quint  <graouts@webkit.org>
     2
     3        Rename hasRunningTransitionsForProperty() and hasCompletedTransitionsForProperty() to be singular
     4        https://bugs.webkit.org/show_bug.cgi?id=218014
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Since there is only running or completed transition per property, the name of these methods was misleading.
     9
     10        * animation/AnimationTimeline.cpp:
     11        (WebCore::AnimationTimeline::updateCSSTransitionsForStyleableAndProperty):
     12        * dom/Element.cpp:
     13        (WebCore::Element::hasCompletedTransitionForProperty const):
     14        (WebCore::Element::hasRunningTransitionForProperty const):
     15        (WebCore::Element::hasCompletedTransitionsForProperty const): Deleted.
     16        (WebCore::Element::hasRunningTransitionsForProperty const): Deleted.
     17        * dom/Element.h:
     18        * style/Styleable.h:
     19        (WebCore::Styleable::hasCompletedTransitionForProperty const):
     20        (WebCore::Styleable::hasRunningTransitionForProperty const):
     21        (WebCore::Styleable::hasCompletedTransitionsForProperty const): Deleted.
     22        (WebCore::Styleable::hasRunningTransitionsForProperty const): Deleted.
     23
    1242020-10-21  Antti Koivisto  <antti@apple.com>
    225
  • trunk/Source/WebCore/animation/AnimationTimeline.cpp

    r267571 r268808  
    364364    // A CSS Transition might have completed since the last time animations were updated so we must
    365365    // update the running and completed transitions membership in that case.
    366     if (is<CSSTransition>(animation) && matchingBackingAnimation && styleable.hasRunningTransitionsForProperty(property) && animation->playState() == WebAnimation::PlayState::Finished) {
     366    if (is<CSSTransition>(animation) && matchingBackingAnimation && styleable.hasRunningTransitionForProperty(property) && animation->playState() == WebAnimation::PlayState::Finished) {
    367367        styleable.ensureCompletedTransitionsByProperty().set(property, styleable.ensureRunningTransitionsByProperty().take(property));
    368368        animation = nullptr;
     
    405405    }();
    406406
    407     if (!styleable.hasRunningTransitionsForProperty(property)
     407    if (!styleable.hasRunningTransitionForProperty(property)
    408408        && !CSSPropertyAnimation::propertiesEqual(property, &beforeChangeStyle, &afterChangeStyle)
    409409        && CSSPropertyAnimation::canPropertyBeInterpolated(property, &beforeChangeStyle, &afterChangeStyle)
     
    432432        auto reversingShorteningFactor = 1;
    433433        styleable.ensureRunningTransitionsByProperty().set(property, CSSTransition::create(styleable, property, generationTime, *matchingBackingAnimation, &beforeChangeStyle, afterChangeStyle, delay, duration, reversingAdjustedStartStyle, reversingShorteningFactor));
    434     } else if (styleable.hasCompletedTransitionsForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureCompletedTransitionsByProperty())) {
     434    } else if (styleable.hasCompletedTransitionForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureCompletedTransitionsByProperty())) {
    435435        // 2. Otherwise, if the element has a completed transition for the property and the end value of the completed transition is different from
    436436        //    the after-change style for the property, then implementations must remove the completed transition from the set of completed transitions.
     
    438438    }
    439439
    440     bool hasRunningTransition = styleable.hasRunningTransitionsForProperty(property);
    441     if ((hasRunningTransition || styleable.hasCompletedTransitionsForProperty(property)) && !matchingBackingAnimation) {
     440    bool hasRunningTransition = styleable.hasRunningTransitionForProperty(property);
     441    if ((hasRunningTransition || styleable.hasCompletedTransitionForProperty(property)) && !matchingBackingAnimation) {
    442442        // 3. If the element has a running transition or completed transition for the property, and there is not a matching transition-property
    443443        //    value, then implementations must cancel the running transition or remove the completed transition from the set of completed transitions.
     
    448448    }
    449449
    450     if (matchingBackingAnimation && styleable.hasRunningTransitionsForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureRunningTransitionsByProperty())) {
     450    if (matchingBackingAnimation && styleable.hasRunningTransitionForProperty(property) && !propertyInStyleMatchesValueForTransitionInMap(property, afterChangeStyle, styleable.ensureRunningTransitionsByProperty())) {
    451451        auto previouslyRunningTransition = styleable.ensureRunningTransitionsByProperty().take(property);
    452452        auto& previouslyRunningTransitionCurrentStyle = previouslyRunningTransition->currentStyle();
  • trunk/Source/WebCore/dom/Element.cpp

    r268782 r268808  
    38483848}
    38493849
    3850 bool Element::hasCompletedTransitionsForProperty(PseudoId pseudoId, CSSPropertyID property) const
     3850bool Element::hasCompletedTransitionForProperty(PseudoId pseudoId, CSSPropertyID property) const
    38513851{
    38523852    if (auto* animationData = animationRareData(pseudoId))
     
    38553855}
    38563856
    3857 bool Element::hasRunningTransitionsForProperty(PseudoId pseudoId, CSSPropertyID property) const
     3857bool Element::hasRunningTransitionForProperty(PseudoId pseudoId, CSSPropertyID property) const
    38583858{
    38593859    if (auto* animationData = animationRareData(pseudoId))
  • trunk/Source/WebCore/dom/Element.h

    r267970 r268808  
    493493
    494494    const AnimationCollection* animations(PseudoId) const;
    495     bool hasCompletedTransitionsForProperty(PseudoId, CSSPropertyID) const;
    496     bool hasRunningTransitionsForProperty(PseudoId, CSSPropertyID) const;
     495    bool hasCompletedTransitionForProperty(PseudoId, CSSPropertyID) const;
     496    bool hasRunningTransitionForProperty(PseudoId, CSSPropertyID) const;
    497497    bool hasRunningTransitions(PseudoId) const;
    498498    AnimationCollection& ensureAnimations(PseudoId);
  • trunk/Source/WebCore/style/Styleable.h

    r267571 r268808  
    9797    }
    9898
    99     bool hasCompletedTransitionsForProperty(CSSPropertyID property) const
     99    bool hasCompletedTransitionForProperty(CSSPropertyID property) const
    100100    {
    101         return element.hasCompletedTransitionsForProperty(pseudoId, property);
     101        return element.hasCompletedTransitionForProperty(pseudoId, property);
    102102    }
    103103
    104     bool hasRunningTransitionsForProperty(CSSPropertyID property) const
     104    bool hasRunningTransitionForProperty(CSSPropertyID property) const
    105105    {
    106         return element.hasRunningTransitionsForProperty(pseudoId, property);
     106        return element.hasRunningTransitionForProperty(pseudoId, property);
    107107    }
    108108
Note: See TracChangeset for help on using the changeset viewer.