servo/src/components/script/dom/htmllinkelement.rs
Patrick Walton be69a503fe script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call.

This is simpler. Currently, the set of methods is not safe, but I plan
to lock it down more soon.
2013-12-17 18:07:12 -08:00

108 lines
2.4 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::HTMLLinkElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLLinkElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node};
pub struct HTMLLinkElement {
htmlelement: HTMLElement,
}
impl HTMLLinkElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLinkElement {
HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode {
let element = HTMLLinkElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLLinkElementBinding::Wrap)
}
}
impl HTMLLinkElement {
pub fn Disabled(&self) -> bool {
false
}
pub fn SetDisabled(&mut self, _disable: bool) {
}
pub fn Href(&self) -> DOMString {
~""
}
pub fn SetHref(&mut self, _href: DOMString) -> ErrorResult {
Ok(())
}
pub fn CrossOrigin(&self) -> DOMString {
~""
}
pub fn SetCrossOrigin(&mut self, _cross_origin: DOMString) -> ErrorResult {
Ok(())
}
pub fn Rel(&self) -> DOMString {
~""
}
pub fn SetRel(&mut self, _rel: DOMString) -> ErrorResult {
Ok(())
}
pub fn Media(&self) -> DOMString {
~""
}
pub fn SetMedia(&mut self, _media: DOMString) -> ErrorResult {
Ok(())
}
pub fn Hreflang(&self) -> DOMString {
~""
}
pub fn SetHreflang(&mut self, _href: DOMString) -> ErrorResult {
Ok(())
}
pub fn Type(&self) -> DOMString {
~""
}
pub fn SetType(&mut self, _type: DOMString) -> ErrorResult {
Ok(())
}
pub fn Charset(&self) -> DOMString {
~""
}
pub fn SetCharset(&mut self, _charset: DOMString) -> ErrorResult {
Ok(())
}
pub fn Rev(&self) -> DOMString {
~""
}
pub fn SetRev(&mut self, _rev: DOMString) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
~""
}
pub fn SetTarget(&mut self, _target: DOMString) -> ErrorResult {
Ok(())
}
}