|
Lines 96-102
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec1
|
| 96 |
#include <inspector/InjectedScriptManager.h> |
96 |
#include <inspector/InjectedScriptManager.h> |
| 97 |
#include <runtime/JSCInlines.h> |
97 |
#include <runtime/JSCInlines.h> |
| 98 |
#include <wtf/HashSet.h> |
98 |
#include <wtf/HashSet.h> |
| 99 |
#include <wtf/OwnPtr.h> |
|
|
| 100 |
#include <wtf/Vector.h> |
99 |
#include <wtf/Vector.h> |
| 101 |
#include <wtf/text/CString.h> |
100 |
#include <wtf/text/CString.h> |
| 102 |
#include <wtf/text/WTFString.h> |
101 |
#include <wtf/text/WTFString.h> |
|
Lines 236-243
void InspectorDOMAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontend
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec2
|
| 236 |
m_frontendDispatcher = std::make_unique<InspectorDOMFrontendDispatcher>(frontendChannel); |
235 |
m_frontendDispatcher = std::make_unique<InspectorDOMFrontendDispatcher>(frontendChannel); |
| 237 |
m_backendDispatcher = InspectorDOMBackendDispatcher::create(backendDispatcher, this); |
236 |
m_backendDispatcher = InspectorDOMBackendDispatcher::create(backendDispatcher, this); |
| 238 |
|
237 |
|
| 239 |
m_history = adoptPtr(new InspectorHistory()); |
238 |
m_history = std::make_unique<InspectorHistory>(); |
| 240 |
m_domEditor = adoptPtr(new DOMEditor(m_history.get())); |
239 |
m_domEditor = std::make_unique<DOMEditor>(m_history.get()); |
| 241 |
|
240 |
|
| 242 |
m_instrumentingAgents->setInspectorDOMAgent(this); |
241 |
m_instrumentingAgents->setInspectorDOMAgent(this); |
| 243 |
m_document = m_pageAgent->mainFrame()->document(); |
242 |
m_document = m_pageAgent->mainFrame()->document(); |
|
Lines 251-258
void InspectorDOMAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason)
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec3
|
| 251 |
m_frontendDispatcher = nullptr; |
250 |
m_frontendDispatcher = nullptr; |
| 252 |
m_backendDispatcher.clear(); |
251 |
m_backendDispatcher.clear(); |
| 253 |
|
252 |
|
| 254 |
m_history.clear(); |
253 |
m_history.reset(); |
| 255 |
m_domEditor.clear(); |
254 |
m_domEditor.reset(); |
| 256 |
|
255 |
|
| 257 |
ErrorString error; |
256 |
ErrorString error; |
| 258 |
setSearchingForNode(&error, false, 0); |
257 |
setSearchingForNode(&error, false, 0); |
|
Lines 584-590
int InspectorDOMAgent::pushNodePathToFrontend(Node* nodeToPush)
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec4
|
| 584 |
Node* parent = innerParentNode(node); |
583 |
Node* parent = innerParentNode(node); |
| 585 |
if (!parent) { |
584 |
if (!parent) { |
| 586 |
// Node being pushed is detached -> push subtree root. |
585 |
// Node being pushed is detached -> push subtree root. |
| 587 |
OwnPtr<NodeToIdMap> newMap = adoptPtr(new NodeToIdMap); |
586 |
auto newMap = std::make_unique<NodeToIdMap>(); |
| 588 |
danglingMap = newMap.get(); |
587 |
danglingMap = newMap.get(); |
| 589 |
m_danglingNodeToIdMaps.append(newMap.release()); |
588 |
m_danglingNodeToIdMaps.append(newMap.release()); |
| 590 |
RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>> children = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>::create(); |
589 |
RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>> children = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>::create(); |
|
Lines 1032-1045
void InspectorDOMAgent::setSearchingForNode(ErrorString* errorString, bool enabl
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec5
|
| 1032 |
m_overlay->didSetSearchingForNode(m_searchingForNode); |
1031 |
m_overlay->didSetSearchingForNode(m_searchingForNode); |
| 1033 |
} |
1032 |
} |
| 1034 |
|
1033 |
|
| 1035 |
PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject) |
1034 |
std::unique_ptr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject) |
| 1036 |
{ |
1035 |
{ |
| 1037 |
if (!highlightInspectorObject) { |
1036 |
if (!highlightInspectorObject) { |
| 1038 |
*errorString = "Internal error: highlight configuration parameter is missing"; |
1037 |
*errorString = "Internal error: highlight configuration parameter is missing"; |
| 1039 |
return nullptr; |
1038 |
return nullptr; |
| 1040 |
} |
1039 |
} |
| 1041 |
|
1040 |
|
| 1042 |
OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig()); |
1041 |
auto highlightConfig = std::make_unique<HighlightConfig>(); |
| 1043 |
bool showInfo = false; // Default: false (do not show a tooltip). |
1042 |
bool showInfo = false; // Default: false (do not show a tooltip). |
| 1044 |
highlightInspectorObject->getBoolean("showInfo", &showInfo); |
1043 |
highlightInspectorObject->getBoolean("showInfo", &showInfo); |
| 1045 |
highlightConfig->showInfo = showInfo; |
1044 |
highlightConfig->showInfo = showInfo; |
|
Lines 1051-1057
PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObjec
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec6
|
| 1051 |
highlightConfig->padding = parseConfigColor("paddingColor", highlightInspectorObject); |
1050 |
highlightConfig->padding = parseConfigColor("paddingColor", highlightInspectorObject); |
| 1052 |
highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject); |
1051 |
highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject); |
| 1053 |
highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject); |
1052 |
highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject); |
| 1054 |
return highlightConfig.release(); |
1053 |
return highlightConfig; |
| 1055 |
} |
1054 |
} |
| 1056 |
|
1055 |
|
| 1057 |
void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const RefPtr<InspectorObject>* highlightConfig) |
1056 |
void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool enabled, const RefPtr<InspectorObject>* highlightConfig) |
|
Lines 1061-1087
void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool ena
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec7
|
| 1061 |
|
1060 |
|
| 1062 |
void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) |
1061 |
void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) |
| 1063 |
{ |
1062 |
{ |
| 1064 |
OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad(FloatRect(x, y, width, height))); |
1063 |
auto quad = std::make_unique<FloatQuad>(FloatRect(x, y, width, height)); |
| 1065 |
innerHighlightQuad(quad.release(), color, outlineColor, usePageCoordinates); |
1064 |
innerHighlightQuad(std::move(quad), color, outlineColor, usePageCoordinates); |
| 1066 |
} |
1065 |
} |
| 1067 |
|
1066 |
|
| 1068 |
void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<InspectorArray>& quadArray, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) |
1067 |
void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<InspectorArray>& quadArray, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) |
| 1069 |
{ |
1068 |
{ |
| 1070 |
OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad()); |
1069 |
auto quad = std::make_unique<FloatQuad>(); |
| 1071 |
if (!parseQuad(quadArray, quad.get())) { |
1070 |
if (!parseQuad(quadArray, quad.get())) { |
| 1072 |
*errorString = "Invalid Quad format"; |
1071 |
*errorString = "Invalid Quad format"; |
| 1073 |
return; |
1072 |
return; |
| 1074 |
} |
1073 |
} |
| 1075 |
innerHighlightQuad(quad.release(), color, outlineColor, usePageCoordinates); |
1074 |
innerHighlightQuad(std::move(quad), color, outlineColor, usePageCoordinates); |
| 1076 |
} |
1075 |
} |
| 1077 |
|
1076 |
|
| 1078 |
void InspectorDOMAgent::innerHighlightQuad(PassOwnPtr<FloatQuad> quad, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) |
1077 |
void InspectorDOMAgent::innerHighlightQuad(std::unique_ptr<FloatQuad> quad, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor, const bool* usePageCoordinates) |
| 1079 |
{ |
1078 |
{ |
| 1080 |
OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig()); |
1079 |
auto highlightConfig = std::make_unique<HighlightConfig>(); |
| 1081 |
highlightConfig->content = parseColor(color); |
1080 |
highlightConfig->content = parseColor(color); |
| 1082 |
highlightConfig->contentOutline = parseColor(outlineColor); |
1081 |
highlightConfig->contentOutline = parseColor(outlineColor); |
| 1083 |
highlightConfig->usePageCoordinates = usePageCoordinates ? *usePageCoordinates : false; |
1082 |
highlightConfig->usePageCoordinates = usePageCoordinates ? *usePageCoordinates : false; |
| 1084 |
m_overlay->highlightQuad(quad, *highlightConfig); |
1083 |
m_overlay->highlightQuad(std::move(quad), *highlightConfig); |
| 1085 |
} |
1084 |
} |
| 1086 |
|
1085 |
|
| 1087 |
void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<InspectorObject>& highlightInspectorObject, const int* nodeId, const String* objectId) |
1086 |
void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<InspectorObject>& highlightInspectorObject, const int* nodeId, const String* objectId) |
|
Lines 1099-1105
void InspectorDOMAgent::highlightNode(ErrorString* errorString, const RefPtr<Ins
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec8
|
| 1099 |
if (!node) |
1098 |
if (!node) |
| 1100 |
return; |
1099 |
return; |
| 1101 |
|
1100 |
|
| 1102 |
OwnPtr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get()); |
1101 |
std::unique_ptr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get()); |
| 1103 |
if (!highlightConfig) |
1102 |
if (!highlightConfig) |
| 1104 |
return; |
1103 |
return; |
| 1105 |
|
1104 |
|
|
Lines 1114-1120
void InspectorDOMAgent::highlightFrame(
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec9
|
| 1114 |
{ |
1113 |
{ |
| 1115 |
Frame* frame = m_pageAgent->frameForId(frameId); |
1114 |
Frame* frame = m_pageAgent->frameForId(frameId); |
| 1116 |
if (frame && frame->ownerElement()) { |
1115 |
if (frame && frame->ownerElement()) { |
| 1117 |
OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig()); |
1116 |
auto highlightConfig = std::make_unique<HighlightConfig>(); |
| 1118 |
highlightConfig->showInfo = true; // Always show tooltips for frames. |
1117 |
highlightConfig->showInfo = true; // Always show tooltips for frames. |
| 1119 |
highlightConfig->content = parseColor(color); |
1118 |
highlightConfig->content = parseColor(color); |
| 1120 |
highlightConfig->contentOutline = parseColor(outlineColor); |
1119 |
highlightConfig->contentOutline = parseColor(outlineColor); |
|
Lines 1642-1648
void InspectorDOMAgent::didInvalidateStyleAttr(Node* node)
a/Source/WebCore/inspector/InspectorDOMAgent.cpp_sec10
|
| 1642 |
return; |
1641 |
return; |
| 1643 |
|
1642 |
|
| 1644 |
if (!m_revalidateStyleAttrTask) |
1643 |
if (!m_revalidateStyleAttrTask) |
| 1645 |
m_revalidateStyleAttrTask = adoptPtr(new RevalidateStyleAttributeTask(this)); |
1644 |
m_revalidateStyleAttrTask = std::make_unique<RevalidateStyleAttributeTask>(this); |
| 1646 |
m_revalidateStyleAttrTask->scheduleFor(toElement(node)); |
1645 |
m_revalidateStyleAttrTask->scheduleFor(toElement(node)); |
| 1647 |
} |
1646 |
} |
| 1648 |
|
1647 |
|