aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-10-31 13:55:29 -0700
committerbors-servo <release+servo@mozilla.com>2013-10-31 13:55:29 -0700
commit041f3a8b06e3f29e99464af752cad8f1a7e93540 (patch)
tree7d259817ddc40c38163ea80d6f8884f9c1729e0c /src
parentd54994a4003481aad8a2b6611d30a2f64b50f071 (diff)
parent78010f96bcb757bdd2118bb9a0d0629104624766 (diff)
downloadservo-041f3a8b06e3f29e99464af752cad8f1a7e93540.tar.gz
servo-041f3a8b06e3f29e99464af752cad8f1a7e93540.zip
auto merge of #1162 : Ms2ger/servo/new-htmlelement, r=jdm
Diffstat (limited to 'src')
-rw-r--r--src/components/script/dom/htmlaudioelement.rs14
-rw-r--r--src/components/script/dom/htmlheadingelement.rs18
-rw-r--r--src/components/script/dom/htmliframeelement.rs20
-rw-r--r--src/components/script/dom/htmlimageelement.rs19
-rw-r--r--src/components/script/dom/htmlmediaelement.rs2
-rw-r--r--src/components/script/dom/htmlparagraphelement.rs17
-rw-r--r--src/components/script/dom/htmlparamelement.rs17
-rw-r--r--src/components/script/dom/htmlpreelement.rs17
-rw-r--r--src/components/script/dom/htmlprogresselement.rs17
-rw-r--r--src/components/script/dom/htmlquoteelement.rs17
-rw-r--r--src/components/script/dom/htmlscriptelement.rs17
-rw-r--r--src/components/script/dom/htmlselectelement.rs18
-rw-r--r--src/components/script/dom/htmlsourceelement.rs17
-rw-r--r--src/components/script/dom/htmlspanelement.rs17
-rw-r--r--src/components/script/dom/htmlstyleelement.rs17
-rw-r--r--src/components/script/dom/htmltablecaptionelement.rs17
-rw-r--r--src/components/script/dom/htmltablecellelement.rs2
-rw-r--r--src/components/script/dom/htmltablecolelement.rs17
-rw-r--r--src/components/script/dom/htmltabledatacellelement.rs17
-rw-r--r--src/components/script/dom/htmltableelement.rs16
-rw-r--r--src/components/script/dom/htmltableheadercellelement.rs17
-rw-r--r--src/components/script/dom/htmltablerowelement.rs17
-rw-r--r--src/components/script/dom/htmltablesectionelement.rs17
-rw-r--r--src/components/script/dom/htmltemplateelement.rs14
-rw-r--r--src/components/script/dom/htmltextareaelement.rs17
-rw-r--r--src/components/script/dom/htmltimeelement.rs17
-rw-r--r--src/components/script/dom/htmltitleelement.rs17
-rw-r--r--src/components/script/dom/htmltrackelement.rs17
-rw-r--r--src/components/script/dom/htmlulistelement.rs17
-rw-r--r--src/components/script/dom/htmlvideoelement.rs17
-rw-r--r--src/components/script/html/hubbub_html_parser.rs99
31 files changed, 517 insertions, 62 deletions
diff --git a/src/components/script/dom/htmlaudioelement.rs b/src/components/script/dom/htmlaudioelement.rs
index dbb33a42331..6ece4235c7c 100644
--- a/src/components/script/dom/htmlaudioelement.rs
+++ b/src/components/script/dom/htmlaudioelement.rs
@@ -2,11 +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::HTMLAudioElementBinding;
+use dom::document::AbstractDocument;
+use dom::element::HTMLAudioElementTypeId;
use dom::htmlmediaelement::HTMLMediaElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLAudioElement {
htmlmediaelement: HTMLMediaElement
}
impl HTMLAudioElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAudioElement {
+ HTMLAudioElement {
+ htmlmediaelement: HTMLMediaElement::new_inherited(HTMLAudioElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLAudioElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLAudioElementBinding::Wrap)
+ }
}
diff --git a/src/components/script/dom/htmlheadingelement.rs b/src/components/script/dom/htmlheadingelement.rs
index e9f470f7e8a..13370230c8b 100644
--- a/src/components/script/dom/htmlheadingelement.rs
+++ b/src/components/script/dom/htmlheadingelement.rs
@@ -2,8 +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::HTMLHeadingElementBinding;
use dom::bindings::utils::DOMString;
+use dom::document::AbstractDocument;
+use dom::element::HTMLHeadingElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub enum HeadingLevel {
Heading1,
@@ -20,6 +24,20 @@ pub struct HTMLHeadingElement {
}
impl HTMLHeadingElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> HTMLHeadingElement {
+ HTMLHeadingElement {
+ htmlelement: HTMLElement::new(HTMLHeadingElementTypeId, localName, document),
+ level: level,
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> AbstractNode<ScriptView> {
+ let element = HTMLHeadingElement::new_inherited(localName, document, level);
+ Node::reflect_node(@mut element, document, HTMLHeadingElementBinding::Wrap)
+ }
+}
+
+impl HTMLHeadingElement {
pub fn Align(&self) -> DOMString {
None
}
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;
@@ -59,6 +61,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
}
diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs
index 49010ee0f62..f10dccf28d4 100644
--- a/src/components/script/dom/htmlimageelement.rs
+++ b/src/components/script/dom/htmlimageelement.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::HTMLImageElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
+use dom::document::AbstractDocument;
+use dom::element::HTMLImageElementTypeId;
use dom::htmlelement::HTMLElement;
-use dom::node::{ScriptView, AbstractNode};
+use dom::node::{AbstractNode, Node, ScriptView};
use extra::url::Url;
use servo_util::geometry::to_px;
use layout_interface::{ContentBoxQuery, ContentBoxResponse};
@@ -19,6 +22,20 @@ pub struct HTMLImageElement {
}
impl HTMLImageElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLImageElement {
+ HTMLImageElement {
+ htmlelement: HTMLElement::new(HTMLImageElementTypeId, localName, document),
+ image: None,
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLImageElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLImageElementBinding::Wrap)
+ }
+}
+
+impl HTMLImageElement {
/// Makes the local `image` member match the status of the `src` attribute and starts
/// prefetching the image. This method must be called after `src` is changed.
pub fn update_image(&mut self, image_cache: ImageCacheTask, url: Option<Url>) {
diff --git a/src/components/script/dom/htmlmediaelement.rs b/src/components/script/dom/htmlmediaelement.rs
index 39c45a3585d..683ae7bf2e1 100644
--- a/src/components/script/dom/htmlmediaelement.rs
+++ b/src/components/script/dom/htmlmediaelement.rs
@@ -12,7 +12,7 @@ pub struct HTMLMediaElement {
}
impl HTMLMediaElement {
- pub fn new(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement {
+ pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement {
HTMLMediaElement {
htmlelement: HTMLElement::new(type_id, tag_name, document)
}
diff --git a/src/components/script/dom/htmlparagraphelement.rs b/src/components/script/dom/htmlparagraphelement.rs
index d8ed198e402..bfd39a240f9 100644
--- a/src/components/script/dom/htmlparagraphelement.rs
+++ b/src/components/script/dom/htmlparagraphelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLParagraphElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLParagraphElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLParagraphElement {
htmlelement: HTMLElement
}
impl HTMLParagraphElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParagraphElement {
+ HTMLParagraphElement {
+ htmlelement: HTMLElement::new(HTMLParagraphElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLParagraphElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLParagraphElementBinding::Wrap)
+ }
+}
+
+impl HTMLParagraphElement {
pub fn Align(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs
index c50ca16cb9e..38f48a22c5c 100644
--- a/src/components/script/dom/htmlparamelement.rs
+++ b/src/components/script/dom/htmlparamelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLParamElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLParamElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLParamElement {
htmlelement: HTMLElement
}
impl HTMLParamElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParamElement {
+ HTMLParamElement {
+ htmlelement: HTMLElement::new(HTMLParamElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLParamElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLParamElementBinding::Wrap)
+ }
+}
+
+impl HTMLParamElement {
pub fn Name(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmlpreelement.rs b/src/components/script/dom/htmlpreelement.rs
index b866d360e60..2a2a9d64841 100644
--- a/src/components/script/dom/htmlpreelement.rs
+++ b/src/components/script/dom/htmlpreelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLPreElementBinding;
use dom::bindings::utils::{ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLPreElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLPreElement {
htmlelement: HTMLElement,
}
impl HTMLPreElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLPreElement {
+ HTMLPreElement {
+ htmlelement: HTMLElement::new(HTMLPreElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLPreElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLPreElementBinding::Wrap)
+ }
+}
+
+impl HTMLPreElement {
pub fn Width(&self) -> i32 {
0
}
diff --git a/src/components/script/dom/htmlprogresselement.rs b/src/components/script/dom/htmlprogresselement.rs
index 3ef1011a1dc..9983d71a0dd 100644
--- a/src/components/script/dom/htmlprogresselement.rs
+++ b/src/components/script/dom/htmlprogresselement.rs
@@ -2,14 +2,31 @@
* 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::HTMLProgressElementBinding;
use dom::bindings::utils::{ErrorResult, Fallible};
+use dom::document::AbstractDocument;
+use dom::element::HTMLProgressElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLProgressElement {
htmlelement: HTMLElement,
}
impl HTMLProgressElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLProgressElement {
+ HTMLProgressElement {
+ htmlelement: HTMLElement::new(HTMLProgressElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLProgressElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLProgressElementBinding::Wrap)
+ }
+}
+
+impl HTMLProgressElement {
pub fn Value(&self) -> f64 {
0f64
}
diff --git a/src/components/script/dom/htmlquoteelement.rs b/src/components/script/dom/htmlquoteelement.rs
index 107603aa1d5..682b4e68b20 100644
--- a/src/components/script/dom/htmlquoteelement.rs
+++ b/src/components/script/dom/htmlquoteelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLQuoteElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLQuoteElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLQuoteElement {
htmlelement: HTMLElement,
}
impl HTMLQuoteElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLQuoteElement {
+ HTMLQuoteElement {
+ htmlelement: HTMLElement::new(HTMLQuoteElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLQuoteElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLQuoteElementBinding::Wrap)
+ }
+}
+
+impl HTMLQuoteElement {
pub fn Cite(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmlscriptelement.rs b/src/components/script/dom/htmlscriptelement.rs
index f3de42eae26..0925a0109f5 100644
--- a/src/components/script/dom/htmlscriptelement.rs
+++ b/src/components/script/dom/htmlscriptelement.rs
@@ -2,8 +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::HTMLScriptElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLScriptElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
use servo_util::tree::ElementLike;
pub struct HTMLScriptElement {
@@ -11,6 +15,19 @@ pub struct HTMLScriptElement {
}
impl HTMLScriptElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLScriptElement {
+ HTMLScriptElement {
+ htmlelement: HTMLElement::new(HTMLScriptElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLScriptElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLScriptElementBinding::Wrap)
+ }
+}
+
+impl HTMLScriptElement {
pub fn Src(&self) -> DOMString {
self.htmlelement.element.get_attr("src").map(|s| s.to_str())
}
diff --git a/src/components/script/dom/htmlselectelement.rs b/src/components/script/dom/htmlselectelement.rs
index 14b5de595d1..38c3da4292a 100644
--- a/src/components/script/dom/htmlselectelement.rs
+++ b/src/components/script/dom/htmlselectelement.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::HTMLSelectElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLSelectElementTypeId;
use dom::htmlelement::HTMLElement;
-use dom::node::{AbstractNode, ScriptView};
+use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState;
pub struct HTMLSelectElement {
@@ -12,6 +15,19 @@ pub struct HTMLSelectElement {
}
impl HTMLSelectElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSelectElement {
+ HTMLSelectElement {
+ htmlelement: HTMLElement::new(HTMLSelectElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLSelectElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLSelectElementBinding::Wrap)
+ }
+}
+
+impl HTMLSelectElement {
pub fn Autofocus(&self) -> bool {
false
}
diff --git a/src/components/script/dom/htmlsourceelement.rs b/src/components/script/dom/htmlsourceelement.rs
index 0fe7bfdf57a..4168f891835 100644
--- a/src/components/script/dom/htmlsourceelement.rs
+++ b/src/components/script/dom/htmlsourceelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLSourceElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLSourceElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLSourceElement {
htmlelement: HTMLElement
}
impl HTMLSourceElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSourceElement {
+ HTMLSourceElement {
+ htmlelement: HTMLElement::new(HTMLSourceElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLSourceElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLSourceElementBinding::Wrap)
+ }
+}
+
+impl HTMLSourceElement {
pub fn Src(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmlspanelement.rs b/src/components/script/dom/htmlspanelement.rs
index 9c3ed92f402..78eb18323b1 100644
--- a/src/components/script/dom/htmlspanelement.rs
+++ b/src/components/script/dom/htmlspanelement.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::HTMLSpanElementBinding;
+use dom::document::AbstractDocument;
+use dom::element::HTMLSpanElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLSpanElement {
htmlelement: HTMLElement
}
+
+impl HTMLSpanElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSpanElement {
+ HTMLSpanElement {
+ htmlelement: HTMLElement::new(HTMLSpanElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLSpanElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLSpanElementBinding::Wrap)
+ }
+}
diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs
index 3d1e0cc95f2..d6817a7d2b9 100644
--- a/src/components/script/dom/htmlstyleelement.rs
+++ b/src/components/script/dom/htmlstyleelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLStyleElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLStyleElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLStyleElement {
htmlelement: HTMLElement,
}
impl HTMLStyleElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLStyleElement {
+ HTMLStyleElement {
+ htmlelement: HTMLElement::new(HTMLStyleElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLStyleElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLStyleElementBinding::Wrap)
+ }
+}
+
+impl HTMLStyleElement {
pub fn Disabled(&self) -> bool {
false
}
diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs
index f812e512ebc..405e59cf272 100644
--- a/src/components/script/dom/htmltablecaptionelement.rs
+++ b/src/components/script/dom/htmltablecaptionelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTableCaptionElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableCaptionElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableCaptionElement {
htmlelement: HTMLElement
}
impl HTMLTableCaptionElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableCaptionElement {
+ HTMLTableCaptionElement {
+ htmlelement: HTMLElement::new(HTMLTableCaptionElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableCaptionElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableCaptionElementBinding::Wrap)
+ }
+}
+
+impl HTMLTableCaptionElement {
pub fn Align(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmltablecellelement.rs b/src/components/script/dom/htmltablecellelement.rs
index 365030b90be..771cd389ecb 100644
--- a/src/components/script/dom/htmltablecellelement.rs
+++ b/src/components/script/dom/htmltablecellelement.rs
@@ -12,7 +12,7 @@ pub struct HTMLTableCellElement {
}
impl HTMLTableCellElement {
- pub fn new(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement {
+ pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement {
HTMLTableCellElement {
htmlelement: HTMLElement::new(type_id, tag_name, document)
}
diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs
index 78ad9867e0e..27817306a2c 100644
--- a/src/components/script/dom/htmltablecolelement.rs
+++ b/src/components/script/dom/htmltablecolelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTableColElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableColElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableColElement {
htmlelement: HTMLElement,
}
impl HTMLTableColElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableColElement {
+ HTMLTableColElement {
+ htmlelement: HTMLElement::new(HTMLTableColElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableColElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableColElementBinding::Wrap)
+ }
+}
+
+impl HTMLTableColElement {
pub fn Span(&self) -> u32 {
0
}
diff --git a/src/components/script/dom/htmltabledatacellelement.rs b/src/components/script/dom/htmltabledatacellelement.rs
index f0a69d97409..4b3dda09745 100644
--- a/src/components/script/dom/htmltabledatacellelement.rs
+++ b/src/components/script/dom/htmltabledatacellelement.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::HTMLTableDataCellElementBinding;
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableDataCellElementTypeId;
use dom::htmltablecellelement::HTMLTableCellElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableDataCellElement {
htmltablecellelement: HTMLTableCellElement,
}
+
+impl HTMLTableDataCellElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableDataCellElement {
+ HTMLTableDataCellElement {
+ htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableDataCellElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableDataCellElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableDataCellElementBinding::Wrap)
+ }
+}
diff --git a/src/components/script/dom/htmltableelement.rs b/src/components/script/dom/htmltableelement.rs
index 3d7d2bf9146..8cdf888440e 100644
--- a/src/components/script/dom/htmltableelement.rs
+++ b/src/components/script/dom/htmltableelement.rs
@@ -2,15 +2,31 @@
* 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::HTMLTableElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableElement {
htmlelement: HTMLElement,
}
impl HTMLTableElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableElement {
+ HTMLTableElement {
+ htmlelement: HTMLElement::new(HTMLTableElementTypeId, localName, document)
+ }
+ }
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableElementBinding::Wrap)
+ }
+}
+
+impl HTMLTableElement {
pub fn DeleteCaption(&self) {
}
diff --git a/src/components/script/dom/htmltableheadercellelement.rs b/src/components/script/dom/htmltableheadercellelement.rs
index e7bb4b0fa38..59a9d596aea 100644
--- a/src/components/script/dom/htmltableheadercellelement.rs
+++ b/src/components/script/dom/htmltableheadercellelement.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::HTMLTableHeaderCellElementBinding;
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableHeaderCellElementTypeId;
use dom::htmltablecellelement::HTMLTableCellElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableHeaderCellElement {
htmltablecellelement: HTMLTableCellElement,
}
+
+impl HTMLTableHeaderCellElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableHeaderCellElement {
+ HTMLTableHeaderCellElement {
+ htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableHeaderCellElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableHeaderCellElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableHeaderCellElementBinding::Wrap)
+ }
+}
diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs
index c86899c238a..5d61f0e7fb5 100644
--- a/src/components/script/dom/htmltablerowelement.rs
+++ b/src/components/script/dom/htmltablerowelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTableRowElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableRowElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableRowElement {
htmlelement: HTMLElement,
}
impl HTMLTableRowElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableRowElement {
+ HTMLTableRowElement {
+ htmlelement: HTMLElement::new(HTMLTableRowElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableRowElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableRowElementBinding::Wrap)
+ }
+}
+
+impl HTMLTableRowElement {
pub fn RowIndex(&self) -> i32 {
0
}
diff --git a/src/components/script/dom/htmltablesectionelement.rs b/src/components/script/dom/htmltablesectionelement.rs
index 91579e252e5..08951af578a 100644
--- a/src/components/script/dom/htmltablesectionelement.rs
+++ b/src/components/script/dom/htmltablesectionelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTableSectionElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTableSectionElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableSectionElement {
htmlelement: HTMLElement,
}
impl HTMLTableSectionElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableSectionElement {
+ HTMLTableSectionElement {
+ htmlelement: HTMLElement::new(HTMLTableSectionElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTableSectionElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTableSectionElementBinding::Wrap)
+ }
+}
+
+impl HTMLTableSectionElement {
pub fn DeleteRow(&mut self, _index: i32) -> ErrorResult {
Ok(())
}
diff --git a/src/components/script/dom/htmltemplateelement.rs b/src/components/script/dom/htmltemplateelement.rs
index 11e4e399948..8ccea37c420 100644
--- a/src/components/script/dom/htmltemplateelement.rs
+++ b/src/components/script/dom/htmltemplateelement.rs
@@ -2,11 +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::HTMLTemplateElementBinding;
+use dom::document::AbstractDocument;
+use dom::element::HTMLTemplateElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTemplateElement {
htmlelement: HTMLElement,
}
impl HTMLTemplateElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTemplateElement {
+ HTMLTemplateElement {
+ htmlelement: HTMLElement::new(HTMLTemplateElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTemplateElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTemplateElementBinding::Wrap)
+ }
}
diff --git a/src/components/script/dom/htmltextareaelement.rs b/src/components/script/dom/htmltextareaelement.rs
index 07531e87a6f..67f8d8d5bba 100644
--- a/src/components/script/dom/htmltextareaelement.rs
+++ b/src/components/script/dom/htmltextareaelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTextAreaElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTextAreaElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTextAreaElement {
htmlelement: HTMLElement,
}
impl HTMLTextAreaElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTextAreaElement {
+ HTMLTextAreaElement {
+ htmlelement: HTMLElement::new(HTMLTextAreaElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTextAreaElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTextAreaElementBinding::Wrap)
+ }
+}
+
+impl HTMLTextAreaElement {
pub fn Autofocus(&self) -> bool {
false
}
diff --git a/src/components/script/dom/htmltimeelement.rs b/src/components/script/dom/htmltimeelement.rs
index d0a685de3a3..ec615d60b8c 100644
--- a/src/components/script/dom/htmltimeelement.rs
+++ b/src/components/script/dom/htmltimeelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTimeElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTimeElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTimeElement {
htmlelement: HTMLElement
}
impl HTMLTimeElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTimeElement {
+ HTMLTimeElement {
+ htmlelement: HTMLElement::new(HTMLTimeElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTimeElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTimeElementBinding::Wrap)
+ }
+}
+
+impl HTMLTimeElement {
pub fn DateTime(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmltitleelement.rs b/src/components/script/dom/htmltitleelement.rs
index 5a3aed5f4ff..e54ebdebb22 100644
--- a/src/components/script/dom/htmltitleelement.rs
+++ b/src/components/script/dom/htmltitleelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTitleElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTitleElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTitleElement {
htmlelement: HTMLElement,
}
impl HTMLTitleElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTitleElement {
+ HTMLTitleElement {
+ htmlelement: HTMLElement::new(HTMLTitleElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTitleElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTitleElementBinding::Wrap)
+ }
+}
+
+impl HTMLTitleElement {
pub fn Text(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmltrackelement.rs b/src/components/script/dom/htmltrackelement.rs
index 4c3e7cb055c..9b6fae79360 100644
--- a/src/components/script/dom/htmltrackelement.rs
+++ b/src/components/script/dom/htmltrackelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLTrackElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLTrackElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTrackElement {
htmlelement: HTMLElement,
}
impl HTMLTrackElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTrackElement {
+ HTMLTrackElement {
+ htmlelement: HTMLElement::new(HTMLTrackElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLTrackElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLTrackElementBinding::Wrap)
+ }
+}
+
+impl HTMLTrackElement {
pub fn Kind(&self) -> DOMString {
None
}
diff --git a/src/components/script/dom/htmlulistelement.rs b/src/components/script/dom/htmlulistelement.rs
index 5883687b653..478d34681f9 100644
--- a/src/components/script/dom/htmlulistelement.rs
+++ b/src/components/script/dom/htmlulistelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLUListElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLUListElementTypeId;
use dom::htmlelement::HTMLElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLUListElement {
htmlelement: HTMLElement
}
impl HTMLUListElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUListElement {
+ HTMLUListElement {
+ htmlelement: HTMLElement::new(HTMLUListElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLUListElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLUListElementBinding::Wrap)
+ }
+}
+
+impl HTMLUListElement {
pub fn Compact(&self) -> bool {
false
}
diff --git a/src/components/script/dom/htmlvideoelement.rs b/src/components/script/dom/htmlvideoelement.rs
index a485480ad04..b78e13947e8 100644
--- a/src/components/script/dom/htmlvideoelement.rs
+++ b/src/components/script/dom/htmlvideoelement.rs
@@ -2,14 +2,31 @@
* 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::HTMLVideoElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLVideoElementTypeId;
use dom::htmlmediaelement::HTMLMediaElement;
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLVideoElement {
htmlmediaelement: HTMLMediaElement
}
impl HTMLVideoElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLVideoElement {
+ HTMLVideoElement {
+ htmlmediaelement: HTMLMediaElement::new_inherited(HTMLVideoElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLVideoElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLVideoElementBinding::Wrap)
+ }
+}
+
+impl HTMLVideoElement {
pub fn Width(&self) -> u32 {
0
}
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index d6883cb8acc..c0da70de983 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -56,26 +56,15 @@ macro_rules! handle_htmlelement(
$cx, $document, $tag, $string, $type_id, $ctor, []);
)
)
-macro_rules! handle_htmlmediaelement(
- ($cx: expr,
- $document: expr,
- $tag: expr,
- $string: expr,
- $type_id: expr,
- $ctor: ident) => (
- handle_element_base!(htmlmediaelement, HTMLMediaElement,
- $cx, $document, $tag, $string, $type_id, $ctor, []);
- )
-)
-macro_rules! handle_htmltablecellelement(
- ($cx: expr,
- $document: expr,
- $tag: expr,
+macro_rules! handle_newable_element(
+ ($document: expr,
+ $localName: expr,
$string: expr,
- $type_id: expr,
- $ctor: ident) => (
- handle_element_base!(htmltablecellelement, HTMLTableCellElement,
- $cx, $document, $tag, $string, $type_id, $ctor, []);
+ $ctor: ident
+ $(, $arg:expr )*) => (
+ if eq_slice($localName, $string) {
+ return $ctor::new(($localName).to_str(), $document $(, $arg)*);
+ }
)
)
macro_rules! handle_element_base(
@@ -258,39 +247,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []);
handle_element!(cx, document, tag, "optgroup",HTMLOptGroupElementTypeId, HTMLOptGroupElement, []);
handle_element!(cx, document, tag, "output", HTMLOutputElementTypeId, HTMLOutputElement, []);
- handle_element!(cx, document, tag, "p", HTMLParagraphElementTypeId, HTMLParagraphElement, []);
- handle_element!(cx, document, tag, "param", HTMLParamElementTypeId, HTMLParamElement, []);
- handle_element!(cx, document, tag, "pre", HTMLPreElementTypeId, HTMLPreElement, []);
- handle_element!(cx, document, tag, "progress",HTMLProgressElementTypeId, HTMLProgressElement, []);
- handle_element!(cx, document, tag, "q", HTMLQuoteElementTypeId, HTMLQuoteElement, []);
- handle_element!(cx, document, tag, "script", HTMLScriptElementTypeId, HTMLScriptElement, []);
- handle_element!(cx, document, tag, "select", HTMLSelectElementTypeId, HTMLSelectElement, []);
- handle_element!(cx, document, tag, "source", HTMLSourceElementTypeId, HTMLSourceElement, []);
- handle_element!(cx, document, tag, "span", HTMLSpanElementTypeId, HTMLSpanElement, []);
- handle_element!(cx, document, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
- handle_element!(cx, document, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
- handle_element!(cx, document, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []);
- handle_element!(cx, document, tag, "col", HTMLTableColElementTypeId, HTMLTableColElement, []);
- handle_element!(cx, document, tag, "colgroup",HTMLTableColElementTypeId, HTMLTableColElement, []);
- handle_element!(cx, document, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
- handle_element!(cx, document, tag, "template",HTMLTemplateElementTypeId, HTMLTemplateElement, []);
- handle_element!(cx, document, tag, "textarea",HTMLTextAreaElementTypeId, HTMLTextAreaElement, []);
- handle_element!(cx, document, tag, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
- handle_element!(cx, document, tag, "title", HTMLTitleElementTypeId, HTMLTitleElement, []);
- handle_element!(cx, document, tag, "tr", HTMLTableRowElementTypeId, HTMLTableRowElement, []);
- handle_element!(cx, document, tag, "track", HTMLTrackElementTypeId, HTMLTrackElement, []);
- 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_element!(cx, document, tag, "h1", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading1)]);
- handle_element!(cx, document, tag, "h2", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading2)]);
- handle_element!(cx, document, tag, "h3", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading3)]);
- handle_element!(cx, document, tag, "h4", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading4)]);
- handle_element!(cx, document, tag, "h5", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading5)]);
- handle_element!(cx, document, tag, "h6", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading6)]);
-
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@@ -298,11 +254,40 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_htmlelement!(cx, document, tag, "section", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement);
- handle_htmlmediaelement!(cx, document, tag, "audio", HTMLAudioElementTypeId, HTMLAudioElement);
- handle_htmlmediaelement!(cx, document, tag, "video", HTMLVideoElementTypeId, HTMLVideoElement);
-
- handle_htmltablecellelement!(cx, document, tag, "td", HTMLTableDataCellElementTypeId, HTMLTableDataCellElement);
- handle_htmltablecellelement!(cx, document, tag, "th", HTMLTableHeaderCellElementTypeId, HTMLTableHeaderCellElement);
+ handle_newable_element!(document, tag, "audio", HTMLAudioElement);
+ handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement);
+ handle_newable_element!(document, tag, "col", HTMLTableColElement);
+ handle_newable_element!(document, tag, "colgroup", HTMLTableColElement);
+ handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1);
+ handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2);
+ handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3);
+ 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, "img", HTMLImageElement);
+ handle_newable_element!(document, tag, "p", HTMLParagraphElement);
+ handle_newable_element!(document, tag, "param", HTMLParamElement);
+ handle_newable_element!(document, tag, "pre", HTMLPreElement);
+ handle_newable_element!(document, tag, "progress", HTMLProgressElement);
+ handle_newable_element!(document, tag, "q", HTMLQuoteElement);
+ handle_newable_element!(document, tag, "script", HTMLScriptElement);
+ handle_newable_element!(document, tag, "select", HTMLSelectElement);
+ handle_newable_element!(document, tag, "source", HTMLSourceElement);
+ handle_newable_element!(document, tag, "span", HTMLSpanElement);
+ handle_newable_element!(document, tag, "style", HTMLStyleElement);
+ handle_newable_element!(document, tag, "table", HTMLTableElement);
+ handle_newable_element!(document, tag, "tbody", HTMLTableSectionElement);
+ handle_newable_element!(document, tag, "td", HTMLTableDataCellElement);
+ handle_newable_element!(document, tag, "template", HTMLTemplateElement);
+ handle_newable_element!(document, tag, "textarea", HTMLTextAreaElement);
+ handle_newable_element!(document, tag, "th", HTMLTableHeaderCellElement);
+ handle_newable_element!(document, tag, "time", HTMLTimeElement);
+ handle_newable_element!(document, tag, "title", HTMLTitleElement);
+ handle_newable_element!(document, tag, "tr", HTMLTableRowElement);
+ handle_newable_element!(document, tag, "track", HTMLTrackElement);
+ handle_newable_element!(document, tag, "ul", HTMLUListElement);
+ handle_newable_element!(document, tag, "video", HTMLVideoElement);
return HTMLUnknownElement::new(tag.to_str(), document);
}