browser_cmd_csscoverage_page1.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <!--
  6. First page of the css coverage test.
  7. * Contains page2 in an iframe
  8. * Forwards to page2 on a timeout
  9. -->
  10. <title>Page 1</title>
  11. <style>
  12. @import url(browser_cmd_csscoverage_sheetD.css);
  13. /* This should match below */
  14. .page1-test1 {
  15. color: #011;
  16. }
  17. /* This should not match below */
  18. .page1-test2 {
  19. color: #012;
  20. }
  21. /* This would match if the mouse was in the right place */
  22. .page1-test3:hover {
  23. color: #013;
  24. }
  25. /* This can't match because it's illegal */
  26. .page1-test4:broken {
  27. color: #014;
  28. }
  29. /* This doesn't match until the event fires */
  30. .page1-test5 {
  31. color: #015;
  32. }
  33. /* TODO: include examples of all CSS rules in
  34. https://developer.mozilla.org/en-US/docs/Web/API/CSSRule
  35. and include tests for rules nested in media rules, etc */
  36. /* We're not testing unparable CSS right now */
  37. </style>
  38. <link rel="stylesheet" type="text/css" href="browser_cmd_csscoverage_sheetA.css">
  39. <link rel="stylesheet" type="text/css" href="browser_cmd_csscoverage_sheetB.css">
  40. <script type="application/javascript;version=1.8">
  41. /* How quickly do we rush through this? */
  42. let delay = 500;
  43. window.addEventListener("load", () => {
  44. dump('TEST-INFO | load from browser_cmd_csscoverage_page1.html\n');
  45. setTimeout(() => {
  46. dump('TEST-INFO | timeout from browser_cmd_csscoverage_page1.html\n');
  47. /* This adds <div class=page1-test5></div> */
  48. let parent = document.querySelector("#page1-test5-holder");
  49. let child = document.createElement("div");
  50. child.classList.add("page1-test5");
  51. parent.appendChild(child);
  52. /* Then navigate to the next step */
  53. window.location.href = "browser_cmd_csscoverage_page3.html"
  54. }, delay);
  55. });
  56. </script>
  57. </head>
  58. <body>
  59. <h2>Page 1</h2>
  60. <div class=page1-test1>.page1-test1</div>
  61. <div class=page1-test3>.page1-test3</div>
  62. <div id=page1-test5-holder></div>
  63. <div class=sheetA-test1>.sheetA-test1</div>
  64. <div class=sheetA-test3>.sheetA-test3</div>
  65. <div class=sheetB-test1>.sheetB-test1</div>
  66. <div class=sheetB-test3>.sheetB-test3</div>
  67. <div class=sheetC-test1>.sheetC-test1</div>
  68. <div class=sheetC-test3>.sheetC-test3</div>
  69. <div class=sheetD-test1>.sheetD-test1</div>
  70. <div class=sheetD-test3>.sheetD-test3</div>
  71. <iframe src=browser_cmd_csscoverage_page2.html></iframe>
  72. <p>
  73. <a href="browser_cmd_csscoverage_page3.html">Page 3</a>
  74. </p>
  75. </body>
  76. </html>