[Modern Media Controls] Use compact mode by default on macOS
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 03:24:37 +0000 (03:24 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 03:24:37 +0000 (03:24 +0000)
commitbfe53bfd63539e7f6e589fec0c1946df664cbddd
treec5f2615f64ae2f7fd1cd312783ba4397dad82068
parenta17828ef5042b9d59aafa5ccc2c2de4aef568d1e
[Modern Media Controls] Use compact mode by default on macOS
https://bugs.webkit.org/show_bug.cgi?id=168958
<rdar://problem/30748638>

Reviewed by Jon Lee.

Source/WebCore:

We now use the compact layout mode by default on macOS.

* Modules/modern-media-controls/controls/layout-item.js: Remove the ReducedPadding trait.
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
(.media-controls.mac.inline.compact .time-label,): Vertically align the time label with
the scrubber in compact mode.
(.media-controls.mac.inline.compact .scrubber.slider): Correctly position the scrubber in
compact mode so that it's vertically aligned.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Remove handling of tight and
reduced padding traits since these do not apply to macOS anymore. We also notify the
scrubber of a layout trait change so that it may adjust its height.
* Modules/modern-media-controls/controls/scrubber.js:
(Scrubber):
(Scrubber.prototype.layoutTraitsDidChange): Adjust the height of the scrubber to match
compact layout traits.
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.get isSufficientlyWide): Adjust the minimum scrubber width for
TimeControl visibility to match compact layout traits.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits): Use the compact layout trait by default
on macOS and make the tight padding specific to iOS.

LayoutTests:

Rebaseline tests to account for compact mode being the default mode for macOS
and remove tests that would check dynamically applying compact mode at some
threshold and the reduced padding mode.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html: Removed.
* media/modern-media-controls/media-controller/media-controller-compact.html:
* media/modern-media-controls/media-controller/media-controller-fullscreen-change-expected.txt:
* media/modern-media-controls/media-controller/media-controller-fullscreen-change.html:
* media/modern-media-controls/media-controller/media-controller-reduced-padding-expected.txt: Removed.
* media/modern-media-controls/media-controller/media-controller-reduced-padding.html: Removed.
* media/modern-media-controls/media-controller/media-controller-toggle-compact-mode-expected.txt: Removed.
* media/modern-media-controls/media-controller/media-controller-toggle-compact-mode.html: Removed.
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-expected.txt
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding-expected.txt [deleted file]
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html [deleted file]
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding-expected.txt [deleted file]
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html [deleted file]
LayoutTests/media/modern-media-controls/media-controller/media-controller-compact.html
LayoutTests/media/modern-media-controls/media-controller/media-controller-fullscreen-change-expected.txt
LayoutTests/media/modern-media-controls/media-controller/media-controller-fullscreen-change.html
LayoutTests/media/modern-media-controls/media-controller/media-controller-reduced-padding-expected.txt [deleted file]
LayoutTests/media/modern-media-controls/media-controller/media-controller-reduced-padding.html [deleted file]
LayoutTests/media/modern-media-controls/media-controller/media-controller-toggle-compact-mode-expected.txt [deleted file]
LayoutTests/media/modern-media-controls/media-controller/media-controller-toggle-compact-mode.html [deleted file]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/layout-item.js
Source/WebCore/Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css
Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/scrubber.js
Source/WebCore/Modules/modern-media-controls/controls/time-control.js
Source/WebCore/Modules/modern-media-controls/media/media-controller.js