[webkit-changes] [WebKit/WebKit] d11015: [iOS] ElementTargeting.ReplacedRendererSizeIgnores...

Wenson Hsieh noreply at github.com
Tue May 7 23:54:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d110152c9e76310103dc843da0fdd5b892f19080
      https://github.com/WebKit/WebKit/commit/d110152c9e76310103dc843da0fdd5b892f19080
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-05-07 (Tue, 07 May 2024)

  Changed paths:
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.h
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

  Log Message:
  -----------
  [iOS] ElementTargeting.ReplacedRendererSizeIgnoresPageScaleAndZoom is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=273856

Reviewed by Aditya Keerthi.

This test was previously relying on the fact that `-setZoomScale:animated:` after navigation would
(usually) not actually result in a scale change, after the next rendering update. As such, this test
only passes because the point `(100, 100)` ends up hit-testing to the same inspected element.

This bug was fixed in 278484 at main, but as a result, it exposes a bug in the test, since
`-setZoomScale:animated:` uses the center of the scroll view as the anchor point (rather than the
origin), which means that hit-testing `(100, 100)` now misses and hits text instead.

Address this by using `-setZoomScale:animated:` and `-setContentOffset:` to zoom to scale 3 and
scroll to the origin, and then carry out the hit-test.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(TestWebKitAPI::TEST(ElementTargeting, ReplacedRendererSizeIgnoresPageScaleAndZoom)):
* Tools/TestWebKitAPI/cocoa/TestWKWebView.h:
* Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView waitForNextPresentationUpdate]):
(-[TestWKWebView waitForNextVisibleContentRectUpdate]):

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