mirror of
https://github.com/servo/servo.git
synced 2025-10-18 09:19:16 +01:00
auto merge of #1483 : brunoabinader/servo/document-doctype, r=jdm
Closes #1482.
This commit is contained in:
commit
50b66f3552
3 changed files with 29 additions and 1 deletions
|
@ -33,7 +33,7 @@ interface Document : Node {
|
|||
// readonly attribute DOMString characterSet;
|
||||
// readonly attribute DOMString contentType;
|
||||
|
||||
//readonly attribute DocumentType? doctype;
|
||||
readonly attribute DocumentType? doctype;
|
||||
readonly attribute Element? documentElement;
|
||||
HTMLCollection getElementsByTagName(DOMString localName);
|
||||
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
|
||||
|
|
|
@ -156,6 +156,10 @@ impl Reflectable for Document {
|
|||
}
|
||||
|
||||
impl Document {
|
||||
pub fn GetDoctype(&self) -> Option<AbstractNode> {
|
||||
self.node.children().find(|child| child.is_doctype())
|
||||
}
|
||||
|
||||
pub fn GetDocumentElement(&self) -> Option<AbstractNode> {
|
||||
self.node.child_elements().next()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue