Bug 1822222 - Convert browser/actors/PageStyle* JSMs to ESMs. r=kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D172674
This commit is contained in:
Saira Abdulla 2023-03-17 01:55:59 +00:00
parent c3355dfd6a
commit 6a4ef6bc43
6 changed files with 9 additions and 15 deletions

View file

@ -1,11 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["PageStyleChild"]; export class PageStyleChild extends JSWindowActorChild {
class PageStyleChild extends JSWindowActorChild {
actorCreated() { actorCreated() {
// C++ can create the actor and call us here once an "interesting" link // C++ can create the actor and call us here once an "interesting" link
// element gets added to the DOM. If pageload hasn't finished yet, just // element gets added to the DOM. If pageload hasn't finished yet, just

View file

@ -1,11 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["PageStyleParent"]; export class PageStyleParent extends JSWindowActorParent {
class PageStyleParent extends JSWindowActorParent {
// This has the most recent information about the content stylesheets for // This has the most recent information about the content stylesheets for
// that actor. It's populated via the PageStyle:Add and PageStyle:Clear // that actor. It's populated via the PageStyle:Add and PageStyle:Clear
// messages from the content process. It has the following structure: // messages from the content process. It has the following structure:

View file

@ -19,7 +19,7 @@ with Files("LightweightThemeChild.jsm"):
with Files("PageInfoChild.sys.mjs"): with Files("PageInfoChild.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Page Info Window") BUG_COMPONENT = ("Firefox", "Page Info Window")
with Files("PageStyleChild.jsm"): with Files("PageStyleChild.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Menus") BUG_COMPONENT = ("Firefox", "Menus")
with Files("PluginChild.jsm"): with Files("PluginChild.jsm"):
@ -68,8 +68,8 @@ FINAL_TARGET_FILES.actors += [
"LinkHandlerChild.jsm", "LinkHandlerChild.jsm",
"LinkHandlerParent.jsm", "LinkHandlerParent.jsm",
"PageInfoChild.sys.mjs", "PageInfoChild.sys.mjs",
"PageStyleChild.jsm", "PageStyleChild.sys.mjs",
"PageStyleParent.jsm", "PageStyleParent.sys.mjs",
"PluginChild.jsm", "PluginChild.jsm",
"PluginParent.jsm", "PluginParent.jsm",
"PointerLockChild.sys.mjs", "PointerLockChild.sys.mjs",

View file

@ -632,10 +632,10 @@ let JSWINDOWACTORS = {
PageStyle: { PageStyle: {
parent: { parent: {
moduleURI: "resource:///actors/PageStyleParent.jsm", esModuleURI: "resource:///actors/PageStyleParent.sys.mjs",
}, },
child: { child: {
moduleURI: "resource:///actors/PageStyleChild.jsm", esModuleURI: "resource:///actors/PageStyleChild.sys.mjs",
events: { events: {
pageshow: { createActor: false }, pageshow: { createActor: false },
}, },

View file

@ -3281,7 +3281,7 @@ void BrowsingContext::DidSet(FieldIndex<IDX_AuthorStyleDisabledDefault>) {
"Should only set AuthorStyleDisabledDefault in the top " "Should only set AuthorStyleDisabledDefault in the top "
"browsing context"); "browsing context");
// We don't need to handle changes to this field, since PageStyleChild.jsm // We don't need to handle changes to this field, since PageStyleChild.sys.mjs
// will respond to the PageStyle:Disable message in all content processes. // will respond to the PageStyle:Disable message in all content processes.
// //
// But we store the state here on the top BrowsingContext so that the // But we store the state here on the top BrowsingContext so that the

View file

@ -6856,7 +6856,7 @@ already_AddRefed<PresShell> Document::CreatePresShell(
MarkUserFontSetDirty(); MarkUserFontSetDirty();
// Take the author style disabled state from the top browsing cvontext. // Take the author style disabled state from the top browsing cvontext.
// (PageStyleChild.jsm ensures this is up to date.) // (PageStyleChild.sys.mjs ensures this is up to date.)
if (BrowsingContext* bc = GetBrowsingContext()) { if (BrowsingContext* bc = GetBrowsingContext()) {
presShell->SetAuthorStyleDisabled(bc->Top()->AuthorStyleDisabledDefault()); presShell->SetAuthorStyleDisabled(bc->Top()->AuthorStyleDisabledDefault());
} }