[Modern Media Controls] TimeControl and TimeLabel
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2016 18:45:10 +0000 (18:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2016 18:45:10 +0000 (18:45 +0000)
commit92576ea113827897a526a093fbbc78892d44c014
tree616e4aee9b5065116b3cac56d4b90c70768fc0c1
parentb8b57c1f863a43fa80584c16ca267f1564bd8cf5
[Modern Media Controls] TimeControl and TimeLabel
https://bugs.webkit.org/show_bug.cgi?id=163356
<rdar://problem/28741376>

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

Source/WebCore:

We introduce the TimeControl and TimeLabel classes. A TimeControl object
provides two TimeLabels, one for the elapsed time, one for the remaining
time, and a Scrubber in between them. Depending on a TimeControl's width,
it will adjust its layout such that the scrubber takes all the available
space between the labels, and can indicate whether it's large enough to
meet the minimal required width to show the scrubber, such that a container
node may decide not to show the TimeControl at all.

TimeLabel nodes simply show an integer time value in miliseconds in a
nicely formatted way.

Tests: media/modern-media-controls/time-control/time-control.html
       media/modern-media-controls/time-label/time-label.html

* Modules/modern-media-controls/controls/time-control.js: Added.
(TimeControl.prototype.get width):
(TimeControl.prototype.set width):
(TimeControl.prototype.get isSufficientlyWide):
* Modules/modern-media-controls/controls/time-label.css: Added.
(.time-label):
* Modules/modern-media-controls/controls/time-label.js: Added.
(TimeLabel.prototype.get value):
(TimeLabel.prototype.set value):
(TimeLabel.prototype.commitProperty):
(TimeLabel.prototype._formattedTime):

LayoutTests:

Adding tests for the new TimeControl and TimeLabel classes.

* media/modern-media-controls/time-control/time-control-expected.txt: Added.
* media/modern-media-controls/time-control/time-control.html: Added.
* media/modern-media-controls/time-label/time-label-expected.txt: Added.
* media/modern-media-controls/time-label/time-label.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/time-control/time-control-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/time-control/time-control.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/time-label/time-label-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/time-label/time-label.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/time-control.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/controls/time-label.css [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/controls/time-label.js [new file with mode: 0644]