Closed Bug 1401691 Opened 7 years ago Closed 7 years ago

Consider allowing windowId for browser.theme.reset

Categories

(WebExtensions :: General, defect, P5)

57 Branch
defect

Tracking

(firefox57 fixed, firefox58 fixed)

VERIFIED FIXED
mozilla58
Tracking Status
firefox57 --- fixed
firefox58 --- fixed

People

(Reporter: jkt, Assigned: ntim)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

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.
Severity: normal → enhancement
Priority: -- → P5
Blocks: themingapi
Assignee: nobody → ntim.bugs
Flags: needinfo?(jkt)
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)
Seems to work, thanks!
Flags: needinfo?(ntim.bugs)
I think this can be considered for 57, as the patch is pretty straightforward and low-risk.
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+
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
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
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?
:jkt, can you please verify that this works for your add-on in Nightly ? Thanks!
Flags: needinfo?(jkt)
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)
(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+
Thanks! Filed bug 1404855 for tests
Depends on: 1404855
Keywords: dev-doc-needed
Blocks: themingapi-polish
No longer blocks: themingapi
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: