Title: [214426] trunk
- Revision
- 214426
- Author
- [email protected]
- Date
- 2017-03-27 12:44:09 -0700 (Mon, 27 Mar 2017)
Log Message
[Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
https://bugs.webkit.org/show_bug.cgi?id=168517
<rdar://problem/30577636>
Reviewed by Dean Jackson.
Source/WebCore:
We completely turn off default event handling in MediaDocument.cpp since we're implementing the
behavior we expect to pause and resume the video in the modern-media-controls module already. This
gets rid of this odd case where the content would not see the "click" event while the C++ side would
handle it and pause the video.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._containerWasClicked): Deleted.
* html/MediaDocument.cpp:
(WebCore::MediaDocument::defaultEventHandler):
LayoutTests:
* media/video-click-dblckick-standalone.html: We disable modern-media-controls here since we know that this test won't pass with them on.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (214425 => 214426)
--- trunk/LayoutTests/ChangeLog 2017-03-27 19:40:01 UTC (rev 214425)
+++ trunk/LayoutTests/ChangeLog 2017-03-27 19:44:09 UTC (rev 214426)
@@ -1,3 +1,13 @@
+2017-03-27 Antoine Quint <[email protected]>
+
+ [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
+ https://bugs.webkit.org/show_bug.cgi?id=168517
+ <rdar://problem/30577636>
+
+ Reviewed by Dean Jackson.
+
+ * media/video-click-dblckick-standalone.html: We disable modern-media-controls here since we know that this test won't pass with them on.
+
2017-03-27 Ryan Haddad <[email protected]>
Mark media/modern-media-controls/time-label/time-label-white-space-nowrap.html as flaky.
Modified: trunk/LayoutTests/media/video-click-dblckick-standalone.html (214425 => 214426)
--- trunk/LayoutTests/media/video-click-dblckick-standalone.html 2017-03-27 19:40:01 UTC (rev 214425)
+++ trunk/LayoutTests/media/video-click-dblckick-standalone.html 2017-03-27 19:44:09 UTC (rev 214426)
@@ -1,3 +1,4 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
<html>
<head>
<script src=""
Modified: trunk/Source/WebCore/ChangeLog (214425 => 214426)
--- trunk/Source/WebCore/ChangeLog 2017-03-27 19:40:01 UTC (rev 214425)
+++ trunk/Source/WebCore/ChangeLog 2017-03-27 19:44:09 UTC (rev 214426)
@@ -1,3 +1,23 @@
+2017-03-27 Antoine Quint <[email protected]>
+
+ [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
+ https://bugs.webkit.org/show_bug.cgi?id=168517
+ <rdar://problem/30577636>
+
+ Reviewed by Dean Jackson.
+
+ We completely turn off default event handling in MediaDocument.cpp since we're implementing the
+ behavior we expect to pause and resume the video in the modern-media-controls module already. This
+ gets rid of this odd case where the content would not see the "click" event while the C++ side would
+ handle it and pause the video.
+
+ * Modules/modern-media-controls/media/media-controller.js:
+ (MediaController):
+ (MediaController.prototype.handleEvent):
+ (MediaController.prototype._containerWasClicked): Deleted.
+ * html/MediaDocument.cpp:
+ (WebCore::MediaDocument::defaultEventHandler):
+
2017-03-27 Youenn Fablet <[email protected]>
Tighten RTCDatachannel creation and parameter getters
Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js (214425 => 214426)
--- trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js 2017-03-27 19:40:01 UTC (rev 214425)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js 2017-03-27 19:44:09 UTC (rev 214426)
@@ -36,7 +36,6 @@
this.container = shadowRoot.appendChild(document.createElement("div"));
this.container.className = "media-controls-container";
- this.container.addEventListener("click", this, true);
if (host) {
host.controlsDependOnPageScaleFactor = this.layoutTraits & LayoutTraits.iOS;
@@ -133,9 +132,7 @@
this._updateControlsIfNeeded();
// We must immediately perform layouts so that we don't lag behind the media layout size.
scheduler.flushScheduledLayoutCallbacks();
- } else if (event.type === "click" && event.currentTarget === this.container)
- this._containerWasClicked(event);
- else if (event.currentTarget === this.media) {
+ } else if (event.currentTarget === this.media) {
this._updateControlsIfNeeded();
if (event.type === "webkitpresentationmodechanged")
this._returnMediaLayerToInlineIfNeeded();
@@ -144,13 +141,6 @@
// Private
- _containerWasClicked(event)
- {
- // We need to call preventDefault() here since, in the case of Media Documents,
- // playback may be toggled when clicking on the video.
- event.preventDefault();
- }
-
_updateControlsIfNeeded()
{
const layoutTraits = this.layoutTraits;
Modified: trunk/Source/WebCore/html/MediaDocument.cpp (214425 => 214426)
--- trunk/Source/WebCore/html/MediaDocument.cpp 2017-03-27 19:40:01 UTC (rev 214425)
+++ trunk/Source/WebCore/html/MediaDocument.cpp 2017-03-27 19:44:09 UTC (rev 214426)
@@ -181,7 +181,12 @@
void MediaDocument::defaultEventHandler(Event& event)
{
- // Match the default Quicktime plugin behavior to allow
+ // Modern media controls have their own event handling to determine when to
+ // pause or resume playback.
+ if (RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled())
+ return;
+
+ // Match the default Quicktime plugin behavior to allow
// clicking and double-clicking to pause and play the media.
Node* targetNode = event.target()->toNode();
if (!targetNode)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes