aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/document.rs4
-rw-r--r--tests/content/test_document_characterSet.html6
-rw-r--r--tests/content/test_document_characterSet_default.html2
-rw-r--r--tests/content/test_document_characterSet_invalid.html2
-rw-r--r--tests/wpt/metadata/dom/nodes/Node-properties.html.ini9
5 files changed, 7 insertions, 16 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index fad44638f64..8a4beae9dc4 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -413,7 +413,7 @@ impl Document {
// http://dom.spec.whatwg.org/#concept-document-quirks
quirks_mode: Cell::new(NoQuirks),
// http://dom.spec.whatwg.org/#concept-document-encoding
- encoding_name: DOMRefCell::new("utf-8".to_string()),
+ encoding_name: DOMRefCell::new("UTF-8".to_string()),
is_html_document: is_html_document == HTMLDocument,
images: Default::default(),
embeds: Default::default(),
@@ -506,7 +506,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
// http://dom.spec.whatwg.org/#dom-document-characterset
fn CharacterSet(self) -> DOMString {
- self.encoding_name.borrow().as_slice().to_ascii_lower()
+ self.encoding_name.borrow().clone()
}
// http://dom.spec.whatwg.org/#dom-document-content_type
diff --git a/tests/content/test_document_characterSet.html b/tests/content/test_document_characterSet.html
index 4ac3dea31be..4e150c682e8 100644
--- a/tests/content/test_document_characterSet.html
+++ b/tests/content/test_document_characterSet.html
@@ -6,13 +6,13 @@
<script>
// test1: characterSet
{
- is(document.characterSet, "utf-8", "test1-0, characterSet");
+ is(document.characterSet, "UTF-8", "test1-0, characterSet");
var xmldoc = new Document;
- is(xmldoc.characterSet, "utf-8", "test2-1, characterSet");
+ is(xmldoc.characterSet, "UTF-8", "test2-1, characterSet");
var htmldoc = document.implementation.createHTMLDocument("title");
- is(htmldoc.characterSet, "utf-8", "test2-2, characterSet");
+ is(htmldoc.characterSet, "UTF-8", "test2-2, characterSet");
}
</script>
</head>
diff --git a/tests/content/test_document_characterSet_default.html b/tests/content/test_document_characterSet_default.html
index 1941e50c3ee..2c234636519 100644
--- a/tests/content/test_document_characterSet_default.html
+++ b/tests/content/test_document_characterSet_default.html
@@ -6,7 +6,7 @@
// test1: default characterSet
{
// FIXME: https://github.com/mozilla-servo/libhubbub/issues/5
- is(document.characterSet, "utf-8", "test1-0, default characterSet");
+ is(document.characterSet, "UTF-8", "test1-0, default characterSet");
}
</script>
</head>
diff --git a/tests/content/test_document_characterSet_invalid.html b/tests/content/test_document_characterSet_invalid.html
index d0440e4fe0f..15ab99519c2 100644
--- a/tests/content/test_document_characterSet_invalid.html
+++ b/tests/content/test_document_characterSet_invalid.html
@@ -6,7 +6,7 @@
<script>
// test1: unknown charset
{
- is(document.characterSet, "utf-8", "test1-0, unknown charset");
+ is(document.characterSet, "UTF-8", "test1-0, unknown charset");
}
</script>
</head>
diff --git a/tests/wpt/metadata/dom/nodes/Node-properties.html.ini b/tests/wpt/metadata/dom/nodes/Node-properties.html.ini
index 892b4468194..819269300ba 100644
--- a/tests/wpt/metadata/dom/nodes/Node-properties.html.ini
+++ b/tests/wpt/metadata/dom/nodes/Node-properties.html.ini
@@ -219,21 +219,12 @@
[paras[4\].firstElementChild]
expected: FAIL
- [document.characterSet]
- expected: FAIL
-
[document.inputEncoding]
expected: FAIL
- [foreignDoc.characterSet]
- expected: FAIL
-
[foreignDoc.inputEncoding]
expected: FAIL
- [xmlDoc.characterSet]
- expected: FAIL
-
[xmlDoc.inputEncoding]
expected: FAIL