Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a515900071861d7aebe336fddcae0ee204b5e5e8
      
https://github.com/WebKit/WebKit/commit/a515900071861d7aebe336fddcae0ee204b5e5e8
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2025-08-13 (Wed, 13 Aug 2025)

  Changed paths:
    M LayoutTests/http/tests/resources/pointer-lock/pointer-lock-test-harness.js
    M LayoutTests/platform/ios/TestExpectations
    A 
LayoutTests/platform/ios/pointer-lock/pointer-lock-option-unadjusted-movement-expected.txt
    M 
LayoutTests/platform/mac-wk1/pointer-lock/pointer-lock-option-unadjusted-movement-expected.txt
    M LayoutTests/pointer-lock/lock-lost-on-alert-expected.txt
    M LayoutTests/pointer-lock/lock-lost-on-alert.html
    M LayoutTests/pointer-lock/pointer-lock-option-unadjusted-movement.html
    M LayoutTests/resources/ui-helper.js
    M Source/WebCore/loader/EmptyClients.h
    M Source/WebCore/page/ChromeClient.h
    M Source/WebCore/page/PointerLockController.cpp
    M Source/WebCore/page/PointerLockController.h
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
    M Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
    M Tools/DumpRenderTree/TestRunner.cpp
    M Tools/DumpRenderTree/TestRunner.h
    M Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/TestController.h
    M Tools/WebKitTestRunner/TestInvocation.cpp
    M Tools/WebKitTestRunner/ios/TestControllerIOS.mm

  Log Message:
  -----------
  [iOS] PointerLockOptions.unadjustedMovement is supported when a pointing 
device is available
https://bugs.webkit.org/show_bug.cgi?id=297304
rdar://158184340

Reviewed by Aditya Keerthi.

Given we will be generating pointermove deltas from unaccelerated data
(c.f. webkit.org/b/297305) to begin with, this option is unconditionally
supported on iOS family whenever a pointing device is available.

This patch exposes WebPage::hasAccessoryMousePointingDevice(), which
keys off of the WebProcess singleton, allowing PointerLockController to
evaluate whether the `unadjustedMovement` option can be respected. Note
that this only meaningfully changes the iOS behavior because we
unconditionally report that a mouse pointing device is present on other
platforms.

Moreover, this patch improves some iOS test coverage of the pointer lock
feature through pointer-lock-option-unadjusted-movement.html. To get
this test running, we need to force toggle the PointerLockEnabled
preference. We also need to mock the web process into thinking a mouse
pointing device is available, which we accomplish through new TestRunner
interface.

* LayoutTests/http/tests/resources/pointer-lock/pointer-lock-test-harness.js:
(runWithUserGesture):
(runOnKeyPress.keypressHandler): Deleted.
(runOnKeyPress): Deleted.
(doNextStep): Deleted.

Instead of emulating the act of obtaining user gesture with a keypress,
let us just run the test steps with user gesture granted (through our
Internals testing interface).

* LayoutTests/platform/ios/TestExpectations:
* 
LayoutTests/platform/ios/pointer-lock/pointer-lock-option-unadjusted-movement-expected.txt:
 Added.
* LayoutTests/pointer-lock/pointer-lock-option-unadjusted-movement.html:

Altered the test slightly to obtain keyWindow/FR status before running
the test steps, since this is a prerequisite for pointer lock
activation.

* Source/WebCore/loader/EmptyClients.h:
* Source/WebCore/page/ChromeClient.h:
* Source/WebCore/page/PointerLockController.cpp:
(WebCore::PointerLockController::rejectPromises):
(WebCore::PointerLockController::supportsUnadjustedMovement): Deleted.
* Source/WebCore/page/PointerLockController.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::hasAccessoryMousePointingDevice const):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mediaSessionManager const):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::isMousePrimaryPointingDevice):
(WebKit::hasAccessoryMousePointingDevice): Deleted.
* Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h:
* Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setHasMouseDeviceForTesting):
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.h:
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::setHasMouseDeviceForTesting):
* Tools/WebKitTestRunner/TestController.h:
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* Tools/WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::TestController::setHasMouseDeviceForTesting):

Keep hold of the shared WKMouseDeviceObserver instance and start/stop as
appropriate.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to