[Modern Media Controls] Adhere to tight padding on iOS
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 02:18:17 +0000 (02:18 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 02:18:17 +0000 (02:18 +0000)
commit58d82a1e9bf983cebc887781e39b1d377b36102d
treeade58598f95ce7f268804b21e0f88d078f8b5caf
parentacf6273443ed518aaa2698a088b08beeb48db638
[Modern Media Controls] Adhere to tight padding on iOS
https://bugs.webkit.org/show_bug.cgi?id=168949
<rdar://problem/30746164>

Reviewed by Jon Lee.

Source/WebCore:

We used to only support custom margins on macOS, to support this on iOS as
well, we promote the notification when the layoutTraits property is set to
MediaControls and expose a new protected method layoutTraitsDidChange() for
subclasses to implement. IOSInlineMediaControls now implements that method
and will use tighter margins for the TightPadding layout trait.

Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html

* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.layoutTraitsDidChange):
(IOSInlineMediaControls):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
(MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
(MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get layoutTraits):
(MediaControls.prototype.set layoutTraits):
(MediaControls.prototype.layoutTraitsDidChange):

LayoutTests:

Adding a new test for the TightPadding layout trait on iOS.

* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding-expected.txt: Added.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/ios-inline-media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/media-controls.js