[webkit-changes] [WebKit/WebKit] 72adbb: walmart.com/wallet focuses phone number field when...

Tim Nguyen noreply at github.com
Sat Dec 14 23:56:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 72adbb9f99534551a728acb270d4f111da5e9515
      https://github.com/WebKit/WebKit/commit/72adbb9f99534551a728acb270d4f111da5e9515
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2024-12-14 (Sat, 14 Dec 2024)

  Changed paths:
    M LayoutTests/editing/async-clipboard/resources/async-clipboard-helpers.js
    M LayoutTests/editing/deleting/5290534.html
    M LayoutTests/editing/inserting/4960120-1.html
    M LayoutTests/editing/inserting/insert-text-into-text-field.html
    M LayoutTests/editing/pasteboard/data-transfer-get-data-on-drop-plain-text.html
    M LayoutTests/editing/pasteboard/data-transfer-get-data-on-paste-plain-text.html
    M LayoutTests/editing/pasteboard/drag-drop-input-textarea.html
    M LayoutTests/editing/pasteboard/drag-drop-url-text.html
    M LayoutTests/editing/pasteboard/pasting-tabs.html
    M LayoutTests/editing/selection/4975120.html
    M LayoutTests/editing/selection/5497643-expected.txt
    M LayoutTests/editing/selection/5497643.html
    M LayoutTests/editing/selection/delete-selection-with-disconnected-extent.html
    M LayoutTests/editing/selection/delete-word-granularity-text-control.html
    M LayoutTests/editing/selection/deleteFromDocument-shadow-tree-crash.html
    M LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless.html
    M LayoutTests/editing/selection/select-iframe-focusin-document-crash.html
    A LayoutTests/editing/selection/selection-setSelectionRange-frameselection-expected.txt
    A LayoutTests/editing/selection/selection-setSelectionRange-frameselection.html
    A LayoutTests/editing/selection/setting-selection-does-not-focus-unless-selected-expected.txt
    A LayoutTests/editing/selection/setting-selection-does-not-focus-unless-selected.html
    M LayoutTests/editing/selection/shrink-selection-after-shift-pagedown.html
    M LayoutTests/fast/css/content/content-on-focus-change.html
    M LayoutTests/fast/events/context-no-deselect.html
    M LayoutTests/fast/forms/datalist/datalist-idTargetChanged-crash.html
    M LayoutTests/fast/forms/input-appearance-selection.html
    M LayoutTests/fast/forms/input-delete.html
    M LayoutTests/fast/forms/input-placeholder-visibility-2-expected.html
    M LayoutTests/fast/forms/paste-into-textarea.html
    M LayoutTests/fast/forms/textarea-arrow-navigation.html
    M LayoutTests/fast/rendering/render-compositor-null-layer-crash.html
    M LayoutTests/fast/text-extraction/basic-text-extraction.html
    M LayoutTests/fast/text/out-of-flow-line-break-crash.html
    M LayoutTests/imported/w3c/web-platform-tests/html/interaction/focus/processing-model/textarea-scroll-selection-expected.txt
    M LayoutTests/resources/accessibility-helper.js
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/html/HTMLTextFormControlElement.cpp

  Log Message:
  -----------
  walmart.com/wallet focuses phone number field when attempting to add a credit card
https://bugs.webkit.org/show_bug.cgi?id=284630
rdar://139075809

Reviewed by Ryosuke Niwa.

Setting the selection should not focus unless there is an existing selection.
This matches other browsers while preserving the principle that focus & selection must be in sync (by neither focusing or selecting).

Notably, these APIs now have this behavior:
- element.setSelectionRange()
- element.selectionStart/selectionEnd setters
- element.setRangeText()

These APIs preserve the old behavior by focusing the text controls before selecting:
- element.select()
- accessibility APIs

Here is the relevant Blink commits for the corresponding change there:
https://github.com/chromium/chromium/commit/530015339e3f6572d239432b69f77ebca1492f73

In order to limit the risk of breakage in older macOS/iOS apps, this behavior is put behind a linked-on-or-after check.

* LayoutTests/editing/async-clipboard/resources/async-clipboard-helpers.js:
(async writeToClipboardUsingDataTransfer):
* LayoutTests/editing/deleting/5290534.html:
* LayoutTests/editing/inserting/4960120-1.html:
* LayoutTests/editing/inserting/insert-text-into-text-field.html:
* LayoutTests/editing/pasteboard/data-transfer-get-data-on-drop-plain-text.html:
* LayoutTests/editing/pasteboard/data-transfer-get-data-on-paste-plain-text.html:
* LayoutTests/editing/pasteboard/drag-drop-input-textarea.html:
* LayoutTests/editing/pasteboard/drag-drop-url-text.html:
* LayoutTests/editing/pasteboard/pasting-tabs.html:
* LayoutTests/editing/selection/4975120.html:
* LayoutTests/editing/selection/5497643-expected.txt:
* LayoutTests/editing/selection/5497643.html:
* LayoutTests/editing/selection/delete-selection-with-disconnected-extent.html:
* LayoutTests/editing/selection/delete-word-granularity-text-control.html:
* LayoutTests/editing/selection/deleteFromDocument-shadow-tree-crash.html:
* LayoutTests/editing/selection/select-iframe-focusin-document-crash.html:
* LayoutTests/editing/selection/selection-setSelectionRange-frameselection-expected.txt: Added.
* LayoutTests/editing/selection/selection-setSelectionRange-frameselection.html: Added.
* LayoutTests/editing/selection/setting-selection-does-not-focus-unless-selected-expected.txt: Added.
* LayoutTests/editing/selection/setting-selection-does-not-focus-unless-selected.html: Added.
* LayoutTests/editing/selection/shrink-selection-after-shift-pagedown.html:
* LayoutTests/fast/css/content/content-on-focus-change.html:
* LayoutTests/fast/events/context-no-deselect.html:
* LayoutTests/fast/forms/datalist/datalist-idTargetChanged-crash.html:
* LayoutTests/fast/forms/input-appearance-selection.html:
* LayoutTests/fast/forms/input-delete.html:
* LayoutTests/fast/forms/input-placeholder-visibility-2-expected.html:
* LayoutTests/fast/forms/paste-into-textarea.html:
* LayoutTests/fast/forms/textarea-arrow-navigation.html:
* LayoutTests/fast/rendering/render-compositor-null-layer-crash.html:
* LayoutTests/fast/text-extraction/basic-text-extraction.html:
* LayoutTests/fast/text/out-of-flow-line-break-crash.html:
* LayoutTests/imported/w3c/web-platform-tests/html/interaction/focus/processing-model/textarea-scroll-selection-expected.txt:
* LayoutTests/resources/accessibility-helper.js:
* Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedTextRange):
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const):
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):

Canonical link: https://commits.webkit.org/287851@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list