| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 Vector<RefPtr<Event> > events; | 103 Vector<RefPtr<Event> > events; |
| 104 events.swap(m_eventQueue); | 104 events.swap(m_eventQueue); |
| 105 m_perFrameEvents.clear(); | 105 m_perFrameEvents.clear(); |
| 106 | 106 |
| 107 for (size_t i = 0; i < events.size(); ++i) { | 107 for (size_t i = 0; i < events.size(); ++i) { |
| 108 EventTarget* eventTarget = events[i]->target(); | 108 EventTarget* eventTarget = events[i]->target(); |
| 109 // FIXME: we should figure out how to make dispatchEvent properly virtua
l to avoid | 109 // FIXME: we should figure out how to make dispatchEvent properly virtua
l to avoid |
| 110 // special casting window. | 110 // special casting window. |
| 111 // FIXME: We should not fire events for nodes that are no longer in the
tree. | 111 // FIXME: We should not fire events for nodes that are no longer in the
tree. |
| 112 if (DOMWindow* window = eventTarget->toDOMWindow()) | 112 if (DOMWindow* window = eventTarget->toDOMWindow()) |
| 113 window->dispatchEvent(events[i], 0); | 113 window->dispatchEvent(events[i], nullptr); |
| 114 else | 114 else |
| 115 eventTarget->dispatchEvent(events[i]); | 115 eventTarget->dispatchEvent(events[i]); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 void ScriptedAnimationController::executeCallbacks(double monotonicTimeNow) | 119 void ScriptedAnimationController::executeCallbacks(double monotonicTimeNow) |
| 120 { | 120 { |
| 121 // dispatchEvents() runs script which can cause the document to be destroyed
. | 121 // dispatchEvents() runs script which can cause the document to be destroyed
. |
| 122 if (!m_document) | 122 if (!m_document) |
| 123 return; | 123 return; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 return; | 183 return; |
| 184 | 184 |
| 185 if (!m_callbacks.size() && !m_eventQueue.size()) | 185 if (!m_callbacks.size() && !m_eventQueue.size()) |
| 186 return; | 186 return; |
| 187 | 187 |
| 188 if (FrameView* frameView = m_document->view()) | 188 if (FrameView* frameView = m_document->view()) |
| 189 frameView->scheduleAnimation(); | 189 frameView->scheduleAnimation(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } | 192 } |
| OLD | NEW |