Web Inspector: Auto-log inspect node selected elements to the console
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Nov 2015 21:40:21 +0000 (21:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Nov 2015 21:40:21 +0000 (21:40 +0000)
commite300502ba445e6dcd01d1ac4132edbd9835bc95c
tree0ebce1d342ef3c7c7b025d409e2353a789b45535
parente1fb58ba553f7daac0f4798336ebac52682e0659
Web Inspector: Auto-log inspect node selected elements to the console
https://bugs.webkit.org/show_bug.cgi?id=151178

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-11-12
Reviewed by Brian Burg.

Auto-logging user selected elements to the console helps with
quick use in the console. $0 is not very discoverable, and $n
values are expendable. This also makes it convenient to use the
inspect node toolbar search option to select a few different
nodes and use each of them in the console without extra work.

* UserInterface/Controllers/DOMTreeManager.js:
(WebInspector.DOMTreeManager.prototype.inspectNodeObject.nodeAvailable):
(WebInspector.DOMTreeManager.prototype.inspectNodeObject):
Log selected nodes to the console. Treat this as a synthetic log that
will not immediately open the console like normal evaluation results.

* UserInterface/Controllers/JavaScriptLogViewController.js:
(WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
(WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult):
(WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted.printResult):
(WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
Initialize ConsoleCommandResultMessage's synthetic properties.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype._populateContextMenu.logElement):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu):
* UserInterface/Controllers/RuntimeManager.js:
Create a global for the special "console" object group used in multiple places.

* UserInterface/Models/ConsoleCommandResultMessage.js:
(WebInspector.ConsoleCommandResultMessage):
(WebInspector.ConsoleCommandResultMessage.prototype.get synthetic):
Add a synthetic property.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
When the ConsoleResult is a synthetic result, do not auto-open the console.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js
Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js
Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js