Bug 227489 - [Modern Media Controls] Address additional feedback on LayoutTraits refactor
Summary: [Modern Media Controls] Address additional feedback on LayoutTraits refactor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-29 09:39 PDT by Sam Weinig
Modified: 2021-08-02 09:53 PDT (History)
9 users (show)

See Also:


Attachments
Patch (13.05 KB, patch)
2021-06-29 09:50 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (12.57 KB, patch)
2021-06-29 10:26 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (4.02 KB, patch)
2021-08-01 10:13 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.