Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9e2aadd3a06e6cf5ef09873cf5c1d5ef2a848d79
      
https://github.com/WebKit/WebKit/commit/9e2aadd3a06e6cf5ef09873cf5c1d5ef2a848d79
  Author: Dana Estra <des...@apple.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
    M 
Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js
    M Source/WebCore/Modules/modern-media-controls/media/media-controller.js
    M Source/WebCore/dom/Document.cpp

  Log Message:
  -----------
  Fix event handling conflicts between webkit fullscreen controls and 
fullscreen controls of youtube.com and vimeo.com
https://bugs.webkit.org/show_bug.cgi?id=273889
rdar://126728057

Reviewed by Jer Noble.

Currently, when on youtube.com and an element is in in-window or standard 
fullscreen and we are displaying the default
WebKit media controls, pressing the spacebar to toggle playback does not work 
because both our event handler and youtube's
Are being executed. When in fullscreen, the keyboard events are sent to the 
HTML body, on which YouTube has a Keyup event
Listener that toggles playback if the key is a space. Because our media 
controls script is loaded after youtube's, our event
Listeners have no chance of handling the event and stopping propagation.

To fix this, this change makes it so that when a keyboard event is fired while 
a page is in fullscreen, the event is
first sent to the fullscreen element to be handled, which now has an event 
listener attached to it for keydown and
Keyup events and stops propagation after handling the spacebar event.

There is also a problem on YouTube.com and Vimeo.com where the website toggles 
playback when the user clicks or drags the
fullscreen bottom controls bar. To fix this, I attached a click event listener 
to the controls bar. The event handler
Stops propagation. There is no need for the webpage's event handlers to be 
executed at all if the user
Is clicking on our controls bar.

* 
Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
* Source/WebCore/Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
* Source/WebCore/dom/Document.cpp:
(WebCore::eventTargetElementForDocument):

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



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

Reply via email to