Skip to content

Commit

Permalink
Bug 1822222 - Convert browser/actors/PageStyle* JSMs to ESMs. r=kpatenio
Browse files Browse the repository at this point in the history
  • Loading branch information
Saira Abdulla committed Mar 17, 2023
1 parent 42b48c3 commit fb66538
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/* 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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";

var EXPORTED_SYMBOLS = ["PageStyleChild"];

class PageStyleChild extends JSWindowActorChild {
export class PageStyleChild extends JSWindowActorChild {
actorCreated() {
// 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/* 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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";

var EXPORTED_SYMBOLS = ["PageStyleParent"];

class PageStyleParent extends JSWindowActorParent {
export class PageStyleParent extends JSWindowActorParent {
// This has the most recent information about the content stylesheets for
// that actor. It's populated via the PageStyle:Add and PageStyle:Clear
// messages from the content process. It has the following structure:
Expand Down
6 changes: 3 additions & 3 deletions browser/actors/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ with Files("LightweightThemeChild.jsm"):
with Files("PageInfoChild.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Page Info Window")

with Files("PageStyleChild.jsm"):
with Files("PageStyleChild.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Menus")

with Files("PluginChild.jsm"):
Expand Down Expand Up @@ -68,8 +68,8 @@ FINAL_TARGET_FILES.actors += [
"LinkHandlerChild.jsm",
"LinkHandlerParent.jsm",
"PageInfoChild.sys.mjs",
"PageStyleChild.jsm",
"PageStyleParent.jsm",
"PageStyleChild.sys.mjs",
"PageStyleParent.sys.mjs",
"PluginChild.jsm",
"PluginParent.jsm",
"PointerLockChild.sys.mjs",
Expand Down
4 changes: 2 additions & 2 deletions browser/components/BrowserGlue.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,10 @@ let JSWINDOWACTORS = {

PageStyle: {
parent: {
moduleURI: "resource:///actors/PageStyleParent.jsm",
esModuleURI: "resource:///actors/PageStyleParent.sys.mjs",
},
child: {
moduleURI: "resource:///actors/PageStyleChild.jsm",
esModuleURI: "resource:///actors/PageStyleChild.sys.mjs",
events: {
pageshow: { createActor: false },
},
Expand Down
2 changes: 1 addition & 1 deletion docshell/base/BrowsingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3281,7 +3281,7 @@ void BrowsingContext::DidSet(FieldIndex<IDX_AuthorStyleDisabledDefault>) {
"Should only set AuthorStyleDisabledDefault in the top "
"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.
//
// But we store the state here on the top BrowsingContext so that the
Expand Down
2 changes: 1 addition & 1 deletion dom/base/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6856,7 +6856,7 @@ already_AddRefed<PresShell> Document::CreatePresShell(
MarkUserFontSetDirty();

// 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()) {
presShell->SetAuthorStyleDisabled(bc->Top()->AuthorStyleDisabledDefault());
}
Expand Down

0 comments on commit fb66538

Please sign in to comment.