diff --git a/accessible/tests/browser/bounds/browser_test_resolution.js b/accessible/tests/browser/bounds/browser_test_resolution.js index 0833ba08f3a0..2da43593324a 100644 --- a/accessible/tests/browser/bounds/browser_test_resolution.js +++ b/accessible/tests/browser/bounds/browser_test_resolution.js @@ -17,7 +17,7 @@ async function testScaledBounds(browser, accDoc, scale, id, type = "object") { getRangeExtents(acc, 0, -1, COORDTYPE_SCREEN_RELATIVE) : getBounds(acc); await ContentTask.spawn(browser, scale, _scale => { - setResolution(document, _scale); + setResolution(content.document, _scale); }); let [scaledX, scaledY, scaledWidth, scaledHeight] = type == "text" ? @@ -30,7 +30,7 @@ async function testScaledBounds(browser, accDoc, scale, id, type = "object") { isWithin(scaledY - docY, (y - docY) * scale, 2, "Wrong scaled y of " + name); await ContentTask.spawn(browser, {}, () => { - setResolution(document, 1.0); + setResolution(content.document, 1.0); }); } diff --git a/accessible/tests/browser/bounds/browser_test_zoom.js b/accessible/tests/browser/bounds/browser_test_zoom.js index 89df1ac75bc2..0bf2c558a242 100644 --- a/accessible/tests/browser/bounds/browser_test_zoom.js +++ b/accessible/tests/browser/bounds/browser_test_zoom.js @@ -47,7 +47,7 @@ async function runTests(browser, accDoc) { await testContentBounds(browser, area); await ContentTask.spawn(browser, {}, () => { - zoomDocument(document, 2.0); + zoomDocument(content.document, 2.0); }); await testContentBounds(browser, p1); diff --git a/accessible/tests/browser/bounds/browser_test_zoom_text.js b/accessible/tests/browser/bounds/browser_test_zoom_text.js index f5b121f6aecd..e8da8b639304 100644 --- a/accessible/tests/browser/bounds/browser_test_zoom_text.js +++ b/accessible/tests/browser/bounds/browser_test_zoom_text.js @@ -36,13 +36,13 @@ async function runTests(browser, accDoc) { await testEmptyInputNode("i1"); await ContentTask.spawn(browser, {}, () => { - zoomDocument(document, 2.0); + zoomDocument(content.document, 2.0); }); await testTextNode("p1"); await ContentTask.spawn(browser, {}, () => { - zoomDocument(document, 1.0); + zoomDocument(content.document, 1.0); }); } diff --git a/accessible/tests/browser/browser_shutdown_remote_own_reference.js b/accessible/tests/browser/browser_shutdown_remote_own_reference.js index 8b9cd8d29d0d..322f6ffc63a7 100644 --- a/accessible/tests/browser/browser_shutdown_remote_own_reference.js +++ b/accessible/tests/browser/browser_shutdown_remote_own_reference.js @@ -40,7 +40,7 @@ add_task(async function() { contentConsumersChanged = ContentTask.spawn(browser, {}, a11yConsumersChangedPromise); // Add a new reference to the a11y service inside the content process. - loadFrameScripts(browser, `let accService = Components.classes[ + loadFrameScripts(browser, `var accService = Components.classes[ '@mozilla.org/accessibilityService;1'].getService( Components.interfaces.nsIAccessibilityService);`); await contentConsumersChanged.then(data => Assert.deepEqual(data, { diff --git a/accessible/tests/browser/e10s/browser_caching_name.js b/accessible/tests/browser/e10s/browser_caching_name.js index 612a2d55e610..f41022d19151 100644 --- a/accessible/tests/browser/e10s/browser_caching_name.js +++ b/accessible/tests/browser/e10s/browser_caching_name.js @@ -334,7 +334,7 @@ async function testAttrRule(browser, target, rule, expected) { let [event] = await contentSpawnMutation(browser, { expected: [recreated ? [EVENT_REORDER, parent] : [EVENT_TEXT_INSERTED, id]] }, ([contentId, contentAttr]) => - document.getElementById(contentId).removeAttribute(contentAttr), [id, attr]); + content.document.getElementById(contentId).removeAttribute(contentAttr), [id, attr]); // Update accessible just in case it is now defunct. target.acc = findAccessibleChildByID(event.accessible, id); @@ -362,7 +362,7 @@ async function testElmRule(browser, target, rule, expected) { testName(acc, expected); let [event] = await contentSpawnMutation(browser, { expected: [[EVENT_REORDER, isSibling ? parent : id]] - }, contentElm => document.querySelector(`${contentElm}`).remove(), elm); + }, contentElm => content.document.querySelector(`${contentElm}`).remove(), elm); // Update accessible just in case it is now defunct. target.acc = findAccessibleChildByID(event.accessible, id); @@ -387,7 +387,7 @@ async function testSubtreeRule(browser, target, rule, expected) { let [event] = await contentSpawnMutation(browser, { expected: [[EVENT_REORDER, id]] }, contentId => { - let elm = document.getElementById(contentId); + let elm = content.document.getElementById(contentId); while (elm.firstChild) { elm.firstChild.remove(); } diff --git a/accessible/tests/browser/e10s/browser_events_vcchange.js b/accessible/tests/browser/e10s/browser_events_vcchange.js index b8d49e7eb17b..d6f530d5ba48 100644 --- a/accessible/tests/browser/e10s/browser_events_vcchange.js +++ b/accessible/tests/browser/e10s/browser_events_vcchange.js @@ -10,7 +10,7 @@ addAccessibleTask(` async function(browser, accDoc) { let onVCChanged = waitForEvent(EVENT_VIRTUALCURSOR_CHANGED, accDoc); await ContentTask.spawn(browser, null, () => { - let vc = getAccessible(document, nsIAccessibleDocument).virtualCursor; + let vc = getAccessible(content.document, Ci.nsIAccessibleDocument).virtualCursor; vc.position = getAccessible("p1"); }); @@ -23,8 +23,8 @@ addAccessibleTask(` onVCChanged = waitForEvent(EVENT_VIRTUALCURSOR_CHANGED, accDoc); await ContentTask.spawn(browser, null, () => { - let vc = getAccessible(document, nsIAccessibleDocument).virtualCursor; - vc.moveNextByText(nsIAccessiblePivot.CHAR_BOUNDARY); + let vc = getAccessible(content.document, Ci.nsIAccessibleDocument).virtualCursor; + vc.moveNextByText(Ci.nsIAccessiblePivot.CHAR_BOUNDARY); }); vccEvent = (await onVCChanged).QueryInterface( nsIAccessibleVirtualCursorChangeEvent); @@ -35,7 +35,7 @@ addAccessibleTask(` onVCChanged = waitForEvent(EVENT_VIRTUALCURSOR_CHANGED, accDoc); await ContentTask.spawn(browser, null, () => { - let vc = getAccessible(document, nsIAccessibleDocument).virtualCursor; + let vc = getAccessible(content.document, Ci.nsIAccessibleDocument).virtualCursor; vc.position = getAccessible("input1"); }); vccEvent = (await onVCChanged).QueryInterface( diff --git a/accessible/tests/browser/scroll/browser_test_zoom_text.js b/accessible/tests/browser/scroll/browser_test_zoom_text.js index 248f42b10196..53e847461f53 100644 --- a/accessible/tests/browser/scroll/browser_test_zoom_text.js +++ b/accessible/tests/browser/scroll/browser_test_zoom_text.js @@ -21,7 +21,7 @@ async function runTests(browser, accDoc) { testTextPos(paragraph, offset, [x, docY], COORDTYPE_SCREEN_RELATIVE); await ContentTask.spawn(browser, {}, () => { - zoomDocument(document, 2.0); + zoomDocument(content.document, 2.0); }); paragraph = findAccessibleChildByID(accDoc, "paragraph2", [nsIAccessibleText]); diff --git a/accessible/tests/browser/tree/browser_aria_owns.js b/accessible/tests/browser/tree/browser_aria_owns.js index 79b508b0f857..f8aa66bdd76b 100644 --- a/accessible/tests/browser/tree/browser_aria_owns.js +++ b/accessible/tests/browser/tree/browser_aria_owns.js @@ -16,7 +16,7 @@ addAccessibleTask(``, await contentSpawnMutation(browser, NO_MOVE, function() { // aria-own ordinal child in place, should be a no-op. - document.getElementById("container").setAttribute("aria-owns", "a"); + content.document.getElementById("container").setAttribute("aria-owns", "a"); }); testChildrenIds(containerAcc, ["a"]); @@ -32,10 +32,10 @@ addAccessibleTask(``, testChildrenIds(containerAcc, ["a"]); await contentSpawnMutation(browser, MOVE, function() { - let container = document.getElementById("container"); + let container = content.document.getElementById("container"); container.setAttribute("aria-owns", "a"); - let aa = document.createElement("li"); + let aa = content.document.createElement("li"); aa.id = "aa"; container.appendChild(aa); }); @@ -43,7 +43,7 @@ addAccessibleTask(``, testChildrenIds(containerAcc, ["aa", "a"]); await contentSpawnMutation(browser, MOVE, function() { - document.getElementById("container").removeAttribute("aria-owns"); + content.document.getElementById("container").removeAttribute("aria-owns"); }); testChildrenIds(containerAcc, ["a", "aa"]); @@ -59,7 +59,7 @@ addAccessibleTask(``, await contentSpawnMutation(browser, NO_MOVE, function() { // remove aria-owned child that is already ordinal, should be no-op. - document.getElementById("container").removeAttribute("aria-owns"); + content.document.getElementById("container").removeAttribute("aria-owns"); }); testChildrenIds(containerAcc, ["a"]); @@ -79,7 +79,7 @@ addAccessibleTask(` testChildrenIds(containerAcc, []); await contentSpawnMutation(browser, NO_MOVE, function() { - document.getElementById("container").setAttribute("aria-owns", "a"); + content.document.getElementById("container").setAttribute("aria-owns", "a"); }); testChildrenIds(containerAcc, []); @@ -151,7 +151,7 @@ addAccessibleTask(` testChildrenIds(containerAcc.firstChild, ["a", "b", "c"]); await contentSpawnMutation(browser, NO_MOVE, function() { - document.getElementById("container").setAttribute("aria-owns", "a c b"); + content.document.getElementById("container").setAttribute("aria-owns", "a c b"); }); testChildrenIds(containerAcc.firstChild, ["a", "b", "c"]); @@ -183,7 +183,7 @@ addAccessibleTask(` await contentSpawnMutation(browser, waitfor, function() { // Put same id twice in aria-owns - document.getElementById("two").setAttribute("aria-owns", "a a"); + content.document.getElementById("two").setAttribute("aria-owns", "a a"); }); testChildrenIds(one, ["b", "c"]); @@ -192,7 +192,7 @@ addAccessibleTask(` await contentSpawnMutation(browser, waitfor, function() { // If the previous double-id aria-owns worked correctly, we should // be in a good state and all is fine.. - document.getElementById("two").setAttribute("aria-owns", "a b"); + content.document.getElementById("two").setAttribute("aria-owns", "a b"); }); testChildrenIds(one, ["c"]); @@ -209,10 +209,10 @@ addAccessibleTask(`
`, }; await contentSpawnMutation(browser, waitFor, function() { - document.documentElement.style.display = "none"; - document.documentElement.getBoundingClientRect(); - document.body.setAttribute("aria-owns", "b a"); - document.documentElement.remove(); + content.document.documentElement.style.display = "none"; + content.document.documentElement.getBoundingClientRect(); + content.document.body.setAttribute("aria-owns", "b a"); + content.document.documentElement.remove(); }); testChildrenIds(accDoc, []); @@ -228,24 +228,24 @@ addAccessibleTask(`
Hello
testChildrenIds(containerAcc, ["a"]); await contentSpawnMutation(browser, MOVE, function() { - document.getElementById("container").setAttribute("aria-owns", "c"); + content.document.getElementById("container").setAttribute("aria-owns", "c"); }); testChildrenIds(containerAcc, ["a", "c"]); await contentSpawnMutation(browser, MOVE, function() { - let span = document.createElement("span"); - document.getElementById("container").appendChild(span); + let span = content.document.createElement("span"); + content.document.getElementById("container").appendChild(span); - let b = document.createElement("div"); + let b = content.document.createElement("div"); b.id = "b"; - document.getElementById("container").appendChild(b); + content.document.getElementById("container").appendChild(b); }); testChildrenIds(containerAcc, ["a", "b", "c"]); await contentSpawnMutation(browser, MOVE, function() { - document.getElementById("container").setAttribute("aria-owns", "c d"); + content.document.getElementById("container").setAttribute("aria-owns", "c d"); }); testChildrenIds(containerAcc, ["a", "b", "c", "d"]);