[Modern Media Controls] Buttons container
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Oct 2016 12:52:28 +0000 (12:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Oct 2016 12:52:28 +0000 (12:52 +0000)
commitd729f77dacbc0395388a63540af41f2027021017
tree3df341fc534f0c132ed37d0f4c8ee9bf98d90276
parent472986b69fff60352e5ae2e11a479550bef98d00
[Modern Media Controls] Buttons container
https://bugs.webkit.org/show_bug.cgi?id=163238
<rdar://problem/28701864>

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

Source/WebCore:

We add a new ButtonsContainer class which contains a group of Button objects
and positions them based on the provided padding and margin between buttons.
Buttons that aren't enabled or marked as dropped are not added to the tree of
LayoutNodes, and thus the DOM.

Additionally, we fix a few issues we found while working on tests for ButtonsContainer
where LayoutNodes would schedule layout callbacks even when they would not do any work
during the layout callback due to not resetting the `needsLayout` flag to false and
removing any scheduled tasks when a layout was completed.

Finally, we fix a few style issues that had not been caught so far and an unused
`size` property on IconButton.

Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
       media/modern-media-controls/buttons-container/buttons-container-constructor.html
       media/modern-media-controls/buttons-container/buttons-container-layout.html

* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.set on):
(AirplayButton):
* Modules/modern-media-controls/controls/buttons-container.css:
(.buttons-container):
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.get buttons):
(ButtonsContainer.prototype.set buttons):
(ButtonsContainer.prototype.layout):
* Modules/modern-media-controls/controls/icon-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set needsLayout):
(LayoutNode.prototype.markDirtyProperty):
(LayoutNode.prototype._markNodeManipulation):
(LayoutNode.prototype._updateDirtyState):
(performScheduledLayout):
(elementFromString):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.unscheduleLayout):

LayoutTests:

Adding tests for the new ButtonsContainer class.

* media/modern-media-controls/buttons-container/buttons-container-buttons-property-expected.txt: Added.
* media/modern-media-controls/buttons-container/buttons-container-buttons-property.html: Added.
* media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt: Added.
* media/modern-media-controls/buttons-container/buttons-container-constructor.html: Added.
* media/modern-media-controls/buttons-container/buttons-container-layout-expected.txt: Added.
* media/modern-media-controls/buttons-container/buttons-container-layout.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-buttons-property-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-buttons-property.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-constructor.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-layout-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-layout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/buttons-container.css [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/controls/icon-button.js
Source/WebCore/Modules/modern-media-controls/controls/layout-node.js
Source/WebCore/Modules/modern-media-controls/controls/scheduler.js