Changeset 228947 in webkit
- Timestamp:
- Feb 23, 2018 5:53:13 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228935 r228947 1 2018-02-22 Antoine Quint <graouts@apple.com> 2 3 REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=183074 5 <rdar://problem/37747028> 6 7 Reviewed by Eric Carlson. 8 9 Add a new test that set controls on the video, then immediately removes them, plays the video and turns the controls 10 back on as soon as the video starts to check that the "showsStartButton" property is false on the media controls. 11 Prior to this patch this test would fail. 12 13 * media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play-expected.txt: Added. 14 * media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html: Added. 15 * platform/ios/TestExpectations: 16 1 17 2018-02-22 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/LayoutTests/platform/ios/TestExpectations
r228883 r228947 3201 3201 media/modern-media-controls/seek-forward-support [ Skip ] 3202 3202 media/modern-media-controls/start-support/start-support-click-to-start.html [ Skip ] 3203 media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html [ Skip ] 3203 3204 media/modern-media-controls/start-support/start-support-lowPowerMode.html [ Skip ] 3204 3205 media/modern-media-controls/volume-down-support [ Skip ] -
trunk/Source/WebCore/ChangeLog
r228946 r228947 1 2018-02-22 Antoine Quint <graouts@apple.com> 2 3 REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=183074 5 <rdar://problem/37747028> 6 7 Reviewed by Eric Carlson. 8 9 Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html 10 11 In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media 12 element we stop listening to the bulk of media events and prevent controls from updating any DOM properties 13 so as to minimize the amount of CPU usage by the Web process. 14 15 An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing, 16 the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed" 17 property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning 18 "false". As a result, if the "controls" attribute was turned back on after the media started playing, they 19 would default to showing the start button, which would be then in the play state, ie. showing the pause icon. 20 21 We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered 22 regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on 23 the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back 24 to "true" from a previous "false" value. 25 26 * Modules/modern-media-controls/media/media-controller.js: 27 (MediaController.prototype.handleEvent): 28 * Modules/modern-media-controls/media/start-support.js: 29 (StartSupport): 30 (StartSupport.prototype.enable): 31 (StartSupport.prototype.handleEvent): 32 (StartSupport.prototype._updateShowsStartButton): 33 1 34 2018-02-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 35 -
trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js
r228718 r228947 170 170 scheduler.flushScheduledLayoutCallbacks(); 171 171 } else if (event.currentTarget === this.media) { 172 if (event.type === "play") 173 this.hasPlayed = true; 172 174 this._updateControlsIfNeeded(); 173 175 this._updateControlsAvailability(); -
trunk/Source/WebCore/Modules/modern-media-controls/media/start-support.js
r219621 r228947 31 31 super(mediaController); 32 32 33 this. mediaController.controls.showsStartButton = this._shouldShowStartButton();33 this._updateShowsStartButton(); 34 34 } 35 35 … … 41 41 } 42 42 43 enable() 44 { 45 super.enable(); 46 47 this._updateShowsStartButton(); 48 } 49 43 50 buttonWasPressed(control) 44 51 { … … 48 55 handleEvent(event) 49 56 { 50 if (event.type === "play") 51 this.mediaController.hasPlayed = true; 57 super.handleEvent(event); 52 58 53 this.mediaController.controls.showsStartButton = this._shouldShowStartButton(); 54 55 super.handleEvent(event); 59 this._updateShowsStartButton(); 56 60 } 57 61 58 62 // Private 63 64 _updateShowsStartButton() 65 { 66 this.mediaController.controls.showsStartButton = this._shouldShowStartButton(); 67 } 59 68 60 69 _shouldShowStartButton()
Note: See TracChangeset
for help on using the changeset viewer.