test_zoom_tree.xhtml (3080B)
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" 4 type="text/css"?> 5 6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 7 title="nsIAccessible::getChildAtPoint and getDeepestChildAtPoint"> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 10 <script src="chrome://mochikit/content/chrome-harness.js" /> 11 12 <script type="application/javascript" 13 src="../treeview.js" /> 14 15 <script type="application/javascript" 16 src="../common.js" /> 17 <script type="application/javascript" 18 src="../events.js" /> 19 <script type="application/javascript" 20 src="../layout.js" /> 21 <script type="application/javascript" 22 src="../browser.js" /> 23 24 <script type="application/javascript"> 25 <![CDATA[ 26 function doTest() 27 { 28 var tabDocument = currentTabDocument(); 29 var tabWindow = currentTabWindow(); 30 31 var tree = tabDocument.getElementById("tree"); 32 var treecols = tabDocument.getElementById("treecols"); 33 var treecol1 = tabDocument.getElementById("treecol1"); 34 35 // tree columns 36 hitTest(tree, treecols, treecol1); 37 38 // tree rows and cells 39 var treeRect = tree.treeBody.getBoundingClientRect(); 40 var rect = tree.getCoordsForCellItem(1, tree.columns[0], "cell"); 41 42 var treeAcc = getAccessible(tree, [nsIAccessibleTable]); 43 var cellAcc = treeAcc.getCellAt(1, 0); 44 var rowAcc = cellAcc.parent; 45 46 var cssX = rect.x + treeRect.x; 47 var cssY = rect.y + treeRect.y; 48 var [x, y] = CSSToDevicePixels(tabWindow, cssX, cssY); 49 50 testChildAtPoint(treeAcc, x, y, rowAcc, cellAcc); 51 testChildAtPoint(rowAcc, x, y, cellAcc, cellAcc); 52 53 // do zoom 54 zoomDocument(tabDocument, 1.5); 55 56 // tree columns 57 hitTest(tree, treecols, treecol1); 58 59 // tree rows and cells 60 [x, y] = CSSToDevicePixels(tabWindow, cssX, cssY); 61 testChildAtPoint(treeAcc, x, y, rowAcc, cellAcc); 62 testChildAtPoint(rowAcc, x, y, cellAcc, cellAcc); 63 64 closeBrowserWindow(); 65 SimpleTest.finish(); 66 } 67 68 function prepareTest() 69 { 70 var tabDocument = currentTabDocument(); 71 var tree = tabDocument.getElementById("tree"); 72 loadXULTreeAndDoTest(doTest, tree, new nsTableTreeView(5)); 73 } 74 75 SimpleTest.waitForExplicitFinish(); 76 openBrowserWindow(prepareTest, 77 getRootDirectory(window.location.href) + "zoom_tree.xhtml", 78 { left: 100, top: 100 }); 79 ]]> 80 </script> 81 82 <hbox flex="1" style="overflow: auto;"> 83 <body xmlns="http://www.w3.org/1999/xhtml"> 84 <a target="_blank" 85 href="https://bugzilla.mozilla.org/show_bug.cgi?id=471493" 86 title=" crash [@ nsPropertyTable::GetPropertyInternal]"> 87 Mozilla Bug 471493 88 </a><br/> 89 <p id="display"></p> 90 <div id="content" style="display: none"> 91 </div> 92 <pre id="test"> 93 </pre> 94 </body> 95 </hbox> 96 97 </window>