summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/uievents/legacy-domevents-tests/submissions/Microsoft/converted/support/ProcessingInstruction.DOMCharacterDataModified.xml
blob: 4c95ae29dff774960c2d7d69ccfb7c2ecc3056cf (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
<?xml version="1.0"?>
<root>
    <head xmlns="http://www.w3.org/1999/xhtml">
        <title> ProcessingInstruction.data and DOMCharacterDataModified event </title>
    </head>
    <div id="log" xmlns="http://www.w3.org/1999/xhtml"></div>

    <pi><?foo bar?></pi>

    <script type="text/javascript" xmlns="http://www.w3.org/1999/xhtml">
        <![CDATA[
            var EVENT = "DOMCharacterDataModified";
            var TARGET = document.getElementsByTagName('pi')[0].firstChild;
            var TestResult = false;

            TARGET.addEventListener(EVENT, TestEvent, false);
            TARGET.data = "new" + TARGET.data;

            function TestEvent(evt)
            {
                if ((EVENT == evt.type) && (TARGET == evt.target) && ("newbar" == evt.newValue))
                {
                    TestResult = true;
                }
                else
                {
                    TestResult = false;
                }
            }
        ]]>
    </script>
</root>