Index: Source/web/InspectorOverlayImpl.cpp |
diff --git a/Source/web/InspectorOverlayImpl.cpp b/Source/web/InspectorOverlayImpl.cpp |
index 9777463d088968175d71e87378620b460d2275fc..70688ad0732c14e929d50b1c810d07e1d254daae 100644 |
--- a/Source/web/InspectorOverlayImpl.cpp |
+++ b/Source/web/InspectorOverlayImpl.cpp |
@@ -79,6 +79,7 @@ public: |
void resumeUpdates() override { } |
void clear() override { } |
void setLayoutEditor(PassOwnPtrWillBeRawPtr<LayoutEditor>) override { } |
+ void showLayoutEditorForNode(Node*, const InspectorHighlightConfig&) override { }; |
}; |
DEFINE_TRACE(InspectorOverlayStub) |
@@ -270,20 +271,20 @@ void InspectorOverlayImpl::setInspectModeEnabled(bool enabled) |
void InspectorOverlayImpl::hideHighlight() |
{ |
- if (m_layoutEditor) |
- m_layoutEditor->setNode(nullptr); |
m_highlightNode.clear(); |
m_eventTargetNode.clear(); |
m_highlightQuad.clear(); |
- update(); |
+ |
+ if (m_layoutEditor && m_layoutEditor->node()) |
+ highlightNode(m_layoutEditor->node(), 0, m_layoutEditor->highlightConfig(), false); |
+ else |
+ update(); |
} |
void InspectorOverlayImpl::highlightNode(Node* node, Node* eventTarget, const InspectorHighlightConfig& highlightConfig, bool omitTooltip) |
{ |
m_nodeHighlightConfig = highlightConfig; |
m_highlightNode = node; |
- if (m_layoutEditor && highlightConfig.showLayoutEditor) |
- m_layoutEditor->setNode(node); |
m_eventTargetNode = eventTarget; |
m_omitTooltip = omitTooltip; |
update(); |
@@ -363,7 +364,7 @@ void InspectorOverlayImpl::drawNodeHighlight() |
RefPtr<JSONObject> highlightJSON = highlight.asJSONObject(); |
evaluateInOverlay("drawHighlight", highlightJSON.release()); |
- if (m_layoutEditor && m_nodeHighlightConfig.showLayoutEditor) { |
+ if (m_layoutEditor && m_layoutEditor->node() == m_highlightNode) { |
RefPtr<JSONObject> layoutEditorInfo = m_layoutEditor->buildJSONInfo(); |
if (layoutEditorInfo) |
evaluateInOverlay("showLayoutEditor", layoutEditorInfo.release()); |
@@ -539,4 +540,14 @@ void InspectorOverlayImpl::setLayoutEditor(PassOwnPtrWillBeRawPtr<LayoutEditor> |
m_overlayHost->setLayoutEditorListener(m_layoutEditor.get()); |
} |
+void InspectorOverlayImpl::showLayoutEditorForNode(Node* node, const InspectorHighlightConfig& highlightConfig) |
+{ |
+ if (!m_layoutEditor) |
+ return; |
+ |
+ m_layoutEditor->setNode(node); |
+ m_layoutEditor->setHighlightConfig(highlightConfig); |
+} |
+ |
+ |
} // namespace blink |