[webkit-changes] [WebKit/WebKit] b9e4f4: Unify ICU versions of findNextWordFromIndex

Tim Horton noreply at github.com
Sat Sep 7 00:44:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b9e4f423693e1b2c34605bbd1c6b5b361d036348
      https://github.com/WebKit/WebKit/commit/b9e4f423693e1b2c34605bbd1c6b5b361d036348
  Author: Tim Horton <thorton at apple.com>
  Date:   2024-09-07 (Sat, 07 Sep 2024)

  Changed paths:
    M LayoutTests/fast/events/ios/key-command-delete-next-word-expected.txt
    M LayoutTests/fast/events/ios/key-command-delete-next-word.html
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/ios/editing/deleting/list-item-1-expected.txt
    M LayoutTests/platform/ios/editing/deleting/non-smart-delete-expected.txt
    M LayoutTests/platform/ios/editing/deleting/smart-delete-002-expected.txt
    R LayoutTests/platform/ios/editing/execCommand/indent-pre-expected.txt
    R LayoutTests/platform/ios/editing/execCommand/remove-formatting-2-live-range-expected.txt
    M LayoutTests/platform/ios/editing/inserting/4960120-2-expected.txt
    M LayoutTests/platform/ios/editing/inserting/insert-paragraph-03-expected.txt
    M LayoutTests/platform/ios/editing/inserting/insert-paragraph-04-expected.txt
    M LayoutTests/platform/ios/editing/inserting/paragraph-separator-01-expected.txt
    M LayoutTests/platform/ios/editing/inserting/paragraph-separator-02-expected.txt
    M LayoutTests/platform/ios/editing/inserting/paragraph-separator-03-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/4806874-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/5006779-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/8145-2-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/bad-placeholder-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/merge-end-borders-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/pasting-object-expected.txt
    M LayoutTests/platform/ios/editing/selection/4932260-2-expected.txt
    M LayoutTests/platform/ios/editing/selection/extend-by-word-002-expected.txt
    M LayoutTests/platform/ios/editing/selection/transformed-selection-rects-expected.txt
    M LayoutTests/platform/ios/editing/style/5046875-1-expected.txt
    M LayoutTests/platform/ios/editing/style/5046875-2-expected.txt
    M LayoutTests/platform/ios/editing/style/relative-font-size-change-002-expected.txt
    M LayoutTests/platform/ios/editing/style/relative-font-size-change-003-expected.txt
    M LayoutTests/platform/ios/editing/style/relative-font-size-change-004-expected.txt
    R LayoutTests/platform/ios/editing/style/unbold-in-bold-expected.txt
    M LayoutTests/platform/ios/fast/dom/34176-expected.txt
    M Source/WebCore/platform/text/TextBoundaries.cpp
    M Source/WebCore/platform/text/mac/TextBoundaries.mm

  Log Message:
  -----------
  Unify ICU versions of findNextWordFromIndex
https://bugs.webkit.org/show_bug.cgi?id=279270
rdar://135422020

Reviewed by Wenson Hsieh.

We have three implementations of `findNextWordFromIndex`:

1) used for all non-Cocoa platforms, which uses ICU
2) used for macOS, which uses Foundation and AppKit
3) used for all non-macOS Cocoa platforms, which uses ICU

Versions 1 and 2 work well, and iterate words as you'd expect. Version 3
has a bug where it will count hopping a space boundary as a word.

This bug has been causing a bit of trouble for our text fragment directive generator,
see e.g. bug 278325.

Fixing this bug makes the code for 3 essentially equivalent to 1, so instead
just smoosh them together. We leave version 2 alone because the scope of the
delta is much less clear.

* Source/WebCore/platform/text/TextBoundaries.cpp:
* Source/WebCore/platform/text/mac/TextBoundaries.mm:
(WebCore::findWordBoundary):
(WebCore::findNextWordFromIndex):

* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/ios/editing/deleting/list-item-1-expected.txt:
* LayoutTests/platform/ios/editing/deleting/non-smart-delete-expected.txt:
* LayoutTests/platform/ios/editing/deleting/smart-delete-002-expected.txt:
* LayoutTests/platform/ios/editing/execCommand/indent-pre-expected.txt: Removed.
* LayoutTests/platform/ios/editing/execCommand/remove-formatting-2-live-range-expected.txt: Removed.
* LayoutTests/platform/ios/editing/inserting/4960120-2-expected.txt:
* LayoutTests/platform/ios/editing/inserting/insert-paragraph-03-expected.txt:
* LayoutTests/platform/ios/editing/inserting/insert-paragraph-04-expected.txt:
* LayoutTests/platform/ios/editing/inserting/paragraph-separator-01-expected.txt:
* LayoutTests/platform/ios/editing/inserting/paragraph-separator-02-expected.txt:
* LayoutTests/platform/ios/editing/inserting/paragraph-separator-03-expected.txt:
* LayoutTests/platform/ios/editing/pasteboard/4806874-expected.txt:
* LayoutTests/platform/ios/editing/pasteboard/5006779-expected.txt:
* LayoutTests/platform/ios/editing/pasteboard/8145-2-expected.txt:
* LayoutTests/platform/ios/editing/pasteboard/bad-placeholder-expected.txt:
* LayoutTests/platform/ios/editing/pasteboard/merge-end-borders-expected.txt:
* LayoutTests/platform/ios/editing/pasteboard/pasting-object-expected.txt:
* LayoutTests/platform/ios/editing/selection/4932260-2-expected.txt:
* LayoutTests/platform/ios/editing/selection/extend-by-word-002-expected.txt:
* LayoutTests/platform/ios/editing/selection/transformed-selection-rects-expected.txt:
* LayoutTests/platform/ios/editing/style/5046875-1-expected.txt:
* LayoutTests/platform/ios/editing/style/5046875-2-expected.txt:
* LayoutTests/platform/ios/editing/style/relative-font-size-change-002-expected.txt:
* LayoutTests/platform/ios/editing/style/relative-font-size-change-003-expected.txt:
* LayoutTests/platform/ios/editing/style/relative-font-size-change-004-expected.txt:
* LayoutTests/platform/ios/editing/style/unbold-in-bold-expected.txt: Removed.
Adjust some baselines, moving them closer to their macOS equivlents.
Sadly most cannot be deleted entirely because the render tree sizes are slightly different,
but this makes the actually interesting parts of the results progress towards macOS.
Also, unskip a bunch of tests that now pass.

fast/events/ios/key-command-delete-next-word.html is the most interesting (forward
delete no longer deletes the space after the word you are deleting), but the new
behavior does match macOS behavior, and the bug that introduced this behavior on
iOS indicates it was intending to match macOS.

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