toolkit/content/tests/chrome/dialog_dialogfocus.xul

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 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 2
michael@0 3 <dialog buttons="extra2,accept,cancel" onload="loaded()"
michael@0 4 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 5
michael@0 6 <tabbox id="tabbox" hidden="true">
michael@0 7 <tabs>
michael@0 8 <tab id="tab" label="Tab"/>
michael@0 9 </tabs>
michael@0 10 <tabpanels>
michael@0 11 <tabpanel>
michael@0 12 <button id="tabbutton" label="Tab Button"/>
michael@0 13 <button id="tabbutton2" label="Tab Button 2"/>
michael@0 14 </tabpanel>
michael@0 15 </tabpanels>
michael@0 16 </tabbox>
michael@0 17
michael@0 18 <textbox id="textbox-yes" value="textbox-yes" hidden="true"/>
michael@0 19 <textbox id="textbox-no" value="textbox-no" noinitialfocus="true" hidden="true"/>
michael@0 20 <button id="one" label="One"/>
michael@0 21 <button id="two" label="Two" hidden="true"/>
michael@0 22
michael@0 23 <script>
michael@0 24 function loaded()
michael@0 25 {
michael@0 26 if (window.arguments) {
michael@0 27 var step = window.arguments[0];
michael@0 28 switch (step) {
michael@0 29 case 2:
michael@0 30 document.getElementById("one").setAttribute("noinitialfocus", "true");
michael@0 31 break;
michael@0 32 case 3:
michael@0 33 document.getElementById("one").hidden = true;
michael@0 34 case 4:
michael@0 35 document.getElementById("tabbutton2").setAttribute("noinitialfocus", "true");
michael@0 36 case 5:
michael@0 37 document.getElementById("tabbutton").setAttribute("noinitialfocus", "true");
michael@0 38 case 6:
michael@0 39 document.getElementById("tabbox").hidden = false;
michael@0 40 break;
michael@0 41 case 7:
michael@0 42 var two = document.getElementById("two");
michael@0 43 two.hidden = false;
michael@0 44 two.focus();
michael@0 45 break;
michael@0 46 case 8:
michael@0 47 document.getElementById("textbox-yes").hidden = false;
michael@0 48 break;
michael@0 49 case 9:
michael@0 50 document.getElementById("textbox-no").hidden = false;
michael@0 51 break;
michael@0 52 }
michael@0 53 }
michael@0 54 }
michael@0 55 </script>
michael@0 56
michael@0 57 </dialog>

mercurial