diff --git a/.eslintignore b/.eslintignore index 467562a1d8b5..bdb10c6ae230 100644 --- a/.eslintignore +++ b/.eslintignore @@ -14,11 +14,7 @@ obj*/** # We ignore all these directories by default, until we get them enabled. # If you are enabling a directory, please add directory specific exclusions # below. -docshell/resources/** -docshell/test/browser/** -docshell/test/chrome/** -docshell/test/iframesandbox/** -docshell/test/mochitest/** +docshell/** extensions/cookie/** extensions/spellcheck/** extensions/universalchardet/** diff --git a/docshell/test/navigation/.eslintrc.js b/docshell/test/navigation/.eslintrc.js index ce627613ad3b..6746617eebd0 100644 --- a/docshell/test/navigation/.eslintrc.js +++ b/docshell/test/navigation/.eslintrc.js @@ -4,13 +4,5 @@ module.exports = { "extends": [ "plugin:mozilla/browser-test", "plugin:mozilla/mochitest-test", - ], - - "plugins": [ - "no-unsanitized", - ], - - "rules": { - "no-unsanitized/method": "off", - }, + ] }; diff --git a/docshell/test/navigation/NavigationUtils.js b/docshell/test/navigation/NavigationUtils.js index 522ddf583780..219c5cbabf39 100644 --- a/docshell/test/navigation/NavigationUtils.js +++ b/docshell/test/navigation/NavigationUtils.js @@ -2,26 +2,26 @@ * 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/. */ -// ///////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// // // Utilities for navigation tests -// -// ///////////////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////////////////// var body = "This frame was navigated."; -var target_url = "navigation_target_url.html"; +var target_url = "navigation_target_url.html" var popup_body = "This is a popup"; var target_popup_url = "navigation_target_popup_url.html"; -// ///////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// // Functions that navigate frames -// ///////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// function navigateByLocation(wnd) { try { wnd.location = target_url; - } catch (ex) { + } catch(ex) { // We need to keep our finished frames count consistent. // Oddly, this ends up simulating the behavior of IE7. window.open(target_url, "_blank", "width=10,height=10"); @@ -48,18 +48,18 @@ function navigateByHyperlink(name) { link.target = name; link.id = "navigation_hyperlink_" + hyperlink_count++; document.body.appendChild(link); - sendMouseEvent({type: "click"}, link.id); + sendMouseEvent({type:"click"}, link.id); } -// ///////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// // Functions that call into Mochitest framework -// ///////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// function isNavigated(wnd, message) { var result = null; try { result = SpecialPowers.wrap(wnd).document.body.innerHTML.trim(); - } catch (ex) { + } catch(ex) { result = ex; } is(result, body, message); @@ -69,7 +69,7 @@ function isBlank(wnd, message) { var result = null; try { result = wnd.document.body.innerHTML.trim(); - } catch (ex) { + } catch(ex) { result = ex; } is(result, "This is a blank document.", message); @@ -79,7 +79,7 @@ function isAccessible(wnd, message) { try { wnd.document.body.innerHTML; ok(true, message); - } catch (ex) { + } catch(ex) { ok(false, message); } } @@ -88,19 +88,18 @@ function isInaccessible(wnd, message) { try { wnd.document.body.innerHTML; ok(false, message); - } catch (ex) { + } catch(ex) { ok(true, message); } } -// ///////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// // Functions that require UniversalXPConnect privilege -// ///////////////////////////////////////////////////////////////////////// -/* eslint-disable mozilla/use-services */ +/////////////////////////////////////////////////////////////////////////// + function xpcEnumerateContentWindows(callback) { var Ci = SpecialPowers.Ci; - // Replacing this with Services.ww format causes test errors, so ignore for now var ww = SpecialPowers.Cc["@mozilla.org/embedcomp/window-watcher;1"] .getService(Ci.nsIWindowWatcher); @@ -128,7 +127,6 @@ function xpcEnumerateContentWindows(callback) { while (contentWindows.length > 0) callback(contentWindows.pop()); } -/* eslint-enable mozilla/use-services */ // Note: This only searches for top-level frames with this name. function xpcGetFramesByName(name) { @@ -180,10 +178,10 @@ function xpcWaitForFinishedFrames(callback, numFrames) { function searchForFinishedFrames(win) { if ((win.location.href.endsWith(target_url) || win.location.href.endsWith(target_popup_url)) && - win.document && - win.document.body && + win.document && + win.document.body && (win.document.body.textContent.trim() == body || - win.document.body.textContent.trim() == popup_body) && + win.document.body.textContent.trim() == popup_body) && win.document.readyState == "complete") { var windowId = win.windowUtils.outerWindowID; @@ -201,7 +199,7 @@ function xpcWaitForFinishedFrames(callback, numFrames) { // This only gives us UniversalXPConnect for the current stack frame // We're using setInterval, so the main page's privileges are still normal xpcEnumerateContentWindows(searchForFinishedFrames); - } catch (ex) { + } catch(ex) { // We might be accessing windows before they are fully constructed, // which can throw. We'll find those frames on our next poll(). } diff --git a/docshell/test/navigation/bluebox_bug430723.html b/docshell/test/navigation/bluebox_bug430723.html index 5dcc53356282..0569ddcfa460 100644 --- a/docshell/test/navigation/bluebox_bug430723.html +++ b/docshell/test/navigation/bluebox_bug430723.html @@ -1,5 +1,5 @@
- +This is a very tall blue box.
diff --git a/docshell/test/navigation/browser_bug343515.js b/docshell/test/navigation/browser_bug343515.js index 5e44450505c9..7a145901c34f 100644 --- a/docshell/test/navigation/browser_bug343515.js +++ b/docshell/test/navigation/browser_bug343515.js @@ -95,7 +95,8 @@ function step3() { Assert.equal(content.frames.length, 2, "Tab 2 should have 2 iframes"); for (var i = 0; i < content.frames.length; i++) { info("step 3, frame " + i + " info: " + content.frames[i].location); - let docShell = content.frames[i].docShell; + let docshell = content.frames[i].docShell; + Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`); } }).then(() => { @@ -109,7 +110,6 @@ function step3() { } function step4() { - /* eslint-disable no-shadow */ function checkTab2Active(expected) { return ContentTask.spawn(ctx.tab2Browser, expected, async function(expected) { function isActive(aWindow) { @@ -128,7 +128,7 @@ function step4() { Assert.equal(isActive(content.frames[1]), expected, `Tab2 iframe 1 should be ${active}`); }); } - /* eslint-enable no-shadow */ + is(testPath + "bug343515_pg3.html", ctx.tab2Browser.currentURI.spec, "Got expected tab 2 url in step 4"); @@ -161,7 +161,8 @@ function step5() { ok(ctx.tab2Browser.docShellIsActive, "Tab 2 should be active"); ContentTask.spawn(ctx.tab2Browser, null, async function() { for (var i = 0; i < content.frames.length; i++) { - let docShell = content.frames[i].docShell; + let docshell = content.frames[i].docShell; + Assert.ok(docShell.isActive, `Tab2 iframe ${i} should be active`); } }).then(() => { @@ -195,7 +196,8 @@ function step6() { ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive"); return ContentTask.spawn(ctx.tab2Browser, null, async function() { for (var i = 0; i < content.frames.length; i++) { - let docShell = content.frames[i].docShell; + let docshell = content.frames[i].docShell; + Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`); } }); @@ -207,7 +209,6 @@ function step6() { } function step7() { - /* eslint-disable no-shadow */ function checkBrowser(browser, tabNum, active) { return ContentTask.spawn(browser, { tabNum, active }, async function({ tabNum, active }) { @@ -225,7 +226,7 @@ function step7() { `Tab${tabNum} iframe 1 should be ${activestr}`); }); } - /* eslint-enable no-shadow */ + // Check everything ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive"); ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active"); @@ -238,7 +239,6 @@ function step7() { }); } - function allDone() { // Close the tabs we made diff --git a/docshell/test/navigation/browser_test-content-chromeflags.js b/docshell/test/navigation/browser_test-content-chromeflags.js index be8d748bc629..17c8e2473df2 100644 --- a/docshell/test/navigation/browser_test-content-chromeflags.js +++ b/docshell/test/navigation/browser_test-content-chromeflags.js @@ -13,13 +13,13 @@ add_task(async function() { SpecialPowers.pushPrefEnv({ "set": [ ["browser.link.open_newwindow", 2], - ], + ] }, resolve); }); await BrowserTestUtils.withNewTab({ gBrowser, - url: TEST_PAGE, + url: TEST_PAGE }, async function(browser) { let openedPromise = BrowserTestUtils.waitForNewWindow(); BrowserTestUtils.synthesizeMouse("a", 0, 0, {}, browser); diff --git a/docshell/test/navigation/file_bug1300461.html b/docshell/test/navigation/file_bug1300461.html index eb77f74184e0..bb7e827d98e2 100644 --- a/docshell/test/navigation/file_bug1300461.html +++ b/docshell/test/navigation/file_bug1300461.html @@ -30,31 +30,31 @@ let shistory = webNav.sessionHistory; let testSteps = [ function() { - opener.is(shistory.count, 1, "check history length"); - opener.is(shistory.index, 0, "check history index"); - opener.ok(!webNav.canGoForward, "check canGoForward"); - setTimeout(() => window.location = "file_bug1300461_back.html", 0); + opener.is(shistory.count, 1, 'check history length'); + opener.is(shistory.index, 0, 'check history index'); + opener.ok(!webNav.canGoForward, 'check canGoForward'); + setTimeout(() => window.location = 'file_bug1300461_back.html', 0); }, function() { - opener.is(shistory.count, 2, "check history length"); - opener.is(shistory.index, 0, "check history index"); - opener.ok(webNav.canGoForward, "check canGoForward"); + opener.is(shistory.count, 2, 'check history length'); + opener.is(shistory.index, 0, 'check history index'); + opener.ok(webNav.canGoForward, 'check canGoForward'); window.history.forward(); - opener.is(shistory.legacySHistory.requestedIndex, 1, "check requestedIndex"); + opener.is(shistory.legacySHistory.requestedIndex, 1, 'check requestedIndex'); }, function() { - opener.is(shistory.count, 2, "check history length"); - opener.is(shistory.index, 0, "check history index"); - opener.ok(webNav.canGoForward, "check canGoForward"); - opener.info("file_bug1300461.html tests finished"); + opener.is(shistory.count, 2, 'check history length'); + opener.is(shistory.index, 0, 'check history index'); + opener.ok(webNav.canGoForward, 'check canGoForward'); + opener.info('file_bug1300461.html tests finished'); opener.nextTest(); window.close(); - }, + } ]; function test() { if (opener) { - opener.info("file_bug1300461.html test " + opener.testCount); + opener.info('file_bug1300461.html test ' + opener.testCount); testSteps[opener.testCount++](); } } diff --git a/docshell/test/navigation/file_bug1300461_back.html b/docshell/test/navigation/file_bug1300461_back.html index 5803d174c7c9..7f2488e27a81 100644 --- a/docshell/test/navigation/file_bug1300461_back.html +++ b/docshell/test/navigation/file_bug1300461_back.html @@ -15,13 +15,13 @@ function test() { if (opener) { opener.info("file_bug1300461_back.html"); - opener.is(shistory.count, 2, "check history length"); - opener.is(shistory.index, 1, "check history index"); - opener.is(shistory.legacySHistory.requestedIndex, -1, "check requestedIndex"); - opener.ok(webNav.canGoBack, "check canGoBack"); + opener.is(shistory.count, 2, 'check history length'); + opener.is(shistory.index, 1, 'check history index'); + opener.is(shistory.legacySHistory.requestedIndex, -1, 'check requestedIndex'); + opener.ok(webNav.canGoBack, 'check canGoBack'); if (opener.testCount == 1) { - opener.info("replaceState to redirect.html"); - window.history.replaceState({}, "", "file_bug1300461_redirect.html"); + opener.info('replaceState to redirect.html'); + window.history.replaceState({}, '', 'file_bug1300461_redirect.html'); } window.history.back(); } diff --git a/docshell/test/navigation/file_bug1326251.html b/docshell/test/navigation/file_bug1326251.html index ebdee540add7..168100329388 100644 --- a/docshell/test/navigation/file_bug1326251.html +++ b/docshell/test/navigation/file_bug1326251.html @@ -4,7 +4,7 @@contentEditable
\ No newline at end of file +contentEditable
\ No newline at end of file diff --git a/docshell/test/navigation/file_bug386782_designmode.html b/docshell/test/navigation/file_bug386782_designmode.html index faa063cbaec9..592b5259232c 100644 --- a/docshell/test/navigation/file_bug386782_designmode.html +++ b/docshell/test/navigation/file_bug386782_designmode.html @@ -1 +1 @@ -designModeDocument
\ No newline at end of file +designModeDocument
\ No newline at end of file diff --git a/docshell/test/navigation/file_bug462076_1.html b/docshell/test/navigation/file_bug462076_1.html index 5050e79fdc17..0aafa9bda1a8 100644 --- a/docshell/test/navigation/file_bug462076_1.html +++ b/docshell/test/navigation/file_bug462076_1.html @@ -21,15 +21,15 @@ for (var i = randomNumber; i < 4; ++i) { makeFrame(i); } - for (var k = 0; k < randomNumber; ++k) { - makeFrame(k); + for (var i = 0; i < randomNumber; ++i) { + makeFrame(i); } } function checkFrame(evt) { var ifr = evt.target; - opener.ok(String(ifr.contentWindow.location).includes(ifr.src), - "Wrong document loaded (" + ifr.src + ", " + + opener.ok(new String(ifr.contentWindow.location).includes(ifr.src), + "Wrong document loaded (" + ifr.src + ", " + ifr.contentWindow.location + ")!"); if (++checkCount == 4) { diff --git a/docshell/test/navigation/file_bug462076_2.html b/docshell/test/navigation/file_bug462076_2.html index 63cf3de3f957..936099e5773a 100644 --- a/docshell/test/navigation/file_bug462076_2.html +++ b/docshell/test/navigation/file_bug462076_2.html @@ -21,15 +21,15 @@ for (var i = randomNumber; i < 4; ++i) { makeFrame(i); } - for (var k = 0; k < randomNumber; ++k) { - makeFrame(k); + for (var i = 0; i < randomNumber; ++i) { + makeFrame(i); } } function checkFrame(evt) { var ifr = evt.target; - opener.ok(String(ifr.contentWindow.location).includes(ifr.src), - "Wrong document loaded (" + ifr.src + ", " + + opener.ok(new String(ifr.contentWindow.location).includes(ifr.src), + "Wrong document loaded (" + ifr.src + ", " + ifr.contentWindow.location + ")!"); if (++checkCount == 4) { diff --git a/docshell/test/navigation/file_bug462076_3.html b/docshell/test/navigation/file_bug462076_3.html index 5c779d2f4988..05713df44af9 100644 --- a/docshell/test/navigation/file_bug462076_3.html +++ b/docshell/test/navigation/file_bug462076_3.html @@ -21,15 +21,15 @@ for (var i = randomNumber; i < 4; ++i) { makeFrame(i); } - for (var k = 0; k < randomNumber; ++k) { - makeFrame(k); + for (var i = 0; i < randomNumber; ++i) { + makeFrame(i); } } function checkFrame(evt) { var ifr = evt.target; - opener.ok(String(ifr.contentWindow.location).includes(ifr.src), - "Wrong document loaded (" + ifr.src + ", " + + opener.ok(new String(ifr.contentWindow.location).includes(ifr.src), + "Wrong document loaded (" + ifr.src + ", " + ifr.contentWindow.location + ")!"); if (++checkCount == 4) { diff --git a/docshell/test/navigation/file_bug508537_1.html b/docshell/test/navigation/file_bug508537_1.html index 3b1f6a175c3e..0531cbea7de5 100644 --- a/docshell/test/navigation/file_bug508537_1.html +++ b/docshell/test/navigation/file_bug508537_1.html @@ -3,9 +3,9 @@ diff --git a/docshell/test/navigation/file_triggeringprincipal_subframe.html b/docshell/test/navigation/file_triggeringprincipal_subframe.html index ba6b6dc09a1c..0db1349f2f95 100644 --- a/docshell/test/navigation/file_triggeringprincipal_subframe.html +++ b/docshell/test/navigation/file_triggeringprincipal_subframe.html @@ -6,9 +6,9 @@This is a very tall red box.
diff --git a/docshell/test/navigation/test_bug270414.html b/docshell/test/navigation/test_bug270414.html index ffa135fe70bb..98dcf42f8df1 100644 --- a/docshell/test/navigation/test_bug270414.html +++ b/docshell/test/navigation/test_bug270414.html @@ -9,18 +9,12 @@ iframe { width: 90%; height: 50px; } diff --git a/docshell/test/navigation/test_bug279495.html b/docshell/test/navigation/test_bug279495.html index 0cbc9dec75ef..79a169567774 100644 --- a/docshell/test/navigation/test_bug279495.html +++ b/docshell/test/navigation/test_bug279495.html @@ -6,12 +6,12 @@ diff --git a/docshell/test/navigation/test_bug344861.html b/docshell/test/navigation/test_bug344861.html index 4cc2eed1a3eb..f9759751c966 100644 --- a/docshell/test/navigation/test_bug344861.html +++ b/docshell/test/navigation/test_bug344861.html @@ -21,12 +21,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=344861 SimpleTest.waitForExplicitFinish(); var newwindow = window.open("/", "testwindow", "width=200,height=200"); -newwindow.onload = function() { +newwindow.onload = function() { is(newwindow.innerHeight, 200, "window.open has correct height dimensions"); is(newwindow.innerWidth, 200, "window.open has correct width dimensions"); SimpleTest.finish(); newwindow.close(); -}; +} diff --git a/docshell/test/navigation/test_bug386782.html b/docshell/test/navigation/test_bug386782.html index 1f11a93821c4..64dfc0dd0733 100644 --- a/docshell/test/navigation/test_bug386782.html +++ b/docshell/test/navigation/test_bug386782.html @@ -21,20 +21,20 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782 { //designModeDocument
url: "file_bug386782_designmode.html", - name: "designModeNavigate", + name: 'designModeNavigate', onload(doc) { doc.designMode = "on"; }, - expectedBodyBeforeEdit: "designModeDocument
", - expectedBodyAfterEdit: "EDITED designModeDocument
", - expectedBodyAfterSecondEdit: "EDITED TWICE designModeDocument
", + expectedBodyBeforeEdit: 'designModeDocument
', + expectedBodyAfterEdit: 'EDITED designModeDocument
', + expectedBodyAfterSecondEdit: 'EDITED TWICE designModeDocument
', }, { //contentEditable
url: "file_bug386782_contenteditable.html", - name: "contentEditableNavigate", - expectedBodyBeforeEdit: "contentEditable
", - expectedBodyAfterEdit: "EDITEDcontentEditable
", - expectedBodyAfterSecondEdit: "EDITED TWICEcontentEditable
", - }, + name: 'contentEditableNavigate', + expectedBodyBeforeEdit: 'contentEditable
', + expectedBodyAfterEdit: 'EDITEDcontentEditable
', + expectedBodyAfterSecondEdit: 'EDITED TWICEcontentEditable
', + } ]; var gTestNum = -1; @@ -66,10 +66,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782 // WARNING: If the following test fails, give the setTimeout() in the onload() // a bit longer; the doc hasn't had enough time to setup its editor. is(gTest.window.document.body.innerHTML, gTest.expectedBodyBeforeEdit, "Is doc setup yet"); - sendString("EDITED ", gTest.window); + sendString('EDITED ', gTest.window); is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Editing failed."); - gTest.window.location = "about:blank"; + gTest.window.location = 'about:blank'; SimpleTest.waitForFocus(goBack, gTest.window); } @@ -101,7 +101,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782 // Check that we can still edit the page. gTest.window.document.body.focus(); - sendString("TWICE ", gTest.window); + sendString('TWICE ', gTest.window); is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterSecondEdit, "Can we still edit?"); gTest.window.close(); diff --git a/docshell/test/navigation/test_bug430624.html b/docshell/test/navigation/test_bug430624.html index 342e5b2cd430..884025a8aea1 100644 --- a/docshell/test/navigation/test_bug430624.html +++ b/docshell/test/navigation/test_bug430624.html @@ -25,7 +25,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430624 function onLoad() { window.frames[0].frameElement.onload = onReload; - // eslint-disable-next-line no-self-assign window.frames[0].frameElement.srcdoc = window.frames[0].frameElement.srcdoc; } @@ -38,7 +37,7 @@ function onReload() { function doTest() { var bodyElement = window.frames[0].frameElement.contentDocument.body; bodyElement.focus(); - sendString("Still ", window.frames[0].frameElement.contentWindow); + sendString('Still ', window.frames[0].frameElement.contentWindow); is(bodyElement.innerHTML, "Still contentEditable", "Check we're contentEditable after reload"); diff --git a/docshell/test/navigation/test_bug430723.html b/docshell/test/navigation/test_bug430723.html index 6f22a5e7dbfb..d9802c54a5ee 100644 --- a/docshell/test/navigation/test_bug430723.html +++ b/docshell/test/navigation/test_bug430723.html @@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430723diff --git a/docshell/test/navigation/test_contentpolicy_block_window.html b/docshell/test/navigation/test_contentpolicy_block_window.html index 6dcd0a18e384..c597a4529044 100644 --- a/docshell/test/navigation/test_contentpolicy_block_window.html +++ b/docshell/test/navigation/test_contentpolicy_block_window.html @@ -24,9 +24,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1329288 * gets called with the right (a non null) 'context' for the TYPE_DOCUMENT load. */ -// Services.jsm is disabled as ChromeUtils appears to be out of scope -/* eslint-disable mozilla/use-services */ - const Cc = SpecialPowers.Cc; const Ci = SpecialPowers.Ci; @@ -39,8 +36,7 @@ var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d var policyName = "@mozilla.org/testpolicy;1"; var policy = { // nsISupports implementation - // eslint-disable-next-line mozilla/use-chromeutils-generateqi - QueryInterface(iid) { + QueryInterface: function(iid) { iid = SpecialPowers.wrap(iid); if (iid.equals(Ci.nsISupports) || iid.equals(Ci.nsIFactory) || @@ -50,12 +46,12 @@ var policy = { }, // nsIFactory implementation - createInstance(outer, iid) { + createInstance: function(outer, iid) { return this.QueryInterface(iid); }, // nsIContentPolicy implementation - shouldLoad(contentLocation, loadInfo, mimeTypeGuess) { + shouldLoad: function(contentLocation, loadInfo, mimeTypeGuess) { let contentType = loadInfo.externalContentPolicyType; let context = loadInfo.loadingContext; @@ -83,10 +79,10 @@ var policy = { return Ci.nsIContentPolicy.REJECT_REQUEST; }, - shouldProcess(contentLocation, loadInfo, mimeTypeGuess) { + shouldProcess: function(contentLocation, loadInfo, mimeTypeGuess) { return Ci.nsIContentPolicy.ACCEPT; - }, -}; + } +} policy = SpecialPowers.wrapCallbackObject(policy); componentManager.registerFactory(policyID, "Test content policy", policyName, policy); @@ -95,7 +91,7 @@ categoryManager.addCategoryEntry("content-policy", policyName, policyName, false SimpleTest.waitForExplicitFinish(); // now everything is set up, let's start the test -document.getElementById("testlink").click(); +document.getElementById("testlink").click() diff --git a/docshell/test/navigation/test_not-opener.html b/docshell/test/navigation/test_not-opener.html index 8bf6c8af8bcc..d778f71d9c93 100644 --- a/docshell/test/navigation/test_not-opener.html +++ b/docshell/test/navigation/test_not-opener.html @@ -13,8 +13,8 @@ if (!navigator.platform.startsWith("Win")) { SimpleTest.expectAssertions(0, 1); } -window.onload = function() { - // navigateByLocation(window0); // Don't have a handle to the window. +window.onload = function () { + //navigateByLocation(window0); // Don't have a handle to the window. navigateByOpen("window1"); navigateByForm("window2"); navigateByHyperlink("window3"); @@ -24,7 +24,7 @@ window.onload = function() { is(xpcGetFramesByName("window2").length, 2, "Should not be able to navigate popup's popup by submitting form."); is(xpcGetFramesByName("window3").length, 2, "Should not be able to navigate popup's popup by targeted hyperlink."); - // opener0.close(); + //opener0.close(); opener1.close(); opener2.close(); opener3.close(); @@ -32,12 +32,12 @@ window.onload = function() { xpcCleanupWindows(); SimpleTest.finish(); }, 6); -}; +} -// opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10"); -let opener1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window1", "_blank", "width=10,height=10"); -let opener2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window2", "_blank", "width=10,height=10"); -let opener3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window3", "_blank", "width=10,height=10"); +//opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10"); +opener1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window1", "_blank", "width=10,height=10"); +opener2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window2", "_blank", "width=10,height=10"); +opener3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window3", "_blank", "width=10,height=10"); diff --git a/docshell/test/navigation/test_opener.html b/docshell/test/navigation/test_opener.html index 0a7e9288f449..bfb1dde9f773 100644 --- a/docshell/test/navigation/test_opener.html +++ b/docshell/test/navigation/test_opener.html @@ -13,7 +13,7 @@ if (navigator.platform.startsWith("Linux")) { SimpleTest.expectAssertions(0, 1); } -window.onload = function() { +window.onload = function () { navigateByLocation(window0); navigateByOpen("window1"); navigateByForm("window2"); @@ -33,7 +33,7 @@ window.onload = function() { xpcCleanupWindows(); SimpleTest.finish(); }, 4); -}; +} var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window0", "width=10,height=10"); var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window1", "width=10,height=10"); diff --git a/docshell/test/navigation/test_popup-navigates-children.html b/docshell/test/navigation/test_popup-navigates-children.html index c809e17ba99d..692f35713cd5 100644 --- a/docshell/test/navigation/test_popup-navigates-children.html +++ b/docshell/test/navigation/test_popup-navigates-children.html @@ -9,12 +9,6 @@ iframe { width: 90%; height: 50px; } diff --git a/docshell/test/navigation/test_sessionhistory.html b/docshell/test/navigation/test_sessionhistory.html index c2c24f5e5dc1..fb4cfc08512c 100644 --- a/docshell/test/navigation/test_sessionhistory.html +++ b/docshell/test/navigation/test_sessionhistory.html @@ -25,7 +25,7 @@ var testFiles = "file_bug462076_3.html", // Dynamic frames after onload "file_bug508537_1.html", // Dynamic frames and forward-back "file_document_write_1.html", // Session history + document.write - // "file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back + //"file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back "file_bug534178.html", // Session history entry clean-up. "file_fragment_handling_during_load.html", "file_nested_frames.html", @@ -48,7 +48,7 @@ function nextTest_() { let nextFile = testFiles.shift(); info("Running " + nextFile); testWindow = window.open(nextFile, "", "width=360,height=480"); - testWindow.onunload = function() { }; // to prevent bfcache + testWindow.onunload = function () { } // to prevent bfcache } else { SimpleTest.finish(); } diff --git a/docshell/test/navigation/test_sibling-matching-parent.html b/docshell/test/navigation/test_sibling-matching-parent.html index c4881b2442bc..dc8ec2f905e4 100644 --- a/docshell/test/navigation/test_sibling-matching-parent.html +++ b/docshell/test/navigation/test_sibling-matching-parent.html @@ -9,8 +9,8 @@ iframe { width: 90%; height: 50px; } diff --git a/docshell/test/navigation/test_sibling-off-domain.html b/docshell/test/navigation/test_sibling-off-domain.html index a02958c9a1b5..ba7942798ee6 100644 --- a/docshell/test/navigation/test_sibling-off-domain.html +++ b/docshell/test/navigation/test_sibling-off-domain.html @@ -9,8 +9,8 @@ iframe { width: 90%; height: 50px; } diff --git a/docshell/test/navigation/test_triggeringprincipal_frame_nav.html b/docshell/test/navigation/test_triggeringprincipal_frame_nav.html index 2c783191c500..fa6e0e03d2b7 100644 --- a/docshell/test/navigation/test_triggeringprincipal_frame_nav.html +++ b/docshell/test/navigation/test_triggeringprincipal_frame_nav.html @@ -48,9 +48,9 @@ window.addEventListener("message", receiveMessage); function receiveMessage(event) { is(event.data.triggeringPrincipalURI, TRIGGERINGPRINCIPALURI, - "TriggeringPrincipal should be the navigating iframe (Frame 1)"); + "TriggeringPrincipal should be the navigating iframe (Frame 1)"); is(event.data.loadingPrincipalURI, LOADINGPRINCIPALURI, - "LoadingPrincipal should be the enclosing iframe (Frame 2)"); + "LoadingPrincipal should be the enclosing iframe (Frame 2)"); is(event.data.referrerURI, TRIGGERINGPRINCIPALURI, "Referrer and TriggeringPrincipal should be identical (Frame 1)"); diff --git a/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html b/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html index a1267a4697c2..0662a01a3332 100644 --- a/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html +++ b/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html @@ -18,16 +18,16 @@ * TriggeringPrincipal and LoadingPrincipal of the navigated iframe (Frame A). * * +---------------------------------------+ - * | Parent | - * | | + * | Parent | + * | | * | +----------------------------+ | - * | | Frame A | | + * | | Frame A | | * | | | | * | | | | * | +----------------------------+ | - * | | + * | | * | +----------------------------+ | - * | | Frame B | | + * | | Frame B | | * | | | | * | | win.open("http://", "A") | | * | +----------------------------+ | @@ -49,7 +49,7 @@ const LOADING_PRINCIPAL_URI = var frameA = document.getElementById("framea"); function checkResults() { - frameA.removeEventListener("load", checkResults); + frameA.removeEventListener('load', checkResults); var channel = SpecialPowers.wrap(frameA.contentWindow).docShell.currentDocumentChannel; var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec; @@ -63,13 +63,13 @@ function checkResults() { is(loadingPrincipal, LOADING_PRINCIPAL_URI, "LoadingPrincipal for targeted window.open() should be the containing document"); - + SimpleTest.finish(); } function performNavigation() { - frameA.removeEventListener("load", performNavigation); - frameA.addEventListener("load", checkResults); + frameA.removeEventListener('load', performNavigation); + frameA.addEventListener('load', checkResults); // load Frame B which then navigates Frame A var frameB = document.getElementById("frameb"); @@ -79,7 +79,7 @@ function performNavigation() { // start the test SimpleTest.waitForExplicitFinish(); -frameA.addEventListener("load", performNavigation); +frameA.addEventListener('load', performNavigation); diff --git a/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html b/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html index 414878bc1314..4c0897ac7b28 100644 --- a/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html +++ b/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html @@ -17,13 +17,13 @@ * TriggeringPrincipal and LoadingPrincipal of the navigated iframe. * * +------------------------------------------+ - * | | + * | | * | +------------------+ | - * | | testframe | | + * | | testframe | | * | +------------------+ | - * | | + * | | * | window.open("http://", "testframe"); | - * | | + * | | * +------------------------------------------+ */ @@ -35,7 +35,7 @@ const LOADING_PRINCIPAL_URI = TRIGGERING_PRINCIPAL_URI; var testframe = document.getElementById("testframe"); function checkResults() { - testframe.removeEventListener("load", checkResults); + testframe.removeEventListener('load', checkResults); var channel = SpecialPowers.wrap(testframe.contentWindow).docShell.currentDocumentChannel; var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec; @@ -49,20 +49,20 @@ function checkResults() { is(loadingPrincipal, LOADING_PRINCIPAL_URI, "LoadingPrincipal for targeted window.open() should be the
diff --git a/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html b/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html index c3673ad299d5..e5abc1ea1951 100644 --- a/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html +++ b/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html @@ -6,15 +6,15 @@ diff --git a/docshell/test/navigation/navigate.html b/docshell/test/navigation/navigate.html index cc142b07cbdb..e686da4236c0 100644 --- a/docshell/test/navigation/navigate.html +++ b/docshell/test/navigation/navigate.html @@ -4,13 +4,12 @@ diff --git a/docshell/test/navigation/redbox_bug430723.html b/docshell/test/navigation/redbox_bug430723.html index c2d1f980923e..db025c31f7ca 100644 --- a/docshell/test/navigation/redbox_bug430723.html +++ b/docshell/test/navigation/redbox_bug430723.html @@ -1,5 +1,5 @@
- +
diff --git a/docshell/test/navigation/test_child.html b/docshell/test/navigation/test_child.html index a2c8eb5d8fe2..c43e1a6cf0ba 100644 --- a/docshell/test/navigation/test_child.html +++ b/docshell/test/navigation/test_child.html @@ -28,7 +28,7 @@ window.onload = function() { xpcCleanupWindows(); SimpleTest.finish(); }, 4); -}; +}
diff --git a/docshell/test/navigation/test_grandchild.html b/docshell/test/navigation/test_grandchild.html index 795f18b0c1cd..439145b3edb6 100644 --- a/docshell/test/navigation/test_grandchild.html +++ b/docshell/test/navigation/test_grandchild.html @@ -13,7 +13,7 @@ if (!navigator.platform.startsWith("Win")) { SimpleTest.expectAssertions(0, 1); } -window.onload = function() { +window.onload = function () { navigateByLocation(frames[0].frames[0]); navigateByOpen("child1_child0"); navigateByForm("child2_child0"); @@ -28,7 +28,7 @@ window.onload = function() { xpcCleanupWindows(); SimpleTest.finish(); }, 4); -}; +}