diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-04-10 21:29:54 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-05-03 14:18:30 -0400 |
commit | 76783b029e5e10da7fd61ab356a8f80a1eaf32e0 (patch) | |
tree | 93697ff8906d2661434abc660ae57607b1871b59 /src/components/script/dom/htmliframeelement.rs | |
parent | dfdda0098a3f169a37c100b36d4dd36ec1d815aa (diff) | |
download | servo-76783b029e5e10da7fd61ab356a8f80a1eaf32e0.tar.gz servo-76783b029e5e10da7fd61ab356a8f80a1eaf32e0.zip |
Move WebIDL methods to traits implemented by JSRef types.
Diffstat (limited to 'src/components/script/dom/htmliframeelement.rs')
-rw-r--r-- | src/components/script/dom/htmliframeelement.rs | 92 |
1 files changed, 62 insertions, 30 deletions
diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index c157e2ad445..316468342f1 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -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 } } |