Open Bug 1862256 Opened 2 years ago Updated 2 months ago

Behavior of home/end and ctrl+a/e in textarea is inconsistent with other browsers

Categories

(Core :: DOM: Editor, defect, P2)

Firefox 121
defect

Tracking

()

ASSIGNED

People

(Reporter: laura, Assigned: laura)

References

Details

Attachments

(2 files, 1 obsolete file)

Steps to reproduce:

  • Type a long line of text into a textarea field, so that it wraps into the next line
  • Press the home key (or ctrl+a)

Actual results:

Caret jumps to start of the wrapped line

Expected results:

Caret jumps to start of line of text

Component: Untriaged → DOM: Editor
Product: Firefox → Core

I've already submitted a patch for this on Phabricator, but I think even after editing the title it did not get linked to the bug.

This patch fixes home/end behavior in textareas. Currently, Firefox' behavior differs from every other major browser in that home/end and ctrl+a/e on macOS jumps to the start/end of the line as it's rendered on screen, respecting line wraps. This is anything but intuitive, as every other application jumps to the start/end of the logical line-of-text instead, ignoring line wraps. An about:config option to restore previous behavior is included.

It sometimes jumps up a line when pressing home/end in an empty line, but this isn't any different from current behavior. I presume the bug lies in GetPrimaryFrameForFocusNode.

I didn't find a bugzilla bug for this, though I imagine I just didn't look hard enough, as this seems like a fairly common complaint, at least from asking my friend circle.

This is my first upstreamed patch, I hope I did everything correctly.

Assignee: nobody → laura
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: -- → S3
Priority: -- → P2

BTW, we somehow have macOS shortcut definitions in two places:

Do we need both, or is either one of it a redundant of the other? :masayuki, do you know why we have both?

Flags: needinfo?(masayuki)
Attachment #9361307 - Attachment is obsolete: true

NativeKeyBindings.mm was created later than the XBL shortcut definition which ShoftcutKeyDefinition.cpp based on. When I create NativeKeyBindings, I just stop removing duplicated shortcuts because it's hard to check the default shortcut key definitions of OS X/macOS which were supported. Therefore, the redundant items which you are sure can be deleted.

Flags: needinfo?(masayuki)

Backed out for causing mochitests failures in test_native_key_bindings_mac.html.

Flags: needinfo?(laura)
Flags: needinfo?(laura) → needinfo?(krosylight)

Described some problems in patch 1.

Flags: needinfo?(krosylight)

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: laura → nobody
Status: ASSIGNED → NEW
Assignee: nobody → laura
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: