OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 iframe { |
| 6 height: 50px; |
| 7 width: 50px; |
| 8 } |
| 9 </style> |
| 10 <iframe></iframe> |
| 11 <script> |
| 12 test(() => { |
| 13 var iframe = document.querySelector("iframe"); |
| 14 var doc = iframe.contentDocument; |
| 15 var style = doc.createElement("style"); |
| 16 style.setAttribute("media", "(min-width: 100px)"); |
| 17 style.textContent = "body { background: green }"; |
| 18 doc.head.appendChild(style); |
| 19 assert_equals(doc.defaultView.getComputedStyle(doc.body).backgroundColor, "r
gba(0, 0, 0, 0)"); |
| 20 iframe.setAttribute("style", "height: 100px; width: 100px"); |
| 21 assert_equals(doc.defaultView.getComputedStyle(doc.body).backgroundColor, "r
gb(0, 128, 0)"); |
| 22 }, "Sheet with initially non-matching viewport media query applies after resiz
e"); |
| 23 </script> |
OLD | NEW |