[Modern Media Controls] Only show controls when the controls attribute is set
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 02:26:04 +0000 (02:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 02:26:04 +0000 (02:26 +0000)
commit30a46de27ab78b158cf0d6b78447fb48451f46d7
treecbdd5743547184515c61ebacfe186d1e6768e38a
parente0df786310b547b27760cd2ca5883bcd3cb5c7a5
[Modern Media Controls] Only show controls when the controls attribute is set
https://bugs.webkit.org/show_bug.cgi?id=165175

Source/WebCore:

We now respect the value of the media's "controls" attribute so that the start button and the controls
bar are only shown when that attribute is set to "true".

Patch by Antoine Quint <graouts@apple.com> on 2016-11-29
Reviewed by Dean Jackson.

Tests: media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html

* Modules/modern-media-controls/controls/controls-bar.js: Added.
(ControlsBar):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.): Deleted.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/controls-visibility-support.js: Added.
(ControlsVisibilitySupport):
(ControlsVisibilitySupport.prototype.destroy):
(ControlsVisibilitySupport.prototype.get mediaEvents):
(ControlsVisibilitySupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport):
(MediaControllerSupport.prototype.handleEvent):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

We add new tests to check that the media's "control" attribute is respected. We also update a
series of tests to be more robust and turn the media "controls" attribute on so that the controls
bar is displayed as required by the tests.

Patch by Antoine Quint <graouts@apple.com> on 2016-11-29
Reviewed by Dean Jackson.

* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html: Added.
* media/modern-media-controls/fullscreen-support/fullscreen-support-click.html:
* media/modern-media-controls/media-controls/media-controls-constructor-expected.txt:
* media/modern-media-controls/media-controls/media-controls-constructor.html:
* media/modern-media-controls/pip-support/pip-support-click.html:
* media/modern-media-controls/placard-support/placard-support-airplay.html:
* media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt:
* media/modern-media-controls/scrubber-support/scrubber-support-click.html:
* media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt:
* media/modern-media-controls/scrubber-support/scrubber-support-drag.html:
* media/modern-media-controls/volume-support/volume-support-click.html:
* media/modern-media-controls/volume-support/volume-support-drag.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click.html
LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor-expected.txt
LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor.html
LayoutTests/media/modern-media-controls/pip-support/pip-support-click.html
LayoutTests/media/modern-media-controls/placard-support/placard-support-airplay.html
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click.html
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag.html
LayoutTests/media/modern-media-controls/volume-support/volume-support-click.html
LayoutTests/media/modern-media-controls/volume-support/volume-support-drag.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/controls/media-controls.js
Source/WebCore/Modules/modern-media-controls/js-files
Source/WebCore/Modules/modern-media-controls/media/controls-visibility-support.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js
Source/WebCore/Modules/modern-media-controls/media/media-controller.js
Source/WebCore/WebCore.xcodeproj/project.pbxproj