| Summary: | Web Inspector: Command-Enter should evaluate selected JS in Debugger/Sources | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> | ||||
| Component: | Web Inspector | Assignee: | Nikita Vasilyev <nvasilyev> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Local Build | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Nikita Vasilyev
2015-08-22 20:27:18 PDT
Created attachment 259942 [details]
Patch
Comment on attachment 259942 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259942&action=review > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:730 > + if (modeName !== "javascript" && modeName !== "htmlmixed") I think there is a way to get the inner mode for the selection, that way we know if it is JS even inside html. Right now I think that will allow non-JS to be evaluated from HTML. The completion controller has code for looking at inner mode I think. Comment on attachment 259942 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259942&action=review >> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:730 >> + if (modeName !== "javascript" && modeName !== "htmlmixed") > > I think there is a way to get the inner mode for the selection, that way we know if it is JS even inside html. Right now I think that will allow non-JS to be evaluated from HTML. The completion controller has code for looking at inner mode I think. Oh, now I see your comment in the ChangeLog. Sounds good. (In reply to comment #4) > Comment on attachment 259942 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=259942&action=review > > >> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:730 > >> + if (modeName !== "javascript" && modeName !== "htmlmixed") > > > > I think there is a way to get the inner mode for the selection, that way we know if it is JS even inside html. Right now I think that will allow non-JS to be evaluated from HTML. The completion controller has code for looking at inner mode I think. > > Oh, now I see your comment in the ChangeLog. Sounds good. Currently, pressing Command-Enter inside a resource doesn't do anything at all. It doesn't insert a new line. We may revisit what does it do for HTML in the future, but I don't have any other ideas at the moment. Comment on attachment 259942 [details] Patch Clearing flags on attachment: 259942 Committed r188967: <http://trac.webkit.org/changeset/188967> All reviewed patches have been landed. Closing bug. Looking into this two weeks later with a fresh eye, I think Command-Enter should show the exact same popover as on hover. Evaluating in the console seems too disconnected from the source code and requires a bit of an extra mental effort not to lose the context. |