| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "bindings/core/v8/V8InspectorOverlayHost.h" | 35 #include "bindings/core/v8/V8InspectorOverlayHost.h" |
| 36 #include "core/dom/Node.h" | 36 #include "core/dom/Node.h" |
| 37 #include "core/dom/StaticNodeList.h" | 37 #include "core/dom/StaticNodeList.h" |
| 38 #include "core/dom/TaskRunnerHelper.h" | 38 #include "core/dom/TaskRunnerHelper.h" |
| 39 #include "core/frame/FrameHost.h" | 39 #include "core/frame/FrameHost.h" |
| 40 #include "core/frame/FrameView.h" | 40 #include "core/frame/FrameView.h" |
| 41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 42 #include "core/frame/LocalFrameClient.h" | 42 #include "core/frame/LocalFrameClient.h" |
| 43 #include "core/frame/Settings.h" | 43 #include "core/frame/Settings.h" |
| 44 #include "core/frame/VisualViewport.h" | 44 #include "core/frame/VisualViewport.h" |
| 45 #include "core/html/HTMLFrameOwnerElement.h" |
| 45 #include "core/input/EventHandler.h" | 46 #include "core/input/EventHandler.h" |
| 46 #include "core/inspector/InspectorOverlayHost.h" | 47 #include "core/inspector/InspectorOverlayHost.h" |
| 47 #include "core/layout/api/LayoutViewItem.h" | 48 #include "core/layout/api/LayoutViewItem.h" |
| 48 #include "core/loader/EmptyClients.h" | 49 #include "core/loader/EmptyClients.h" |
| 49 #include "core/loader/FrameLoadRequest.h" | 50 #include "core/loader/FrameLoadRequest.h" |
| 50 #include "core/page/ChromeClient.h" | 51 #include "core/page/ChromeClient.h" |
| 51 #include "core/page/Page.h" | 52 #include "core/page/Page.h" |
| 52 #include "platform/ScriptForbiddenScope.h" | 53 #include "platform/ScriptForbiddenScope.h" |
| 53 #include "platform/graphics/GraphicsContext.h" | 54 #include "platform/graphics/GraphicsContext.h" |
| 54 #include "platform/graphics/paint/CullRect.h" | 55 #include "platform/graphics/paint/CullRect.h" |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 node = &shadowRoot->host(); | 729 node = &shadowRoot->host(); |
| 729 } | 730 } |
| 730 | 731 |
| 731 // Shadow roots don't have boxes - use host element instead. | 732 // Shadow roots don't have boxes - use host element instead. |
| 732 if (node && node->isShadowRoot()) | 733 if (node && node->isShadowRoot()) |
| 733 node = node->parentOrShadowHostNode(); | 734 node = node->parentOrShadowHostNode(); |
| 734 | 735 |
| 735 if (!node) | 736 if (!node) |
| 736 return true; | 737 return true; |
| 737 | 738 |
| 739 if (node->isFrameOwnerElement()) { |
| 740 HTMLFrameOwnerElement* frameOwner = toHTMLFrameOwnerElement(node); |
| 741 if (frameOwner->contentFrame() && |
| 742 !frameOwner->contentFrame()->isLocalFrame()) { |
| 743 // Do not consume event so that remote frame can handle it. |
| 744 hideHighlight(); |
| 745 m_hoveredNodeForInspectMode.clear(); |
| 746 return false; |
| 747 } |
| 748 } |
| 749 |
| 738 Node* eventTarget = (event.modifiers() & WebInputEvent::ShiftKey) | 750 Node* eventTarget = (event.modifiers() & WebInputEvent::ShiftKey) |
| 739 ? hoveredNodeForEvent(frame, event, false) | 751 ? hoveredNodeForEvent(frame, event, false) |
| 740 : nullptr; | 752 : nullptr; |
| 741 if (eventTarget == node) | 753 if (eventTarget == node) |
| 742 eventTarget = nullptr; | 754 eventTarget = nullptr; |
| 743 | 755 |
| 744 if (node && m_inspectModeHighlightConfig) { | 756 if (node && m_inspectModeHighlightConfig) { |
| 745 m_hoveredNodeForInspectMode = node; | 757 m_hoveredNodeForInspectMode = node; |
| 746 if (m_domAgent) | 758 if (m_domAgent) |
| 747 m_domAgent->nodeHighlightedInOverlay(node); | 759 m_domAgent->nodeHighlightedInOverlay(node); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 bool InspectorOverlay::shouldSearchForNode() { | 803 bool InspectorOverlay::shouldSearchForNode() { |
| 792 return m_inspectMode != InspectorDOMAgent::NotSearching; | 804 return m_inspectMode != InspectorDOMAgent::NotSearching; |
| 793 } | 805 } |
| 794 | 806 |
| 795 void InspectorOverlay::inspect(Node* node) { | 807 void InspectorOverlay::inspect(Node* node) { |
| 796 if (m_domAgent) | 808 if (m_domAgent) |
| 797 m_domAgent->inspect(node); | 809 m_domAgent->inspect(node); |
| 798 } | 810 } |
| 799 | 811 |
| 800 } // namespace blink | 812 } // namespace blink |
| OLD | NEW |