Sat, 03 Jan 2015 20:18:00 +0100
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 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>nsIAccessible actions testing on HTML links (HTML:a)</title> |
michael@0 | 5 | |
michael@0 | 6 | <link rel="stylesheet" type="text/css" |
michael@0 | 7 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../events.js"></script> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../actions.js"></script> |
michael@0 | 18 | |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | function getAnchorTargetDocumentAcc() |
michael@0 | 21 | { |
michael@0 | 22 | var thisTabDocAcc = getTabDocAccessible(); |
michael@0 | 23 | var thisDocTabPanelAcc = thisTabDocAcc.parent.parent; |
michael@0 | 24 | var tabPanelsAcc = thisDocTabPanelAcc.parent; |
michael@0 | 25 | var newDocTabPanelAcc = tabPanelsAcc.lastChild.firstChild; |
michael@0 | 26 | return newDocTabPanelAcc.firstChild; |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | function linkChecker(aID) |
michael@0 | 30 | { |
michael@0 | 31 | this.type = EVENT_DOCUMENT_LOAD_COMPLETE; |
michael@0 | 32 | this.__defineGetter__("target", getAnchorTargetDocumentAcc); |
michael@0 | 33 | |
michael@0 | 34 | this.check = function linkChecker_check() |
michael@0 | 35 | { |
michael@0 | 36 | var anchorTargetWindow = |
michael@0 | 37 | getAccessible(getAnchorTargetDocumentAcc(), [nsIAccessibleDocument]). |
michael@0 | 38 | window; |
michael@0 | 39 | anchorTargetWindow.close(); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | this.getID = function linkChecker_getID() |
michael@0 | 43 | { |
michael@0 | 44 | return "link '" + aID + "' states check "; |
michael@0 | 45 | } |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | //gA11yEventDumpID = "eventdump"; // debug stuff |
michael@0 | 49 | gA11yEventDumpToConsole = true; |
michael@0 | 50 | |
michael@0 | 51 | function doTest() |
michael@0 | 52 | { |
michael@0 | 53 | var actionsArray = [ |
michael@0 | 54 | { |
michael@0 | 55 | ID: "link1", |
michael@0 | 56 | actionName: "jump", |
michael@0 | 57 | events: CLICK_EVENTS, |
michael@0 | 58 | eventSeq: [ |
michael@0 | 59 | new linkChecker("link1") |
michael@0 | 60 | ] |
michael@0 | 61 | }, |
michael@0 | 62 | { |
michael@0 | 63 | ID: "img1", |
michael@0 | 64 | targetID: "link1", |
michael@0 | 65 | actionName: "jump", |
michael@0 | 66 | events: CLICK_EVENTS, |
michael@0 | 67 | eventSeq: [ |
michael@0 | 68 | new linkChecker("link1") |
michael@0 | 69 | ] |
michael@0 | 70 | }, |
michael@0 | 71 | { |
michael@0 | 72 | ID: "link2", |
michael@0 | 73 | actionName: "click", |
michael@0 | 74 | events: CLICK_EVENTS |
michael@0 | 75 | }, |
michael@0 | 76 | { |
michael@0 | 77 | ID: "img2", |
michael@0 | 78 | targetID: "link2", |
michael@0 | 79 | actionName: "jump", |
michael@0 | 80 | events: CLICK_EVENTS |
michael@0 | 81 | }, |
michael@0 | 82 | { |
michael@0 | 83 | ID: "link3", |
michael@0 | 84 | actionName: "click", |
michael@0 | 85 | events: CLICK_EVENTS |
michael@0 | 86 | }, |
michael@0 | 87 | { |
michael@0 | 88 | ID: "img3", |
michael@0 | 89 | targetID: "link3", |
michael@0 | 90 | actionName: "jump", |
michael@0 | 91 | events: CLICK_EVENTS |
michael@0 | 92 | }, |
michael@0 | 93 | { |
michael@0 | 94 | ID: "link4", |
michael@0 | 95 | actionName: "click", |
michael@0 | 96 | events: CLICK_EVENTS |
michael@0 | 97 | }, |
michael@0 | 98 | { |
michael@0 | 99 | ID: "img4", |
michael@0 | 100 | targetID: "link4", |
michael@0 | 101 | actionName: "jump", |
michael@0 | 102 | events: CLICK_EVENTS |
michael@0 | 103 | } |
michael@0 | 104 | ]; |
michael@0 | 105 | testActions(actionsArray); |
michael@0 | 106 | } |
michael@0 | 107 | |
michael@0 | 108 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 109 | addA11yLoadEvent(doTest); |
michael@0 | 110 | </script> |
michael@0 | 111 | </head> |
michael@0 | 112 | |
michael@0 | 113 | <body> |
michael@0 | 114 | |
michael@0 | 115 | <a target="_blank" |
michael@0 | 116 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=423409" |
michael@0 | 117 | title="Expose click action if mouseup and mousedown are registered"> |
michael@0 | 118 | Mozilla Bug 423409 |
michael@0 | 119 | </a> |
michael@0 | 120 | <p id="display"></p> |
michael@0 | 121 | <div id="content" style="display: none"></div> |
michael@0 | 122 | <pre id="test"> |
michael@0 | 123 | </pre> |
michael@0 | 124 | |
michael@0 | 125 | <a href="about:mozilla" id="link1" target="_blank"> |
michael@0 | 126 | <img src="../moz.png" id="img1"> |
michael@0 | 127 | </a> |
michael@0 | 128 | <a id="link2" onmousedown=""> |
michael@0 | 129 | <img src="../moz.png" id="img2"> |
michael@0 | 130 | </a> |
michael@0 | 131 | <a id="link3" onclick=""> |
michael@0 | 132 | <img src="../moz.png" id="img3"> |
michael@0 | 133 | </a> |
michael@0 | 134 | <a id="link4" onmouseup=""> |
michael@0 | 135 | <img src="../moz.png" id="img4"> |
michael@0 | 136 | </a> |
michael@0 | 137 | |
michael@0 | 138 | <div id="eventdump"></div> |
michael@0 | 139 | </body> |
michael@0 | 140 | </html> |