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

View file

@ -225,7 +225,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []);
handle_element!(cx, document, tag, "fieldset",HTMLFieldSetElementTypeId, HTMLFieldSetElement, []);
handle_element!(cx, document, tag, "font", HTMLFontElementTypeId, HTMLFontElement, []);
handle_element!(cx, document, tag, "form", HTMLFormElementTypeId, HTMLFormElement, []);
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@ -238,6 +237,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_newable_element!(document, tag, "col", HTMLTableColElement);
handle_newable_element!(document, tag, "colgroup", HTMLTableColElement);
handle_newable_element!(document, tag, "del", HTMLModElement);
handle_newable_element!(document, tag, "form", HTMLFormElement);
handle_newable_element!(document, tag, "frame", HTMLFrameElement);
handle_newable_element!(document, tag, "frameset", HTMLFrameSetElement);
handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1);