Emacs like goto beginning/end of line shortcuts stopped working inside <textarea>s

RESOLVED FIXED in mozilla25

Status

()

Core
Widget: Cocoa
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: reuben, Assigned: jryans)

Tracking

({regression})

Trunk
mozilla25
All
Mac OS X
regression
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

5 years ago
STR:
1) data:text/html,<body onload="t.focus()"><textarea id="t">foobar</textarea></body>
2) Try to use control+E, control+A to move the caret to the end of line.

Expected results:
Caret is moved accordingly.

Actual results:
Caret is not moved.
(Reporter)

Comment 1

5 years ago
Initial range on central:

dde4dcd6fa46 2013-07-11 GOOD
b44898282f21 2013-07-12 FAIL

https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dde4dcd6fa46&tochange=b44898282f21
This might be fallout from the patch for bug 282097.
Yes, sounds likely.  I'll take a look.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Keywords: regressionwindow-wanted
Created attachment 777543 [details] [diff] [review]
Part 1: Restore Emacs shortcuts in textareas

I've removed most of the conditionals that were added to only allow paragraph selectors to work on text inputs.

This is a little confusing, since for editable elements and textareas, these are line motions, even though the selector says paragraph.  

The default OS X bindings for these Emacs-style commands (ctrl+a, ctrl+e, etc.) use paragraph selectors, so this change at least restores those keystrokes to the line motions that they made prior to bug #282097 landing.
Attachment #777543 - Flags: review?(masayuki)
Created attachment 777544 [details] [diff] [review]
Part 2: Expand NativeKeyBindings tests

I've greatly expanded the test for NativeKeyBindings in several ways:

* textareas and inputs are now tested, in addition to the editable element from before
* All OS X supported Emacs-style shortcuts are tested
Attachment #777544 - Flags: review?(masayuki)
Comment on attachment 777543 [details] [diff] [review]
Part 1: Restore Emacs shortcuts in textareas

nice!
Attachment #777543 - Flags: review?(masayuki) → review+
Comment on attachment 777544 [details] [diff] [review]
Part 2: Expand NativeKeyBindings tests

I'm +'ing this patch.

However, you send wrong character when Ctrl key is pressed. For example, if Ctrl + 'a' is pressed, the char should be U+0001 and the unmodified char should be 'a'.
http://mxr.mozilla.org/mozilla-central/source/widget/tests/test_keycodes.xul#370

Would you add new patch for fixing this bug?

You can research the actual character with TextInputHandler's log.
> export NSPR_LOG_FILE=<file name> && export NSPR_LOG_MODULES=TextInputHandlerWidgets:1

Then, the native key event is recorded by this:
http://mxr.mozilla.org/mozilla-central/source/widget/cocoa/TextInputHandler.mm#1420
Attachment #777544 - Flags: review?(masayuki) → review+
I mean that you should fix the bug in current test too.
Blocks: 282097
Created attachment 778042 [details] [diff] [review]
Part 2: Expand NativeKeyBindings tests (v2)

* Corrected characters sent when using modifiers as suggested in comment #7.
* Removed page down step because the positioning result was unreliable on try.

Carrying over masayuki's r+ from attachment #777544 [details] [diff] [review].
Attachment #777544 - Attachment is obsolete: true
Attachment #778042 - Flags: review+
Try push is green: https://tbpl.mozilla.org/?tree=Try&rev=a6ccd22259e6
Keywords: checkin-needed
(Reporter)

Comment 11

5 years ago
Thanks for the patch!

remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/2f26d189329b
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/53891879b3a4
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2f26d189329b
https://hg.mozilla.org/mozilla-central/rev/53891879b3a4
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.