Bug 241902

Summary: Pressing shift+tab when focused in the middle of a contenteditable element doesn't work
Product: WebKit Reporter: Jamie Birch <jamie>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, brian, megan_gardner, rniwa, tyler_w, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   

Description Jamie Birch 2022-06-22 21:16:10 PDT
STR:

1: Navigate to: data:text/html,<div><button>Bold</button><button>Italic</button><div%20contenteditable="true">Hello</div><button>Bold</button><button>Italic</button></div>

2. Click between the 'e' and the 'l' in 'Hello'.

3. Press shift+tab

Expected results:
Focus moves to the "Italic" button

Actual results:
Focus doesn't change.

Firefox and Chrome produce the expected results, as does a regular <input type="text"> field.
Comment 1 Jamie Birch 2022-06-22 21:22:55 PDT
The expected results assume that the user has turned on Preferences... > Advanced > Accessibility > "Press Tab to highlight each item on a web page".

If the user has turned this setting off, then the actual result (focus doesn't change) is still true, but instead the expected behaviour would have been for focus to move to the URL bar.
Comment 2 Alexey Proskuryakov 2022-06-23 20:18:44 PDT
I can reproduce this. Very weird!
Comment 3 Radar WebKit Bug Importer 2022-06-29 21:17:12 PDT
<rdar://problem/96190283>
Comment 4 Ryosuke Niwa 2022-06-30 15:37:32 PDT
Likely a regression from https://trac.webkit.org/r201832.
Comment 5 Ryosuke Niwa 2022-06-30 20:01:33 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1975
Comment 6 EWS 2022-06-30 22:59:03 PDT
Committed 252029@main (7dc7f7fcb381): <https://commits.webkit.org/252029@main>

Reviewed commits have been landed. Closing PR #1975 and removing active labels.