servo/src/components/script/dom/htmlstyleelement.rs
2013-11-14 20:35:36 +09:00

60 lines
1.6 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::HTMLStyleElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLStyleElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLStyleElement {
htmlelement: HTMLElement,
}
impl HTMLStyleElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLStyleElement {
HTMLStyleElement {
htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLStyleElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLStyleElementBinding::Wrap)
}
}
impl HTMLStyleElement {
pub fn Disabled(&self) -> bool {
false
}
pub fn SetDisabled(&self, _disabled: bool) {
}
pub fn Media(&self) -> DOMString {
~""
}
pub fn SetMedia(&mut self, _media: DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
~""
}
pub fn SetType(&mut self, _type: DOMString) -> ErrorResult {
Ok(())
}
pub fn Scoped(&self) -> bool {
false
}
pub fn SetScoped(&self, _scoped: bool) -> ErrorResult {
Ok(())
}
}