Changeset 228960 in webkit


Ignore:
Timestamp:
Feb 23, 2018 12:30:11 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r228947. rdar://problem/37833040

Location:
branches/safari-605-branch
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/LayoutTests/ChangeLog

    r228873 r228960  
     12018-02-23  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r228947. rdar://problem/37833040
     4
     5    2018-02-22  Antoine Quint  <graouts@apple.com>
     6
     7            REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
     8            https://bugs.webkit.org/show_bug.cgi?id=183074
     9            <rdar://problem/37747028>
     10
     11            Reviewed by Eric Carlson.
     12
     13            Add a new test that set controls on the video, then immediately removes them, plays the video and turns the controls
     14            back on as soon as the video starts to check that the "showsStartButton" property is false on the media controls.
     15            Prior to this patch this test would fail.
     16
     17            * media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play-expected.txt: Added.
     18            * media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html: Added.
     19            * platform/ios/TestExpectations:
     20
    1212018-02-21  Jason Marcell  <jmarcell@apple.com>
    222
  • branches/safari-605-branch/LayoutTests/platform/ios/TestExpectations

    r228848 r228960  
    32223222media/modern-media-controls/placard-support/ipad [ Skip ]
    32233223media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html [ Skip ]
     3224media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html [ Skip ]
    32243225
    32253226# There is no focus state for on iOS
  • branches/safari-605-branch/Source/WebCore/ChangeLog

    r228958 r228960  
     12018-02-23  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r228947. rdar://problem/37833040
     4
     5    2018-02-22  Antoine Quint  <graouts@apple.com>
     6
     7            REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
     8            https://bugs.webkit.org/show_bug.cgi?id=183074
     9            <rdar://problem/37747028>
     10
     11            Reviewed by Eric Carlson.
     12
     13            Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html
     14
     15            In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media
     16            element we stop listening to the bulk of media events and prevent controls from updating any DOM properties
     17            so as to minimize the amount of CPU usage by the Web process.
     18
     19            An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing,
     20            the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed"
     21            property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning
     22            "false". As a result, if the "controls" attribute was turned back on after the media started playing, they
     23            would default to showing the start button, which would be then in the play state, ie. showing the pause icon.
     24
     25            We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered
     26            regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on
     27            the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back
     28            to "true" from a previous "false" value.
     29
     30            * Modules/modern-media-controls/media/media-controller.js:
     31            (MediaController.prototype.handleEvent):
     32            * Modules/modern-media-controls/media/start-support.js:
     33            (StartSupport):
     34            (StartSupport.prototype.enable):
     35            (StartSupport.prototype.handleEvent):
     36            (StartSupport.prototype._updateShowsStartButton):
     37
    1382018-02-23  Jason Marcell  <jmarcell@apple.com>
    239
  • branches/safari-605-branch/Source/WebCore/Modules/modern-media-controls/media/media-controller.js

    r228597 r228960  
    167167            scheduler.flushScheduledLayoutCallbacks();
    168168        } else if (event.currentTarget === this.media) {
     169            if (event.type === "play")
     170                this.hasPlayed = true;
    169171            this._updateControlsIfNeeded();
    170172            this._updateControlsAvailability();
  • branches/safari-605-branch/Source/WebCore/Modules/modern-media-controls/media/start-support.js

    r219621 r228960  
    3131        super(mediaController);
    3232
    33         this.mediaController.controls.showsStartButton = this._shouldShowStartButton();
     33        this._updateShowsStartButton();
    3434    }
    3535
     
    4141    }
    4242
     43    enable()
     44    {
     45        super.enable();
     46
     47        this._updateShowsStartButton();
     48    }
     49
    4350    buttonWasPressed(control)
    4451    {
     
    4855    handleEvent(event)
    4956    {
    50         if (event.type === "play")
    51             this.mediaController.hasPlayed = true;
     57        super.handleEvent(event);
    5258
    53         this.mediaController.controls.showsStartButton = this._shouldShowStartButton();
    54 
    55         super.handleEvent(event);
     59        this._updateShowsStartButton();
    5660    }
    5761
    5862    // Private
     63
     64    _updateShowsStartButton()
     65    {
     66        this.mediaController.controls.showsStartButton = this._shouldShowStartButton();
     67    }
    5968
    6069    _shouldShowStartButton()
Note: See TracChangeset for help on using the changeset viewer.