4 <script src=
"../../../resources/js-test.js"></script>
14 outline:
2px solid red;
21 content: 'test ' url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=);
24 counter-reset: section;
27 counter-reset: subsection
0 anothercounter
5;
29 #counter
> h1:before {
30 counter-increment: section;
31 content: counter(section) '. ';
33 #counter
> div
> h2:before {
34 counter-increment: subsection;
35 content: counter(section) '.' counter(subsection) '. ';
41 <div id=
"outline">outline
</div>
42 <div id=
"content">content
</div>
45 <h1 id=
"counter1">Heading A
</h1>
47 <h2 id=
"subcounter1">Subheading A
</h2>
48 <h2 id=
"subcounter2">Subheading B
</h2>
53 <div id=
"console"></div>
57 function computedStyleFor(id
, pseudo
, property
)
59 var element
= document
.getElementById(id
);
60 var style
= window
.getComputedStyle(element
, pseudo
);
63 return style
.getPropertyValue(property
);
66 shouldBe("computedStyleFor('outline', null, 'outline-offset')", "'5px'");
68 shouldBeEqualToString("computedStyleFor('content', 'before', 'content')", "\"text\"");
69 shouldBeEqualToString("computedStyleFor('content', 'after', 'content')", "\"test \" url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)");
70 shouldBe("computedStyleFor('counter', null, 'counter-reset')", "'section 0'");
71 var str
= computedStyleFor('subcounter', null, 'counter-reset');
72 shouldBe("str.indexOf('subsection 0') != -1", "true");
73 shouldBe("str.indexOf('anothercounter 5') != -1", "true");
74 shouldBe("computedStyleFor('counter1', 'before', 'counter-increment')", "'section 1'");
75 shouldBe("computedStyleFor('subcounter2', 'before', 'counter-increment')", "'subsection 1'");
76 shouldBeEqualToString("computedStyleFor('subcounter2', 'before', 'content')", 'counter(section) "." counter(subsection) ". "');