summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/encoding/css-charset-dom.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/encoding/css-charset-dom.html')
-rw-r--r--LayoutTests/fast/encoding/css-charset-dom.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/LayoutTests/fast/encoding/css-charset-dom.html b/LayoutTests/fast/encoding/css-charset-dom.html
new file mode 100644
index 0000000..8d591ae
--- /dev/null
+++ b/LayoutTests/fast/encoding/css-charset-dom.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+ <meta content="text/html; charset=windows-1251" http-equiv="Content-Type"/>
+ <link rel="stylesheet" type="text/css" href="css-charset.css" charset="windows-1251">
+ <!-- The document charset and link charset have lower priority than @charset, so they
+ shouldn't affect anything. -->
+</head>
+<body onload="test()">
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=10676">bug 10676</a>:
+@charset rules not accessible via DOM</p>
+
+<p id="result"></p>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function test() {
+ try {
+ charsetRule = document.styleSheets[0].cssRules[0];
+ document.getElementById("result").innerHTML = "cssText: " + charsetRule.cssText + "<br>encoding: " + charsetRule.encoding;
+ document.getElementById("result").innerHTML += "<br>Resetting encoding...";
+ charsetRule.encoding = "koi8-r";
+ document.getElementById("result").innerHTML += "<br>cssText: " + charsetRule.cssText + "<br>encoding: " + charsetRule.encoding;
+ } catch (ex) {
+ document.getElementById("result").textContent = ex.toString();
+ }
+}
+</script>
+
+</body>
+</html>