[Modern Media Controls] Show an invalid placard when we fail to load a media file
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 03:05:55 +0000 (03:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 03:05:55 +0000 (03:05 +0000)
commit461dc1573ee659e37275d71d22289b60c5319465
tree4decee79df4f20d1fd9fa6ad75a9962e929b129d
parent4c714dbf329c4035d774709e1566097b04e6121e
[Modern Media Controls] Show an invalid placard when we fail to load a media file
https://bugs.webkit.org/show_bug.cgi?id=165180

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

Source/WebCore:

We now show a placard with an "invalid" icon when we fail to load the media file.

Tests: media/modern-media-controls/invalid-placard/invalid-placard.html
       media/modern-media-controls/placard-support/placard-support-error.html

* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/invalid-placard.js: Added.
(InvalidPlacard):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get showsStartButton):
(MediaControls.prototype.set showsStartButton):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.hidePlacard):
(MediaControls.prototype._invalidateChildren):
* Modules/modern-media-controls/controls/placard.css:
(.placard .icon):
* Modules/modern-media-controls/images/iOS/invalid-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/invalid-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/invalid-placard@3x.png: Added.
* Modules/modern-media-controls/images/macOS/invalid-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/invalid-placard@2x.png: Added.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

We add tests for the new InvalidPlacard class.

* media/modern-media-controls/invalid-placard/invalid-placard-expected.txt: Added.
* media/modern-media-controls/invalid-placard/invalid-placard.html: Added.
* 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/media-controls/media-controls-placard-expected.txt:
* media/modern-media-controls/media-controls/media-controls-placard.html:
* media/modern-media-controls/placard-support/placard-support-error-expected.txt: Added.
* media/modern-media-controls/placard-support/placard-support-error.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/invalid-placard/invalid-placard-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/invalid-placard/invalid-placard.html [new file with mode: 0644]
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/media-controls/media-controls-placard-expected.txt
LayoutTests/media/modern-media-controls/media-controls/media-controls-placard.html
LayoutTests/media/modern-media-controls/placard-support/placard-support-error-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/placard-support/placard-support-error.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/icon-service.js
Source/WebCore/Modules/modern-media-controls/controls/invalid-placard.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/controls/media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/placard.css
Source/WebCore/Modules/modern-media-controls/images/iOS/invalid-placard@1x.png [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/images/iOS/invalid-placard@2x.png [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/images/iOS/invalid-placard@3x.png [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/images/macOS/invalid-placard@1x.png [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/images/macOS/invalid-placard@2x.png [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/js-files
Source/WebCore/Modules/modern-media-controls/media/placard-support.js
Source/WebCore/WebCore.xcodeproj/project.pbxproj