Changeset 190890 in webkit
- Timestamp:
- Oct 12, 2015 2:48:32 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190884 r190890 1 2015-10-12 Antoine Quint <graouts@apple.com> 2 3 [SVG] Handle endEvent for svg animations 4 https://bugs.webkit.org/show_bug.cgi?id=121587 5 6 Reviewed by Dean Jackson. 7 8 Tests for the "endEvent" event for SVG animations. 9 10 * svg/animations/end-event-declarative-expected.svg: Added. 11 * svg/animations/end-event-declarative.svg: Added. 12 * svg/animations/end-event-script-expected.svg: Added. 13 * svg/animations/end-event-script.svg: Added. 14 1 15 2015-10-12 Brady Eidson <beidson@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r190887 r190890 1 2015-10-12 Antoine Quint <graouts@apple.com> 2 3 [SVG] Handle endEvent for svg animations 4 https://bugs.webkit.org/show_bug.cgi?id=121587 5 6 Reviewed by Dean Jackson. 7 8 Add support for the "endEvent" SVG event triggered when an animation completes, as 9 specified in http://www.w3.org/TR/SMIL3/smil-timing.html#q135. This event doesn't 10 bubble and can't be canceled. Added test coverage for the event through the DOM 11 Events API as well as the declarative SMIL Animation syntax. 12 13 Adapted from a Chromium patch by pavan.e@samsung.com 14 https://chromium.googlesource.com/chromium/blink/+/4d415ca0268231aa80e3552fe21bf3480a6978f8 15 16 Tests: svg/animations/end-event-declarative-expected.svg 17 svg/animations/end-event-declarative.svg 18 svg/animations/end-event-script-expected.svg 19 svg/animations/end-event-script.svg 20 21 * svg/animation/SMILTimeContainer.cpp: 22 (WebCore::SMILTimeContainer::updateAnimations): 23 * svg/animation/SVGSMILElement.cpp: 24 (WebCore::smilEndEventSender): 25 (WebCore::SVGSMILElement::~SVGSMILElement): 26 (WebCore::SVGSMILElement::progress): 27 (WebCore::SVGSMILElement::dispatchPendingEvent): 28 * svg/animation/SVGSMILElement.h: 29 (WebCore::SVGSMILElement::hasConditionsConnected): 30 1 31 2015-10-12 Per Arne Vollan <peavo@outlook.com> 2 32 -
trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp
r184852 r190890 265 265 for (auto& it : m_scheduledAnimations) { 266 266 AnimationsVector* scheduled = it.value.get(); 267 for (auto* animation : *scheduled) { 268 if (!animation->hasConditionsConnected()) 269 animation->connectConditions(); 270 } 271 } 272 273 for (auto& it : m_scheduledAnimations) { 274 AnimationsVector* scheduled = it.value.get(); 267 275 268 276 // Sort according to priority. Elements with later begin time have higher priority. -
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
r185813 r190890 31 31 #include "Event.h" 32 32 #include "EventListener.h" 33 #include "EventSender.h" 33 34 #include "FloatConversion.h" 34 35 #include "FrameView.h" … … 46 47 47 48 namespace WebCore { 48 49 50 static SMILEventSender& smilEndEventSender() 51 { 52 static NeverDestroyed<SMILEventSender> sender("endEvent"); 53 return sender; 54 } 55 49 56 // This is used for duration type time values that can't be negative. 50 57 static const double invalidCachedTime = -1.; … … 136 143 { 137 144 clearResourceReferences(); 145 smilEndEventSender().cancelEvent(*this); 138 146 disconnectConditions(); 139 147 if (m_timeContainer && m_targetElement && hasValidAttributeName()) … … 1049 1057 ASSERT(m_isWaitingForFirstInterval || m_intervalBegin.isFinite()); 1050 1058 1051 if (!m_conditionsConnected)1052 connectConditions();1053 1054 1059 if (!m_intervalBegin.isFinite()) { 1055 1060 ASSERT(m_activeState == Inactive); … … 1108 1113 1109 1114 if (oldActiveState == Active && m_activeState != Active) { 1115 smilEndEventSender().dispatchEventSoon(*this); 1110 1116 endedActiveInterval(); 1111 1117 if (m_activeState != Frozen) 1112 1118 clearAnimatedType(m_targetElement); 1119 } 1120 1121 // Triggering all the pending events if the animation timeline is changed. 1122 if (seekToTime) { 1123 if (m_activeState == Inactive || m_activeState == Frozen) 1124 smilEndEventSender().dispatchEventSoon(*this); 1113 1125 } 1114 1126 … … 1188 1200 } 1189 1201 1190 } 1202 void SVGSMILElement::dispatchPendingEvent(SMILEventSender* eventSender) 1203 { 1204 ASSERT(eventSender == &smilEndEventSender()); 1205 const AtomicString& eventType = eventSender->eventType(); 1206 dispatchEvent(Event::create(eventType, false, false)); 1207 } 1208 1209 } -
trunk/Source/WebCore/svg/animation/SVGSMILElement.h
r185813 r190890 34 34 namespace WebCore { 35 35 36 class SVGSMILElement; 37 38 template<typename T> class EventSender; 39 typedef EventSender<SVGSMILElement> SMILEventSender; 40 36 41 class ConditionEventListener; 37 42 class SMILTimeContainer; … … 107 112 virtual void clearAnimatedType(SVGElement* targetElement) = 0; 108 113 virtual void applyResultsToTarget() = 0; 114 115 void connectConditions(); 116 bool hasConditionsConnected() const { return m_conditionsConnected; } 117 118 void dispatchPendingEvent(SMILEventSender*); 109 119 110 120 protected: … … 169 179 Element* eventBaseFor(const Condition&); 170 180 171 void connectConditions();172 181 void disconnectConditions(); 173 182
Note: See TracChangeset
for help on using the changeset viewer.