From bc61e0348ebd44a9ebd20faeae48814f463447d5 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 21:39:55 +0100 Subject: [PATCH 01/44] Introduce HTMLOutputElement::new. --- src/components/script/dom/htmloutputelement.rs | 18 +++++++++++++++++- .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs index b3f0f80a0fe..d006eb7e97f 100644 --- a/src/components/script/dom/htmloutputelement.rs +++ b/src/components/script/dom/htmloutputelement.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::HTMLOutputElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLOutputElementTypeId; use dom::htmlelement::HTMLElement; -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, Node, ScriptView}; use dom::validitystate::ValidityState; pub struct HTMLOutputElement { htmlelement: HTMLElement } +impl HTMLOutputElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOutputElement { + HTMLOutputElement { + htmlelement: HTMLElement::new(HTMLOutputElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLOutputElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLOutputElementBinding::Wrap) + } +} + impl HTMLOutputElement { pub fn GetForm(&self) -> Option> { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index b1f8cc96484..e6c6e68ba30 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -245,7 +245,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []); 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_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -265,6 +264,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "output", HTMLOutputElement); handle_newable_element!(document, tag, "p", HTMLParagraphElement); handle_newable_element!(document, tag, "param", HTMLParamElement); handle_newable_element!(document, tag, "pre", HTMLPreElement); From 21be4752a1640dcffa91cab93447b3d9af6ca771 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 21:47:25 +0100 Subject: [PATCH 02/44] Introduce HTMLOptGroupElement::new. --- .../script/dom/htmloptgroupelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmloptgroupelement.rs b/src/components/script/dom/htmloptgroupelement.rs index 640907d7501..55825725424 100644 --- a/src/components/script/dom/htmloptgroupelement.rs +++ b/src/components/script/dom/htmloptgroupelement.rs @@ -2,13 +2,30 @@ * 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::HTMLOptGroupElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLOptGroupElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLOptGroupElement { htmlelement: HTMLElement } +impl HTMLOptGroupElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptGroupElement { + HTMLOptGroupElement { + htmlelement: HTMLElement::new(HTMLOptGroupElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLOptGroupElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLOptGroupElementBinding::Wrap) + } +} + impl HTMLOptGroupElement { pub fn Disabled(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index e6c6e68ba30..00e7c78d6e1 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -244,7 +244,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "object", HTMLObjectElementTypeId, HTMLObjectElement, []); handle_element!(cx, document, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []); handle_element!(cx, document, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []); - handle_element!(cx, document, tag, "optgroup",HTMLOptGroupElementTypeId, HTMLOptGroupElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -264,6 +263,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "optgroup", HTMLOptGroupElement); handle_newable_element!(document, tag, "output", HTMLOutputElement); handle_newable_element!(document, tag, "p", HTMLParagraphElement); handle_newable_element!(document, tag, "param", HTMLParamElement); From 6c217c6872651729c162bd3092f700177cf24abc Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 21:52:43 +0100 Subject: [PATCH 03/44] Introduce HTMLOptionElement::new. --- src/components/script/dom/htmloptionelement.rs | 18 +++++++++++++++++- .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs index 7e3b4ff31a4..52c5daf8bf9 100644 --- a/src/components/script/dom/htmloptionelement.rs +++ b/src/components/script/dom/htmloptionelement.rs @@ -2,14 +2,30 @@ * 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::HTMLOptionElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLOptionElementTypeId; use dom::htmlelement::HTMLElement; -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLOptionElement { htmlelement: HTMLElement } +impl HTMLOptionElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptionElement { + HTMLOptionElement { + htmlelement: HTMLElement::new(HTMLOptionElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLOptionElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLOptionElementBinding::Wrap) + } +} + impl HTMLOptionElement { pub fn Disabled(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 00e7c78d6e1..531a961b0cf 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -243,7 +243,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []); handle_element!(cx, document, tag, "object", HTMLObjectElementTypeId, HTMLObjectElement, []); handle_element!(cx, document, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []); - handle_element!(cx, document, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -264,6 +263,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement); + handle_newable_element!(document, tag, "option", HTMLOptionElement); handle_newable_element!(document, tag, "output", HTMLOutputElement); handle_newable_element!(document, tag, "p", HTMLParagraphElement); handle_newable_element!(document, tag, "param", HTMLParamElement); From 9fbc45ae9cd90aaf0bed45ad47188c887f7ceb0e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 21:56:22 +0100 Subject: [PATCH 04/44] Introduce HTMLOListElement::new. --- src/components/script/dom/htmlolistelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlolistelement.rs b/src/components/script/dom/htmlolistelement.rs index 8aabcef7b18..157073e86c3 100644 --- a/src/components/script/dom/htmlolistelement.rs +++ b/src/components/script/dom/htmlolistelement.rs @@ -2,13 +2,30 @@ * 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::HTMLOListElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLOListElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLOListElement { htmlelement: HTMLElement, } +impl HTMLOListElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOListElement { + HTMLOListElement { + htmlelement: HTMLElement::new(HTMLOListElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLOListElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLOListElementBinding::Wrap) + } +} + impl HTMLOListElement { pub fn Reversed(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 531a961b0cf..8ababab95d5 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -242,7 +242,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []); handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []); handle_element!(cx, document, tag, "object", HTMLObjectElementTypeId, HTMLObjectElement, []); - handle_element!(cx, document, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -262,6 +261,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "ol", HTMLOListElement); handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement); handle_newable_element!(document, tag, "option", HTMLOptionElement); handle_newable_element!(document, tag, "output", HTMLOutputElement); From b20461f25365f8b90d241489cfe115b71eca9bcf Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 22:02:32 +0100 Subject: [PATCH 05/44] Introduce HTMLObjectElement::new. --- src/components/script/dom/htmlobjectelement.rs | 17 ++++++++++++++++- .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index 7591b1c5180..da31fdd73c6 100644 --- a/src/components/script/dom/htmlobjectelement.rs +++ b/src/components/script/dom/htmlobjectelement.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::HTMLObjectElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; +use dom::element::HTMLObjectElementTypeId; use dom::htmlelement::HTMLElement; -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, Node, ScriptView}; use dom::validitystate::ValidityState; use dom::windowproxy::WindowProxy; @@ -13,6 +15,19 @@ pub struct HTMLObjectElement { htmlelement: HTMLElement } +impl HTMLObjectElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLObjectElement { + HTMLObjectElement { + htmlelement: HTMLElement::new(HTMLObjectElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLObjectElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLObjectElementBinding::Wrap) + } +} + impl HTMLObjectElement { pub fn Data(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 8ababab95d5..2a0632dcce2 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -241,7 +241,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []); handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []); handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []); - handle_element!(cx, document, tag, "object", HTMLObjectElementTypeId, HTMLObjectElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -261,6 +260,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "object", HTMLObjectElement); handle_newable_element!(document, tag, "ol", HTMLOListElement); handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement); handle_newable_element!(document, tag, "option", HTMLOptionElement); From 5cfa70c769aa99a7cf2bf7d7570b43172619a06d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 22:12:43 +0100 Subject: [PATCH 06/44] Introduce HTMLModElement::new and use it for del/ins, not the non-existent mod. --- src/components/script/dom/htmlmodelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlmodelement.rs b/src/components/script/dom/htmlmodelement.rs index 16568a676b9..e1aad28c5af 100644 --- a/src/components/script/dom/htmlmodelement.rs +++ b/src/components/script/dom/htmlmodelement.rs @@ -2,13 +2,30 @@ * 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::HTMLModElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLModElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLModElement { htmlelement: HTMLElement } +impl HTMLModElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLModElement { + HTMLModElement { + htmlelement: HTMLElement::new(HTMLModElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLModElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLModElementBinding::Wrap) + } +} + impl HTMLModElement { pub fn Cite(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 2a0632dcce2..9f32636ecad 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -240,7 +240,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []); handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []); handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []); - handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -252,6 +251,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "del", HTMLModElement); handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1); handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2); handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3); @@ -260,6 +260,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "ins", HTMLModElement); handle_newable_element!(document, tag, "object", HTMLObjectElement); handle_newable_element!(document, tag, "ol", HTMLOListElement); handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement); From db3515240a34208c59a967cf27e64fa43819eb4e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 22:36:17 +0100 Subject: [PATCH 07/44] Introduce HTMLMeterElement::new. --- src/components/script/dom/htmlmeterelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlmeterelement.rs b/src/components/script/dom/htmlmeterelement.rs index d7c709f5120..c9bb4983fce 100644 --- a/src/components/script/dom/htmlmeterelement.rs +++ b/src/components/script/dom/htmlmeterelement.rs @@ -2,13 +2,30 @@ * 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::HTMLMeterElementBinding; use dom::bindings::utils::ErrorResult; +use dom::document::AbstractDocument; +use dom::element::HTMLMeterElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLMeterElement { htmlelement: HTMLElement } +impl HTMLMeterElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMeterElement { + HTMLMeterElement { + htmlelement: HTMLElement::new(HTMLMeterElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLMeterElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLMeterElementBinding::Wrap) + } +} + impl HTMLMeterElement { pub fn Value(&self) -> f64 { 0.0 diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 9f32636ecad..8811640ea92 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -239,7 +239,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []); handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []); handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []); - handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -261,6 +260,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); + handle_newable_element!(document, tag, "meter", HTMLMeterElement); handle_newable_element!(document, tag, "object", HTMLObjectElement); handle_newable_element!(document, tag, "ol", HTMLOListElement); handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement); From 5a18c616d6a7f99c2813fc9b55b9e5879e90b64d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 22:42:19 +0100 Subject: [PATCH 08/44] Introduce HTMLMetaElement::new. --- src/components/script/dom/htmlmetaelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlmetaelement.rs b/src/components/script/dom/htmlmetaelement.rs index 52c25345582..51fdbe419c9 100644 --- a/src/components/script/dom/htmlmetaelement.rs +++ b/src/components/script/dom/htmlmetaelement.rs @@ -2,13 +2,30 @@ * 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::HTMLMetaElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLMetaElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLMetaElement { htmlelement: HTMLElement, } +impl HTMLMetaElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMetaElement { + HTMLMetaElement { + htmlelement: HTMLElement::new(HTMLMetaElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLMetaElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLMetaElementBinding::Wrap) + } +} + impl HTMLMetaElement { 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 8811640ea92..b18e7f63903 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -238,7 +238,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []); handle_element!(cx, document, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []); handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []); - handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -260,6 +259,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); + handle_newable_element!(document, tag, "meta", HTMLMetaElement); handle_newable_element!(document, tag, "meter", HTMLMeterElement); handle_newable_element!(document, tag, "object", HTMLObjectElement); handle_newable_element!(document, tag, "ol", HTMLOListElement); From 81018b3dcc35a1ccba66049bd646409ad9f3beab Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 22:46:44 +0100 Subject: [PATCH 09/44] Introduce HTMLMainElement::new. --- src/components/script/dom/htmlmainelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) 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 { + let element = HTMLMainElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLMainElementBinding::Wrap) + } +} diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index b18e7f63903..91dffa0d892 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -237,7 +237,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []); handle_element!(cx, document, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []); handle_element!(cx, document, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []); - handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -259,6 +258,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); + handle_newable_element!(document, tag, "main", HTMLMainElement); handle_newable_element!(document, tag, "meta", HTMLMetaElement); handle_newable_element!(document, tag, "meter", HTMLMeterElement); handle_newable_element!(document, tag, "object", HTMLObjectElement); From 9afab1807a156240efecb107040876de709e3bf7 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 23:06:49 +0100 Subject: [PATCH 10/44] Introduce HTMLMapElement::new. --- src/components/script/dom/htmlmapelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index 35883929be3..12f881ec3f1 100644 --- a/src/components/script/dom/htmlmapelement.rs +++ b/src/components/script/dom/htmlmapelement.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::HTMLMapElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; use dom::htmlcollection::HTMLCollection; +use dom::document::AbstractDocument; +use dom::element::HTMLMapElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLMapElement { htmlelement: HTMLElement } +impl HTMLMapElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMapElement { + HTMLMapElement { + htmlelement: HTMLElement::new(HTMLMapElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLMapElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLMapElementBinding::Wrap) + } +} + impl HTMLMapElement { 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 91dffa0d892..fa760f7edac 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -236,7 +236,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "legend", HTMLLegendElementTypeId, HTMLLegendElement, []); handle_element!(cx, document, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []); handle_element!(cx, document, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []); - handle_element!(cx, document, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -259,6 +258,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); handle_newable_element!(document, tag, "main", HTMLMainElement); + handle_newable_element!(document, tag, "map", HTMLMapElement); handle_newable_element!(document, tag, "meta", HTMLMetaElement); handle_newable_element!(document, tag, "meter", HTMLMeterElement); handle_newable_element!(document, tag, "object", HTMLObjectElement); From 3b58858c7e058ad37cf121e2b33fadbaa5e96bbf Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 23:12:56 +0100 Subject: [PATCH 11/44] Introduce HTMLLIElement::new. --- src/components/script/dom/htmllielement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmllielement.rs b/src/components/script/dom/htmllielement.rs index 3383df9a421..0716bf6c0d4 100644 --- a/src/components/script/dom/htmllielement.rs +++ b/src/components/script/dom/htmllielement.rs @@ -2,13 +2,30 @@ * 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::HTMLLIElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLLIElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLLIElement { htmlelement: HTMLElement, } +impl HTMLLIElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLIElement { + HTMLLIElement { + htmlelement: HTMLElement::new(HTMLLIElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLLIElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLLIElementBinding::Wrap) + } +} + impl HTMLLIElement { pub fn Value(&self) -> i32 { 0 diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index fa760f7edac..902d754d936 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -235,7 +235,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "label", HTMLLabelElementTypeId, HTMLLabelElement, []); handle_element!(cx, document, tag, "legend", HTMLLegendElementTypeId, HTMLLegendElement, []); handle_element!(cx, document, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []); - handle_element!(cx, document, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -257,6 +256,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); + handle_newable_element!(document, tag, "li", HTMLLIElement); handle_newable_element!(document, tag, "main", HTMLMainElement); handle_newable_element!(document, tag, "map", HTMLMapElement); handle_newable_element!(document, tag, "meta", HTMLMetaElement); From 186a757c0571583af31293482fec14766745ee31 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 23:16:25 +0100 Subject: [PATCH 12/44] Introduce HTMLLinkElement::new. --- src/components/script/dom/htmllinkelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmllinkelement.rs b/src/components/script/dom/htmllinkelement.rs index 2f828e838cb..17edfd3be6b 100644 --- a/src/components/script/dom/htmllinkelement.rs +++ b/src/components/script/dom/htmllinkelement.rs @@ -2,13 +2,30 @@ * 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::HTMLLinkElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLLinkElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLLinkElement { htmlelement: HTMLElement, } +impl HTMLLinkElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLinkElement { + HTMLLinkElement { + htmlelement: HTMLElement::new(HTMLLinkElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLLinkElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLLinkElementBinding::Wrap) + } +} + impl HTMLLinkElement { pub fn Disabled(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 902d754d936..4c030280d33 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -234,7 +234,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "input", HTMLInputElementTypeId, HTMLInputElement, []); handle_element!(cx, document, tag, "label", HTMLLabelElementTypeId, HTMLLabelElement, []); handle_element!(cx, document, tag, "legend", HTMLLegendElementTypeId, HTMLLegendElement, []); - handle_element!(cx, document, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -257,6 +256,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); handle_newable_element!(document, tag, "li", HTMLLIElement); + handle_newable_element!(document, tag, "link", HTMLLinkElement); handle_newable_element!(document, tag, "main", HTMLMainElement); handle_newable_element!(document, tag, "map", HTMLMapElement); handle_newable_element!(document, tag, "meta", HTMLMetaElement); From 721119132ab6509eda175a738ec4efb0ab00e3ff Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 23:23:52 +0100 Subject: [PATCH 13/44] Introduce HTMLLegendElement::new. --- src/components/script/dom/htmllegendelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmllegendelement.rs b/src/components/script/dom/htmllegendelement.rs index c840adacfe5..aeb9d3d6c9b 100644 --- a/src/components/script/dom/htmllegendelement.rs +++ b/src/components/script/dom/htmllegendelement.rs @@ -2,13 +2,30 @@ * 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::HTMLLegendElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLLegendElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLLegendElement { htmlelement: HTMLElement, } +impl HTMLLegendElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLegendElement { + HTMLLegendElement { + htmlelement: HTMLElement::new(HTMLLegendElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLLegendElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLLegendElementBinding::Wrap) + } +} + impl HTMLLegendElement { pub fn Align(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 4c030280d33..068b9b167fa 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -233,7 +233,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "html", HTMLHtmlElementTypeId, HTMLHtmlElement, []); handle_element!(cx, document, tag, "input", HTMLInputElementTypeId, HTMLInputElement, []); handle_element!(cx, document, tag, "label", HTMLLabelElementTypeId, HTMLLabelElement, []); - handle_element!(cx, document, tag, "legend", HTMLLegendElementTypeId, HTMLLegendElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -255,6 +254,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); + handle_newable_element!(document, tag, "legend", HTMLLegendElement); handle_newable_element!(document, tag, "li", HTMLLIElement); handle_newable_element!(document, tag, "link", HTMLLinkElement); handle_newable_element!(document, tag, "main", HTMLMainElement); From b592742b255a0e4b7abc39ab755b3944926189d1 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 23:28:55 +0100 Subject: [PATCH 14/44] Introduce HTMLLabelElement::new. --- src/components/script/dom/htmllabelelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmllabelelement.rs b/src/components/script/dom/htmllabelelement.rs index 63d15bc5988..25d66551049 100644 --- a/src/components/script/dom/htmllabelelement.rs +++ b/src/components/script/dom/htmllabelelement.rs @@ -2,13 +2,30 @@ * 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::HTMLLabelElementBinding; use dom::bindings::utils::DOMString; +use dom::document::AbstractDocument; +use dom::element::HTMLLabelElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLLabelElement { htmlelement: HTMLElement, } +impl HTMLLabelElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLabelElement { + HTMLLabelElement { + htmlelement: HTMLElement::new(HTMLLabelElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLLabelElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLLabelElementBinding::Wrap) + } +} + impl HTMLLabelElement { pub fn HtmlFor(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 068b9b167fa..fb3b8c7a324 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -232,7 +232,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "head", HTMLHeadElementTypeId, HTMLHeadElement, []); handle_element!(cx, document, tag, "html", HTMLHtmlElementTypeId, HTMLHtmlElement, []); handle_element!(cx, document, tag, "input", HTMLInputElementTypeId, HTMLInputElement, []); - handle_element!(cx, document, tag, "label", HTMLLabelElementTypeId, HTMLLabelElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -254,6 +253,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "ins", HTMLModElement); + handle_newable_element!(document, tag, "label", HTMLLabelElement); handle_newable_element!(document, tag, "legend", HTMLLegendElement); handle_newable_element!(document, tag, "li", HTMLLIElement); handle_newable_element!(document, tag, "link", HTMLLinkElement); From 1f4cc4182e94cc8284d230f33de27db3c35663f8 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 1 Nov 2013 23:34:26 +0100 Subject: [PATCH 15/44] Introduce HTMLInputElement::new. --- src/components/script/dom/htmlinputelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlinputelement.rs b/src/components/script/dom/htmlinputelement.rs index d6fc4080f6b..7657ea8b9be 100644 --- a/src/components/script/dom/htmlinputelement.rs +++ b/src/components/script/dom/htmlinputelement.rs @@ -2,13 +2,30 @@ * 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::HTMLInputElementBinding; use dom::bindings::utils::{DOMString, ErrorResult, Fallible}; +use dom::document::AbstractDocument; +use dom::element::HTMLInputElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLInputElement { htmlelement: HTMLElement, } +impl HTMLInputElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLInputElement { + HTMLInputElement { + htmlelement: HTMLElement::new(HTMLInputElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLInputElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLInputElementBinding::Wrap) + } +} + impl HTMLInputElement { pub fn Accept(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index fb3b8c7a324..dc9d6f2fba9 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -231,7 +231,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "hr", HTMLHRElementTypeId, HTMLHRElement, []); handle_element!(cx, document, tag, "head", HTMLHeadElementTypeId, HTMLHeadElement, []); handle_element!(cx, document, tag, "html", HTMLHtmlElementTypeId, HTMLHtmlElement, []); - handle_element!(cx, document, tag, "input", HTMLInputElementTypeId, HTMLInputElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -252,6 +251,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "input", HTMLInputElement); handle_newable_element!(document, tag, "ins", HTMLModElement); handle_newable_element!(document, tag, "label", HTMLLabelElement); handle_newable_element!(document, tag, "legend", HTMLLegendElement); From 1e42f2756037a73c70f9d88b7c839c22c828a446 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 11:28:54 +0100 Subject: [PATCH 16/44] Introduce HTMLHtmlElement::new. --- src/components/script/dom/htmlhtmlelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlhtmlelement.rs b/src/components/script/dom/htmlhtmlelement.rs index b4db96289fe..e86478f3585 100644 --- a/src/components/script/dom/htmlhtmlelement.rs +++ b/src/components/script/dom/htmlhtmlelement.rs @@ -2,13 +2,30 @@ * 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::HTMLHtmlElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLHtmlElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLHtmlElement { htmlelement: HTMLElement } +impl HTMLHtmlElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHtmlElement { + HTMLHtmlElement { + htmlelement: HTMLElement::new(HTMLHtmlElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLHtmlElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLHtmlElementBinding::Wrap) + } +} + impl HTMLHtmlElement { pub fn Version(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index dc9d6f2fba9..d9843e33d79 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -230,7 +230,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "frameset",HTMLFrameSetElementTypeId, HTMLFrameSetElement, []); handle_element!(cx, document, tag, "hr", HTMLHRElementTypeId, HTMLHRElement, []); handle_element!(cx, document, tag, "head", HTMLHeadElementTypeId, HTMLHeadElement, []); - handle_element!(cx, document, tag, "html", HTMLHtmlElementTypeId, HTMLHtmlElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -249,6 +248,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, "html", HTMLHtmlElement); handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "input", HTMLInputElement); From dac20f11d4798a5b3f616180547764aa6774a7a4 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 11:37:57 +0100 Subject: [PATCH 17/44] Introduce HTMLHeadElement::new. --- src/components/script/dom/htmlheadelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlheadelement.rs b/src/components/script/dom/htmlheadelement.rs index 4e63dd549ff..a94638d72c1 100644 --- a/src/components/script/dom/htmlheadelement.rs +++ b/src/components/script/dom/htmlheadelement.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::HTMLHeadElementBinding; +use dom::document::AbstractDocument; +use dom::element::HTMLHeadElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLHeadElement { htmlelement: HTMLElement } + +impl HTMLHeadElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHeadElement { + HTMLHeadElement { + htmlelement: HTMLElement::new(HTMLHeadElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLHeadElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLHeadElementBinding::Wrap) + } +} diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index d9843e33d79..ed25bc24842 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -229,7 +229,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "frame", HTMLFrameElementTypeId, HTMLFrameElement, []); handle_element!(cx, document, tag, "frameset",HTMLFrameSetElementTypeId, HTMLFrameSetElement, []); handle_element!(cx, document, tag, "hr", HTMLHRElementTypeId, HTMLHRElement, []); - handle_element!(cx, document, tag, "head", HTMLHeadElementTypeId, HTMLHeadElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -248,6 +247,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, "head", HTMLHeadElement); handle_newable_element!(document, tag, "html", HTMLHtmlElement); handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); From 5bfc044ee47bc8baf9df69d9d2827739523f8427 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 11:41:51 +0100 Subject: [PATCH 18/44] Introduce HTMLHRElement::new. --- src/components/script/dom/htmlhrelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlhrelement.rs b/src/components/script/dom/htmlhrelement.rs index 73d0094a4fb..677b86dc796 100644 --- a/src/components/script/dom/htmlhrelement.rs +++ b/src/components/script/dom/htmlhrelement.rs @@ -2,13 +2,30 @@ * 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::HTMLHRElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLHRElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLHRElement { htmlelement: HTMLElement, } +impl HTMLHRElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHRElement { + HTMLHRElement { + htmlelement: HTMLElement::new(HTMLHRElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLHRElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLHRElementBinding::Wrap) + } +} + impl HTMLHRElement { pub fn Align(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index ed25bc24842..444971d83cd 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -228,7 +228,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "form", HTMLFormElementTypeId, HTMLFormElement, []); handle_element!(cx, document, tag, "frame", HTMLFrameElementTypeId, HTMLFrameElement, []); handle_element!(cx, document, tag, "frameset",HTMLFrameSetElementTypeId, HTMLFrameSetElement, []); - handle_element!(cx, document, tag, "hr", HTMLHRElementTypeId, HTMLHRElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -248,6 +247,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "h5", HTMLHeadingElement, Heading5); handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6); handle_newable_element!(document, tag, "head", HTMLHeadElement); + handle_newable_element!(document, tag, "hr", HTMLHRElement); handle_newable_element!(document, tag, "html", HTMLHtmlElement); handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); From d8198249ecec1c56cf258b7092127105b7136ae9 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 11:46:50 +0100 Subject: [PATCH 19/44] Introduce HTMLFrameSetElement::new. --- .../script/dom/htmlframesetelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlframesetelement.rs b/src/components/script/dom/htmlframesetelement.rs index 1e9231ce82d..df25a03e7e3 100644 --- a/src/components/script/dom/htmlframesetelement.rs +++ b/src/components/script/dom/htmlframesetelement.rs @@ -2,13 +2,30 @@ * 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::HTMLFrameSetElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLFrameSetElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLFrameSetElement { htmlelement: HTMLElement } +impl HTMLFrameSetElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFrameSetElement { + HTMLFrameSetElement { + htmlelement: HTMLElement::new(HTMLFrameSetElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLFrameSetElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLFrameSetElementBinding::Wrap) + } +} + impl HTMLFrameSetElement { pub fn Cols(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 444971d83cd..49d9146b3fc 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -227,7 +227,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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_element!(cx, document, tag, "frameset",HTMLFrameSetElementTypeId, HTMLFrameSetElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -240,6 +239,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, "frameset", HTMLFrameSetElement); handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1); handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2); handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3); From 996f2dcbb9f6a6e9e28c4069d0b3d915ad9f3eb6 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 11:51:02 +0100 Subject: [PATCH 20/44] Introduce HTMLFrameElement::new. --- src/components/script/dom/htmlframeelement.rs | 16 ++++++++++++++++ src/components/script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) 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,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::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 { htmlelement: HTMLElement } +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 { + 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); From b923bcdef729f9785c23e7e85181156c3cfde072 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 11:55:54 +0100 Subject: [PATCH 21/44] Introduce HTMLFormElement::new. --- src/components/script/dom/htmlformelement.rs | 18 +++++++++++++++++- .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index c6fbac85cb9..c6e5263aee2 100644 --- a/src/components/script/dom/htmlformelement.rs +++ b/src/components/script/dom/htmlformelement.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::HTMLFormElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLFormElementTypeId; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLFormElement { htmlelement: HTMLElement } +impl HTMLFormElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFormElement { + HTMLFormElement { + htmlelement: HTMLElement::new(HTMLFormElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLFormElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLFormElementBinding::Wrap) + } +} + impl HTMLFormElement { pub fn AcceptCharset(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 2d0b99e8ac8..bf84d7369a5 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -225,7 +225,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []); 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_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -238,6 +237,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, "form", HTMLFormElement); handle_newable_element!(document, tag, "frame", HTMLFrameElement); handle_newable_element!(document, tag, "frameset", HTMLFrameSetElement); handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1); From a8578701a8525c42e542574f2e185b73ebc6684d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:05:06 +0100 Subject: [PATCH 22/44] Introduce HTMLFontElement::new. --- src/components/script/dom/htmlfontelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlfontelement.rs b/src/components/script/dom/htmlfontelement.rs index 76eb666dace..4c69baaa4aa 100644 --- a/src/components/script/dom/htmlfontelement.rs +++ b/src/components/script/dom/htmlfontelement.rs @@ -2,13 +2,30 @@ * 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::HTMLFontElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLFontElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLFontElement { htmlelement: HTMLElement } +impl HTMLFontElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFontElement { + HTMLFontElement { + htmlelement: HTMLElement::new(HTMLFontElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLFontElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLFontElementBinding::Wrap) + } +} + impl HTMLFontElement { pub fn Color(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index bf84d7369a5..d7cb32b938d 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -224,7 +224,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []); handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []); handle_element!(cx, document, tag, "fieldset",HTMLFieldSetElementTypeId, HTMLFieldSetElement, []); - handle_element!(cx, document, tag, "font", HTMLFontElementTypeId, HTMLFontElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -237,6 +236,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, "font", HTMLFontElement); handle_newable_element!(document, tag, "form", HTMLFormElement); handle_newable_element!(document, tag, "frame", HTMLFrameElement); handle_newable_element!(document, tag, "frameset", HTMLFrameSetElement); From f3b1cabf3288271bf170a7ab4299926c63f47dfe Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:10:27 +0100 Subject: [PATCH 23/44] Introduce HTMLFieldSetElement::new. --- .../script/dom/htmlfieldsetelement.rs | 18 +++++++++++++++++- .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/script/dom/htmlfieldsetelement.rs b/src/components/script/dom/htmlfieldsetelement.rs index a0a1ff2a4ca..ccb34ee6656 100644 --- a/src/components/script/dom/htmlfieldsetelement.rs +++ b/src/components/script/dom/htmlfieldsetelement.rs @@ -2,16 +2,32 @@ * 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::HTMLFieldSetElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLFieldSetElementTypeId; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, Node, ScriptView}; use dom::validitystate::ValidityState; pub struct HTMLFieldSetElement { htmlelement: HTMLElement } +impl HTMLFieldSetElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFieldSetElement { + HTMLFieldSetElement { + htmlelement: HTMLElement::new(HTMLFieldSetElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLFieldSetElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLFieldSetElementBinding::Wrap) + } +} + impl HTMLFieldSetElement { pub fn Disabled(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index d7cb32b938d..f6ac7b32163 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -223,7 +223,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []); handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []); handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []); - handle_element!(cx, document, tag, "fieldset",HTMLFieldSetElementTypeId, HTMLFieldSetElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -236,6 +235,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, "fieldset", HTMLFieldSetElement); handle_newable_element!(document, tag, "font", HTMLFontElement); handle_newable_element!(document, tag, "form", HTMLFormElement); handle_newable_element!(document, tag, "frame", HTMLFrameElement); From 7290e75c6ba8b4c9c205395be085e444885c2f55 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:15:51 +0100 Subject: [PATCH 24/44] Introduce HTMLEmbedElement::new. --- src/components/script/dom/htmlembedelement.rs | 16 ++++++++++++++++ src/components/script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlembedelement.rs b/src/components/script/dom/htmlembedelement.rs index d7cb30349c0..9f020246f19 100644 --- a/src/components/script/dom/htmlembedelement.rs +++ b/src/components/script/dom/htmlembedelement.rs @@ -2,14 +2,30 @@ * 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::HTMLEmbedElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; use dom::document::AbstractDocument; +use dom::element::HTMLEmbedElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLEmbedElement { htmlelement: HTMLElement } +impl HTMLEmbedElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLEmbedElement { + HTMLEmbedElement { + htmlelement: HTMLElement::new(HTMLEmbedElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLEmbedElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLEmbedElementBinding::Wrap) + } +} + impl HTMLEmbedElement { 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 f6ac7b32163..f0ddcb8f20a 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -222,7 +222,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "dir", HTMLDirectoryElementTypeId, HTMLDirectoryElement, []); handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []); handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []); - handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -235,6 +234,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, "embed", HTMLEmbedElement); handle_newable_element!(document, tag, "fieldset", HTMLFieldSetElement); handle_newable_element!(document, tag, "font", HTMLFontElement); handle_newable_element!(document, tag, "form", HTMLFormElement); From dea0f088deaf9aba0c1faff2f53176a8429f5ad0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:27:23 +0100 Subject: [PATCH 25/44] Introduce HTMLDListElement::new. --- src/components/script/dom/htmldlistelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmldlistelement.rs b/src/components/script/dom/htmldlistelement.rs index 567ae5288e9..686763c69ad 100644 --- a/src/components/script/dom/htmldlistelement.rs +++ b/src/components/script/dom/htmldlistelement.rs @@ -2,13 +2,30 @@ * 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::HTMLDListElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLDListElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLDListElement { htmlelement: HTMLElement } +impl HTMLDListElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDListElement { + HTMLDListElement { + htmlelement: HTMLElement::new(HTMLDListElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLDListElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLDListElementBinding::Wrap) + } +} + impl HTMLDListElement { pub fn Compact(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index f0ddcb8f20a..c39a40195f2 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -221,7 +221,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "datalist",HTMLDataListElementTypeId, HTMLDataListElement, []); handle_element!(cx, document, tag, "dir", HTMLDirectoryElementTypeId, HTMLDirectoryElement, []); handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []); - handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -234,6 +233,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, "dl", HTMLDListElement); handle_newable_element!(document, tag, "embed", HTMLEmbedElement); handle_newable_element!(document, tag, "fieldset", HTMLFieldSetElement); handle_newable_element!(document, tag, "font", HTMLFontElement); From 4d7b0a5e52f999c4a61d9c5eaacf8eb14745f7bc Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:50:15 +0100 Subject: [PATCH 26/44] Introduce HTMLDivElement::new. --- src/components/script/dom/htmldivelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmldivelement.rs b/src/components/script/dom/htmldivelement.rs index a5d6ea7fb3e..277a1c10b10 100644 --- a/src/components/script/dom/htmldivelement.rs +++ b/src/components/script/dom/htmldivelement.rs @@ -2,13 +2,30 @@ * 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::HTMLDivElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLDivElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLDivElement { htmlelement: HTMLElement } +impl HTMLDivElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDivElement { + HTMLDivElement { + htmlelement: HTMLElement::new(HTMLDivElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLDivElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLDivElementBinding::Wrap) + } +} + impl HTMLDivElement { pub fn Align(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index c39a40195f2..27526453899 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -220,7 +220,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []); handle_element!(cx, document, tag, "datalist",HTMLDataListElementTypeId, HTMLDataListElement, []); handle_element!(cx, document, tag, "dir", HTMLDirectoryElementTypeId, HTMLDirectoryElement, []); - handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -233,6 +232,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, "div", HTMLDivElement); handle_newable_element!(document, tag, "dl", HTMLDListElement); handle_newable_element!(document, tag, "embed", HTMLEmbedElement); handle_newable_element!(document, tag, "fieldset", HTMLFieldSetElement); From 0113717d24e743114c47baab48aa9c7005d42bda Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:53:45 +0100 Subject: [PATCH 27/44] Introduce HTMLDirectoryElement::new. --- .../script/dom/htmldirectoryelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmldirectoryelement.rs b/src/components/script/dom/htmldirectoryelement.rs index 4651818b4ee..cadabe92b1e 100644 --- a/src/components/script/dom/htmldirectoryelement.rs +++ b/src/components/script/dom/htmldirectoryelement.rs @@ -2,13 +2,30 @@ * 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::HTMLDirectoryElementBinding; use dom::bindings::utils::ErrorResult; +use dom::document::AbstractDocument; +use dom::element::HTMLDirectoryElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLDirectoryElement { htmlelement: HTMLElement } +impl HTMLDirectoryElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDirectoryElement { + HTMLDirectoryElement { + htmlelement: HTMLElement::new(HTMLDirectoryElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLDirectoryElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLDirectoryElementBinding::Wrap) + } +} + impl HTMLDirectoryElement { pub fn Compact(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 27526453899..3672cc9f587 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -219,7 +219,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []); handle_element!(cx, document, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []); handle_element!(cx, document, tag, "datalist",HTMLDataListElementTypeId, HTMLDataListElement, []); - handle_element!(cx, document, tag, "dir", HTMLDirectoryElementTypeId, HTMLDirectoryElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -232,6 +231,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, "dir", HTMLDirectoryElement); handle_newable_element!(document, tag, "div", HTMLDivElement); handle_newable_element!(document, tag, "dl", HTMLDListElement); handle_newable_element!(document, tag, "embed", HTMLEmbedElement); From f81ed712a8e2aefc7e37f168bb4f988dba14865a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 12:58:32 +0100 Subject: [PATCH 28/44] Introduce HTMLDataListElement::new. --- .../script/dom/htmldatalistelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmldatalistelement.rs b/src/components/script/dom/htmldatalistelement.rs index df0fe2939ed..95dcf628efd 100644 --- a/src/components/script/dom/htmldatalistelement.rs +++ b/src/components/script/dom/htmldatalistelement.rs @@ -2,13 +2,30 @@ * 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::HTMLDataListElementBinding; +use dom::document::AbstractDocument; +use dom::element::HTMLDataListElementTypeId; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLDataListElement { htmlelement: HTMLElement } +impl HTMLDataListElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDataListElement { + HTMLDataListElement { + htmlelement: HTMLElement::new(HTMLDataListElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLDataListElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLDataListElementBinding::Wrap) + } +} + impl HTMLDataListElement { pub fn Options(&self) -> @mut HTMLCollection { let window = self.htmlelement.element.node.owner_doc().document().window; diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 3672cc9f587..4c9c1770eaa 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -218,7 +218,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "button", HTMLButtonElementTypeId, HTMLButtonElement, []); handle_element!(cx, document, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []); handle_element!(cx, document, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []); - handle_element!(cx, document, tag, "datalist",HTMLDataListElementTypeId, HTMLDataListElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -230,6 +229,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "datalist", HTMLDataListElement); handle_newable_element!(document, tag, "del", HTMLModElement); handle_newable_element!(document, tag, "dir", HTMLDirectoryElement); handle_newable_element!(document, tag, "div", HTMLDivElement); From 4d706984e19a2a14e969a3887f1368615588eafe Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 13:03:16 +0100 Subject: [PATCH 29/44] Introduce HTMLDataElement::new. --- src/components/script/dom/htmldataelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmldataelement.rs b/src/components/script/dom/htmldataelement.rs index 2c16f188adf..9b91452d59a 100644 --- a/src/components/script/dom/htmldataelement.rs +++ b/src/components/script/dom/htmldataelement.rs @@ -2,13 +2,30 @@ * 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::HTMLDataElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLDataElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLDataElement { htmlelement: HTMLElement } +impl HTMLDataElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDataElement { + HTMLDataElement { + htmlelement: HTMLElement::new(HTMLDataElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLDataElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLDataElementBinding::Wrap) + } +} + impl HTMLDataElement { pub fn Value(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 4c9c1770eaa..03c6e30d1e4 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -217,7 +217,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []); handle_element!(cx, document, tag, "button", HTMLButtonElementTypeId, HTMLButtonElement, []); handle_element!(cx, document, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []); - handle_element!(cx, document, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -229,6 +228,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "data", HTMLDataElement); handle_newable_element!(document, tag, "datalist", HTMLDataListElement); handle_newable_element!(document, tag, "del", HTMLModElement); handle_newable_element!(document, tag, "dir", HTMLDirectoryElement); From 74312da1baff3a5658aabd3d0f2c0be26ae8900b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:18:29 +0100 Subject: [PATCH 30/44] Introduce HTMLCanvasElement::new. --- src/components/script/dom/htmlcanvaselement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlcanvaselement.rs b/src/components/script/dom/htmlcanvaselement.rs index dba29030bfa..81adc4550f1 100644 --- a/src/components/script/dom/htmlcanvaselement.rs +++ b/src/components/script/dom/htmlcanvaselement.rs @@ -2,13 +2,30 @@ * 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::HTMLCanvasElementBinding; use dom::bindings::utils::{ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLCanvasElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLCanvasElement { htmlelement: HTMLElement, } +impl HTMLCanvasElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLCanvasElement { + HTMLCanvasElement { + htmlelement: HTMLElement::new(HTMLCanvasElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLCanvasElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLCanvasElementBinding::Wrap) + } +} + impl HTMLCanvasElement { 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 03c6e30d1e4..61f5b38a2b8 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -216,7 +216,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []); handle_element!(cx, document, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []); handle_element!(cx, document, tag, "button", HTMLButtonElementTypeId, HTMLButtonElement, []); - handle_element!(cx, document, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -225,6 +224,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); + handle_newable_element!(document, tag, "canvas", HTMLCanvasElement); handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement); handle_newable_element!(document, tag, "col", HTMLTableColElement); handle_newable_element!(document, tag, "colgroup", HTMLTableColElement); From 0d56584561ff17830e2e57f2980c1eb7b1d8a449 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:22:35 +0100 Subject: [PATCH 31/44] Introduce HTMLButtonElement::new. --- src/components/script/dom/htmlbuttonelement.rs | 18 +++++++++++++++++- .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/script/dom/htmlbuttonelement.rs b/src/components/script/dom/htmlbuttonelement.rs index 7710d5a364c..a6b90b9d123 100644 --- a/src/components/script/dom/htmlbuttonelement.rs +++ b/src/components/script/dom/htmlbuttonelement.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::HTMLButtonElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLButtonElementTypeId; use dom::htmlelement::HTMLElement; -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, Node, ScriptView}; use dom::validitystate::ValidityState; pub struct HTMLButtonElement { htmlelement: HTMLElement } +impl HTMLButtonElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLButtonElement { + HTMLButtonElement { + htmlelement: HTMLElement::new(HTMLButtonElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLButtonElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLButtonElementBinding::Wrap) + } +} + impl HTMLButtonElement { pub fn Autofocus(&self) -> bool { false diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 61f5b38a2b8..07983994c74 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -215,7 +215,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "base", HTMLBaseElementTypeId, HTMLBaseElement, []); handle_element!(cx, document, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []); handle_element!(cx, document, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []); - handle_element!(cx, document, tag, "button", HTMLButtonElementTypeId, HTMLButtonElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -224,6 +223,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); + handle_newable_element!(document, tag, "button", HTMLButtonElement); handle_newable_element!(document, tag, "canvas", HTMLCanvasElement); handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement); handle_newable_element!(document, tag, "col", HTMLTableColElement); From 8796ca5c0250c11d6a6ca03c0982b2484179f7bb Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:26:39 +0100 Subject: [PATCH 32/44] Introduce HTMLBodyElement::new. --- src/components/script/dom/htmlbodyelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlbodyelement.rs b/src/components/script/dom/htmlbodyelement.rs index 3f409a23789..2dea5fdcbfa 100644 --- a/src/components/script/dom/htmlbodyelement.rs +++ b/src/components/script/dom/htmlbodyelement.rs @@ -2,13 +2,30 @@ * 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::HTMLBodyElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLBodyElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLBodyElement { htmlelement: HTMLElement } +impl HTMLBodyElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBodyElement { + HTMLBodyElement { + htmlelement: HTMLElement::new(HTMLBodyElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLBodyElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLBodyElementBinding::Wrap) + } +} + impl HTMLBodyElement { pub fn Text(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 07983994c74..593a17ff56f 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -214,7 +214,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "area", HTMLAreaElementTypeId, HTMLAreaElement, []); handle_element!(cx, document, tag, "base", HTMLBaseElementTypeId, HTMLBaseElement, []); handle_element!(cx, document, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []); - handle_element!(cx, document, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -223,6 +222,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); + handle_newable_element!(document, tag, "body", HTMLBodyElement); handle_newable_element!(document, tag, "button", HTMLButtonElement); handle_newable_element!(document, tag, "canvas", HTMLCanvasElement); handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement); From 74a522b89a3fe6fe4069703cc2860ac2451c01ff Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:30:25 +0100 Subject: [PATCH 33/44] Introduce HTMLBRElement::new. --- src/components/script/dom/htmlbrelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlbrelement.rs b/src/components/script/dom/htmlbrelement.rs index cf6d79dcbf5..0cbd66a1ec6 100644 --- a/src/components/script/dom/htmlbrelement.rs +++ b/src/components/script/dom/htmlbrelement.rs @@ -2,13 +2,30 @@ * 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::HTMLBRElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLBRElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLBRElement { htmlelement: HTMLElement, } +impl HTMLBRElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBRElement { + HTMLBRElement { + htmlelement: HTMLElement::new(HTMLBRElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLBRElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLBRElementBinding::Wrap) + } +} + impl HTMLBRElement { pub fn Clear(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 593a17ff56f..9c8ebe2d93b 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -213,7 +213,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []); handle_element!(cx, document, tag, "area", HTMLAreaElementTypeId, HTMLAreaElement, []); handle_element!(cx, document, tag, "base", HTMLBaseElementTypeId, HTMLBaseElement, []); - handle_element!(cx, document, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -223,6 +222,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "audio", HTMLAudioElement); handle_newable_element!(document, tag, "body", HTMLBodyElement); + handle_newable_element!(document, tag, "br", HTMLBRElement); handle_newable_element!(document, tag, "button", HTMLButtonElement); handle_newable_element!(document, tag, "canvas", HTMLCanvasElement); handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement); From d3db3b9f7282169162e17ce74642053a408f4373 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:36:54 +0100 Subject: [PATCH 34/44] Introduce HTMLBaseElement::new. --- src/components/script/dom/htmlbaseelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlbaseelement.rs b/src/components/script/dom/htmlbaseelement.rs index 9872798f2e3..4fbf1ff4409 100644 --- a/src/components/script/dom/htmlbaseelement.rs +++ b/src/components/script/dom/htmlbaseelement.rs @@ -2,13 +2,30 @@ * 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::HTMLBaseElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLBaseElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLBaseElement { htmlelement: HTMLElement } +impl HTMLBaseElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBaseElement { + HTMLBaseElement { + htmlelement: HTMLElement::new(HTMLBaseElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLBaseElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLBaseElementBinding::Wrap) + } +} + impl HTMLBaseElement { pub fn Href(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 9c8ebe2d93b..546f8b17f7a 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -212,7 +212,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_element!(cx, document, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []); handle_element!(cx, document, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []); handle_element!(cx, document, tag, "area", HTMLAreaElementTypeId, HTMLAreaElement, []); - handle_element!(cx, document, tag, "base", HTMLBaseElementTypeId, HTMLBaseElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -221,6 +220,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); + handle_newable_element!(document, tag, "base", HTMLBaseElement); handle_newable_element!(document, tag, "body", HTMLBodyElement); handle_newable_element!(document, tag, "br", HTMLBRElement); handle_newable_element!(document, tag, "button", HTMLButtonElement); From 05162f16aae0f5f26e67416e4deeef65ff04bd1d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:40:15 +0100 Subject: [PATCH 35/44] Introduce HTMLAreaElement::new. --- src/components/script/dom/htmlareaelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlareaelement.rs b/src/components/script/dom/htmlareaelement.rs index 5111e376979..c251243ff05 100644 --- a/src/components/script/dom/htmlareaelement.rs +++ b/src/components/script/dom/htmlareaelement.rs @@ -2,13 +2,30 @@ * 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::HTMLAreaElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLAreaElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLAreaElement { htmlelement: HTMLElement } +impl HTMLAreaElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAreaElement { + HTMLAreaElement { + htmlelement: HTMLElement::new(HTMLAreaElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLAreaElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLAreaElementBinding::Wrap) + } +} + impl HTMLAreaElement { pub fn Alt(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 546f8b17f7a..462e8faeca2 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -211,7 +211,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum // TODO (Issue #85): use atoms handle_element!(cx, document, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []); handle_element!(cx, document, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []); - handle_element!(cx, document, tag, "area", HTMLAreaElementTypeId, HTMLAreaElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -219,6 +218,7 @@ 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_newable_element!(document, tag, "area", HTMLAreaElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); handle_newable_element!(document, tag, "base", HTMLBaseElement); handle_newable_element!(document, tag, "body", HTMLBodyElement); From f15620313a9365f35271812a2c2fac997fd11734 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:44:20 +0100 Subject: [PATCH 36/44] Introduce HTMLAppletElement::new. --- src/components/script/dom/htmlappletelement.rs | 17 +++++++++++++++++ .../script/html/hubbub_html_parser.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/script/dom/htmlappletelement.rs b/src/components/script/dom/htmlappletelement.rs index 3d349c2fa0e..d6797b62e62 100644 --- a/src/components/script/dom/htmlappletelement.rs +++ b/src/components/script/dom/htmlappletelement.rs @@ -2,13 +2,30 @@ * 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::HTMLAppletElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLAppletElementTypeId; use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLAppletElement { htmlelement: HTMLElement } +impl HTMLAppletElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAppletElement { + HTMLAppletElement { + htmlelement: HTMLElement::new(HTMLAppletElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLAppletElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLAppletElementBinding::Wrap) + } +} + impl HTMLAppletElement { pub fn Align(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 462e8faeca2..9a8dab73e21 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -210,7 +210,6 @@ fn js_script_listener(to_parent: SharedChan, pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode { // TODO (Issue #85): use atoms handle_element!(cx, document, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []); - handle_element!(cx, document, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); @@ -218,6 +217,7 @@ 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_newable_element!(document, tag, "applet", HTMLAppletElement); handle_newable_element!(document, tag, "area", HTMLAreaElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); handle_newable_element!(document, tag, "base", HTMLBaseElement); From 9e236a3dfd5809926aac34906d522d0635d9275d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 18:49:44 +0100 Subject: [PATCH 37/44] Introduce HTMLAnchorElement::new. --- .../script/dom/htmlanchorelement.rs | 19 ++++++++++++++++++- .../script/html/hubbub_html_parser.rs | 3 +-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/components/script/dom/htmlanchorelement.rs b/src/components/script/dom/htmlanchorelement.rs index 74f65de57c6..d5743b71ea0 100644 --- a/src/components/script/dom/htmlanchorelement.rs +++ b/src/components/script/dom/htmlanchorelement.rs @@ -2,13 +2,30 @@ * 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::htmlelement::HTMLElement; +use dom::bindings::codegen::HTMLAnchorElementBinding; use dom::bindings::utils::{DOMString, ErrorResult}; +use dom::document::AbstractDocument; +use dom::element::HTMLAnchorElementTypeId; +use dom::htmlelement::HTMLElement; +use dom::node::{AbstractNode, Node, ScriptView}; pub struct HTMLAnchorElement { htmlelement: HTMLElement } +impl HTMLAnchorElement { + pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAnchorElement { + HTMLAnchorElement { + htmlelement: HTMLElement::new(HTMLAnchorElementTypeId, localName, document) + } + } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLAnchorElement::new_inherited(localName, document); + Node::reflect_node(@mut element, document, HTMLAnchorElementBinding::Wrap) + } +} + impl HTMLAnchorElement { pub fn Href(&self) -> DOMString { None diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 9a8dab73e21..48a1c7d1c41 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -209,14 +209,13 @@ fn js_script_listener(to_parent: SharedChan, pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode { // TODO (Issue #85): use atoms - handle_element!(cx, document, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []); - handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "i", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "section", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); + handle_newable_element!(document, tag, "a", HTMLAnchorElement); handle_newable_element!(document, tag, "applet", HTMLAppletElement); handle_newable_element!(document, tag, "area", HTMLAreaElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); From 375af8d43723537ab260793d56c8a845cdd7c030 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 19:40:48 +0100 Subject: [PATCH 38/44] Remove the now-unused handle_element macro. --- src/components/script/html/hubbub_html_parser.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 48a1c7d1c41..fb74f2be47e 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -32,19 +32,6 @@ use extra::future::Future; use extra::url::Url; use geom::size::Size2D; -macro_rules! handle_element( - ($cx: expr, - $document: expr, - $tag: expr, - $string: expr, - $type_id: expr, - $ctor: ident, - [ $(($field:ident : $field_init:expr)),* ]) => ( - handle_element_base!(htmlelement, HTMLElement, - $cx, $document, $tag, $string, $type_id, $ctor, - [$(($field:$field_init)),*]); - ) -) macro_rules! handle_htmlelement( ($cx: expr, $document: expr, From e918d4daf0d4700096d2c936e5f44ffb75614e46 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 20:32:25 +0100 Subject: [PATCH 39/44] Use HTMLTitleElement::new in Document::SetTitle. --- src/components/script/dom/document.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 2cff5123f1f..251da394cf5 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -12,7 +12,6 @@ use dom::element::{Element}; use dom::element::{HTMLHeadElementTypeId, HTMLTitleElementTypeId}; use dom::htmlcollection::HTMLCollection; use dom::htmldocument::HTMLDocument; -use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, ScriptView, Node, ElementNodeTypeId, DocumentNodeTypeId}; use dom::text::Text; use dom::window::Window; @@ -323,12 +322,7 @@ impl Document { break; } if !has_title { - let new_title = @HTMLTitleElement { - htmlelement: HTMLElement::new(HTMLTitleElementTypeId, ~"title", abstract_self) - }; - let new_title = unsafe { - Node::as_abstract_node(self.get_cx(), new_title) - }; + let new_title = HTMLTitleElement::new(~"title", abstract_self); new_title.AppendChild(self.CreateTextNode(abstract_self, title)); node.AppendChild(new_title); } From 4ac0dc1bfdf67c55b871c3cddf70c763f09667a7 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 20:45:22 +0100 Subject: [PATCH 40/44] Use HTMLHtmlElement::new in parse_html. --- src/components/script/html/hubbub_html_parser.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index fb74f2be47e..f906a7d21e1 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -333,8 +333,7 @@ pub fn parse_html(cx: *JSContext, } // Build the root node. - let root = @HTMLHtmlElement { htmlelement: HTMLElement::new(HTMLHtmlElementTypeId, ~"html", document) }; - let root = unsafe { Node::as_abstract_node(cx, root) }; + let root = HTMLHtmlElement::new(~"html", document); debug!("created new node"); let mut parser = hubbub::Parser("UTF-8", false); debug!("created parser"); From e2c90d1198b78878ef490da2f98032ac64dcb9da Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 20:55:18 +0100 Subject: [PATCH 41/44] Rename HTMLElement::new to HTMLElement::new_inherited. --- src/components/script/dom/htmlanchorelement.rs | 2 +- src/components/script/dom/htmlappletelement.rs | 2 +- src/components/script/dom/htmlareaelement.rs | 2 +- src/components/script/dom/htmlbaseelement.rs | 2 +- src/components/script/dom/htmlbodyelement.rs | 2 +- src/components/script/dom/htmlbrelement.rs | 2 +- src/components/script/dom/htmlbuttonelement.rs | 2 +- src/components/script/dom/htmlcanvaselement.rs | 2 +- src/components/script/dom/htmldataelement.rs | 2 +- src/components/script/dom/htmldatalistelement.rs | 2 +- src/components/script/dom/htmldirectoryelement.rs | 2 +- src/components/script/dom/htmldivelement.rs | 2 +- src/components/script/dom/htmldlistelement.rs | 2 +- src/components/script/dom/htmlelement.rs | 2 +- src/components/script/dom/htmlembedelement.rs | 2 +- src/components/script/dom/htmlfieldsetelement.rs | 2 +- src/components/script/dom/htmlfontelement.rs | 2 +- src/components/script/dom/htmlformelement.rs | 2 +- src/components/script/dom/htmlframeelement.rs | 2 +- src/components/script/dom/htmlframesetelement.rs | 2 +- src/components/script/dom/htmlheadelement.rs | 2 +- src/components/script/dom/htmlheadingelement.rs | 2 +- src/components/script/dom/htmlhrelement.rs | 2 +- src/components/script/dom/htmlhtmlelement.rs | 2 +- src/components/script/dom/htmliframeelement.rs | 2 +- src/components/script/dom/htmlimageelement.rs | 2 +- src/components/script/dom/htmlinputelement.rs | 2 +- src/components/script/dom/htmllabelelement.rs | 2 +- src/components/script/dom/htmllegendelement.rs | 2 +- src/components/script/dom/htmllielement.rs | 2 +- src/components/script/dom/htmllinkelement.rs | 2 +- src/components/script/dom/htmlmainelement.rs | 2 +- src/components/script/dom/htmlmapelement.rs | 2 +- src/components/script/dom/htmlmediaelement.rs | 2 +- src/components/script/dom/htmlmetaelement.rs | 2 +- src/components/script/dom/htmlmeterelement.rs | 2 +- src/components/script/dom/htmlmodelement.rs | 2 +- src/components/script/dom/htmlobjectelement.rs | 2 +- src/components/script/dom/htmlolistelement.rs | 2 +- src/components/script/dom/htmloptgroupelement.rs | 2 +- src/components/script/dom/htmloptionelement.rs | 2 +- src/components/script/dom/htmloutputelement.rs | 2 +- src/components/script/dom/htmlparagraphelement.rs | 2 +- src/components/script/dom/htmlparamelement.rs | 2 +- src/components/script/dom/htmlpreelement.rs | 2 +- src/components/script/dom/htmlprogresselement.rs | 2 +- src/components/script/dom/htmlquoteelement.rs | 2 +- src/components/script/dom/htmlscriptelement.rs | 2 +- src/components/script/dom/htmlselectelement.rs | 2 +- src/components/script/dom/htmlsourceelement.rs | 2 +- src/components/script/dom/htmlspanelement.rs | 2 +- src/components/script/dom/htmlstyleelement.rs | 2 +- src/components/script/dom/htmltablecaptionelement.rs | 2 +- src/components/script/dom/htmltablecellelement.rs | 2 +- src/components/script/dom/htmltablecolelement.rs | 2 +- src/components/script/dom/htmltableelement.rs | 2 +- src/components/script/dom/htmltablerowelement.rs | 2 +- src/components/script/dom/htmltablesectionelement.rs | 2 +- src/components/script/dom/htmltemplateelement.rs | 2 +- src/components/script/dom/htmltextareaelement.rs | 2 +- src/components/script/dom/htmltimeelement.rs | 2 +- src/components/script/dom/htmltitleelement.rs | 2 +- src/components/script/dom/htmltrackelement.rs | 2 +- src/components/script/dom/htmlulistelement.rs | 2 +- src/components/script/dom/htmlunknownelement.rs | 2 +- 65 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/components/script/dom/htmlanchorelement.rs b/src/components/script/dom/htmlanchorelement.rs index d5743b71ea0..21a28aecaeb 100644 --- a/src/components/script/dom/htmlanchorelement.rs +++ b/src/components/script/dom/htmlanchorelement.rs @@ -16,7 +16,7 @@ pub struct HTMLAnchorElement { impl HTMLAnchorElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAnchorElement { HTMLAnchorElement { - htmlelement: HTMLElement::new(HTMLAnchorElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLAnchorElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlappletelement.rs b/src/components/script/dom/htmlappletelement.rs index d6797b62e62..7471c3557d6 100644 --- a/src/components/script/dom/htmlappletelement.rs +++ b/src/components/script/dom/htmlappletelement.rs @@ -16,7 +16,7 @@ pub struct HTMLAppletElement { impl HTMLAppletElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAppletElement { HTMLAppletElement { - htmlelement: HTMLElement::new(HTMLAppletElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLAppletElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlareaelement.rs b/src/components/script/dom/htmlareaelement.rs index c251243ff05..4f77f9a12ed 100644 --- a/src/components/script/dom/htmlareaelement.rs +++ b/src/components/script/dom/htmlareaelement.rs @@ -16,7 +16,7 @@ pub struct HTMLAreaElement { impl HTMLAreaElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAreaElement { HTMLAreaElement { - htmlelement: HTMLElement::new(HTMLAreaElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLAreaElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlbaseelement.rs b/src/components/script/dom/htmlbaseelement.rs index 4fbf1ff4409..077db6d8405 100644 --- a/src/components/script/dom/htmlbaseelement.rs +++ b/src/components/script/dom/htmlbaseelement.rs @@ -16,7 +16,7 @@ pub struct HTMLBaseElement { impl HTMLBaseElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBaseElement { HTMLBaseElement { - htmlelement: HTMLElement::new(HTMLBaseElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLBaseElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlbodyelement.rs b/src/components/script/dom/htmlbodyelement.rs index 2dea5fdcbfa..4105c0742ad 100644 --- a/src/components/script/dom/htmlbodyelement.rs +++ b/src/components/script/dom/htmlbodyelement.rs @@ -16,7 +16,7 @@ pub struct HTMLBodyElement { impl HTMLBodyElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBodyElement { HTMLBodyElement { - htmlelement: HTMLElement::new(HTMLBodyElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLBodyElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlbrelement.rs b/src/components/script/dom/htmlbrelement.rs index 0cbd66a1ec6..653424c1c8c 100644 --- a/src/components/script/dom/htmlbrelement.rs +++ b/src/components/script/dom/htmlbrelement.rs @@ -16,7 +16,7 @@ pub struct HTMLBRElement { impl HTMLBRElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBRElement { HTMLBRElement { - htmlelement: HTMLElement::new(HTMLBRElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLBRElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlbuttonelement.rs b/src/components/script/dom/htmlbuttonelement.rs index a6b90b9d123..5bd1c352d8e 100644 --- a/src/components/script/dom/htmlbuttonelement.rs +++ b/src/components/script/dom/htmlbuttonelement.rs @@ -17,7 +17,7 @@ pub struct HTMLButtonElement { impl HTMLButtonElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLButtonElement { HTMLButtonElement { - htmlelement: HTMLElement::new(HTMLButtonElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLButtonElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlcanvaselement.rs b/src/components/script/dom/htmlcanvaselement.rs index 81adc4550f1..4c789163d72 100644 --- a/src/components/script/dom/htmlcanvaselement.rs +++ b/src/components/script/dom/htmlcanvaselement.rs @@ -16,7 +16,7 @@ pub struct HTMLCanvasElement { impl HTMLCanvasElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLCanvasElement { HTMLCanvasElement { - htmlelement: HTMLElement::new(HTMLCanvasElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLCanvasElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmldataelement.rs b/src/components/script/dom/htmldataelement.rs index 9b91452d59a..5e97f113cbf 100644 --- a/src/components/script/dom/htmldataelement.rs +++ b/src/components/script/dom/htmldataelement.rs @@ -16,7 +16,7 @@ pub struct HTMLDataElement { impl HTMLDataElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDataElement { HTMLDataElement { - htmlelement: HTMLElement::new(HTMLDataElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDataElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmldatalistelement.rs b/src/components/script/dom/htmldatalistelement.rs index 95dcf628efd..9f5bfce6b37 100644 --- a/src/components/script/dom/htmldatalistelement.rs +++ b/src/components/script/dom/htmldatalistelement.rs @@ -16,7 +16,7 @@ pub struct HTMLDataListElement { impl HTMLDataListElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDataListElement { HTMLDataListElement { - htmlelement: HTMLElement::new(HTMLDataListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDataListElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmldirectoryelement.rs b/src/components/script/dom/htmldirectoryelement.rs index cadabe92b1e..fb63cecfaf9 100644 --- a/src/components/script/dom/htmldirectoryelement.rs +++ b/src/components/script/dom/htmldirectoryelement.rs @@ -16,7 +16,7 @@ pub struct HTMLDirectoryElement { impl HTMLDirectoryElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDirectoryElement { HTMLDirectoryElement { - htmlelement: HTMLElement::new(HTMLDirectoryElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDirectoryElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmldivelement.rs b/src/components/script/dom/htmldivelement.rs index 277a1c10b10..26ce3ba6a14 100644 --- a/src/components/script/dom/htmldivelement.rs +++ b/src/components/script/dom/htmldivelement.rs @@ -16,7 +16,7 @@ pub struct HTMLDivElement { impl HTMLDivElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDivElement { HTMLDivElement { - htmlelement: HTMLElement::new(HTMLDivElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDivElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmldlistelement.rs b/src/components/script/dom/htmldlistelement.rs index 686763c69ad..63b770e9534 100644 --- a/src/components/script/dom/htmldlistelement.rs +++ b/src/components/script/dom/htmldlistelement.rs @@ -16,7 +16,7 @@ pub struct HTMLDListElement { impl HTMLDListElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDListElement { HTMLDListElement { - htmlelement: HTMLElement::new(HTMLDListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDListElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs index 22a6437ea9e..59a75e1353d 100644 --- a/src/components/script/dom/htmlelement.rs +++ b/src/components/script/dom/htmlelement.rs @@ -14,7 +14,7 @@ pub struct HTMLElement { } impl HTMLElement { - pub fn new(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLElement { + pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLElement { HTMLElement { element: Element::new(type_id, tag_name, document) } diff --git a/src/components/script/dom/htmlembedelement.rs b/src/components/script/dom/htmlembedelement.rs index 9f020246f19..ca9b0e5a53e 100644 --- a/src/components/script/dom/htmlembedelement.rs +++ b/src/components/script/dom/htmlembedelement.rs @@ -16,7 +16,7 @@ pub struct HTMLEmbedElement { impl HTMLEmbedElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLEmbedElement { HTMLEmbedElement { - htmlelement: HTMLElement::new(HTMLEmbedElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLEmbedElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlfieldsetelement.rs b/src/components/script/dom/htmlfieldsetelement.rs index ccb34ee6656..89011d9dfda 100644 --- a/src/components/script/dom/htmlfieldsetelement.rs +++ b/src/components/script/dom/htmlfieldsetelement.rs @@ -18,7 +18,7 @@ pub struct HTMLFieldSetElement { impl HTMLFieldSetElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFieldSetElement { HTMLFieldSetElement { - htmlelement: HTMLElement::new(HTMLFieldSetElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlfontelement.rs b/src/components/script/dom/htmlfontelement.rs index 4c69baaa4aa..d15251e4c7d 100644 --- a/src/components/script/dom/htmlfontelement.rs +++ b/src/components/script/dom/htmlfontelement.rs @@ -16,7 +16,7 @@ pub struct HTMLFontElement { impl HTMLFontElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFontElement { HTMLFontElement { - htmlelement: HTMLElement::new(HTMLFontElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFontElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index c6e5263aee2..54469a9631f 100644 --- a/src/components/script/dom/htmlformelement.rs +++ b/src/components/script/dom/htmlformelement.rs @@ -17,7 +17,7 @@ pub struct HTMLFormElement { impl HTMLFormElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFormElement { HTMLFormElement { - htmlelement: HTMLElement::new(HTMLFormElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFormElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlframeelement.rs b/src/components/script/dom/htmlframeelement.rs index 30a6e30f24c..a9ab387c58e 100644 --- a/src/components/script/dom/htmlframeelement.rs +++ b/src/components/script/dom/htmlframeelement.rs @@ -17,7 +17,7 @@ pub struct HTMLFrameElement { impl HTMLFrameElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFrameElement { HTMLFrameElement { - htmlelement: HTMLElement::new(HTMLFrameElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlframesetelement.rs b/src/components/script/dom/htmlframesetelement.rs index df25a03e7e3..42dc12f78e4 100644 --- a/src/components/script/dom/htmlframesetelement.rs +++ b/src/components/script/dom/htmlframesetelement.rs @@ -16,7 +16,7 @@ pub struct HTMLFrameSetElement { impl HTMLFrameSetElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFrameSetElement { HTMLFrameSetElement { - htmlelement: HTMLElement::new(HTMLFrameSetElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFrameSetElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlheadelement.rs b/src/components/script/dom/htmlheadelement.rs index a94638d72c1..cd2a046cba9 100644 --- a/src/components/script/dom/htmlheadelement.rs +++ b/src/components/script/dom/htmlheadelement.rs @@ -15,7 +15,7 @@ pub struct HTMLHeadElement { impl HTMLHeadElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHeadElement { HTMLHeadElement { - htmlelement: HTMLElement::new(HTMLHeadElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLHeadElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlheadingelement.rs b/src/components/script/dom/htmlheadingelement.rs index 13370230c8b..a8b840b6edc 100644 --- a/src/components/script/dom/htmlheadingelement.rs +++ b/src/components/script/dom/htmlheadingelement.rs @@ -26,7 +26,7 @@ pub struct HTMLHeadingElement { impl HTMLHeadingElement { pub fn new_inherited(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> HTMLHeadingElement { HTMLHeadingElement { - htmlelement: HTMLElement::new(HTMLHeadingElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLHeadingElementTypeId, localName, document), level: level, } } diff --git a/src/components/script/dom/htmlhrelement.rs b/src/components/script/dom/htmlhrelement.rs index 677b86dc796..cb7662148c1 100644 --- a/src/components/script/dom/htmlhrelement.rs +++ b/src/components/script/dom/htmlhrelement.rs @@ -16,7 +16,7 @@ pub struct HTMLHRElement { impl HTMLHRElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHRElement { HTMLHRElement { - htmlelement: HTMLElement::new(HTMLHRElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLHRElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlhtmlelement.rs b/src/components/script/dom/htmlhtmlelement.rs index e86478f3585..1292ff49692 100644 --- a/src/components/script/dom/htmlhtmlelement.rs +++ b/src/components/script/dom/htmlhtmlelement.rs @@ -16,7 +16,7 @@ pub struct HTMLHtmlElement { impl HTMLHtmlElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHtmlElement { HTMLHtmlElement { - htmlelement: HTMLElement::new(HTMLHtmlElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index efb47baaf48..08bde32f44e 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -63,7 +63,7 @@ impl HTMLIFrameElement { impl HTMLIFrameElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLIFrameElement { HTMLIFrameElement { - htmlelement: HTMLElement::new(HTMLIframeElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLIframeElementTypeId, localName, document), frame: None, size: None, sandbox: None, diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index f10dccf28d4..94b48b6252f 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -24,7 +24,7 @@ pub struct HTMLImageElement { impl HTMLImageElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLImageElement { HTMLImageElement { - htmlelement: HTMLElement::new(HTMLImageElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLImageElementTypeId, localName, document), image: None, } } diff --git a/src/components/script/dom/htmlinputelement.rs b/src/components/script/dom/htmlinputelement.rs index 7657ea8b9be..5e85f32dc79 100644 --- a/src/components/script/dom/htmlinputelement.rs +++ b/src/components/script/dom/htmlinputelement.rs @@ -16,7 +16,7 @@ pub struct HTMLInputElement { impl HTMLInputElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLInputElement { HTMLInputElement { - htmlelement: HTMLElement::new(HTMLInputElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLInputElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmllabelelement.rs b/src/components/script/dom/htmllabelelement.rs index 25d66551049..35ffbfa900e 100644 --- a/src/components/script/dom/htmllabelelement.rs +++ b/src/components/script/dom/htmllabelelement.rs @@ -16,7 +16,7 @@ pub struct HTMLLabelElement { impl HTMLLabelElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLabelElement { HTMLLabelElement { - htmlelement: HTMLElement::new(HTMLLabelElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLabelElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmllegendelement.rs b/src/components/script/dom/htmllegendelement.rs index aeb9d3d6c9b..2eeec359a44 100644 --- a/src/components/script/dom/htmllegendelement.rs +++ b/src/components/script/dom/htmllegendelement.rs @@ -16,7 +16,7 @@ pub struct HTMLLegendElement { impl HTMLLegendElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLegendElement { HTMLLegendElement { - htmlelement: HTMLElement::new(HTMLLegendElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLegendElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmllielement.rs b/src/components/script/dom/htmllielement.rs index 0716bf6c0d4..ea719be1362 100644 --- a/src/components/script/dom/htmllielement.rs +++ b/src/components/script/dom/htmllielement.rs @@ -16,7 +16,7 @@ pub struct HTMLLIElement { impl HTMLLIElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLIElement { HTMLLIElement { - htmlelement: HTMLElement::new(HTMLLIElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLIElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmllinkelement.rs b/src/components/script/dom/htmllinkelement.rs index 17edfd3be6b..6833e457ba4 100644 --- a/src/components/script/dom/htmllinkelement.rs +++ b/src/components/script/dom/htmllinkelement.rs @@ -16,7 +16,7 @@ pub struct HTMLLinkElement { impl HTMLLinkElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLinkElement { HTMLLinkElement { - htmlelement: HTMLElement::new(HTMLLinkElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlmainelement.rs b/src/components/script/dom/htmlmainelement.rs index 83f48e74e5b..cbcd68d17b7 100644 --- a/src/components/script/dom/htmlmainelement.rs +++ b/src/components/script/dom/htmlmainelement.rs @@ -15,7 +15,7 @@ pub struct HTMLMainElement { impl HTMLMainElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMainElement { HTMLMainElement { - htmlelement: HTMLElement::new(HTMLMainElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMainElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index 12f881ec3f1..7174f829c31 100644 --- a/src/components/script/dom/htmlmapelement.rs +++ b/src/components/script/dom/htmlmapelement.rs @@ -17,7 +17,7 @@ pub struct HTMLMapElement { impl HTMLMapElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMapElement { HTMLMapElement { - htmlelement: HTMLElement::new(HTMLMapElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMapElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlmediaelement.rs b/src/components/script/dom/htmlmediaelement.rs index 683ae7bf2e1..1daad8ecf95 100644 --- a/src/components/script/dom/htmlmediaelement.rs +++ b/src/components/script/dom/htmlmediaelement.rs @@ -14,7 +14,7 @@ pub struct HTMLMediaElement { impl HTMLMediaElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement { HTMLMediaElement { - htmlelement: HTMLElement::new(type_id, tag_name, document) + htmlelement: HTMLElement::new_inherited(type_id, tag_name, document) } } } diff --git a/src/components/script/dom/htmlmetaelement.rs b/src/components/script/dom/htmlmetaelement.rs index 51fdbe419c9..20a6257e74b 100644 --- a/src/components/script/dom/htmlmetaelement.rs +++ b/src/components/script/dom/htmlmetaelement.rs @@ -16,7 +16,7 @@ pub struct HTMLMetaElement { impl HTMLMetaElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMetaElement { HTMLMetaElement { - htmlelement: HTMLElement::new(HTMLMetaElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMetaElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlmeterelement.rs b/src/components/script/dom/htmlmeterelement.rs index c9bb4983fce..ea039682f51 100644 --- a/src/components/script/dom/htmlmeterelement.rs +++ b/src/components/script/dom/htmlmeterelement.rs @@ -16,7 +16,7 @@ pub struct HTMLMeterElement { impl HTMLMeterElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMeterElement { HTMLMeterElement { - htmlelement: HTMLElement::new(HTMLMeterElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMeterElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlmodelement.rs b/src/components/script/dom/htmlmodelement.rs index e1aad28c5af..ff45b90be87 100644 --- a/src/components/script/dom/htmlmodelement.rs +++ b/src/components/script/dom/htmlmodelement.rs @@ -16,7 +16,7 @@ pub struct HTMLModElement { impl HTMLModElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLModElement { HTMLModElement { - htmlelement: HTMLElement::new(HTMLModElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index da31fdd73c6..7fc29c32812 100644 --- a/src/components/script/dom/htmlobjectelement.rs +++ b/src/components/script/dom/htmlobjectelement.rs @@ -18,7 +18,7 @@ pub struct HTMLObjectElement { impl HTMLObjectElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLObjectElement { HTMLObjectElement { - htmlelement: HTMLElement::new(HTMLObjectElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLObjectElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlolistelement.rs b/src/components/script/dom/htmlolistelement.rs index 157073e86c3..1a2fd349032 100644 --- a/src/components/script/dom/htmlolistelement.rs +++ b/src/components/script/dom/htmlolistelement.rs @@ -16,7 +16,7 @@ pub struct HTMLOListElement { impl HTMLOListElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOListElement { HTMLOListElement { - htmlelement: HTMLElement::new(HTMLOListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOListElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmloptgroupelement.rs b/src/components/script/dom/htmloptgroupelement.rs index 55825725424..0bd13fbd6e3 100644 --- a/src/components/script/dom/htmloptgroupelement.rs +++ b/src/components/script/dom/htmloptgroupelement.rs @@ -16,7 +16,7 @@ pub struct HTMLOptGroupElement { impl HTMLOptGroupElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptGroupElement { HTMLOptGroupElement { - htmlelement: HTMLElement::new(HTMLOptGroupElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOptGroupElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs index 52c5daf8bf9..4f7adb4b845 100644 --- a/src/components/script/dom/htmloptionelement.rs +++ b/src/components/script/dom/htmloptionelement.rs @@ -16,7 +16,7 @@ pub struct HTMLOptionElement { impl HTMLOptionElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptionElement { HTMLOptionElement { - htmlelement: HTMLElement::new(HTMLOptionElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOptionElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs index d006eb7e97f..8c5832f1d6a 100644 --- a/src/components/script/dom/htmloutputelement.rs +++ b/src/components/script/dom/htmloutputelement.rs @@ -17,7 +17,7 @@ pub struct HTMLOutputElement { impl HTMLOutputElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOutputElement { HTMLOutputElement { - htmlelement: HTMLElement::new(HTMLOutputElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOutputElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlparagraphelement.rs b/src/components/script/dom/htmlparagraphelement.rs index bfd39a240f9..2c07892f7e6 100644 --- a/src/components/script/dom/htmlparagraphelement.rs +++ b/src/components/script/dom/htmlparagraphelement.rs @@ -16,7 +16,7 @@ pub struct HTMLParagraphElement { impl HTMLParagraphElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParagraphElement { HTMLParagraphElement { - htmlelement: HTMLElement::new(HTMLParagraphElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLParagraphElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs index 38f48a22c5c..b97eb017872 100644 --- a/src/components/script/dom/htmlparamelement.rs +++ b/src/components/script/dom/htmlparamelement.rs @@ -16,7 +16,7 @@ pub struct HTMLParamElement { impl HTMLParamElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParamElement { HTMLParamElement { - htmlelement: HTMLElement::new(HTMLParamElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlpreelement.rs b/src/components/script/dom/htmlpreelement.rs index 2a2a9d64841..2c736fd7d8e 100644 --- a/src/components/script/dom/htmlpreelement.rs +++ b/src/components/script/dom/htmlpreelement.rs @@ -16,7 +16,7 @@ pub struct HTMLPreElement { impl HTMLPreElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLPreElement { HTMLPreElement { - htmlelement: HTMLElement::new(HTMLPreElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLPreElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlprogresselement.rs b/src/components/script/dom/htmlprogresselement.rs index 9983d71a0dd..7f7c13d6318 100644 --- a/src/components/script/dom/htmlprogresselement.rs +++ b/src/components/script/dom/htmlprogresselement.rs @@ -16,7 +16,7 @@ pub struct HTMLProgressElement { impl HTMLProgressElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLProgressElement { HTMLProgressElement { - htmlelement: HTMLElement::new(HTMLProgressElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLProgressElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlquoteelement.rs b/src/components/script/dom/htmlquoteelement.rs index 682b4e68b20..5b03188c9c6 100644 --- a/src/components/script/dom/htmlquoteelement.rs +++ b/src/components/script/dom/htmlquoteelement.rs @@ -16,7 +16,7 @@ pub struct HTMLQuoteElement { impl HTMLQuoteElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLQuoteElement { HTMLQuoteElement { - htmlelement: HTMLElement::new(HTMLQuoteElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLQuoteElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlscriptelement.rs b/src/components/script/dom/htmlscriptelement.rs index 0925a0109f5..ea47c904f1f 100644 --- a/src/components/script/dom/htmlscriptelement.rs +++ b/src/components/script/dom/htmlscriptelement.rs @@ -17,7 +17,7 @@ pub struct HTMLScriptElement { impl HTMLScriptElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLScriptElement { HTMLScriptElement { - htmlelement: HTMLElement::new(HTMLScriptElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlselectelement.rs b/src/components/script/dom/htmlselectelement.rs index 38c3da4292a..bda52c7ed18 100644 --- a/src/components/script/dom/htmlselectelement.rs +++ b/src/components/script/dom/htmlselectelement.rs @@ -17,7 +17,7 @@ pub struct HTMLSelectElement { impl HTMLSelectElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSelectElement { HTMLSelectElement { - htmlelement: HTMLElement::new(HTMLSelectElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLSelectElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlsourceelement.rs b/src/components/script/dom/htmlsourceelement.rs index 4168f891835..89933a7478a 100644 --- a/src/components/script/dom/htmlsourceelement.rs +++ b/src/components/script/dom/htmlsourceelement.rs @@ -16,7 +16,7 @@ pub struct HTMLSourceElement { impl HTMLSourceElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSourceElement { HTMLSourceElement { - htmlelement: HTMLElement::new(HTMLSourceElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLSourceElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlspanelement.rs b/src/components/script/dom/htmlspanelement.rs index 78eb18323b1..f1678043a62 100644 --- a/src/components/script/dom/htmlspanelement.rs +++ b/src/components/script/dom/htmlspanelement.rs @@ -15,7 +15,7 @@ pub struct HTMLSpanElement { impl HTMLSpanElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSpanElement { HTMLSpanElement { - htmlelement: HTMLElement::new(HTMLSpanElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLSpanElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs index d6817a7d2b9..88c933d851e 100644 --- a/src/components/script/dom/htmlstyleelement.rs +++ b/src/components/script/dom/htmlstyleelement.rs @@ -16,7 +16,7 @@ pub struct HTMLStyleElement { impl HTMLStyleElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLStyleElement { HTMLStyleElement { - htmlelement: HTMLElement::new(HTMLStyleElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs index 405e59cf272..788e239344a 100644 --- a/src/components/script/dom/htmltablecaptionelement.rs +++ b/src/components/script/dom/htmltablecaptionelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTableCaptionElement { impl HTMLTableCaptionElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableCaptionElement { HTMLTableCaptionElement { - htmlelement: HTMLElement::new(HTMLTableCaptionElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableCaptionElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltablecellelement.rs b/src/components/script/dom/htmltablecellelement.rs index 771cd389ecb..9869bf3fb7f 100644 --- a/src/components/script/dom/htmltablecellelement.rs +++ b/src/components/script/dom/htmltablecellelement.rs @@ -14,7 +14,7 @@ pub struct HTMLTableCellElement { impl HTMLTableCellElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement { HTMLTableCellElement { - htmlelement: HTMLElement::new(type_id, tag_name, document) + htmlelement: HTMLElement::new_inherited(type_id, tag_name, document) } } } diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs index 27817306a2c..633e40e60f8 100644 --- a/src/components/script/dom/htmltablecolelement.rs +++ b/src/components/script/dom/htmltablecolelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTableColElement { impl HTMLTableColElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableColElement { HTMLTableColElement { - htmlelement: HTMLElement::new(HTMLTableColElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableColElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltableelement.rs b/src/components/script/dom/htmltableelement.rs index 8cdf888440e..9456c8554ed 100644 --- a/src/components/script/dom/htmltableelement.rs +++ b/src/components/script/dom/htmltableelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTableElement { impl HTMLTableElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableElement { HTMLTableElement { - htmlelement: HTMLElement::new(HTMLTableElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs index 5d61f0e7fb5..de22597d057 100644 --- a/src/components/script/dom/htmltablerowelement.rs +++ b/src/components/script/dom/htmltablerowelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTableRowElement { impl HTMLTableRowElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableRowElement { HTMLTableRowElement { - htmlelement: HTMLElement::new(HTMLTableRowElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableRowElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltablesectionelement.rs b/src/components/script/dom/htmltablesectionelement.rs index 08951af578a..8133e768ea3 100644 --- a/src/components/script/dom/htmltablesectionelement.rs +++ b/src/components/script/dom/htmltablesectionelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTableSectionElement { impl HTMLTableSectionElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableSectionElement { HTMLTableSectionElement { - htmlelement: HTMLElement::new(HTMLTableSectionElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableSectionElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltemplateelement.rs b/src/components/script/dom/htmltemplateelement.rs index 8ccea37c420..b42e8f5df06 100644 --- a/src/components/script/dom/htmltemplateelement.rs +++ b/src/components/script/dom/htmltemplateelement.rs @@ -15,7 +15,7 @@ pub struct HTMLTemplateElement { impl HTMLTemplateElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTemplateElement { HTMLTemplateElement { - htmlelement: HTMLElement::new(HTMLTemplateElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTemplateElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltextareaelement.rs b/src/components/script/dom/htmltextareaelement.rs index 67f8d8d5bba..5065d90a76e 100644 --- a/src/components/script/dom/htmltextareaelement.rs +++ b/src/components/script/dom/htmltextareaelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTextAreaElement { impl HTMLTextAreaElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTextAreaElement { HTMLTextAreaElement { - htmlelement: HTMLElement::new(HTMLTextAreaElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTextAreaElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltimeelement.rs b/src/components/script/dom/htmltimeelement.rs index ec615d60b8c..93c6081cb62 100644 --- a/src/components/script/dom/htmltimeelement.rs +++ b/src/components/script/dom/htmltimeelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTimeElement { impl HTMLTimeElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTimeElement { HTMLTimeElement { - htmlelement: HTMLElement::new(HTMLTimeElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTimeElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltitleelement.rs b/src/components/script/dom/htmltitleelement.rs index e54ebdebb22..fd646b5b797 100644 --- a/src/components/script/dom/htmltitleelement.rs +++ b/src/components/script/dom/htmltitleelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTitleElement { impl HTMLTitleElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTitleElement { HTMLTitleElement { - htmlelement: HTMLElement::new(HTMLTitleElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTitleElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmltrackelement.rs b/src/components/script/dom/htmltrackelement.rs index 9b6fae79360..1a5a2072356 100644 --- a/src/components/script/dom/htmltrackelement.rs +++ b/src/components/script/dom/htmltrackelement.rs @@ -16,7 +16,7 @@ pub struct HTMLTrackElement { impl HTMLTrackElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTrackElement { HTMLTrackElement { - htmlelement: HTMLElement::new(HTMLTrackElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTrackElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlulistelement.rs b/src/components/script/dom/htmlulistelement.rs index 478d34681f9..ee7df48009a 100644 --- a/src/components/script/dom/htmlulistelement.rs +++ b/src/components/script/dom/htmlulistelement.rs @@ -16,7 +16,7 @@ pub struct HTMLUListElement { impl HTMLUListElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUListElement { HTMLUListElement { - htmlelement: HTMLElement::new(HTMLUListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLUListElementTypeId, localName, document) } } diff --git a/src/components/script/dom/htmlunknownelement.rs b/src/components/script/dom/htmlunknownelement.rs index b8b1795908c..4ff25898e13 100644 --- a/src/components/script/dom/htmlunknownelement.rs +++ b/src/components/script/dom/htmlunknownelement.rs @@ -15,7 +15,7 @@ pub struct HTMLUnknownElement { impl HTMLUnknownElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUnknownElement { HTMLUnknownElement { - htmlelement: HTMLElement::new(HTMLUnknownElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLUnknownElementTypeId, localName, document) } } From b4559334bbd744a63c403478946bb7636dbc2552 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 21:05:37 +0100 Subject: [PATCH 42/44] Introduce HTMLElement::new. --- src/components/script/dom/htmlelement.rs | 10 +++- .../script/html/hubbub_html_parser.rs | 47 +++---------------- 2 files changed, 15 insertions(+), 42 deletions(-) diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs index 59a75e1353d..b7ff82b6e6d 100644 --- a/src/components/script/dom/htmlelement.rs +++ b/src/components/script/dom/htmlelement.rs @@ -2,10 +2,11 @@ * 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::HTMLElementBinding; use dom::bindings::utils::{DOMString, ErrorResult, Fallible}; use dom::document::AbstractDocument; -use dom::element::{Element, ElementTypeId}; -use dom::node::{AbstractNode, ScriptView}; +use dom::element::{Element, ElementTypeId, HTMLElementTypeId}; +use dom::node::{AbstractNode, Node, ScriptView}; use js::jsapi::{JSContext, JSVal}; use js::JSVAL_NULL; @@ -19,6 +20,11 @@ impl HTMLElement { element: Element::new(type_id, tag_name, document) } } + + pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode { + let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document); + Node::reflect_node(@mut element, document, HTMLElementBinding::Wrap) + } } impl HTMLElement { diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index f906a7d21e1..21b18b69577 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::document::AbstractDocument; -use dom::element::*; +use dom::element::{HTMLLinkElementTypeId, HTMLIframeElementTypeId, HTMLImageElementTypeId}; use dom::htmlelement::HTMLElement; use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5, Heading6}; use dom::htmliframeelement::IFrameSize; @@ -32,17 +32,6 @@ use extra::future::Future; use extra::url::Url; use geom::size::Size2D; -macro_rules! handle_htmlelement( - ($cx: expr, - $document: expr, - $tag: expr, - $string: expr, - $type_id: expr, - $ctor: ident) => ( - handle_element_base!(element, Element, - $cx, $document, $tag, $string, $type_id, $ctor, []); - ) -) macro_rules! handle_newable_element( ($document: expr, $localName: expr, @@ -54,27 +43,6 @@ macro_rules! handle_newable_element( } ) ) -macro_rules! handle_element_base( - ($parent: ident, - $parent_init: ident, - $cx: expr, - $document: expr, - $tag: expr, - $string: expr, - $type_id: expr, - $ctor: ident, - [ $(($field:ident : $field_init:expr)),* ]) => ( - if eq_slice($tag, $string) { - let _element = @$ctor { - $parent: $parent_init::new($type_id, ($tag).to_str(), $document), - $( - $field: $field_init, - )* - }; - return unsafe { Node::as_abstract_node($cx, _element) }; - } - ) -) pub struct JSFile { @@ -194,18 +162,14 @@ fn js_script_listener(to_parent: SharedChan, // Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized // via atomization (issue #85). -pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode { +pub fn build_element_from_tag(_cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode { // TODO (Issue #85): use atoms - handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); - handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); - handle_htmlelement!(cx, document, tag, "i", HTMLElementTypeId, HTMLElement); - handle_htmlelement!(cx, document, tag, "section", HTMLElementTypeId, HTMLElement); - handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); - handle_newable_element!(document, tag, "a", HTMLAnchorElement); handle_newable_element!(document, tag, "applet", HTMLAppletElement); handle_newable_element!(document, tag, "area", HTMLAreaElement); + handle_newable_element!(document, tag, "aside", HTMLElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement); + handle_newable_element!(document, tag, "b", HTMLElement); handle_newable_element!(document, tag, "base", HTMLBaseElement); handle_newable_element!(document, tag, "body", HTMLBodyElement); handle_newable_element!(document, tag, "br", HTMLBRElement); @@ -235,6 +199,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum handle_newable_element!(document, tag, "head", HTMLHeadElement); handle_newable_element!(document, tag, "hr", HTMLHRElement); handle_newable_element!(document, tag, "html", HTMLHtmlElement); + handle_newable_element!(document, tag, "i", HTMLElement); handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); handle_newable_element!(document, tag, "img", HTMLImageElement); handle_newable_element!(document, tag, "input", HTMLInputElement); @@ -258,7 +223,9 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum 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, "section", HTMLElement); handle_newable_element!(document, tag, "select", HTMLSelectElement); + handle_newable_element!(document, tag, "small", HTMLElement); handle_newable_element!(document, tag, "source", HTMLSourceElement); handle_newable_element!(document, tag, "span", HTMLSpanElement); handle_newable_element!(document, tag, "style", HTMLStyleElement); From 7700a892fcae8f153885f38a81bbc44d4d4b7510 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 21:13:37 +0100 Subject: [PATCH 43/44] Cleanup build_element_from_tag's signature. --- src/components/script/dom/document.rs | 3 +-- src/components/script/html/hubbub_html_parser.rs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 251da394cf5..f889c5ddde2 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -235,13 +235,12 @@ impl Document { } pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &DOMString) -> Fallible> { - let cx = self.get_cx(); let local_name = null_str_as_empty(local_name); if !is_valid_element_name(local_name) { return Err(InvalidCharacter); } let local_name = local_name.to_ascii_lower(); - Ok(build_element_from_tag(cx, local_name, abstract_self)) + Ok(build_element_from_tag(local_name, abstract_self)) } pub fn CreateDocumentFragment(&self, abstract_self: AbstractDocument) -> AbstractNode { diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 21b18b69577..de87a13134e 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -39,7 +39,7 @@ macro_rules! handle_newable_element( $ctor: ident $(, $arg:expr )*) => ( if eq_slice($localName, $string) { - return $ctor::new(($localName).to_str(), $document $(, $arg)*); + return $ctor::new($localName, $document $(, $arg)*); } ) ) @@ -162,7 +162,7 @@ fn js_script_listener(to_parent: SharedChan, // Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized // via atomization (issue #85). -pub fn build_element_from_tag(_cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode { +pub fn build_element_from_tag(tag: ~str, document: AbstractDocument) -> AbstractNode { // TODO (Issue #85): use atoms handle_newable_element!(document, tag, "a", HTMLAnchorElement); handle_newable_element!(document, tag, "applet", HTMLAppletElement); @@ -242,7 +242,7 @@ pub fn build_element_from_tag(_cx: *JSContext, tag: &str, document: AbstractDocu handle_newable_element!(document, tag, "ul", HTMLUListElement); handle_newable_element!(document, tag, "video", HTMLVideoElement); - return HTMLUnknownElement::new(tag.to_str(), document); + return HTMLUnknownElement::new(tag, document); } pub fn parse_html(cx: *JSContext, @@ -336,7 +336,7 @@ pub fn parse_html(cx: *JSContext, }, create_element: |tag: ~hubbub::Tag| { debug!("create element"); - let node = build_element_from_tag(cx, tag.name, document); + let node = build_element_from_tag(tag.name.clone(), document); debug!("-- attach attrs"); do node.as_mut_element |element| { From 655a2099ef1adf6b8712557331ef649d990b0541 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 2 Nov 2013 21:14:15 +0100 Subject: [PATCH 44/44] Rename handle_newable_element to handle_element. --- .../script/html/hubbub_html_parser.rs | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index de87a13134e..f1622d8215e 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -32,7 +32,7 @@ use extra::future::Future; use extra::url::Url; use geom::size::Size2D; -macro_rules! handle_newable_element( +macro_rules! handle_element( ($document: expr, $localName: expr, $string: expr, @@ -164,83 +164,83 @@ fn js_script_listener(to_parent: SharedChan, pub fn build_element_from_tag(tag: ~str, document: AbstractDocument) -> AbstractNode { // TODO (Issue #85): use atoms - handle_newable_element!(document, tag, "a", HTMLAnchorElement); - handle_newable_element!(document, tag, "applet", HTMLAppletElement); - handle_newable_element!(document, tag, "area", HTMLAreaElement); - handle_newable_element!(document, tag, "aside", HTMLElement); - handle_newable_element!(document, tag, "audio", HTMLAudioElement); - handle_newable_element!(document, tag, "b", HTMLElement); - handle_newable_element!(document, tag, "base", HTMLBaseElement); - handle_newable_element!(document, tag, "body", HTMLBodyElement); - handle_newable_element!(document, tag, "br", HTMLBRElement); - handle_newable_element!(document, tag, "button", HTMLButtonElement); - handle_newable_element!(document, tag, "canvas", HTMLCanvasElement); - 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, "data", HTMLDataElement); - handle_newable_element!(document, tag, "datalist", HTMLDataListElement); - handle_newable_element!(document, tag, "del", HTMLModElement); - handle_newable_element!(document, tag, "dir", HTMLDirectoryElement); - handle_newable_element!(document, tag, "div", HTMLDivElement); - handle_newable_element!(document, tag, "dl", HTMLDListElement); - handle_newable_element!(document, tag, "embed", HTMLEmbedElement); - handle_newable_element!(document, tag, "fieldset", HTMLFieldSetElement); - handle_newable_element!(document, tag, "font", HTMLFontElement); - handle_newable_element!(document, tag, "form", HTMLFormElement); - 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); - 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, "head", HTMLHeadElement); - handle_newable_element!(document, tag, "hr", HTMLHRElement); - handle_newable_element!(document, tag, "html", HTMLHtmlElement); - handle_newable_element!(document, tag, "i", HTMLElement); - handle_newable_element!(document, tag, "iframe", HTMLIFrameElement); - handle_newable_element!(document, tag, "img", HTMLImageElement); - handle_newable_element!(document, tag, "input", HTMLInputElement); - handle_newable_element!(document, tag, "ins", HTMLModElement); - handle_newable_element!(document, tag, "label", HTMLLabelElement); - handle_newable_element!(document, tag, "legend", HTMLLegendElement); - handle_newable_element!(document, tag, "li", HTMLLIElement); - handle_newable_element!(document, tag, "link", HTMLLinkElement); - handle_newable_element!(document, tag, "main", HTMLMainElement); - handle_newable_element!(document, tag, "map", HTMLMapElement); - handle_newable_element!(document, tag, "meta", HTMLMetaElement); - handle_newable_element!(document, tag, "meter", HTMLMeterElement); - handle_newable_element!(document, tag, "object", HTMLObjectElement); - handle_newable_element!(document, tag, "ol", HTMLOListElement); - handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement); - handle_newable_element!(document, tag, "option", HTMLOptionElement); - handle_newable_element!(document, tag, "output", HTMLOutputElement); - 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, "section", HTMLElement); - handle_newable_element!(document, tag, "select", HTMLSelectElement); - handle_newable_element!(document, tag, "small", HTMLElement); - 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); + handle_element!(document, tag, "a", HTMLAnchorElement); + handle_element!(document, tag, "applet", HTMLAppletElement); + handle_element!(document, tag, "area", HTMLAreaElement); + handle_element!(document, tag, "aside", HTMLElement); + handle_element!(document, tag, "audio", HTMLAudioElement); + handle_element!(document, tag, "b", HTMLElement); + handle_element!(document, tag, "base", HTMLBaseElement); + handle_element!(document, tag, "body", HTMLBodyElement); + handle_element!(document, tag, "br", HTMLBRElement); + handle_element!(document, tag, "button", HTMLButtonElement); + handle_element!(document, tag, "canvas", HTMLCanvasElement); + handle_element!(document, tag, "caption", HTMLTableCaptionElement); + handle_element!(document, tag, "col", HTMLTableColElement); + handle_element!(document, tag, "colgroup", HTMLTableColElement); + handle_element!(document, tag, "data", HTMLDataElement); + handle_element!(document, tag, "datalist", HTMLDataListElement); + handle_element!(document, tag, "del", HTMLModElement); + handle_element!(document, tag, "dir", HTMLDirectoryElement); + handle_element!(document, tag, "div", HTMLDivElement); + handle_element!(document, tag, "dl", HTMLDListElement); + handle_element!(document, tag, "embed", HTMLEmbedElement); + handle_element!(document, tag, "fieldset", HTMLFieldSetElement); + handle_element!(document, tag, "font", HTMLFontElement); + handle_element!(document, tag, "form", HTMLFormElement); + handle_element!(document, tag, "frame", HTMLFrameElement); + handle_element!(document, tag, "frameset", HTMLFrameSetElement); + handle_element!(document, tag, "h1", HTMLHeadingElement, Heading1); + handle_element!(document, tag, "h2", HTMLHeadingElement, Heading2); + handle_element!(document, tag, "h3", HTMLHeadingElement, Heading3); + handle_element!(document, tag, "h4", HTMLHeadingElement, Heading4); + handle_element!(document, tag, "h5", HTMLHeadingElement, Heading5); + handle_element!(document, tag, "h6", HTMLHeadingElement, Heading6); + handle_element!(document, tag, "head", HTMLHeadElement); + handle_element!(document, tag, "hr", HTMLHRElement); + handle_element!(document, tag, "html", HTMLHtmlElement); + handle_element!(document, tag, "i", HTMLElement); + handle_element!(document, tag, "iframe", HTMLIFrameElement); + handle_element!(document, tag, "img", HTMLImageElement); + handle_element!(document, tag, "input", HTMLInputElement); + handle_element!(document, tag, "ins", HTMLModElement); + handle_element!(document, tag, "label", HTMLLabelElement); + handle_element!(document, tag, "legend", HTMLLegendElement); + handle_element!(document, tag, "li", HTMLLIElement); + handle_element!(document, tag, "link", HTMLLinkElement); + handle_element!(document, tag, "main", HTMLMainElement); + handle_element!(document, tag, "map", HTMLMapElement); + handle_element!(document, tag, "meta", HTMLMetaElement); + handle_element!(document, tag, "meter", HTMLMeterElement); + handle_element!(document, tag, "object", HTMLObjectElement); + handle_element!(document, tag, "ol", HTMLOListElement); + handle_element!(document, tag, "optgroup", HTMLOptGroupElement); + handle_element!(document, tag, "option", HTMLOptionElement); + handle_element!(document, tag, "output", HTMLOutputElement); + handle_element!(document, tag, "p", HTMLParagraphElement); + handle_element!(document, tag, "param", HTMLParamElement); + handle_element!(document, tag, "pre", HTMLPreElement); + handle_element!(document, tag, "progress", HTMLProgressElement); + handle_element!(document, tag, "q", HTMLQuoteElement); + handle_element!(document, tag, "script", HTMLScriptElement); + handle_element!(document, tag, "section", HTMLElement); + handle_element!(document, tag, "select", HTMLSelectElement); + handle_element!(document, tag, "small", HTMLElement); + handle_element!(document, tag, "source", HTMLSourceElement); + handle_element!(document, tag, "span", HTMLSpanElement); + handle_element!(document, tag, "style", HTMLStyleElement); + handle_element!(document, tag, "table", HTMLTableElement); + handle_element!(document, tag, "tbody", HTMLTableSectionElement); + handle_element!(document, tag, "td", HTMLTableDataCellElement); + handle_element!(document, tag, "template", HTMLTemplateElement); + handle_element!(document, tag, "textarea", HTMLTextAreaElement); + handle_element!(document, tag, "th", HTMLTableHeaderCellElement); + handle_element!(document, tag, "time", HTMLTimeElement); + handle_element!(document, tag, "title", HTMLTitleElement); + handle_element!(document, tag, "tr", HTMLTableRowElement); + handle_element!(document, tag, "track", HTMLTrackElement); + handle_element!(document, tag, "ul", HTMLUListElement); + handle_element!(document, tag, "video", HTMLVideoElement); return HTMLUnknownElement::new(tag, document); }