toolkit/content/tests/chrome/window_subframe_origin.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.

     1 <?xml version="1.0"?>
     2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     3    - License, v. 2.0. If a copy of the MPL was not distributed with this
     4    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     5 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     7 <window id="window" title="Subframe Origin Tests"
     8         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9 <script type="application/javascript"
    10         src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
    12 <iframe
    13   style="margin-left:20px; margin-top:20px; min-height:300px; max-width:300px; max-height:300px; border:solid 1px black;"
    14   src="frame_subframe_origin_subframe1.xul"></iframe>
    15 <caption id="parentcap" label=""/>
    17 <script>
    19 // Fire a mouse move event aimed at this window, and check to be
    20 // sure the client coords translate from widget to the dom correctly.
    22 function runTests()
    23 {
    24   synthesizeMouse(document.getElementById("window"), 1, 2, { type: "mousemove" });
    25 }
    27 window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window);
    29 function mouseMove(e) {
    30   var element = e.target;
    31   var el = document.getElementById("parentcap");
    32   el.label = "client: (" + e.clientX + "," + e.clientY + ")";
    33   window.opener.wrappedJSObject.SimpleTest.is(e.clientX, 1, "mouse event clientX");
    34   window.opener.wrappedJSObject.SimpleTest.is(e.clientY, 2, "mouse event clientY");
    35   // fire the next test on the sub frame
    36   frames[0].runTests();
    37 }
    39 window.addEventListener("mousemove",mouseMove, false);
    41 </script>
    42 </window>

mercurial