Closed Bug 1043154 Opened 10 years ago Closed 10 years ago

Split console does not open on ESC if the focus is inside of source editor (style editor / debugger)

Categories

(DevTools :: Source Editor, defect)

defect
Not set
normal

Tracking

(firefox34 verified)

VERIFIED FIXED
Firefox 34
Tracking Status
firefox34 --- verified

People

(Reporter: jayesh.choudhari17, Assigned: jayesh.choudhari17, Mentored)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 (Beta/Release)
Build ID: 20140723030202

Steps to reproduce:

1. Open any website or a blank page
2. open the developer tools
3. Go to Style-Editor tab
4. Focus inside the right panel (which can contain the source of any of the files)
5. Hit ESC 


Actual results:

The webconsole toolbox does not opens


Expected results:

webconsole toolbox should open even if the focus is inside the right-side sources panel
See Also: → 1043148
Component: Untriaged → Developer Tools: Style Editor
Status: UNCONFIRMED → NEW
Component: Developer Tools: Style Editor → Developer Tools: Source Editor
Ever confirmed: true
Summary: Webconsole toolbox does not opens up on ESC if the focus is inside right-side panel of the style-editor tab in devtools → Split console does not open on ESC if the focus is inside of source editor (style editor / debugger)
Hi Brian,

I am willing to work on this bug. Can you give some pointers on this.

Thanks,
Jayesh
(In reply to Jayesh from comment #2)
> Hi Brian,
> 
> I am willing to work on this bug. Can you give some pointers on this.
> 
> Thanks,
> Jayesh

OK, so the trick is adding a handler for extraKeys for the editor component that is being used by the style editor and the debugger.  This is sending a CodeMirror keyMap object: http://codemirror.net/doc/manual.html#keymaps.  I think this will actually be quite simple, just set the handler to the "Esc" key to false, which will tell CodeMirror to allow the event to be handled by the browser.

extraKeys["Esc"] = false;

The two places this will need to be done are:

Style Editor at _getKeyBindings: http://dxr.mozilla.org/mozilla-central/source/browser/devtools/styleeditor/StyleSheetEditor.jsm#618
Debugger at initializeEditor: http://dxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-view.js#211
Assignee: nobody → jayesh.choudhari17
Mentor: bgrinstead
Status: NEW → ASSIGNED
OS: Windows 7 → All
Hardware: x86_64 → All
Version: 34 Branch → Trunk
Attached patch escKey-1.patchSplinter Review
Hi Brian,

I submitted a patch. Do have a look and update me on the changes. 

P.S.: Working on fx-team repository

Thanks,
Jayesh
Attachment #8469048 - Flags: review?(bgrinstead)
Attachment #8469048 - Flags: feedback?(bgrinstead)
Comment on attachment 8469048 [details] [diff] [review]
escKey-1.patch

Review of attachment 8469048 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, the extraKeys["Esc"] = false is already tested by CM.  I'm going to open a follow up for properly restoring focus when the split console is closed, since this affects other things already - like if you have a text box focused, then ESC to open split console, then ESC to close split console then the text box should be refocused.

https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=eb2f80122044
Attachment #8469048 - Flags: review?(bgrinstead)
Attachment #8469048 - Flags: review+
Attachment #8469048 - Flags: feedback?(bgrinstead)
Blocks: 1050439
https://hg.mozilla.org/mozilla-central/rev/5bf0bbcc85fb
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
Verified: [bugday-20140813]

Explanation: 

Web console is properly opening when users press ESC character in Style editor.
QA Whiteboard: [qa+]
Already verified by Karthikeyan in comment 8.
Status: RESOLVED → VERIFIED
QA Whiteboard: [qa+] → [qa!]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.