Summary: | autofocus of text input should not select text | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||||||||||
Component: | Forms | Assignee: | Devin Rousso <hi> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | akeerthi, cdumez, changseok, cmarcelo, esprehn+autocc, ews-watchlist, gyuyoung.kim, hi, kangil.han, mifenton, thorton, webkit-bug-importer, wenson_hsieh | ||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
URL: | data:text/html,<input type=text value="Test" autofocus> | ||||||||||||||
Attachments: |
|
Description
Devin Rousso
2020-11-04 14:31:53 PST
Created attachment 413223 [details]
Patch
Created attachment 413351 [details]
Patch
my initial attempt had more behavior change "ripples" than i'd anticipated, so here's another approach that's (hopefully) far more targeted in behavior change
putting this up before writing tests to see if EWS still has issues with this approach
Created attachment 413371 [details]
Patch
Created attachment 413442 [details]
Patch
Comment on attachment 413442 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413442&action=review > Source/WebCore/dom/Document.h:292 > + Restore, // If there is no previous selection, this behaves like SelectAll. Nit - it's a little more verbose, but maybe `RestoreOrSelectAll`? (and remove the comment) > Source/WebCore/dom/Document.h:293 > + PlaceCursorAtStart, Also, this should be (selection) Caret, not (mouse) Cursor :P > LayoutTests/fast/forms/input-text-autofocus.html:27 > + shouldBe("input.selectionStart", UIHelper.isIOSFamily() ? "3" : "0"); > + shouldBe("input.selectionEnd", UIHelper.isIOSFamily() ? "3" : "0"); We generally try to avoid platform-specific logic like this in tests, if possible. Can we just override the editing behavior instead, and make all platforms yield the same results? Created attachment 413483 [details]
Patch
Committed r269587: <https://trac.webkit.org/changeset/269587> All reviewed patches have been landed. Closing bug and clearing flags on attachment 413483 [details]. |