Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1775 document().addMutationObserverTypes(registry->at(i)->mutationTypes() ); | 1775 document().addMutationObserverTypes(registry->at(i)->mutationTypes() ); |
| 1776 } | 1776 } |
| 1777 } | 1777 } |
| 1778 | 1778 |
| 1779 if (transientMutationObserverRegistry()) { | 1779 if (transientMutationObserverRegistry()) { |
| 1780 for (MutationObserverRegistration* registration : *transientMutationObse rverRegistry()) | 1780 for (MutationObserverRegistration* registration : *transientMutationObse rverRegistry()) |
| 1781 document().addMutationObserverTypes(registration->mutationTypes()); | 1781 document().addMutationObserverTypes(registration->mutationTypes()); |
| 1782 } | 1782 } |
| 1783 } | 1783 } |
| 1784 | 1784 |
| 1785 bool Node::addEventListenerInternal(const AtomicString& eventType, EventListener * listener, const EventListenerOptions& options) | 1785 bool Node::addEventListenerInternal(const AtomicString& eventType, EventListener * listener, const AddEventListenerOptions& options) |
| 1786 { | 1786 { |
| 1787 if (!EventTarget::addEventListenerInternal(eventType, listener, options)) | 1787 if (!EventTarget::addEventListenerInternal(eventType, listener, options)) |
| 1788 return false; | 1788 return false; |
| 1789 | 1789 |
| 1790 document().addListenerTypeIfNeeded(eventType); | 1790 document().addListenerTypeIfNeeded(eventType); |
| 1791 if (FrameHost* frameHost = document().frameHost()) | 1791 if (FrameHost* frameHost = document().frameHost()) |
| 1792 frameHost->eventHandlerRegistry().didAddEventHandler(*this, eventType, o ptions); | 1792 frameHost->eventHandlerRegistry().didAddEventHandler(*this, eventType, o ptions); |
| 1793 | 1793 |
| 1794 return true; | 1794 return true; |
| 1795 } | 1795 } |
| 1796 | 1796 |
| 1797 bool Node::removeEventListenerInternal(const AtomicString& eventType, EventListe ner* listener, const EventListenerOptions& options) | 1797 void Node::removedEventListener(const AtomicString& eventType, const RegisteredE ventListener& registeredListener) |
|
bokan
2016/04/26 19:54:59
Could you do this for all the other removeEventLis
| |
| 1798 { | 1798 { |
| 1799 if (!EventTarget::removeEventListenerInternal(eventType, listener, options)) | |
| 1800 return false; | |
| 1801 | |
| 1802 // FIXME: Notify Document that the listener has vanished. We need to keep tr ack of a number of | 1799 // FIXME: Notify Document that the listener has vanished. We need to keep tr ack of a number of |
| 1803 // listeners for each type, not just a bool - see https://bugs.webkit.org/sh ow_bug.cgi?id=33861 | 1800 // listeners for each type, not just a bool - see https://bugs.webkit.org/sh ow_bug.cgi?id=33861 |
| 1804 if (FrameHost* frameHost = document().frameHost()) | 1801 if (FrameHost* frameHost = document().frameHost()) |
| 1805 frameHost->eventHandlerRegistry().didRemoveEventHandler(*this, eventType , options); | 1802 frameHost->eventHandlerRegistry().didRemoveEventHandler(*this, eventType , registeredListener.options()); |
| 1806 | |
| 1807 return true; | |
| 1808 } | 1803 } |
| 1809 | 1804 |
| 1810 void Node::removeAllEventListeners() | 1805 void Node::removeAllEventListeners() |
| 1811 { | 1806 { |
| 1812 if (hasEventListeners() && document().frameHost()) | 1807 if (hasEventListeners() && document().frameHost()) |
| 1813 document().frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers (*this); | 1808 document().frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers (*this); |
| 1814 EventTarget::removeAllEventListeners(); | 1809 EventTarget::removeAllEventListeners(); |
| 1815 } | 1810 } |
| 1816 | 1811 |
| 1817 void Node::removeAllEventListenersRecursively() | 1812 void Node::removeAllEventListenersRecursively() |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2332 | 2327 |
| 2333 void showNodePath(const blink::Node* node) | 2328 void showNodePath(const blink::Node* node) |
| 2334 { | 2329 { |
| 2335 if (node) | 2330 if (node) |
| 2336 node->showNodePathForThis(); | 2331 node->showNodePathForThis(); |
| 2337 else | 2332 else |
| 2338 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2333 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2339 } | 2334 } |
| 2340 | 2335 |
| 2341 #endif | 2336 #endif |
| OLD | NEW |