Clip-path transitions sometimes trigger endless animation timers
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Oct 2015 19:15:28 +0000 (19:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Oct 2015 19:15:28 +0000 (19:15 +0000)
commit33b29da72ccac7983770895482e00fffecc62eff
tree44bf2b00f30e76bd051c95333a7a5daa906b40ee
parent03956a97ae7c1a75f8432a94beb46b68f0862274
Clip-path transitions sometimes trigger endless animation timers
https://bugs.webkit.org/show_bug.cgi?id=150018

Reviewed by Tim Horton.

Source/WebCore:

Transitioning -webkit-clip-path could trigger endless animation
timers, because when CompositeAnimation::updateTransitions() calls
isTargetPropertyEqual(), a false negative answer triggers canceling the
current transition and starting a new one over and over.

This happened because StyleRareNonInheritedData simply tested pointer
equality for m_clipPath and m_shapeOutside. Both of these need to do deep
equality testing, requiring the implementation of operator== in BasicShapes
classes.

In addition, the PropertyWrappers in CSSPropertyAnimation need equals()
implementations that also do more than pointer equality testing.

Tests: transitions/clip-path-transitions.html
       transitions/shape-outside-transitions.html

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperClipPath::equals):
(WebCore::PropertyWrapperShape::equals):
* rendering/ClipPathOperation.h:
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapeCircle::operator==):
(WebCore::BasicShapeEllipse::operator==):
(WebCore::BasicShapePolygon::operator==):
(WebCore::BasicShapeInset::operator==):
* rendering/style/BasicShapes.h:
(WebCore::BasicShapeCenterCoordinate::operator==):
(WebCore::BasicShapeRadius::operator==):
* rendering/style/ShapeValue.cpp:
(WebCore::pointersOrValuesEqual):
(WebCore::ShapeValue::operator==):
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::operator!=):
(WebCore::ShapeValue::operator==): Deleted.
(WebCore::ShapeValue::ShapeValue): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::clipPathOperationsEquivalent):
(WebCore::StyleRareNonInheritedData::shapeOutsideDataEquivalent):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

New tests for transitions of clip-path and shape-outside.

* transitions/clip-path-transitions-expected.txt: Added.
* transitions/clip-path-transitions.html: Added.
* transitions/resources/transition-test-helpers.js:
(parseClipPath):
(checkExpectedValue):
* transitions/shape-outside-transitions-expected.txt: Added.
* transitions/shape-outside-transitions.html: Added.
* transitions/svg-transitions-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/transitions/clip-path-transitions-expected.txt [new file with mode: 0644]
LayoutTests/transitions/clip-path-transitions.html [new file with mode: 0644]
LayoutTests/transitions/resources/transition-test-helpers.js
LayoutTests/transitions/shape-outside-transitions-expected.txt [new file with mode: 0644]
LayoutTests/transitions/shape-outside-transitions.html [new file with mode: 0644]
LayoutTests/transitions/svg-transitions-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/rendering/ClipPathOperation.h
Source/WebCore/rendering/style/BasicShapes.cpp
Source/WebCore/rendering/style/BasicShapes.h
Source/WebCore/rendering/style/ShapeValue.cpp
Source/WebCore/rendering/style/ShapeValue.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h