Prevent clicks in the placeholder from playing or pausing the video in a MediaDocument.
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 May 2016 22:13:10 +0000 (22:13 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 May 2016 22:13:10 +0000 (22:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157625

Reviewed by Jer Noble.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls):
(Controller.prototype.handlePlaceholderClick):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

index ce75937..0bead7f 100644 (file)
@@ -1,3 +1,14 @@
+2016-05-12  Ada Chan  <adachan@apple.com>
+
+        Prevent clicks in the placeholder from playing or pausing the video in a MediaDocument.
+        https://bugs.webkit.org/show_bug.cgi?id=157625
+
+        Reviewed by Jer Noble.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.createControls):
+        (Controller.prototype.handlePlaceholderClick):
+
 2016-05-12  Chris Dumez  <cdumez@apple.com>
 
         Drop toJS() overload taking a PassRefPtr<> parameter
index 5c09f43..6dce991 100644 (file)
@@ -493,6 +493,8 @@ Controller.prototype = {
         var inlinePlaybackPlaceholder = this.controls.inlinePlaybackPlaceholder = document.createElement('div');
         inlinePlaybackPlaceholder.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-status');
         inlinePlaybackPlaceholder.setAttribute('aria-label', this.UIString('Video Playback Placeholder'));
+        this.listenFor(inlinePlaybackPlaceholder, 'click', this.handlePlaceholderClick);
+        this.listenFor(inlinePlaybackPlaceholder, 'dblclick', this.handlePlaceholderClick);
         if (!Controller.gSimulatePictureInPictureAvailable)
             inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
 
@@ -974,6 +976,12 @@ Controller.prototype = {
         event.preventDefault();
     },
 
+    handlePlaceholderClick: function(event)
+    {
+        // Prevent clicks in the placeholder from playing or pausing the video in a MediaDocument.
+        event.preventDefault();
+    },
+
     handleRewindButtonClicked: function(event)
     {
         var newTime = Math.max(