mirror of
https://github.com/servo/servo.git
synced 2025-10-16 16:29:18 +01:00
Remove HTMLDocument.
This commit is contained in:
parent
7190feb5e3
commit
e2617a6396
12 changed files with 10 additions and 81 deletions
|
@ -224,10 +224,6 @@ DOMInterfaces = {
|
|||
{
|
||||
}],
|
||||
|
||||
'HTMLDocument': {
|
||||
'customTrace': 'trace'
|
||||
},
|
||||
|
||||
'HTMLOptionsCollection': [
|
||||
{
|
||||
'nativeType': 'nsHTMLOptionCollection',
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::DOMImplementationBinding;
|
||||
use dom::bindings::codegen::InheritTypes::{NodeCast, DocumentCast};
|
||||
use dom::bindings::codegen::InheritTypes::NodeCast;
|
||||
use dom::bindings::js::JS;
|
||||
use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object};
|
||||
use dom::bindings::utils::{Fallible, InvalidCharacter, NamespaceError};
|
||||
use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type};
|
||||
use dom::document::{Document, HTML, HTMLDocumentTypeId};
|
||||
use dom::documenttype::DocumentType;
|
||||
use dom::htmldocument::HTMLDocument;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlheadelement::HTMLHeadElement;
|
||||
use dom::htmlhtmlelement::HTMLHtmlElement;
|
||||
|
@ -67,7 +66,7 @@ impl DOMImplementation {
|
|||
// http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
|
||||
pub fn CreateHTMLDocument(&self, title: Option<DOMString>) -> JS<Document> {
|
||||
// Step 1-2.
|
||||
let doc: JS<Document> = DocumentCast::from(&HTMLDocument::new(&self.owner, None));
|
||||
let doc = Document::new(&self.owner, None, HTML, None);
|
||||
assert!(doc.get().doctype == HTML);
|
||||
|
||||
let mut doc_node: JS<Node> = NodeCast::from(&doc);
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
|
||||
use dom::bindings::codegen::DOMParserBinding;
|
||||
use dom::bindings::codegen::DOMParserBinding::SupportedTypeValues::{Text_html, Text_xml};
|
||||
use dom::bindings::codegen::InheritTypes::DocumentCast;
|
||||
use dom::bindings::js::JS;
|
||||
use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object};
|
||||
use dom::bindings::utils::Fallible;
|
||||
use dom::bindings::utils::FailureUnknown;
|
||||
use dom::document::Document;
|
||||
use dom::htmldocument::HTMLDocument;
|
||||
use dom::document::{Document, HTML};
|
||||
use dom::window::Window;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
|
@ -43,7 +41,7 @@ impl DOMParser {
|
|||
-> Fallible<JS<Document>> {
|
||||
match ty {
|
||||
Text_html => {
|
||||
Ok(DocumentCast::from(&HTMLDocument::new(&self.owner, None)))
|
||||
Ok(Document::new(&self.owner, None, HTML, None))
|
||||
}
|
||||
Text_xml => {
|
||||
Document::Constructor(&self.owner)
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLDocumentBinding;
|
||||
use dom::bindings::codegen::InheritTypes::HTMLDocumentDerived;
|
||||
use dom::bindings::js::JS;
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::document::{Document, HTML, HTMLDocumentTypeId};
|
||||
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
|
||||
use dom::node::DocumentNodeTypeId;
|
||||
use dom::window::Window;
|
||||
|
||||
use extra::url::Url;
|
||||
|
||||
#[deriving(Encodable)]
|
||||
pub struct HTMLDocument {
|
||||
parent: Document
|
||||
}
|
||||
|
||||
impl HTMLDocumentDerived for EventTarget {
|
||||
fn is_htmldocument(&self) -> bool {
|
||||
match self.type_id {
|
||||
NodeTargetTypeId(DocumentNodeTypeId(HTMLDocumentTypeId)) => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HTMLDocument {
|
||||
pub fn new_inherited(window: JS<Window>, url: Option<Url>) -> HTMLDocument {
|
||||
HTMLDocument {
|
||||
parent: Document::new_inherited(window, url, HTML, None)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(window: &JS<Window>, url: Option<Url>) -> JS<HTMLDocument> {
|
||||
let document = HTMLDocument::new_inherited(window.clone(), url);
|
||||
Document::reflect_document(~document, window, HTMLDocumentBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
impl Reflectable for HTMLDocument {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
self.parent.reflector()
|
||||
}
|
||||
|
||||
fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
|
||||
self.parent.mut_reflector()
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
/* http://www.whatwg.org/specs/web-apps/current-work/#the-document-object */
|
||||
interface HTMLDocument : Document {};
|
Loading…
Add table
Add a link
Reference in a new issue