1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/generic/test/plugin_clipping_helper.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?> 1.6 +<html xmlns="http://www.w3.org/1999/xhtml" title="Test Plugin Clipping"> 1.7 +<head> 1.8 + <style> 1.9 + embed { width:200px; height:200px; display:block; } 1.10 + iframe { border:none; } 1.11 + </style> 1.12 +</head> 1.13 +<body> 1.14 + 1.15 +<!-- Use a XUL element here so we can get its boxObject.screenX/Y --> 1.16 +<hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1" 1.17 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.18 + <hbox style="width:100px;"></hbox><hbox id="h2"/> 1.19 +</hbox> 1.20 + 1.21 +<!-- Non-clipped plugin --> 1.22 +<embed id="p1" type="application/x-test" wmode="window" 1.23 + style="position:absolute; left:300px; top:0"></embed> 1.24 +<!-- Clipped to the top and left by the viewport --> 1.25 +<embed id="p2" type="application/x-test" wmode="window" 1.26 + style="position:absolute; left:-100px; top:-100px;"></embed> 1.27 +<!-- Clipped by a scrollable DIV --> 1.28 +<div style="overflow:auto; width:200px; height:200px; 1.29 + position:absolute; left:100px; top:0;"> 1.30 + <div style="position:relative; left:-100px; top:-100px;"> 1.31 + <embed id="p3" type="application/x-test" wmode="window"></embed> 1.32 + </div> 1.33 +</div> 1.34 +<!-- Clipped by a scrollable DIV *and* to the viewport --> 1.35 +<div style="overflow:auto; width:200px; height:200px; position:absolute; top:100px; left:-100px;"> 1.36 + <div style="position:relative; top:-100px;"> 1.37 + <embed id="p4" type="application/x-test" wmode="window"></embed> 1.38 + </div> 1.39 +</div> 1.40 +<!-- Clipped by an iframe --> 1.41 +<iframe id="f1" style="position:absolute; left:200px; top:200px; width:200px; height:200px;" 1.42 + src="data:text/html,<embed style='position:absolute; left:-100px; top:-100px; width:200px; height:200px;' id='p5' type='application/x-test' wmode='window'>"></iframe> 1.43 + 1.44 +<script src="plugin_clipping_lib.js"></script> 1.45 +<script class="testbody" type="application/javascript"> 1.46 +<![CDATA[ 1.47 + 1.48 +function runTests() { 1.49 + checkClipRegion("p1", [[0, 0, 200, 200]]); 1.50 + checkClipRegion("p2", [[100, 100, 200, 200]]); 1.51 + checkClipRegion("p3", [[100, 100, 200, 200]]); 1.52 + checkClipRegion("p4", [[100, 100, 200, 200]]); 1.53 + checkClipRegionForFrame("f1", "p5", [[100, 100, 200, 200]]); 1.54 + 1.55 + window.opener.SimpleTest.finish(); 1.56 + window.close(); 1.57 +} 1.58 +]]> 1.59 +</script> 1.60 + 1.61 +</body> 1.62 +</html>