Consider allowing windowId for browser.theme.reset

VERIFIED FIXED in Firefox 57

Status

P5
enhancement
VERIFIED FIXED
2 years ago
9 months ago

People

(Reporter: jkt, Assigned: ntim)

Tracking

(Depends on: 1 bug, Blocks: 1 bug, {dev-doc-complete})

57 Branch
mozilla58
dev-doc-complete
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed, firefox58 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Reset clears my styles to native which is super useful, however I then have to calculate all the visible windows again.

If I could pass a windowId to browser.theme.reset() this would be simpler and less janky.

Updated

2 years ago
Severity: normal → enhancement
status-firefox57: affected → wontfix
Priority: -- → P5
(Assignee)

Updated

2 years ago
Blocks: 1330328
(Assignee)

Updated

2 years ago
Assignee: nobody → ntim.bugs
(Assignee)

Updated

2 years ago
Flags: needinfo?(jkt)
(Reporter)

Comment 1

2 years ago
As mentioned on irc the current code doesn't work with reset.
I created a branch here: https://github.com/jonathanKingston/containers-theme/tree/reset-theme
This currently works across containers, however when you change to a default tab it will retain the containers theme.

:ntim I can double check the code works when you have a patch (which it sounds like you have).
Flags: needinfo?(jkt) → needinfo?(ntim.bugs)
(Assignee)

Comment 2

2 years ago
Seems to work, thanks!
Flags: needinfo?(ntim.bugs)
Comment hidden (mozreview-request)
(Assignee)

Comment 4

2 years ago
I think this can be considered for 57, as the patch is pretty straightforward and low-risk.
status-firefox57: wontfix → affected
Comment on attachment 8913738 [details]
Bug 1401691 - Accept windowId parameter for browser.theme.reset().

https://reviewboard.mozilla.org/r/185126/#review190294
Attachment #8913738 - Flags: review?(jaws) → review+

Comment 6

2 years ago
Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/55e00fb0f00b
Accept windowId parameter for browser.theme.reset(). r=jaws
https://hg.mozilla.org/mozilla-central/rev/55e00fb0f00b
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox58: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
(Assignee)

Comment 8

2 years ago
Comment on attachment 8913738 [details]
Bug 1401691 - Accept windowId parameter for browser.theme.reset().

Approval Request Comment
[Feature/Bug causing the regression]: bug 1342712
[User impact if declined]: None for users, but the API introduced in bug 1342712 will be incomplete, as its equivalent for reset() won't be supported
[Is this code covered by automated tests?]: No
[Has the fix been verified in Nightly?]: not yet
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: no
[Why is the change risky/not risky?]: Straightforward JS changes, that have the same logic as bug 1342712, which has been well tested.
[String changes made/needed]: none
Attachment #8913738 - Flags: approval-mozilla-beta?
(Assignee)

Comment 9

2 years ago
:jkt, can you please verify that this works for your add-on in Nightly ? Thanks!
Flags: needinfo?(jkt)
(Reporter)

Comment 10

2 years ago
I can confirm that the patch in Nightly now works with the branch that I made, thank you!
Flags: needinfo?(jkt)
Status: RESOLVED → VERIFIED
What kind of extension would use this?
By the way, there is no test?
Flags: needinfo?(ntim.bugs)
(Assignee)

Comment 12

2 years ago
(In reply to Sylvestre Ledru [:sylvestre] from comment #11)
> What kind of extension would use this?

Theme related extensions: VivaldiFox (I'm working on a port for 57 atm), Containers theme.

> By the way, there is no test?

Both bug 1342712 and this bug don't have testing coverage, since I landed those in a rush to be able to port my own extensions in time for 57.

I do plan to add tests later separately though.
Flags: needinfo?(ntim.bugs)
Comment on attachment 8913738 [details]
Bug 1401691 - Accept windowId parameter for browser.theme.reset().

OK, taking it to help theme support.
Tim, please report a new bug to make sure we don't forget about adding tests.
Thanks
Attachment #8913738 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
(Assignee)

Comment 14

2 years ago
Thanks! Filed bug 1404855 for tests
Depends on: 1404855
(Assignee)

Updated

a year ago
Keywords: dev-doc-needed
Updated doc (thanks ntim):

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/theme/reset
Keywords: dev-doc-needed → dev-doc-complete
(Assignee)

Updated

a year ago
Blocks: 1417884
No longer blocks: 1330328

Updated

9 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.