servo/src/components/script/dom/htmlmodelement.rs
Lars Bergstrom 948daf2422 This batch of changes upgrades Servo to work with the Rust upgrade as of
April 10, 2014. The main changes are to privacy, to work around the
issues with incorrect bounds on the libstd `Arc<Mutex<T>>`, and the
various API changes strewn throughout the libraries.
2014-04-27 15:46:12 -05:00

59 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::HTMLModElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLModElementDerived;
use dom::bindings::js::JS;
use dom::bindings::error::ErrorResult;
use dom::document::Document;
use dom::element::HTMLModElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlelement::HTMLElement;
use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
pub struct HTMLModElement {
pub htmlelement: HTMLElement
}
impl HTMLModElementDerived for EventTarget {
fn is_htmlmodelement(&self) -> bool {
match self.type_id {
NodeTargetTypeId(ElementNodeTypeId(HTMLModElementTypeId)) => true,
_ => false
}
}
}
impl HTMLModElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLModElement {
HTMLModElement {
htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, document)
}
}
pub fn new(localName: DOMString, document: &JS<Document>) -> JS<HTMLModElement> {
let element = HTMLModElement::new_inherited(localName, document.clone());
Node::reflect_node(~element, document, HTMLModElementBinding::Wrap)
}
}
impl HTMLModElement {
pub fn Cite(&self) -> DOMString {
~""
}
pub fn SetCite(&mut self, _cite: DOMString) -> ErrorResult {
Ok(())
}
pub fn DateTime(&self) -> DOMString {
~""
}
pub fn SetDateTime(&mut self, _datetime: DOMString) -> ErrorResult {
Ok(())
}
}