[webkit-changes] [WebKit/WebKit] f4cdea: Videos autoplay with sound on cnn.com pages after ...

Jer Noble noreply at github.com
Sat Jul 1 11:33:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f4cdea7383ed11bb27fa41d08605d64dec72e530
      https://github.com/WebKit/WebKit/commit/f4cdea7383ed11bb27fa41d08605d64dec72e530
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2023-07-01 (Sat, 01 Jul 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/fast/html/transient-activation-expected.txt
    A LayoutTests/fast/html/transient-activation.html
    M LayoutTests/fullscreen/requestFullscreen-escape-key-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-keyboard-enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-keyboard-escape-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-mouse-left-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-pointerevent_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/user-activation/no-activation-thru-escape-key-expected.txt
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/ios-wk2/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac-wk1/TestExpectations
    M LayoutTests/platform/mac/TestExpectations
    M Source/WebCore/dom/UserGestureIndicator.cpp
    M Source/WebCore/dom/UserGestureIndicator.h
    M Source/WebCore/page/EventHandler.cpp

  Log Message:
  -----------
  Videos autoplay with sound on cnn.com pages after refresh in Safari
https://bugs.webkit.org/show_bug.cgi?id=258696
rdar://110343800

Reviewed by Chris Dumez.

The HTML specification defines a very narrow set of gesture events
which will cause activation. WebKit currently triggers activation
for all uses of UserGestureIndicator, which leads to things like
"LeftCmd Up" after a Cmd-R to trigger playback during a reload.

Add a set of helper methods `userGestureTypeForPlatformEvent()` to
return the correct UserGestureType for a particular PlatformEvent.

Update UserGestureIndicator to only set the activation timestamp of
the window when passed a UserGestureType::ActivationTriggering.

Make UserGestureType::ActivationTriggering the default to handle
the currently large set of call sites that expect a user gesture
to be triggered from a programmatic call.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-keyboard-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-keyboard-escape-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/user-activation/activation-trigger-mouse-left-expected.txt:
* Source/WebCore/dom/UserGestureIndicator.cpp:
* Source/WebCore/dom/UserGestureIndicator.h:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::userGestureTypeForPlatformEvent):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::internalKeyEvent):
(WebCore::EventHandler::handleTouchEvent):

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




More information about the webkit-changes mailing list