aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2013-11-02 11:51:02 +0100
committerMs2ger <ms2ger@gmail.com>2013-11-02 11:51:02 +0100
commit996f2dcbb9f6a6e9e28c4069d0b3d915ad9f3eb6 (patch)
tree2a5001220587c483517552f82b1a4e2a7bfdf67d /src
parentd8198249ecec1c56cf258b7092127105b7136ae9 (diff)
downloadservo-996f2dcbb9f6a6e9e28c4069d0b3d915ad9f3eb6.tar.gz
servo-996f2dcbb9f6a6e9e28c4069d0b3d915ad9f3eb6.zip
Introduce HTMLFrameElement::new.
Diffstat (limited to 'src')
-rw-r--r--src/components/script/dom/htmlframeelement.rs16
-rw-r--r--src/components/script/html/hubbub_html_parser.rs2
2 files changed, 17 insertions, 1 deletions
diff --git a/src/components/script/dom/htmlframeelement.rs b/src/components/script/dom/htmlframeelement.rs
index 6874f32f28c..30a6e30f24c 100644
--- a/src/components/script/dom/htmlframeelement.rs
+++ b/src/components/script/dom/htmlframeelement.rs
@@ -2,9 +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::HTMLFrameElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
+use dom::element::HTMLFrameElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
use dom::windowproxy::WindowProxy;
pub struct HTMLFrameElement {
@@ -12,6 +15,19 @@ pub struct HTMLFrameElement {
}
impl HTMLFrameElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFrameElement {
+ HTMLFrameElement {
+ htmlelement: HTMLElement::new(HTMLFrameElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLFrameElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLFrameElementBinding::Wrap)
+ }
+}
+
+impl HTMLFrameElement {
pub fn Name(&self) -> DOMString {
None
}
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index 49d9146b3fc..2d0b99e8ac8 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -226,7 +226,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
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_element!(cx, document, tag, "frame", HTMLFrameElementTypeId, HTMLFrameElement, []);
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@@ -239,6 +238,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, "frame", HTMLFrameElement);
handle_newable_element!(document, tag, "frameset", HTMLFrameSetElement);
handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1);
handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2);