Closed Bug 1628701 Opened 5 years ago Closed 5 years ago

Port bug 1624482: Scope menulist styles to its own component using shadow DOM

Categories

(Thunderbird :: Theme, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 77.0

People

(Reporter: Paenglab, Assigned: Paenglab)

References

Details

Attachments

(3 files, 1 obsolete file)

bug 1624482 moved some elements into shadow-DOM.

Attached patch 1628701-scope-menulist.patch (obsolete) — Splinter Review

This patch hopefully fixes the CSS. But in mailWidgets.js it needs more work as the editable menulists are broken.

Not really tested as Windows build is busted.

Assignee: nobody → richard.marti
Attachment #9139462 - Flags: feedback?(mkmelin+mozilla)

I checked the normal menulists and they should be okay now.

I played a bit with mailWidgets.js and tried to convert the textbox in the editable menulists the menulist-input and textbox-input classes are now the ::part(text-input) in the CSS. The editable menulist is now almost normally shown but without label and the textbox doesn't work. This needs now a CE expert, like you Magnus, to fix it. ;-)

Attachment #9139462 - Attachment is obsolete: true
Attachment #9139462 - Flags: feedback?(mkmelin+mozilla)
Attachment #9139502 - Flags: feedback?(mkmelin+mozilla)

Some fixes to your patch.
But the hightlightable-label is giving me headaches. It won't stop showing
https://hg.mozilla.org/mozilla-central/rev/86530e261ad5#l19.58

The menulist::part(label-box) rule from messengercompose.css is getting picked up, but not stuff below it. Is it not allowed to select thing below a part, or not working?

See Also: → 1624482
Attachment #9139502 - Flags: feedback?(mkmelin+mozilla) → feedback+
Comment on attachment 9139568 [details] [diff] [review] 1628701-editable-part-fix.patch Review of attachment 9139568 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/base/content/mailWidgets.js @@ +796,5 @@ > } > this.menupopup.addEventListener("popuphiding", this._popupHiding); > } > > + get fragment() { You can remove this bit and use `this.constructor.fragment` instead, see bug 1590573

(In reply to Magnus Melin [:mkmelin] from comment #3)

Created attachment 9139568 [details] [diff] [review]
1628701-editable-part-fix.patch

Some fixes to your patch.
But the hightlightable-label is giving me headaches. It won't stop showing
https://hg.mozilla.org/mozilla-central/rev/86530e261ad5#l19.58

The menulist::part(label-box) rule from messengercompose.css is getting picked up, but not stuff below it. Is it not allowed to select thing below a part, or not working?

You should just put <link rel="stylesheet" href="chrome://global/skin/menulist.css"/> inside the markup, and then the rules from https://hg.mozilla.org/mozilla-central/rev/86530e261ad5#l19.58 will apply.

I think that's desired anyway, since menulist-editable used class names from menulist, so you'll want all the styles formerly applying to menulist to apply to menulist-editable children as well.

Alternatively, elements can have multiple parts, so you can use part="label highlightable-label", and since the [highlightable] attribute inherits from the parent, target it as: menulist[highlightable]::part(highlightable-label) and such.

Thanks, that seems to work! I'll fold these and land it.
For toolkit: was the highlightable-label part="label" intended?

There seem to be some minor things still to do (e.g. the description in the menulist doesn't have the same faded color as before), but we can do a followup patch.

This needs both Magnus and Richard's patches applied.

  • I've imported menulist.css from toolkit into the markup
  • I've removed unnecessary IDs and classes
  • I've fixed .menulist-description styling
  • I've removed some code I think is dead (menulist-editable-box/menulist-editable-input)

(In reply to Magnus Melin [:mkmelin] from comment #6)

Thanks, that seems to work! I'll fold these and land it.
For toolkit: was the highlightable-label part="label" intended?

Yep, part is like class, multiple elements can share the same part. When we style the label, we usually want to style both labels at the same time.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/27f756d7fac7
Port bug 1624482: Scope menulist styles to its own component using shadow DOM. r=mkmelin

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/468302900d21 follow-up - adjust calendar tests for menulist DOM change. rs=bustage-fix
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/f6aaa12818d0 follow-up - make browser_menulist aware of the shadow DOM. rs=bustage-fix
Target Milestone: --- → Thunderbird 77.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: