| <html> |
| <head> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| function found(text, regexString) |
| { |
| var matches = text.match(new RegExp(regexString, 'g')); |
| if (matches && matches.length === 1) |
| return 'PASS'; |
| else |
| return 'FAIL'; |
| } |
| |
| function testSection(text, name) { |
| return name + ': ' + |
| found(text, '<span class="webkit-html-tag"><' + name + '>') + ' ' + |
| found(text, '<td class="webkit-line-content"><test' + name + '>') + ' ' + |
| found(text, '<span class="webkit-html-tag"></' + name + '>') + '\n'; |
| } |
| |
| function report(frame) |
| { |
| var result = frame.contentDocument.documentElement.innerHTML; |
| var resultText = ''; |
| |
| resultText += testSection(result, 'script'); |
| resultText += testSection(result, 'style'); |
| resultText += testSection(result, 'xmp'); |
| resultText += testSection(result, 'textarea'); |
| |
| if (window.testRunner) { |
| document.open(); |
| document.write(resultText); |
| document.close(); |
| testRunner.notifyDone(); |
| } else { |
| document.getElementById("result").textContent = resultText; |
| } |
| } |
| </script> |
| </head> |
| <body> |
| <p>You should see a frame in 'view source' mode below.</p> |
| <p>None of the "<testxxx>" strings shown below should be colorized like HTML.</p> |
| <hr> |
| <div id="result"></div> |
| <hr> |
| <iframe viewsource src="resources/viewsource-frame-2.html" height="250" onload="report(this)"></iframe> |
| </body> |
| </html> |