Changeset 211339 in webkit


Ignore:
Timestamp:
Jan 28, 2017 10:16:41 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
https://bugs.webkit.org/show_bug.cgi?id=167552
<rdar://problem/29601646>

Patch by Antoine Quint <Antoine Quint> on 2017-01-28
Reviewed by Eric Carlson.

Source/WebCore:

In the case of media documents, there is a built-in behavior, implemented in MediaDocument::defaultEventHandler(),
that toggles playback when clicking or double-clicking the video. We disable this behavior by adding a "click" event
handler on the entire media shadow root and calling "preventDefault()".

Test: media/modern-media-controls/media-documents/click-on-video-should-not-pause.html

  • Modules/modern-media-controls/media/media-controller.js:

(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._containerWasClicked):

LayoutTests:

Add a new test that checks that clicking on a <video> within a media document does not paused after being clicked.
Since this behavior uses click events, we use window.eventSender and skip this test on iOS.

  • media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt: Added.
  • media/modern-media-controls/media-documents/click-on-video-should-not-pause.html: Added.
  • platform/ios-simulator/TestExpectations:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211337 r211339  
     12017-01-28  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
     4        https://bugs.webkit.org/show_bug.cgi?id=167552
     5        <rdar://problem/29601646>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Add a new test that checks that clicking on a <video> within a media document does not paused after being clicked.
     10        Since this behavior uses click events, we use window.eventSender and skip this test on iOS.
     11
     12        * media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt: Added.
     13        * media/modern-media-controls/media-documents/click-on-video-should-not-pause.html: Added.
     14        * platform/ios-simulator/TestExpectations:
     15
    1162017-01-28  Zalan Bujtas  <zalan@apple.com>
    217
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r211250 r211339  
    28012801media/modern-media-controls/media-controller/media-controller-auto-hide-rewind-with-mouse-enter.html [ Skip ]
    28022802media/modern-media-controls/scrubber-support/scrubber-support-click.html [ Skip ]
     2803media/modern-media-controls/media-documents/click-on-video-should-not-pause.html [ Skip ]
    28032804
    28042805# Tests designed for macOS that have iOS equivalents in "ipad" directories
  • trunk/Source/WebCore/ChangeLog

    r211338 r211339  
     12017-01-28  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
     4        https://bugs.webkit.org/show_bug.cgi?id=167552
     5        <rdar://problem/29601646>
     6
     7        Reviewed by Eric Carlson.
     8
     9        In the case of media documents, there is a built-in behavior, implemented in MediaDocument::defaultEventHandler(),
     10        that toggles playback when clicking or double-clicking the video. We disable this behavior by adding a "click" event
     11        handler on the entire media shadow root and calling "preventDefault()".
     12
     13        Test: media/modern-media-controls/media-documents/click-on-video-should-not-pause.html
     14
     15        * Modules/modern-media-controls/media/media-controller.js:
     16        (MediaController):
     17        (MediaController.prototype.handleEvent):
     18        (MediaController.prototype._containerWasClicked):
     19
    1202017-01-28  Dan Bernstein  <mitz@apple.com>
    221
  • trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js

    r209615 r211339  
    3535        this.container = shadowRoot.appendChild(document.createElement("div"));
    3636        this.container.className = "media-controls-container";
     37        this.container.addEventListener("click", this, true);
    3738
    3839        if (host) {
     
    7980        if (event.type === "resize" && event.currentTarget === this.shadowRoot)
    8081            this._updateControlsSize();
     82        else if (event.type === "click" && event.currentTarget === this.container)
     83            this._containerWasClicked(event);
    8184        else if (event.currentTarget === this.media) {
    8285            this._updateControlsIfNeeded();
     
    8790
    8891    // Private
     92
     93    _containerWasClicked(event)
     94    {
     95        // We need to call preventDefault() here since, in the case of Media Documents,
     96        // playback may be toggled when clicking on the video.
     97        event.preventDefault();
     98    }
    8999
    90100    _updateControlsIfNeeded()
Note: See TracChangeset for help on using the changeset viewer.