summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/resource-locations-in-created-html-document.html
blob: 4dc08d4d17e1c227f3eedd8b594d5570f7a2c8d8 (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
<html>
<head>
    <script>
    function runTest() {
        if (window.testRunner)
            testRunner.dumpAsText();
            
        var htmlDoc = document.implementation.createHTMLDocument('');
        
        htmlDoc.open();
        htmlDoc.write('<html><img id="theImage" src="/test"></html>');

        var path = htmlDoc.getElementById('theImage').src;

        if (path == 'file:///test')
            document.getElementById('result').innerHTML = 'SUCCESS';
        else if (/^file:\/\/\/[C-Z]:\/test$/.test(path))  // MS Windows.
            document.getElementById('result').innerHTML = 'SUCCESS';
    }
    </script>
</head>
<body onload="runTest()">
    This tests that paths in documents created using document.implementation.createHTMLDocument are returned correctly.
    <div id="result">FAILURE</div>
</body>
</html>