RESOLVED FIXED 162868
[Modern Media Controls] LayoutItem and Button classes
https://bugs.webkit.org/show_bug.cgi?id=162868
Summary [Modern Media Controls] LayoutItem and Button classes
Antoine Quint
Reported 2016-10-03 09:58:34 PDT
Now that we have the basic building blocks to render content asynchronously with LayoutNode, we need to add a class to create buttons, which is the bread and butter of the UI part of media controls.
Attachments
Patch (15.19 KB, patch)
2016-10-03 10:02 PDT, Antoine Quint
no flags
Patch for landing (15.17 KB, patch)
2016-10-03 11:00 PDT, Antoine Quint
no flags
Radar WebKit Bug Importer
Comment 1 2016-10-03 09:59:06 PDT
Antoine Quint
Comment 2 2016-10-03 10:02:20 PDT
Dean Jackson
Comment 3 2016-10-03 10:10:44 PDT
Comment on attachment 290490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290490&action=review > Source/WebCore/ChangeLog:10 > + We introduce the new Button class and its parent class LayoutItem. A Button is a class > + that we will subclass a lot in coming patches, it provides a way to create a button We will subclass Button a lot in coming patches, as it... > Source/WebCore/Modules/modern-media-controls/controls/button.js:32 > + element: `<button>`, Why not use just a "" string here? > Source/WebCore/Modules/modern-media-controls/controls/button.js:36 > + this._enabled = true; Would you ever want to call the delegate at this point? > Source/WebCore/Modules/modern-media-controls/controls/layout-item.js:36 > + constructor({ element = null, layoutDelegate = null } = {}) Nice. I'd forgotten about this syntax. > LayoutTests/media/modern-media-controls/button/button.html:30 > +button.uiDelegate = { > + > + buttonWasClicked(aButton) > + { > + clickedButton = aButton; > + shouldBeTrue("clickedButton === button"); > + } > + > +} This syntax is nuts. I really wanted to see buttonWasClicked: function (aButton)... > LayoutTests/media/modern-media-controls/layout-item/layout-item.html:12 > + > + get layoutTraits() Nit: blank line isn't really needed
Antoine Quint
Comment 4 2016-10-03 10:58:15 PDT
(In reply to comment #3) > Comment on attachment 290490 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=290490&action=review > > > Source/WebCore/ChangeLog:10 > > + We introduce the new Button class and its parent class LayoutItem. A Button is a class > > + that we will subclass a lot in coming patches, it provides a way to create a button > > We will subclass Button a lot in coming patches, as it... > > > Source/WebCore/Modules/modern-media-controls/controls/button.js:32 > > + element: `<button>`, > > Why not use just a "" string here? Sure. > > Source/WebCore/Modules/modern-media-controls/controls/button.js:36 > > + this._enabled = true; > > Would you ever want to call the delegate at this point? The need for that hasn't arisen yet. > > Source/WebCore/Modules/modern-media-controls/controls/layout-item.js:36 > > + constructor({ element = null, layoutDelegate = null } = {}) > > Nice. I'd forgotten about this syntax. Yes, default parameter values and object deconstruction is a fine pair. > > LayoutTests/media/modern-media-controls/button/button.html:30 > > +button.uiDelegate = { > > + > > + buttonWasClicked(aButton) > > + { > > + clickedButton = aButton; > > + shouldBeTrue("clickedButton === button"); > > + } > > + > > +} > > This syntax is nuts. I really wanted to see buttonWasClicked: function > (aButton)... Sure, we can write it this way. > > LayoutTests/media/modern-media-controls/layout-item/layout-item.html:12 > > + > > + get layoutTraits() > > Nit: blank line isn't really needed Will remove.
Antoine Quint
Comment 5 2016-10-03 11:00:58 PDT
Created attachment 290492 [details] Patch for landing
WebKit Commit Bot
Comment 6 2016-10-03 13:33:33 PDT
Comment on attachment 290492 [details] Patch for landing Clearing flags on attachment: 290492 Committed r206745: <http://trac.webkit.org/changeset/206745>
WebKit Commit Bot
Comment 7 2016-10-03 13:33:38 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.