diff options
Diffstat (limited to 'src/components/script/dom/htmlparamelement.rs')
-rw-r--r-- | src/components/script/dom/htmlparamelement.rs | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs index 781221bfad0..115d1759964 100644 --- a/src/components/script/dom/htmlparamelement.rs +++ b/src/components/script/dom/htmlparamelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLParamElementBinding; use dom::bindings::codegen::InheritTypes::HTMLParamElementDerived; -use dom::bindings::js::JS; +use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLParamElementTypeId; @@ -28,48 +28,59 @@ impl HTMLParamElementDerived for EventTarget { } impl HTMLParamElement { - pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLParamElement { + pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLParamElement { HTMLParamElement { htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, document) } } - pub fn new(localName: DOMString, document: &JS<Document>) -> JS<HTMLParamElement> { - let element = HTMLParamElement::new_inherited(localName, document.clone()); + pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParamElement> { + let element = HTMLParamElement::new_inherited(localName, document); Node::reflect_node(~element, document, HTMLParamElementBinding::Wrap) } } -impl HTMLParamElement { - pub fn Name(&self) -> DOMString { +pub trait HTMLParamElementMethods { + fn Name(&self) -> DOMString; + fn SetName(&mut self, _name: DOMString) -> ErrorResult; + fn Value(&self) -> DOMString; + fn SetValue(&mut self, _value: DOMString) -> ErrorResult; + fn Type(&self) -> DOMString; + fn SetType(&mut self, _type: DOMString) -> ErrorResult; + fn ValueType(&self) -> DOMString; + fn SetValueType(&mut self, _value_type: DOMString) -> ErrorResult; +} + +impl<'a> HTMLParamElementMethods for JSRef<'a, HTMLParamElement> { + fn Name(&self) -> DOMString { ~"" } - pub fn SetName(&mut self, _name: DOMString) -> ErrorResult { + fn SetName(&mut self, _name: DOMString) -> ErrorResult { Ok(()) } - pub fn Value(&self) -> DOMString { + fn Value(&self) -> DOMString { ~"" } - pub fn SetValue(&mut self, _value: DOMString) -> ErrorResult { + fn SetValue(&mut self, _value: DOMString) -> ErrorResult { Ok(()) } - pub fn Type(&self) -> DOMString { + fn Type(&self) -> DOMString { ~"" } - pub fn SetType(&mut self, _type: DOMString) -> ErrorResult { + fn SetType(&mut self, _type: DOMString) -> ErrorResult { Ok(()) } - pub fn ValueType(&self) -> DOMString { + fn ValueType(&self) -> DOMString { ~"" } - pub fn SetValueType(&mut self, _value_type: DOMString) -> ErrorResult { + fn SetValueType(&mut self, _value_type: DOMString) -> ErrorResult { Ok(()) } } |