[webkit-changes] [WebKit/WebKit] 5965a7: Fix debug asserts hit by ActionSheetTests.{PlayPau...

Tyler Wilcock noreply at github.com
Thu May 18 14:42:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5965a71610ecbebbf078330db934ac78d1dc0bbe
      https://github.com/WebKit/WebKit/commit/5965a71610ecbebbf078330db934ac78d1dc0bbe
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-05-18 (Thu, 18 May 2023)

  Changed paths:
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
    M Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm

  Log Message:
  -----------
  Fix debug asserts hit by ActionSheetTests.{PlayPauseAnimationCoveredByLink, PlayPauseAnimationInsideLink}
https://bugs.webkit.org/show_bug.cgi?id=256925
rdar://problem/109486147

Reviewed by Chris Fleizach.

These tests hit two debug asserts. The first was in EventHandler::hitTestResultAtPoint:

ASSERT(!hitType.contains(HitTestRequest::Type::CollectMultipleElements));

I removed this ASSERT because having CollectMultipleElements is intentional and necessary
for showing the right animation actions in the sheet (see commit message of https://github.com/WebKit/WebKit/commit/31091c93475d4d29c78644b5ec7787e4594b28c2).

The second ASSERT was in functions -[WKActionSheetAssistant {showImageSheet, showLinkSheet}]:

ASSERT(!_elementInfo);

The intention of this ASSERT is to ensure we don't have stale _elementInfo (any previous activated element info
should've been cleaned up). After adding logging and performing long-press, dismiss, long-press cycle on a real
webpage, I observed that this cleanup happens through mechanisms that our simulated long-press doesn't exercise.
So to fix this, I added -[WKWebView _resetInteraction] to allow simulation of this cleanup.

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint const):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _resetInteraction]):
* Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
(TestWebKitAPI::performLongPressAction):
(TestWebKitAPI::playPauseAnimationTest):
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list