summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_click_on_reframed_generated_text.html
blob: e8c8b092d64fe798ff49872bbe98923bb9a8d7fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!doctype html>
<title>Test for bug 1497524: Unbound generated content in the active chain</title>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
#target::before {
  content: "X";
  color: green;
}
</style>
Should get a click event when clicking on the X below.
<div id="target"></div>
<script>
SimpleTest.waitForExplicitFinish();
let target = document.getElementById("target");

target.addEventListener("mousedown", () => target.style.display = "inline");
target.addEventListener("mouseup", () => target.style.display = "block");
target.addEventListener("click", () => {
  ok(true, "Got click event");
  SimpleTest.finish();
});

onload = function() {
  requestAnimationFrame(() => {
    synthesizeMouseAtCenter(target, { type: "mousedown" })
    requestAnimationFrame(() => {
      synthesizeMouseAtCenter(target, { type: "mouseup" })
    });
  });
}
</script>