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

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Rebase Created 4 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
OLDNEW
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 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 } 1816 }
1817 } 1817 }
1818 1818
1819 bool Node::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWil lBeRawPtr<EventListener> listener, const EventListenerOptions& options) 1819 bool Node::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWil lBeRawPtr<EventListener> listener, const EventListenerOptions& options)
1820 { 1820 {
1821 if (!EventTarget::addEventListenerInternal(eventType, listener, options)) 1821 if (!EventTarget::addEventListenerInternal(eventType, listener, options))
1822 return false; 1822 return false;
1823 1823
1824 document().addListenerTypeIfNeeded(eventType); 1824 document().addListenerTypeIfNeeded(eventType);
1825 if (FrameHost* frameHost = document().frameHost()) 1825 if (FrameHost* frameHost = document().frameHost())
1826 frameHost->eventHandlerRegistry().didAddEventHandler(*this, eventType); 1826 frameHost->eventHandlerRegistry().didAddEventHandler(*this, eventType, o ptions);
1827 1827
1828 return true; 1828 return true;
1829 } 1829 }
1830 1830
1831 bool Node::removeEventListenerInternal(const AtomicString& eventType, PassRefPtr WillBeRawPtr<EventListener> listener, const EventListenerOptions& options) 1831 bool Node::removeEventListenerInternal(const AtomicString& eventType, PassRefPtr WillBeRawPtr<EventListener> listener, const EventListenerOptions& options)
1832 { 1832 {
1833 if (!EventTarget::removeEventListenerInternal(eventType, listener, options)) 1833 if (!EventTarget::removeEventListenerInternal(eventType, listener, options))
1834 return false; 1834 return false;
1835 1835
1836 // FIXME: Notify Document that the listener has vanished. We need to keep tr ack of a number of 1836 // FIXME: Notify Document that the listener has vanished. We need to keep tr ack of a number of
1837 // listeners for each type, not just a bool - see https://bugs.webkit.org/sh ow_bug.cgi?id=33861 1837 // listeners for each type, not just a bool - see https://bugs.webkit.org/sh ow_bug.cgi?id=33861
1838 if (FrameHost* frameHost = document().frameHost()) 1838 if (FrameHost* frameHost = document().frameHost())
1839 frameHost->eventHandlerRegistry().didRemoveEventHandler(*this, eventType ); 1839 frameHost->eventHandlerRegistry().didRemoveEventHandler(*this, eventType , options);
1840 1840
1841 return true; 1841 return true;
1842 } 1842 }
1843 1843
1844 void Node::removeAllEventListeners() 1844 void Node::removeAllEventListeners()
1845 { 1845 {
1846 if (hasEventListeners() && document().frameHost()) 1846 if (hasEventListeners() && document().frameHost())
1847 document().frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers (*this); 1847 document().frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers (*this);
1848 EventTarget::removeAllEventListeners(); 1848 EventTarget::removeAllEventListeners();
1849 } 1849 }
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 2425
2426 void showNodePath(const blink::Node* node) 2426 void showNodePath(const blink::Node* node)
2427 { 2427 {
2428 if (node) 2428 if (node)
2429 node->showNodePathForThis(); 2429 node->showNodePathForThis();
2430 else 2430 else
2431 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2431 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2432 } 2432 }
2433 2433
2434 #endif 2434 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698