mirror of
https://github.com/servo/servo.git
synced 2025-06-24 00:54:32 +01:00
51 lines
1.7 KiB
Rust
51 lines
1.7 KiB
Rust
/* 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::BindingDeclarations::HTMLHtmlElementBinding;
|
|
use dom::bindings::codegen::InheritTypes::HTMLHtmlElementDerived;
|
|
use dom::bindings::js::{JS, JSRef, Unrooted};
|
|
use dom::bindings::error::ErrorResult;
|
|
use dom::document::Document;
|
|
use dom::element::HTMLHtmlElementTypeId;
|
|
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
|
|
use dom::htmlelement::HTMLElement;
|
|
use dom::node::{Node, ElementNodeTypeId};
|
|
use servo_util::str::DOMString;
|
|
|
|
#[deriving(Encodable)]
|
|
pub struct HTMLHtmlElement {
|
|
pub htmlelement: HTMLElement
|
|
}
|
|
|
|
impl HTMLHtmlElementDerived for EventTarget {
|
|
fn is_htmlhtmlelement(&self) -> bool {
|
|
match self.type_id {
|
|
NodeTargetTypeId(ElementNodeTypeId(HTMLHtmlElementTypeId)) => true,
|
|
_ => false
|
|
}
|
|
}
|
|
}
|
|
|
|
impl HTMLHtmlElement {
|
|
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLHtmlElement {
|
|
HTMLHtmlElement {
|
|
htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, document)
|
|
}
|
|
}
|
|
|
|
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Unrooted<HTMLHtmlElement> {
|
|
let element = HTMLHtmlElement::new_inherited(localName, document.unrooted());
|
|
Node::reflect_node(~element, document, HTMLHtmlElementBinding::Wrap)
|
|
}
|
|
}
|
|
|
|
impl HTMLHtmlElement {
|
|
pub fn Version(&self) -> DOMString {
|
|
~""
|
|
}
|
|
|
|
pub fn SetVersion(&mut self, _version: DOMString) -> ErrorResult {
|
|
Ok(())
|
|
}
|
|
}
|