1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<window title="Content/chrome integration subwindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="runTests()">\
<!-- We're mainly testing that a) translucent chrome elements cause the plugin to be clipped away and
b) translucent content elements do NOT cause the plugin to be clipped away -->
<stack style="height:100px; width:150px;">
<iframe type="content" style="border:none;" id="f"
src="data:text/html,<embed id='e' type='application/x-test' wmode='window'
style='position:absolute;left:0;top:0;width:100px;height:100px'></embed>
<div style='position:absolute;left:0;top:80px;width:100px;height:10px;background:rgba(0,0,128,0.5)'></div>
<div style='position:absolute;left:0;top:90px;width:100px;height:10px;background:blue'></div>
"/>
<vbox>
<vbox style="height:25px; background:yellow;"/> <!-- plugin should be covered here -->
<vbox style="height:25px; background:rgba(0,128,0,0.5);"/> <!-- plugin should be covered here -->
<vbox style="height:50px;"/> <!-- plugin should be visible here -->
</vbox>
</stack>
<script type="application/javascript">
<![CDATA[
var imports = [ "SimpleTest", "is", "isnot", "ok", "todo" ];
for (var name of imports) {
window[name] = window.opener.wrappedJSObject[name];
}
var plugin;
function waitForPaint() {
if (plugin.getPaintCount() < 1) {
setTimeout(waitForPaint, 0);
return;
}
if (plugin.hasWidget()) {
is(plugin.getClipRegionRectCount(), 1, "plugin clip rect count");
var left = plugin.getEdge(0);
var top = plugin.getEdge(1);
is(plugin.getClipRegionRectEdge(0,0) - left, 0, "plugin clip rect left");
// our two vboxes with backgrounds should cause the top of the plugin to be clipped
is(plugin.getClipRegionRectEdge(0,1) - top, 50, "plugin clip rect top");
is(plugin.getClipRegionRectEdge(0,2) - left, 100, "plugin clip rect right");
// of the two content DIVs, the first one should not cause the plugin to be clipped because
// it's transparent. The second one should cause the plugin to be clipped.
is(plugin.getClipRegionRectEdge(0,3) - top, 90, "plugin clip rect bottom");
} else {
todo(false, "Test only tests windowed plugins");
}
var tester = window.SimpleTest;
window.close();
tester.finish();
}
function runTests() {
plugin = document.getElementById("f").contentDocument.getElementById("e").wrappedJSObject;
waitForPaint();
}
]]>
</script>
</window>
|