From ef8ce135502cb905ce62f5c2a867726971a2dcb2 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 15 Jan 2014 14:39:33 -0400 Subject: [PATCH] DocumentType does not need to know about quirks mode TSIA. Closes #1498. --- src/components/script/dom/documenttype.rs | 7 +------ src/components/script/dom/domimplementation.rs | 4 +--- src/components/script/html/hubbub_html_parser.rs | 3 +-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/script/dom/documenttype.rs b/src/components/script/dom/documenttype.rs index 66e731e724b..0fceb16083c 100644 --- a/src/components/script/dom/documenttype.rs +++ b/src/components/script/dom/documenttype.rs @@ -13,35 +13,30 @@ pub struct DocumentType { name: DOMString, public_id: DOMString, system_id: DOMString, - force_quirks: bool } impl DocumentType { pub fn new_inherited(name: ~str, public_id: Option<~str>, system_id: Option<~str>, - force_quirks: bool, document: AbstractDocument) -> DocumentType { DocumentType { node: Node::new_inherited(DoctypeNodeTypeId, document), name: name, public_id: public_id.unwrap_or(~""), - system_id: system_id.unwrap_or(~""), - force_quirks: force_quirks, + system_id: system_id.unwrap_or(~"") } } pub fn new(name: ~str, public_id: Option<~str>, system_id: Option<~str>, - force_quirks: bool, document: AbstractDocument) -> AbstractNode { let documenttype = DocumentType::new_inherited(name, public_id, system_id, - force_quirks, document); Node::reflect_node(@mut documenttype, document, DocumentTypeBinding::Wrap) } diff --git a/src/components/script/dom/domimplementation.rs b/src/components/script/dom/domimplementation.rs index d11a15c24e6..cee3f1957e0 100644 --- a/src/components/script/dom/domimplementation.rs +++ b/src/components/script/dom/domimplementation.rs @@ -43,15 +43,13 @@ impl Reflectable for DOMImplementation { impl DOMImplementation { // http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype pub fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible { - // FIXME: To be removed in https://github.com/mozilla/servo/issues/1498 - let force_quirks : bool = false; match xml_name_type(qname) { // Step 1. InvalidXMLName => Err(InvalidCharacter), // Step 2. Name => Err(NamespaceError), // Step 3. - QName => Ok(DocumentType::new(qname, Some(pubid), Some(sysid), force_quirks, self.owner.Document())) + QName => Ok(DocumentType::new(qname, Some(pubid), Some(sysid), self.owner.Document())) } } } diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 5d9e955714a..776f5a480f8 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -312,11 +312,10 @@ pub fn parse_html(cx: *JSContext, let ~hubbub::Doctype {name: name, public_id: public_id, system_id: system_id, - force_quirks: force_quirks } = doctype; + force_quirks: _ } = doctype; let node = DocumentType::new(name, public_id, system_id, - force_quirks, document); unsafe { node.to_hubbub_node()