[webkit-changes] [WebKit/WebKit] 058abd: [iOS] fast/events/ios/contenteditable-autocapitali...

Wenson Hsieh noreply at github.com
Wed Feb 12 15:49:06 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 058abd3f4442ff5468c490ef859910560c730813
      https://github.com/WebKit/WebKit/commit/058abd3f4442ff5468c490ef859910560c730813
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2025-02-12 (Wed, 12 Feb 2025)

  Changed paths:
    M LayoutTests/editing/caret/ios/place-caret-after-autocorrected-word.html
    M LayoutTests/editing/input/cocoa/autocorrect-off.html
    M LayoutTests/editing/input/ios/autocorrection-replaces-space-with-period.html
    M LayoutTests/editing/input/ios/invalidate-text-entry-context-when-clearing-text-area.html
    M LayoutTests/editing/selection/ios/extend-selection-with-inline-predictions.html
    M LayoutTests/fast/events/ios/contenteditable-autocapitalize.html
    M LayoutTests/fast/forms/ios/autocapitalize-words.html
    M LayoutTests/fast/repaint/placeholder-after-caps-lock-hidden.html
    M LayoutTests/resources/ui-helper.js

  Log Message:
  -----------
  [iOS] fast/events/ios/contenteditable-autocapitalize.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=287578
rdar://144713635

Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.

This iOS layout test sometimes fails, with the following test output:

```
-PASS With autocapitalize: none, the output is: "to"
+FAIL With autocapitalize: none, the output is: "t" (expected "to")
```

...which suggests that we occasionally fail to wait for `o` to be typed after focusing the text
field for the first time. Other (similar) tests that attempt to type a sequence of characters on iOS
are robust against this, by waiting for either the `input` or `keyup` event to be handled after
typing each key, before moving on with the rest of the test.

To fix this, we extract this technique for waiting on a DOM event before typing the next character
into a new `UIHelper` method, and deploy this new helper method in various tests (including the
flaky test in this bug) to avoid code duplication.

* LayoutTests/editing/caret/ios/place-caret-after-autocorrected-word.html:
* LayoutTests/editing/input/cocoa/autocorrect-off.html:
* LayoutTests/editing/input/ios/autocorrection-replaces-space-with-period.html:
* LayoutTests/editing/input/ios/invalidate-text-entry-context-when-clearing-text-area.html:
* LayoutTests/editing/selection/ios/extend-selection-with-inline-predictions.html:
* LayoutTests/fast/events/ios/contenteditable-autocapitalize.html:
* LayoutTests/fast/forms/ios/autocapitalize-words.html:
* LayoutTests/fast/repaint/placeholder-after-caps-lock-hidden.html:
* LayoutTests/resources/ui-helper.js:

Introduce the new test helper (`typeCharacters`).

(window.UIHelper.async typeCharacters):
(window.UIHelper):
(UIHelper.EventStreamBuilder.prototype._reset): Deleted.
(UIHelper.EventStreamBuilder.prototype.begin): Deleted.
(UIHelper.EventStreamBuilder.prototype.wait): Deleted.
(UIHelper.EventStreamBuilder.prototype.move): Deleted.
(UIHelper.EventStreamBuilder.prototype.end): Deleted.
(UIHelper.EventStreamBuilder.prototype.takeResult): Deleted.

Canonical link: https://commits.webkit.org/290306@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