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 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
michael@0 | 4 | <!-- |
michael@0 | 5 | https://bugzilla.mozilla.org/show_bug.cgi?id=792324 |
michael@0 | 6 | --> |
michael@0 | 7 | <window title="Mozilla Bug 792324" |
michael@0 | 8 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 9 | |
michael@0 | 10 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
michael@0 | 11 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> |
michael@0 | 12 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792324">Mozilla Bug 792324</a> |
michael@0 | 14 | |
michael@0 | 15 | <p id="display"></p> |
michael@0 | 16 | <div id="content" style="display: none"> |
michael@0 | 17 | </div> |
michael@0 | 18 | </body> |
michael@0 | 19 | |
michael@0 | 20 | <panel id="panel-1"> |
michael@0 | 21 | <button label="just a normal button"/> |
michael@0 | 22 | <button id="button-1" |
michael@0 | 23 | accesskey="X" |
michael@0 | 24 | oncommand="clicked(event)" |
michael@0 | 25 | label="Button in panel 1" |
michael@0 | 26 | /> |
michael@0 | 27 | </panel> |
michael@0 | 28 | |
michael@0 | 29 | <panel id="panel-2"> |
michael@0 | 30 | <button label="just a normal button"/> |
michael@0 | 31 | <button id="button-2" |
michael@0 | 32 | accesskey="X" |
michael@0 | 33 | oncommand="clicked(event)" |
michael@0 | 34 | label="Button in panel 2" |
michael@0 | 35 | /> |
michael@0 | 36 | </panel> |
michael@0 | 37 | |
michael@0 | 38 | <script class="testbody" type="application/javascript;version=1.7"><![CDATA[ |
michael@0 | 39 | |
michael@0 | 40 | /** Test for Bug 792324 **/ |
michael@0 | 41 | let after_click; |
michael@0 | 42 | |
michael@0 | 43 | function clicked(event) { |
michael@0 | 44 | after_click(event); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | function checkAccessKeyOnPanel(panelid, buttonid, cb) { |
michael@0 | 48 | let panel = document.getElementById(panelid); |
michael@0 | 49 | panel.addEventListener("popupshown", function onpopupshown() { |
michael@0 | 50 | panel.removeEventListener("popupshown", onpopupshown); |
michael@0 | 51 | panel.firstChild.focus(); |
michael@0 | 52 | after_click = function(event) { |
michael@0 | 53 | is(event.target.id, buttonid, "Accesskey was directed to the button '" + buttonid + "'"); |
michael@0 | 54 | panel.hidePopup(); |
michael@0 | 55 | cb(); |
michael@0 | 56 | } |
michael@0 | 57 | synthesizeKey("X", {}); |
michael@0 | 58 | }); |
michael@0 | 59 | panel.openPopup(null, "", 100, 100, false, false); |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | function test() { |
michael@0 | 63 | checkAccessKeyOnPanel("panel-1", "button-1", function() { |
michael@0 | 64 | checkAccessKeyOnPanel("panel-2", "button-2", function() { |
michael@0 | 65 | SimpleTest.finish(); |
michael@0 | 66 | }); |
michael@0 | 67 | }); |
michael@0 | 68 | } |
michael@0 | 69 | |
michael@0 | 70 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 71 | SimpleTest.waitForFocus(test, window); |
michael@0 | 72 | |
michael@0 | 73 | ]]></script> |
michael@0 | 74 | |
michael@0 | 75 | </window> |