summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/encoding/css-charset-default.xhtml
blob: 87a6d68f8e5036c911183f5bf45179fb53d0a4ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="iso-8859-5"?>
<?xml-stylesheet href="css-charset-inherit-iso-8859-5.css?1" type="text/css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>CSS Default charset</title>
    <link rel="stylesheet" type="text/css" href="css-charset-inherit-iso-8859-5.css?2"/>
    <link rel="stylesheet" type="text/css" href="css-charset-import.css"/>
    <style type="text/css">
        @import "css-charset-inherit-iso-8859-5.css?4";
    </style>
    <script>document.charset = "koi8-r";</script>
    <link rel="stylesheet" type="text/css" href="css-charset-inherit-koi-8.css?2"/>
</head>
<body onload="test()">
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11011">bug 11011</a>:
External CSS is parsed as iso-8859-1 even though the main document is utf-8.</p>

<p id="res1">Stylesheet 1 (inherit document charset using xml-stylesheet processing instruction): </p>
<p id="res2">Stylesheet 2 (inherit document charset using link): </p>
<p id="res3">Stylesheet 3 (inherit referring stylesheet charset): </p>
<p id="res4">Stylesheet 4 (inherit referring inline stylesheet charset): </p>
<p id="res5">Stylesheet 5 (inherit document charset using link after document.charset was set): </p>

<script type="text/javascript">
if (window.layoutTestController)
    layoutTestController.dumpAsText();

function test() {
  try {
    document.getElementById("res1").innerHTML += document.styleSheets[0].cssRules[0].style.content;

    document.getElementById("res2").innerHTML += document.styleSheets[1].cssRules[0].style.content;
    
    document.getElementById("res3").innerHTML += document.styleSheets[2].cssRules[1].styleSheet.cssRules[0].style.content;

    document.getElementById("res4").innerHTML += document.styleSheets[3].cssRules[0].styleSheet.cssRules[0].style.content;

    document.getElementById("res5").innerHTML += document.styleSheets[4].cssRules[0].style.content;
  } catch (ex) {
    alert(ex.toString());
  }
}
</script>

</body>
</html>