WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
191023
InputEvent.inputType should be "deleteSoftLineBackward" or "deleteSoftLineForward" rather than "deleteHardLineBackward" nor "deleteHardLineForward" when pressing Command + Backspace or Delete
https://bugs.webkit.org/show_bug.cgi?id=191023
Summary
InputEvent.inputType should be "deleteSoftLineBackward" or "deleteSoftLineFor...
Masayuki Nakano
Reported
2018-10-29 01:49:02 PDT
STR: 1. Load
https://d-toybox.com/studio/lib/input_event_viewer.html
2. Choose "<div contenteditable>" from the radio buttons. 3. Shrink your Safari window as far as possible. 4. Type a long text *without* line breaks into the editor below the toolbars (blue solid border area) until you see a couple of lines. 5. Put a caret at middle of a line. 6. Press Command + Backspace. Actual result: I see "deleteHardLineBackward" value in dispatched "input"/"beforeinput" events (shown table in bottom of the page). Expected result: Those inputType values should be "deleteSoftLineBackward" because this operation removes from caret to the previous *visual* line break. "deleteSoftLineBackword" is defined as:
> delete from the caret to the nearest visual line break before the caret position
"deleteHardLineBackword" is defined as:
> delete from the caret to the nearest beginning of a block element or br element before the caret position
https://w3c.github.io/input-events/#interface-InputEvent-Attributes
Chrome uses "deleteSoftLineBackward", and Firefox will use it.
Attachments
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2018-10-29 08:35:48 PDT
Thanks for the report, Masayuki! Indeed, TypingDeleteLineBackward and TypingDeleteLineForward should dispatch input events of input type "deleteSoftLine(Backward|Forward)", since deletion is to the visual line break.
Radar WebKit Bug Importer
Comment 2
2018-10-29 13:37:26 PDT
<
rdar://problem/45647376
>
Ahmad Saleem
Comment 3
2025-01-21 21:13:02 PST
https://searchfox.org/wubkat/rev/d4766b667963256e41db8c72a02613067074d834/Source/WebCore/editing/EditCommand.cpp#82
case EditAction::TypingDeleteLineBackward: return "deleteHardLineBackward"_s; case EditAction::TypingDeleteLineForward: return "deleteHardLineForward"_s; @Wenson - do we have to update following only?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug