1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/mathml/tests/test_bug706406.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,71 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=706406 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 706406</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 +</head> 1.15 +<body> 1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=706406">Mozilla Bug 706406</a> 1.17 +<p id="display"></p> 1.18 +<math xmlns="http://www.w3.org/1998/Math/MathML"> 1.19 + <maction actiontype="toggle" id="maction"> 1.20 + <mn>1</mn> 1.21 + <mn>2</mn> 1.22 + </maction> 1.23 +</math> 1.24 +<pre id="test"> 1.25 +<script type="application/javascript"> 1.26 + 1.27 +/** Test for Bug 706406 **/ 1.28 + 1.29 +function doTest() 1.30 +{ 1.31 + function doStopPropagation(aEvent) { 1.32 + aEvent.stopPropagation(); 1.33 + } 1.34 + 1.35 + var maction = document.getElementById("maction"); 1.36 + 1.37 + synthesizeMouseAtCenter(maction, {}); 1.38 + 1.39 + is(maction.getAttribute("selection"), "2", 1.40 + "maction's selection attribute isn't 2 by first click"); 1.41 + 1.42 + synthesizeMouseAtCenter(maction, {}); 1.43 + 1.44 + is(maction.getAttribute("selection"), "1", 1.45 + "maction's selection attribute isn't 1 by second click"); 1.46 + 1.47 + window.addEventListener("mousedown", doStopPropagation, true); 1.48 + window.addEventListener("mouseup", doStopPropagation, true); 1.49 + window.addEventListener("click", doStopPropagation, true); 1.50 + 1.51 + synthesizeMouseAtCenter(maction, {}); 1.52 + 1.53 + is(maction.getAttribute("selection"), "2", 1.54 + "maction's selection attribute isn't 2 by first click called stopPropagation()"); 1.55 + 1.56 + synthesizeMouseAtCenter(maction, {}); 1.57 + 1.58 + is(maction.getAttribute("selection"), "1", 1.59 + "maction's selection attribute isn't 1 by second click called stopPropagation()"); 1.60 + 1.61 + window.removeEventListener("mousedown", doStopPropagation, true); 1.62 + window.removeEventListener("mouseup", doStopPropagation, true); 1.63 + window.removeEventListener("click", doStopPropagation, true); 1.64 + 1.65 + SimpleTest.finish(); 1.66 +} 1.67 + 1.68 +SimpleTest.waitForExplicitFinish(); 1.69 +SimpleTest.waitForFocus(doTest); 1.70 + 1.71 +</script> 1.72 +</pre> 1.73 +</body> 1.74 +</html>