layout/mathml/tests/test_bug706406.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial