From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/base/test/browser.toml | 10 + dom/base/test/browser_object_attachment.js | 168 +++++++ dom/base/test/chrome.toml | 3 - dom/base/test/chrome/bug418986-1.js | 3 + dom/base/test/chrome/chrome.toml | 4 - dom/base/test/chrome/file_bug549682.xhtml | 10 +- dom/base/test/chrome/file_bug616841.xhtml | 2 +- dom/base/test/chrome/test_bug1339722.html | 4 +- dom/base/test/chrome/test_bug339494.xhtml | 2 +- dom/base/test/chrome/test_bug429785.xhtml | 2 +- dom/base/test/chrome/test_bug430050.xhtml | 2 +- .../test/chrome/test_chromeOuterWindowID.xhtml | 2 +- dom/base/test/chrome/test_swapFrameLoaders.xhtml | 25 - dom/base/test/chrome/title_window.xhtml | 4 +- .../test/chrome/window_nsITextInputProcessor.xhtml | 4 +- dom/base/test/chrome/window_swapFrameLoaders.xhtml | 223 --------- dom/base/test/common_postMessages.js | 2 + dom/base/test/file_bug1008126_worker.js | 2 + dom/base/test/file_bug945152_worker.js | 1 + dom/base/test/file_focus_shadow_dom.html | 24 +- dom/base/test/file_img_attachment.jpg | Bin 0 -> 2711 bytes dom/base/test/file_img_attachment.jpg^headers^ | 1 + dom/base/test/file_img_object_attachment.html | 6 + dom/base/test/file_pdf_attachment.pdf | Bin 0 -> 1568 bytes dom/base/test/file_pdf_attachment.pdf^headers^ | 2 + dom/base/test/file_pdf_object_attachment.html | 6 + .../test/fullscreen/MozDomFullscreen_chrome.xhtml | 2 +- .../browser_fullscreen-navigation-history-race.js | 2 +- .../browser_fullscreen-tab-close-race.js | 2 +- dom/base/test/fullscreen/file_fullscreen-api.html | 22 +- .../fullscreen/file_fullscreen-bug-1798219-2.html | 2 +- .../fullscreen/file_fullscreen-bug-1798219.html | 2 +- .../test/fullscreen/file_fullscreen-denied.html | 2 +- .../fullscreen/file_fullscreen-esc-exit-inner.html | 2 +- .../test/fullscreen/file_fullscreen-esc-exit.html | 4 +- .../test/fullscreen/file_fullscreen-shadowdom.html | 2 +- .../fullscreen/file_fullscreen-svg-element.html | 2 +- dom/base/test/fullscreen/fullscreen.xhtml | 2 +- dom/base/test/fullscreen/fullscreen_helpers.js | 4 +- dom/base/test/fullscreen/test_fullscreen-api.html | 2 +- .../test/fullscreen/test_fullscreen_modal.html | 11 +- dom/base/test/gtest/TestMimeType.cpp | 142 +++--- dom/base/test/meta_viewport/viewport_helpers.js | 1 + dom/base/test/mochitest.toml | 5 +- dom/base/test/test_domrequest.html | 233 --------- dom/base/test/test_domrequesthelper.xhtml | 549 --------------------- dom/base/test/test_focus_radio.html | 90 ++++ dom/base/test/unit/test_error_codes.js | 2 +- .../test/useractivation/file_clipboard_common.js | 8 +- .../test_popup_blocker_async_callback.html | 2 +- .../test_useractivation_scrollbar.html | 2 +- 51 files changed, 439 insertions(+), 1170 deletions(-) create mode 100644 dom/base/test/browser_object_attachment.js delete mode 100644 dom/base/test/chrome/test_swapFrameLoaders.xhtml delete mode 100644 dom/base/test/chrome/window_swapFrameLoaders.xhtml create mode 100644 dom/base/test/file_img_attachment.jpg create mode 100644 dom/base/test/file_img_attachment.jpg^headers^ create mode 100644 dom/base/test/file_img_object_attachment.html create mode 100644 dom/base/test/file_pdf_attachment.pdf create mode 100644 dom/base/test/file_pdf_attachment.pdf^headers^ create mode 100644 dom/base/test/file_pdf_object_attachment.html delete mode 100644 dom/base/test/test_domrequest.html delete mode 100644 dom/base/test/test_domrequesthelper.xhtml create mode 100644 dom/base/test/test_focus_radio.html (limited to 'dom/base/test') diff --git a/dom/base/test/browser.toml b/dom/base/test/browser.toml index 1deeb88d89..a68bd2e873 100644 --- a/dom/base/test/browser.toml +++ b/dom/base/test/browser.toml @@ -109,6 +109,16 @@ skip-if = [ ] support-files = ["browser_multiple_popups.html"] +["browser_object_attachment.js"] +support-files = [ + "file_img_object_attachment.html", + "file_img_attachment.jpg", + "file_img_attachment.jpg^headers^", + "file_pdf_object_attachment.html", + "file_pdf_attachment.pdf", + "file_pdf_attachment.pdf^headers^", +] + ["browser_outline_refocus.js"] ["browser_page_load_event_telemetry.js"] diff --git a/dom/base/test/browser_object_attachment.js b/dom/base/test/browser_object_attachment.js new file mode 100644 index 0000000000..b4432862f0 --- /dev/null +++ b/dom/base/test/browser_object_attachment.js @@ -0,0 +1,168 @@ +ChromeUtils.defineESModuleGetters(this, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", +}); + +const httpsTestRoot = getRootDirectory(gTestPath).replace( + "chrome://mochitests/content", + "https://example.com" +); + +add_task(async function test_pdf_object_attachment() { + await SpecialPowers.pushPrefEnv({ + set: [["dom.navigation.object_embed.allow_retargeting", false]], + }); + + await BrowserTestUtils.withNewTab( + `${httpsTestRoot}/file_pdf_object_attachment.html`, + async browser => { + is( + browser.browsingContext.children.length, + 1, + "Should have a child frame" + ); + await SpecialPowers.spawn(browser, [], async () => { + let obj = content.document.querySelector("object"); + is( + obj.displayedType, + Ci.nsIObjectLoadingContent.TYPE_DOCUMENT, + "should be displaying TYPE_DOCUMENT" + ); + }); + } + ); +}); + +add_task(async function test_img_object_attachment() { + await SpecialPowers.pushPrefEnv({ + set: [["dom.navigation.object_embed.allow_retargeting", false]], + }); + + await BrowserTestUtils.withNewTab( + `${httpsTestRoot}/file_img_object_attachment.html`, + async browser => { + is( + browser.browsingContext.children.length, + 1, + "Should have a child frame" + ); + await SpecialPowers.spawn(browser, [], async () => { + let obj = content.document.querySelector("object"); + is( + obj.displayedType, + Ci.nsIObjectLoadingContent.TYPE_DOCUMENT, + "should be displaying TYPE_DOCUMENT" + ); + }); + } + ); +}); + +async function waitForDownload() { + // Get the downloads list and add a view to listen for a download to be added. + let downloadList = await Downloads.getList(Downloads.ALL); + + // Wait for a single download + let downloadView; + let finishedAllDownloads = new Promise(resolve => { + downloadView = { + onDownloadAdded(aDownload) { + info("download added"); + resolve(aDownload); + }, + }; + }); + await downloadList.addView(downloadView); + let download = await finishedAllDownloads; + await downloadList.removeView(downloadView); + + // Clean up the download from the list. + await downloadList.remove(download); + await download.finalize(true); + + // Return the download + return download; +} + +add_task(async function test_pdf_object_attachment_download() { + await SpecialPowers.pushPrefEnv({ + set: [["dom.navigation.object_embed.allow_retargeting", true]], + }); + + // Set the behaviour to save pdfs to disk and not handle internally, so we + // don't end up with extra tabs after the test. + var gMimeSvc = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); + var gHandlerSvc = Cc["@mozilla.org/uriloader/handler-service;1"].getService( + Ci.nsIHandlerService + ); + const mimeInfo = gMimeSvc.getFromTypeAndExtension("application/pdf", "pdf"); + let previousAction = mimeInfo.preferredAction; + mimeInfo.preferredAction = Ci.nsIHandlerInfo.saveToDisk; + gHandlerSvc.store(mimeInfo); + registerCleanupFunction(() => { + mimeInfo.preferredAction = previousAction; + gHandlerSvc.store(mimeInfo); + }); + + // Start listening for the download before opening the new tab. + let downloadPromise = waitForDownload(); + await BrowserTestUtils.withNewTab( + `${httpsTestRoot}/file_pdf_object_attachment.html`, + async browser => { + let download = await downloadPromise; + is( + download.source.url, + `${httpsTestRoot}/file_pdf_attachment.pdf`, + "download should be the pdf" + ); + + await SpecialPowers.spawn(browser, [], async () => { + let obj = content.document.querySelector("object"); + is( + obj.displayedType, + Ci.nsIObjectLoadingContent.TYPE_FALLBACK, + "should be displaying TYPE_FALLBACK" + ); + }); + } + ); +}); + +add_task(async function test_img_object_attachment_download() { + // NOTE: This is testing our current behaviour here as of bug 1868001 (which + // is to download an image with `Content-Disposition: attachment` embedded + // within an object or embed element). + // + // Other browsers ignore the `Content-Disposition: attachment` header when + // loading images within object or embed element as-of december 2023, as + // we did prior to the changes in bug 1595491. + // + // If this turns out to be a web-compat issue, we may want to introduce + // special handling to ignore content-disposition when loading images within + // an object or embed element. + await SpecialPowers.pushPrefEnv({ + set: [["dom.navigation.object_embed.allow_retargeting", true]], + }); + + // Start listening for the download before opening the new tab. + let downloadPromise = waitForDownload(); + await BrowserTestUtils.withNewTab( + `${httpsTestRoot}/file_img_object_attachment.html`, + async browser => { + let download = await downloadPromise; + is( + download.source.url, + `${httpsTestRoot}/file_img_attachment.jpg`, + "download should be the jpg" + ); + + await SpecialPowers.spawn(browser, [], async () => { + let obj = content.document.querySelector("object"); + is( + obj.displayedType, + Ci.nsIObjectLoadingContent.TYPE_FALLBACK, + "should be displaying TYPE_FALLBACK" + ); + }); + } + ); +}); diff --git a/dom/base/test/chrome.toml b/dom/base/test/chrome.toml index 687d778cac..ec736a086c 100644 --- a/dom/base/test/chrome.toml +++ b/dom/base/test/chrome.toml @@ -1,6 +1,5 @@ [DEFAULT] skip-if = ["os == 'android'"] -prefs = ["dom.domrequest.enabled=true"] support-files = [ "file_empty.html", "file_blocking_image.html", @@ -38,8 +37,6 @@ support-files = [ ["test_bug1120222.html"] -["test_domrequesthelper.xhtml"] - ["test_fragment_sanitization.xhtml"] ["test_getLastOverWindowPointerLocationInCSSPixels.html"] diff --git a/dom/base/test/chrome/bug418986-1.js b/dom/base/test/chrome/bug418986-1.js index 7c39df0c13..e7e3c63b5c 100644 --- a/dom/base/test/chrome/bug418986-1.js +++ b/dom/base/test/chrome/bug418986-1.js @@ -1,4 +1,7 @@ /* globals chromeWindow */ + +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ + // The main test function. var test = function (isContent) { SimpleTest.waitForExplicitFinish(); diff --git a/dom/base/test/chrome/chrome.toml b/dom/base/test/chrome/chrome.toml index b8439a2d2e..08265bcb97 100644 --- a/dom/base/test/chrome/chrome.toml +++ b/dom/base/test/chrome/chrome.toml @@ -18,7 +18,6 @@ support-files = [ "custom_element_ep.js", "window_nsITextInputProcessor.xhtml", "title_window.xhtml", - "window_swapFrameLoaders.xhtml", ] prefs = ["gfx.font_rendering.fallback.async=false"] @@ -126,9 +125,6 @@ support-files = ["../dummy.html"] ["test_range_getClientRectsAndTexts.html"] -["test_swapFrameLoaders.xhtml"] -skip-if = ["os == 'mac'"] # bug 1674413 - ["test_title.xhtml"] support-files = ["file_title.xhtml"] diff --git a/dom/base/test/chrome/file_bug549682.xhtml b/dom/base/test/chrome/file_bug549682.xhtml index 8ae05d38d8..0bb3080507 100644 --- a/dom/base/test/chrome/file_bug549682.xhtml +++ b/dom/base/test/chrome/file_bug549682.xhtml @@ -28,11 +28,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682 } var asyncPPML = false; - function ppmASL(m) { + function ppmASL() { asyncPPML = true; } var syncPPML = false; - function ppmSL(m) { + function ppmSL() { syncPPML = true; } ppm.addMessageListener("processmessageAsync", ppmASL); @@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682 cpm.sendSyncMessage("processmessageSync", ""); var asyncCPML = false; - function cpmASL(m) { + function cpmASL() { asyncCPML = true; } cpm.addMessageListener("childprocessmessage", cpmASL); @@ -93,7 +93,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682 var weakListener = { QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]), - receiveMessage(msg) { + receiveMessage() { if (weakMessageReceived) { ok(false, 'Weak listener fired twice.'); return; @@ -109,7 +109,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682 var weakListener2 = { QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]), - receiveMessage(msg) { + receiveMessage() { ok(false, 'Should not have received a message.'); } }; diff --git a/dom/base/test/chrome/file_bug616841.xhtml b/dom/base/test/chrome/file_bug616841.xhtml index b0512d162c..3651a00226 100644 --- a/dom/base/test/chrome/file_bug616841.xhtml +++ b/dom/base/test/chrome/file_bug616841.xhtml @@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841 [ "D", "\u010C" ] ]; var nCmps = 0; - function recvContentReady(m) { + function recvContentReady() { for (var i = 0; i < toCompare.length; ++i) { var pair = toCompare[i]; messageManager.broadcastAsyncMessage("cmp", diff --git a/dom/base/test/chrome/test_bug1339722.html b/dom/base/test/chrome/test_bug1339722.html index d8d95f1faa..7655ff95fa 100644 --- a/dom/base/test/chrome/test_bug1339722.html +++ b/dom/base/test/chrome/test_bug1339722.html @@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722 // behave similarly. const TOPIC = "document-on-modify-request"; let win; - const observe = (subject, topic, data) => { + const observe = (subject, topic) => { info("Got " + topic); Services.obs.removeObserver(observe, TOPIC); @@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722 // Remove the iframe to cause frameloader destroy. iframe.remove(); - setTimeout($ => { + setTimeout(() => { ok(!document.getElementById("testFrame"), "verify iframe removed"); SimpleTest.finish(); }, 0); diff --git a/dom/base/test/chrome/test_bug339494.xhtml b/dom/base/test/chrome/test_bug339494.xhtml index 203f6e644d..afab41b65c 100644 --- a/dom/base/test/chrome/test_bug339494.xhtml +++ b/dom/base/test/chrome/test_bug339494.xhtml @@ -55,7 +55,7 @@ SimpleTest.waitForExplicitFinish(); s.setAttribute("ggg", "testvalue"); await promiseFlushingMutationObserver(); - const observer = new MutationObserver((aMutationList, aObserver) => { + const observer = new MutationObserver(() => { ok(s.hasAttribute("ggg"), "Value check 3. There should be a value"); isnot(s.getAttribute("ggg"), "testvalue", "Value check 4"); is(s.getAttribute("ggg"), "othervalue", "Value check 5"); diff --git a/dom/base/test/chrome/test_bug429785.xhtml b/dom/base/test/chrome/test_bug429785.xhtml index fb51634fab..10c9977ccb 100644 --- a/dom/base/test/chrome/test_bug429785.xhtml +++ b/dom/base/test/chrome/test_bug429785.xhtml @@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785 var errorLogged = false; var listener = { QueryInterface: ChromeUtils.generateQI(["nsIConsoleListener"]), - observe(msg) { errorLogged = true; } + observe() { errorLogged = true; } }; function step2() { diff --git a/dom/base/test/chrome/test_bug430050.xhtml b/dom/base/test/chrome/test_bug430050.xhtml index d7d6cf656c..dfe1e3c8ee 100644 --- a/dom/base/test/chrome/test_bug430050.xhtml +++ b/dom/base/test/chrome/test_bug430050.xhtml @@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430050 } function startTest() { - const observer = new MutationObserver((aMutationList, aObserver) => { + const observer = new MutationObserver(() => { document.getElementById('b').setAttribute("src", "data:text/plain,failed"); const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal(); diff --git a/dom/base/test/chrome/test_chromeOuterWindowID.xhtml b/dom/base/test/chrome/test_chromeOuterWindowID.xhtml index 1feb7c7c74..3aa482b636 100644 --- a/dom/base/test/chrome/test_chromeOuterWindowID.xhtml +++ b/dom/base/test/chrome/test_chromeOuterWindowID.xhtml @@ -42,7 +42,7 @@ windows. "Both browsers should belong to the same document."); let winID = getOuterWindowID(browser1.ownerGlobal); - let getChildRootOuterId = browser => { + let getChildRootOuterId = () => { try { return docShell.browserChild?.chromeOuterWindowID; } catch(ex) { } diff --git a/dom/base/test/chrome/test_swapFrameLoaders.xhtml b/dom/base/test/chrome/test_swapFrameLoaders.xhtml deleted file mode 100644 index 4ea11a1a62..0000000000 --- a/dom/base/test/chrome/test_swapFrameLoaders.xhtml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/dom/base/test/chrome/title_window.xhtml b/dom/base/test/chrome/title_window.xhtml index f48cdaaaf1..5f9840c36c 100644 --- a/dom/base/test/chrome/title_window.xhtml +++ b/dom/base/test/chrome/title_window.xhtml @@ -63,10 +63,10 @@ } } - function listener2(ev) { + function listener2() { inProgressDoc[description] = false; } - function listener3(ev) { + function listener3() { inProgressWin[description] = false; } frame.addEventListener("DOMTitleChanged", listener); diff --git a/dom/base/test/chrome/window_nsITextInputProcessor.xhtml b/dom/base/test/chrome/window_nsITextInputProcessor.xhtml index c8ce6ee5e7..c62ba2ce47 100644 --- a/dom/base/test/chrome/window_nsITextInputProcessor.xhtml +++ b/dom/base/test/chrome/window_nsITextInputProcessor.xhtml @@ -4120,7 +4120,7 @@ function runUnloadTests1() let oldSrc = iframe.src; let parentWindow = window; - iframe.addEventListener("load", function (aEvent) { + iframe.addEventListener("load", function () { ok(true, description + "dummy page is loaded"); childWindow = iframe.contentWindow; textareaInFrame = null; @@ -4181,7 +4181,7 @@ function runUnloadTests2() let oldSrc = iframe.src; - iframe.addEventListener("load", function (aEvent) { + iframe.addEventListener("load", function () { ok(true, description + "dummy page is loaded"); childWindow = iframe.contentWindow; textareaInFrame = null; diff --git a/dom/base/test/chrome/window_swapFrameLoaders.xhtml b/dom/base/test/chrome/window_swapFrameLoaders.xhtml deleted file mode 100644 index 4a38bcc1fc..0000000000 --- a/dom/base/test/chrome/window_swapFrameLoaders.xhtml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - diff --git a/dom/base/test/common_postMessages.js b/dom/base/test/common_postMessages.js index c4836fdd77..044f3e7f34 100644 --- a/dom/base/test/common_postMessages.js +++ b/dom/base/test/common_postMessages.js @@ -1,3 +1,5 @@ +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ + function getType(a) { if (a === null || a === undefined) { return "null"; diff --git a/dom/base/test/file_bug1008126_worker.js b/dom/base/test/file_bug1008126_worker.js index aaba278de5..4e418d777e 100644 --- a/dom/base/test/file_bug1008126_worker.js +++ b/dom/base/test/file_bug1008126_worker.js @@ -3,6 +3,8 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ + var gEntry1 = "data_1.txt"; var gEntry2 = "data_2.txt"; var gEntry3 = "data_big.txt"; diff --git a/dom/base/test/file_bug945152_worker.js b/dom/base/test/file_bug945152_worker.js index 9664045b6d..c0feebf0d6 100644 --- a/dom/base/test/file_bug945152_worker.js +++ b/dom/base/test/file_bug945152_worker.js @@ -1,3 +1,4 @@ +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ var gData1 = "TEST_DATA_1:ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var gData2 = "TEST_DATA_2:1234567890"; var gPaddingChar = "."; diff --git a/dom/base/test/file_focus_shadow_dom.html b/dom/base/test/file_focus_shadow_dom.html index 6fa9d1b88e..7a0a0da729 100644 --- a/dom/base/test/file_focus_shadow_dom.html +++ b/dom/base/test/file_focus_shadow_dom.html @@ -79,10 +79,16 @@ opener.is(lastFocusTarget, shadowDate, "Should have focused date element in shadow DOM. (3)"); synthesizeKey("KEY_Tab"); opener.is(lastFocusTarget, shadowDate, "Should have focused date element with a calendar button in shadow DOM. (3)"); - synthesizeKey("KEY_Tab"); - opener.is(shadowIframe.contentDocument.activeElement, - shadowIframe.contentDocument.documentElement, - "Should have focused document element in shadow iframe. (3)"); + + let canTabMoveFocusToRootElement = + !SpecialPowers.getBoolPref("dom.disable_tab_focus_to_root_element"); + if (canTabMoveFocusToRootElement) { + synthesizeKey("KEY_Tab"); + opener.is(shadowIframe.contentDocument.activeElement, + shadowIframe.contentDocument.documentElement, + "Should have focused document element in shadow iframe. (3)"); + } + synthesizeKey("KEY_Tab"); opener.is(shadowIframe.contentDocument.activeElement, shadowIframe.contentDocument.body.firstChild, @@ -99,10 +105,12 @@ opener.is(shadowIframe.contentDocument.activeElement, shadowIframe.contentDocument.body.firstChild, "Should have focused input element in shadow iframe. (4)"); - synthesizeKey("KEY_Tab", {shiftKey: true}); - opener.is(shadowIframe.contentDocument.activeElement, - shadowIframe.contentDocument.documentElement, - "Should have focused document element in shadow iframe. (4)"); + if (canTabMoveFocusToRootElement) { + synthesizeKey("KEY_Tab", {shiftKey: true}); + opener.is(shadowIframe.contentDocument.activeElement, + shadowIframe.contentDocument.documentElement, + "Should have focused document element in shadow iframe. (4)"); + } synthesizeKey("KEY_Tab", {shiftKey: true}); opener.is(lastFocusTarget, shadowDate, "Should have focused date element with a calendar button in shadow DOM. (4)"); synthesizeKey("KEY_Tab", {shiftKey: true}); diff --git a/dom/base/test/file_img_attachment.jpg b/dom/base/test/file_img_attachment.jpg new file mode 100644 index 0000000000..dcd99b9670 Binary files /dev/null and b/dom/base/test/file_img_attachment.jpg differ diff --git a/dom/base/test/file_img_attachment.jpg^headers^ b/dom/base/test/file_img_attachment.jpg^headers^ new file mode 100644 index 0000000000..71ed8e7805 --- /dev/null +++ b/dom/base/test/file_img_attachment.jpg^headers^ @@ -0,0 +1 @@ +Content-Disposition: attachment diff --git a/dom/base/test/file_img_object_attachment.html b/dom/base/test/file_img_object_attachment.html new file mode 100644 index 0000000000..502894041e --- /dev/null +++ b/dom/base/test/file_img_object_attachment.html @@ -0,0 +1,6 @@ + + + + fallback + + diff --git a/dom/base/test/file_pdf_attachment.pdf b/dom/base/test/file_pdf_attachment.pdf new file mode 100644 index 0000000000..89066463f1 Binary files /dev/null and b/dom/base/test/file_pdf_attachment.pdf differ diff --git a/dom/base/test/file_pdf_attachment.pdf^headers^ b/dom/base/test/file_pdf_attachment.pdf^headers^ new file mode 100644 index 0000000000..562009a8de --- /dev/null +++ b/dom/base/test/file_pdf_attachment.pdf^headers^ @@ -0,0 +1,2 @@ +Content-Type: application/octet-stream +Content-Disposition: attachment diff --git a/dom/base/test/file_pdf_object_attachment.html b/dom/base/test/file_pdf_object_attachment.html new file mode 100644 index 0000000000..d87eff9923 --- /dev/null +++ b/dom/base/test/file_pdf_object_attachment.html @@ -0,0 +1,6 @@ + + + + fallback + + diff --git a/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml b/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml index 93f00311e7..bc92abf3e0 100644 --- a/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml +++ b/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml @@ -79,7 +79,7 @@ function thirdEntry(event) { gOuterDoc.exitFullscreen(); } -function earlyExit(event) { +function earlyExit() { ok(false, "MozDOMFullscreen:Exited should only be triggered after cancel all fullscreen"); } diff --git a/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js b/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js index 2ea2b9ee40..49a48c3177 100644 --- a/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js +++ b/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js @@ -82,7 +82,7 @@ function preventBFCache(aBrowsingContext, aPrevent) { let target = content.document.getElementById("div"); target.addEventListener( "mousedown", - function (e) { + function () { content.window.history.back(); }, { once: true } diff --git a/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js b/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js index 10d10a0b0f..1338c4a550 100644 --- a/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js +++ b/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js @@ -70,7 +70,7 @@ async function WaitRemoveDocumentAndCloseTab(aBrowser, aBrowsingContext) { return new Promise(resolve => { content.document.addEventListener( "fullscreenchange", - e => { + () => { resolve(); }, { once: true } diff --git a/dom/base/test/fullscreen/file_fullscreen-api.html b/dom/base/test/fullscreen/file_fullscreen-api.html index 645e6ece46..9661b10de9 100644 --- a/dom/base/test/fullscreen/file_fullscreen-api.html +++ b/dom/base/test/fullscreen/file_fullscreen-api.html @@ -112,7 +112,7 @@ function enter2(event) { promise = document.exitFullscreen(); } -function exit2(event) { +function exit2() { is(document.fullscreenElement, null, "Full-screen element should have rolled back."); is(iframe.contentDocument.fullscreenElement, null, @@ -156,7 +156,7 @@ function exit3(event) { promise = outOfDocElement.requestFullscreen(); } -function error1(event) { +function error1() { ok(!document.fullscreenElement, "Requests for full-screen from not-in-doc elements should fail."); assertPromiseRejected(promise, "in error1"); @@ -181,7 +181,7 @@ function enter4(event) { "Should not have a full-screen element again."); } -async function exit_to_arg_test_1(event) { +async function exit_to_arg_test_1() { ok(!document.fullscreenElement, "Should have left full-screen mode (third time)."); addFullscreenChangeContinuation("enter", enter_from_arg_test_1); @@ -196,14 +196,14 @@ async function exit_to_arg_test_1(event) { ok(!threw, "requestFullscreen with bogus arg (123) shouldn't throw exception"); } -function enter_from_arg_test_1(event) { +function enter_from_arg_test_1() { ok(document.fullscreenElement, "Should have entered full-screen after calling with bogus (ignored) argument (fourth time)"); addFullscreenChangeContinuation("exit", exit_to_arg_test_2); document.exitFullscreen(); } -async function exit_to_arg_test_2(event) { +async function exit_to_arg_test_2() { ok(!document.fullscreenElement, "Should have left full-screen mode (fourth time)."); addFullscreenChangeContinuation("enter", enter_from_arg_test_2); @@ -218,14 +218,14 @@ async function exit_to_arg_test_2(event) { ok(!threw, "requestFullscreen with { vrDisplay: null } shouldn't throw exception"); } -function enter_from_arg_test_2(event) { +function enter_from_arg_test_2() { ok(document.fullscreenElement, "Should have entered full-screen after calling with vrDisplay null argument (fifth time)"); addFullscreenChangeContinuation("exit", exit4); document.exitFullscreen(); } -function exit4(event) { +function exit4() { ok(!document.fullscreenElement, "Should be back in non-full-screen mode (fifth time)"); SpecialPowers.pushPrefEnv({"set":[["full-screen-api.allow-trusted-requests-only", true]]}, function() { @@ -234,7 +234,7 @@ function exit4(event) { }); } -function error2(event) { +function error2() { ok(!document.fullscreenElement, "Should still be in normal mode, because calling context isn't trusted."); button = document.createElement("button"); @@ -246,13 +246,13 @@ function error2(event) { sendMouseClick(button); } -function enter5(event) { +function enter5() { ok(document.fullscreenElement, "Moved to full-screen after mouse click"); addFullscreenChangeContinuation("exit", exit5); document.exitFullscreen(); } -function exit5(event) { +function exit5() { ok(!document.fullscreenElement, "Should have left full-screen mode (last time)."); SpecialPowers.pushPrefEnv({ @@ -264,7 +264,7 @@ function exit5(event) { }); } -function error3(event) { +function error3() { ok(!document.fullscreenElement, "Should still be in normal mode, because pref is not enabled."); diff --git a/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html b/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html index 61db80c228..48f2dea09d 100644 --- a/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html +++ b/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html @@ -2,7 +2,7 @@ - - - -

- -
-
-
- - diff --git a/dom/base/test/test_domrequesthelper.xhtml b/dom/base/test/test_domrequesthelper.xhtml deleted file mode 100644 index 6b9061b8a2..0000000000 --- a/dom/base/test/test_domrequesthelper.xhtml +++ /dev/null @@ -1,549 +0,0 @@ - - - - - - - - - - -

- -

-  
-
diff --git a/dom/base/test/test_focus_radio.html b/dom/base/test/test_focus_radio.html new file mode 100644 index 0000000000..8e97012745 --- /dev/null +++ b/dom/base/test/test_focus_radio.html @@ -0,0 +1,90 @@ + +Test for input radio focus + + + + +
+ a + + +
+
+ b + + +
+
+ c + + +
+
+ d + + + + +
+ + + diff --git a/dom/base/test/unit/test_error_codes.js b/dom/base/test/unit/test_error_codes.js index 73c893c512..5c26331d11 100644 --- a/dom/base/test/unit/test_error_codes.js +++ b/dom/base/test/unit/test_error_codes.js @@ -10,7 +10,7 @@ function asyncXHR(expectedStatus, nextTestFunc) { xhr.open("GET", "http://localhost:4444/test_error_code.xml", true); var sawError = false; - xhr.addEventListener("loadend", function doAsyncRequest_onLoad(event) { + xhr.addEventListener("loadend", function doAsyncRequest_onLoad() { Assert.ok(sawError, "Should have received an error"); nextTestFunc(); }); diff --git a/dom/base/test/useractivation/file_clipboard_common.js b/dom/base/test/useractivation/file_clipboard_common.js index fe172e52c8..3925404350 100644 --- a/dom/base/test/useractivation/file_clipboard_common.js +++ b/dom/base/test/useractivation/file_clipboard_common.js @@ -373,10 +373,10 @@ function allMechanisms(aCb, aClipOverride, aNegateAll) { case 0: // Keyboard issued cutCopyAll( - function docut(aSucc) { + function docut() { synthesizeKey("x", { accelKey: true }); }, - function docopy(aSucc) { + function docopy() { synthesizeKey("c", { accelKey: true }); }, function done() { @@ -411,14 +411,14 @@ function allMechanisms(aCb, aClipOverride, aNegateAll) { case 2: // Not triggered by user gesture cutCopyAll( - function doCut(aSucc) { + function doCut() { is( false, document.execCommand("cut"), "Can't directly execCommand not in a user callback" ); }, - function doCopy(aSucc) { + function doCopy() { is( false, document.execCommand("copy"), diff --git a/dom/base/test/useractivation/test_popup_blocker_async_callback.html b/dom/base/test/useractivation/test_popup_blocker_async_callback.html index dc53596531..4667229116 100644 --- a/dom/base/test/useractivation/test_popup_blocker_async_callback.html +++ b/dom/base/test/useractivation/test_popup_blocker_async_callback.html @@ -16,7 +16,7 @@ SimpleTest.requestFlakyTimeout("Need to test setTimeout"); function startTest(aTestAsyncFun, aAllowPopup = true) { return new Promise(aResolve => { let target = document.getElementById("target"); - target.addEventListener("click", (e) => { + target.addEventListener("click", () => { aTestAsyncFun(() => { let w = window.open("about:blank"); is(!!w, aAllowPopup, `Should ${aAllowPopup ? "allow" : "block"} popup`); diff --git a/dom/base/test/useractivation/test_useractivation_scrollbar.html b/dom/base/test/useractivation/test_useractivation_scrollbar.html index 778d6d0898..197cdc49fb 100644 --- a/dom/base/test/useractivation/test_useractivation_scrollbar.html +++ b/dom/base/test/useractivation/test_useractivation_scrollbar.html @@ -78,7 +78,7 @@ if (!opener) { SimpleTest.waitForFocus(async function() { function waitForEvent(aTarget, aEvent) { return new Promise((aResolve) => { - aTarget.addEventListener(aEvent, function listener(event) { + aTarget.addEventListener(aEvent, function listener() { aResolve(); }, { once: true }); }); -- cgit v1.2.3