aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmlmainelement.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2013-11-01 22:46:44 +0100
committerMs2ger <ms2ger@gmail.com>2013-11-01 22:46:44 +0100
commit81018b3dcc35a1ccba66049bd646409ad9f3beab (patch)
tree20f667442d0744fe9403850a2905637ca88801c0 /src/components/script/dom/htmlmainelement.rs
parent5a18c616d6a7f99c2813fc9b55b9e5879e90b64d (diff)
downloadservo-81018b3dcc35a1ccba66049bd646409ad9f3beab.tar.gz
servo-81018b3dcc35a1ccba66049bd646409ad9f3beab.zip
Introduce HTMLMainElement::new.
Diffstat (limited to 'src/components/script/dom/htmlmainelement.rs')
-rw-r--r--src/components/script/dom/htmlmainelement.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/script/dom/htmlmainelement.rs b/src/components/script/dom/htmlmainelement.rs
index c81d73b2b40..83f48e74e5b 100644
--- a/src/components/script/dom/htmlmainelement.rs
+++ b/src/components/script/dom/htmlmainelement.rs
@@ -2,8 +2,25 @@
* 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::HTMLMainElementBinding;
+use dom::document::AbstractDocument;
+use dom::element::HTMLMainElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLMainElement {
htmlelement: HTMLElement
}
+
+impl HTMLMainElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMainElement {
+ HTMLMainElement {
+ htmlelement: HTMLElement::new(HTMLMainElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLMainElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLMainElementBinding::Wrap)
+ }
+}