4 <style type=
"text/css">
5 div
.a
{background-color: red
;}
7 div
.a
{background-color: green
!important
;}
9 div
.b
{background-color: green
!important
;}
13 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=36515">bug
36515</a>:
14 CSS style definitions are ignored if they just follow a
"@charset" which appears in lines other than the first line in stylesheet.
</p>
15 <p>There should be two green squares below:
</p>
16 <div class=
"a" style=
"height:100px; width:100px;"></div><br>
17 <div class=
"b" style=
"height:100px; width:100px; background-color:red;"></div>
18 <div style=
"height:5px; width:5px; background-color:green; visibility: hidden"></div>
19 <div id=
"result">Testing...
</div>
21 if (window
.testRunner
)
22 testRunner
.dumpAsText();
23 var expected
= document
.defaultView
.getComputedStyle(document
.getElementsByTagName("div")[2], null).backgroundColor
;
24 var result
= document
.defaultView
.getComputedStyle(document
.getElementsByTagName("div")[0], null).backgroundColor
== expected
25 && document
.defaultView
.getComputedStyle(document
.getElementsByTagName("div")[1], null).backgroundColor
== expected
;
26 document
.getElementById("result").innerHTML
= result
? "PASS" : "FAIL";