Bug 213298
| Summary: | Insertion point is missing after focusing a text field that has been emptied | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | mitz |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | cdumez, jond, thorton, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 13 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | data:text/html,<input%20value=0%20autofocus> | ||
mitz
To reproduce this bug:
1. In Safari, navigate to the URL
2. Press Delete to delete the contents of the text field
3. Press Tab to move focus away from the text field
4. Press Tab again to focus the text field
Result:
After step 2, the field is focused and empty with a blinking insertion point. After step 4, the field is focused and empty but the insertion point is missing.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
mitz
Maybe focusing the empty field makes an empty selection in it (as normally focusing a field selects the entire contents) that is somehow different from a caret selection.
mitz
Doesn’t happen if the text field never contained anything (the apparent difference being the presence or lack of a <br> in the shadow DOM).
Wenson Hsieh
I'm able to repro. Some debug logging in FrameSelection::setSelectionWithoutUpdatingAppearance...
After deleting:
OLD: { OffsetInAnchor(<DIV 0x11dc9e2f0 id='' class=''>, 0) }
NEW: { BeforeAnchor(<BR 0x11dc9f380 id='' class=''>) }
After tabbing to the unified field:
OLD: { BeforeAnchor(<BR 0x11dc9f380 id='' class=''>) }
NEW: { None }
After tabbing back to the text field:
OLD: { None }
NEW: { BeforeAnchor(<BR 0x11dc9f380 id='' class=''>), AfterAnchor(<BR 0x11dc9f380 id='' class=''>) }
Radar WebKit Bug Importer
<rdar://problem/64450787>
Wenson Hsieh
Also reproduces on stock Safari in macOS 10.15.6