Bug 258908 - [modern-media-controls] Stop setting CSS variables using universal selectors
Summary: [modern-media-controls] Stop setting CSS variables using universal selectors
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-05 18:03 PDT by Tim Nguyen (:ntim)
Modified: 2023-07-05 18:03 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2023-07-05 18:03:41 PDT
Variables should be set on the container element and inherited down. They shouldn't be set on every single element like:

https://searchfox.org/wubkat/rev/12cb9f518180ff4a469eff2481efdf907e4cf63c/Source/WebCore/Modules/modern-media-controls/controls/media-controls.css#38-44

Rules like these are error prone, because overriding them from different CSS files might not work as expected. See for instance:

https://searchfox.org/wubkat/rev/12cb9f518180ff4a469eff2481efdf907e4cf63c/Source/WebCore/Modules/modern-media-controls/controls/vision-media-controls.css#34-41

which needs to do `.media-controls.vision *`.

If someone writes a new rule and forgets the `*` or misses an element where the variable is used, this can cause issues with the variable having the wrong value.
Comment 1 Radar WebKit Bug Importer 2023-07-05 18:03:50 PDT
<rdar://problem/111819735>