michael@0: /** michael@0: * Focus hyperlink invoker. michael@0: * michael@0: * @param aID [in] hyperlink identifier michael@0: * @param aSelectedAfter [in] specifies if hyperlink is selected/focused after michael@0: * the focus michael@0: */ michael@0: function focusLink(aID, aSelectedAfter) michael@0: { michael@0: this.node = getNode(aID); michael@0: this.accessible = getAccessible(this.node); michael@0: michael@0: this.eventSeq = []; michael@0: this.unexpectedEventSeq = []; michael@0: michael@0: var checker = new invokerChecker(EVENT_FOCUS, this.accessible); michael@0: if (aSelectedAfter) michael@0: this.eventSeq.push(checker); michael@0: else michael@0: this.unexpectedEventSeq.push(checker); michael@0: michael@0: this.invoke = function focusLink_invoke() michael@0: { michael@0: var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE : 0); michael@0: var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED; michael@0: testStates(aID, expectedStates, 0, unexpectedStates, 0); michael@0: michael@0: this.node.focus(); michael@0: } michael@0: michael@0: this.finalCheck = function focusLink_finalCheck() michael@0: { michael@0: var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0); michael@0: var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0); michael@0: testStates(aID, expectedStates, 0, unexpectedStates, 0); michael@0: } michael@0: michael@0: this.getID = function focusLink_getID() michael@0: { michael@0: return "focus hyperlink " + prettyName(aID); michael@0: } michael@0: }