4 div:first-letter { color: red; }
6 <script src=
"../../../resources/js-test.js"></script>
7 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=83298">https://bugs.webkit.org/show_bug.cgi?id=
83298</a></p>
8 <div>First letter of this sentence should be red.
</div>
10 description("getMatchedCSSRules with invalid Pseudo Elements");
12 var expectedResult1
= "p { color: green; }";
13 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('p'), '')[0].cssText", expectedResult1
)
14 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('p'), undefined)[0].cssText", expectedResult1
)
15 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('p'), null)[0].cssText", expectedResult1
)
16 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('p'))[0].cssText", expectedResult1
)
18 shouldBe("getMatchedCSSRules(document.querySelector('p'), 'before')", "null")
19 shouldBe("getMatchedCSSRules(document.querySelector('p'), 'foo')", "null")
21 var expectedResult2
= "div::first-letter { color: red; }";
22 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('div'), 'first-letter')[0].cssText", expectedResult2
)
23 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('div'), ':first-letter')[0].cssText", expectedResult2
)
24 shouldBeEqualToString("getMatchedCSSRules(document.querySelector('div'), '::first-letter')[0].cssText", expectedResult2
)
26 successfullyParsed
= true;