test_css_cross_domain.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=524223 -->
  4. <head>
  5. <title>Test cross-domain CSS loading</title>
  6. <script type="application/javascript"
  7. src="/tests/SimpleTest/SimpleTest.js"></script>
  8. <link rel="stylesheet" type="text/css"
  9. href="/tests/SimpleTest/test.css"/>
  10. <style type="text/css">
  11. hr { border: none; clear: both }
  12. .column {
  13. margin: 10px;
  14. float: left;
  15. }
  16. iframe {
  17. width: 40px;
  18. height: 680px;
  19. border: none;
  20. margin: 0;
  21. padding: 0;
  22. }
  23. h2 { font-weight: normal; padding: 0 }
  24. ol, h2 { font-size: 13px; line-height: 20px; }
  25. ol { padding-left: 1em;
  26. list-style-type: upper-roman }
  27. ol ol { list-style-type: upper-alpha }
  28. ol ol ol { list-style-type: decimal }
  29. </style>
  30. </head>
  31. <body>
  32. <a target="_blank"
  33. href="https://bugzilla.mozilla.org/show_bug.cgi?id=524223">Mozilla
  34. Bug 524223</a>
  35. <hr/>
  36. <div class="column">
  37. <h2>&nbsp;</h2>
  38. <ol><li>text/css<ol><li>same origin<ol><li>valid</li>
  39. <li>malformed</li>
  40. <li>http error</li></ol></li>
  41. <li>cross origin<ol><li>valid</li>
  42. <li>malformed</li>
  43. <li>http error</li></ol></li>
  44. <li>same to cross<ol><li>valid</li>
  45. <li>malformed</li>
  46. <li>http error</li></ol></li>
  47. <li>cross to same<ol><li>valid</li>
  48. <li>malformed</li>
  49. <li>http error</li></ol></li></ol></li>
  50. <li>text/html<ol><li>same origin<ol><li>valid</li>
  51. <li>malformed</li>
  52. <li>http error</li></ol></li>
  53. <li>cross origin<ol><li>valid</li>
  54. <li>malformed</li>
  55. <li>http error</li></ol></li>
  56. <li>same to cross<ol><li>valid</li>
  57. <li>malformed</li>
  58. <li>http error</li></ol></li>
  59. <li>cross to same<ol><li>valid</li>
  60. <li>malformed</li>
  61. <li>http error</li></ol></li></ol></li>
  62. </ol>
  63. </div>
  64. <div class="column">
  65. <h2>Quirks</h2>
  66. <iframe id="quirks" src="ccd-quirks.html"></iframe>
  67. </div>
  68. <div class="column">
  69. <h2>Standards</h2>
  70. <iframe id="standards" src="ccd-standards.html"></iframe>
  71. </div>
  72. <script type="application/javascript">
  73. /** Test for Bug 524223 **/
  74. function check_iframe(ifr) {
  75. var doc = ifr.contentDocument;
  76. var cases = doc.getElementsByTagName("p");
  77. for (var i = 0; i < cases.length; i++) {
  78. var color = doc.defaultView.getComputedStyle(cases[i], "")
  79. .getPropertyValue("background-color");
  80. is(color, "rgb(0, 255, 0)", ifr.id + " " + cases[i].id);
  81. }
  82. }
  83. SimpleTest.waitForExplicitFinish();
  84. window.onload = function() {
  85. check_iframe(document.getElementById("quirks"));
  86. check_iframe(document.getElementById("standards"));
  87. SimpleTest.finish();
  88. };
  89. </script>
  90. </body>
  91. </html>