summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm
blob: a3ab4f57d40d39e9c5ecaaab8204248e632b1bbf (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>
<html>
    <head>
        <title id="desc">HTML5 Selection: Call selectAllChildren() where the parameter is a text node</title>
        <script type="text/javascript">
            function RunTest()
            {
                try
                {
                    var selection = window.getSelection();
                    var div1 = document.getElementById("div1");
                    selection.selectAllChildren(div1.firstChild);
                    
                    if ("" == selection.toString())
                    {
                        document.getElementById("testresult").firstChild.data = "PASS";
                    }
                }
                catch (ex)
                {
                    document.getElementById("testresult").firstChild.data = "FAIL";
                }
            }
        </script>
    </head>
    <body onload="RunTest();">
        <div id="div1">Call selectAllChildren() where the parameter is a text node</div>
        <p>Test passes if the word "PASS" appears below.</p>
        <div>Test result: </div>
        <div id="testresult">FAIL</div>
    </body>
</html>