test_style_sheet.html (758B)
1 <!DOCTYPE html> 2 <title>Test for Bug 1239128</title> 3 <script src="/tests/SimpleTest/SimpleTest.js"></script> 4 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> 5 <body> 6 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1239128">Mozilla Bug 1239128</a> 7 <p id="display"</p> 8 9 <svg> 10 <style>svg { fill: blue; }</style> 11 </svg> 12 13 <pre id="test"> 14 <script class="testbody" type="application/javascript"> 15 var style = document.querySelector("style"); 16 17 var exceptionThrown = false; 18 try { 19 is(style.sheet.cssRules[0].cssText, "svg { fill: blue; }", 20 "Should get the fill: blue rule back"); 21 } catch (e) { 22 exceptionThrown = true; 23 } 24 25 ok(!exceptionThrown, "Should be able to access data: <style> stylesheet"); 26 </script> 27 </pre>