diff --git a/accessible/.eslintrc.js b/accessible/.eslintrc.js index 563570d8b953aa16e9d0da3b14d603a0c96d5431..887fd4770dc13b92f4a0777ddf06599314f21cda 100644 --- a/accessible/.eslintrc.js +++ b/accessible/.eslintrc.js @@ -2,23 +2,30 @@ module.exports = { "extends": [ - "../.eslintrc.js" + "plugin:mozilla/recommended" ], - "globals": { - "Cc": true, - "Ci": true, - "Components": true, - "console": true, - "Cu": true, - "dump": true, - "Services": true, - "XPCOMUtils": true - }, "rules": { // Warn about cyclomatic complexity in functions. "complexity": ["error", 42], - // Maximum depth callbacks can be nested. - "max-nested-callbacks": ["error", 10], + // XXX These are rules that are enabled in the recommended configuration, but + // disabled here due to failures when initially implemented. They should be + // removed (and hence enabled) at some stage. + "brace-style": "off", + "consistent-return": "off", + "func-call-spacing": "off", + "quotes": "off", + "object-shorthand": "off", + "space-before-function-paren": "off", + "space-infix-ops": "off", + "key-spacing": "off", + "keyword-spacing": "off", + "no-else-return": "off", + "no-multi-spaces": "off", + "no-trailing-spaces": "off", + "no-unexpected-multiline": "off", + "no-unsafe-finally": "off", + "no-useless-call": "off", + "spaced-comment": "off", } }; diff --git a/accessible/jsat/AccessFu.jsm b/accessible/jsat/AccessFu.jsm index 307894d5259d02baaa137b97714a28ee6740626c..06eb6d7f6a9f1eb66c0c600d34bddd851240555b 100644 --- a/accessible/jsat/AccessFu.jsm +++ b/accessible/jsat/AccessFu.jsm @@ -2,8 +2,6 @@ * 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/. */ -/* global AccessFu, Components, Utils, PrefCache, Logger, Services, - PointerAdapter, dump, Presentation, Rect */ /* exported AccessFu */ 'use strict'; diff --git a/accessible/jsat/EventManager.jsm b/accessible/jsat/EventManager.jsm index 4efa732e121c2c42ff9262657f1bdcc258490abf..0bf7beb0891c98731d4cd1dd1b696cfd35a3bbae 100644 --- a/accessible/jsat/EventManager.jsm +++ b/accessible/jsat/EventManager.jsm @@ -98,7 +98,6 @@ this.EventManager.prototype = { switch (aEvent.type) { case 'wheel': { - let attempts = 0; let delta = aEvent.deltaX || aEvent.deltaY; this.contentControl.autoMove( null, @@ -271,7 +270,6 @@ this.EventManager.prototype = { { // Put vc where the focus is at let acc = aEvent.accessible; - let doc = aEvent.accessibleDocument; this._setEditingMode(aEvent); if ([Roles.CHROME_WINDOW, Roles.DOCUMENT, @@ -486,7 +484,7 @@ this.EventManager.prototype = { } return {}; }; - let {live, relevant, busy, atomic, memberOf} = getLiveAttributes(aEvent); + let {live, relevant, /* busy, atomic, memberOf */ } = getLiveAttributes(aEvent); // If container-live is not present or is set to |off| ignore the event. if (!live || live === 'off') { return {}; diff --git a/accessible/jsat/Gestures.jsm b/accessible/jsat/Gestures.jsm index cc431614c7c71bcfd565e8de82e13ce5d6660ad8..9a278f9b18f9cf6278bfef66366ad2294477c2e1 100644 --- a/accessible/jsat/Gestures.jsm +++ b/accessible/jsat/Gestures.jsm @@ -2,7 +2,6 @@ * 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/. */ -/* global Components, GestureSettings, XPCOMUtils, Utils, Promise, Logger */ /* exported GestureSettings, GestureTracker */ /****************************************************************************** diff --git a/accessible/jsat/OutputGenerator.jsm b/accessible/jsat/OutputGenerator.jsm index 36b43a5695e6a48f13d86d45a70c7b9d20372161..1f5dd74d7a0b2f6aab0607db1b5b837a3b0d8edb 100644 --- a/accessible/jsat/OutputGenerator.jsm +++ b/accessible/jsat/OutputGenerator.jsm @@ -2,7 +2,6 @@ * 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/. */ -/* global Components, XPCOMUtils, Utils, PrefCache, States, Roles, Logger */ /* exported UtteranceGenerator, BrailleGenerator */ 'use strict'; diff --git a/accessible/jsat/PointerAdapter.jsm b/accessible/jsat/PointerAdapter.jsm index ff54976b759ba13ae98b49ceab7f5f49059dc735..3240d7b5525667c91c32e74d63217097b50e8918 100644 --- a/accessible/jsat/PointerAdapter.jsm +++ b/accessible/jsat/PointerAdapter.jsm @@ -2,8 +2,6 @@ * 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/. */ -/* global Components, XPCOMUtils, Utils, Logger, GestureSettings, - GestureTracker */ /* exported PointerRelay, PointerAdapter */ 'use strict'; diff --git a/accessible/jsat/Presentation.jsm b/accessible/jsat/Presentation.jsm index c7d4162b714910cddc653e9e763de5b5e7636263..1b801569ad083be1c6209fbd73559d7c4036637e 100644 --- a/accessible/jsat/Presentation.jsm +++ b/accessible/jsat/Presentation.jsm @@ -2,8 +2,6 @@ * 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/. */ -/* global Components, XPCOMUtils, Utils, Logger, BraillePresenter, Presentation, - UtteranceGenerator, BrailleGenerator, States, Roles, PivotContext */ /* exported Presentation */ 'use strict'; diff --git a/accessible/jsat/Traversal.jsm b/accessible/jsat/Traversal.jsm index 5b3bbdf89c720bf264049c07abff88eb4c76a507..a505f6dbaddf81a65760d53d07cb2f87276172ac 100644 --- a/accessible/jsat/Traversal.jsm +++ b/accessible/jsat/Traversal.jsm @@ -2,8 +2,6 @@ * 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/. */ -/* global PrefCache, Roles, Prefilters, States, Filters, Utils, - TraversalRules, Components, XPCOMUtils */ /* exported TraversalRules, TraversalHelper */ 'use strict'; diff --git a/accessible/jsat/Utils.jsm b/accessible/jsat/Utils.jsm index 61a68eb28b6794c6a25fb4590281e42d2b3a23b9..a8f6d89d16c12a9e39b675ebd40188d00ba84f2a 100644 --- a/accessible/jsat/Utils.jsm +++ b/accessible/jsat/Utils.jsm @@ -2,8 +2,6 @@ * 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/. */ -/* global Components, XPCOMUtils, Services, PluralForm, Logger, Rect, Utils, - States, Relations, Roles, dump, Events, PivotContext, PrefCache */ /* exported Utils, Logger, PivotContext, PrefCache */ 'use strict'; diff --git a/accessible/jsat/content-script.js b/accessible/jsat/content-script.js index 6ef0dadc3120e42ff8fea75e56a5cc35d7a9c44e..d7b8e8347265c23fb8313ded5ed903ddf81d1204 100644 --- a/accessible/jsat/content-script.js +++ b/accessible/jsat/content-script.js @@ -2,6 +2,8 @@ * 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/. */ +/* eslint-env mozilla/frame-script */ + var Ci = Components.interfaces; var Cu = Components.utils; diff --git a/accessible/tests/crashtests/.eslintrc.js b/accessible/tests/crashtests/.eslintrc.js new file mode 100644 index 0000000000000000000000000000000000000000..1a103a8d38c1191a2f08d15cceda3f215b3c9861 --- /dev/null +++ b/accessible/tests/crashtests/.eslintrc.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = { + "extends": [ + "plugin:mozilla/mochitest-test" + ], +}; diff --git a/accessible/tests/crashtests/448064.xhtml b/accessible/tests/crashtests/448064.xhtml index 7b662e7de7c0ad1d044a2b12fb45e2b19b760394..586dbd1debf52b3d4dded5fe94f9bd52c1d77ce0 100644 --- a/accessible/tests/crashtests/448064.xhtml +++ b/accessible/tests/crashtests/448064.xhtml @@ -20,13 +20,13 @@ <script> function dumpAccessibleNode(aNode, level) { var msg = ""; - + try { msg += "name=\"" + aNode.name + "\" "; } catch (e) { msg += " noName "; } - + dump(msg + '\n'); } @@ -35,7 +35,7 @@ function dumpAccessibleTree(aNode, level) { level = level || 0; dumpAccessibleNode(aNode, level); - try { + try { var child = aNode.firstChild; while (child) { dumpAccessibleTree(child, level + 1); @@ -46,14 +46,14 @@ function dumpAccessibleTree(aNode, level) { } } -function A(o) { +function A(o) { var acc = SpecialPowers.Cc['@mozilla.org/accessibilityService;1'] .getService(SpecialPowers.Ci.nsIAccessibilityService); return acc.getAccessibleFor(o); } function beginAccessible() { - dumpAccessibleTree(A(document),0); + dumpAccessibleTree(A(document), 0); } setTimeout(beginAccessible, 100); @@ -62,9 +62,9 @@ setTimeout(doe, 200); function doe() { document.getElementById('mw_a').appendChild(document.getElementById('mw_b')); document.getElementById('mw_c').appendChild(document.getElementById('mw_d')); - document.getElementById('mw_e').appendChild(document.getElementById('mw_f')); - document.getElementById('mw_g').appendChild(document.getElementById('mw_b')); + document.getElementById('mw_e').appendChild(document.getElementById('mw_f')); + document.getElementById('mw_g').appendChild(document.getElementById('mw_b')); } </script> </body> -</html> \ No newline at end of file +</html> diff --git a/accessible/tests/mochitest/.eslintrc.js b/accessible/tests/mochitest/.eslintrc.js new file mode 100644 index 0000000000000000000000000000000000000000..63fd23f5143c6d5fe7d3eecf490136ebcab4008e --- /dev/null +++ b/accessible/tests/mochitest/.eslintrc.js @@ -0,0 +1,24 @@ +"use strict"; + +module.exports = { + "extends": [ + "plugin:mozilla/mochitest-test" + ], + "rules": { + "mozilla/no-cpows-in-tests": "error", + "mozilla/reject-importGlobalProperties": "error", + + // XXX These are rules that are enabled in the recommended configuration, but + // disabled here due to failures when initially implemented. They should be + // removed (and hence enabled) at some stage. + "comma-spacing": "off", + "no-cond-assign": "off", + "no-lonely-if": "off", + "no-nested-ternary": "off", + "no-new-object": "off", + "no-redeclare": "off", + "no-shadow": "off", + "no-undef": "off", + "space-unary-ops": "off", + } +}; diff --git a/accessible/tests/mochitest/actions.js b/accessible/tests/mochitest/actions.js index 0c2765eeb3ac03d0a2a2350b091c154dd0d8555a..d7ac0dc563034620a388c8b6b3ff867306cdd94b 100644 --- a/accessible/tests/mochitest/actions.js +++ b/accessible/tests/mochitest/actions.js @@ -41,7 +41,7 @@ const XUL_EVENTS = CLICK_EVENTS | COMMAND_EVENT; * * // [optional] an array of invoker's checker objects (see eventQueue * // constructor events.js) - * get eventSeq() {} + * get eventSeq() {} * }; * * @@ -134,7 +134,7 @@ function actionInvoker(aAccOrElmOrId, aActionIndex, aActionName, aEventSeq) try { acc.doAction(aActionIndex); } - catch (e){ + catch (e) { ok(false, "doAction(" + aActionIndex + ") failed with: " + e.name); return INVOKER_ACTION_FAILED; } diff --git a/accessible/tests/mochitest/actions/test_media.html b/accessible/tests/mochitest/actions/test_media.html index beb014ebc3e2024ab8d315284023d7eabc790b71..447d25941eba9e1b98fc10e8d2d31711e644730a 100644 --- a/accessible/tests/mochitest/actions/test_media.html +++ b/accessible/tests/mochitest/actions/test_media.html @@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573 var audioElm = getAccessible("audio"); var playBtn = audioElm.firstChild; - var scrubber = playBtn.nextSibling.nextSibling.nextSibling; + // var scrubber = playBtn.nextSibling.nextSibling.nextSibling; var muteBtn = audioElm.lastChild.previousSibling; var actions = [ diff --git a/accessible/tests/mochitest/editabletext/editabletext.js b/accessible/tests/mochitest/editabletext/editabletext.js index 2fb1851bf6f511becac90e6fb6cdc34434e713ba..46f5d345f0929194cfc50ebd58bb1926f38a2125 100644 --- a/accessible/tests/mochitest/editabletext/editabletext.js +++ b/accessible/tests/mochitest/editabletext/editabletext.js @@ -133,7 +133,7 @@ function editableTextTest(aID) } this.generateTest(aID, null, [aStartPos, aEndPos, getTextFromClipboard], - copyNPasteInvoke, getValueChecker(aID, aResStr), testID); + copyNPasteTextInvoke, getValueChecker(aID, aResStr), testID); } /** @@ -222,7 +222,6 @@ function editableTextTest(aID) function getValue(aID) { - var value = ""; var elm = getNode(aID); if (elm instanceof Components.interfaces.nsIDOMNSEditableElement) return elm.value; @@ -258,21 +257,6 @@ function editableTextTest(aID) return checker; } - function getValueNClipboardChecker(aID, aValue, aText) - { - var valueChecker = getValueChecker(aID, aValue); - var clipboardChecker = getClipboardChecker(aID, aText); - - var checker = { - check: function() - { - valueChecker.check(); - clipboardChecker.check(); - } - }; - return checker; - } - /** * Process next scheduled test. */ @@ -350,4 +334,3 @@ function editableTextTest(aID) this.mEventQueue = new eventQueue(); this.mEventQueueReady = false; } - diff --git a/accessible/tests/mochitest/elm/test_canvas.html b/accessible/tests/mochitest/elm/test_canvas.html index b4b74380033f4190fbb86d2e559f247c316fdd30..4f707d067f898e1d4f2f4c609cc24904ddb81a60 100644 --- a/accessible/tests/mochitest/elm/test_canvas.html +++ b/accessible/tests/mochitest/elm/test_canvas.html @@ -29,7 +29,7 @@ context.addHitRegion({control: element}); var input = getAccessible("showA"); - var [cnvX, cnvY, cnvWidth, cnvHeight] = getBoundsForDOMElm(canv); + var [cnvX, cnvY, /*cnvWidth*/, /*cnvHeight*/] = getBoundsForDOMElm(canv); var [accX, accY, accWidth, accHeight] = getBounds(input); var [x, y, w, h] = CSSToDevicePixels(window, kX, kY, kWidth, kHeight); diff --git a/accessible/tests/mochitest/events.js b/accessible/tests/mochitest/events.js index 6cb5fd9385486566f2602635c4dc37f04834d6ef..e426d6a8cc6e7fde2955856122e45a51312e3a05 100644 --- a/accessible/tests/mochitest/events.js +++ b/accessible/tests/mochitest/events.js @@ -505,7 +505,7 @@ function eventQueue(aEventType) // (i.e. event types are matched, targets differs). if (!checker.unexpected && checker.unique && eventQueue.compareEventTypes(checker, aEvent)) { - var isExppected = false; + var isExpected = false; for (var jdx = 0; jdx < eventSeq.length; jdx++) { isExpected = eventQueue.compareEvents(eventSeq[jdx], aEvent); if (isExpected) @@ -969,7 +969,7 @@ eventQueue.logEvent = function eventQueue_logEvent(aOrigEvent, aMatchedChecker, var currType = eventQueue.getEventTypeAsString(aMatchedChecker); var currTargetDescr = eventQueue.getEventTargetDescr(aMatchedChecker); - var consoleMsg = "*****\nScenario " + aScenarioIdx + + var consoleMsg = "*****\nScenario " + aScenarioIdx + ", event " + aEventIdx + " matched: " + currType + "\n" + infoMsg + "\n*****"; gLogger.logToConsole(consoleMsg); @@ -1315,8 +1315,8 @@ function synthFocus(aNodeOrID, aCheckerOrEventSeq) this.DOMNode.focus(); } - this.getID = function synthFocus_getID() - { + this.getID = function synthFocus_getID() + { return prettyName(aNodeOrID) + " focus"; } } @@ -1336,8 +1336,8 @@ function synthFocusOnFrame(aNodeOrID, aCheckerOrEventSeq) this.DOMNode.body.focus(); } - this.getID = function synthFocus_getID() - { + this.getID = function synthFocus_getID() + { return prettyName(aNodeOrID) + " frame document focus"; } } @@ -1991,7 +1991,7 @@ function selChangeSeq(aUnselectedID, aSelectedID) } // Return two possible scenarios: depending on widget type when selection is - // moved the the order of items that get selected and unselected may vary. + // moved the the order of items that get selected and unselected may vary. return [ [ new stateChangeChecker(STATE_SELECTED, false, false, aUnselectedID), @@ -2151,7 +2151,7 @@ function removeA11yEventListener(aEventType, aEventHandler) return false; listenersArray.splice(index, 1); - + if (!listenersArray.length) { gA11yEventListeners[aEventType] = null; delete gA11yEventListeners[aEventType]; @@ -2270,21 +2270,19 @@ var gLogger = function sequenceItem(aProcessor, aEventType, aTarget, aItemID) { // private - + this.startProcess = function sequenceItem_startProcess() { this.queue.invoke(); } - - var item = this; - + this.queue = new eventQueue(); this.queue.onFinish = function() { aProcessor.onProcessed(); return DO_NOT_FINISH_TEST; } - + var invoker = { invoke: function invoker_invoke() { return aProcessor.process(); @@ -2295,7 +2293,7 @@ function sequenceItem(aProcessor, aEventType, aTarget, aItemID) }, eventSeq: [ new invokerChecker(aEventType, aTarget) ] }; - + this.queue.push(invoker); } diff --git a/accessible/tests/mochitest/events/test_fromUserInput.html b/accessible/tests/mochitest/events/test_fromUserInput.html index 1cfeedf0b360cdd80200295e6698c59c23a057bb..5917ae06eb5a94c07a9fd52034b1655c9c1d2b77 100644 --- a/accessible/tests/mochitest/events/test_fromUserInput.html +++ b/accessible/tests/mochitest/events/test_fromUserInput.html @@ -31,9 +31,6 @@ this.invoke = function removeTextFromInput_invoke() { - const nsIDOMNSEditableElement = - Components.interfaces.nsIDOMNSEditableElement; - this.DOMNode.focus(); this.DOMNode.setSelectionRange(aStart, aEnd); @@ -60,9 +57,6 @@ this.invoke = function removeTextFromContentEditable_invoke() { - const nsIDOMNSEditableElement = - Components.interfaces.nsIDOMNSEditableElement; - this.DOMNode.focus(); this.textNode = getNode(aID).firstChild; var selection = window.getSelection(); diff --git a/accessible/tests/mochitest/events/test_text.html b/accessible/tests/mochitest/events/test_text.html index 76dd1ce49af09126720b1d510a4a8a48eda28dd2..b05dbeeafc2ef496c68a16e9baa00cc7a170716f 100644 --- a/accessible/tests/mochitest/events/test_text.html +++ b/accessible/tests/mochitest/events/test_text.html @@ -185,9 +185,6 @@ this.invoke = function removeTextFromInput_invoke() { - const nsIDOMNSEditableElement = - Components.interfaces.nsIDOMNSEditableElement; - this.DOMNode.focus(); this.DOMNode.setSelectionRange(aStart, aEnd); diff --git a/accessible/tests/mochitest/grid.js b/accessible/tests/mochitest/grid.js index c3dc7d1ba5361d473e388f8c1ec5391cd694af79..abe1212e24d472b54f0b00b38122f7aa583ac607 100644 --- a/accessible/tests/mochitest/grid.js +++ b/accessible/tests/mochitest/grid.js @@ -26,7 +26,6 @@ function grid(aTableIdentifier) this.getCellAtIndex = function getCellAtIndex(aIndex) { - var rowCount = this.getRowCount(); var colsCount = this.getColsCount(); var rowIdx = Math.floor(aIndex / colsCount); @@ -133,7 +132,7 @@ function grid(aTableIdentifier) { if (aEvent.target.localName != "td") return; - + var curCell = this.getCurrentCell(); var cell = aEvent.target; diff --git a/accessible/tests/mochitest/hittest/test_canvas_hitregion.html b/accessible/tests/mochitest/hittest/test_canvas_hitregion.html index fc1df3d60fd38e5af9a2d08d95482e89cfe30d74..37309984b9a3386e8ff36884e426c9870852fdad 100644 --- a/accessible/tests/mochitest/hittest/test_canvas_hitregion.html +++ b/accessible/tests/mochitest/hittest/test_canvas_hitregion.html @@ -51,7 +51,7 @@ var hitcanvas = getAccessible("hitcanvas"); var hitcheck = getAccessible("hitcheck"); - var [hitX, hitY, hitWidth, hitHeight] = getBounds(hitcanvas); + var [hitX, hitY, /*hitWidth, hitHeight */] = getBounds(hitcanvas); var [deltaX, deltaY] = CSSToDevicePixels(window, offsetX, offsetY); var docAcc = getAccessible(document); diff --git a/accessible/tests/mochitest/hittest/test_general.html b/accessible/tests/mochitest/hittest/test_general.html index 74ff4fe298d71a911d55bb473babb946afa491de..0a8f5d0d60b70410ca78465c2eaa2563bced82e4 100644 --- a/accessible/tests/mochitest/hittest/test_general.html +++ b/accessible/tests/mochitest/hittest/test_general.html @@ -48,9 +48,8 @@ if (!MAC) { // Not specific case, point is inside of btn accessible. var btn = getAccessible("btn"); - var btnText = btn.firstChild; testChildAtPoint(btn, 1, 1, btn, btn); - + // Not specific case, point is outside of btn accessible. testChildAtPoint(btn, -1, 1, null, null); diff --git a/accessible/tests/mochitest/hyperlink/test_general.html b/accessible/tests/mochitest/hyperlink/test_general.html index e6e098ecca2fba7c5cdb25342e3d79a6fc220a32..4b3a20446a4051529400e4cc5ae224fcf03061b3 100644 --- a/accessible/tests/mochitest/hyperlink/test_general.html +++ b/accessible/tests/mochitest/hyperlink/test_general.html @@ -72,7 +72,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368 [nsIAccessibleHyperLink]); testThis("NormalHyperlink", normalHyperlinkAcc, ROLE_LINK, 1, "Mozilla Foundation", true, 17, 18); - is(normalHyperlinkAcc.getURI(0).spec, "http://www.mozilla.org/", + is(normalHyperlinkAcc.getURI(0).spec, "http://www.mozilla.org/", "URI wrong for normalHyperlinkElement!"); testStates(normalHyperlinkAcc, STATE_LINKED, 0); @@ -133,7 +133,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368 [nsIAccessibleHyperLink]); testThis("LinkWithSpan", hyperlinkWithSpanAcc, ROLE_LINK, 1, "Heise Online", true, 119, 120); - is(hyperlinkWithSpanAcc.getURI(0).spec, "http://www.heise.de/", + is(hyperlinkWithSpanAcc.getURI(0).spec, "http://www.heise.de/", "URI wrong for hyperlinkElementWithSpan!"); testStates(hyperlinkWithSpanAcc, STATE_LINKED, 0); testAction("LinkWithSpan", hyperlinkWithSpanAcc, "jump"); @@ -168,7 +168,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368 ////////////////////////////////////////////////////////////////////////// // Maps to group links (bug 431615). - var linksMapAcc = getAccessible("linksmap"); + // var linksMapAcc = getAccessible("linksmap"); ////////////////////////////////////////////////////////////////////////// // Link with title attribute, no name from the subtree (bug 438325). @@ -260,13 +260,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368 >This should never be of state_linked</a ><br>Link with registered 'click' event: <a id="linkWithClick" onclick="var clicked = true;" >This should have state_linked</a - ><br>Link with title attribute (no name from subtree): <a + ><br>Link with title attribute (no name from subtree): <a id="linkWithTitleNoNameFromSubtree" href="http://www.heise.de/" title="Link with title"><img src=""/></a - ><br>Link with title attribute (name from subtree): <a + ><br>Link with title attribute (name from subtree): <a id="linkWithTitleNameFromSubtree" href="http://www.heise.de/" title="Link with title">the name from subtree</a - ><br>Link with title attribute (name from nested image): <a + ><br>Link with title attribute (name from nested image): <a id="linkWithTitleNameFromImg" href="http://www.heise.de/" title="Link with title"><img src="" alt="The title for link"/></a ><br><br>Map that is used to group links (www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), also see the bug 431615:<br diff --git a/accessible/tests/mochitest/jsat/test_live_regions.html b/accessible/tests/mochitest/jsat/test_live_regions.html index 53828f1b190b296eaa65f2c1a5664b8e3aa27a64..e696d3244b331b0cd49d93d7b36d3a3d2114e14d 100644 --- a/accessible/tests/mochitest/jsat/test_live_regions.html +++ b/accessible/tests/mochitest/jsat/test_live_regions.html @@ -300,7 +300,6 @@ } }, action: function action() { - var region = document.getElementById("to_replace_region"); var child = document.getElementById("to_replace"); child.setAttribute("role", "main"); } diff --git a/accessible/tests/mochitest/name/markup.js b/accessible/tests/mochitest/name/markup.js index 9d1c09562ed0d6c8d6eaa2e095eed6a0dcbb25f2..1a806ec88a2b97f156bc667b0dac4caf41b5c0dd 100644 --- a/accessible/tests/mochitest/name/markup.js +++ b/accessible/tests/mochitest/name/markup.js @@ -139,8 +139,6 @@ function testNamesForMarkupRules(aMarkupElm, aContainer) if (gDumpToConsole) dump("\nProcessing markup rules '" + testID + "'\n"); - var serializer = new XMLSerializer(); - var expr = "//html/body/div[@id='test']/" + aMarkupElm.getAttribute("ref"); var elm = evaluateXPath(document, expr, htmlDocResolver)[0]; diff --git a/accessible/tests/mochitest/relations.js b/accessible/tests/mochitest/relations.js index 0d9aae2b19c5e6dda3cfb90f579cad58aff5309e..f6c03477bbce60846f45eb77f39466520b3ace11 100644 --- a/accessible/tests/mochitest/relations.js +++ b/accessible/tests/mochitest/relations.js @@ -115,7 +115,6 @@ function testAbsentRelation(aIdentifier, aRelType, aUnrelatedIdentifiers) var relation = getRelationByType(aIdentifier, aRelType); var relDescr = getRelationErrorMsg(aIdentifier, aRelType); - var relDescrStart = getRelationErrorMsg(aIdentifier, aRelType, true); if (!aUnrelatedIdentifiers) { ok(false, "No identifiers given for unrelated accessibles."); diff --git a/accessible/tests/mochitest/scroll/test_zoom.html b/accessible/tests/mochitest/scroll/test_zoom.html index 05dd3c4440db46c621b6bb7f8d423107728deecc..cff32a5043b6d937b94973f23fdcdff145ad2c23 100644 --- a/accessible/tests/mochitest/scroll/test_zoom.html +++ b/accessible/tests/mochitest/scroll/test_zoom.html @@ -22,7 +22,7 @@ { // scrollToPoint relative screen var anchor = getAccessible("bottom1"); - var [x, y] = getPos(anchor); + var [x, /*y*/] = getPos(anchor); var [docX, docY] = getPos(document); anchor.scrollToPoint(COORDTYPE_SCREEN_RELATIVE, docX, docY); @@ -30,7 +30,7 @@ // scrollToPoint relative window anchor = getAccessible("bottom2"); - var [x, y] = getPos(anchor); + var [x, /*y*/] = getPos(anchor); var wnd = getRootAccessible().DOMDocument.defaultView; var [screenX, screenY] = CSSToDevicePixels(wnd, wnd.screenX, wnd.screenY); var scrollToX = docX - screenX, scrollToY = docY - screenY; @@ -40,7 +40,7 @@ // scrollToPoint relative parent anchor = getAccessible("bottom3"); - var [x, y] = getPos(anchor); + var [x, /*y*/] = getPos(anchor); var [parentX, parentY] = getPos(anchor.parent); var scrollToX = parentX - docX, scrollToY = parentY - docY; diff --git a/accessible/tests/mochitest/scroll/test_zoom_text.html b/accessible/tests/mochitest/scroll/test_zoom_text.html index 3ef8fcdedfa3c9c91fef74bfd23b7bae7a6d4572..f162cc7e1c6eca9d7b97b5b2c24c945b94563a2e 100644 --- a/accessible/tests/mochitest/scroll/test_zoom_text.html +++ b/accessible/tests/mochitest/scroll/test_zoom_text.html @@ -27,7 +27,7 @@ var paragraph = getAccessible(paragraphNode, [nsIAccessibleText]); var offset = 64; // beginning of 4th stanza - var [x, y] = getPos(paragraph); + var [x, /*y*/] = getPos(paragraph); var [docX, docY] = getPos(tabDocument); paragraph.scrollSubstringToPoint(offset, offset, @@ -39,7 +39,7 @@ paragraphNode = tabDocument.getElementById("paragraph2"); paragraph = getAccessible(paragraphNode, [nsIAccessibleText]); offset = 52; // // beginning of 4th stanza - var [x, y] = getPos(paragraph); + var [x, /*y*/] = getPos(paragraph); paragraph.scrollSubstringToPoint(offset, offset, COORDTYPE_SCREEN_RELATIVE, docX, docY); testTextPos(paragraph, offset, [x, docY], COORDTYPE_SCREEN_RELATIVE); diff --git a/accessible/tests/mochitest/selectable.js b/accessible/tests/mochitest/selectable.js index 87bf296f0fdbc197582dd36c8eed58d186a47aef..5e26063c35a064287a8916975878b411d919d7c8 100644 --- a/accessible/tests/mochitest/selectable.js +++ b/accessible/tests/mochitest/selectable.js @@ -52,7 +52,7 @@ function testIsItemSelected(aSelectAcc, aTraversedAcc, aIndexObj, aSelectedChild var childCount = aTraversedAcc.childCount; for (var idx = 0; idx < childCount; idx++) { var child = aTraversedAcc.getChildAt(idx); - var [state, extraState] = getStates(child); + var [state, /*extraState*/] = getStates(child); if (state & STATE_SELECTABLE) { var isSelected = false; var len = aSelectedChildren.length; diff --git a/accessible/tests/mochitest/states.js b/accessible/tests/mochitest/states.js index ad1f89943e871e1691c5290bd125c37892ceec11..573c72f3a1b3965083e49444c2a289466a0ab683 100644 --- a/accessible/tests/mochitest/states.js +++ b/accessible/tests/mochitest/states.js @@ -204,7 +204,7 @@ function testStatesInSubtree(aAccOrElmOrID, aState, aExtraState, aAbsentState) function testIsDefunct(aAccessible, aTestName) { var id = prettyName(aAccessible) + (aTestName ? " [" + aTestName + "]" : ""); - var [state, extraState] = getStates(aAccessible); + var [/*state*/, extraState] = getStates(aAccessible); isState(extraState & EXT_STATE_DEFUNCT, EXT_STATE_DEFUNCT, true, "no defuct state for " + id + "!"); } diff --git a/accessible/tests/mochitest/states/test_aria.html b/accessible/tests/mochitest/states/test_aria.html index 1fb19c7c4291fb821a8fd24ecb59c7a7d6cef5ff..7c9563634bda8dc56da1282ba69af13b00ed8f67 100644 --- a/accessible/tests/mochitest/states/test_aria.html +++ b/accessible/tests/mochitest/states/test_aria.html @@ -34,7 +34,7 @@ if (!acc) return; - var [state, extraState] = getStates(aAccOrElmOrID); + var [state, /*extraState*/] = getStates(aAccOrElmOrID); if (state & STATE_UNAVAILABLE) { var role = getRole(acc); if (role != ROLE_GROUPING) { diff --git a/accessible/tests/mochitest/table.js b/accessible/tests/mochitest/table.js index e171594d6b8acc66d25d6bc2b2cd8ce85a81f48c..8b729f5a462e134f82bcfbc40574921c526c7a3d 100644 --- a/accessible/tests/mochitest/table.js +++ b/accessible/tests/mochitest/table.js @@ -16,7 +16,7 @@ const kRowHeaderCell = 2; // Indicates the cell is row header cell const kColHeaderCell = 4; // Indicated the cell is column header cell const kOrigin = kDataCell | kRowHeaderCell | kColHeaderCell; -const kRowSpanned = 8; // Indicates the cell is not origin and row spanned +const kRowSpanned = 8; // Indicates the cell is not origin and row spanned const kColSpanned = 16; // Indicates the cell is not origin and column spanned const kSpanned = kRowSpanned | kColSpanned; @@ -417,7 +417,6 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg) var selRows = new Array(); // isRowSelected test - var selrowCount = 0; for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) { var isRowSelected = true; for (var colIdx = 0; colIdx < colsCount; colIdx++) { @@ -539,7 +538,6 @@ function testUnselectTableColumn(aIdentifier, aColIdx, aCellsArray) var rowCount = aCellsArray.length; for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) { - var cellState = aCellsArray[rowIdx][aColIdx]; // Unselect origin cell. var [origRowIdx, origColIdx] = getOrigRowAndColumn(aCellsArray, rowIdx, aColIdx); diff --git a/accessible/tests/mochitest/table/test_table_1.html b/accessible/tests/mochitest/table/test_table_1.html index ab39377702bd5c829dedb92dea145a99525a3e45..60e1b2922c0377eff2a08553fb0c1c9daff3e036 100644 --- a/accessible/tests/mochitest/table/test_table_1.html +++ b/accessible/tests/mochitest/table/test_table_1.html @@ -50,9 +50,13 @@ function doTest() is(accTable.selectedRowCount, 1, "no cells selected"); - var columnDescription = accTable.getColumnDescription(1); - var rowDescription = accTable.getRowDescription(1); - + // These shouldn't throw. + try { + accTable.getColumnDescription(1); + accTable.getRowDescription(1); + } catch (ex) { + ok(false, "getColumnDescription/getRowDescription shouldn't throw."); + } SimpleTest.finish(); } SimpleTest.waitForExplicitFinish(); diff --git a/accessible/tests/mochitest/test_OuterDocAccessible.html b/accessible/tests/mochitest/test_OuterDocAccessible.html index c2efa18fe5d37f648538c34ec7d34bd502bde8c3..235f729d875a9b4d1c51fc1f6825f0d754da5ac3 100644 --- a/accessible/tests/mochitest/test_OuterDocAccessible.html +++ b/accessible/tests/mochitest/test_OuterDocAccessible.html @@ -40,9 +40,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441519 // see bug 440770, no actions wanted on outer doc is(outerDocAcc.actionCount, 0, "Wrong number of actions for internal frame!"); - var actionTempStr; // not really used, just needs to receive a value + try { - actionTempStr = outerDocAcc.getActionName(0); + outerDocAcc.getActionName(0); do_throw("No exception thrown for actionName!"); } catch(e) { ok(e.result, ns_error_invalid_arg, diff --git a/accessible/tests/mochitest/text.js b/accessible/tests/mochitest/text.js index a91ea9acc91e08425707d78fbce395c3ee69b372..193094fcff9a60bf23462c7b8c9703865f9c816f 100644 --- a/accessible/tests/mochitest/text.js +++ b/accessible/tests/mochitest/text.js @@ -261,8 +261,8 @@ function testWordCount(aElement, aCount, aToDoFlag) var offset = 0; var wordCount = 0; while (true) { - var text = acc.getTextAtOffset(offset, BOUNDARY_WORD_START, - startOffsetObj, endOffsetObj); + acc.getTextAtOffset(offset, BOUNDARY_WORD_START, + startOffsetObj, endOffsetObj); if (offset >= length) break; diff --git a/accessible/tests/mochitest/tree/test_aria_globals.html b/accessible/tests/mochitest/tree/test_aria_globals.html index 771640fcc6dd31aefc3a32da05530ef90777dcee..34c73691a9321ec8177dff57acf38a982b5d3efe 100644 --- a/accessible/tests/mochitest/tree/test_aria_globals.html +++ b/accessible/tests/mochitest/tree/test_aria_globals.html @@ -42,7 +42,7 @@ for (var idx = 0; idx < globalIds.length; idx++) { ok(isAccessible(globalIds[idx]), - "Must be accessible becuase of " + "aria-" + globalIds[idx] + + "Must be accessible becuase of aria-" + globalIds[idx] + " presence"); } diff --git a/accessible/tests/mochitest/treeupdate/test_list.html b/accessible/tests/mochitest/treeupdate/test_list.html index 9196142d9be6d5b207abff3af48e98d7c0ebc11d..595392b5bc8d402e69e7d93c025146f3ee50a231 100644 --- a/accessible/tests/mochitest/treeupdate/test_list.html +++ b/accessible/tests/mochitest/treeupdate/test_list.html @@ -68,7 +68,7 @@ 0, this.li, this.liNode, this.bullet ); } - }; + } function showProcessor() { @@ -84,7 +84,7 @@ testLiAccessibleTree(); gSequence.processNext(); } - }; + } function textReplaceProcessor() { @@ -106,7 +106,7 @@ testAccessibleTree(this.liNode, tree); SimpleTest.finish(); } - }; + } //////////////////////////////////////////////////////////////////////////// // Test diff --git a/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html b/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html index d4c178cb978a0afdfa6a761d8b09a98fc486bf92..66deadb55c49bee09ea3d178ea96d52b0b08f465 100644 --- a/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html +++ b/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html @@ -65,7 +65,7 @@ { return "add li"; } - }; + } //////////////////////////////////////////////////////////////////////////// // Test diff --git a/accessible/tests/mochitest/value/test_general.html b/accessible/tests/mochitest/value/test_general.html index 12e718ba17ce7299939d031e400dd72742ec7f9f..bf19bc38bb82f84f0a61a18e3848ace7d98fb200 100644 --- a/accessible/tests/mochitest/value/test_general.html +++ b/accessible/tests/mochitest/value/test_general.html @@ -36,7 +36,6 @@ is(acc.value, aValue, "Wrong value for " + aID + "!"); } - var rootDir = getRootDirectory(window.location.href); var href = getRootDirectory(window.location.href) + "foo"; // roles that can't live as HTMLLinkAccessibles