Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 May 2018 20:59:07 +0000 (20:59 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 May 2018 20:59:07 +0000 (20:59 +0000)
commit8be29f1ed33cd2b74273f3665b3ecba26df3cd12
tree7fa28a49e86357409fdfa396b69183f6c1a32b09
parente2940e54e704a966ca04dc7da0f3ed28275bc52a
Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener
https://bugs.webkit.org/show_bug.cgi?id=181580
<rdar://problem/36461309>

Reviewed by Brian Burg.

Source/WebCore:

EventTarget should pass newly added EventListeners to InspectorInstrumentation,
instead of PageDebuggerAgent assuming the last item in the EventListenerVector
is the most recently added listener. This assumption does not hold when
the new listener replaces an existing listener.

* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::setAttributeEventListener):

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didAddEventListenerImpl):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didAddEventListener):

* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didAddEventListener):
* inspector/agents/page/PageDebuggerAgent.h:

LayoutTests:

Add new test covering the case where adding an attribute event listener
causes an existing attribute event listener to be replaced.

* inspector/debugger/async-stack-trace-expected.txt:
* inspector/debugger/async-stack-trace.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/debugger/async-stack-trace-expected.txt
LayoutTests/inspector/debugger/async-stack-trace.html
Source/WebCore/ChangeLog
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
Source/WebCore/inspector/agents/page/PageDebuggerAgent.h