diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index bbe98d4565e..efb47baaf48 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -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 { + let element = HTMLIFrameElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLIFrameElementBinding::Wrap) + } +} + impl HTMLIFrameElement { pub fn Src(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 7d8553b6099..ff7b17d5997 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -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);