<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
<style>
:valid { background: red; }
:invalid { background: red; }
textarea { background: lime; }
</style>
</head>
<body>
<p id="description"></p>
<form method="get">
<textarea name="victim" readonly>Lorem ipsum</textarea>
<textarea name="victim" disabled>Lorem ipsum</textarea>
</form>
<div id="console"></div>
<script>
description("This test performs a check for the :valid/:invalid CSS selector on textarea elements where it shouldn't be applied.");
v = document.getElementsByName("victim");
for (i = 0; i < v.length; i++)
shouldBe("document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");
</script>
</body>
</html>