test_pseudoelement_parsing.html 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <title>Test for Bug 922669</title>
  3. <script src="/MochiKit/MochiKit.js"></script>
  4. <script src="/tests/SimpleTest/SimpleTest.js"></script>
  5. <script src="/tests/SimpleTest/EventUtils.js"></script>
  6. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
  7. <style></style>
  8. <script>
  9. var style = document.querySelector("style");
  10. var gValidTests = [
  11. "::-moz-progress-bar",
  12. "::-moz-progress-bar:hover",
  13. "::-moz-progress-bar:active",
  14. "::-moz-progress-bar:focus",
  15. "::-moz-progress-bar:hover:focus",
  16. "#a::-moz-progress-bar:hover",
  17. ":hover::-moz-progress-bar"
  18. ];
  19. var gInvalidTests = [
  20. "::foo",
  21. "::-moz-progress-bar::-moz-progress-bar",
  22. "::-moz-progress-bar::first-line",
  23. "::-moz-progress-bar#a",
  24. "::-moz-progress-bar:invalid",
  25. "::-moz-focus-inner:active"
  26. ];
  27. gValidTests.forEach(function(aTest) {
  28. style.textContent = aTest + "{}";
  29. is(style.sheet.cssRules.length, 1, aTest);
  30. style.textContent = "";
  31. });
  32. gInvalidTests.forEach(function(aTest) {
  33. style.textContent = aTest + "{}";
  34. is(style.sheet.cssRules.length, 0, aTest);
  35. style.textContent = "";
  36. });
  37. </script>