layout/base/tests/chrome/test_bug708062.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/tests/chrome/test_bug708062.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=708062
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 708062</title>
    1.11 +  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
    1.13 +</head>
    1.14 +<body onload="doTest()">
    1.15 +
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=708062">Mozilla Bug 708062</a>
    1.17 +<p id="display"></p>
    1.18 +<div id="content" style="display: none">
    1.19 +
    1.20 +</div>
    1.21 +<iframe id="f" style="width:100px;"
    1.22 +        src="data:text/html,A<div id='d' style='position:fixed;width:170px;top:0;right:0;height:1px;background:yellow;'>"></iframe>
    1.23 +<pre id="test">
    1.24 +
    1.25 +<script>
    1.26 +function isBoundingClientRect(e, r, msg) {
    1.27 +  var BCR = e.getBoundingClientRect();
    1.28 +  is([BCR.left, BCR.top, BCR.right, BCR.bottom].join(','), r, msg);
    1.29 +}
    1.30 +
    1.31 +function doTest() {
    1.32 +  var f = document.getElementById('f');
    1.33 +
    1.34 +  var navigator1 = f.contentWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation);
    1.35 +  var docShell = navigator1.QueryInterface(Components.interfaces.nsIDocShell);
    1.36 +  var docviewer = docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
    1.37 +
    1.38 +  var d = f.contentDocument.getElementById('d');
    1.39 +
    1.40 +  isBoundingClientRect(d, "-70,0,100,1", "initial rect");
    1.41 +  docviewer.fullZoom = 2;
    1.42 +  isBoundingClientRect(d, "-120,0,50,1", "after zooming in");
    1.43 +  docviewer.fullZoom = 1;
    1.44 +  isBoundingClientRect(d, "-70,0,100,1", "after zooming back out");
    1.45 +  SimpleTest.finish();
    1.46 +}
    1.47 +</script>
    1.48 +</pre>
    1.49 +</body>
    1.50 +</html>

mercurial