1 <meta charset="gb2312"> 2 <body onload="testStylesheets()"> 3 <script> 4 if (window.layoutTestController) 5 layoutTestController.dumpAsText(); 6 </script> 7 8 <!-- 9 This test uses the word "SUCCESS" spelled with Cyrillic letters "CCE", 10 making decoding problems visible. 11 --> 12 13 <ol> 14 <li>Script with charset: 15 <span id="testdiv1"></span>. 16 <li>Link rel=stylesheet with charset: 17 <span id="testdiv2"></span> 18 <li>Script without charset: 19 <span id="testdiv3"></span> 20 <li>Link rel=stylesheet without charset: 21 <span id="testdiv4"></span> 22 </ol> 23 24 <script type='text/javascript' src='this-does-not-need-to-exist.js'></script> 25 26 <script type='text/javascript' src='resources/preloaded-utf-8.js' charset='utf-8'></script> 27 28 <link rel='stylesheet' href='resources/preloaded-utf-8.css' charset='utf-8'> 29 30 <script charset="utf-8"></script> 31 32 <script type='text/javascript' src='resources/preloaded-gb2312.js'></script> 33 34 <link rel='stylesheet' charset='utf-8'> 35 36 <link rel='stylesheet' href='resources/preloaded-gb2312.css'> 37 38 <script> 39 function testStylesheets() 40 { 41 document.getElementById('testdiv2').innerText = 42 (/SUSS/.test(document.styleSheets[0].cssRules[0].cssText)) ? "SUCCESS" : "FAILURE"; 43 44 document.getElementById('testdiv4').innerText = 45 (/SUSS/.test(document.styleSheets[1].cssRules[0].cssText)) ? "SUCCESS" : "FAILURE"; 46 } 47 </script> 48