Reviewed by Adam Barth.
Make fireEventsAndUpdateStyle use stack local vectors.
https://bugs.webkit.org/show_bug.cgi?id=46760
Test: animations/animation-add-events-in-handler.html
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
2011-01-26 Justin Schuh <jschuh@chromium.org>
Reviewed by Adam Barth.
Make fireEventsAndUpdateStyle use stack local vectors.
https://bugs.webkit.org/show_bug.cgi?id=46760
* animations/animation-add-events-in-handler-expected.txt: Added.
* animations/animation-add-events-in-handler.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76708
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-01-26 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Make fireEventsAndUpdateStyle use stack local vectors.
+ https://bugs.webkit.org/show_bug.cgi?id=46760
+
+ * animations/animation-add-events-in-handler-expected.txt: Added.
+ * animations/animation-add-events-in-handler.html: Added.
+
2011-01-26 Tony Chang <tony@chromium.org>
Unreviewed, marking fast/overflow/overflow-rtl-vertical.html as
--- /dev/null
+PASS: Adding animation events in the handler did not crash.
--- /dev/null
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function touchElement(evt) {
+ getComputedStyle(evt.srcElement.firstElementChild)['-webkit-animation-duration'];
+ evt.srcElement.firstElementChild.style.display = 'block';
+ total++;
+ if (total == 500) {
+ document.getElementById("results").innerHTML = "PASS: Adding animation events in the handler did not crash.";
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+window.onload = function() {
+ total = 0;
+ var padding = document.getElementsByClassName("padding");
+ for (var i = 0; i < padding.length; i++)
+ padding[i].addEventListener('webkitAnimationIteration', touchElement, false, false);
+};
+</script>
+<style>
+@-webkit-keyframes keyframes {
+ from { }
+}
+
+.crash {
+ -webkit-animation-name: keyframes;
+}
+
+.padding {
+ -webkit-animation-name: keyframes;
+ -webkit-animation-iteration-count: infinite;
+ -webkit-animation-duration: 0.001;
+}
+</style>
+<div id="results">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<div class="padding">
+<img class="crash">
+2011-01-26 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Make fireEventsAndUpdateStyle use stack local vectors.
+ https://bugs.webkit.org/show_bug.cgi?id=46760
+
+ Test: animations/animation-add-events-in-handler.html
+
+ * page/animation/AnimationController.cpp:
+ (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
+
2011-01-26 Nate Chapin <japhet@chromium.org>
Reviewed by Adam Barth.
bool updateStyle = !m_eventsToDispatch.isEmpty() || !m_nodeChangesToDispatch.isEmpty();
// fire all the events
- Vector<EventToDispatch>::const_iterator eventsToDispatchEnd = m_eventsToDispatch.end();
- for (Vector<EventToDispatch>::const_iterator it = m_eventsToDispatch.begin(); it != eventsToDispatchEnd; ++it) {
+ Vector<EventToDispatch> eventsToDispatch = m_eventsToDispatch;
+ m_eventsToDispatch.clear();
+ Vector<EventToDispatch>::const_iterator eventsToDispatchEnd = eventsToDispatch.end();
+ for (Vector<EventToDispatch>::const_iterator it = eventsToDispatch.begin(); it != eventsToDispatchEnd; ++it) {
if (it->eventType == eventNames().webkitTransitionEndEvent)
it->element->dispatchEvent(WebKitTransitionEvent::create(it->eventType, it->name, it->elapsedTime));
else
it->element->dispatchEvent(WebKitAnimationEvent::create(it->eventType, it->name, it->elapsedTime));
}
- m_eventsToDispatch.clear();
-
// call setChanged on all the elements
Vector<RefPtr<Node> >::const_iterator nodeChangesToDispatchEnd = m_nodeChangesToDispatch.end();
for (Vector<RefPtr<Node> >::const_iterator it = m_nodeChangesToDispatch.begin(); it != nodeChangesToDispatchEnd; ++it)