34 lines
1.0 KiB
HTML
34 lines
1.0 KiB
HTML
<html>
|
|
<head>
|
|
<title><textarea> and "readonly"</title>
|
|
<style>
|
|
textarea:read-only { background:lime }
|
|
textarea { background:red }
|
|
</style>
|
|
<link rel="help" href="http://whatwg.org/specs/web-forms/current-work/#readonly">
|
|
<link rel="help" href="http://whatwg.org/specs/web-forms/current-work/#relation">
|
|
<script language="JavaScript" type="text/javascript">
|
|
function log(message) {
|
|
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
|
|
}
|
|
|
|
function test() {
|
|
if (window.testRunner)
|
|
testRunner.dumpAsText();
|
|
|
|
var t = document.getElementById("victim");
|
|
if (document.defaultView.getComputedStyle(t, null).getPropertyValue('background-color') == "rgb(0, 255, 0)")
|
|
log("SUCCESS");
|
|
else
|
|
log("FAILURE");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="test()">
|
|
<p>This test checks for :read-only right behavior. Fails if FAILURE is shown below.</p>
|
|
<p><textarea id="victim" readonly></textarea></p>
|
|
<hr>
|
|
<ol id="console"></ol>
|
|
</body>
|
|
</html>
|