|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?> |
|
3 <html xmlns="http://www.w3.org/1999/xhtml" title="Test Plugin Clipping: Dynamic Tests"> |
|
4 <head> |
|
5 <style> |
|
6 embed { width:300px; height:200px; display:block; } |
|
7 </style> |
|
8 </head> |
|
9 <body> |
|
10 |
|
11 <!-- Use a XUL element here so we can get its boxObject.screenX/Y --> |
|
12 <hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1" |
|
13 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
14 <hbox style="width:100px;"></hbox><hbox id="h2"/> |
|
15 </hbox> |
|
16 |
|
17 <div id="d1" style="width:200px; overflow:hidden; position:absolute; top:0; left:0;"> |
|
18 <embed id="p1" type="application/x-test" wmode="window" style="position:relative"></embed> |
|
19 </div> |
|
20 <div id="d2" style="width:200px; height:200px; overflow:hidden; position:absolute; top:100px; left:0;"> |
|
21 <embed id="p2" type="application/x-test" wmode="window"></embed> |
|
22 <div id="zbox" style="position:absolute; left:50px; top:50px; width:100px; height:100px; background:yellow;"> |
|
23 </div> |
|
24 </div> |
|
25 |
|
26 <div id="scroll" |
|
27 style="position:absolute; top:0; left:0; width:300px; height:400px; overflow:scroll;"> |
|
28 <div id="sbox" |
|
29 style="margin-top:350px; margin-left:50px; margin-bottom:1000px; width:100px; height:100px; background:blue;"></div> |
|
30 </div> |
|
31 |
|
32 <script src="plugin_clipping_lib.js"></script> |
|
33 <script class="testbody" type="application/javascript"> |
|
34 <![CDATA[ |
|
35 var scroll = document.getElementById("scroll"); |
|
36 var zbox = document.getElementById("zbox"); |
|
37 var sbox = document.getElementById("sbox"); |
|
38 var p1 = document.getElementById("p1"); |
|
39 var d2 = document.getElementById("d2"); |
|
40 |
|
41 function runTests() { |
|
42 |
|
43 checkClipRegion("p1", [[0, 0, 200, 100]]); |
|
44 checkClipRegion("p2", [[0, 0, 200, 50], [0, 50, 50, 150], [150, 50, 200, 150], [0, 150, 200, 200]]); |
|
45 |
|
46 scroll.scrollTop = 150; |
|
47 |
|
48 // A non-zero timeout is needed on X11 (unless an XSync could be performed) |
|
49 // to delay an OOP plugin's X requests enough so that the X server processes |
|
50 // them after the parent processes requests (for the changes above). |
|
51 setTimeout(part2, 1000); |
|
52 } |
|
53 |
|
54 function part2() { |
|
55 checkClipRegion("p2", [[0, 0, 200, 50], [0, 50, 50, 200], [150, 50, 200, 200]]); |
|
56 |
|
57 zbox.style.zIndex = -1; |
|
58 |
|
59 setTimeout(part3, 1000); |
|
60 } |
|
61 |
|
62 function part3() { |
|
63 checkClipRegion("p2", [[0, 0, 200, 100], [0, 100, 50, 200], [150, 100, 200, 200]]); |
|
64 |
|
65 sbox.style.background = ""; |
|
66 |
|
67 setTimeout(part4, 1000); |
|
68 } |
|
69 |
|
70 function part4() { |
|
71 checkClipRegion("p2", [[0, 0, 200, 200]]); |
|
72 |
|
73 p1.style.zIndex = 1; |
|
74 |
|
75 setTimeout(part5, 1000); |
|
76 } |
|
77 |
|
78 function part5() { |
|
79 checkClipRegion("p1", [[0, 0, 200, 200]]); |
|
80 checkClipRegion("p2", [[0, 100, 200, 200]]); |
|
81 |
|
82 // Test subpixel stuff |
|
83 p1.style.zIndex = -1; |
|
84 zbox.style.zIndex = 1; |
|
85 zbox.style.top = "50.3px;" |
|
86 d2.style.top = "100.3px"; |
|
87 |
|
88 setTimeout(done, 1000); |
|
89 } |
|
90 |
|
91 function done() { |
|
92 checkClipRegionNoBounds("p2", [[0, 0, 200, 50], [0, 50, 50, 150], [150, 50, 200, 150], [0, 150, 200, 200]]); |
|
93 |
|
94 window.opener.SimpleTest.finish(); |
|
95 window.close(); |
|
96 } |
|
97 |
|
98 ]]> |
|
99 </script> |
|
100 |
|
101 </body> |
|
102 </html> |