mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
DocumentType does not need to know about quirks mode
TSIA. Closes #1498.
This commit is contained in:
parent
bf4498f948
commit
ef8ce13550
3 changed files with 3 additions and 11 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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<AbstractNode> {
|
||||
// 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()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue