Changeset 256427 in webkit


Ignore:
Timestamp:
Feb 12, 2020 12:39:51 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Fix crash due to uninitialized currentStyle in CSSTransition
https://bugs.webkit.org/show_bug.cgi?id=205959
<rdar://57073673>

Patch by Sunny He <sunny_he@apple.com> on 2020-02-12
Reviewed by Antoine Quint.

Source/WebCore:

Test: legacy-animation-engine/transitions/svg-bad-scale-crash.html

  • animation/CSSTransition.cpp:

(WebCore::CSSTransition::create):
(WebCore::CSSTransition::CSSTransition):

  • animation/CSSTransition.h:

LayoutTests:

Fix crash due to uninitialized currentStyle in CSSTransition

  • legacy-animation-engine/transitions/svg-bad-scale-crash-expected.txt: Added.
  • legacy-animation-engine/transitions/svg-bad-scale-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r256425 r256427  
     12020-02-12  Sunny He  <sunny_he@apple.com>
     2
     3        Fix crash due to uninitialized currentStyle in CSSTransition
     4        https://bugs.webkit.org/show_bug.cgi?id=205959
     5        <rdar://57073673>
     6
     7        Reviewed by Antoine Quint.
     8
     9        Fix crash due to uninitialized currentStyle in CSSTransition
     10
     11        * legacy-animation-engine/transitions/svg-bad-scale-crash-expected.txt: Added.
     12        * legacy-animation-engine/transitions/svg-bad-scale-crash.html: Added.
     13
    1142020-02-11  Tomoki Imai  <Tomoki.Imai@sony.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r256424 r256427  
     12020-02-12  Sunny He  <sunny_he@apple.com>
     2
     3        Fix crash due to uninitialized currentStyle in CSSTransition
     4        https://bugs.webkit.org/show_bug.cgi?id=205959
     5        <rdar://57073673>
     6
     7        Reviewed by Antoine Quint.
     8
     9        Test: legacy-animation-engine/transitions/svg-bad-scale-crash.html
     10
     11        * animation/CSSTransition.cpp:
     12        (WebCore::CSSTransition::create):
     13        (WebCore::CSSTransition::CSSTransition):
     14        * animation/CSSTransition.h:
     15
    1162020-02-11  Peng Liu  <peng.liu6@apple.com>
    217
  • trunk/Source/WebCore/animation/CSSTransition.cpp

    r255396 r256427  
    3939Ref<CSSTransition> CSSTransition::create(Element& owningElement, CSSPropertyID property, MonotonicTime generationTime, const Animation& backingAnimation, const RenderStyle* oldStyle, const RenderStyle& newStyle, Seconds delay, Seconds duration, const RenderStyle& reversingAdjustedStartStyle, double reversingShorteningFactor)
    4040{
    41     auto result = adoptRef(*new CSSTransition(owningElement, property, generationTime, backingAnimation, newStyle, reversingAdjustedStartStyle, reversingShorteningFactor));
     41    ASSERT(oldStyle);
     42    auto result = adoptRef(*new CSSTransition(owningElement, property, generationTime, backingAnimation, *oldStyle, newStyle, reversingAdjustedStartStyle, reversingShorteningFactor));
    4243    result->initialize(oldStyle, newStyle);
    4344    result->setTimingProperties(delay, duration);
     
    4849}
    4950
    50 CSSTransition::CSSTransition(Element& element, CSSPropertyID property, MonotonicTime generationTime, const Animation& backingAnimation, const RenderStyle& targetStyle, const RenderStyle& reversingAdjustedStartStyle, double reversingShorteningFactor)
     51CSSTransition::CSSTransition(Element& element, CSSPropertyID property, MonotonicTime generationTime, const Animation& backingAnimation, const RenderStyle& oldStyle, const RenderStyle& targetStyle, const RenderStyle& reversingAdjustedStartStyle, double reversingShorteningFactor)
    5152    : DeclarativeAnimation(element, backingAnimation)
    5253    , m_property(property)
    5354    , m_generationTime(generationTime)
    5455    , m_targetStyle(RenderStyle::clonePtr(targetStyle))
     56    , m_currentStyle(RenderStyle::clonePtr(oldStyle))
    5557    , m_reversingAdjustedStartStyle(RenderStyle::clonePtr(reversingAdjustedStartStyle))
    5658    , m_reversingShorteningFactor(reversingShorteningFactor)
  • trunk/Source/WebCore/animation/CSSTransition.h

    r243887 r256427  
    5454
    5555private:
    56     CSSTransition(Element&, CSSPropertyID, MonotonicTime generationTime, const Animation&, const RenderStyle& targetStyle, const RenderStyle& reversingAdjustedStartStyle, double);
     56    CSSTransition(Element&, CSSPropertyID, MonotonicTime generationTime, const Animation&, const RenderStyle& oldStyle, const RenderStyle& targetStyle, const RenderStyle& reversingAdjustedStartStyle, double);
    5757    void setTimingProperties(Seconds delay, Seconds duration);
    5858
Note: See TracChangeset for help on using the changeset viewer.