Changeset 214426 in webkit


Ignore:
Timestamp:
Mar 27, 2017 12:44:09 PM (7 years ago)
Author:
graouts@webkit.org
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.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r214425 r214426  
     12017-03-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
     4        https://bugs.webkit.org/show_bug.cgi?id=168517
     5        <rdar://problem/30577636>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * media/video-click-dblckick-standalone.html: We disable modern-media-controls here since we know that this test won't pass with them on.
     10
    1112017-03-27  Ryan Haddad  <ryanhaddad@apple.com>
    212
  • trunk/LayoutTests/media/video-click-dblckick-standalone.html

    r120416 r214426  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
    12<html>
    23    <head>
  • trunk/Source/WebCore/ChangeLog

    r214421 r214426  
     12017-03-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
     4        https://bugs.webkit.org/show_bug.cgi?id=168517
     5        <rdar://problem/30577636>
     6
     7        Reviewed by Dean Jackson.
     8
     9        We completely turn off default event handling in MediaDocument.cpp since we're implementing the
     10        behavior we expect to pause and resume the video in the modern-media-controls module already. This
     11        gets rid of this odd case where the content would not see the "click" event while the C++ side would
     12        handle it and pause the video.
     13
     14        * Modules/modern-media-controls/media/media-controller.js:
     15        (MediaController):
     16        (MediaController.prototype.handleEvent):
     17        (MediaController.prototype._containerWasClicked): Deleted.
     18        * html/MediaDocument.cpp:
     19        (WebCore::MediaDocument::defaultEventHandler):
     20
    1212017-03-27  Youenn Fablet  <youenn@apple.com>
    222
  • trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js

    r214411 r214426  
    3737        this.container = shadowRoot.appendChild(document.createElement("div"));
    3838        this.container.className = "media-controls-container";
    39         this.container.addEventListener("click", this, true);
    4039
    4140        if (host) {
     
    134133            // We must immediately perform layouts so that we don't lag behind the media layout size.
    135134            scheduler.flushScheduledLayoutCallbacks();
    136         } else if (event.type === "click" && event.currentTarget === this.container)
    137             this._containerWasClicked(event);
    138         else if (event.currentTarget === this.media) {
     135        } else if (event.currentTarget === this.media) {
    139136            this._updateControlsIfNeeded();
    140137            if (event.type === "webkitpresentationmodechanged")
     
    144141
    145142    // Private
    146 
    147     _containerWasClicked(event)
    148     {
    149         // We need to call preventDefault() here since, in the case of Media Documents,
    150         // playback may be toggled when clicking on the video.
    151         event.preventDefault();
    152     }
    153143
    154144    _updateControlsIfNeeded()
  • trunk/Source/WebCore/html/MediaDocument.cpp

    r214411 r214426  
    182182void MediaDocument::defaultEventHandler(Event& event)
    183183{
    184     // Match the default Quicktime plugin behavior to allow
     184    // Modern media controls have their own event handling to determine when to
     185    // pause or resume playback.
     186    if (RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled())
     187        return;
     188   
     189    // Match the default Quicktime plugin behavior to allow
    185190    // clicking and double-clicking to pause and play the media.
    186191    Node* targetNode = event.target()->toNode();
Note: See TracChangeset for help on using the changeset viewer.