test_css_loader_crossorigin_data_url.html (841B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Test for handling of 'crossorigin' attribute on CSS link with data: URL</title> 4 <link id="testlink" crossorigin rel="stylesheet" href="data:text/css,%23someuniqueidhere{display:none}"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <div id="log"></div> 8 <div id="someuniqueidhere"></div> 9 <script> 10 var t = async_test("link@crossorigin with data: href"); 11 window.addEventListener("load", t.step_func_done(function() { 12 assert_equals(getComputedStyle(document.getElementById("someuniqueidhere")).display, 13 "none", "sheet should be applied"); 14 assert_equals(document.getElementById("testlink").sheet.cssRules[0].style.display, 15 "none", "should be able to read data from the sheet"); 16 })); 17 </script>