| Index: Source/core/inspector/InspectorDOMAgent.cpp
|
| diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
|
| index ef5031e94b2cf942e502c76bccbd6d3f22b4b70e..d8e1eed5c2e9b8ac51b1d041d44ec2270140771e 100644
|
| --- a/Source/core/inspector/InspectorDOMAgent.cpp
|
| +++ b/Source/core/inspector/InspectorDOMAgent.cpp
|
| @@ -317,6 +317,7 @@ InspectorDOMAgent::InspectorDOMAgent(InspectorPageAgent* pageAgent, InjectedScri
|
| , m_searchingForNode(NotSearching)
|
| , m_suppressAttributeModifiedEvent(false)
|
| , m_backendNodeIdToInspect(0)
|
| + , m_searchingInLayoutEditorPaused(false)
|
| {
|
| }
|
|
|
| @@ -1127,7 +1128,7 @@ void InspectorDOMAgent::discardSearchResults(ErrorString*, const String& searchI
|
|
|
| bool InspectorDOMAgent::handleMousePress()
|
| {
|
| - if (m_searchingForNode == NotSearching)
|
| + if (m_searchingForNode == NotSearching || (m_searchingForNode == SearchingInLayoutEditor && m_searchingInLayoutEditorPaused))
|
| return false;
|
|
|
| if (m_hoveredNodeForInspectMode) {
|
| @@ -1140,7 +1141,7 @@ bool InspectorDOMAgent::handleMousePress()
|
|
|
| bool InspectorDOMAgent::handleGestureEvent(LocalFrame* frame, const PlatformGestureEvent& event)
|
| {
|
| - if (m_searchingForNode == NotSearching || event.type() != PlatformEvent::GestureTap)
|
| + if (m_searchingForNode == NotSearching || event.type() != PlatformEvent::GestureTap || (m_searchingForNode == SearchingInLayoutEditor && m_searchingInLayoutEditorPaused))
|
| return false;
|
| Node* node = hoveredNodeForEvent(frame, event, false);
|
| if (node && m_inspectModeHighlightConfig) {
|
| @@ -1153,7 +1154,7 @@ bool InspectorDOMAgent::handleGestureEvent(LocalFrame* frame, const PlatformGest
|
|
|
| bool InspectorDOMAgent::handleTouchEvent(LocalFrame* frame, const PlatformTouchEvent& event)
|
| {
|
| - if (m_searchingForNode == NotSearching)
|
| + if (m_searchingForNode == NotSearching || (m_searchingForNode == SearchingInLayoutEditor && m_searchingInLayoutEditorPaused))
|
| return false;
|
| Node* node = hoveredNodeForEvent(frame, event, false);
|
| if (node && m_inspectModeHighlightConfig) {
|
| @@ -1182,11 +1183,16 @@ void InspectorDOMAgent::inspect(Node* inspectedNode)
|
| }
|
|
|
| frontend()->inspectNodeRequested(backendNodeId);
|
| +
|
| + if (m_searchingForNode == SearchingInLayoutEditor) {
|
| + m_searchingInLayoutEditorPaused = true;
|
| + m_overlay->setInspectModeEnabled(false);
|
| + }
|
| }
|
|
|
| bool InspectorDOMAgent::handleMouseMove(LocalFrame* frame, const PlatformMouseEvent& event)
|
| {
|
| - if (m_searchingForNode == NotSearching)
|
| + if (m_searchingForNode == NotSearching || (m_searchingForNode == SearchingInLayoutEditor && m_searchingInLayoutEditorPaused))
|
| return false;
|
|
|
| if (!frame->view() || !frame->contentLayoutObject())
|
| @@ -1265,11 +1271,22 @@ PassOwnPtr<InspectorHighlightConfig> InspectorDOMAgent::highlightConfigFromInspe
|
| return highlightConfig.release();
|
| }
|
|
|
| -void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const bool* inspectUAShadowDOM, const RefPtr<JSONObject>* highlightConfig)
|
| +void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const String* mode, const RefPtr<JSONObject>* highlightConfig)
|
| {
|
| if (enabled && !pushDocumentUponHandlelessOperation(errorString))
|
| return;
|
| - SearchMode searchMode = enabled ? (asBool(inspectUAShadowDOM) ? SearchingForUAShadow : SearchingForNormal) : NotSearching;
|
| + SearchMode searchMode = SearchingForNormal;
|
| + if (!enabled) {
|
| + searchMode = NotSearching;
|
| + } else if (!mode) {
|
| + searchMode = SearchingForNormal;
|
| + } else if (*mode == "showUAShadowDOM") {
|
| + searchMode = SearchingForUAShadow;
|
| + } else if (*mode == "showLayoutEditor") {
|
| + searchMode = SearchingInLayoutEditor;
|
| + m_searchingInLayoutEditorPaused = false;
|
| + }
|
| +
|
| setSearchingForNode(errorString, searchMode, highlightConfig ? highlightConfig->get() : nullptr);
|
| }
|
|
|
| @@ -2221,6 +2238,20 @@ bool InspectorDOMAgent::pushDocumentUponHandlelessOperation(ErrorString* errorSt
|
| return true;
|
| }
|
|
|
| +void InspectorDOMAgent::resumeSearchingForNode(Node* startNode)
|
| +{
|
| + if (m_searchingForNode != SearchingInLayoutEditor)
|
| + return;
|
| +
|
| + m_searchingInLayoutEditorPaused = false;
|
| + m_overlay->setInspectModeEnabled(true);
|
| + if (startNode && m_inspectModeHighlightConfig) {
|
| + m_hoveredNodeForInspectMode = startNode;
|
| + m_overlay->highlightNode(startNode, 0, *m_inspectModeHighlightConfig, false);
|
| + }
|
| +
|
| +}
|
| +
|
| DEFINE_TRACE(InspectorDOMAgent)
|
| {
|
| visitor->trace(m_domListener);
|
|
|