Title: [244476] trunk/Source/WebCore
- Revision
- 244476
- Author
- [email protected]
- Date
- 2019-04-19 17:30:35 -0700 (Fri, 19 Apr 2019)
Log Message
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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (244475 => 244476)
--- trunk/Source/WebCore/ChangeLog 2019-04-20 00:00:26 UTC (rev 244475)
+++ trunk/Source/WebCore/ChangeLog 2019-04-20 00:30:35 UTC (rev 244476)
@@ -1,3 +1,22 @@
+2019-04-19 Devin Rousso <[email protected]>
+
+ 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):
+
2019-04-19 John Wilander <[email protected]>
Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
Modified: trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp (244475 => 244476)
--- trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp 2019-04-20 00:00:26 UTC (rev 244475)
+++ trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp 2019-04-20 00:30:35 UTC (rev 244476)
@@ -313,9 +313,6 @@
for (auto* mediaElement : HTMLMediaElement::allMediaElements())
addEventListenersToNode(*mediaElement);
#endif
-
- if (m_nodeToFocus)
- focusNode();
}
void InspectorDOMAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
@@ -322,7 +319,9 @@
{
m_history.reset();
m_domEditor.reset();
+ m_nodeToFocus = nullptr;
m_mousedOverNode = nullptr;
+ m_inspectedNode = nullptr;
ErrorString unused;
setSearchingForNode(unused, false, nullptr);
@@ -507,6 +506,9 @@
m_document = document;
root = buildObjectForNode(m_document.get(), 2, &m_documentNodeToIdMap);
+
+ if (m_nodeToFocus)
+ focusNode();
}
void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId, int depth)
@@ -1105,7 +1107,7 @@
void InspectorDOMAgent::focusNode()
{
- if (!m_frontendDispatcher)
+ if (!m_documentRequested)
return;
ASSERT(m_nodeToFocus);
@@ -2136,6 +2138,15 @@
void InspectorDOMAgent::didCommitLoad(Document* document)
{
+ if (m_nodeToFocus && &m_nodeToFocus->document() == document)
+ m_nodeToFocus = nullptr;
+
+ if (m_mousedOverNode && &m_mousedOverNode->document() == document)
+ m_mousedOverNode = nullptr;
+
+ if (m_inspectedNode && &m_inspectedNode->document() == document)
+ m_inspectedNode = nullptr;
+
RefPtr<Element> frameOwner = document->ownerElement();
if (!frameOwner)
return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes