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

Changeset 242970 in webkit


Ignore:
Timestamp:
Mar 14, 2019, 3:11:42 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Use enum class for AnimationMode
https://bugs.webkit.org/show_bug.cgi?id=195762

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-14
Reviewed by Tim Horton.

Convert AnimationMode into an enum class.

  • svg/SVGAnimateElementBase.cpp:

(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::isAdditive const):

  • svg/SVGAnimateMotionElement.cpp:

(WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
(WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
(WebCore::SVGAnimateMotionElement::updateAnimationMode):

  • svg/SVGAnimatedAngle.cpp:

(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedBoolean.cpp:

(WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedColor.cpp:

(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedEnumeration.cpp:

(WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedInteger.cpp:

(WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedIntegerOptionalInteger.cpp:

(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedLength.cpp:

(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedLengthList.cpp:

(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedNumber.cpp:

(WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedNumberList.cpp:

(WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedNumberOptionalNumber.cpp:

(WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedPath.cpp:

(WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedPointList.cpp:

(WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedPreserveAspectRatio.cpp:

(WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedRect.cpp:

(WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):

  • svg/SVGAnimatedTransformList.cpp:

(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):

  • svg/SVGAnimationElement.cpp:

(WebCore::SVGAnimationElement::updateAnimationMode):
(WebCore::SVGAnimationElement::isAdditive const):
(WebCore::SVGAnimationElement::isAccumulated const):
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
(WebCore::SVGAnimationElement::startedActiveInterval):
(WebCore::SVGAnimationElement::updateAnimation):

  • svg/SVGAnimationElement.h:

(WebCore::SVGAnimationElement::adjustFromToListValues):
(WebCore::SVGAnimationElement::animateDiscreteType):
(WebCore::SVGAnimationElement::animateAdditiveNumber):

  • svg/SVGSetElement.cpp:

(WebCore::SVGSetElement::SVGSetElement):
(WebCore::SVGSetElement::updateAnimationMode):

Location:
trunk/Source/WebCore
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r242964 r242970  
     12019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Use enum class for AnimationMode
     4        https://bugs.webkit.org/show_bug.cgi?id=195762
     5
     6        Reviewed by Tim Horton.
     7
     8        Convert AnimationMode into an enum class.
     9
     10        * svg/SVGAnimateElementBase.cpp:
     11        (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
     12        (WebCore::SVGAnimateElementBase::isAdditive const):
     13        * svg/SVGAnimateMotionElement.cpp:
     14        (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
     15        (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
     16        (WebCore::SVGAnimateMotionElement::updateAnimationMode):
     17        * svg/SVGAnimatedAngle.cpp:
     18        (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
     19        * svg/SVGAnimatedBoolean.cpp:
     20        (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
     21        * svg/SVGAnimatedColor.cpp:
     22        (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
     23        * svg/SVGAnimatedEnumeration.cpp:
     24        (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
     25        * svg/SVGAnimatedInteger.cpp:
     26        (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
     27        * svg/SVGAnimatedIntegerOptionalInteger.cpp:
     28        (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
     29        * svg/SVGAnimatedLength.cpp:
     30        (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
     31        * svg/SVGAnimatedLengthList.cpp:
     32        (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
     33        * svg/SVGAnimatedNumber.cpp:
     34        (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
     35        * svg/SVGAnimatedNumberList.cpp:
     36        (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
     37        * svg/SVGAnimatedNumberOptionalNumber.cpp:
     38        (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
     39        * svg/SVGAnimatedPath.cpp:
     40        (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
     41        * svg/SVGAnimatedPointList.cpp:
     42        (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
     43        * svg/SVGAnimatedPreserveAspectRatio.cpp:
     44        (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
     45        * svg/SVGAnimatedRect.cpp:
     46        (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
     47        * svg/SVGAnimatedTransformList.cpp:
     48        (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
     49        * svg/SVGAnimationElement.cpp:
     50        (WebCore::SVGAnimationElement::updateAnimationMode):
     51        (WebCore::SVGAnimationElement::isAdditive const):
     52        (WebCore::SVGAnimationElement::isAccumulated const):
     53        (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
     54        (WebCore::SVGAnimationElement::startedActiveInterval):
     55        (WebCore::SVGAnimationElement::updateAnimation):
     56        * svg/SVGAnimationElement.h:
     57        (WebCore::SVGAnimationElement::adjustFromToListValues):
     58        (WebCore::SVGAnimationElement::animateDiscreteType):
     59        (WebCore::SVGAnimationElement::animateAdditiveNumber):
     60        * svg/SVGSetElement.cpp:
     61        (WebCore::SVGSetElement::SVGSetElement):
     62        (WebCore::SVGSetElement::updateAnimationMode):
     63
    1642019-03-14  Ryosuke Niwa  <rniwa@webkit.org>
    265
  • trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp

    r239965 r242970  
    164164        return false;
    165165
    166     if (animationMode() == ByAnimation && !isAdditive())
     166    if (animationMode() == AnimationMode::By && !isAdditive())
    167167        return false;
    168168
    169169    // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes).
    170     if (animationMode() == FromByAnimation && !animatedPropertyTypeSupportsAddition())
     170    if (animationMode() == AnimationMode::FromBy && !animatedPropertyTypeSupportsAddition())
    171171        return false;
    172172
     
    413413bool SVGAnimateElementBase::isAdditive() const
    414414{
    415     if (animationMode() == ByAnimation || animationMode() == FromByAnimation) {
     415    if (animationMode() == AnimationMode::By || animationMode() == AnimationMode::FromBy) {
    416416        if (!animatedPropertyTypeSupportsAddition())
    417417            return false;
  • trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp

    r229694 r242970  
    177177{
    178178    m_hasToPointAtEndOfDuration = false;
    179     if (animationMode() == ByAnimation && !isAdditive())
     179    if (animationMode() == AnimationMode::By && !isAdditive())
    180180        return false;
    181181    parsePoint(fromString, m_fromPoint);
     
    223223        transform->makeIdentity();
    224224
    225     if (animationMode() != PathAnimation) {
     225    if (animationMode() != AnimationMode::Path) {
    226226        FloatPoint toPointAtEndOfDuration = m_toPoint;
    227227        if (isAccumulated() && repeatCount && m_hasToPointAtEndOfDuration)
     
    289289{
    290290    if (!m_animationPath.isEmpty())
    291         setAnimationMode(PathAnimation);
     291        setAnimationMode(AnimationMode::Path);
    292292    else
    293293        SVGAnimationElement::updateAnimationMode();
  • trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp

    r229417 r242970  
    8181    ASSERT(m_contextElement);
    8282
    83     const auto& fromAngleAndEnumeration = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<std::pair<SVGAngleValue, unsigned>>();
     83    const auto& fromAngleAndEnumeration = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<std::pair<SVGAngleValue, unsigned>>();
    8484    auto& toAngleAndEnumeration = to->as<std::pair<SVGAngleValue, unsigned>>();
    8585    auto& toAtEndOfDurationAngleAndEnumeration = toAtEndOfDuration->as<std::pair<SVGAngleValue, unsigned>>();
  • trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp

    r229417 r242970  
    7171    ASSERT(m_contextElement);
    7272
    73     const auto fromBoolean = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<bool>();
     73    const auto fromBoolean = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<bool>();
    7474    const auto toBoolean = to->as<bool>();
    7575    auto& animatedBoolean = animated->as<bool>();
  • trunk/Source/WebCore/svg/SVGAnimatedColor.cpp

    r229417 r242970  
    7171    ASSERT(m_contextElement);
    7272
    73     auto fromColor = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<Color>();
     73    auto fromColor = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<Color>();
    7474    auto toColor = to->as<Color>();
    7575
  • trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp

    r234610 r242970  
    149149    ASSERT(m_contextElement);
    150150
    151     const auto fromEnumeration = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<unsigned>();
     151    const auto fromEnumeration = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<unsigned>();
    152152    const auto toEnumeration = to->as<unsigned>();
    153153    auto& animatedEnumeration = animated->as<unsigned>();
  • trunk/Source/WebCore/svg/SVGAnimatedInteger.cpp

    r229417 r242970  
    8383    ASSERT(m_contextElement);
    8484
    85     const auto fromInteger = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<int>();
     85    const auto fromInteger = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<int>();
    8686    const auto toInteger = to->as<int>();
    8787    const auto toAtEndOfDurationInteger = toAtEndOfDuration->as<int>();
  • trunk/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp

    r229417 r242970  
    7979    ASSERT(m_contextElement);
    8080
    81     const auto& fromIntegerPair = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<std::pair<int, int>>();
     81    const auto& fromIntegerPair = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<std::pair<int, int>>();
    8282    const auto& toIntegerPair = to->as<std::pair<int, int>>();
    8383    const auto& toAtEndOfDurationIntegerPair = toAtEndOfDuration->as<std::pair<int, int>>();
  • trunk/Source/WebCore/svg/SVGAnimatedLength.cpp

    r229417 r242970  
    8787    ASSERT(m_contextElement);
    8888
    89     auto fromSVGLength = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGLengthValue>();
     89    auto fromSVGLength = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<SVGLengthValue>();
    9090    auto toSVGLength = to->as<SVGLengthValue>();
    9191    const auto& toAtEndOfDurationSVGLength = toAtEndOfDuration->as<SVGLengthValue>();
  • trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp

    r229417 r242970  
    9191    ASSERT(m_contextElement);
    9292
    93     auto fromLengthList = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGLengthListValues>();
     93    auto fromLengthList = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<SVGLengthListValues>();
    9494    auto toLengthList = to->as<SVGLengthListValues>();
    9595    const auto& toAtEndOfDurationLengthList = toAtEndOfDuration->as<SVGLengthListValues>();
  • trunk/Source/WebCore/svg/SVGAnimatedNumber.cpp

    r229417 r242970  
    8080    ASSERT(m_contextElement);
    8181
    82     auto fromNumber = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<float>();
     82    auto fromNumber = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<float>();
    8383    auto toNumber = to->as<float>();
    8484    const auto toAtEndOfDurationNumber = toAtEndOfDuration->as<float>();
  • trunk/Source/WebCore/svg/SVGAnimatedNumberList.cpp

    r229417 r242970  
    8282    ASSERT(m_animationElement);
    8383
    84     const auto& fromNumberList = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGNumberListValues>();
     84    const auto& fromNumberList = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<SVGNumberListValues>();
    8585    const auto& toNumberList = to->as<SVGNumberListValues>();
    8686    const auto& toAtEndOfDurationNumberList = toAtEndOfDuration->as<SVGNumberListValues>();
  • trunk/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp

    r229417 r242970  
    7979    ASSERT(m_contextElement);
    8080
    81     const auto& fromNumberPair = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<std::pair<float, float>>();
     81    const auto& fromNumberPair = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<std::pair<float, float>>();
    8282    const auto& toNumberPair = to->as<std::pair<float, float>>();
    8383    const auto& toAtEndOfDurationNumberPair = toAtEndOfDuration->as<std::pair<float, float>>();
  • trunk/Source/WebCore/svg/SVGAnimatedPath.cpp

    r229417 r242970  
    109109    ASSERT(m_contextElement);
    110110
    111     bool isToAnimation = m_animationElement->animationMode() == ToAnimation;
     111    bool isToAnimation = m_animationElement->animationMode() == AnimationMode::To;
    112112    auto& animatedPath = animated->as<SVGPathByteStream>();
    113113
  • trunk/Source/WebCore/svg/SVGAnimatedPointList.cpp

    r229417 r242970  
    8383    ASSERT(m_animationElement);
    8484
    85     const auto& fromPointList = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGPointListValues>();
     85    const auto& fromPointList = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<SVGPointListValues>();
    8686    const auto& toPointList = to->as<SVGPointListValues>();
    8787    const auto& toAtEndOfDurationPointList = toAtEndOfDuration->as<SVGPointListValues>();
  • trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp

    r229417 r242970  
    7070    ASSERT(m_contextElement);
    7171
    72     const auto& fromPreserveAspectRatio = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGPreserveAspectRatioValue>();
     72    const auto& fromPreserveAspectRatio = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<SVGPreserveAspectRatioValue>();
    7373    const auto& toPreserveAspectRatio = to->as<SVGPreserveAspectRatioValue>();
    7474    auto& animatedPreserveAspectRatio = animated->as<SVGPreserveAspectRatioValue>();
  • trunk/Source/WebCore/svg/SVGAnimatedRect.cpp

    r229417 r242970  
    7474    ASSERT(m_contextElement);
    7575
    76     const auto& fromRect = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<FloatRect>();
     76    const auto& fromRect = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<FloatRect>();
    7777    const auto& toRect = to->as<FloatRect>();
    7878    const auto& toAtEndOfDurationRect = toAtEndOfDuration->as<FloatRect>();
  • trunk/Source/WebCore/svg/SVGAnimatedTransformList.cpp

    r229417 r242970  
    106106
    107107    // Never resize the animatedTransformList to the toTransformList size, instead either clear the list or append to it.
    108     if (!animatedTransformList.isEmpty() && (!m_animationElement->isAdditive() || m_animationElement->animationMode() == ToAnimation))
     108    if (!animatedTransformList.isEmpty() && (!m_animationElement->isAdditive() || m_animationElement->animationMode() == AnimationMode::To))
    109109        animatedTransformList.clear();
    110110
  • trunk/Source/WebCore/svg/SVGAnimationElement.cpp

    r234620 r242970  
    269269    // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues
    270270    if (hasAttribute(SVGNames::valuesAttr))
    271         setAnimationMode(ValuesAnimation);
     271        setAnimationMode(AnimationMode::Values);
    272272    else if (!toValue().isEmpty())
    273         setAnimationMode(fromValue().isEmpty() ? ToAnimation : FromToAnimation);
     273        setAnimationMode(fromValue().isEmpty() ? AnimationMode::To : AnimationMode::FromTo);
    274274    else if (!byValue().isEmpty())
    275         setAnimationMode(fromValue().isEmpty() ? ByAnimation : FromByAnimation);
     275        setAnimationMode(fromValue().isEmpty() ? AnimationMode::By : AnimationMode::FromBy);
    276276    else
    277         setAnimationMode(NoAnimation);
     277        setAnimationMode(AnimationMode::None);
    278278}
    279279
     
    328328    static NeverDestroyed<const AtomicString> sum("sum", AtomicString::ConstructFromLiteral);
    329329    const AtomicString& value = attributeWithoutSynchronization(SVGNames::additiveAttr);
    330     return value == sum || animationMode() == ByAnimation;
     330    return value == sum || animationMode() == AnimationMode::By;
    331331}
    332332
     
    335335    static NeverDestroyed<const AtomicString> sum("sum", AtomicString::ConstructFromLiteral);
    336336    const AtomicString& value = attributeWithoutSynchronization(SVGNames::accumulateAttr);
    337     return value == sum && animationMode() != ToAnimation;
     337    return value == sum && animationMode() != AnimationMode::To;
    338338}
    339339
     
    370370{
    371371    ASSERT(calcMode() == CalcMode::Paced);
    372     ASSERT(animationMode() == ValuesAnimation);
     372    ASSERT(animationMode() == AnimationMode::Values);
    373373
    374374    unsigned valuesCount = m_values.size();
     
    555555        if (!splinesCount
    556556            || (hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) && m_keyPoints.size() - 1 != splinesCount)
    557             || (animationMode == ValuesAnimation && m_values.size() - 1 != splinesCount)
     557            || (animationMode == AnimationMode::Values && m_values.size() - 1 != splinesCount)
    558558            || (hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) && m_keyTimes.size() - 1 != splinesCount))
    559559            return;
     
    563563    String to = toValue();
    564564    String by = byValue();
    565     if (animationMode == NoAnimation)
    566         return;
    567     if ((animationMode == FromToAnimation || animationMode == FromByAnimation || animationMode == ToAnimation || animationMode == ByAnimation)
     565    if (animationMode == AnimationMode::None)
     566        return;
     567    if ((animationMode == AnimationMode::FromTo || animationMode == AnimationMode::FromBy || animationMode == AnimationMode::To || animationMode == AnimationMode::By)
    568568        && (hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) && hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) && (m_keyTimes.size() < 2 || m_keyTimes.size() != m_keyPoints.size())))
    569569        return;
    570     if (animationMode == FromToAnimation)
     570    if (animationMode == AnimationMode::FromTo)
    571571        m_animationValid = calculateFromAndToValues(from, to);
    572     else if (animationMode == ToAnimation) {
     572    else if (animationMode == AnimationMode::To) {
    573573        // For to-animations the from value is the current accumulated value from lower priority animations.
    574574        // The value is not static and is determined during the animation.
    575575        m_animationValid = calculateFromAndToValues(emptyString(), to);
    576     } else if (animationMode == FromByAnimation)
     576    } else if (animationMode == AnimationMode::FromBy)
    577577        m_animationValid = calculateFromAndByValues(from, by);
    578     else if (animationMode == ByAnimation)
     578    else if (animationMode == AnimationMode::By)
    579579        m_animationValid = calculateFromAndByValues(emptyString(), by);
    580     else if (animationMode == ValuesAnimation) {
     580    else if (animationMode == AnimationMode::Values) {
    581581        m_animationValid = m_values.size() >= 1
    582582            && (calcMode == CalcMode::Paced || !hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) || hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size()))
     
    588588        if (calcMode == CalcMode::Paced && m_animationValid)
    589589            calculateKeyTimesForCalcModePaced();
    590     } else if (animationMode == PathAnimation)
     590    } else if (animationMode == AnimationMode::Path)
    591591        m_animationValid = calcMode == CalcMode::Paced || !hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size());
    592592}
     
    600600    CalcMode calcMode = this->calcMode();
    601601    AnimationMode animationMode = this->animationMode();
    602     if (animationMode == ValuesAnimation) {
     602    if (animationMode == AnimationMode::Values) {
    603603        String from;
    604604        String to;
     
    615615    else if (m_keyPoints.isEmpty() && calcMode == CalcMode::Spline && m_keyTimes.size() > 1)
    616616        effectivePercent = calculatePercentForSpline(percent, calculateKeyTimesIndex(percent));
    617     else if (animationMode == FromToAnimation || animationMode == ToAnimation)
     617    else if (animationMode == AnimationMode::FromTo || animationMode == AnimationMode::To)
    618618        effectivePercent = calculatePercentForFromTo(percent);
    619619    else
  • trunk/Source/WebCore/svg/SVGAnimationElement.h

    r234620 r242970  
    3737class TimeContainer;
    3838
    39 enum AnimationMode {
    40     NoAnimation,
    41     FromToAnimation,
    42     FromByAnimation,
    43     ToAnimation,
    44     ByAnimation,
    45     ValuesAnimation,
    46     PathAnimation // Used by AnimateMotion.
     39enum class AnimationMode : uint8_t {
     40    None,
     41    FromTo,
     42    FromBy,
     43    To,
     44    By,
     45    Values,
     46    Path // Used by AnimateMotion.
    4747};
    4848
     
    5151enum AnimatedPropertyValueType { RegularPropertyValue, CurrentColorValue, InheritValue };
    5252
    53 enum class CalcMode { Discrete, Linear, Paced, Spline };
     53enum class CalcMode : uint8_t { Discrete, Linear, Paced, Spline };
    5454
    5555class SVGAnimationElement : public SVGSMILElement, public SVGExternalResourcesRequired, public SVGTests {
     
    106106        if (fromListSize != toListSize && fromListSize) {
    107107            if (percentage < 0.5) {
    108                 if (animationMode() != ToAnimation)
     108                if (animationMode() != AnimationMode::To)
    109109                    animatedList = AnimatedType(fromList);
    110110            } else
     
    123123    template<typename AnimatedType> void animateDiscreteType(float percentage, const AnimatedType& fromType, const AnimatedType& toType, AnimatedType& animatedType)
    124124    {
    125         if ((animationMode() == FromToAnimation && percentage > 0.5) || animationMode() == ToAnimation || percentage == 1) {
     125        if ((animationMode() == AnimationMode::FromTo && percentage > 0.5) || animationMode() == AnimationMode::To || percentage == 1) {
    126126            animatedType = AnimatedType(toType);
    127127            return;
     
    141141            number += toAtEndOfDurationNumber * repeatCount;
    142142
    143         if (isAdditive() && animationMode() != ToAnimation)
     143        if (isAdditive() && animationMode() != AnimationMode::To)
    144144            animatedNumber += number;
    145145        else
     
    221221    bool m_hasInvalidCSSAttributeType { false };
    222222    CalcMode m_calcMode { CalcMode::Linear };
    223     AnimationMode m_animationMode { NoAnimation };
     223    AnimationMode m_animationMode { AnimationMode::None };
    224224    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    225225};
  • trunk/Source/WebCore/svg/SVGSetElement.cpp

    r229694 r242970  
    3232    : SVGAnimateElementBase(tagName, document)
    3333{
    34     setAnimationMode(ToAnimation);
     34    setAnimationMode(AnimationMode::To);
    3535    ASSERT(hasTagName(SVGNames::setTag));
    3636}
     
    4343void SVGSetElement::updateAnimationMode()
    4444{
    45     // No-op, as <set> has a constant animation mode of ToAnimation.
     45    // No-op, as <set> has a constant animation mode of AnimationMode::To.
    4646    // See: http://www.w3.org/TR/SVG/single-page.html#animate-SetElement
    4747}
Note: See TracChangeset for help on using the changeset viewer.