Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=706406 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 706406</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=706406">Mozilla Bug 706406</a> |
michael@0 | 14 | <p id="display"></p> |
michael@0 | 15 | <math xmlns="http://www.w3.org/1998/Math/MathML"> |
michael@0 | 16 | <maction actiontype="toggle" id="maction"> |
michael@0 | 17 | <mn>1</mn> |
michael@0 | 18 | <mn>2</mn> |
michael@0 | 19 | </maction> |
michael@0 | 20 | </math> |
michael@0 | 21 | <pre id="test"> |
michael@0 | 22 | <script type="application/javascript"> |
michael@0 | 23 | |
michael@0 | 24 | /** Test for Bug 706406 **/ |
michael@0 | 25 | |
michael@0 | 26 | function doTest() |
michael@0 | 27 | { |
michael@0 | 28 | function doStopPropagation(aEvent) { |
michael@0 | 29 | aEvent.stopPropagation(); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | var maction = document.getElementById("maction"); |
michael@0 | 33 | |
michael@0 | 34 | synthesizeMouseAtCenter(maction, {}); |
michael@0 | 35 | |
michael@0 | 36 | is(maction.getAttribute("selection"), "2", |
michael@0 | 37 | "maction's selection attribute isn't 2 by first click"); |
michael@0 | 38 | |
michael@0 | 39 | synthesizeMouseAtCenter(maction, {}); |
michael@0 | 40 | |
michael@0 | 41 | is(maction.getAttribute("selection"), "1", |
michael@0 | 42 | "maction's selection attribute isn't 1 by second click"); |
michael@0 | 43 | |
michael@0 | 44 | window.addEventListener("mousedown", doStopPropagation, true); |
michael@0 | 45 | window.addEventListener("mouseup", doStopPropagation, true); |
michael@0 | 46 | window.addEventListener("click", doStopPropagation, true); |
michael@0 | 47 | |
michael@0 | 48 | synthesizeMouseAtCenter(maction, {}); |
michael@0 | 49 | |
michael@0 | 50 | is(maction.getAttribute("selection"), "2", |
michael@0 | 51 | "maction's selection attribute isn't 2 by first click called stopPropagation()"); |
michael@0 | 52 | |
michael@0 | 53 | synthesizeMouseAtCenter(maction, {}); |
michael@0 | 54 | |
michael@0 | 55 | is(maction.getAttribute("selection"), "1", |
michael@0 | 56 | "maction's selection attribute isn't 1 by second click called stopPropagation()"); |
michael@0 | 57 | |
michael@0 | 58 | window.removeEventListener("mousedown", doStopPropagation, true); |
michael@0 | 59 | window.removeEventListener("mouseup", doStopPropagation, true); |
michael@0 | 60 | window.removeEventListener("click", doStopPropagation, true); |
michael@0 | 61 | |
michael@0 | 62 | SimpleTest.finish(); |
michael@0 | 63 | } |
michael@0 | 64 | |
michael@0 | 65 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 66 | SimpleTest.waitForFocus(doTest); |
michael@0 | 67 | |
michael@0 | 68 | </script> |
michael@0 | 69 | </pre> |
michael@0 | 70 | </body> |
michael@0 | 71 | </html> |