Closed Bug 1782456 Opened 3 years ago Closed 3 years ago

Missing style in unified extensions context menu

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(firefox105 fixed)

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: willdurand, Assigned: willdurand)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

In Bug 1777483, we introduced a context menu that appears either by clicking the cog button with the primary button or secondary button ("right click" like any other context menu).

I noticed that the menu doesn't have the exact same behavior when opened with left vs. right click. With a secondary button click (which is how we open context menus usually), the menu items are refreshed but it isn't the case with a primary button click.

STR:

  1. Install https://addons.mozilla.org/en-US/firefox/addon/styl-us/
  2. Click on the cog icon to reveal the context menu (with primary button)
  3. Select "Show active style count"
  4. Re-open the menu with primary button click
  5. Close menu and re-open it with secondary button click

What happened?

In (4), the "Show active style count" should be checked but it isn't.
In (5), the "Show active style count" is checked, which is expected.

Expectations:

There should be no difference between (4) and (5), and (5) is the correct behavior.

Whiteboard: [addons-jira → [addons-jira]
Type: enhancement → defect
Whiteboard: [addons-jira] → [addons-jira]
Whiteboard: [addons-jira]
Whiteboard: [addons-jira]

I noticed some missing context menu style when loading the context menu
from our own viewcache, which explains the difference between primary
and secondary button click. Not sure ecavtly what was missing as the
styles are all over the place.

The menu item actually works, the actions are called and for
checkbox-like menu items, the checked attribute is correctly set in
the "HTML". Also it looked like sub-menus weren't affected (e.g. Tree
Style Tab didn't have any issue).

While investigating, I also noticed that most (if not all) menupopup
elements are declared in the main popupset, so I tried to move the
unified extensions context menu to this main popupset and lazy-load the
l10n strings (similar to the toolbar context menu 1).

That fixed the bug.

We talked with :rpl and the menupopup is needed to apply some missing style. There are two new problems, though:

  1. on MacOS with native context menu and dark mode, some icons are barely visible. It looks like what Bug 1698761 describes but this bug has been closed in favor of Bug 1710459...
  2. on Linux with widget.gtk.native-context-menus=true, opening a context menu closes the popup

I am going to update the bug title.

Summary: Context menu open with primary button click does not refresh extension's menu items → Missing style in unified extensions context menu
Severity: -- → N/A
Priority: -- → P2

(In reply to William Durand [:willdurand] from comment #2)

  1. on Linux with widget.gtk.native-context-menus=true, opening a context menu closes the popup

I filed Bug 1782533.

Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f67084bc9e22 Move unified extensions context menu to main popupset. r=rpl,Gijs
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Depends on: 1784292
No longer depends on: 1784292
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: