Web Inspector: REGRESSION: Elements: "Inspect Element" context menu often doesn't...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Apr 2019 00:30:35 +0000 (00:30 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Apr 2019 00:30:35 +0000 (00:30 +0000)
commit24593f97f2af42844e0f202c49338ce93bcb0b11
treecd1e1698475807ab7381e0345dafec92e429af80
parent015101bffb80978c5d0e574b23094bc4f0b3de33
Web Inspector: REGRESSION: Elements: "Inspect Element" context menu often doesn't select that element
https://bugs.webkit.org/show_bug.cgi?id=197091
<rdar://problem/49953728>

Reviewed by Joseph Pecoraro.

Delay the `inspect` event fron firing with the focued node until the frontend has had a
chance to request the document. Otherwise, requesting the document clears the mapping of
node-to-id, so the focused node's id would no longer be valid.

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorDOMAgent::getDocument):
(WebCore::InspectorDOMAgent::focusNode):
(WebCore::InspectorDOMAgent::didCommitLoad):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/inspector/agents/InspectorDOMAgent.cpp