[webkit-changes] [WebKit/WebKit] 96471c: [iOS] Adjust several API/layout tests in preparati...

Wenson Hsieh noreply at github.com
Thu Oct 24 21:16:56 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 96471cca452126f827e7d66d99cd6aedd3dc02ef
      https://github.com/WebKit/WebKit/commit/96471cca452126f827e7d66d99cd6aedd3dc02ef
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-10-24 (Thu, 24 Oct 2024)

  Changed paths:
    M LayoutTests/editing/selection/ios/hide-selection-when-scrolling-overflow-container.html
    M LayoutTests/editing/selection/ios/show-selection-in-transformed-container-expected.txt
    M LayoutTests/editing/selection/ios/show-selection-in-transformed-container.html
    R LayoutTests/platform/ipad/editing/selection/ios/show-selection-in-transformed-container-expected.txt
    M LayoutTests/resources/ui-helper.js
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

  Log Message:
  -----------
  [iOS] Adjust several API/layout tests in preparation for enabling SelectionHonorsOverflowScrolling
https://bugs.webkit.org/show_bug.cgi?id=282064

Reviewed by Abrar Rahman Protyasha.

Adjust several layout and API tests, ahead of enabling `SelectionHonorsOverflowScrolling`. See below
for more details.

* LayoutTests/editing/selection/ios/hide-selection-when-scrolling-overflow-container.html:

This test validates that the selection is hidden when overflow scrolling is *not* honored, so we
need to force the runtime feature off for this test. This test will eventually become obsolete, once
`SelectionHonorsOverflowScrolling` is enabled on all iOS family platforms.

* LayoutTests/editing/selection/ios/show-selection-in-transformed-container-expected.txt:
* LayoutTests/editing/selection/ios/show-selection-in-transformed-container.html:

Adjust this test so that it rounds the selection rects to the nearest device pixel. The expectations
changed here, due to the fact that the selection now becomes reparented inside of a compositing
layer due to the text field gaining a transform; this causes the math that maps selection rects from
selection container coordinates to root view coordinates to yield `17.9999995` instead of `18`. This
doesn't result in any user-visible change, so we can just make the test robust against this floating
point error and clamp to the nearest device pixel.

I'm also adjusting the test to simply check that the caret rect before applying transforms is the
same as the caret after applying transforms; this captures the original intent of the test, without
requiring a separate iPad baseline due to hard-coded rect values.

* LayoutTests/platform/ipad/editing/selection/ios/show-selection-in-transformed-container-expected.txt: Removed.
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.roundToDevicePixel):
(window.UIHelper.roundRectToDevicePixel):
* Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView selectionViewRectsInContentCoordinates]):

Adjust this API testing helper to handle the case where selection rects are parented inside of
compositing views rather than the root view, by converting from selection container coordinate to
the content view's (root view) coordinate space.

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