Bug 233018 - WebKit should pipe mouse hover events on iOS to the UI delegate
Summary: WebKit should pipe mouse hover events on iOS to the UI delegate
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Other
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-11 15:20 PST by Kevin Turner
Modified: 2022-02-12 07:43 PST (History)
6 users (show)

See Also:


Attachments
Patch (12.03 KB, patch)
2022-02-09 18:25 PST, Kevin Turner
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (12.01 KB, patch)
2022-02-09 18:58 PST, Kevin Turner
no flags Details | Formatted Diff | Diff
Simple test case example (2.71 KB, patch)
2022-02-09 23:14 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (15.68 KB, patch)
2022-02-10 18:57 PST, Kevin Turner
no flags Details | Formatted Diff | Diff
Patch (15.67 KB, patch)
2022-02-11 17:41 PST, Kevin Turner
no flags Details | Formatted Diff | Diff
Patch (15.64 KB, patch)
2022-02-11 18:05 PST, Kevin Turner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Turner 2021-11-11 15:20:41 PST
WebKit should allow `mouseDidMoveOverElement` delegate callbacks on iOS. These callbacks are currently guarded to be macOS only in WKUIDelegatePrivate.h.
Comment 1 Radar WebKit Bug Importer 2021-11-11 15:22:13 PST
<rdar://problem/85318451>
Comment 2 Simon Fraser (smfr) 2021-11-12 17:33:08 PST
Do you have a reason for wanting them?
Comment 3 Kevin Turner 2022-02-09 18:25:05 PST
Created attachment 451476 [details]
Patch
Comment 4 Wenson Hsieh 2022-02-09 18:27:50 PST
We should be able to write a quick API test to exercise this codepath.
Comment 5 Darin Adler 2022-02-09 18:55:10 PST
Comment on attachment 451476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451476&action=review

> Source/WebKit/Shared/API/Cocoa/_WKHitTestResult.h:28
> +#if PLATFORM(MAC) || HAVE(UIKIT_WITH_MOUSE_SUPPORT)

This header is used outside WebKIt, and thus it can’t use PLATFORM() and HAVE() includes.
Comment 6 Darin Adler 2022-02-09 18:55:29 PST
Comment on attachment 451476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451476&action=review

>> Source/WebKit/Shared/API/Cocoa/_WKHitTestResult.h:28
>> +#if PLATFORM(MAC) || HAVE(UIKIT_WITH_MOUSE_SUPPORT)
> 
> This header is used outside WebKIt, and thus it can’t use PLATFORM() and HAVE() includes.

Can’t use PLATFORM() and HAVE() macros.
Comment 7 Kevin Turner 2022-02-09 18:58:33 PST
Created attachment 451480 [details]
Patch
Comment 8 Wenson Hsieh 2022-02-09 23:14:28 PST
Created attachment 451495 [details]
Simple test case example

(Example of an API test case that could be used to exercise the new API on iOS)
Comment 9 Tim Horton 2022-02-09 23:15:49 PST
Comment on attachment 451480 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451480&action=review

> Source/WebKit/Shared/API/Cocoa/_WKHitTestResult.h:28
> +#if TARGET_OS_OSX || TARGET_OS_IPHONE

I'm pretty sure this condition is true everywhere that this file exists (IPHONE includes all of the iOS-derivatives), so maybe you can just delete it instead? Or maybe you meant TARGET_OS_IOS

> Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:74
> +#if !PLATFORM(MAC)

Why the inverted condition? Should be PLATFORM(IOS_FAMILY) or maybe the HAVE
Comment 10 Tim Horton 2022-02-09 23:16:15 PST
(and yes, a test would be lovely)
Comment 11 Kevin Turner 2022-02-10 18:57:20 PST
Created attachment 451628 [details]
Patch
Comment 12 Wenson Hsieh 2022-02-11 17:37:16 PST
Comment on attachment 451628 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451628&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm:356
> +    EXPECT_TRUE(hitTestResult != nullptr);

Nit - ideally, this would be `EXPECT_NOT_NULL(hitTestResult);`
Comment 13 Kevin Turner 2022-02-11 17:41:42 PST
Created attachment 451763 [details]
Patch
Comment 14 Kevin Turner 2022-02-11 18:05:46 PST
Created attachment 451765 [details]
Patch
Comment 15 EWS 2022-02-12 07:43:22 PST
Committed r289694 (247179@main): <https://commits.webkit.org/247179@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 451765 [details].