[webkit-changes] [WebKit/WebKit] 6d29a3: VibrationActuator should stop vibrating when its d...

Chris Dumez noreply at github.com
Wed Jan 11 13:20:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d29a35a2b0da6ab9ae6756dd7eb262fc77a51a2
      https://github.com/WebKit/WebKit/commit/6d29a35a2b0da6ab9ae6756dd7eb262fc77a51a2
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    A LayoutTests/gamepad/gamepad-vibration-document-no-longer-fully-active-expected.txt
    A LayoutTests/gamepad/gamepad-vibration-document-no-longer-fully-active.html
    A LayoutTests/gamepad/gamepad-vibration-visibility-change-expected.txt
    A LayoutTests/gamepad/gamepad-vibration-visibility-change.html
    M Source/WebCore/Modules/gamepad/Gamepad.cpp
    M Source/WebCore/Modules/gamepad/Gamepad.h
    M Source/WebCore/Modules/gamepad/GamepadHapticActuator.cpp
    M Source/WebCore/Modules/gamepad/GamepadHapticActuator.h
    M Source/WebCore/Modules/gamepad/GamepadHapticActuator.idl
    M Source/WebCore/Modules/gamepad/GamepadManager.cpp
    M Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp
    M Source/WebCore/Modules/gamepad/NavigatorGamepad.h
    M Source/WebCore/Modules/webxr/WebXRInputSource.cpp
    M Source/WebCore/page/Navigator.cpp
    M Source/WebCore/page/Navigator.h
    M Source/WebCore/platform/gamepad/GamepadProvider.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/MockGamepadProvider.cpp
    M Source/WebCore/testing/MockGamepadProvider.h
    M Source/WebKit/UIProcess/API/C/WKContext.cpp
    M Source/WebKit/UIProcess/API/C/WKContext.h
    M Tools/WebKitTestRunner/TestController.cpp

  Log Message:
  -----------
  VibrationActuator should stop vibrating when its document becomes hidden
https://bugs.webkit.org/show_bug.cgi?id=250414

Reviewed by Youenn Fablet.

VibrationActuator should stop vibrating when its document becomes hidden:
- https://w3c.github.io/gamepad/extensions.html#gamepadhapticactuator-interface (Page Visibility section)

Also address test flakiness by properly clearing mock gamepads between tests.
We used to call MockGamepadProvider::clearMockGamepads() inside the WebContent
process even though they are stored in the UIProcess nowadays.

* LayoutTests/gamepad/gamepad-vibration-document-no-longer-fully-active.html: Added.
* LayoutTests/gamepad/gamepad-vibration-document-no-longer-fully-active-expected.txt: Added.
* LayoutTests/gamepad/gamepad-vibration-visibility-change-expected.txt: Added.
* LayoutTests/gamepad/gamepad-vibration-visibility-change.html: Added.
* Source/WebCore/Modules/gamepad/Gamepad.cpp:
(WebCore::Gamepad::Gamepad):
(WebCore::Gamepad::vibrationActuator):
* Source/WebCore/Modules/gamepad/Gamepad.h:
* Source/WebCore/Modules/gamepad/GamepadHapticActuator.cpp:
(WebCore::GamepadHapticActuator::create):
(WebCore::GamepadHapticActuator::GamepadHapticActuator):
(WebCore::GamepadHapticActuator::~GamepadHapticActuator):
(WebCore::GamepadHapticActuator::playEffect):
(WebCore::GamepadHapticActuator::reset):
(WebCore::GamepadHapticActuator::stopEffects):
(WebCore::GamepadHapticActuator::document):
(WebCore::GamepadHapticActuator::activeDOMObjectName const):
(WebCore::GamepadHapticActuator::suspend):
(WebCore::GamepadHapticActuator::stop):
(WebCore::GamepadHapticActuator::visibilityStateChanged):
* Source/WebCore/Modules/gamepad/GamepadHapticActuator.h:
* Source/WebCore/Modules/gamepad/GamepadHapticActuator.idl:
* Source/WebCore/Modules/gamepad/GamepadManager.cpp:
(WebCore::navigatorGamepadFromDOMWindow):
* Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp:
(WebCore::NavigatorGamepad::NavigatorGamepad):
(WebCore::NavigatorGamepad::from):
(WebCore::NavigatorGamepad::gamepadFromPlatformGamepad):
(WebCore::NavigatorGamepad::getGamepads):
(WebCore::NavigatorGamepad::gamepadsBecameVisible):
(WebCore::NavigatorGamepad::gamepadConnected):
* Source/WebCore/Modules/gamepad/NavigatorGamepad.h:
* Source/WebCore/Modules/webxr/WebXRInputSource.cpp:
(WebCore::WebXRInputSource::WebXRInputSource):
* Source/WebCore/page/Navigator.cpp:
(WebCore::Navigator::document):
* Source/WebCore/page/Navigator.h:
* Source/WebCore/testing/MockGamepad.cpp:
(WebCore::MockGamepad::MockGamepad):

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




More information about the webkit-changes mailing list