test_processing_instruction_update_stylesheet.xhtml (1597B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <?xml-stylesheet href="data:text/css;charset=UTF-8,p{color:red}" type="text/css"?> 3 <!DOCTYPE html 4 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 5 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 7 <!-- 8 https://bugzilla.mozilla.org/show_bug.cgi?id=888864 9 --> 10 <head> 11 <title>Test for Bug 888864</title> 12 <script src="/tests/SimpleTest/SimpleTest.js"></script> 13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 14 <script type="application/javascript"> 15 <![CDATA[ 16 17 /** Test for Bug 888864 */ 18 SimpleTest.waitForExplicitFinish(); 19 20 function changeColorAndRun(callback) { 21 var piNode = document.firstChild; 22 piNode.data = 'href="data:text/css;charset=UTF-8,p{color:green}" type="text/css"'; 23 piNode.addEventListener("load", callback); 24 } 25 26 function runTest() { 27 var previousColor = window.getComputedStyle(document.getElementById("display")). 28 getPropertyValue("color"); 29 changeColorAndRun(function() { 30 var afterChange = window.getComputedStyle(document.getElementById("display")). 31 getPropertyValue("color"); 32 isnot(previousColor, afterChange, 33 "Color of the p element should change."); 34 SimpleTest.finish(); 35 }); 36 } 37 ]]> 38 </script> 39 </head> 40 <body onload="runTest();"> 41 <p id="display">This changes color</p> 42 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=888864">Mozilla Bug 888864</a> 43 <pre id="test"> 44 </pre> 45 </body> 46 </html>