browser_cmd_csscoverage_page2.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Page 2</title>
  6. <style>
  7. @import url(browser_cmd_csscoverage_sheetD.css);
  8. /* This should match below */
  9. .page2-test1 {
  10. color: #021;
  11. }
  12. /* This should not match below */
  13. .page2-test2 {
  14. color: #022;
  15. }
  16. /* This doesn't match until the event fires */
  17. .page2-test3 {
  18. color: #023;
  19. }
  20. </style>
  21. <link rel="stylesheet" type="text/css" href="browser_cmd_csscoverage_sheetA.css">
  22. <link rel="stylesheet" type="text/css" href="browser_cmd_csscoverage_sheetB.css">
  23. <script type="application/javascript;version=1.8">
  24. /* How quickly do we rush through this? */
  25. let delay = 500;
  26. window.addEventListener("load", () => {
  27. dump('TEST-INFO | load from browser_cmd_csscoverage_page2.html\n');
  28. setTimeout(() => {
  29. dump('TEST-INFO | timeout from browser_cmd_csscoverage_page2.html\n');
  30. /* This adds <div class=page2-test3></div> */
  31. let parent = document.querySelector("#page2-test3-holder");
  32. let child = document.createElement("div");
  33. child.classList.add("page2-test3");
  34. parent.appendChild(child);
  35. }, delay);
  36. });
  37. </script>
  38. </head>
  39. <body>
  40. <h2>Page 2</h2>
  41. <div class=page2-test1>.page2-test1</div>
  42. <div id=page2-test3-holder></div>
  43. <div class=sheetA-test1>.sheetA-test1</div>
  44. <div class=sheetA-test4>.sheetA-test4</div>
  45. <div class=sheetB-test1>.sheetB-test1</div>
  46. <div class=sheetB-test4>.sheetB-test4</div>
  47. <div class=sheetC-test1>.sheetC-test1</div>
  48. <div class=sheetC-test4>.sheetC-test4</div>
  49. <div class=sheetD-test1>.sheetD-test1</div>
  50. <div class=sheetD-test4>.sheetD-test4</div>
  51. </body>
  52. </html>