summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest
diff options
context:
space:
mode:
Diffstat (limited to 'accessible/tests/mochitest')
-rw-r--r--accessible/tests/mochitest/actions/test_media.html2
-rw-r--r--accessible/tests/mochitest/actions/test_tree.xhtml6
-rw-r--r--accessible/tests/mochitest/actions/test_treegrid.xhtml8
-rw-r--r--accessible/tests/mochitest/autocomplete.js8
-rw-r--r--accessible/tests/mochitest/common.js2
-rw-r--r--accessible/tests/mochitest/events.js7
-rw-r--r--accessible/tests/mochitest/events/a11y.toml2
-rw-r--r--accessible/tests/mochitest/events/test_contextmenu.html2
-rw-r--r--accessible/tests/mochitest/events/test_focus_aria_activedescendant.html327
-rw-r--r--accessible/tests/mochitest/events/test_focus_doc.html12
-rw-r--r--accessible/tests/mochitest/events/test_label.xhtml2
-rw-r--r--accessible/tests/mochitest/events/test_statechange.html2
-rw-r--r--accessible/tests/mochitest/name/markup.js2
-rw-r--r--accessible/tests/mochitest/name/test_tree.xhtml4
-rw-r--r--accessible/tests/mochitest/promisified-events.js4
-rw-r--r--accessible/tests/mochitest/relations/test_tabbrowser.xhtml2
-rw-r--r--accessible/tests/mochitest/role.js1
-rw-r--r--accessible/tests/mochitest/role/test_aria.html24
-rw-r--r--accessible/tests/mochitest/role/test_general.html2
-rw-r--r--accessible/tests/mochitest/states/test_aria_widgetitems.html4
-rw-r--r--accessible/tests/mochitest/test_bug420863.html4
-rw-r--r--accessible/tests/mochitest/text.js24
-rw-r--r--accessible/tests/mochitest/tree/test_aria_display_contents.html2
-rw-r--r--accessible/tests/mochitest/tree/test_aria_grid.html12
-rw-r--r--accessible/tests/mochitest/tree/test_aria_owns.html4
-rw-r--r--accessible/tests/mochitest/tree/test_tabbrowser.xhtml2
-rw-r--r--accessible/tests/mochitest/tree/test_tree.xhtml2
-rw-r--r--accessible/tests/mochitest/treeupdate/test_contextmenu.xhtml4
-rw-r--r--accessible/tests/mochitest/treeupdate/test_delayed_removal.html2
-rw-r--r--accessible/tests/mochitest/treeupdate/test_shadow_slots.html10
-rw-r--r--accessible/tests/mochitest/treeupdate/test_shutdown.xhtml2
-rw-r--r--accessible/tests/mochitest/treeview.js16
32 files changed, 105 insertions, 402 deletions
diff --git a/accessible/tests/mochitest/actions/test_media.html b/accessible/tests/mochitest/actions/test_media.html
index 5327901e56..99393b984b 100644
--- a/accessible/tests/mochitest/actions/test_media.html
+++ b/accessible/tests/mochitest/actions/test_media.html
@@ -32,7 +32,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
this.getID = function focusChecker_getID() {
return "focus handling";
};
- this.check = function focusChecker_check(aEvent) {
+ this.check = function focusChecker_check() {
testStates(this.target, STATE_FOCUSED);
};
}
diff --git a/accessible/tests/mochitest/actions/test_tree.xhtml b/accessible/tests/mochitest/actions/test_tree.xhtml
index 17710cbdce..3279ac74ee 100644
--- a/accessible/tests/mochitest/actions/test_tree.xhtml
+++ b/accessible/tests/mochitest/actions/test_tree.xhtml
@@ -31,7 +31,7 @@
{
this.__proto__ = new focusChecker(aAcc);
- this.check = function focusChecker_check(aEvent)
+ this.check = function focusChecker_check()
{
var states = aStates ? aStates : 0;
testStates(this.target, STATE_FOCUSED | STATE_SELECTED | states);
@@ -71,7 +71,7 @@
actionIndex: 1,
events: CLICK_EVENTS,
targetID: treeBodyNode,
- checkOnClickEvent: function check(aEvent)
+ checkOnClickEvent: function check()
{
testStates(this.ID, STATE_EXPANDED);
}
@@ -82,7 +82,7 @@
actionIndex: 1,
events: CLICK_EVENTS,
targetID: treeBodyNode,
- checkOnClickEvent: function check(aEvent)
+ checkOnClickEvent: function check()
{
testStates(this.ID, STATE_COLLAPSED);
}
diff --git a/accessible/tests/mochitest/actions/test_treegrid.xhtml b/accessible/tests/mochitest/actions/test_treegrid.xhtml
index 1c6e1bb8aa..985018418b 100644
--- a/accessible/tests/mochitest/actions/test_treegrid.xhtml
+++ b/accessible/tests/mochitest/actions/test_treegrid.xhtml
@@ -37,7 +37,7 @@
{
return "focus handling";
}
- this.check = function focusChecker_check(aEvent)
+ this.check = function focusChecker_check()
{
var states = aStates ? aStates : 0;
testStates(this.target, STATE_FOCUSED | STATE_SELECTED | states);
@@ -52,7 +52,7 @@
{
return "state change handling";
}
- this.check = function stateChangeChecker_check(aEvent)
+ this.check = function stateChangeChecker_check()
{
if (aIsEnabled)
testStates(this.target, STATE_CHECKED);
@@ -95,7 +95,7 @@
actionIndex: 1,
events: CLICK_EVENTS,
targetID: treeBodyNode,
- check: function check(aEvent)
+ check: function check()
{
testStates(this.ID, STATE_EXPANDED);
}
@@ -106,7 +106,7 @@
actionIndex: 1,
events: CLICK_EVENTS,
targetID: treeBodyNode,
- check: function check(aEvent)
+ check: function check()
{
testStates(this.ID, STATE_COLLAPSED);
}
diff --git a/accessible/tests/mochitest/autocomplete.js b/accessible/tests/mochitest/autocomplete.js
index bd5458c51d..baf9529473 100644
--- a/accessible/tests/mochitest/autocomplete.js
+++ b/accessible/tests/mochitest/autocomplete.js
@@ -171,11 +171,11 @@ AutoCompleteResult.prototype = {
return this.comments[aIndex];
},
- getStyleAt(aIndex) {
+ getStyleAt() {
return null;
},
- getImageAt(aIndex) {
+ getImageAt() {
return "";
},
@@ -183,11 +183,11 @@ AutoCompleteResult.prototype = {
return this.getValueAt(aIndex);
},
- isRemovableAt(aRowIndex) {
+ isRemovableAt() {
return true;
},
- removeValueAt(aRowIndex) {},
+ removeValueAt() {},
// nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),
diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js
index f0ee117452..7f40c33bff 100644
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -976,7 +976,7 @@ function prettyName(aIdentifier) {
* @param aString the string to shorten.
* @returns the shortened string.
*/
-function shortenString(aString, aMaxLength) {
+function shortenString(aString) {
if (aString.length <= MAX_TRIM_LENGTH) {
return aString;
}
diff --git a/accessible/tests/mochitest/events.js b/accessible/tests/mochitest/events.js
index a6c216e01d..d4e3221f95 100644
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -928,10 +928,7 @@ function eventQueue(aEventType) {
return invoker.getID();
};
- this.setInvokerStatus = function eventQueue_setInvokerStatus(
- aStatus,
- aLogMsg
- ) {
+ this.setInvokerStatus = function eventQueue_setInvokerStatus(aStatus) {
this.mNextInvokerStatus = aStatus;
// Uncomment it to debug invoker processing logic.
@@ -2348,7 +2345,7 @@ var gA11yEventApplicantsCount = 0;
var gA11yEventObserver = {
// eslint-disable-next-line complexity
- observe: function observe(aSubject, aTopic, aData) {
+ observe: function observe(aSubject, aTopic) {
if (aTopic != "accessible-event") {
return;
}
diff --git a/accessible/tests/mochitest/events/a11y.toml b/accessible/tests/mochitest/events/a11y.toml
index 501b59f7b7..81f9fab3d9 100644
--- a/accessible/tests/mochitest/events/a11y.toml
+++ b/accessible/tests/mochitest/events/a11y.toml
@@ -40,8 +40,6 @@ support-files = [
["test_flush.html"]
-["test_focus_aria_activedescendant.html"]
-
["test_focus_autocomplete.html"]
["test_focus_autocomplete.xhtml"]
diff --git a/accessible/tests/mochitest/events/test_contextmenu.html b/accessible/tests/mochitest/events/test_contextmenu.html
index 6200efc00d..3047b4d46c 100644
--- a/accessible/tests/mochitest/events/test_contextmenu.html
+++ b/accessible/tests/mochitest/events/test_contextmenu.html
@@ -52,7 +52,7 @@
};
}
- function closeContextMenu(aID) {
+ function closeContextMenu() {
this.eventSeq = [
new invokerChecker(EVENT_MENUPOPUP_END,
getAccessible(getContextMenuNode())),
diff --git a/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html b/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html
deleted file mode 100644
index 661284619a..0000000000
--- a/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html
+++ /dev/null
@@ -1,327 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=429547
--->
-<head>
- <title>aria-activedescendant focus tests</title>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <script type="application/javascript"
- src="../common.js"></script>
- <script type="application/javascript"
- src="../role.js"></script>
- <script type="application/javascript"
- src="../states.js"></script>
- <script type="application/javascript"
- src="../events.js"></script>
-
- <script type="application/javascript">
- let PromEvents = {};
- Services.scriptloader.loadSubScript(
- "chrome://mochitests/content/a11y/accessible/tests/mochitest/promisified-events.js",
- PromEvents);
- // gA11yEventDumpToConsole = true; // debugging
-
- function changeARIAActiveDescendant(aContainer, aItem, aPrevItemId) {
- let itemID = Node.isInstance(aItem) ? aItem.id : aItem;
- this.eventSeq = [new focusChecker(aItem)];
-
- if (aPrevItemId) {
- this.eventSeq.push(
- new stateChangeChecker(EXT_STATE_ACTIVE, true, false, aPrevItemId)
- );
- }
-
- this.eventSeq.push(
- new stateChangeChecker(EXT_STATE_ACTIVE, true, true, aItem)
- );
-
- this.invoke = function changeARIAActiveDescendant_invoke() {
- getNode(aContainer).setAttribute("aria-activedescendant", itemID);
- };
-
- this.getID = function changeARIAActiveDescendant_getID() {
- return "change aria-activedescendant on " + itemID;
- };
- }
-
- function clearARIAActiveDescendant(aID, aPrevItemId) {
- this.eventSeq = [
- new focusChecker(aID),
- ];
-
- if (aPrevItemId) {
- this.eventSeq.push(
- new stateChangeChecker(EXT_STATE_ACTIVE, true, false, aPrevItemId)
- );
- }
-
- this.invoke = function clearARIAActiveDescendant_invoke() {
- getNode(aID).removeAttribute("aria-activedescendant");
- };
-
- this.getID = function clearARIAActiveDescendant_getID() {
- return "clear aria-activedescendant on container " + aID;
- };
- }
-
- /**
- * Change aria-activedescendant to an invalid (non-existent) id.
- * Ensure that focus is fired on the element itself.
- */
- function changeARIAActiveDescendantInvalid(aID, aInvalidID, aPrevItemId) {
- if (!aInvalidID) {
- aInvalidID = "invalid";
- }
-
- this.eventSeq = [
- new focusChecker(aID),
- ];
-
- if (aPrevItemId) {
- this.eventSeq.push(
- new stateChangeChecker(EXT_STATE_ACTIVE, true, false, aPrevItemId)
- );
- }
-
- this.invoke = function changeARIAActiveDescendant_invoke() {
- getNode(aID).setAttribute("aria-activedescendant", aInvalidID);
- };
-
- this.getID = function changeARIAActiveDescendant_getID() {
- return "change aria-activedescendant to invalid id";
- };
- }
-
- function insertItemNFocus(aID, aNewItemID, aPrevItemId) {
- this.eventSeq = [
- new invokerChecker(EVENT_SHOW, aNewItemID),
- new focusChecker(aNewItemID),
- ];
-
- if (aPrevItemId) {
- this.eventSeq.push(
- new stateChangeChecker(EXT_STATE_ACTIVE, true, false, aPrevItemId)
- );
- }
-
- this.eventSeq.push(
- new stateChangeChecker(EXT_STATE_ACTIVE, true, true, aNewItemID)
- );
-
- this.invoke = function insertItemNFocus_invoke() {
- var container = getNode(aID);
-
- var itemNode = document.createElement("div");
- itemNode.setAttribute("id", aNewItemID);
- itemNode.setAttribute("role", "listitem");
- itemNode.textContent = aNewItemID;
- container.appendChild(itemNode);
-
- container.setAttribute("aria-activedescendant", aNewItemID);
- };
-
- this.getID = function insertItemNFocus_getID() {
- return "insert new node and focus it with ID: " + aNewItemID;
- };
- }
-
- /**
- * Change the id of an element to another id which is the target of
- * aria-activedescendant.
- * If another element already has the desired id, remove it from that
- * element first.
- * Ensure that focus is fired on the target element which was given the
- * desired id.
- * @param aFromID The existing id of the target element.
- * @param aToID The desired id to be given to the target element.
- */
- function moveARIAActiveDescendantID(aFromID, aToID) {
- this.eventSeq = [
- new focusChecker(aToID),
- new stateChangeChecker(EXT_STATE_ACTIVE, true, true, aToID),
- ];
-
- this.invoke = function moveARIAActiveDescendantID_invoke() {
- let orig = document.getElementById(aToID);
- if (orig) {
- orig.id = "";
- }
- document.getElementById(aFromID).id = aToID;
- };
-
- this.getID = function moveARIAActiveDescendantID_getID() {
- return "move aria-activedescendant id " + aToID;
- };
- }
-
- var gQueue = null;
- async function doTest() {
- gQueue = new eventQueue();
- // Later tests use await.
- let queueFinished = new Promise(resolve => {
- gQueue.onFinish = function() {
- resolve();
- return DO_NOT_FINISH_TEST;
- };
- });
-
- gQueue.push(new synthFocus("listbox", new focusChecker("item1")));
- gQueue.push(new changeARIAActiveDescendant("listbox", "item2", "item1"));
- gQueue.push(new changeARIAActiveDescendant("listbox", "item3", "item2"));
-
- gQueue.push(new synthFocus("combobox_entry", new focusChecker("combobox_entry")));
- gQueue.push(new changeARIAActiveDescendant("combobox", "combobox_option2"));
-
- gQueue.push(new synthFocus("listbox", new focusChecker("item3")));
- gQueue.push(new insertItemNFocus("listbox", "item4", "item3"));
-
- gQueue.push(new clearARIAActiveDescendant("listbox", "item4"));
- gQueue.push(new changeARIAActiveDescendant("listbox", "item1"));
- gQueue.push(new changeARIAActiveDescendantInvalid("listbox", "invalid", "item1"));
-
- gQueue.push(new changeARIAActiveDescendant("listbox", "roaming"));
- gQueue.push(new moveARIAActiveDescendantID("roaming2", "roaming"));
- gQueue.push(new changeARIAActiveDescendantInvalid("listbox", "roaming3", "roaming"));
- gQueue.push(new moveARIAActiveDescendantID("roaming", "roaming3"));
-
- gQueue.push(new synthFocus("activedesc_nondesc_input",
- new focusChecker("activedesc_nondesc_option")));
-
- let shadowRoot = document.getElementById("shadow").shadowRoot;
- let shadowListbox = shadowRoot.getElementById("shadowListbox");
- let shadowItem1 = shadowRoot.getElementById("shadowItem1");
- let shadowItem2 = shadowRoot.getElementById("shadowItem2");
- gQueue.push(new synthFocus(shadowListbox, new focusChecker(shadowItem1)));
- gQueue.push(new changeARIAActiveDescendant(shadowListbox, shadowItem2));
-
- gQueue.invoke();
- await queueFinished;
- // Tests beyond this point use await rather than eventQueue.
-
- info("Testing simultaneous insertion, relocation and aria-activedescendant");
- let comboboxWithHiddenList = getNode("comboboxWithHiddenList");
- let evtProm = PromEvents.waitForEvent(EVENT_FOCUS, comboboxWithHiddenList);
- comboboxWithHiddenList.focus();
- await evtProm;
- testStates(comboboxWithHiddenList, STATE_FOCUSED);
- // hiddenList is owned, so unhiding causes insertion and relocation.
- getNode("hiddenList").hidden = false;
- evtProm = Promise.all([
- PromEvents.waitForEvent(EVENT_FOCUS, "hiddenListOption"),
- PromEvents.waitForStateChange("hiddenListOption", EXT_STATE_ACTIVE, true, true),
- ]);
- comboboxWithHiddenList.setAttribute("aria-activedescendant", "hiddenListOption");
- await evtProm;
- testStates("hiddenListOption", STATE_FOCUSED);
-
- info("Testing active state changes when not focused");
- testStates("listbox", 0, 0, STATE_FOCUSED);
- evtProm = Promise.all([
- PromEvents.waitForStateChange("roaming3", EXT_STATE_ACTIVE, false, true),
- PromEvents.waitForStateChange("item1", EXT_STATE_ACTIVE, true, true),
- ]);
- getNode("listbox").setAttribute("aria-activedescendant", "item1");
- await evtProm;
-
- info("Testing that focus is always fired first");
- const listbox = getNode("listbox");
- evtProm = PromEvents.waitForEvent(EVENT_FOCUS, "item1");
- listbox.focus();
- await evtProm;
- const item1 = getNode("item1");
- evtProm = PromEvents.waitForOrderedEvents([
- [EVENT_FOCUS, "item2"],
- [EVENT_NAME_CHANGE, item1],
- ], "Focus then name change");
- item1.setAttribute("aria-label", "changed");
- listbox.setAttribute("aria-activedescendant", "item2");
- await evtProm;
-
- info("Setting aria-activedescendant to invalid id on non-focused node");
- const combobox_entry = getNode("combobox_entry");
- evtProm = PromEvents.waitForEvents({
- expected: [[EVENT_FOCUS, combobox_entry]],
- unexpected: [[EVENT_FOCUS, listbox]],
- });
- combobox_entry.focus();
- listbox.setAttribute("aria-activedescendant", "invalid");
- await evtProm;
-
- SimpleTest.finish();
- }
-
- SimpleTest.waitForExplicitFinish();
- addA11yLoadEvent(doTest);
- </script>
-</head>
-<body>
-
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=429547"
- title="Support aria-activedescendant usage in nsIAccesible::TakeFocus()">
- Mozilla Bug 429547
- </a>
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=761102"
- title="Focus may be missed when ARIA active-descendant is changed on active composite widget">
- Mozilla Bug 761102
- </a>
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test">
- </pre>
-
- <div role="listbox" aria-activedescendant="item1" id="listbox" tabindex="1"
- aria-owns="item3">
- <div role="listitem" id="item1">item1</div>
- <div role="listitem" id="item2">item2</div>
- <div role="listitem" id="roaming">roaming</div>
- <div role="listitem" id="roaming2">roaming2</div>
- </div>
- <div role="listitem" id="item3">item3</div>
-
- <div role="combobox" id="combobox">
- <input id="combobox_entry">
- <ul>
- <li role="option" id="combobox_option1">option1</li>
- <li role="option" id="combobox_option2">option2</li>
- </ul>
- </div>
-
- <!-- aria-activedescendant targeting a non-descendant -->
- <input id="activedesc_nondesc_input" aria-activedescendant="activedesc_nondesc_option">
- <div role="listbox">
- <div role="option" id="activedesc_nondesc_option">option</div>
- </div>
-
- <div id="shadow"></div>
- <script>
- let host = document.getElementById("shadow");
- let shadow = host.attachShadow({mode: "open"});
- let listbox = document.createElement("div");
- listbox.id = "shadowListbox";
- listbox.setAttribute("role", "listbox");
- listbox.setAttribute("tabindex", "0");
- shadow.appendChild(listbox);
- let item = document.createElement("div");
- item.id = "shadowItem1";
- item.setAttribute("role", "option");
- listbox.appendChild(item);
- listbox.setAttribute("aria-activedescendant", "shadowItem1");
- item = document.createElement("div");
- item.id = "shadowItem2";
- item.setAttribute("role", "option");
- listbox.appendChild(item);
- </script>
-
- <div id="comboboxWithHiddenList" tabindex="0" role="combobox" aria-owns="hiddenList">
- </div>
- <div id="hiddenList" hidden role="listbox">
- <div id="hiddenListOption" role="option"></div>
- </div>
-</body>
-</html>
diff --git a/accessible/tests/mochitest/events/test_focus_doc.html b/accessible/tests/mochitest/events/test_focus_doc.html
index a35fc06ed0..bfb43895bd 100644
--- a/accessible/tests/mochitest/events/test_focus_doc.html
+++ b/accessible/tests/mochitest/events/test_focus_doc.html
@@ -47,7 +47,17 @@
// focus on not editable document
gQueue.push(new synthFocus(frame2InputAcc));
- gQueue.push(new synthShiftTab(frame2DocAcc, new focusChecker(frame2DocAcc)));
+ var canTabMoveFocusToRootElement =
+ !SpecialPowers.getBoolPref("dom.disable_tab_focus_to_root_element");
+ if (canTabMoveFocusToRootElement) {
+ // Moves the focus to the root element
+ gQueue.push(new synthShiftTab(frame2DocAcc, new focusChecker(frame2DocAcc)));
+ } else {
+ // Skips the root element, so the focus got moved to buttonAcc2.
+ var buttonAcc2 = getAccessible("b2");
+ gQueue.push(new synthShiftTab(buttonAcc2, new focusChecker(buttonAcc2)));
+ }
+
gQueue.invoke(); // Will call SimpleTest.finish();
}
diff --git a/accessible/tests/mochitest/events/test_label.xhtml b/accessible/tests/mochitest/events/test_label.xhtml
index 5780629dc6..2f207eba65 100644
--- a/accessible/tests/mochitest/events/test_label.xhtml
+++ b/accessible/tests/mochitest/events/test_label.xhtml
@@ -93,7 +93,7 @@
/**
* Change @crop attribute.
*/
- function setCrop(aID, aCropValue, aRemovedText, aInsertedText)
+ function setCrop(aID, aCropValue)
{
this.labelNode = getNode(aID);
this.width = this.labelNode.getBoundingClientRect().width;
diff --git a/accessible/tests/mochitest/events/test_statechange.html b/accessible/tests/mochitest/events/test_statechange.html
index 0642851408..0ecf54b0d1 100644
--- a/accessible/tests/mochitest/events/test_statechange.html
+++ b/accessible/tests/mochitest/events/test_statechange.html
@@ -28,7 +28,7 @@
await p;
}
- async function makeEditableDoc(aDocNode, aIsEnabled) {
+ async function makeEditableDoc(aDocNode) {
let p = waitForStateChange(aDocNode, EXT_STATE_EDITABLE, true, true);
aDocNode.designMode = "on";
await p;
diff --git a/accessible/tests/mochitest/name/markup.js b/accessible/tests/mochitest/name/markup.js
index a267bd4f7b..4ad478482b 100644
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -335,7 +335,7 @@ function testNameForElmRule(aElm, aRule) {
parentNode.removeChild(labelElm);
}
-function testNameForSubtreeRule(aElm, aRule) {
+function testNameForSubtreeRule(aElm) {
var msg = "From subtree test (" + gTestIterator.testID + ").";
testName(aElm, aElm.getAttribute("textequiv"), msg);
testAbsentAttrs(aElm, { "explicit-name": "true" });
diff --git a/accessible/tests/mochitest/name/test_tree.xhtml b/accessible/tests/mochitest/name/test_tree.xhtml
index 3564481d00..282e4ea118 100644
--- a/accessible/tests/mochitest/name/test_tree.xhtml
+++ b/accessible/tests/mochitest/name/test_tree.xhtml
@@ -31,7 +31,7 @@
this.DOMNode.view = new nsTreeTreeView();
}
- this.check = function treeTester_check(aEvent)
+ this.check = function treeTester_check()
{
var tree = {
role: ROLE_OUTLINE,
@@ -89,7 +89,7 @@
this.DOMNode.view = new nsTableTreeView(2);
}
- this.check = function tableTester_check(aEvent)
+ this.check = function tableTester_check()
{
var tree = {
role: aIsTable ? ROLE_TABLE : ROLE_TREE_TABLE,
diff --git a/accessible/tests/mochitest/promisified-events.js b/accessible/tests/mochitest/promisified-events.js
index c58466dcf1..223be16147 100644
--- a/accessible/tests/mochitest/promisified-events.js
+++ b/accessible/tests/mochitest/promisified-events.js
@@ -141,7 +141,7 @@ function matchEvent(event, matchCriteria) {
function waitForEvent(eventType, matchCriteria, message) {
return new Promise(resolve => {
let eventObserver = {
- observe(subject, topic, data) {
+ observe(subject, topic) {
if (topic !== "accessible-event") {
return;
}
@@ -185,7 +185,7 @@ class UnexpectedEvents {
}
}
- observe(subject, topic, data) {
+ observe(subject, topic) {
if (topic !== "accessible-event") {
return;
}
diff --git a/accessible/tests/mochitest/relations/test_tabbrowser.xhtml b/accessible/tests/mochitest/relations/test_tabbrowser.xhtml
index 3356bc6140..4820419c1e 100644
--- a/accessible/tests/mochitest/relations/test_tabbrowser.xhtml
+++ b/accessible/tests/mochitest/relations/test_tabbrowser.xhtml
@@ -43,7 +43,7 @@
browserDocument().documentElement.getBoundingClientRect();
}
- this.finalCheck = function testTabRelations_finalCheck(aEvent)
+ this.finalCheck = function testTabRelations_finalCheck()
{
////////////////////////////////////////////////////////////////////////
// 'labelled by'/'label for' relations for xul:tab and xul:tabpanel
diff --git a/accessible/tests/mochitest/role.js b/accessible/tests/mochitest/role.js
index 07b820c2ac..66cb6de4d2 100644
--- a/accessible/tests/mochitest/role.js
+++ b/accessible/tests/mochitest/role.js
@@ -40,6 +40,7 @@ const ROLE_FLAT_EQUATION = nsIAccessibleRole.ROLE_FLAT_EQUATION;
const ROLE_FORM = nsIAccessibleRole.ROLE_FORM;
const ROLE_FORM_LANDMARK = nsIAccessibleRole.ROLE_FORM_LANDMARK;
const ROLE_GRAPHIC = nsIAccessibleRole.ROLE_GRAPHIC;
+const ROLE_GRID = nsIAccessibleRole.ROLE_GRID;
const ROLE_GRID_CELL = nsIAccessibleRole.ROLE_GRID_CELL;
const ROLE_GROUPING = nsIAccessibleRole.ROLE_GROUPING;
const ROLE_HEADING = nsIAccessibleRole.ROLE_HEADING;
diff --git a/accessible/tests/mochitest/role/test_aria.html b/accessible/tests/mochitest/role/test_aria.html
index bd7ffd27fb..0e7873c485 100644
--- a/accessible/tests/mochitest/role/test_aria.html
+++ b/accessible/tests/mochitest/role/test_aria.html
@@ -56,16 +56,16 @@
testRole("aria_directory_mixed", ROLE_LIST);
testRole("aria_document", ROLE_NON_NATIVE_DOCUMENT);
testRole("aria_document_mixed", ROLE_NON_NATIVE_DOCUMENT);
- testRole("aria_form", ROLE_FORM);
- testRole("aria_form_mixed", ROLE_FORM);
+ testRole("aria_form", ROLE_TEXT);
+ testRole("aria_form_mixed", ROLE_TEXT);
testRole("aria_form_with_label", ROLE_FORM);
testRole("aria_form_with_label_mixed", ROLE_FORM);
testRole("aria_feed", ROLE_GROUPING);
testRole("aria_feed_mixed", ROLE_GROUPING);
testRole("aria_figure", ROLE_FIGURE);
testRole("aria_figure_mixed", ROLE_FIGURE);
- testRole("aria_grid", ROLE_TABLE);
- testRole("aria_grid_mixed", ROLE_TABLE);
+ testRole("aria_grid", ROLE_GRID);
+ testRole("aria_grid_mixed", ROLE_GRID);
testRole("aria_gridcell", ROLE_GRID_CELL);
testRole("aria_gridcell_mixed", ROLE_GRID_CELL);
testRole("aria_group", ROLE_GROUPING);
@@ -184,8 +184,10 @@
testRole("articlemain", ROLE_LANDMARK);
testRole("articlemain_mixed", ROLE_LANDMARK);
- testRole("articleform", ROLE_FORM);
- testRole("articleform_mixed", ROLE_FORM);
+ testRole("articleform", ROLE_ARTICLE);
+ testRole("articleform_mixed", ROLE_ARTICLE);
+ testRole("articleform_label", ROLE_FORM);
+ testRole("articleform_label_mixed", ROLE_FORM);
// Test article exposed as article
testRole("testArticle", ROLE_ARTICLE);
@@ -204,8 +206,10 @@
// strong landmark
testRole("application", ROLE_APPLICATION);
testRole("application_mixed", ROLE_APPLICATION);
- testRole("form", ROLE_FORM);
- testRole("form_mixed", ROLE_FORM);
+ testRole("form", ROLE_SECTION);
+ testRole("form_mixed", ROLE_SECTION);
+ testRole("form_label", ROLE_FORM);
+ testRole("form_label_mixed", ROLE_FORM);
testRole("application_table", ROLE_APPLICATION);
testRole("application_table_mixed", ROLE_APPLICATION);
@@ -535,6 +539,8 @@
<article id="articlemain_mixed" role="mAIn">a main area</article>
<article id="articleform" role="form">a form area</article>
<article id="articleform_mixed" role="fORm">a form area</article>
+ <article id="articleform_label" aria-label="form" role="form">a form area</article>
+ <article id="articleform_label_mixed" aria-label="form" role="fORm">a form area</article>
<div id="testArticle" role="article" title="Test article">
<p>This is a paragraph inside the article.</p>
@@ -561,6 +567,8 @@
<div role="aPPLICATIOn" id="application_mixed">application</div>
<div role="form" id="form">form</div>
<div role="fORm" id="form_mixed">form</div>
+ <div role="form" id="form_label" aria-label="form">form</div>
+ <div role="fORm" id="form_label_mixed" aria-label="form">form</div>
<!-- weak landmarks -->
<div role="banner" id="banner">banner</div>
diff --git a/accessible/tests/mochitest/role/test_general.html b/accessible/tests/mochitest/role/test_general.html
index 38dde3325a..c0afd39360 100644
--- a/accessible/tests/mochitest/role/test_general.html
+++ b/accessible/tests/mochitest/role/test_general.html
@@ -161,7 +161,7 @@
id="nav_overflow">overflow nav</nav>
<header style="overflow: hidden;"
id="header_overflow">overflow header</header>
- <aside style="overflow: hidden;"
+ <aside style="overflow: hidden;" aria-label="aside"
id="aside_overflow">overflow aside</aside>
<footer style="overflow: hidden;"
id="footer_overflow">overflow footer</footer>
diff --git a/accessible/tests/mochitest/states/test_aria_widgetitems.html b/accessible/tests/mochitest/states/test_aria_widgetitems.html
index c2d546ba01..d17f110c22 100644
--- a/accessible/tests/mochitest/states/test_aria_widgetitems.html
+++ b/accessible/tests/mochitest/states/test_aria_widgetitems.html
@@ -26,7 +26,7 @@
this.DOMNode.focus();
};
- this.check = function focusARIAItem_check(aEvent) {
+ this.check = function focusARIAItem_check() {
testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
aIsSelected ? 0 : STATE_SELECTED);
};
@@ -47,7 +47,7 @@
this.widgetDOMNode.focus();
};
- this.check = function focusActiveDescendantItem_check(aEvent) {
+ this.check = function focusActiveDescendantItem_check() {
testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
aIsSelected ? 0 : STATE_SELECTED);
};
diff --git a/accessible/tests/mochitest/test_bug420863.html b/accessible/tests/mochitest/test_bug420863.html
index 4f3a608fe1..9d515ab3c6 100644
--- a/accessible/tests/mochitest/test_bug420863.html
+++ b/accessible/tests/mochitest/test_bug420863.html
@@ -40,7 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420863
// register 'click' event handler
gClickHandler = {
- handleEvent: function handleEvent(aEvent) {
+ handleEvent: function handleEvent() {
},
};
td3Node.addEventListener("click", gClickHandler);
@@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420863
actionName: "click",
actionIndex: 0,
events: CLICK_EVENTS,
- checkOnClickEvent: function check(aEvent) {
+ checkOnClickEvent: function check() {
// unregister click event handler
this.ID.removeEventListener("click", gClickHandler);
diff --git a/accessible/tests/mochitest/text.js b/accessible/tests/mochitest/text.js
index 21392336a1..6fe2a00b83 100644
--- a/accessible/tests/mochitest/text.js
+++ b/accessible/tests/mochitest/text.js
@@ -197,9 +197,17 @@ function testTextAfterOffset(
aBoundaryType,
aText,
aStartOffset,
- aEndOffset
+ aEndOffset,
+ ...aArgs
) {
- testTextSuperHelper("getTextAfterOffset", arguments);
+ testTextSuperHelper("getTextAfterOffset", [
+ aOffset,
+ aBoundaryType,
+ aText,
+ aStartOffset,
+ aEndOffset,
+ ...aArgs,
+ ]);
}
/**
@@ -261,9 +269,17 @@ function testTextBeforeOffset(
aBoundaryType,
aText,
aStartOffset,
- aEndOffset
+ aEndOffset,
+ ...aArgs
) {
- testTextSuperHelper("getTextBeforeOffset", arguments);
+ testTextSuperHelper("getTextBeforeOffset", [
+ aOffset,
+ aBoundaryType,
+ aText,
+ aStartOffset,
+ aEndOffset,
+ ...aArgs,
+ ]);
}
/**
diff --git a/accessible/tests/mochitest/tree/test_aria_display_contents.html b/accessible/tests/mochitest/tree/test_aria_display_contents.html
index 5c6f7f20fb..454e4e46e1 100644
--- a/accessible/tests/mochitest/tree/test_aria_display_contents.html
+++ b/accessible/tests/mochitest/tree/test_aria_display_contents.html
@@ -17,7 +17,7 @@
// Test ARIA grids that have display: contents; on different elements.
// They should all have equivalent trees.
var accTree =
- { TABLE: [
+ { GRID: [
{ ROW: [
{ role: ROLE_COLUMNHEADER,
children: [ { TEXT_LEAF: [ ] }, ]
diff --git a/accessible/tests/mochitest/tree/test_aria_grid.html b/accessible/tests/mochitest/tree/test_aria_grid.html
index 80ff97095b..4dd30e4183 100644
--- a/accessible/tests/mochitest/tree/test_aria_grid.html
+++ b/accessible/tests/mochitest/tree/test_aria_grid.html
@@ -18,7 +18,7 @@
// grid having rowgroups
var accTree =
- { TABLE: [
+ { GRID: [
{ GROUPING: [
{ ROW: [
{ GRID_CELL: [
@@ -34,7 +34,7 @@
// strange grids (mix of ARIA and HTML tables)
accTree = {
- role: ROLE_TABLE,
+ role: ROLE_GRID,
children: [
{ // div@role="row"
role: ROLE_ROW,
@@ -67,7 +67,7 @@
testAccessibleTree("strange_grid1", accTree);
accTree = {
- role: ROLE_TABLE,
+ role: ROLE_GRID,
children: [
{ // tr@role="row"
role: ROLE_ROW,
@@ -95,7 +95,7 @@
testAccessibleTree("strange_grid2", accTree);
accTree = {
- role: ROLE_TABLE,
+ role: ROLE_GRID,
children: [
{ // div@role="row"
role: ROLE_ROW,
@@ -122,7 +122,7 @@
testAccessibleTree("strange_grid3", accTree);
accTree = {
- role: ROLE_TABLE,
+ role: ROLE_GRID,
children: [
{ // div@role="row"
role: ROLE_ROW,
@@ -192,7 +192,7 @@
// grids that could contain text container accessibles but shouldn't.
accTree =
- { TABLE: [
+ { GRID: [
{ ROW: [
{ GRID_CELL: [
{ TEXT_LEAF: [ ] },
diff --git a/accessible/tests/mochitest/tree/test_aria_owns.html b/accessible/tests/mochitest/tree/test_aria_owns.html
index a01968521b..760cf7565b 100644
--- a/accessible/tests/mochitest/tree/test_aria_owns.html
+++ b/accessible/tests/mochitest/tree/test_aria_owns.html
@@ -96,7 +96,7 @@
testAccessibleTree("ariaowns_container", tree);
tree =
- { TABLE: [
+ { GRID: [
{ ROW: [
{ GRID_CELL: [
{ TEXT_LEAF: [] },
@@ -160,7 +160,7 @@
<!-- natural and aria-owns hierarchy -->
<div id="t5_2" role="note"><div aria-owns="t5_3" role="heading"></div></div>
<div id="t5_1"><div aria-owns="t5_2" role="group"></div></div>
- <div id="t5_3" role="form"><div aria-owns="t5_1" role="tooltip"></div></div>
+ <div id="t5_3" aria-label="form" role="form"><div aria-owns="t5_1" role="tooltip"></div></div>
<!-- rearrange children -->
<div id="t6_1" aria-owns="t6_3 t6_2">
diff --git a/accessible/tests/mochitest/tree/test_tabbrowser.xhtml b/accessible/tests/mochitest/tree/test_tabbrowser.xhtml
index 401ea1a2b1..3ccf83e4dc 100644
--- a/accessible/tests/mochitest/tree/test_tabbrowser.xhtml
+++ b/accessible/tests/mochitest/tree/test_tabbrowser.xhtml
@@ -42,7 +42,7 @@
browserDocument().documentElement.getBoundingClientRect();
}
- this.finalCheck = function testTabHierarchy_finalCheck(aEvent)
+ this.finalCheck = function testTabHierarchy_finalCheck()
{
////////////////////
// Tab bar
diff --git a/accessible/tests/mochitest/tree/test_tree.xhtml b/accessible/tests/mochitest/tree/test_tree.xhtml
index e22b3faa9d..e70ef134e9 100644
--- a/accessible/tests/mochitest/tree/test_tree.xhtml
+++ b/accessible/tests/mochitest/tree/test_tree.xhtml
@@ -97,7 +97,7 @@
{
this.DOMNode.view = aView;
}
- this.check = function check(aEvent)
+ this.check = function check()
{
testAccessibleTreeFor(this.DOMNode, aRole);
}
diff --git a/accessible/tests/mochitest/treeupdate/test_contextmenu.xhtml b/accessible/tests/mochitest/treeupdate/test_contextmenu.xhtml
index f81d77332d..9edac19af6 100644
--- a/accessible/tests/mochitest/treeupdate/test_contextmenu.xhtml
+++ b/accessible/tests/mochitest/treeupdate/test_contextmenu.xhtml
@@ -31,7 +31,7 @@
getNode(aID).openPopup(button, "after_start", 0, 0, true, false);
}
- this.finalCheck = function openMenu_finalCheck(aEvent)
+ this.finalCheck = function openMenu_finalCheck()
{
testAccessibleTree(aID, aTree);
}
@@ -70,7 +70,7 @@
synthesizeKey("KEY_Enter");
}
- this.finalCheck = function openSubMenu_finalCheck(aEvent)
+ this.finalCheck = function openSubMenu_finalCheck()
{
testAccessibleTree(aMenuID, aTree);
}
diff --git a/accessible/tests/mochitest/treeupdate/test_delayed_removal.html b/accessible/tests/mochitest/treeupdate/test_delayed_removal.html
index 3f421f0c5b..2ba1e31203 100644
--- a/accessible/tests/mochitest/treeupdate/test_delayed_removal.html
+++ b/accessible/tests/mochitest/treeupdate/test_delayed_removal.html
@@ -218,7 +218,7 @@
}
// Check to see that a reframed body gets its children pruned correctly.
- async function bodyReframe(argument) {
+ async function bodyReframe() {
// Load sub-document in iframe.
let event = waitForEvent(EVENT_REORDER, "iframe", "bodyReframe");
getNode("iframe").src =
diff --git a/accessible/tests/mochitest/treeupdate/test_shadow_slots.html b/accessible/tests/mochitest/treeupdate/test_shadow_slots.html
index 27baef0e4a..6680971401 100644
--- a/accessible/tests/mochitest/treeupdate/test_shadow_slots.html
+++ b/accessible/tests/mochitest/treeupdate/test_shadow_slots.html
@@ -55,7 +55,7 @@
async function changeSlotFlat() {
await _dynamicShadowTest("changeSlotFlat",
- (container, host) => {
+ (container) => {
container.querySelector('.red').removeAttribute('slot');
container.querySelector('.green').setAttribute('slot', 'myslot');
}, { SECTION: [{ SECTION: [{ name: "green"} ] }] });
@@ -63,7 +63,7 @@
async function changeSlotOneDeep() {
await _dynamicShadowTest("changeSlotOneDeep",
- (container, host) => {
+ (container) => {
container.querySelector('.red').removeAttribute('slot');
container.querySelector('.green').setAttribute('slot', 'myslot');
}, { SECTION: [{ SECTION: [{ SECTION: [{ name: "green"} ] }] }] }, ["shadowdiv"]);
@@ -72,7 +72,7 @@
// Nested roots and slots
async function changeSlotNested() {
await _dynamicShadowTest("changeSlotNested",
- (container, host) => {
+ (container) => {
testAccessibleTree(getNode("changeSlotNested"),
{ SECTION: [{ SECTION: [{ SECTION: [{ name: "red"} ] }] }] });
container.querySelector('.red').removeAttribute('slot');
@@ -82,14 +82,14 @@
async function changeSlotSingleChild() {
await _dynamicShadowTest("changeSlotSingleChild",
- (container, host) => {
+ (container) => {
container.querySelector('.red').setAttribute('slot', 'invalid');
}, { SECTION: [{ SECTION: [] }] });
}
async function changeSlotNoShadow() {
await _dynamicShadowTest("changeSlotNoShadow",
- (container, host) => {
+ (container) => {
// Make sure changing the slot attribute doesn't remove an element
// even when it remains in the flat tree.
container.querySelector('.red').setAttribute('slot', 'invalid');
diff --git a/accessible/tests/mochitest/treeupdate/test_shutdown.xhtml b/accessible/tests/mochitest/treeupdate/test_shutdown.xhtml
index ad8aebf812..9be24cb6f4 100644
--- a/accessible/tests/mochitest/treeupdate/test_shutdown.xhtml
+++ b/accessible/tests/mochitest/treeupdate/test_shutdown.xhtml
@@ -57,7 +57,7 @@
getNode(aID).remove();
};
- this.check = function check(aEvent)
+ this.check = function check()
{
testIsDefunct(this.tree, aID);
testIsDefunct(this.lastItem, "last item of " + aID);
diff --git a/accessible/tests/mochitest/treeview.js b/accessible/tests/mochitest/treeview.js
index 5dc3b595d8..6b50e5fecc 100644
--- a/accessible/tests/mochitest/treeview.js
+++ b/accessible/tests/mochitest/treeview.js
@@ -91,11 +91,11 @@ nsTreeView.prototype = {
return data.text + aCol.id;
},
- getCellValue: function getCellValue(aRow, aCol) {
+ getCellValue: function getCellValue(aRow) {
var data = this.getDataForIndex(aRow);
return data.value;
},
- getRowProperties: function getRowProperties(aIndex) {
+ getRowProperties: function getRowProperties() {
return "";
},
getCellProperties: function getCellProperties(aIndex, aCol) {
@@ -106,19 +106,19 @@ nsTreeView.prototype = {
var data = this.getDataForIndex(aIndex);
return this.mCyclerStates[data.cyclerState];
},
- getColumnProperties: function getColumnProperties(aCol) {
+ getColumnProperties: function getColumnProperties() {
return "";
},
getParentIndex: function getParentIndex(aRowIndex) {
var info = this.getInfoByIndex(aRowIndex);
return info.parentIndex;
},
- hasNextSibling: function hasNextSibling(aRowIndex, aAfterIndex) {},
+ hasNextSibling: function hasNextSibling() {},
getLevel: function getLevel(aIndex) {
var info = this.getInfoByIndex(aIndex);
return info.level;
},
- getImageSrc: function getImageSrc(aRow, aCol) {},
+ getImageSrc: function getImageSrc() {},
isContainer: function isContainer(aIndex) {
var data = this.getDataForIndex(aIndex);
return data.open != undefined;
@@ -131,7 +131,7 @@ nsTreeView.prototype = {
var data = this.getDataForIndex(aIndex);
return data.open == undefined;
},
- isSeparator: function isSeparator(aIndex) {},
+ isSeparator: function isSeparator() {},
isSorted: function isSorted() {},
toggleOpenState: function toggleOpenState(aIndex) {
var data = this.getDataForIndex(aIndex);
@@ -146,14 +146,14 @@ nsTreeView.prototype = {
}
},
selectionChanged: function selectionChanged() {},
- cycleHeader: function cycleHeader(aCol) {},
+ cycleHeader: function cycleHeader() {},
cycleCell: function cycleCell(aRow, aCol) {
var data = this.getDataForIndex(aRow);
data.cyclerState = (data.cyclerState + 1) % 3;
this.mTree.invalidateCell(aRow, aCol);
},
- isEditable: function isEditable(aRow, aCol) {
+ isEditable: function isEditable() {
return true;
},
setCellText: function setCellText(aRow, aCol, aValue) {