layout/base/tests/chrome/dialog_with_positioning_window.xul

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.

michael@0 1 <?xml version="1.0" encoding="UTF-8" ?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
michael@0 3 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
michael@0 4 onload="setTimeout(runTest, 0)">
michael@0 5 <vbox>
michael@0 6 <text value="powered by example.com" style="padding: 16px;"/>
michael@0 7 </vbox>
michael@0 8 <hbox id="t" style="position: fixed; right: 16px; bottom: 16px;">
michael@0 9 <button label="OK"/>
michael@0 10 </hbox>
michael@0 11 <script><![CDATA[
michael@0 12 var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
michael@0 13 var SpecialPowers = window.opener.wrappedJSObject.SpecialPowers;
michael@0 14 var is = window.opener.wrappedJSObject.is;
michael@0 15 var ok = window.opener.wrappedJSObject.ok;
michael@0 16
michael@0 17 // We run this off a setTimeout from onload, because the XUL window
michael@0 18 // only does its intrinsic-height layout after the load event has
michael@0 19 // finished
michael@0 20 function runTest() {
michael@0 21 var t = document.getElementById("t");
michael@0 22 var tBottom = t.getBoundingClientRect().bottom;
michael@0 23 is(tBottom, document.documentElement.getBoundingClientRect().bottom - 16,
michael@0 24 "check fixed-pos element t bottom positioned correctly");
michael@0 25 ok(tBottom < 200, "fixed-pos element t bottom must be sane, less than 200 (got " + tBottom + ")");
michael@0 26 window.close();
michael@0 27 SimpleTest.finish();
michael@0 28 }
michael@0 29 ]]></script>
michael@0 30 </window>

mercurial