Changeset 212872 in webkit


Ignore:
Timestamp:
Feb 22, 2017 6:55:59 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
https://bugs.webkit.org/show_bug.cgi?id=168755
<rdar://problem/30664484>

Patch by Antoine Quint <Antoine Quint> on 2017-02-22
Reviewed by Dean Jackson.

Source/WebCore:

We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
with an event type and target combination that was specifically registered in this class's scope.
We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
https://bugs.webkit.org/show_bug.cgi?id=168515.

Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html

  • Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:

(MacOSFullscreenMediaControls.prototype.handleEvent):
(MacOSFullscreenMediaControls.prototype._handleMousedown):

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

(MacOSMediaControls.prototype.handleEvent):
(MacOSMediaControls):

LayoutTests:

Add a dedicated test for fullscreen to check that clicking on the video correctly toggles playback.

  • media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen-expected.txt: Added.
  • media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html: Added.
  • platform/ios-simulator/TestExpectations:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r212869 r212872  
     12017-02-22  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=168755
     5        <rdar://problem/30664484>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a dedicated test for fullscreen to check that clicking on the video correctly toggles playback.
     10
     11        * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen-expected.txt: Added.
     12        * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html: Added.
     13        * platform/ios-simulator/TestExpectations:
     14
    1152017-02-22  Antoine Quint  <graouts@apple.com>
    216
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r212845 r212872  
    28132813media/modern-media-controls/media-documents/click-on-video-should-not-pause.html [ Skip ]
    28142814media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html [ Skip ]
     2815media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html [ Skip ]
    28152816media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html [ Skip ]
    28162817media/modern-media-controls/media-controller/media-controller-click-on-video-controls-should-not-pause.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r212869 r212872  
     12017-02-22  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=168755
     5        <rdar://problem/30664484>
     6
     7        Reviewed by Dean Jackson.
     8
     9        We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
     10        with an event type and target combination that was specifically registered in this class's scope.
     11        We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
     12        https://bugs.webkit.org/show_bug.cgi?id=168515.
     13
     14        Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html
     15
     16        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
     17        (MacOSFullscreenMediaControls.prototype.handleEvent):
     18        (MacOSFullscreenMediaControls.prototype._handleMousedown):
     19        * Modules/modern-media-controls/controls/macos-media-controls.js:
     20        (MacOSMediaControls.prototype.handleEvent):
     21        (MacOSMediaControls):
     22
    1232017-02-22  Antoine Quint  <graouts@apple.com>
    224
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js

    r212573 r212872  
    7474        this.controlsBar.children = [new BackgroundTint, this._leftContainer, this._centerContainer, this._rightContainer, this.timeControl];
    7575
    76         this.element.addEventListener("mousedown", this);
     76        this.controlsBar.element.addEventListener("mousedown", this);
    7777    }
    7878
     
    9292    handleEvent(event)
    9393    {
    94         switch (event.type) {
    95         case "mousedown":
     94        if (event.type === "mousedown" && event.currentTarget === this.controlsBar.element)
    9695            this._handleMousedown(event);
    97             break;
    98         case "mousemove":
     96        else if (event.type === "mousemove" && event.currentTarget === this.element)
    9997            this._handleMousemove(event);
    100             break;
    101         case "mouseup":
     98        else if (event.type === "mouseup" && event.currentTarget === this.element)
    10299            this._handleMouseup(event);
    103             break;
    104         }
     100        else
     101            super.handleEvent(event);
    105102    }
    106103
     
    129126    _handleMousedown(event)
    130127    {
    131         super.handleEvent(event);
    132 
    133         if (event.target !== this.controlsBar.element)
    134             return;
    135 
    136128        event.preventDefault();
     129        event.stopPropagation();
    137130
    138131        this._lastDragPoint = this._pointForEvent(event);
  • trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.js

    r212573 r212872  
    6969        // Only notify that the background was clicked when the "mousedown" event
    7070        // was also received, which wouldn't happen if the "mousedown" event caused
    71         // the tracks panel to be hidden.
    72         if (event.type === "mousedown")
     71        // the tracks panel to be hidden, unless we're in fullscreen in which case
     72        // we can simply check that the panel is not currently presented.
     73        if (event.type === "mousedown" && !this.tracksPanel.presented)
    7374            this._receivedMousedown = true;
    7475        else if (event.type === "click") {
Note: See TracChangeset for help on using the changeset viewer.