OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 if (!layoutObject) { | 2035 if (!layoutObject) { |
2036 *errorString = "No layout object for node, perhaps orphan or hidden node
"; | 2036 *errorString = "No layout object for node, perhaps orphan or hidden node
"; |
2037 return; | 2037 return; |
2038 } | 2038 } |
2039 while (layoutObject && !layoutObject->isDocumentElement() && !layoutObject->
isRelayoutBoundaryForInspector()) | 2039 while (layoutObject && !layoutObject->isDocumentElement() && !layoutObject->
isRelayoutBoundaryForInspector()) |
2040 layoutObject = layoutObject->container(); | 2040 layoutObject = layoutObject->container(); |
2041 Node* resultNode = layoutObject ? layoutObject->generatingNode() : node->own
erDocument(); | 2041 Node* resultNode = layoutObject ? layoutObject->generatingNode() : node->own
erDocument(); |
2042 *relayoutBoundaryNodeId = pushNodePathToFrontend(resultNode); | 2042 *relayoutBoundaryNodeId = pushNodePathToFrontend(resultNode); |
2043 } | 2043 } |
2044 | 2044 |
2045 void InspectorDOMAgent::getHighlightObjectForTest(ErrorString* errorString, int
nodeId, RefPtr<JSONObject>* result) | 2045 void InspectorDOMAgent::getHighlightObjectForTest(ErrorString* errorString, int
nodeId, RefPtr<protocol::DictionaryValue>* result) |
2046 { | 2046 { |
2047 Node* node = assertNode(errorString, nodeId); | 2047 Node* node = assertNode(errorString, nodeId); |
2048 if (!node) | 2048 if (!node) |
2049 return; | 2049 return; |
2050 InspectorHighlight highlight(node, InspectorHighlight::defaultConfig(), true
); | 2050 InspectorHighlight highlight(node, InspectorHighlight::defaultConfig(), true
); |
2051 *result = highlight.asJSONObject(); | 2051 *result = highlight.asProtocolValue(); |
2052 } | 2052 } |
2053 | 2053 |
2054 PassOwnPtr<protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node*
node, const String& objectGroup) | 2054 PassOwnPtr<protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node*
node, const String& objectGroup) |
2055 { | 2055 { |
2056 Document* document = node->isDocumentNode() ? &node->document() : node->owne
rDocument(); | 2056 Document* document = node->isDocumentNode() ? &node->document() : node->owne
rDocument(); |
2057 LocalFrame* frame = document ? document->frame() : nullptr; | 2057 LocalFrame* frame = document ? document->frame() : nullptr; |
2058 if (!frame) | 2058 if (!frame) |
2059 return nullptr; | 2059 return nullptr; |
2060 | 2060 |
2061 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 2061 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
(...skipping 26 matching lines...) Expand all Loading... |
2088 visitor->trace(m_document); | 2088 visitor->trace(m_document); |
2089 visitor->trace(m_revalidateTask); | 2089 visitor->trace(m_revalidateTask); |
2090 visitor->trace(m_searchResults); | 2090 visitor->trace(m_searchResults); |
2091 #endif | 2091 #endif |
2092 visitor->trace(m_history); | 2092 visitor->trace(m_history); |
2093 visitor->trace(m_domEditor); | 2093 visitor->trace(m_domEditor); |
2094 InspectorBaseAgent::trace(visitor); | 2094 InspectorBaseAgent::trace(visitor); |
2095 } | 2095 } |
2096 | 2096 |
2097 } // namespace blink | 2097 } // namespace blink |
OLD | NEW |