Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7b8132883f8ee3e1845ece781612c14b7d49ce77
      
https://github.com/WebKit/WebKit/commit/7b8132883f8ee3e1845ece781612c14b7d49ce77
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-08-15 (Sat, 15 Aug 2026)

  Changed paths:
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.h
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  [AppKit Gestures] Gesture controller may not reflect preference changes 
driven through WebPage.setWebFeature()
https://bugs.webkit.org/show_bug.cgi?id=321835
rdar://184977998

Reviewed by Richard Robinson.

When writing an API test like this:

```
@Test
func someTest() async {
    page.setWebFeature("UseAppKitGesturesForGestureEvents", enabled: true)
    ...
}
```

I noticed that the certain preference gated functionality was broken.
This is because WKAppKitGestureController initialization happens
directly under -[WKWebView initWithFrame:configuration:], and the
functionality in question was respecting a sticky preference value read
during initialization.

This is further exacerbated by the fact that WebPage.setWebFeature()
does not actually end up propagating preference changes to WebViewImpl,
since WebPageProxy::hasRunningProcess() reports that the associated web
content process is terminated/not launched (before we make a -loadHTML:
call). Not that it would be helpful in any way, though, since we only
pick up the preference at gesture controller initialization anyway.

While it is generally going to be useful to be able to set runtime
WebKit features before WebPage initialization -- tracked as an API
request in rdar://184981081 -- there is no inherent reason for our
gesture controller to not reflect updated preferences. As such, we
expose a `-[WKAppKitGestureController preferencesDidChange]` method,
which is called from both the WebViewImpl::preferencesDidChange() hook,
and from the WebViewImpl::didRelaunchPorcess() hook. This latter call is
salient for this patch, since it ensures the controller is reactive to
preference changes after the web content process is brought up.

* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.h:
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(-[WKAppKitGestureController preferencesDidChange]):
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::didRelaunchProcess):
(WebKit::WebViewImpl::preferencesDidChange):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to