Changeset 219316 in webkit
- Timestamp:
- Jul 10, 2017 5:01:55 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r219315 r219316 1 2017-07-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab 4 https://bugs.webkit.org/show_bug.cgi?id=174279 5 6 Reviewed by Matt Baker. 7 8 * inspector/dom/highlightNodeList-expected.html: Added. 9 * inspector/dom/highlightNodeList.html: Added. 10 1 11 2017-07-10 Javier Fernandez <jfernandez@igalia.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r219301 r219316 1 2017-07-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab 4 https://bugs.webkit.org/show_bug.cgi?id=174279 5 6 Reviewed by Matt Baker. 7 8 * inspector/protocol/DOM.json: 9 Add `highlightNodeList` command that will highlight each node in the given list. 10 1 11 2017-07-03 Brian Burg <bburg@apple.com> 2 12 -
trunk/Source/JavaScriptCore/inspector/protocol/DOM.json
r218898 r219316 378 378 }, 379 379 { 380 "name": "highlightNodeList", 381 "description": "Highlights each DOM node in the given list.", 382 "parameters": [ 383 { "name": "nodeIds", "type": "array", "items": { "$ref": "NodeId" } }, 384 { "name": "highlightConfig", "$ref": "HighlightConfig" } 385 ] 386 }, 387 { 380 388 "name": "hideHighlight", 381 389 "description": "Hides DOM node highlight." -
trunk/Source/WebCore/ChangeLog
r219315 r219316 1 2017-07-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab 4 https://bugs.webkit.org/show_bug.cgi?id=174279 5 6 Reviewed by Matt Baker. 7 8 Test: inspector/dom/highlightNodeList.html 9 10 * inspector/InspectorDOMAgent.h: 11 * inspector/InspectorDOMAgent.cpp: 12 (WebCore::InspectorDOMAgent::highlightNodeList): 13 1 14 2017-07-10 Javier Fernandez <jfernandez@igalia.com> 2 15 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r215160 r219316 86 86 #include "ScriptState.h" 87 87 #include "ShadowRoot.h" 88 #include "StaticNodeList.h" 88 89 #include "StyleProperties.h" 89 90 #include "StyleResolver.h" … … 1145 1146 1146 1147 m_overlay->highlightNode(node, *highlightConfig); 1148 } 1149 1150 void InspectorDOMAgent::highlightNodeList(ErrorString& errorString, const InspectorArray& nodeIds, const InspectorObject& highlightInspectorObject) 1151 { 1152 Vector<Ref<Node>> nodes; 1153 for (auto& nodeValue : nodeIds) { 1154 if (!nodeValue) { 1155 errorString = ASCIILiteral("Invalid nodeIds item."); 1156 return; 1157 } 1158 1159 int nodeId = 0; 1160 if (!nodeValue->asInteger(nodeId)) { 1161 errorString = ASCIILiteral("Invalid nodeIds item type. Expecting integer types."); 1162 return; 1163 } 1164 1165 // In the case that a node is removed in the time between when highlightNodeList is invoked 1166 // by the frontend and it is executed by the backend, we should still attempt to highlight 1167 // as many nodes as possible. As such, we should ignore any errors generated when attempting 1168 // to get a Node from a given nodeId. 1169 ErrorString ignored; 1170 Node* node = assertNode(ignored, nodeId); 1171 if (!node) 1172 continue; 1173 1174 nodes.append(*node); 1175 } 1176 1177 std::unique_ptr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, &highlightInspectorObject); 1178 if (!highlightConfig) 1179 return; 1180 1181 m_overlay->highlightNodeList(StaticNodeList::create(WTFMove(nodes)), *highlightConfig); 1147 1182 } 1148 1183 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.h
r213626 r219316 140 140 void highlightSelector(ErrorString&, const Inspector::InspectorObject& highlightConfig, const String& selectorString, const String* const frameId) override; 141 141 void highlightNode(ErrorString&, const Inspector::InspectorObject& highlightConfig, const int* const nodeId, const String* const objectId) override; 142 void highlightNodeList(ErrorString&, const Inspector::InspectorArray& nodeIds, const Inspector::InspectorObject& highlightConfig) override; 142 143 void highlightFrame(ErrorString&, const String& frameId, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor) override; 143 144 -
trunk/Source/WebInspectorUI/ChangeLog
r219301 r219316 1 2017-07-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab 4 https://bugs.webkit.org/show_bug.cgi?id=174279 5 6 Reviewed by Matt Baker. 7 8 * UserInterface/Controllers/DOMTreeManager.js: 9 (WebInspector.DOMTreeManager.prototype.highlightDOMNodeList): 10 (WebInspector.DOMTreeManager.prototype.highlightSelector): 11 * UserInterface/Views/CanvasTreeElement.js: 12 (WebInspector.CanvasTreeElement.prototype._handleMouseOver): 13 1 14 2017-07-03 Brian Burg <bburg@apple.com> 2 15 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js
r219268 r219316 427 427 } 428 428 429 highlightDOMNodeList(nodeIds, mode) 430 { 431 // COMPATIBILITY (iOS 11): DOM.highlightNodeList did not exist. 432 if (!DOMAgent.highlightNodeList) 433 return; 434 435 if (this._hideDOMNodeHighlightTimeout) { 436 clearTimeout(this._hideDOMNodeHighlightTimeout); 437 this._hideDOMNodeHighlightTimeout = undefined; 438 } 439 440 DOMAgent.highlightNodeList(nodeIds, this._buildHighlightConfig(mode)); 441 } 442 429 443 highlightSelector(selectorText, frameId, mode) 430 444 { … … 432 446 if (!DOMAgent.highlightSelector) 433 447 return; 448 449 if (this._hideDOMNodeHighlightTimeout) { 450 clearTimeout(this._hideDOMNodeHighlightTimeout); 451 this._hideDOMNodeHighlightTimeout = undefined; 452 } 434 453 435 454 DOMAgent.highlightSelector(this._buildHighlightConfig(mode), selectorText, frameId); -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasTreeElement.js
r219214 r219316 66 66 _handleMouseOver(event) 67 67 { 68 this.representedObject.requestNode((node) => { 69 if (!node || !node.ownerDocument) 70 return; 68 if (this.representedObject.cssCanvasName) { 69 this.representedObject.requestCSSCanvasClientNodes((cssCanvasClientNodes) => { 70 WebInspector.domTreeManager.highlightDOMNodeList(cssCanvasClientNodes.map((node) => node.id), "all"); 71 }); 72 } else { 73 this.representedObject.requestNode((node) => { 74 if (!node || !node.ownerDocument) 75 return; 71 76 72 WebInspector.domTreeManager.highlightDOMNode(node.id, "all"); 73 }); 77 WebInspector.domTreeManager.highlightDOMNode(node.id, "all"); 78 }); 79 } 74 80 } 75 81
Note: See TracChangeset
for help on using the changeset viewer.