Closed Bug 1595143 Opened 5 months ago Closed 4 months ago

[MSU Capstone] Port LightweightThemeChild to JSWindowActors

Categories

(WebExtensions :: Themes, task)

task
Not set

Tracking

(Fission Milestone:M5, firefox72 verified)

VERIFIED FIXED
mozilla72
Fission Milestone M5
Tracking Status
firefox72 --- verified

People

(Reporter: mconley, Assigned: jahnsjam)

References

Details

Attachments

(1 file)

Implemented here: https://searchfox.org/mozilla-central/rev/b2b0077c2e6a516a76bf8077d6f0237c58f5959a/browser/actors/LightweightThemeChild.jsm

Registered here: https://searchfox.org/mozilla-central/rev/b2b0077c2e6a516a76bf8077d6f0237c58f5959a/browser/components/BrowserGlue.jsm#317-325

Interestingly, this actor doesn't actually do any cross-process communication directly. It's job is to attach itself to about:home, about:newtab and about:welcome, and check the Services.cpmm.sharedData structure for any theme data to apply, and then sends a special event down to content to apply that data.

There are two other things to note:

  1. Sidebars use this actor as well, but do so in a really strange way - the sidebars for Sync'd Tabs, History and Bookmarks manually instantiate the LightweightThemeChild actor and mock out a dispatcher rather than relying on the underlying ActorManagerChild thing to do it for them. I guess this is because there's no ActorManagerChild for these sidebars, since those sidebars actually run in the parent process. I suspect we can probably add the bookmarks and history URIs to the matches: registration for the JSWindowActor implementation, and set the includeChrome property to true in the registration as well, and I think then we can have LightweightThemeChild be instantiated in the "normal" lazy fashion like with about:* pages, instead of manually doing it like we do here.

For reference, the URIs for the sync'd tabs, history and bookmark sidebar pages are:

chrome://browser/content/syncedtabs/sidebar.xhtml
and
chrome://browser/content/places/historySidebar.xul
and
chrome://browser/content/places/bookmarksSidebar.xul

  1. The Services.cpmm.sharedData is keyed on a special identifier, chromeOuterWindowID, that represents which window a particular Actor is within. This is because each browser window can be themed differently. I suspect until we figure out a way of making chromeOuterWindowID available on a BrowsingContext, we should keep getting it off of the message manager. So for now, in the port, let's access the message manager's chromeOuterWindowID like so:

this.docShell.messageManager.chromeOuterWindowID.

r=mconley, gijs, barret

See Also: → 1596852

Tentatively moving all bugs whose summaries mention "Fission" (or other Fission-related keywords) but are not assigned to a Fission Milestone to the "?" triage milestone.

This will generate a lot of bugmail, so you can filter your bugmail for the following UUID and delete them en masse:

0ee3c76a-bc79-4eb2-8d12-05dc0b68e732

Fission Milestone: --- → ?
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c1d83dcf6376
Port LightweightThemeChild to JSWindowActors r=mconley,Gijs
Fission Milestone: ? → M5
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72

Hello,

Will this fix require manual validation? If yes, please provide some steps to reproduce in order to correctly test it and also, please set the "qe-verify+" flag. Otherwise, could the "qe-verify-" flag be added? Thanks!

Flags: needinfo?(jahnsjam)
Flags: needinfo?(jahnsjam) → qe-verify+

Hello,

"qe-verify+" has been set.
In particular, testing application of the theme to the history/bookmarks sidebar is desired.
To view the sidebar, press the Sidebar icon in the top left, or press Ctrl+B.
Here's some themes to test with:
-Firefox Menu > Customize... , then in the bottom bar switch to Dark Theme
-unofficial themes like https://addons.mozilla.org/en-US/firefox/addon/matte-black-red/ or https://addons.mozilla.org/en-US/firefox/addon/gradient-orange-blue , which should affect the sidebar

Hello,

Verified the fix on the latest Beta (72.0b3/20191205201734) and Nightly (73.0a1/20191205215330) under Windows 10 Pro 64-bit and Ubuntu 18.04.

The proposed themes to test the fix are properly applied to the bookmarks/history sidebar, confirming the fix.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.