Introduce HTMLIFrameElement::new.

This commit is contained in:
Ms2ger 2013-10-31 15:53:43 +01:00
parent 8e5cd9f3a8
commit 7c17970c21
2 changed files with 20 additions and 2 deletions

View file

@ -2,10 +2,12 @@
* 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::HTMLIFrameElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
use dom::document::AbstractDocument;
use dom::element::HTMLIframeElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView};
use dom::node::{AbstractNode, Node, ScriptView};
use dom::windowproxy::WindowProxy;
use geom::size::Size2D;
use geom::rect::Rect;
@ -58,6 +60,22 @@ impl HTMLIFrameElement {
}
}
impl HTMLIFrameElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLIFrameElement {
HTMLIFrameElement {
htmlelement: HTMLElement::new(HTMLIframeElementTypeId, localName, document),
frame: None,
size: None,
sandbox: None,
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLIFrameElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLIFrameElementBinding::Wrap)
}
}
impl HTMLIFrameElement {
pub fn Src(&self) -> DOMString {
None

View file

@ -271,7 +271,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "ul", HTMLUListElementTypeId, HTMLUListElement, []);
handle_element!(cx, document, tag, "img", HTMLImageElementTypeId, HTMLImageElement, [(image: None)]);
handle_element!(cx, document, tag, "iframe", HTMLIframeElementTypeId, HTMLIFrameElement, [(frame: None), (size: None), (sandbox: None)]);
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@ -286,6 +285,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_newable_element!(document, tag, "h4", HTMLHeadingElement, Heading4);
handle_newable_element!(document, tag, "h5", HTMLHeadingElement, Heading5);
handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
handle_newable_element!(document, tag, "iframe", HTMLIFrameElement);
handle_newable_element!(document, tag, "td", HTMLTableDataCellElement);
handle_newable_element!(document, tag, "th", HTMLTableHeaderCellElement);
handle_newable_element!(document, tag, "video", HTMLVideoElement);