OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>document.contentType</title> | |
3 <link rel="help" href="http://dom.spec.whatwg.org/#dom-document-contenttype"> | |
4 <script src="../../resources/js-test.js"></script> | |
5 <body> | |
6 <p> | |
7 <iframe data-mt="text/html"></iframe> | |
8 <iframe data-mt="text/xml"></iframe> | |
9 <iframe data-mt="application/xml"></iframe> | |
10 <iframe data-mt="image/svg+xml"></iframe> | |
11 </p> | |
12 <script> | |
13 window.jsTestIsAsync = true; | |
14 | |
15 window.onmessage = function(e) { | |
16 if (e.data) | |
arv (Not doing code reviews)
2014/02/11 16:36:10
Wrong indentation
| |
17 shouldBe('"' + e.data.obtained + '"', '"' + e.data.expected + '" '); | |
18 else | |
19 testFailed("Null message payload"); | |
20 | |
21 if (--expected_messages == 0) | |
22 finishJSTest(); | |
23 }; | |
24 | |
25 var document_contents = '<script xmlns="http://www.w3.org/1999/xhtml">' + | |
arv (Not doing code reviews)
2014/02/11 16:36:10
no underscores in js
| |
26 'parent.postMessage(' + | |
27 '{obtained: document.contentType, expected: "{0}"}, "*");' + | |
28 '<' + '/script>'; | |
29 | |
30 var iframes = document.body.getElementsByTagName('iframe'); | |
arv (Not doing code reviews)
2014/02/11 16:36:10
document.querySelector('iframe') or document.getEl
| |
31 for (var k = 0, f; f = iframes[k]; k++) | |
32 f.src = 'data:' + f.dataset.mt + ',' + | |
33 encodeURIComponent(document_contents.replace('{0}', f.dataset.mt )); | |
34 | |
35 var expected_messages = iframes.length; | |
36 | |
37 </script> | |
OLD | NEW |