summaryrefslogtreecommitdiffstats
path: root/layout/svg/tests/test_hover_near_text.html
blob: 2bf808e61a71a9407c64f41cf755a3501c818352 (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
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
        <title>Test mouse hover near text element inside svg element with viewBox attribute</title>
        <script src="/tests/SimpleTest/SimpleTest.js"></script>
    </head>
    <body style="margin:0">
        <div>
            <svg viewBox="-1 -1 2 2" width="300" height="300">
                <text style="font-size:0.1px" onmouseover="this.setAttribute('fill', 'red')">Hi</text>
            </svg>
        </div>
        <p>
            <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1519144">Mozilla Bug 1519144</a>
        </p>
        <script type="application/javascript">
            let utils = SpecialPowers.getDOMWindowUtils(window);
            utils.sendMouseEvent('mousemove', 155, 125, 0, 0, 0); //hover above the text
            utils.sendMouseEvent('mousemove', 125, 155, 0, 0, 0); //hover to the left of the text
            requestIdleCallback(() => {
                ok(!document.getElementsByTagName('text')[0].hasAttribute('fill'),
                   'Text element should not receive an event');
                SimpleTest.finish();
            });
            SimpleTest.waitForExplicitFinish()
        </script>
    </body>
</html>