OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <style> | |
5 #transformedChild { | |
6 -webkit-transform: rotate3d(0.2, 1, 0, 35grad); | |
7 } | |
8 #absoluteChild { | |
9 position: absolute; | |
10 top: 300px; | |
11 } | |
12 #relativeChild { | |
13 position: relative; | |
14 top: 200px; | |
15 } | |
16 #overhangingContainer { | |
17 height: 10px; | |
18 } | |
19 #overhangingFloatingChild { | |
20 width: 100px; | |
21 float: left; | |
22 } | |
23 #tests { | |
24 font: 10px Ahem; | |
25 } | |
26 </style> | |
27 </head> | |
28 <body> | |
29 <p id="description">This tests verifies the hit test regions given to the compos
itor. It can only be run in DumpRenderTree. | |
30 The outputted rects should cover the hit test regions of all the listed elements
.</p> | |
31 <div id="console"></div> | |
32 | |
33 <div id="tests"> | |
34 <div id="normalFlow"> | |
35 Lorem ipsum | |
36 <span>sum</span>. | |
37 </div> | |
38 <div id="absoluteChildContainer"> | |
39 Lorem ipsum | |
40 <span id="absoluteChild">Absolute child</span> | |
41 </div> | |
42 <div id="relativeChildContainer"> | |
43 Lorem ipsum | |
44 <span id="relativeChild">Relative child</span> | |
45 </div> | |
46 <div id="overhangingContainer"> | |
47 <div id="overhangingFloatingChild">Overhanging float overhanging
float overhanging float overhanging float</div> | |
48 </div> | |
49 <div id="transformedChildContainer"> | |
50 <div id="transformedChild">Transformed</div> | |
51 </div> | |
52 <div> | |
53 <b id="continuation">This b tag | |
54 <div>causes a</div> | |
55 continuation</b> | |
56 </div> | |
57 </div> | |
58 <script> | |
59 if (!window.testRunner) | |
60 return; | |
61 | |
62 window.testRunner.dumpAsText(); | |
63 | |
64 function listener() { } | |
65 | |
66 function log(msg) { | |
67 var span = document.createElement("span"); | |
68 document.getElementById("console").appendChild(span); | |
69 span.innerHTML = msg + '<br />'; | |
70 } | |
71 | |
72 function sortRects(a, b) { | |
73 return a.top - b.top; | |
74 } | |
75 | |
76 function logRects(id) { | |
77 element = document.getElementById(id); | |
78 element.addEventListener('touchstart', listener, false); | |
79 rects = window.internals.touchEventTargetClientRects(document); | |
80 var sortedRects = new Array(); | |
81 for (var i = 0; i < rects.length; ++i) | |
82 sortedRects[i] = rects[i]; | |
83 sortedRects.sort(sortRects); | |
84 for (var i = 0; i < rects.length; ++i) | |
85 log(id + "[" + i + "]: (" + sortedRects[i].left + ", " + sortedR
ects[i].top + ", " + sortedRects[i].width + ", " + sortedRects[i].height + ")"); | |
86 element.removeEventListener('touchstart', listener, false); | |
87 } | |
88 | |
89 logRects("normalFlow"); | |
90 logRects("absoluteChildContainer"); | |
91 logRects("relativeChildContainer"); | |
92 logRects("overhangingContainer"); | |
93 logRects("transformedChildContainer"); | |
94 logRects("continuation"); | |
95 | |
96 var testContainer = document.getElementById("tests"); | |
97 testContainer.parentNode.removeChild(testContainer); | |
98 | |
99 </script> | |
100 </body> | |
101 <!DOCTYPE html> | |
102 <html> | |
103 <head> | |
104 <style> | |
105 #transformedChild { | |
106 -webkit-transform: rotate3d(0.2, 1, 0, 35grad); | |
107 } | |
108 #absoluteChild { | |
109 position: absolute; | |
110 top: 300px; | |
111 } | |
112 #relativeChild { | |
113 position: relative; | |
114 top: 200px; | |
115 } | |
116 #overhangingContainer { | |
117 height: 10px; | |
118 } | |
119 #overhangingFloatingChild { | |
120 width: 100px; | |
121 float: left; | |
122 } | |
123 #tests { | |
124 font: 10px Ahem; | |
125 } | |
126 </style> | |
127 </head> | |
128 <body> | |
129 <p id="description">This tests verifies the hit test regions given to the compos
itor. It can only be run in DumpRenderTree. | |
130 The outputted rects should cover the hit test regions of all the listed elements
.</p> | |
131 <div id="console"></div> | |
132 | |
133 <div id="tests"> | |
134 <div id="normalFlow"> | |
135 Lorem ipsum | |
136 <span>sum</span>. | |
137 </div> | |
138 <div id="absoluteChildContainer"> | |
139 Lorem ipsum | |
140 <span id="absoluteChild">Absolute child</span> | |
141 </div> | |
142 <div id="relativeChildContainer"> | |
143 Lorem ipsum | |
144 <span id="relativeChild">Relative child</span> | |
145 </div> | |
146 <div id="overhangingContainer"> | |
147 <div id="overhangingFloatingChild">Overhanging float overhanging
float overhanging float overhanging float</div> | |
148 </div> | |
149 <div id="transformedChildContainer"> | |
150 <div id="transformedChild">Transformed</div> | |
151 </div> | |
152 <div> | |
153 <b id="continuation">This b tag | |
154 <div>causes a</div> | |
155 continuation</b> | |
156 </div> | |
157 </div> | |
158 <script> | |
159 if (!window.testRunner) | |
160 return; | |
161 | |
162 window.testRunner.dumpAsText(); | |
163 | |
164 function listener() { } | |
165 | |
166 function log(msg) { | |
167 var span = document.createElement("span"); | |
168 document.getElementById("console").appendChild(span); | |
169 span.innerHTML = msg + '<br />'; | |
170 } | |
171 | |
172 function sortRects(a, b) { | |
173 return a.top - b.top; | |
174 } | |
175 | |
176 function logRects(id) { | |
177 element = document.getElementById(id); | |
178 element.addEventListener('touchstart', listener, false); | |
179 rects = window.internals.touchEventTargetClientRects(document); | |
180 var sortedRects = new Array(); | |
181 for (var i = 0; i < rects.length; ++i) | |
182 sortedRects[i] = rects[i]; | |
183 sortedRects.sort(sortRects); | |
184 for (var i = 0; i < rects.length; ++i) | |
185 log(id + "[" + i + "]: (" + sortedRects[i].left + ", " + sortedR
ects[i].top + ", " + sortedRects[i].width + ", " + sortedRects[i].height + ")"); | |
186 element.removeEventListener('touchstart', listener, false); | |
187 } | |
188 | |
189 logRects("normalFlow"); | |
190 logRects("absoluteChildContainer"); | |
191 logRects("relativeChildContainer"); | |
192 logRects("overhangingContainer"); | |
193 logRects("transformedChildContainer"); | |
194 logRects("continuation"); | |
195 | |
196 var testContainer = document.getElementById("tests"); | |
197 testContainer.parentNode.removeChild(testContainer); | |
198 | |
199 </script> | |
200 </body> | |
OLD | NEW |