file_first_focusable_in_scope.xhtml (1521B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 3 4 <window onload="start()" 5 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 6 xmlns:html="http://www.w3.org/1999/xhtml"> 7 8 <linkset> 9 <html:link rel="localization" href="browser/places.ftl"/> 10 </linkset> 11 <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> 12 13 <hbox id="sidebar-search-container" align="center"> 14 <html:input type="search" id="search-box" 15 data-l10n-id="places-bookmarks-search" 16 data-l10n-attrs="placeholder" 17 aria-controls="bookmarks-view" 18 oncommand="searchBookmarks(this.value);"/> 19 </hbox> 20 21 <tree seltype="single" flex="1"> 22 <treecols> 23 <treecol flex="1"/> 24 <treecol flex="1"/> 25 </treecols> 26 <treechildren> 27 <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem> 28 </treechildren> 29 </tree> 30 31 <script type="application/javascript"> 32 <![CDATA[ 33 34 function is(l, r, n) { window.arguments[0].SimpleTest.is(l,r,n); } 35 function ok(v, n) { window.arguments[0].SimpleTest.ok(v,n); } 36 37 function done() 38 { 39 window.close(); 40 window.arguments[0].SimpleTest.finish(); 41 } 42 43 function start() 44 { 45 is(document.activeElement, document.documentElement, "initial focus is the document element"); 46 synthesizeKey("KEY_F6"); 47 is(document.activeElement, document.getElementById("search-box"), "F6 moves to the first focusable element"); 48 done(); 49 } 50 51 ]]></script> 52 53 </window>