| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 * | 23 * |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/dom/ScriptedAnimationController.h" | 27 #include "core/dom/ScriptedAnimationController.h" |
| 28 | 28 |
| 29 #include "core/dom/Document.h" | 29 #include "core/dom/Document.h" |
| 30 #include "core/dom/RequestAnimationFrameCallback.h" | 30 #include "core/dom/RequestAnimationFrameCallback.h" |
| 31 #include "core/events/Event.h" | 31 #include "core/events/Event.h" |
| 32 #include "core/frame/DOMWindow.h" | 32 #include "core/frame/LocalDOMWindow.h" |
| 33 #include "core/frame/FrameView.h" | 33 #include "core/frame/FrameView.h" |
| 34 #include "core/inspector/InspectorInstrumentation.h" | 34 #include "core/inspector/InspectorInstrumentation.h" |
| 35 #include "core/inspector/InspectorTraceEvents.h" | 35 #include "core/inspector/InspectorTraceEvents.h" |
| 36 #include "core/loader/DocumentLoader.h" | 36 #include "core/loader/DocumentLoader.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 std::pair<EventTarget*, StringImpl*> eventTargetKey(const Event* event) | 40 std::pair<EventTarget*, StringImpl*> eventTargetKey(const Event* event) |
| 41 { | 41 { |
| 42 return std::make_pair(event->target(), event->type().impl()); | 42 return std::make_pair(event->target(), event->type().impl()); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 { | 121 { |
| 122 WillBeHeapVector<RefPtrWillBeMember<Event> > events; | 122 WillBeHeapVector<RefPtrWillBeMember<Event> > events; |
| 123 events.swap(m_eventQueue); | 123 events.swap(m_eventQueue); |
| 124 m_perFrameEvents.clear(); | 124 m_perFrameEvents.clear(); |
| 125 | 125 |
| 126 for (size_t i = 0; i < events.size(); ++i) { | 126 for (size_t i = 0; i < events.size(); ++i) { |
| 127 EventTarget* eventTarget = events[i]->target(); | 127 EventTarget* eventTarget = events[i]->target(); |
| 128 // FIXME: we should figure out how to make dispatchEvent properly virtua
l to avoid | 128 // FIXME: we should figure out how to make dispatchEvent properly virtua
l to avoid |
| 129 // special casting window. | 129 // special casting window. |
| 130 // FIXME: We should not fire events for nodes that are no longer in the
tree. | 130 // FIXME: We should not fire events for nodes that are no longer in the
tree. |
| 131 if (DOMWindow* window = eventTarget->toDOMWindow()) | 131 if (LocalDOMWindow* window = eventTarget->toDOMWindow()) |
| 132 window->dispatchEvent(events[i], nullptr); | 132 window->dispatchEvent(events[i], nullptr); |
| 133 else | 133 else |
| 134 eventTarget->dispatchEvent(events[i]); | 134 eventTarget->dispatchEvent(events[i]); |
| 135 | 135 |
| 136 InspectorInstrumentation::didRemoveEvent(eventTarget, events[i].get()); | 136 InspectorInstrumentation::didRemoveEvent(eventTarget, events[i].get()); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 void ScriptedAnimationController::executeCallbacks(double monotonicTimeNow) | 140 void ScriptedAnimationController::executeCallbacks(double monotonicTimeNow) |
| 141 { | 141 { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return; | 208 return; |
| 209 | 209 |
| 210 if (!m_callbacks.size() && !m_eventQueue.size()) | 210 if (!m_callbacks.size() && !m_eventQueue.size()) |
| 211 return; | 211 return; |
| 212 | 212 |
| 213 if (FrameView* frameView = m_document->view()) | 213 if (FrameView* frameView = m_document->view()) |
| 214 frameView->scheduleAnimation(); | 214 frameView->scheduleAnimation(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } | 217 } |
| OLD | NEW |