Bug 1776680 [wpt PR 34603] - [@container] Test invalidation of font-relative units...
[gecko.git] / dom / events / test / test_unbound_before_in_active_chain.html
blobb62d44bb31ba9e9ae6579bc4880e24558bf638ee
1 <!doctype html>
2 <title>Test for bug 1489139: Unbound generated content in the active chain</title>
3 <script src="/tests/SimpleTest/EventUtils.js"></script>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <style>
6 #target, #target::before {
7 width: 200px;
8 height: 200px;
11 #target::before {
12 content: " ";
13 display: block;
14 background: green;
17 #target:active::before {
18 content: "";
19 background: red;
21 </style>
22 Should see a green square after clicking.
23 <div id="target"></div>
24 <script>
25 SimpleTest.waitForExplicitFinish();
26 onload = function() {
27 let target = document.getElementById("target");
28 requestAnimationFrame(() => {
29 synthesizeMouseAtPoint(100, 100, { type: "mousedown" })
30 ok(target.matches(":active"), "Should have been clicked");
31 requestAnimationFrame(() => {
32 synthesizeMouseAtPoint(100, 100, { type: "mouseup" })
33 ok(!target.matches(':active'), "Should stop matching :active afterwards");
34 SimpleTest.finish();
35 });
36 });
38 </script>