<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[242940] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/242940">242940</a></dd>
<dt>Author</dt> <dd>drousso@apple.com</dd>
<dt>Date</dt> <dd>2019-03-14 02:46:01 -0700 (Thu, 14 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Console: getEventListeners should work for any EventTarget
https://bugs.webkit.org/show_bug.cgi?id=195713

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/console/command-line-api-getEventListeners.html

* dom/EventTarget.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::eventTypes): Added.

* inspector/CommandLineAPIHost.idl:
* inspector/CommandLineAPIHost.h:
(WebCore::CommandLineAPIHost::init):
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::disconnect):
(WebCore::CommandLineAPIHost::getEventListeners):
(WebCore::listenerEntriesFromListenerInfo): Deleted.

* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPIImpl.prototype.getEventListeners):

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:

LayoutTests:

* inspector/console/command-line-api-getEventListeners.html:
* inspector/console/command-line-api-getEventListeners-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectorconsolecommandlineapigetEventListenersexpectedtxt">trunk/LayoutTests/inspector/console/command-line-api-getEventListeners-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorconsolecommandlineapigetEventListenershtml">trunk/LayoutTests/inspector/console/command-line-api-getEventListeners.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomEventTargetcpp">trunk/Source/WebCore/dom/EventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventTargeth">trunk/Source/WebCore/dom/EventTarget.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorCommandLineAPIHostcpp">trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorCommandLineAPIHosth">trunk/Source/WebCore/inspector/CommandLineAPIHost.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorCommandLineAPIHostidl">trunk/Source/WebCore/inspector/CommandLineAPIHost.idl</a></li>
<li><a href="#trunkSourceWebCoreinspectorCommandLineAPIModuleSourcejs">trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllercpp">trunk/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerInspectorControllercpp">trunk/Source/WebCore/inspector/WorkerInspectorController.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsNativeFunctionParametersjs">trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/LayoutTests/ChangeLog 2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2019-03-14  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Console: getEventListeners should work for any EventTarget
+        https://bugs.webkit.org/show_bug.cgi?id=195713
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/console/command-line-api-getEventListeners.html:
+        * inspector/console/command-line-api-getEventListeners-expected.txt:
+
+2019-03-14  Devin Rousso  <drousso@apple.com>
+
</ins><span class="cx">         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195123
</span><span class="cx">         <rdar://problem/48450148>
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorconsolecommandlineapigetEventListenersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/console/command-line-api-getEventListeners-expected.txt (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/command-line-api-getEventListeners-expected.txt      2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/LayoutTests/inspector/console/command-line-api-getEventListeners-expected.txt 2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -2,15 +2,38 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> == Running test suite: Console.CommandLineAPI.getEventListeners
</span><ins>+-- Running test case: Console.CommandLineAPI.getEventListeners.NoArguments
+TypeError: Argument 1 ('target') to CommandLineAPIHost.getEventListeners must be an instance of EventTarget
+
</ins><span class="cx"> -- Running test case: Console.CommandLineAPI.getEventListeners.Undefined
</span><del>-{}
</del><ins>+TypeError: Argument 1 ('target') to CommandLineAPIHost.getEventListeners must be an instance of EventTarget
</ins><span class="cx"> 
</span><span class="cx"> -- Running test case: Console.CommandLineAPI.getEventListeners.Null
</span><del>-{}
</del><ins>+TypeError: Argument 1 ('target') to CommandLineAPIHost.getEventListeners must be an instance of EventTarget
</ins><span class="cx"> 
</span><span class="cx"> -- Running test case: Console.CommandLineAPI.getEventListeners.String
</span><del>-TypeError: Argument 1 ('node') to CommandLineAPIHost.getEventListeners must be an instance of Node
</del><ins>+TypeError: Argument 1 ('target') to CommandLineAPIHost.getEventListeners must be an instance of EventTarget
</ins><span class="cx"> 
</span><ins>+-- Running test case: Console.CommandLineAPI.getEventListeners.window
+{
+  "error": [
+    {
+      "listener": "<function bound >",
+      "once": false,
+      "passive": false,
+      "useCapture": false
+    }
+  ],
+  "load": [
+    {
+      "listener": "<function onload>",
+      "once": false,
+      "passive": false,
+      "useCapture": false
+    }
+  ]
+}
+
</ins><span class="cx"> -- Running test case: Console.CommandLineAPI.getEventListeners.NodeNoListeners
</span><span class="cx"> {}
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorconsolecommandlineapigetEventListenershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/console/command-line-api-getEventListeners.html (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/command-line-api-getEventListeners.html      2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/LayoutTests/inspector/console/command-line-api-getEventListeners.html 2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -43,6 +43,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     addTestCase({
</span><ins>+        name: "Console.CommandLineAPI.getEventListeners.NoArguments",
+        expression: ``,
+    });
+
+    addTestCase({
</ins><span class="cx">         name: "Console.CommandLineAPI.getEventListeners.Undefined",
</span><span class="cx">         expression: `undefined`,
</span><span class="cx">     });
</span><span class="lines">@@ -58,6 +63,11 @@
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     addTestCase({
</span><ins>+        name: "Console.CommandLineAPI.getEventListeners.window",
+        expression: `window`,
+    });
+
+    addTestCase({
</ins><span class="cx">         name: "Console.CommandLineAPI.getEventListeners.NodeNoListeners",
</span><span class="cx">         expression: `document.createElement("p")`,
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/ChangeLog      2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2019-03-14  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Console: getEventListeners should work for any EventTarget
+        https://bugs.webkit.org/show_bug.cgi?id=195713
+
+        Reviewed by Joseph Pecoraro.
+
+        Test: inspector/console/command-line-api-getEventListeners.html
+
+        * dom/EventTarget.h:
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::eventTypes): Added.
+
+        * inspector/CommandLineAPIHost.idl:
+        * inspector/CommandLineAPIHost.h:
+        (WebCore::CommandLineAPIHost::init):
+        * inspector/CommandLineAPIHost.cpp:
+        (WebCore::CommandLineAPIHost::disconnect):
+        (WebCore::CommandLineAPIHost::getEventListeners):
+        (WebCore::listenerEntriesFromListenerInfo): Deleted.
+
+        * inspector/CommandLineAPIModuleSource.js:
+        (CommandLineAPIImpl.prototype.getEventListeners):
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::WorkerInspectorController):
+
+2019-03-14  Devin Rousso  <drousso@apple.com>
+
</ins><span class="cx">         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195123
</span><span class="cx">         <rdar://problem/48450148>
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.cpp (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.cpp 2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/dom/EventTarget.cpp    2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -319,6 +319,13 @@
</span><span class="cx">         InspectorInstrumentation::didDispatchEvent(willDispatchEventCookie);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector<AtomicString> EventTarget::eventTypes()
+{
+    if (auto* data = eventTargetData())
+        return data->eventListenerMap.eventTypes();
+    return { };
+}
+
</ins><span class="cx"> const EventListenerVector& EventTarget::eventListeners(const AtomicString& eventType)
</span><span class="cx"> {
</span><span class="cx">     auto* data = eventTargetData();
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.h (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.h   2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/dom/EventTarget.h      2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -101,6 +101,8 @@
</span><span class="cx">     bool hasEventListeners(const AtomicString& eventType) const;
</span><span class="cx">     bool hasCapturingEventListeners(const AtomicString& eventType);
</span><span class="cx">     bool hasActiveEventListeners(const AtomicString& eventType) const;
</span><ins>+
+    Vector<AtomicString> eventTypes();
</ins><span class="cx">     const EventListenerVector& eventListeners(const AtomicString& eventType);
</span><span class="cx"> 
</span><span class="cx">     enum class EventInvokePhase { Capturing, Bubbling };
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorCommandLineAPIHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp    2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp       2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "Database.h"
</span><span class="cx"> #include "Document.h"
</span><del>-#include "InspectorDOMAgent.h"
</del><ins>+#include "EventTarget.h"
</ins><span class="cx"> #include "InspectorDOMStorageAgent.h"
</span><span class="cx"> #include "InspectorDatabaseAgent.h"
</span><span class="cx"> #include "JSCommandLineAPIHost.h"
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> {
</span><span class="cx">     m_inspectorAgent = nullptr;
</span><span class="cx">     m_consoleAgent = nullptr;
</span><del>-    m_domAgent = nullptr;
</del><span class="cx">     m_domStorageAgent = nullptr;
</span><span class="cx">     m_databaseAgent = nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -89,51 +88,38 @@
</span><span class="cx">     m_inspectorAgent->inspect(WTFMove(remoteObject), WTFMove(hintsObject));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Vector<CommandLineAPIHost::ListenerEntry> listenerEntriesFromListenerInfo(ExecState& state, Document& document, const EventListenerInfo& listenerInfo)
</del><ins>+CommandLineAPIHost::EventListenersRecord CommandLineAPIHost::getEventListeners(ExecState& state, EventTarget& target)
</ins><span class="cx"> {
</span><del>-    VM& vm = state.vm();
</del><ins>+    auto* scriptExecutionContext = target.scriptExecutionContext();
+    if (!scriptExecutionContext)
+        return { };
</ins><span class="cx"> 
</span><del>-    Vector<CommandLineAPIHost::ListenerEntry> entries;
-    for (auto& eventListener : listenerInfo.eventListenerVector) {
-        if (!is<JSEventListener>(eventListener->callback())) {
-            ASSERT_NOT_REACHED();
-            continue;
-        }
</del><ins>+    EventListenersRecord result;
</ins><span class="cx"> 
</span><del>-        auto& jsListener = downcast<JSEventListener>(eventListener->callback());
</del><ins>+    VM& vm = state.vm();
</ins><span class="cx"> 
</span><del>-        // Hide listeners from other contexts.
-        if (&jsListener.isolatedWorld() != &currentWorld(state))
-            continue;
</del><ins>+    for (auto& eventType : target.eventTypes()) {
+        Vector<CommandLineAPIHost::ListenerEntry> entries;
</ins><span class="cx"> 
</span><del>-        auto function = jsListener.jsFunction(document);
-        if (!function)
-            continue;
</del><ins>+        for (auto& eventListener : target.eventListeners(eventType)) {
+            if (!is<JSEventListener>(eventListener->callback()))
+                continue;
</ins><span class="cx"> 
</span><del>-        entries.append({ JSC::Strong<JSC::JSObject>(vm, function), eventListener->useCapture(), eventListener->isPassive(), eventListener->isOnce() });
-    }
</del><ins>+            auto& jsListener = downcast<JSEventListener>(eventListener->callback());
</ins><span class="cx"> 
</span><del>-    return entries;
-}
</del><ins>+            // Hide listeners from other contexts.
+            if (&jsListener.isolatedWorld() != &currentWorld(state))
+                continue;
</ins><span class="cx"> 
</span><del>-auto CommandLineAPIHost::getEventListeners(JSC::ExecState& state, Node* node) -> EventListenersRecord
-{
-    if (!m_domAgent)
-        return { };
</del><ins>+            auto* function = jsListener.jsFunction(*scriptExecutionContext);
+            if (!function)
+                continue;
</ins><span class="cx"> 
</span><del>-    if (!node)
-        return { };
</del><ins>+            entries.append({ Strong<JSObject>(vm, function), eventListener->useCapture(), eventListener->isPassive(), eventListener->isOnce() });
+        }
</ins><span class="cx"> 
</span><del>-    Vector<EventListenerInfo> listenerInfoArray;
-    m_domAgent->getEventListeners(node, listenerInfoArray, false);
-
-    EventListenersRecord result;
-
-    for (auto& listenerInfo : listenerInfoArray) {
-        auto entries = listenerEntriesFromListenerInfo(state, node->document(), listenerInfo);
-        if (entries.isEmpty())
-            continue;
-        result.append({ listenerInfo.eventType, WTFMove(entries) });
</del><ins>+        if (!entries.isEmpty())
+            result.append({ eventType, WTFMove(entries) });
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return result;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorCommandLineAPIHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/CommandLineAPIHost.h (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/CommandLineAPIHost.h      2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/inspector/CommandLineAPIHost.h 2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -46,11 +46,10 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Database;
</span><del>-class InspectorDOMAgent;
</del><ins>+class EventTarget;
</ins><span class="cx"> class InspectorDOMStorageAgent;
</span><span class="cx"> class InspectorDatabaseAgent;
</span><span class="cx"> class JSDOMGlobalObject;
</span><del>-class Node;
</del><span class="cx"> class Storage;
</span><span class="cx"> 
</span><span class="cx"> struct EventListenerInfo;
</span><span class="lines">@@ -62,7 +61,6 @@
</span><span class="cx"> 
</span><span class="cx">     void init(Inspector::InspectorAgent* inspectorAgent
</span><span class="cx">         , Inspector::InspectorConsoleAgent* consoleAgent
</span><del>-        , InspectorDOMAgent* domAgent
</del><span class="cx">         , InspectorDOMStorageAgent* domStorageAgent
</span><span class="cx">         , InspectorDatabaseAgent* databaseAgent
</span><span class="cx">         )
</span><span class="lines">@@ -69,7 +67,6 @@
</span><span class="cx">     {
</span><span class="cx">         m_inspectorAgent = inspectorAgent;
</span><span class="cx">         m_consoleAgent = consoleAgent;
</span><del>-        m_domAgent = domAgent;
</del><span class="cx">         m_domStorageAgent = domStorageAgent;
</span><span class="cx">         m_databaseAgent = databaseAgent;
</span><span class="cx">     }
</span><span class="lines">@@ -97,7 +94,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     using EventListenersRecord = Vector<WTF::KeyValuePair<String, Vector<ListenerEntry>>>;
</span><del>-    EventListenersRecord getEventListeners(JSC::ExecState&, Node*);
</del><ins>+    EventListenersRecord getEventListeners(JSC::ExecState&, EventTarget&);
</ins><span class="cx"> 
</span><span class="cx">     String databaseId(Database&);
</span><span class="cx">     String storageId(Storage&);
</span><span class="lines">@@ -110,7 +107,6 @@
</span><span class="cx"> 
</span><span class="cx">     Inspector::InspectorAgent* m_inspectorAgent { nullptr };
</span><span class="cx">     Inspector::InspectorConsoleAgent* m_consoleAgent { nullptr };
</span><del>-    InspectorDOMAgent* m_domAgent { nullptr };
</del><span class="cx">     InspectorDOMStorageAgent* m_domStorageAgent { nullptr };
</span><span class="cx">     InspectorDatabaseAgent* m_databaseAgent { nullptr };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorCommandLineAPIHostidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/CommandLineAPIHost.idl (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/CommandLineAPIHost.idl    2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/inspector/CommandLineAPIHost.idl       2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     [CallWith=ExecState] void inspect(any objectToInspect, any hints);
</span><span class="cx">     [CallWith=ExecState] any inspectedObject();
</span><span class="cx"> 
</span><del>-    [CallWith=ExecState] record<DOMString, sequence<ListenerEntry>> getEventListeners(Node? node);
</del><ins>+    [CallWith=ExecState] record<DOMString, sequence<ListenerEntry>> getEventListeners(EventTarget target);
</ins><span class="cx"> 
</span><span class="cx">     DOMString databaseId(Database database);
</span><span class="cx">     DOMString storageId(Storage storage);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorCommandLineAPIModuleSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js     2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js        2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -272,12 +272,9 @@
</span><span class="cx">         CommandLineAPIHost.clearConsoleMessages();
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    /**
-     * @param {Node} node
-     */
-    getEventListeners: function(node)
</del><ins>+    getEventListeners: function(target)
</ins><span class="cx">     {
</span><del>-        return CommandLineAPIHost.getEventListeners(node);
</del><ins>+        return CommandLineAPIHost.getEventListeners(target);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _inspectedObject: function()
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp   2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp      2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_injectedScriptManager->commandLineAPIHost());
</span><span class="cx">     if (CommandLineAPIHost* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost())
</span><del>-        commandLineAPIHost->init(m_inspectorAgent, consoleAgent, m_domAgent, domStorageAgent, databaseAgent);
</del><ins>+        commandLineAPIHost->init(m_inspectorAgent, consoleAgent, domStorageAgent, databaseAgent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorController::~InspectorController()
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp     2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">     m_agents.append(WTFMove(heapAgent));
</span><span class="cx"> 
</span><span class="cx">     if (CommandLineAPIHost* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost())
</span><del>-        commandLineAPIHost->init(nullptr, m_instrumentingAgents->webConsoleAgent(), nullptr, nullptr, nullptr);
</del><ins>+        commandLineAPIHost->init(nullptr, m_instrumentingAgents->webConsoleAgent(), nullptr, nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WorkerInspectorController::~WorkerInspectorController()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog    2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebInspectorUI/ChangeLog       2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -1,5 +1,14 @@
</span><span class="cx"> 2019-03-14  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Console: getEventListeners should work for any EventTarget
+        https://bugs.webkit.org/show_bug.cgi?id=195713
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Models/NativeFunctionParameters.js:
+
+2019-03-14  Devin Rousso  <drousso@apple.com>
+
</ins><span class="cx">         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195123
</span><span class="cx">         <rdar://problem/48450148>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsNativeFunctionParametersjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js (242939 => 242940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js     2019-03-14 09:33:24 UTC (rev 242939)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js        2019-03-14 09:46:01 UTC (rev 242940)
</span><span class="lines">@@ -695,7 +695,7 @@
</span><span class="cx">     CommandLineAPIHost: {
</span><span class="cx">         copyText: "text",
</span><span class="cx">         databaseId: "database",
</span><del>-        getEventListeners: "node",
</del><ins>+        getEventListeners: "target",
</ins><span class="cx">         inspect: "objectId, hints",
</span><span class="cx">         storageId: "storage",
</span><span class="cx">         __proto__: null,
</span></span></pre>
</div>
</div>

</body>
</html>