1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
6 input { background: blue; }
10 <p id=
"description"></p>
12 <input name=
"victim" type=
"text"/>
13 <input name=
"victim" type=
"text" value=
"Loremipsum" pattern=
"Lorem ipsum"/>
15 <div id=
"console"></div>
17 description("This test checks that input element that share style, no longer share style after validity rules are dynamically added.");
19 var s1
= document
.getElementById('sty').sheet
;
20 s1
.insertRule(':valid { background: lime; }', s1
.cssRules
.length
);
22 v
= document
.getElementsByTagName("input");
24 shouldBe("document.defaultView.getComputedStyle(v[0], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");
25 shouldBe("document.defaultView.getComputedStyle(v[1], null).getPropertyValue('background-color')", "'rgb(0, 0, 255)'");