Closed Bug 1800417 Opened 3 years ago Closed 3 years ago

Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets

Categories

(WebExtensions :: Frontend, task, P3)

task

Tracking

(firefox112 fixed)

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: willdurand, Assigned: willdurand)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(5 files)

In Bug 1798324, we updated the style of the extension (CUI) widgets to match the Unified Extensions UI. These widgets are "custom" widgets and have two buttons. One of them is the primary (or action) button, also known as "view button" for the widgets of type "custom".

The view button in a custom widget is placed in the toolbar when the widget is pinned. We use the .toolbarbutton-1 class on this button for that reason. In addition, we use .subviewbutton on this same button when the widget is placed in a panel (unified extensions panel in most cases). See: https://searchfox.org/mozilla-central/rev/219df29d0fb5d8928ae41bba4a605046de411cf0/browser/components/extensions/parent/ext-browserAction.js#229-233

We should not use these two CSS classes on the same button. There were a few ideas in https://phabricator.services.mozilla.com/D161036.

Severity: -- → N/A
Priority: -- → P3
Depends on: 1801048
Assignee: nobody → wdurand
Status: NEW → ASSIGNED

Fixing this bug would also fix a minor difference between CUI widgets and custom elements in the panel: when -moz-window-inactive is set, toolbar buttons have an opacity of 0.5, which essentially makes them less visible. That is not the case for the custom elements (at the bottom of the list) as seen in the screenshot.

Attachment #9304702 - Attachment description: WIP: Bug 1800417 - Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r?mconley!,Itiel → Bug 1800417 - Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r?mconley!,Itiel
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab00cf793f29 Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r=Itiel,mconley,dao,rpl

I am still trying to fix Bug 1798683 to unlock the patch for this bug..

Flags: needinfo?(wdurand)
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6dbcf3dd30c4 Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r=Itiel,mconley,dao,rpl

Meant to back out bug 1798683
Will reland this.
Sorry

Flags: needinfo?(wdurand)
Flags: needinfo?(wdurand)
Pushed by smolnar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/549ce0549c2e Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r=Itiel,mconley,dao,rpl

This is the actual culprit. Backfills confirm it
Backed out for causing bc failures in browser/components/extensions/test/browser/browser_unified_extensions_overflowable_toolbar.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/883042d84c6a74e474c0fcb4be8cb93fe3909b77

Push with failures

Failure log

Flags: needinfo?(wdurand)

sigh, I'll take yet another look..

Flags: needinfo?(wdurand)

:mconley I am not able to land this patch because of an obscure bug on Linux, that I cannot reproduce myself. I can consistently reproduce on Try, though and the screenshot (attached here) reminds me of Bug 1798973, which we couldn't reproduce either. Could you please take a look?

Flags: needinfo?(mconley)

Here's a try push for that test directory on the same platform with some added profiler markers and profiling enabled. Let's see if we can deduce what's happening here: https://treeherder.mozilla.org/jobs?repo=try&revision=94d9461452a2703e07a8af18bf8aa0a4159dcc0a

Will leave needinfo for now while I wait for the build to complete.

So the issue seems to be that the OverflowableToolbar reports itself as not being enabled at the time that the resize event occurs:

https://share.firefox.dev/40H2Iy3

Looking into why that might be...

Another try push with more logging to see if we can find where the OverflowableToolbar is being disabled: https://treeherder.mozilla.org/jobs?repo=try&revision=4b7cb913a8d350f7fd44289399d1a08bfb0dbd5b

The problem was that a previous test (browser_unified_extensions_cui.js) had fired an event on the toolbox that disabled the OverflowableToolbar for all windows to simulate entering customize mode, and then didn't fire the event to simulate exiting it again.

This seems to fix the test for me: https://hg.mozilla.org/try/rev/962d9ce798e71a42203d8376ccc5b1bd59344680

Try push: https://treeherder.mozilla.org/jobs?repo=try&revision=a4b09b4711717be1d53b06fb5766d329adcbc53f

Flags: needinfo?(mconley)
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d26e7747cf69 Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r=Itiel,mconley,dao,rpl

Backed out changeset d26e7747cf69 (Bug 1800417) for bc failures on browser_unified_extensions_overflowable_toolbar.js.
Backout link
Push with failures <--> bc7
Failure Log

Flags: needinfo?(wdurand)
Regressions: 1816533
No longer regressions: 1816533
Flags: needinfo?(wdurand)
Keywords: leave-open
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d88c5a272101 Make sure we exit customization mode in browser_unified_extensions_cui.js. r=rpl
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e391918bb558 Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r=Itiel,mconley,dao,rpl

Backed out for causing mochitest failures in browser_unified_extensions_overflowable_toolbar.js

Flags: needinfo?(wdurand)

Depends on D162712

Depends on D162712

Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a306b471b9fb Fix the use of both `toolbarbutton-1` and `subviewbutton` CSS classes in extension widgets. r=Itiel,mconley,dao,rpl
Flags: needinfo?(wdurand)
Keywords: leave-open

This bug caused the default extension icon (i.e. for an extension without an icon) to change from white to black in dark mode.

I can provide more details or file a bug if needed, but I don't have time to at this exact moment; I just mozregressioned this and thought I'd leave a note.

Flags: needinfo?(wdurand)
Regressions: 1817865

(In reply to Justin Peter from comment #26)

This bug caused the default extension icon (i.e. for an extension without an icon) to change from white to black in dark mode.

I can provide more details or file a bug if needed, but I don't have time to at this exact moment; I just mozregressioned this and thought I'd leave a note.

Thanks, should be fixed in bug 1817865.

Flags: needinfo?(wdurand)
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
See Also: → 1818622
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: