Introduce HTMLFieldSetElement::new.

This commit is contained in:
Ms2ger 2013-11-02 12:10:27 +01:00
parent a8578701a8
commit f3b1cabf32
2 changed files with 18 additions and 2 deletions

View file

@ -2,16 +2,32 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLFieldSetElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLFieldSetElementTypeId;
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
pub struct HTMLFieldSetElement { pub struct HTMLFieldSetElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLFieldSetElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFieldSetElement {
HTMLFieldSetElement {
htmlelement: HTMLElement::new(HTMLFieldSetElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFieldSetElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFieldSetElementBinding::Wrap)
}
}
impl HTMLFieldSetElement { impl HTMLFieldSetElement {
pub fn Disabled(&self) -> bool { pub fn Disabled(&self) -> bool {
false false

View file

@ -223,7 +223,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []); handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []);
handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []); handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []);
handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []); handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []);
handle_element!(cx, document, tag, "fieldset",HTMLFieldSetElementTypeId, HTMLFieldSetElement, []);
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@ -236,6 +235,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, "col", HTMLTableColElement);
handle_newable_element!(document, tag, "colgroup", HTMLTableColElement); handle_newable_element!(document, tag, "colgroup", HTMLTableColElement);
handle_newable_element!(document, tag, "del", HTMLModElement); handle_newable_element!(document, tag, "del", HTMLModElement);
handle_newable_element!(document, tag, "fieldset", HTMLFieldSetElement);
handle_newable_element!(document, tag, "font", HTMLFontElement); handle_newable_element!(document, tag, "font", HTMLFontElement);
handle_newable_element!(document, tag, "form", HTMLFormElement); handle_newable_element!(document, tag, "form", HTMLFormElement);
handle_newable_element!(document, tag, "frame", HTMLFrameElement); handle_newable_element!(document, tag, "frame", HTMLFrameElement);