blob: 2346afc995d93fad80f3e9c392ba6ae62043bba3 [file] [log] [blame]
<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">&lt;' + name + '&gt;') + ' ' +
found(text, '<td class="webkit-line-content">&lt;test' + name + '&gt;') + ' ' +
found(text, '<span class="webkit-html-tag">&lt;/' + name + '&gt;') + '\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 "&lt;testxxx&gt;" 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>