From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- devtools/client/styleeditor/StyleEditorUI.sys.mjs | 2 +- .../client/styleeditor/StyleEditorUtil.sys.mjs | 31 +--------------------- .../client/styleeditor/StyleSheetEditor.sys.mjs | 2 +- .../test/iframe_with_service_worker.html | 2 +- 4 files changed, 4 insertions(+), 33 deletions(-) (limited to 'devtools/client/styleeditor') diff --git a/devtools/client/styleeditor/StyleEditorUI.sys.mjs b/devtools/client/styleeditor/StyleEditorUI.sys.mjs index d48c50f556..e00a88c3ad 100644 --- a/devtools/client/styleeditor/StyleEditorUI.sys.mjs +++ b/devtools/client/styleeditor/StyleEditorUI.sys.mjs @@ -1576,7 +1576,7 @@ export class StyleEditorUI extends EventEmitter { // onAvailable is a mandatory argument for watchTargets, // but we don't do anything when a new target gets created. - #onTargetAvailable = ({ targetFront }) => {}; + #onTargetAvailable = () => {}; #onTargetDestroyed = ({ targetFront }) => { // Iterate over a copy of the list in order to prevent skipping diff --git a/devtools/client/styleeditor/StyleEditorUtil.sys.mjs b/devtools/client/styleeditor/StyleEditorUtil.sys.mjs index 739dc55fc5..11dae675d9 100644 --- a/devtools/client/styleeditor/StyleEditorUtil.sys.mjs +++ b/devtools/client/styleeditor/StyleEditorUtil.sys.mjs @@ -50,23 +50,6 @@ export function getString(name) { } } -/** - * Assert an expression is true or throw if false. - * - * @param expression - * @param message - * Optional message. - * @return expression - */ -export function assert(expression, message) { - if (!expression) { - const msg = message ? "ASSERTION FAILURE:" + message : "ASSERTION FAILURE"; - log(msg); - throw new Error(msg); - } - return expression; -} - /** * Retrieve or set the text content of an element. * @@ -93,18 +76,6 @@ export function text(root, selector, textContent) { return textContent; } -/** - * Log a message to the console. - * - * @param ...rest - * One or multiple arguments to log. - * If multiple arguments are given, they will be joined by " " - * in the log. - */ -export function log() { - console.logStringMessage(Array.prototype.slice.call(arguments).join(" ")); -} - /** * Show file picker and return the file user selected. * @@ -171,7 +142,7 @@ export function showFilePicker( fp.defaultString = suggestedFilename; } - fp.init(parentWindow, getString(key + ".title"), mode); + fp.init(parentWindow.browsingContext, getString(key + ".title"), mode); fp.appendFilter(getString(key + ".filter"), "*.css"); fp.appendFilters(fp.filterAll); fp.open(fpCallback); diff --git a/devtools/client/styleeditor/StyleSheetEditor.sys.mjs b/devtools/client/styleeditor/StyleSheetEditor.sys.mjs index d84854a0ae..bf43bf0268 100644 --- a/devtools/client/styleeditor/StyleSheetEditor.sys.mjs +++ b/devtools/client/styleeditor/StyleSheetEditor.sys.mjs @@ -274,7 +274,7 @@ StyleSheetEditor.prototype = { * * This will set |this._state.text| to the new text. */ - async _fetchSourceText(options = {}) { + async _fetchSourceText() { const styleSheetsFront = await this._getStyleSheetsFront(); let longStr = null; diff --git a/devtools/client/styleeditor/test/iframe_with_service_worker.html b/devtools/client/styleeditor/test/iframe_with_service_worker.html index 690515775e..b66e1e74a8 100644 --- a/devtools/client/styleeditor/test/iframe_with_service_worker.html +++ b/devtools/client/styleeditor/test/iframe_with_service_worker.html @@ -12,7 +12,7 @@ function waitForActive(swr) { resolve(swr); return; } - sw.addEventListener("statechange", function onStateChange(evt) { + sw.addEventListener("statechange", function onStateChange() { if (sw.state === "activated") { sw.removeEventListener("statechange", onStateChange); resolve(swr); -- cgit v1.2.3