accessible/tests/mochitest/hyperlink/hyperlink.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /**
michael@0 2 * Focus hyperlink invoker.
michael@0 3 *
michael@0 4 * @param aID [in] hyperlink identifier
michael@0 5 * @param aSelectedAfter [in] specifies if hyperlink is selected/focused after
michael@0 6 * the focus
michael@0 7 */
michael@0 8 function focusLink(aID, aSelectedAfter)
michael@0 9 {
michael@0 10 this.node = getNode(aID);
michael@0 11 this.accessible = getAccessible(this.node);
michael@0 12
michael@0 13 this.eventSeq = [];
michael@0 14 this.unexpectedEventSeq = [];
michael@0 15
michael@0 16 var checker = new invokerChecker(EVENT_FOCUS, this.accessible);
michael@0 17 if (aSelectedAfter)
michael@0 18 this.eventSeq.push(checker);
michael@0 19 else
michael@0 20 this.unexpectedEventSeq.push(checker);
michael@0 21
michael@0 22 this.invoke = function focusLink_invoke()
michael@0 23 {
michael@0 24 var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE : 0);
michael@0 25 var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED;
michael@0 26 testStates(aID, expectedStates, 0, unexpectedStates, 0);
michael@0 27
michael@0 28 this.node.focus();
michael@0 29 }
michael@0 30
michael@0 31 this.finalCheck = function focusLink_finalCheck()
michael@0 32 {
michael@0 33 var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0);
michael@0 34 var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0);
michael@0 35 testStates(aID, expectedStates, 0, unexpectedStates, 0);
michael@0 36 }
michael@0 37
michael@0 38 this.getID = function focusLink_getID()
michael@0 39 {
michael@0 40 return "focus hyperlink " + prettyName(aID);
michael@0 41 }
michael@0 42 }

mercurial