Introduce HTMLFormElement::new.

This commit is contained in:
Ms2ger 2013-11-02 11:55:54 +01:00
parent 996f2dcbb9
commit b923bcdef7
2 changed files with 18 additions and 2 deletions

View file

@ -2,15 +2,31 @@
* 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::HTMLFormElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLFormElementTypeId;
use dom::htmlcollection::HTMLCollection;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView};
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLFormElement {
htmlelement: HTMLElement
}
impl HTMLFormElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFormElement {
HTMLFormElement {
htmlelement: HTMLElement::new(HTMLFormElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFormElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFormElementBinding::Wrap)
}
}
impl HTMLFormElement {
pub fn AcceptCharset(&self) -> DOMString {
None