Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: Source/WebCore/page/animation/AnimationController.cpp

Issue 6483002: Merge 76708 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/animations/animation-add-events-in-handler-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 void AnimationControllerPrivate::fireEventsAndUpdateStyle() 140 void AnimationControllerPrivate::fireEventsAndUpdateStyle()
141 { 141 {
142 // Protect the frame from getting destroyed in the event handler 142 // Protect the frame from getting destroyed in the event handler
143 RefPtr<Frame> protector = m_frame; 143 RefPtr<Frame> protector = m_frame;
144 144
145 bool updateStyle = !m_eventsToDispatch.isEmpty() || !m_nodeChangesToDispatch .isEmpty(); 145 bool updateStyle = !m_eventsToDispatch.isEmpty() || !m_nodeChangesToDispatch .isEmpty();
146 146
147 // fire all the events 147 // fire all the events
148 Vector<EventToDispatch>::const_iterator eventsToDispatchEnd = m_eventsToDisp atch.end(); 148 Vector<EventToDispatch> eventsToDispatch = m_eventsToDispatch;
149 for (Vector<EventToDispatch>::const_iterator it = m_eventsToDispatch.begin() ; it != eventsToDispatchEnd; ++it) { 149 m_eventsToDispatch.clear();
150 Vector<EventToDispatch>::const_iterator eventsToDispatchEnd = eventsToDispat ch.end();
151 for (Vector<EventToDispatch>::const_iterator it = eventsToDispatch.begin(); it != eventsToDispatchEnd; ++it) {
150 if (it->eventType == eventNames().webkitTransitionEndEvent) 152 if (it->eventType == eventNames().webkitTransitionEndEvent)
151 it->element->dispatchEvent(WebKitTransitionEvent::create(it->eventTy pe, it->name, it->elapsedTime)); 153 it->element->dispatchEvent(WebKitTransitionEvent::create(it->eventTy pe, it->name, it->elapsedTime));
152 else 154 else
153 it->element->dispatchEvent(WebKitAnimationEvent::create(it->eventTyp e, it->name, it->elapsedTime)); 155 it->element->dispatchEvent(WebKitAnimationEvent::create(it->eventTyp e, it->name, it->elapsedTime));
154 } 156 }
155 157
156 m_eventsToDispatch.clear();
157
158 // call setChanged on all the elements 158 // call setChanged on all the elements
159 Vector<RefPtr<Node> >::const_iterator nodeChangesToDispatchEnd = m_nodeChang esToDispatch.end(); 159 Vector<RefPtr<Node> >::const_iterator nodeChangesToDispatchEnd = m_nodeChang esToDispatch.end();
160 for (Vector<RefPtr<Node> >::const_iterator it = m_nodeChangesToDispatch.begi n(); it != nodeChangesToDispatchEnd; ++it) 160 for (Vector<RefPtr<Node> >::const_iterator it = m_nodeChangesToDispatch.begi n(); it != nodeChangesToDispatchEnd; ++it)
161 (*it)->setNeedsStyleRecalc(SyntheticStyleChange); 161 (*it)->setNeedsStyleRecalc(SyntheticStyleChange);
162 162
163 m_nodeChangesToDispatch.clear(); 163 m_nodeChangesToDispatch.clear();
164 164
165 if (updateStyle && m_frame) 165 if (updateStyle && m_frame)
166 m_frame->document()->updateStyleIfNeeded(); 166 m_frame->document()->updateStyleIfNeeded();
167 } 167 }
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 { 606 {
607 #if USE(ACCELERATED_COMPOSITING) 607 #if USE(ACCELERATED_COMPOSITING)
608 return AnimationBase::animationOfPropertyIsAccelerated(property); 608 return AnimationBase::animationOfPropertyIsAccelerated(property);
609 #else 609 #else
610 UNUSED_PARAM(property); 610 UNUSED_PARAM(property);
611 return false; 611 return false;
612 #endif 612 #endif
613 } 613 }
614 614
615 } // namespace WebCore 615 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/animations/animation-add-events-in-handler-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698