1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +<?xml version="1.0"?> 1.5 +<!-- This Source Code Form is subject to the terms of the Mozilla Public 1.6 + - License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 1.8 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.9 + 1.10 +<page id="frame2" 1.11 + style="background-color:red;" 1.12 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.13 +<script type="application/javascript" 1.14 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> 1.15 + 1.16 +<spacer height="10px"/> 1.17 +<caption id="cap2" style="background-color:white;" label=""/> 1.18 +<script class="testbody" type="application/javascript"> 1.19 + 1.20 +// Fire a mouse move event aimed at this window, and check to be 1.21 +// sure the client coords translate from widget to the dom correctly. 1.22 + 1.23 +function runTests() 1.24 +{ 1.25 + synthesizeMouse(document.getElementById("frame2"), 6, 5, { type: "mousemove" }); 1.26 +} 1.27 + 1.28 +function mouseMove(e) { 1.29 + e.stopPropagation(); 1.30 + var element = e.target; 1.31 + var el = document.getElementById("cap2"); 1.32 + el.label = "client: (" + e.clientX + "," + e.clientY + ")"; 1.33 + parent.parent.opener.wrappedJSObject.SimpleTest.is(e.clientX, 6, "mouse event clientX on sub frame 2"); 1.34 + parent.parent.opener.wrappedJSObject.SimpleTest.is(e.clientY, 5, "mouse event clientY on sub frame 2"); 1.35 + parent.parent.opener.wrappedJSObject.SimpleTest.finish(); 1.36 + parent.parent.close(); 1.37 +} 1.38 + 1.39 +window.addEventListener("mousemove",mouseMove, false); 1.40 + 1.41 +</script> 1.42 +</page>