[Modern Media Controls] Basic MediaController
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 22:03:16 +0000 (22:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 22:03:16 +0000 (22:03 +0000)
commitc4451fc1eafee5ea25fafb3d1a32186edbd6cfa6
treef694bf2d820451a4028aaf4e91e2eedc969e6d53
parenta926195fa2656329bf3c9a4ae382504eba76a67d
[Modern Media Controls] Basic MediaController
https://bugs.webkit.org/show_bug.cgi?id=163539
<rdar://problem/28797542>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-17
Reviewed by Darin Adler.

Source/WebCore:

We add a new main.js file which acts as the entry point by implementing the createControls()
function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
been created. That functions creates an instance of the new MediaController class, which is
the controller object that will handle communication between the media controls and the media
element. At first, this MediaController class is very limited and assumes macOS inline
layout traits and forces a start button to be shown over the media, which can be played
to start the media and show the full controls. More functionality will be added by future patches.

Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
       media/modern-media-controls/media-controller/media-controller-constructor.html
       media/modern-media-controls/media-controller/media-controller-resize.html

* Modules/modern-media-controls/main.js: Added.
(createControls):
* Modules/modern-media-controls/media/media-controller.js: Added.
(MediaController):
(MediaController.prototype.set pageScaleFactor):
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype.handleEvent):
(MediaController.prototype.buttonWasClicked):
(MediaController.prototype._updateControlsSize):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):

LayoutTests:

Testing the properties of the new MediaController class and the availability and behavior of the
createControls() global function.

* media/modern-media-controls/media-controller/media-controller-click-to-start-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-click-to-start.html: Added.
* media/modern-media-controls/media-controller/media-controller-constructor-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-constructor.html: Added.
* media/modern-media-controls/media-controller/media-controller-resize-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-resize.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/media-controller/media-controller-click-to-start-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/media-controller/media-controller-click-to-start.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/media-controller/media-controller-constructor-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/media-controller/media-controller-constructor.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/media-controller/media-controller-resize-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/media-controller/media-controller-resize.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/main.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/media/media-controller.js [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/rendering/RenderThemeMac.mm