dom/tests/mochitest/chrome/test_focus_switchbinding.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     5 <window title="Focus Switch Binding Test"
     6         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     8   <script type="application/javascript"
     9           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    11 <script>
    12 SimpleTest.waitForExplicitFinish();
    14 function switchBinding()
    15 {
    16   $("box").style.MozBinding = "url(#second)";
    17 }
    18 </script>
    20 <xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl"
    21               xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    22   <xbl:binding id="first">
    23     <xbl:content>
    24       <xul:button label="First"/>
    25     </xbl:content>
    26     <xbl:implementation>
    27       <xbl:constructor>
    28         document.getAnonymousNodes(this)[0].focus();
    29         setTimeout(switchBinding, 0);
    30       </xbl:constructor>
    31     </xbl:implementation>
    32   </xbl:binding>
    33   <xbl:binding id="second">
    34     <xbl:content>
    35       <xul:button label="Second"/>
    36     </xbl:content>
    37     <xbl:implementation>
    38       <xbl:constructor>
    39         $("after").focus();
    40       </xbl:constructor>
    41     </xbl:implementation>
    42   </xbl:binding>
    43 </xbl:bindings>
    45 <box id="box" style="-moz-binding: url(#first)"/>
    46 <button id="after" label="After" onfocus="is(document.activeElement, $('after'), 'focus set'); SimpleTest.finish()"/>
    48 <body xmlns="http://www.w3.org/1999/xhtml">
    49 <p id="display">
    50 </p>
    51 <div id="content" style="display: none">
    52 </div>
    53 <pre id="test">
    54 </pre>
    55 </body>
    57 </window>

mercurial