Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Window / getMatchedCSSRules-with-invalid-pseudo-elements.html
blob0d0659c7ae1c0362556926e47035f6d8229a5259
1 <!DOCTYPE html>
2 <style>
3 p { color: green; }
4 div:first-letter { color: red; }
5 </style>
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>
9 <script>
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;
27 </script>