[webkit-reviews] review granted: [Bug 218585] autofocus of text input should not select text : [Attachment 413442] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Nov 6 12:44:53 PST 2020
Wenson Hsieh <wenson_hsieh at apple.com> has granted Devin Rousso
<drousso at apple.com>'s request for review:
Bug 218585: autofocus of text input should not select text
https://bugs.webkit.org/show_bug.cgi?id=218585
Attachment 413442: Patch
https://bugs.webkit.org/attachment.cgi?id=413442&action=review
--- Comment #6 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 413442
--> https://bugs.webkit.org/attachment.cgi?id=413442
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?
More information about the webkit-reviews
mailing list