Scope menulist styles to its own component using shadow DOM
Categories
(Toolkit :: Themes, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: ntim, Assigned: ntim)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
I think it'd be nice to try componentizing the styling of our custom elements a bit more. Right now, we import chrome://global/content/widgets.css
or chrome://global/skin/global.css
(which itself includes widgets.css
) in every single custom element using shadow DOM. widgets.css includes 22 stylesheets which isn't ideal.
To make better use of web components, it would make more sense for each CE to only include styles for its own component.
For this to work however, all CEs must start using shadow DOM, which involves:
- changing the component stylesheet to work with shadow dom
- rewriting external stylesheets to use shadow parts
menulist.js would be a good candidate to start with after bug 1624454.
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Looks like try isn't super happy: https://treeherder.mozilla.org/#/jobs?repo=try&revision=72a15d28ce2e86e8aaff9e9250094d98365e974a
Will have to investigate :(
Assignee | ||
Comment 3•5 years ago
|
||
(In reply to Tim Nguyen :ntim from comment #2)
Looks like try isn't super happy: https://treeherder.mozilla.org/#/jobs?repo=try&revision=72a15d28ce2e86e8aaff9e9250094d98365e974a
Will have to investigate :(
Bug 1627568 should fix the reftest failures.
The select-related failures were due to popuponly
not working at all, this is because the shadowRoot was created all the time (even with popuponly
) as the constructor doesn't know about the element's attributes yet. To fix this, I appended a slot into the shadow root when popuponly
was used (since you can't create a shadow root conditionally).
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/86530e261ad5
https://hg.mozilla.org/mozilla-central/rev/1319738e81d2
Comment 10•5 years ago
|
||
bugherder |
Description
•