Move WebIDL methods to traits implemented by JSRef types.

This commit is contained in:
Josh Matthews 2014-04-10 21:29:54 -04:00
parent dfdda0098a
commit 76783b029e
106 changed files with 3644 additions and 1912 deletions

View file

@ -80,122 +80,154 @@ impl HTMLIFrameElement {
}
}
impl HTMLIFrameElement {
pub fn Src(&self) -> DOMString {
pub trait HTMLIFrameElementMethods {
fn Src(&self) -> DOMString;
fn SetSrc(&mut self, _src: DOMString) -> ErrorResult;
fn Srcdoc(&self) -> DOMString;
fn SetSrcdoc(&mut self, _srcdoc: DOMString) -> ErrorResult;
fn Name(&self) -> DOMString;
fn SetName(&mut self, _name: DOMString) -> ErrorResult;
fn Sandbox(&self, abstract_self: &JSRef<HTMLIFrameElement>) -> DOMString;
fn SetSandbox(&mut self, abstract_self: &mut JSRef<HTMLIFrameElement>, sandbox: DOMString);
fn AllowFullscreen(&self) -> bool;
fn SetAllowFullscreen(&mut self, _allow: bool) -> ErrorResult;
fn Width(&self) -> DOMString;
fn SetWidth(&mut self, _width: DOMString) -> ErrorResult;
fn Height(&self) -> DOMString;
fn SetHeight(&mut self, _height: DOMString) -> ErrorResult;
fn GetContentDocument(&self) -> Option<Unrooted<Document>>;
fn GetContentWindow(&self) -> Option<Unrooted<Window>>;
fn Align(&self) -> DOMString;
fn SetAlign(&mut self, _align: DOMString) -> ErrorResult;
fn Scrolling(&self) -> DOMString;
fn SetScrolling(&mut self, _scrolling: DOMString) -> ErrorResult;
fn FrameBorder(&self) -> DOMString;
fn SetFrameBorder(&mut self, _frameborder: DOMString) -> ErrorResult;
fn LongDesc(&self) -> DOMString;
fn SetLongDesc(&mut self, _longdesc: DOMString) -> ErrorResult;
fn MarginHeight(&self) -> DOMString;
fn SetMarginHeight(&mut self, _marginheight: DOMString) -> ErrorResult;
fn MarginWidth(&self) -> DOMString;
fn SetMarginWidth(&mut self, _marginwidth: DOMString) -> ErrorResult;
fn GetSVGDocument(&self) -> Option<Unrooted<Document>>;
}
impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
fn Src(&self) -> DOMString {
~""
}
pub fn SetSrc(&mut self, _src: DOMString) -> ErrorResult {
fn SetSrc(&mut self, _src: DOMString) -> ErrorResult {
Ok(())
}
pub fn Srcdoc(&self) -> DOMString {
fn Srcdoc(&self) -> DOMString {
~""
}
pub fn SetSrcdoc(&mut self, _srcdoc: DOMString) -> ErrorResult {
fn SetSrcdoc(&mut self, _srcdoc: DOMString) -> ErrorResult {
Ok(())
}
pub fn Name(&self) -> DOMString {
fn Name(&self) -> DOMString {
~""
}
pub fn SetName(&mut self, _name: DOMString) -> ErrorResult {
fn SetName(&mut self, _name: DOMString) -> ErrorResult {
Ok(())
}
pub fn Sandbox(&self, abstract_self: &JSRef<HTMLIFrameElement>) -> DOMString {
fn Sandbox(&self, abstract_self: &JSRef<HTMLIFrameElement>) -> DOMString {
let element: &JSRef<Element> = ElementCast::from_ref(abstract_self);
element.get_string_attribute("sandbox")
}
pub fn SetSandbox(&mut self, abstract_self: &mut JSRef<HTMLIFrameElement>, sandbox: DOMString) {
fn SetSandbox(&mut self, abstract_self: &mut JSRef<HTMLIFrameElement>, sandbox: DOMString) {
let element: &mut JSRef<Element> = ElementCast::from_mut_ref(abstract_self);
element.set_string_attribute("sandbox", sandbox);
}
pub fn AllowFullscreen(&self) -> bool {
fn AllowFullscreen(&self) -> bool {
false
}
pub fn SetAllowFullscreen(&mut self, _allow: bool) -> ErrorResult {
fn SetAllowFullscreen(&mut self, _allow: bool) -> ErrorResult {
Ok(())
}
pub fn Width(&self) -> DOMString {
fn Width(&self) -> DOMString {
~""
}
pub fn SetWidth(&mut self, _width: DOMString) -> ErrorResult {
fn SetWidth(&mut self, _width: DOMString) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> DOMString {
fn Height(&self) -> DOMString {
~""
}
pub fn SetHeight(&mut self, _height: DOMString) -> ErrorResult {
fn SetHeight(&mut self, _height: DOMString) -> ErrorResult {
Ok(())
}
pub fn GetContentDocument(&self) -> Option<Unrooted<Document>> {
fn GetContentDocument(&self) -> Option<Unrooted<Document>> {
None
}
pub fn GetContentWindow(&self) -> Option<Unrooted<Window>> {
fn GetContentWindow(&self) -> Option<Unrooted<Window>> {
None
}
pub fn Align(&self) -> DOMString {
fn Align(&self) -> DOMString {
~""
}
pub fn SetAlign(&mut self, _align: DOMString) -> ErrorResult {
fn SetAlign(&mut self, _align: DOMString) -> ErrorResult {
Ok(())
}
pub fn Scrolling(&self) -> DOMString {
fn Scrolling(&self) -> DOMString {
~""
}
pub fn SetScrolling(&mut self, _scrolling: DOMString) -> ErrorResult {
fn SetScrolling(&mut self, _scrolling: DOMString) -> ErrorResult {
Ok(())
}
pub fn FrameBorder(&self) -> DOMString {
fn FrameBorder(&self) -> DOMString {
~""
}
pub fn SetFrameBorder(&mut self, _frameborder: DOMString) -> ErrorResult {
fn SetFrameBorder(&mut self, _frameborder: DOMString) -> ErrorResult {
Ok(())
}
pub fn LongDesc(&self) -> DOMString {
fn LongDesc(&self) -> DOMString {
~""
}
pub fn SetLongDesc(&mut self, _longdesc: DOMString) -> ErrorResult {
fn SetLongDesc(&mut self, _longdesc: DOMString) -> ErrorResult {
Ok(())
}
pub fn MarginHeight(&self) -> DOMString {
fn MarginHeight(&self) -> DOMString {
~""
}
pub fn SetMarginHeight(&mut self, _marginheight: DOMString) -> ErrorResult {
fn SetMarginHeight(&mut self, _marginheight: DOMString) -> ErrorResult {
Ok(())
}
pub fn MarginWidth(&self) -> DOMString {
fn MarginWidth(&self) -> DOMString {
~""
}
pub fn SetMarginWidth(&mut self, _marginwidth: DOMString) -> ErrorResult {
fn SetMarginWidth(&mut self, _marginwidth: DOMString) -> ErrorResult {
Ok(())
}
pub fn GetSVGDocument(&self) -> Option<Unrooted<Document>> {
fn GetSVGDocument(&self) -> Option<Unrooted<Document>> {
None
}
}