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