WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
227505
Move BottomControlsBarHeight and InsideMargin to be computed at runtime
https://bugs.webkit.org/show_bug.cgi?id=227505
Summary
Move BottomControlsBarHeight and InsideMargin to be computed at runtime
Dean Jackson
Reported
2021-06-29 13:59:50 PDT
Move BottomControlsBarHeight to a layout trait
Attachments
Patch
(4.37 KB, patch)
2021-06-29 14:05 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(5.28 KB, patch)
2021-06-29 16:18 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(6.54 KB, patch)
2021-06-30 19:21 PDT
,
Dean Jackson
hi
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
EWS test
(12.37 KB, patch)
2021-07-02 18:14 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-06-29 14:02:12 PDT
<
rdar://problem/79932256
>
Dean Jackson
Comment 2
2021-06-29 14:05:15 PDT
Created
attachment 432525
[details]
Patch
Sam Weinig
Comment 3
2021-06-29 16:06:29 PDT
Comment on
attachment 432525
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=432525&action=review
> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:220 > + this.bottomControlsBar.y = Math.max(0, this.height - this.layoutTraits.inlineBottomControlsBarHeight() - InsideMargin);
Not knowing nothing about nothing, can we instead query a CSS variable for something like this and get rid of both BottomControlsBarHeight and InsideMargin and just have the platform's css do it?
Dean Jackson
Comment 4
2021-06-29 16:18:27 PDT
Created
attachment 432550
[details]
Patch
Dean Jackson
Comment 5
2021-06-30 19:21:58 PDT
Created
attachment 432650
[details]
Patch
Devin Rousso
Comment 6
2021-06-30 23:48:49 PDT
Comment on
attachment 432650
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=432650&action=review
r=mews
> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:133 > + const inlineInsideMargin = this.computedValueForStylePropertyInPx("--inline-controls-inside-margin");
Can we maybe cache this value somewhere so that we don't have to get the computed style more than once? We don't expect this value to change so there's not much benefit to requesting it more than once.
> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:219 > + const inlineBottomControlsBarHeight = this.computedValueForStylePropertyInPx("--inline-controls-bar-height");
ditto (:133)
> Source/WebCore/Modules/modern-media-controls/controls/layout-node.js:241 > + return null;
NIT: maybe the fallback value should be `0` so that it's still valid px value (and therefore able to be used in math operations)?
> Source/WebCore/Modules/modern-media-controls/controls/layout-node.js:244 > + return parseFloat(value);
Not sure which is better, but you also could do this with ``` window.getComputedStyle(this.element).getPropertyCSSValue(propertyName).getFloatValue(CSSPrimitiveValue.CSS_PX) ```
> Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js:63 > + const inlineInsideMargin = this.computedValueForStylePropertyInPx("--inline-controls-inside-margin"); > + const inlineBottomControlsBarHeight = this.computedValueForStylePropertyInPx("--inline-controls-bar-height");
ditto (inline-media-controls.js:133)
Dean Jackson
Comment 7
2021-07-01 12:28:47 PDT
Comment on
attachment 432650
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=432650&action=review
>> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:133 >> + const inlineInsideMargin = this.computedValueForStylePropertyInPx("--inline-controls-inside-margin"); > > Can we maybe cache this value somewhere so that we don't have to get the computed style more than once? We don't expect this value to change so there's not much benefit to requesting it more than once.
Good point.
>> Source/WebCore/Modules/modern-media-controls/controls/layout-node.js:241 >> + return null; > > NIT: maybe the fallback value should be `0` so that it's still valid px value (and therefore able to be used in math operations)?
Agreed.
>> Source/WebCore/Modules/modern-media-controls/controls/layout-node.js:244 >> + return parseFloat(value); > > Not sure which is better, but you also could do this with > ``` > window.getComputedStyle(this.element).getPropertyCSSValue(propertyName).getFloatValue(CSSPrimitiveValue.CSS_PX) > ```
OK!
Sam Weinig
Comment 8
2021-07-01 12:34:12 PDT
Comment on
attachment 432650
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=432650&action=review
>>> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:133 >>> + const inlineInsideMargin = this.computedValueForStylePropertyInPx("--inline-controls-inside-margin"); >> >> Can we maybe cache this value somewhere so that we don't have to get the computed style more than once? We don't expect this value to change so there's not much benefit to requesting it more than once. > > Good point.
It seems like it will only be called once per InlineMediaControls, so I don't see any reason to cache it unless we see some performance concern.
Devin Rousso
Comment 9
2021-07-01 13:01:17 PDT
Comment on
attachment 432650
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=432650&action=review
>>>> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:133 >>>> + const inlineInsideMargin = this.computedValueForStylePropertyInPx("--inline-controls-inside-margin"); >>> >>> Can we maybe cache this value somewhere so that we don't have to get the computed style more than once? We don't expect this value to change so there's not much benefit to requesting it more than once. >> >> Good point. > > It seems like it will only be called once per InlineMediaControls, so I don't see any reason to cache it unless we see some performance concern.
This is called in every `layout`, which I think can happen pretty frequently. Though I think it may depend on the state of the video, page, etc.
Dean Jackson
Comment 10
2021-07-01 13:28:57 PDT
Committed
r279481
(
239334@main
): <
https://commits.webkit.org/239334@main
>
Amir Mark Jr
Comment 11
2021-07-01 17:22:38 PDT
Reverted
r279481
for reason: Broke a pre-existing test Committed
r279489
(
239341@main
): <
https://commits.webkit.org/239341@main
>
Dean Jackson
Comment 12
2021-07-02 18:14:18 PDT
Created
attachment 432837
[details]
EWS test
Dean Jackson
Comment 13
2021-07-03 14:29:41 PDT
Committed
r279547
(
239383@main
): <
https://commits.webkit.org/239383@main
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug