layout/generic/test/plugin_clipping_helper.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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">
     4 <head>
     5   <style>
     6   embed { width:200px; height:200px; display:block; }
     7   iframe { border:none; }
     8   </style>
     9 </head>
    10 <body>
    12 <!-- Use a XUL element here so we can get its boxObject.screenX/Y -->
    13 <hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1"
    14       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    15   <hbox style="width:100px;"></hbox><hbox id="h2"/>
    16 </hbox>
    18 <!-- Non-clipped plugin -->
    19 <embed id="p1" type="application/x-test" wmode="window"
    20        style="position:absolute; left:300px; top:0"></embed>
    21 <!-- Clipped to the top and left by the viewport -->
    22 <embed id="p2" type="application/x-test" wmode="window"
    23        style="position:absolute; left:-100px; top:-100px;"></embed>
    24 <!-- Clipped by a scrollable DIV -->
    25 <div style="overflow:auto; width:200px; height:200px;
    26             position:absolute; left:100px; top:0;">
    27   <div style="position:relative; left:-100px; top:-100px;">
    28     <embed id="p3" type="application/x-test" wmode="window"></embed>
    29   </div>
    30 </div>
    31 <!-- Clipped by a scrollable DIV *and* to the viewport -->
    32 <div style="overflow:auto; width:200px; height:200px; position:absolute; top:100px; left:-100px;">
    33   <div style="position:relative; top:-100px;">
    34     <embed id="p4" type="application/x-test" wmode="window"></embed>
    35   </div>
    36 </div>
    37 <!-- Clipped by an iframe -->
    38 <iframe id="f1" style="position:absolute; left:200px; top:200px; width:200px; height:200px;"
    39         src="data:text/html,&lt;embed style='position:absolute; left:-100px; top:-100px; width:200px; height:200px;' id='p5' type='application/x-test' wmode='window'&gt;"></iframe>
    41 <script src="plugin_clipping_lib.js"></script>
    42 <script class="testbody" type="application/javascript">
    43 <![CDATA[
    45 function runTests() {
    46   checkClipRegion("p1", [[0, 0, 200, 200]]);
    47   checkClipRegion("p2", [[100, 100, 200, 200]]);
    48   checkClipRegion("p3", [[100, 100, 200, 200]]);
    49   checkClipRegion("p4", [[100, 100, 200, 200]]);
    50   checkClipRegionForFrame("f1", "p5", [[100, 100, 200, 200]]);
    52   window.opener.SimpleTest.finish();
    53   window.close();
    54 }
    55 ]]>
    56 </script>
    58 </body>
    59 </html>

mercurial