forked from mirrors/gecko-dev
See https://groups.google.com/forum/#!topic/mozilla.dev.platform/BWUvjERSXUM Differential Revision: https://phabricator.services.mozilla.com/D49285
61 lines
1.8 KiB
HTML
61 lines
1.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
|
<style>
|
|
/* For some reason, test is failing on treeherder if the rules from the UA sheet
|
|
are not overridden. */
|
|
maction > :not(:first-child) { display: inline; }
|
|
</style>
|
|
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
<maction actiontype="toggle" id="maction">
|
|
<mn>1</mn>
|
|
<mn>2</mn>
|
|
</maction>
|
|
</math>
|
|
<pre id="test">
|
|
<script>
|
|
window.is = window.parent.is;
|
|
window.SimpleTest = window.parent.SimpleTest;
|
|
function doTest()
|
|
{
|
|
function doStopPropagation(aEvent) {
|
|
aEvent.stopPropagation();
|
|
}
|
|
|
|
var maction = document.getElementById("maction");
|
|
|
|
synthesizeMouseAtCenter(maction, {});
|
|
|
|
is(maction.getAttribute("selection"), "2",
|
|
"maction's selection attribute isn't 2 by first click");
|
|
|
|
synthesizeMouseAtCenter(maction, {});
|
|
|
|
is(maction.getAttribute("selection"), "1",
|
|
"maction's selection attribute isn't 1 by second click");
|
|
|
|
window.addEventListener("mousedown", doStopPropagation, true);
|
|
window.addEventListener("mouseup", doStopPropagation, true);
|
|
window.addEventListener("click", doStopPropagation, true);
|
|
|
|
synthesizeMouseAtCenter(maction, {});
|
|
|
|
is(maction.getAttribute("selection"), "2",
|
|
"maction's selection attribute isn't 2 by first click called stopPropagation()");
|
|
|
|
synthesizeMouseAtCenter(maction, {});
|
|
|
|
is(maction.getAttribute("selection"), "1",
|
|
"maction's selection attribute isn't 1 by second click called stopPropagation()");
|
|
|
|
window.removeEventListener("mousedown", doStopPropagation, true);
|
|
window.removeEventListener("mouseup", doStopPropagation, true);
|
|
window.removeEventListener("click", doStopPropagation, true);
|
|
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
SimpleTest.waitForFocus(doTest);
|
|
|
|
</script>
|
|
</pre>
|