mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
auto merge of #4265 : ProgramFOX/servo/issue-4251, r=Ms2ger
Resolves #4251
This commit is contained in:
commit
b805e74fef
5 changed files with 7 additions and 16 deletions
|
@ -413,7 +413,7 @@ impl Document {
|
||||||
// http://dom.spec.whatwg.org/#concept-document-quirks
|
// http://dom.spec.whatwg.org/#concept-document-quirks
|
||||||
quirks_mode: Cell::new(NoQuirks),
|
quirks_mode: Cell::new(NoQuirks),
|
||||||
// http://dom.spec.whatwg.org/#concept-document-encoding
|
// 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,
|
is_html_document: is_html_document == HTMLDocument,
|
||||||
images: Default::default(),
|
images: Default::default(),
|
||||||
embeds: Default::default(),
|
embeds: Default::default(),
|
||||||
|
@ -506,7 +506,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-document-characterset
|
// http://dom.spec.whatwg.org/#dom-document-characterset
|
||||||
fn CharacterSet(self) -> DOMString {
|
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
|
// http://dom.spec.whatwg.org/#dom-document-content_type
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
<script>
|
<script>
|
||||||
// test1: characterSet
|
// test1: characterSet
|
||||||
{
|
{
|
||||||
is(document.characterSet, "utf-8", "test1-0, characterSet");
|
is(document.characterSet, "UTF-8", "test1-0, characterSet");
|
||||||
|
|
||||||
var xmldoc = new Document;
|
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");
|
var htmldoc = document.implementation.createHTMLDocument("title");
|
||||||
is(htmldoc.characterSet, "utf-8", "test2-2, characterSet");
|
is(htmldoc.characterSet, "UTF-8", "test2-2, characterSet");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// test1: default characterSet
|
// test1: default characterSet
|
||||||
{
|
{
|
||||||
// FIXME: https://github.com/mozilla-servo/libhubbub/issues/5
|
// 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>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<script>
|
<script>
|
||||||
// test1: unknown charset
|
// test1: unknown charset
|
||||||
{
|
{
|
||||||
is(document.characterSet, "utf-8", "test1-0, unknown charset");
|
is(document.characterSet, "UTF-8", "test1-0, unknown charset");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -219,21 +219,12 @@
|
||||||
[paras[4\].firstElementChild]
|
[paras[4\].firstElementChild]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[document.characterSet]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[document.inputEncoding]
|
[document.inputEncoding]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[foreignDoc.characterSet]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[foreignDoc.inputEncoding]
|
[foreignDoc.inputEncoding]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[xmlDoc.characterSet]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[xmlDoc.inputEncoding]
|
[xmlDoc.inputEncoding]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue