Inspector should support cd(window) in the command line for Firebug parity.
<rdar://problem/6070219>
Created attachment 102113 [details] Patch
Attachment 102113 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/http..." exit_code: 1 Source/WebCore/inspector/InspectorRuntimeAgent.h:57: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Source/WebCore/inspector/InspectorRuntimeAgent.cpp:62: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 102121 [details] Screenshot with the patch applied
Comment on attachment 102113 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=102113&action=review > LayoutTests/http/tests/inspector/console-cd.html:11 > + WebInspector.drawer.immediatelyFinishAnimation(); This is worth a separate InspectorTest.showConsole() function. > Source/WebCore/inspector/Inspector.json:262 > + { "name": "type", "type": "string", "enum": ["frame"], "description": "Type of the context." }, Context id should not be composite (or at least should be opaque to the front-end side). > Source/WebCore/inspector/Inspector.json:275 > + { "name": "context", "$ref": "ContextId", "optional": true, "description": "Specifies in which context to perform evaluation" } Can we use frame id here instead? > Source/WebCore/inspector/front-end/ConsoleView.js:195 > + get _currentEvaluationContextId() We generally don't do private getters. > Source/WebCore/inspector/front-end/ContextManager.js:1 > +/* The name is too generic. JavaScriptWorldManager? How does this correlate with the workers contexts? DebuggerModel?
Created attachment 102136 [details] Patch
(In reply to comment #5) > (From update of attachment 102113 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=102113&action=review > > > LayoutTests/http/tests/inspector/console-cd.html:11 > > + WebInspector.drawer.immediatelyFinishAnimation(); > > This is worth a separate InspectorTest.showConsole() function. > Done. > > Source/WebCore/inspector/Inspector.json:262 > > + { "name": "type", "type": "string", "enum": ["frame"], "description": "Type of the context." }, > > Context id should not be composite (or at least should be opaque to the front-end side). > Replaced with frameId as discussed offline. > > Source/WebCore/inspector/Inspector.json:275 > > + { "name": "context", "$ref": "ContextId", "optional": true, "description": "Specifies in which context to perform evaluation" } > > Can we use frame id here instead? > Done. > > Source/WebCore/inspector/front-end/ConsoleView.js:195 > > + get _currentEvaluationContextId() > > We generally don't do private getters. > Fixed. > > Source/WebCore/inspector/front-end/ContextManager.js:1 > > +/* > > The name is too generic. JavaScriptWorldManager? How does this correlate with the workers contexts? DebuggerModel? Renamed to JavaScriptContextManager.js
Attachment 102136 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/http..." exit_code: 1 Source/WebCore/inspector/InspectorRuntimeAgent.h:57: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Source/WebCore/inspector/InspectorRuntimeAgent.cpp:62: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 18 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 102136 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=102136&action=review > Source/WebCore/inspector/InspectorRuntimeAgent.cpp:66 > + if (!m_pageAgent) { You should implement an abstract method fetching evaluation context instead.
Created attachment 102138 [details] Patch
Comment on attachment 102138 [details] Patch Please add the new file to the vcproj.
Attachment 102138 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/http..." exit_code: 1 Source/WebCore/inspector/InspectorRuntimeAgent.h:56: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Source/WebCore/inspector/InspectorRuntimeAgent.cpp:60: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5] Total errors found: 2 in 18 files If any of these errors are false positives, please file a bug against check-webkit-style.
Committed r91839: <http://trac.webkit.org/changeset/91839>
Why was this bug repurposed? This bug was specifically about supporting the cd(window) command-line API from Firebug.
(In reply to comment #14) > Why was this bug repurposed? This bug was specifically about supporting the cd(window) command-line API from Firebug. I filed a new issue for it: https://bugs.webkit.org/show_bug.cgi?id=65285. Overall, cd(frame) does not sound like a great idea. Imagine several cd() calls within single evaluated expression, especially crossing origin boundaries. So chances are high it will stay open for quite some time.
Thanks for filing the new bug.