Bug 227489

Summary: [Modern Media Controls] Address additional feedback on LayoutTraits refactor
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, hi, jer.noble, joepeck, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=227423
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Sam Weinig 2021-06-29 09:39:42 PDT
[Modern Media Controls] Address additional feedback on LayoutTraits refactor
Comment 1 Sam Weinig 2021-06-29 09:50:42 PDT
Created attachment 432490 [details]
Patch
Comment 2 Sam Weinig 2021-06-29 09:52:59 PDT
This is addressing the additional post land feedback in https://bugs.webkit.org/show_bug.cgi?id=227423.

It does not address the feedback on the overridenSupportingObjectClasses() delegation point, as doing so would require some file placement factoring that seems outside the scope.
Comment 3 Devin Rousso 2021-06-29 10:15:52 PDT
Comment on attachment 432490 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=432490&action=review

r=mews, nice!  Thanks for making these changes :)

> Source/WebCore/Modules/modern-media-controls/controls/ios-layout-traits.js:43
> +    controlsAvailabilityOverride()

I think this is much clearer :)

> Source/WebCore/Modules/modern-media-controls/controls/layout-traits.js:98
> +    FallThrough  : 2,

NIT: I feel like maybe `FallThrough` should be `0` so that its the only non-override (as well as being the only falsy value)

> Source/WebCore/Modules/modern-media-controls/media/media-controller.js:253
> -        this._supportingObjects = this._supportingObjectClasses().map(SupportClass => new SupportClass(this), this);
> +        this._supportingObjects = this.layoutTraits.supportingObjectClasses().map(SupportClass => new SupportClass(this), this);

comment #2 suggests that you weren't going to do this.  FWIW this is the idea that I had in mind, so I'm on-board with this approach if it is workable :)
Comment 4 Sam Weinig 2021-06-29 10:24:15 PDT
(In reply to Devin Rousso from comment #3)
> Comment on attachment 432490 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=432490&action=review
> 
> r=mews, nice!  Thanks for making these changes :)
> 
> > Source/WebCore/Modules/modern-media-controls/controls/ios-layout-traits.js:43
> > +    controlsAvailabilityOverride()
> 
> I think this is much clearer :)
> 
> > Source/WebCore/Modules/modern-media-controls/controls/layout-traits.js:98
> > +    FallThrough  : 2,
> 
> NIT: I feel like maybe `FallThrough` should be `0` so that its the only
> non-override (as well as being the only falsy value)

Ok.

> 
> > Source/WebCore/Modules/modern-media-controls/media/media-controller.js:253
> > -        this._supportingObjects = this._supportingObjectClasses().map(SupportClass => new SupportClass(this), this);
> > +        this._supportingObjects = this.layoutTraits.supportingObjectClasses().map(SupportClass => new SupportClass(this), this);
> 
> comment #2 suggests that you weren't going to do this.  FWIW this is the
> idea that I had in mind, so I'm on-board with this approach if it is
> workable :)

Yeah, this is wrong. I borked the commit. Will fix.
Comment 5 Sam Weinig 2021-06-29 10:26:29 PDT
Created attachment 432494 [details]
Patch
Comment 6 Radar WebKit Bug Importer 2021-07-06 09:40:33 PDT
<rdar://problem/80215569>
Comment 7 Sam Weinig 2021-08-01 10:13:48 PDT
Created attachment 434724 [details]
Patch
Comment 8 EWS 2021-08-02 09:38:37 PDT
Committed r280534 (240166@main): <https://commits.webkit.org/240166@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434724 [details].
Comment 9 Sam Weinig 2021-08-02 09:53:01 PDT
(In reply to EWS from comment #8)
> Committed r280534 (240166@main): <https://commits.webkit.org/240166@main>
> 
> All reviewed patches have been landed. Closing bug and clearing flags on
> attachment 434724 [details].

Well, drat. Will land the rest in new bugs.