From 3a5a66d54e459deb9ead7f8b8760449e9e5faa94 Mon Sep 17 00:00:00 2001 From: Gilles Leblanc Date: Mon, 6 Oct 2014 22:49:49 -0400 Subject: [PATCH] Take the prefix from createElementNS into account for HTML elements Fixes #3139 --- components/script/dom/document.rs | 7 +- components/script/dom/domimplementation.rs | 8 +- components/script/dom/htmlanchorelement.rs | 8 +- components/script/dom/htmlappletelement.rs | 8 +- components/script/dom/htmlareaelement.rs | 8 +- components/script/dom/htmlaudioelement.rs | 8 +- components/script/dom/htmlbaseelement.rs | 8 +- components/script/dom/htmlbodyelement.rs | 8 +- components/script/dom/htmlbrelement.rs | 8 +- components/script/dom/htmlbuttonelement.rs | 8 +- components/script/dom/htmlcanvaselement.rs | 8 +- components/script/dom/htmldataelement.rs | 8 +- components/script/dom/htmldatalistelement.rs | 8 +- components/script/dom/htmldirectoryelement.rs | 8 +- components/script/dom/htmldivelement.rs | 8 +- components/script/dom/htmldlistelement.rs | 8 +- components/script/dom/htmlelement.rs | 8 +- components/script/dom/htmlembedelement.rs | 8 +- components/script/dom/htmlfieldsetelement.rs | 8 +- components/script/dom/htmlfontelement.rs | 8 +- components/script/dom/htmlformelement.rs | 8 +- components/script/dom/htmlframeelement.rs | 8 +- components/script/dom/htmlframesetelement.rs | 8 +- components/script/dom/htmlheadelement.rs | 8 +- components/script/dom/htmlheadingelement.rs | 8 +- components/script/dom/htmlhrelement.rs | 8 +- components/script/dom/htmlhtmlelement.rs | 8 +- components/script/dom/htmliframeelement.rs | 8 +- components/script/dom/htmlimageelement.rs | 8 +- components/script/dom/htmlinputelement.rs | 8 +- components/script/dom/htmllabelelement.rs | 8 +- components/script/dom/htmllegendelement.rs | 8 +- components/script/dom/htmllielement.rs | 8 +- components/script/dom/htmllinkelement.rs | 8 +- components/script/dom/htmlmapelement.rs | 8 +- components/script/dom/htmlmediaelement.rs | 4 +- components/script/dom/htmlmetaelement.rs | 8 +- components/script/dom/htmlmeterelement.rs | 8 +- components/script/dom/htmlmodelement.rs | 8 +- components/script/dom/htmlobjectelement.rs | 8 +- components/script/dom/htmlolistelement.rs | 8 +- components/script/dom/htmloptgroupelement.rs | 8 +- components/script/dom/htmloptionelement.rs | 8 +- components/script/dom/htmloutputelement.rs | 8 +- components/script/dom/htmlparagraphelement.rs | 8 +- components/script/dom/htmlparamelement.rs | 8 +- components/script/dom/htmlpreelement.rs | 8 +- components/script/dom/htmlprogresselement.rs | 8 +- components/script/dom/htmlquoteelement.rs | 8 +- components/script/dom/htmlscriptelement.rs | 8 +- components/script/dom/htmlselectelement.rs | 8 +- components/script/dom/htmlsourceelement.rs | 8 +- components/script/dom/htmlspanelement.rs | 8 +- components/script/dom/htmlstyleelement.rs | 8 +- .../script/dom/htmltablecaptionelement.rs | 8 +- components/script/dom/htmltablecellelement.rs | 4 +- components/script/dom/htmltablecolelement.rs | 8 +- .../script/dom/htmltabledatacellelement.rs | 8 +- components/script/dom/htmltableelement.rs | 8 +- .../script/dom/htmltableheadercellelement.rs | 8 +- components/script/dom/htmltablerowelement.rs | 8 +- .../script/dom/htmltablesectionelement.rs | 8 +- components/script/dom/htmltemplateelement.rs | 8 +- components/script/dom/htmltextareaelement.rs | 8 +- components/script/dom/htmltimeelement.rs | 8 +- components/script/dom/htmltitleelement.rs | 8 +- components/script/dom/htmltrackelement.rs | 8 +- components/script/dom/htmlulistelement.rs | 8 +- components/script/dom/htmlunknownelement.rs | 8 +- components/script/dom/htmlvideoelement.rs | 8 +- components/script/dom/node.rs | 2 +- components/script/html/hubbub_html_parser.rs | 257 +++++++++--------- tests/wpt/metadata/dom/nodes/case.html.ini | 74 ----- 73 files changed, 406 insertions(+), 478 deletions(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 8a7ae10dd7d6..e2c95bf56b9c 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -486,7 +486,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { return Err(InvalidCharacter); } let local_name = local_name.as_slice().to_ascii_lower(); - Ok(build_element_from_tag(local_name, ns!(HTML), self)) + Ok(build_element_from_tag(local_name, ns!(HTML), None, self)) } // http://dom.spec.whatwg.org/#dom-document-createelementns @@ -530,7 +530,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } if ns == ns!(HTML) { - Ok(build_element_from_tag(local_name_from_qname.to_string(), ns, self)) + Ok(build_element_from_tag(local_name_from_qname.to_string(), ns, + prefix_from_qname.map(|s| s.to_string()), self)) } else { Ok(Element::new(local_name_from_qname.to_string(), ns, prefix_from_qname.map(|s| s.to_string()), self)) @@ -679,7 +680,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } }, None => { - let new_title = HTMLTitleElement::new("title".to_string(), self).root(); + let new_title = HTMLTitleElement::new("title".to_string(), None, self).root(); let new_title: JSRef = NodeCast::from_ref(*new_title); if !title.is_empty() { diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs index 642de0713a6a..bd3c2aec743b 100644 --- a/components/script/dom/domimplementation.rs +++ b/components/script/dom/domimplementation.rs @@ -131,13 +131,13 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { { // Step 4. - let doc_html: Root = NodeCast::from_temporary(HTMLHtmlElement::new("html".to_string(), *doc)).root(); + let doc_html: Root = NodeCast::from_temporary(HTMLHtmlElement::new("html".to_string(), None, *doc)).root(); let doc_html = doc_html.deref(); assert!(doc_node.AppendChild(*doc_html).is_ok()); { // Step 5. - let doc_head: Root = NodeCast::from_temporary(HTMLHeadElement::new("head".to_string(), *doc)).root(); + let doc_head: Root = NodeCast::from_temporary(HTMLHeadElement::new("head".to_string(), None, *doc)).root(); let doc_head = doc_head.deref(); assert!(doc_html.AppendChild(*doc_head).is_ok()); @@ -146,7 +146,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { None => (), Some(title_str) => { // Step 6.1. - let doc_title: Root = NodeCast::from_temporary(HTMLTitleElement::new("title".to_string(), *doc)).root(); + let doc_title: Root = NodeCast::from_temporary(HTMLTitleElement::new("title".to_string(), None, *doc)).root(); let doc_title = doc_title.deref(); assert!(doc_head.AppendChild(*doc_title).is_ok()); @@ -159,7 +159,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { } // Step 7. - let doc_body: Root = HTMLBodyElement::new("body".to_string(), *doc).root(); + let doc_body: Root = HTMLBodyElement::new("body".to_string(), None, *doc).root(); let doc_body = doc_body.deref(); assert!(doc_html.AppendChild(NodeCast::from_ref(*doc_body)).is_ok()); } diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index e182e8170b34..74ab29764567 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -34,15 +34,15 @@ impl HTMLAnchorElementDerived for EventTarget { } impl HTMLAnchorElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLAnchorElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLAnchorElement { HTMLAnchorElement { - htmlelement: HTMLElement::new_inherited(HTMLAnchorElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLAnchorElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLAnchorElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLAnchorElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLAnchorElementBinding::Wrap) } } diff --git a/components/script/dom/htmlappletelement.rs b/components/script/dom/htmlappletelement.rs index ce8e8f70f8a6..b40bc50bc679 100644 --- a/components/script/dom/htmlappletelement.rs +++ b/components/script/dom/htmlappletelement.rs @@ -26,15 +26,15 @@ impl HTMLAppletElementDerived for EventTarget { } impl HTMLAppletElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLAppletElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLAppletElement { HTMLAppletElement { - htmlelement: HTMLElement::new_inherited(HTMLAppletElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLAppletElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLAppletElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLAppletElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLAppletElementBinding::Wrap) } } diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index 892850ed94c6..57c3fe883d4a 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -27,15 +27,15 @@ impl HTMLAreaElementDerived for EventTarget { } impl HTMLAreaElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLAreaElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLAreaElement { HTMLAreaElement { - htmlelement: HTMLElement::new_inherited(HTMLAreaElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLAreaElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLAreaElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLAreaElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLAreaElementBinding::Wrap) } } diff --git a/components/script/dom/htmlaudioelement.rs b/components/script/dom/htmlaudioelement.rs index b8e73266e5ba..0d419c403383 100644 --- a/components/script/dom/htmlaudioelement.rs +++ b/components/script/dom/htmlaudioelement.rs @@ -26,15 +26,15 @@ impl HTMLAudioElementDerived for EventTarget { } impl HTMLAudioElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLAudioElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLAudioElement { HTMLAudioElement { - htmlmediaelement: HTMLMediaElement::new_inherited(HTMLAudioElementTypeId, localName, document) + htmlmediaelement: HTMLMediaElement::new_inherited(HTMLAudioElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLAudioElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLAudioElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLAudioElementBinding::Wrap) } } diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs index 1ed0d2035de9..1a9d0e833bdb 100644 --- a/components/script/dom/htmlbaseelement.rs +++ b/components/script/dom/htmlbaseelement.rs @@ -26,15 +26,15 @@ impl HTMLBaseElementDerived for EventTarget { } impl HTMLBaseElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLBaseElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLBaseElement { HTMLBaseElement { - htmlelement: HTMLElement::new_inherited(HTMLBaseElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLBaseElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLBaseElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLBaseElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLBaseElementBinding::Wrap) } } diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index 764be50c83f6..9fcc47b16ec5 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -33,15 +33,15 @@ impl HTMLBodyElementDerived for EventTarget { } impl HTMLBodyElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLBodyElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLBodyElement { HTMLBodyElement { - htmlelement: HTMLElement::new_inherited(HTMLBodyElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLBodyElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLBodyElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLBodyElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLBodyElementBinding::Wrap) } } diff --git a/components/script/dom/htmlbrelement.rs b/components/script/dom/htmlbrelement.rs index ce8997cbf734..4585c433ae2e 100644 --- a/components/script/dom/htmlbrelement.rs +++ b/components/script/dom/htmlbrelement.rs @@ -26,15 +26,15 @@ impl HTMLBRElementDerived for EventTarget { } impl HTMLBRElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLBRElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLBRElement { HTMLBRElement { - htmlelement: HTMLElement::new_inherited(HTMLBRElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLBRElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLBRElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLBRElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLBRElementBinding::Wrap) } } diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 01a1e5137489..9c99f3bcc9e2 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -32,15 +32,15 @@ impl HTMLButtonElementDerived for EventTarget { } impl HTMLButtonElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLButtonElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLButtonElement { HTMLButtonElement { - htmlelement: HTMLElement::new_inherited(HTMLButtonElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLButtonElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLButtonElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLButtonElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLButtonElementBinding::Wrap) } } diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 09cd40022ef6..3f7d11531bc8 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -44,9 +44,9 @@ impl HTMLCanvasElementDerived for EventTarget { } impl HTMLCanvasElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLCanvasElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLCanvasElement { HTMLCanvasElement { - htmlelement: HTMLElement::new_inherited(HTMLCanvasElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLCanvasElementTypeId, localName, prefix, document), context: Default::default(), width: Cell::new(DefaultWidth), height: Cell::new(DefaultHeight), @@ -54,8 +54,8 @@ impl HTMLCanvasElement { } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLCanvasElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLCanvasElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLCanvasElementBinding::Wrap) } } diff --git a/components/script/dom/htmldataelement.rs b/components/script/dom/htmldataelement.rs index 180ef7bb5d23..aeafde6d06e4 100644 --- a/components/script/dom/htmldataelement.rs +++ b/components/script/dom/htmldataelement.rs @@ -26,15 +26,15 @@ impl HTMLDataElementDerived for EventTarget { } impl HTMLDataElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLDataElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLDataElement { HTMLDataElement { - htmlelement: HTMLElement::new_inherited(HTMLDataElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDataElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLDataElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLDataElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDataElementBinding::Wrap) } } diff --git a/components/script/dom/htmldatalistelement.rs b/components/script/dom/htmldatalistelement.rs index 491fe958ab93..9c57a7176ff0 100644 --- a/components/script/dom/htmldatalistelement.rs +++ b/components/script/dom/htmldatalistelement.rs @@ -29,15 +29,15 @@ impl HTMLDataListElementDerived for EventTarget { } impl HTMLDataListElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLDataListElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLDataListElement { HTMLDataListElement { - htmlelement: HTMLElement::new_inherited(HTMLDataListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDataListElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLDataListElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLDataListElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDataListElementBinding::Wrap) } } diff --git a/components/script/dom/htmldirectoryelement.rs b/components/script/dom/htmldirectoryelement.rs index fc7ea59a58b0..b55bd5397817 100644 --- a/components/script/dom/htmldirectoryelement.rs +++ b/components/script/dom/htmldirectoryelement.rs @@ -26,15 +26,15 @@ impl HTMLDirectoryElementDerived for EventTarget { } impl HTMLDirectoryElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLDirectoryElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLDirectoryElement { HTMLDirectoryElement { - htmlelement: HTMLElement::new_inherited(HTMLDirectoryElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDirectoryElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLDirectoryElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLDirectoryElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDirectoryElementBinding::Wrap) } } diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index c1d3ed3d26b7..c164beec7d06 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -26,15 +26,15 @@ impl HTMLDivElementDerived for EventTarget { } impl HTMLDivElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLDivElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLDivElement { HTMLDivElement { - htmlelement: HTMLElement::new_inherited(HTMLDivElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDivElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLDivElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLDivElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDivElementBinding::Wrap) } } diff --git a/components/script/dom/htmldlistelement.rs b/components/script/dom/htmldlistelement.rs index 72a5fa360f31..d107a277faf6 100644 --- a/components/script/dom/htmldlistelement.rs +++ b/components/script/dom/htmldlistelement.rs @@ -26,15 +26,15 @@ impl HTMLDListElementDerived for EventTarget { } impl HTMLDListElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLDListElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLDListElement { HTMLDListElement { - htmlelement: HTMLElement::new_inherited(HTMLDListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLDListElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLDListElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLDListElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDListElementBinding::Wrap) } } diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 96c3af3a8fd5..c1489fa02ade 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -37,15 +37,15 @@ impl HTMLElementDerived for EventTarget { } impl HTMLElement { - pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JSRef) -> HTMLElement { + pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, prefix: Option, document: JSRef) -> HTMLElement { HTMLElement { - element: Element::new_inherited(type_id, tag_name, ns!(HTML), None, document) + element: Element::new_inherited(type_id, tag_name, ns!(HTML), prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, prefix, document); Node::reflect_node(box element, document, HTMLElementBinding::Wrap) } } diff --git a/components/script/dom/htmlembedelement.rs b/components/script/dom/htmlembedelement.rs index e60f6a2ea80a..587a0d375f3c 100644 --- a/components/script/dom/htmlembedelement.rs +++ b/components/script/dom/htmlembedelement.rs @@ -26,15 +26,15 @@ impl HTMLEmbedElementDerived for EventTarget { } impl HTMLEmbedElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLEmbedElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLEmbedElement { HTMLEmbedElement { - htmlelement: HTMLElement::new_inherited(HTMLEmbedElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLEmbedElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLEmbedElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLEmbedElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLEmbedElementBinding::Wrap) } } diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs index 2d5188b644ec..594348946221 100644 --- a/components/script/dom/htmlfieldsetelement.rs +++ b/components/script/dom/htmlfieldsetelement.rs @@ -34,15 +34,15 @@ impl HTMLFieldSetElementDerived for EventTarget { } impl HTMLFieldSetElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLFieldSetElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLFieldSetElement { HTMLFieldSetElement { - htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLFieldSetElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLFieldSetElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLFieldSetElementBinding::Wrap) } } diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index 0e60a29d808a..0feede649a49 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -26,15 +26,15 @@ impl HTMLFontElementDerived for EventTarget { } impl HTMLFontElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLFontElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLFontElement { HTMLFontElement { - htmlelement: HTMLElement::new_inherited(HTMLFontElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFontElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLFontElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLFontElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLFontElementBinding::Wrap) } } diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 997ed47ca5c4..d0647839a47e 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -26,15 +26,15 @@ impl HTMLFormElementDerived for EventTarget { } impl HTMLFormElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLFormElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLFormElement { HTMLFormElement { - htmlelement: HTMLElement::new_inherited(HTMLFormElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFormElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLFormElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLFormElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLFormElementBinding::Wrap) } } diff --git a/components/script/dom/htmlframeelement.rs b/components/script/dom/htmlframeelement.rs index 536e518eed16..62febac5b7f2 100644 --- a/components/script/dom/htmlframeelement.rs +++ b/components/script/dom/htmlframeelement.rs @@ -26,15 +26,15 @@ impl HTMLFrameElementDerived for EventTarget { } impl HTMLFrameElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLFrameElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLFrameElement { HTMLFrameElement { - htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLFrameElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLFrameElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLFrameElementBinding::Wrap) } } diff --git a/components/script/dom/htmlframesetelement.rs b/components/script/dom/htmlframesetelement.rs index aa25543f802b..a2599a734d60 100644 --- a/components/script/dom/htmlframesetelement.rs +++ b/components/script/dom/htmlframesetelement.rs @@ -26,15 +26,15 @@ impl HTMLFrameSetElementDerived for EventTarget { } impl HTMLFrameSetElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLFrameSetElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLFrameSetElement { HTMLFrameSetElement { - htmlelement: HTMLElement::new_inherited(HTMLFrameSetElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLFrameSetElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLFrameSetElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLFrameSetElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLFrameSetElementBinding::Wrap) } } diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs index 689cf6909669..c972400c0d6d 100644 --- a/components/script/dom/htmlheadelement.rs +++ b/components/script/dom/htmlheadelement.rs @@ -26,15 +26,15 @@ impl HTMLHeadElementDerived for EventTarget { } impl HTMLHeadElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLHeadElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLHeadElement { HTMLHeadElement { - htmlelement: HTMLElement::new_inherited(HTMLHeadElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLHeadElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLHeadElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLHeadElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLHeadElementBinding::Wrap) } } diff --git a/components/script/dom/htmlheadingelement.rs b/components/script/dom/htmlheadingelement.rs index b4bf666639ea..ace784a96a96 100644 --- a/components/script/dom/htmlheadingelement.rs +++ b/components/script/dom/htmlheadingelement.rs @@ -37,16 +37,16 @@ impl HTMLHeadingElementDerived for EventTarget { } impl HTMLHeadingElement { - fn new_inherited(localName: DOMString, document: JSRef, level: HeadingLevel) -> HTMLHeadingElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef, level: HeadingLevel) -> HTMLHeadingElement { HTMLHeadingElement { - htmlelement: HTMLElement::new_inherited(HTMLHeadingElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLHeadingElementTypeId, localName, prefix, document), level: level, } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef, level: HeadingLevel) -> Temporary { - let element = HTMLHeadingElement::new_inherited(localName, document, level); + pub fn new(localName: DOMString, prefix: Option, document: JSRef, level: HeadingLevel) -> Temporary { + let element = HTMLHeadingElement::new_inherited(localName, prefix, document, level); Node::reflect_node(box element, document, HTMLHeadingElementBinding::Wrap) } } diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs index 8119a0aa96a1..8167c5854f7b 100644 --- a/components/script/dom/htmlhrelement.rs +++ b/components/script/dom/htmlhrelement.rs @@ -26,15 +26,15 @@ impl HTMLHRElementDerived for EventTarget { } impl HTMLHRElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLHRElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLHRElement { HTMLHRElement { - htmlelement: HTMLElement::new_inherited(HTMLHRElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLHRElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLHRElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLHRElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLHRElementBinding::Wrap) } } diff --git a/components/script/dom/htmlhtmlelement.rs b/components/script/dom/htmlhtmlelement.rs index 28bc364fbe3b..279eb740709f 100644 --- a/components/script/dom/htmlhtmlelement.rs +++ b/components/script/dom/htmlhtmlelement.rs @@ -26,15 +26,15 @@ impl HTMLHtmlElementDerived for EventTarget { } impl HTMLHtmlElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLHtmlElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLHtmlElement { HTMLHtmlElement { - htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLHtmlElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLHtmlElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLHtmlElementBinding::Wrap) } } diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 273e089d5105..e32b3d7437ef 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -113,17 +113,17 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> { } impl HTMLIFrameElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLIFrameElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLIFrameElement { HTMLIFrameElement { - htmlelement: HTMLElement::new_inherited(HTMLIFrameElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLIFrameElementTypeId, localName, prefix, document), size: Cell::new(None), sandbox: Cell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLIFrameElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLIFrameElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLIFrameElementBinding::Wrap) } } diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 76013985c553..633b07ce5bf0 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -71,16 +71,16 @@ impl<'a> PrivateHTMLImageElementHelpers for JSRef<'a, HTMLImageElement> { } impl HTMLImageElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLImageElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLImageElement { HTMLImageElement { - htmlelement: HTMLElement::new_inherited(HTMLImageElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLImageElementTypeId, localName, prefix, document), image: RefCell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLImageElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLImageElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLImageElementBinding::Wrap) } } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 3bb57dfdb0e5..bb8ef6dec275 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -62,9 +62,9 @@ impl HTMLInputElementDerived for EventTarget { static DEFAULT_INPUT_SIZE: u32 = 20; impl HTMLInputElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLInputElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLInputElement { HTMLInputElement { - htmlelement: HTMLElement::new_inherited(HTMLInputElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLInputElementTypeId, localName, prefix, document), input_type: Cell::new(InputText), checked: Cell::new(false), uncommitted_value: RefCell::new(None), @@ -74,8 +74,8 @@ impl HTMLInputElement { } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLInputElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLInputElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLInputElementBinding::Wrap) } } diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index 326fd8ab7a1c..7ff84e0075ae 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -26,15 +26,15 @@ impl HTMLLabelElementDerived for EventTarget { } impl HTMLLabelElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLLabelElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLLabelElement { HTMLLabelElement { - htmlelement: HTMLElement::new_inherited(HTMLLabelElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLabelElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLLabelElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLLabelElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLLabelElementBinding::Wrap) } } diff --git a/components/script/dom/htmllegendelement.rs b/components/script/dom/htmllegendelement.rs index 72a7415bfe5e..86bf81ca7ec2 100644 --- a/components/script/dom/htmllegendelement.rs +++ b/components/script/dom/htmllegendelement.rs @@ -26,15 +26,15 @@ impl HTMLLegendElementDerived for EventTarget { } impl HTMLLegendElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLLegendElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLLegendElement { HTMLLegendElement { - htmlelement: HTMLElement::new_inherited(HTMLLegendElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLegendElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLLegendElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLLegendElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLLegendElementBinding::Wrap) } } diff --git a/components/script/dom/htmllielement.rs b/components/script/dom/htmllielement.rs index 02cd33499098..948430d3eda2 100644 --- a/components/script/dom/htmllielement.rs +++ b/components/script/dom/htmllielement.rs @@ -26,15 +26,15 @@ impl HTMLLIElementDerived for EventTarget { } impl HTMLLIElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLLIElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLLIElement { HTMLLIElement { - htmlelement: HTMLElement::new_inherited(HTMLLIElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLIElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLLIElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLLIElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLLIElementBinding::Wrap) } } diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index d525fb366ebb..04e03bcc7606 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -34,15 +34,15 @@ impl HTMLLinkElementDerived for EventTarget { } impl HTMLLinkElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLLinkElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLLinkElement { HTMLLinkElement { - htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLLinkElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLLinkElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLLinkElementBinding::Wrap) } } diff --git a/components/script/dom/htmlmapelement.rs b/components/script/dom/htmlmapelement.rs index 8b2e775d6d39..585102c2af9c 100644 --- a/components/script/dom/htmlmapelement.rs +++ b/components/script/dom/htmlmapelement.rs @@ -26,15 +26,15 @@ impl HTMLMapElementDerived for EventTarget { } impl HTMLMapElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLMapElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLMapElement { HTMLMapElement { - htmlelement: HTMLElement::new_inherited(HTMLMapElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMapElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLMapElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLMapElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLMapElementBinding::Wrap) } } diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index b2f5dedce52d..ef841c31a35f 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -29,9 +29,9 @@ impl HTMLMediaElementDerived for EventTarget { } impl HTMLMediaElement { - pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JSRef) -> HTMLMediaElement { + pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, prefix: Option, document: JSRef) -> HTMLMediaElement { HTMLMediaElement { - htmlelement: HTMLElement::new_inherited(type_id, tag_name, document) + htmlelement: HTMLElement::new_inherited(type_id, tag_name, prefix, document) } } } diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index bb4a87065e6a..34873293440a 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -26,15 +26,15 @@ impl HTMLMetaElementDerived for EventTarget { } impl HTMLMetaElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLMetaElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLMetaElement { HTMLMetaElement { - htmlelement: HTMLElement::new_inherited(HTMLMetaElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMetaElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLMetaElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLMetaElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLMetaElementBinding::Wrap) } } diff --git a/components/script/dom/htmlmeterelement.rs b/components/script/dom/htmlmeterelement.rs index 7fad261f23f7..1648cde97517 100644 --- a/components/script/dom/htmlmeterelement.rs +++ b/components/script/dom/htmlmeterelement.rs @@ -26,15 +26,15 @@ impl HTMLMeterElementDerived for EventTarget { } impl HTMLMeterElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLMeterElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLMeterElement { HTMLMeterElement { - htmlelement: HTMLElement::new_inherited(HTMLMeterElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLMeterElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLMeterElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLMeterElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLMeterElementBinding::Wrap) } } diff --git a/components/script/dom/htmlmodelement.rs b/components/script/dom/htmlmodelement.rs index e7686bb03818..35ebb61e6ad5 100644 --- a/components/script/dom/htmlmodelement.rs +++ b/components/script/dom/htmlmodelement.rs @@ -26,15 +26,15 @@ impl HTMLModElementDerived for EventTarget { } impl HTMLModElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLModElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLModElement { HTMLModElement { - htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLModElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLModElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLModElementBinding::Wrap) } } diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index 268c46994563..6a3981118768 100644 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -38,15 +38,15 @@ impl HTMLObjectElementDerived for EventTarget { } impl HTMLObjectElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLObjectElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLObjectElement { HTMLObjectElement { - htmlelement: HTMLElement::new_inherited(HTMLObjectElementTypeId, localName, document), + htmlelement: HTMLElement::new_inherited(HTMLObjectElementTypeId, localName, prefix, document), } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLObjectElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLObjectElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLObjectElementBinding::Wrap) } } diff --git a/components/script/dom/htmlolistelement.rs b/components/script/dom/htmlolistelement.rs index 0fa1fac33e46..ae36ce0d628a 100644 --- a/components/script/dom/htmlolistelement.rs +++ b/components/script/dom/htmlolistelement.rs @@ -26,15 +26,15 @@ impl HTMLOListElementDerived for EventTarget { } impl HTMLOListElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLOListElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLOListElement { HTMLOListElement { - htmlelement: HTMLElement::new_inherited(HTMLOListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOListElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLOListElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLOListElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLOListElementBinding::Wrap) } } diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs index bf5782fb4e34..cf63bbbd653b 100644 --- a/components/script/dom/htmloptgroupelement.rs +++ b/components/script/dom/htmloptgroupelement.rs @@ -31,15 +31,15 @@ impl HTMLOptGroupElementDerived for EventTarget { } impl HTMLOptGroupElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLOptGroupElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLOptGroupElement { HTMLOptGroupElement { - htmlelement: HTMLElement::new_inherited(HTMLOptGroupElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOptGroupElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLOptGroupElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLOptGroupElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLOptGroupElementBinding::Wrap) } } diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs index 568d991a5ce7..ecd8b2d498b5 100644 --- a/components/script/dom/htmloptionelement.rs +++ b/components/script/dom/htmloptionelement.rs @@ -35,15 +35,15 @@ impl HTMLOptionElementDerived for EventTarget { } impl HTMLOptionElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLOptionElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLOptionElement { HTMLOptionElement { - htmlelement: HTMLElement::new_inherited(HTMLOptionElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOptionElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLOptionElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLOptionElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLOptionElementBinding::Wrap) } } diff --git a/components/script/dom/htmloutputelement.rs b/components/script/dom/htmloutputelement.rs index a316bfe821d1..1442980de262 100644 --- a/components/script/dom/htmloutputelement.rs +++ b/components/script/dom/htmloutputelement.rs @@ -28,15 +28,15 @@ impl HTMLOutputElementDerived for EventTarget { } impl HTMLOutputElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLOutputElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLOutputElement { HTMLOutputElement { - htmlelement: HTMLElement::new_inherited(HTMLOutputElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLOutputElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLOutputElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLOutputElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLOutputElementBinding::Wrap) } } diff --git a/components/script/dom/htmlparagraphelement.rs b/components/script/dom/htmlparagraphelement.rs index b8645e3c35f8..6b91ba18afce 100644 --- a/components/script/dom/htmlparagraphelement.rs +++ b/components/script/dom/htmlparagraphelement.rs @@ -26,15 +26,15 @@ impl HTMLParagraphElementDerived for EventTarget { } impl HTMLParagraphElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLParagraphElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLParagraphElement { HTMLParagraphElement { - htmlelement: HTMLElement::new_inherited(HTMLParagraphElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLParagraphElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLParagraphElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLParagraphElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLParagraphElementBinding::Wrap) } } diff --git a/components/script/dom/htmlparamelement.rs b/components/script/dom/htmlparamelement.rs index fded20de33f2..2b664425e854 100644 --- a/components/script/dom/htmlparamelement.rs +++ b/components/script/dom/htmlparamelement.rs @@ -26,15 +26,15 @@ impl HTMLParamElementDerived for EventTarget { } impl HTMLParamElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLParamElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLParamElement { HTMLParamElement { - htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLParamElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLParamElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLParamElementBinding::Wrap) } } diff --git a/components/script/dom/htmlpreelement.rs b/components/script/dom/htmlpreelement.rs index 66f914fa405d..9ec13769e785 100644 --- a/components/script/dom/htmlpreelement.rs +++ b/components/script/dom/htmlpreelement.rs @@ -26,15 +26,15 @@ impl HTMLPreElementDerived for EventTarget { } impl HTMLPreElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLPreElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLPreElement { HTMLPreElement { - htmlelement: HTMLElement::new_inherited(HTMLPreElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLPreElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLPreElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLPreElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLPreElementBinding::Wrap) } } diff --git a/components/script/dom/htmlprogresselement.rs b/components/script/dom/htmlprogresselement.rs index 038fd36530be..c9506716562e 100644 --- a/components/script/dom/htmlprogresselement.rs +++ b/components/script/dom/htmlprogresselement.rs @@ -26,15 +26,15 @@ impl HTMLProgressElementDerived for EventTarget { } impl HTMLProgressElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLProgressElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLProgressElement { HTMLProgressElement { - htmlelement: HTMLElement::new_inherited(HTMLProgressElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLProgressElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLProgressElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLProgressElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLProgressElementBinding::Wrap) } } diff --git a/components/script/dom/htmlquoteelement.rs b/components/script/dom/htmlquoteelement.rs index acc8a9d4357c..532554254c2a 100644 --- a/components/script/dom/htmlquoteelement.rs +++ b/components/script/dom/htmlquoteelement.rs @@ -26,15 +26,15 @@ impl HTMLQuoteElementDerived for EventTarget { } impl HTMLQuoteElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLQuoteElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLQuoteElement { HTMLQuoteElement { - htmlelement: HTMLElement::new_inherited(HTMLQuoteElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLQuoteElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLQuoteElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLQuoteElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLQuoteElementBinding::Wrap) } } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 73a39aab5218..3c200b9f3242 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -31,15 +31,15 @@ impl HTMLScriptElementDerived for EventTarget { } impl HTMLScriptElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLScriptElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLScriptElement { HTMLScriptElement { - htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLScriptElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLScriptElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap) } } diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index 787a7e32b098..cabff32d906b 100644 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -34,15 +34,15 @@ impl HTMLSelectElementDerived for EventTarget { } impl HTMLSelectElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLSelectElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLSelectElement { HTMLSelectElement { - htmlelement: HTMLElement::new_inherited(HTMLSelectElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLSelectElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLSelectElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLSelectElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLSelectElementBinding::Wrap) } } diff --git a/components/script/dom/htmlsourceelement.rs b/components/script/dom/htmlsourceelement.rs index 336d7af74be6..07d971c0dffc 100644 --- a/components/script/dom/htmlsourceelement.rs +++ b/components/script/dom/htmlsourceelement.rs @@ -26,15 +26,15 @@ impl HTMLSourceElementDerived for EventTarget { } impl HTMLSourceElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLSourceElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLSourceElement { HTMLSourceElement { - htmlelement: HTMLElement::new_inherited(HTMLSourceElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLSourceElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLSourceElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLSourceElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLSourceElementBinding::Wrap) } } diff --git a/components/script/dom/htmlspanelement.rs b/components/script/dom/htmlspanelement.rs index 84ce1272d7bc..a3a55d5b00a7 100644 --- a/components/script/dom/htmlspanelement.rs +++ b/components/script/dom/htmlspanelement.rs @@ -26,15 +26,15 @@ impl HTMLSpanElementDerived for EventTarget { } impl HTMLSpanElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLSpanElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLSpanElement { HTMLSpanElement { - htmlelement: HTMLElement::new_inherited(HTMLSpanElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLSpanElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLSpanElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLSpanElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLSpanElementBinding::Wrap) } } diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index a4bc3ace2649..7f8b7747d035 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -30,15 +30,15 @@ impl HTMLStyleElementDerived for EventTarget { } impl HTMLStyleElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLStyleElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLStyleElement { HTMLStyleElement { - htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLStyleElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLStyleElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLStyleElementBinding::Wrap) } } diff --git a/components/script/dom/htmltablecaptionelement.rs b/components/script/dom/htmltablecaptionelement.rs index b49944eaaf04..68a0feab854b 100644 --- a/components/script/dom/htmltablecaptionelement.rs +++ b/components/script/dom/htmltablecaptionelement.rs @@ -26,15 +26,15 @@ impl HTMLTableCaptionElementDerived for EventTarget { } impl HTMLTableCaptionElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableCaptionElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableCaptionElement { HTMLTableCaptionElement { - htmlelement: HTMLElement::new_inherited(HTMLTableCaptionElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableCaptionElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableCaptionElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableCaptionElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableCaptionElementBinding::Wrap) } } diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 9412e6c77bd2..f4fc2002fa97 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -29,9 +29,9 @@ impl HTMLTableCellElementDerived for EventTarget { } impl HTMLTableCellElement { - pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JSRef) -> HTMLTableCellElement { + pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, prefix: Option, document: JSRef) -> HTMLTableCellElement { HTMLTableCellElement { - htmlelement: HTMLElement::new_inherited(type_id, tag_name, document) + htmlelement: HTMLElement::new_inherited(type_id, tag_name, prefix, document) } } } diff --git a/components/script/dom/htmltablecolelement.rs b/components/script/dom/htmltablecolelement.rs index fdadb37acf7b..88bc8b7beb5f 100644 --- a/components/script/dom/htmltablecolelement.rs +++ b/components/script/dom/htmltablecolelement.rs @@ -26,15 +26,15 @@ impl HTMLTableColElementDerived for EventTarget { } impl HTMLTableColElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableColElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableColElement { HTMLTableColElement { - htmlelement: HTMLElement::new_inherited(HTMLTableColElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableColElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableColElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableColElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableColElementBinding::Wrap) } } diff --git a/components/script/dom/htmltabledatacellelement.rs b/components/script/dom/htmltabledatacellelement.rs index 5e110827e2dc..83569b1e08c5 100644 --- a/components/script/dom/htmltabledatacellelement.rs +++ b/components/script/dom/htmltabledatacellelement.rs @@ -26,15 +26,15 @@ impl HTMLTableDataCellElementDerived for EventTarget { } impl HTMLTableDataCellElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableDataCellElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableDataCellElement { HTMLTableDataCellElement { - htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableDataCellElementTypeId, localName, document) + htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableDataCellElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableDataCellElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableDataCellElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableDataCellElementBinding::Wrap) } } diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index 68cb80371c3c..1d9b4eff9d02 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -30,15 +30,15 @@ impl HTMLTableElementDerived for EventTarget { } impl HTMLTableElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableElement { HTMLTableElement { - htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap) } } diff --git a/components/script/dom/htmltableheadercellelement.rs b/components/script/dom/htmltableheadercellelement.rs index a88fdc302d3c..056c7b9d7896 100644 --- a/components/script/dom/htmltableheadercellelement.rs +++ b/components/script/dom/htmltableheadercellelement.rs @@ -26,15 +26,15 @@ impl HTMLTableHeaderCellElementDerived for EventTarget { } impl HTMLTableHeaderCellElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableHeaderCellElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableHeaderCellElement { HTMLTableHeaderCellElement { - htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableHeaderCellElementTypeId, localName, document) + htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableHeaderCellElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableHeaderCellElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableHeaderCellElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableHeaderCellElementBinding::Wrap) } } diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index fdb2f049e3bf..51fb63bd7e8c 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -26,15 +26,15 @@ impl HTMLTableRowElementDerived for EventTarget { } impl HTMLTableRowElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableRowElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableRowElement { HTMLTableRowElement { - htmlelement: HTMLElement::new_inherited(HTMLTableRowElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableRowElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableRowElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableRowElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableRowElementBinding::Wrap) } } diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index b730aca1f060..7b3eb02ebc1b 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -26,15 +26,15 @@ impl HTMLTableSectionElementDerived for EventTarget { } impl HTMLTableSectionElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTableSectionElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTableSectionElement { HTMLTableSectionElement { - htmlelement: HTMLElement::new_inherited(HTMLTableSectionElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTableSectionElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTableSectionElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTableSectionElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTableSectionElementBinding::Wrap) } } diff --git a/components/script/dom/htmltemplateelement.rs b/components/script/dom/htmltemplateelement.rs index fb48d6c1125e..523b8b8bae0f 100644 --- a/components/script/dom/htmltemplateelement.rs +++ b/components/script/dom/htmltemplateelement.rs @@ -26,15 +26,15 @@ impl HTMLTemplateElementDerived for EventTarget { } impl HTMLTemplateElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTemplateElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTemplateElement { HTMLTemplateElement { - htmlelement: HTMLElement::new_inherited(HTMLTemplateElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTemplateElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTemplateElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTemplateElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTemplateElementBinding::Wrap) } } diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 763c636d5b67..947f929c7949 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -31,15 +31,15 @@ impl HTMLTextAreaElementDerived for EventTarget { } impl HTMLTextAreaElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTextAreaElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTextAreaElement { HTMLTextAreaElement { - htmlelement: HTMLElement::new_inherited(HTMLTextAreaElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTextAreaElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTextAreaElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTextAreaElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTextAreaElementBinding::Wrap) } } diff --git a/components/script/dom/htmltimeelement.rs b/components/script/dom/htmltimeelement.rs index 4d0c1cbe0bfb..5d71321b88be 100644 --- a/components/script/dom/htmltimeelement.rs +++ b/components/script/dom/htmltimeelement.rs @@ -26,15 +26,15 @@ impl HTMLTimeElementDerived for EventTarget { } impl HTMLTimeElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTimeElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTimeElement { HTMLTimeElement { - htmlelement: HTMLElement::new_inherited(HTMLTimeElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTimeElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTimeElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTimeElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTimeElementBinding::Wrap) } } diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs index 7b15910d8ebf..1004d1c74739 100644 --- a/components/script/dom/htmltitleelement.rs +++ b/components/script/dom/htmltitleelement.rs @@ -29,15 +29,15 @@ impl HTMLTitleElementDerived for EventTarget { } impl HTMLTitleElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTitleElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTitleElement { HTMLTitleElement { - htmlelement: HTMLElement::new_inherited(HTMLTitleElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTitleElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTitleElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTitleElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTitleElementBinding::Wrap) } } diff --git a/components/script/dom/htmltrackelement.rs b/components/script/dom/htmltrackelement.rs index 7ddbd2190bd2..a1c5c428d741 100644 --- a/components/script/dom/htmltrackelement.rs +++ b/components/script/dom/htmltrackelement.rs @@ -26,15 +26,15 @@ impl HTMLTrackElementDerived for EventTarget { } impl HTMLTrackElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLTrackElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLTrackElement { HTMLTrackElement { - htmlelement: HTMLElement::new_inherited(HTMLTrackElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLTrackElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLTrackElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLTrackElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLTrackElementBinding::Wrap) } } diff --git a/components/script/dom/htmlulistelement.rs b/components/script/dom/htmlulistelement.rs index 143a2a38ac55..ffeb8affa11d 100644 --- a/components/script/dom/htmlulistelement.rs +++ b/components/script/dom/htmlulistelement.rs @@ -26,15 +26,15 @@ impl HTMLUListElementDerived for EventTarget { } impl HTMLUListElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLUListElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLUListElement { HTMLUListElement { - htmlelement: HTMLElement::new_inherited(HTMLUListElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLUListElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLUListElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLUListElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLUListElementBinding::Wrap) } } diff --git a/components/script/dom/htmlunknownelement.rs b/components/script/dom/htmlunknownelement.rs index a41b4cca835c..f39329c8e1f3 100644 --- a/components/script/dom/htmlunknownelement.rs +++ b/components/script/dom/htmlunknownelement.rs @@ -26,15 +26,15 @@ impl HTMLUnknownElementDerived for EventTarget { } impl HTMLUnknownElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLUnknownElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLUnknownElement { HTMLUnknownElement { - htmlelement: HTMLElement::new_inherited(HTMLUnknownElementTypeId, localName, document) + htmlelement: HTMLElement::new_inherited(HTMLUnknownElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLUnknownElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLUnknownElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLUnknownElementBinding::Wrap) } } diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs index 3ae359eff94b..ecbabaa906b5 100644 --- a/components/script/dom/htmlvideoelement.rs +++ b/components/script/dom/htmlvideoelement.rs @@ -26,15 +26,15 @@ impl HTMLVideoElementDerived for EventTarget { } impl HTMLVideoElement { - fn new_inherited(localName: DOMString, document: JSRef) -> HTMLVideoElement { + fn new_inherited(localName: DOMString, prefix: Option, document: JSRef) -> HTMLVideoElement { HTMLVideoElement { - htmlmediaelement: HTMLMediaElement::new_inherited(HTMLVideoElementTypeId, localName, document) + htmlmediaelement: HTMLMediaElement::new_inherited(HTMLVideoElementTypeId, localName, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: DOMString, document: JSRef) -> Temporary { - let element = HTMLVideoElement::new_inherited(localName, document); + pub fn new(localName: DOMString, prefix: Option, document: JSRef) -> Temporary { + let element = HTMLVideoElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLVideoElementBinding::Wrap) } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index f84e2529450b..b8319bd0da42 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1382,7 +1382,7 @@ impl Node { let element: JSRef = ElementCast::to_ref(node).unwrap(); let element = element.deref(); let element = build_element_from_tag(element.local_name.as_slice().to_string(), - element.namespace.clone(), *document); + element.namespace.clone(), Some(element.prefix.as_slice().to_string()), *document); NodeCast::from_temporary(element) }, TextNodeTypeId => { diff --git a/components/script/html/hubbub_html_parser.rs b/components/script/html/hubbub_html_parser.rs index ee34cda888c6..36d39562938c 100644 --- a/components/script/html/hubbub_html_parser.rs +++ b/components/script/html/hubbub_html_parser.rs @@ -39,11 +39,12 @@ use string_cache::{Atom, Namespace}; macro_rules! handle_element( ($document: expr, $localName: expr, + $prefix: expr, $string: expr, $ctor: ident $(, $arg:expr )*) => ( if $string == $localName.as_slice() { - return ElementCast::from_temporary($ctor::new($localName, $document $(, $arg)*)); + return ElementCast::from_temporary($ctor::new($localName, $prefix, $document $(, $arg)*)); } ) ) @@ -150,136 +151,136 @@ fn parse_last_modified(timestamp: &str) -> String { // 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(tag: DOMString, ns: Namespace, document: JSRef) -> Temporary { +pub fn build_element_from_tag(tag: DOMString, ns: Namespace, prefix: Option, document: JSRef) -> Temporary { if ns != ns!(HTML) { - return Element::new(tag, ns, None, document); + return Element::new(tag, ns, prefix, document); } // TODO (Issue #85): use atoms - handle_element!(document, tag, "a", HTMLAnchorElement); - handle_element!(document, tag, "abbr", HTMLElement); - handle_element!(document, tag, "acronym", HTMLElement); - handle_element!(document, tag, "address", HTMLElement); - handle_element!(document, tag, "applet", HTMLAppletElement); - handle_element!(document, tag, "area", HTMLAreaElement); - handle_element!(document, tag, "article", HTMLElement); - 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, "bdi", HTMLElement); - handle_element!(document, tag, "bdo", HTMLElement); - handle_element!(document, tag, "bgsound", HTMLElement); - handle_element!(document, tag, "big", HTMLElement); - handle_element!(document, tag, "blockquote",HTMLElement); - 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, "center", HTMLElement); - handle_element!(document, tag, "cite", HTMLElement); - handle_element!(document, tag, "code", HTMLElement); - 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, "dd", HTMLElement); - handle_element!(document, tag, "del", HTMLModElement); - handle_element!(document, tag, "details", HTMLElement); - handle_element!(document, tag, "dfn", HTMLElement); - handle_element!(document, tag, "dir", HTMLDirectoryElement); - handle_element!(document, tag, "div", HTMLDivElement); - handle_element!(document, tag, "dl", HTMLDListElement); - handle_element!(document, tag, "dt", HTMLElement); - handle_element!(document, tag, "em", HTMLElement); - handle_element!(document, tag, "embed", HTMLEmbedElement); - handle_element!(document, tag, "fieldset", HTMLFieldSetElement); - handle_element!(document, tag, "figcaption",HTMLElement); - handle_element!(document, tag, "figure", HTMLElement); - handle_element!(document, tag, "font", HTMLFontElement); - handle_element!(document, tag, "footer", HTMLElement); - 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, "header", HTMLElement); - handle_element!(document, tag, "hgroup", HTMLElement); - 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, "isindex", HTMLElement); - handle_element!(document, tag, "kbd", HTMLElement); - 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", HTMLElement); - handle_element!(document, tag, "map", HTMLMapElement); - handle_element!(document, tag, "mark", HTMLElement); - handle_element!(document, tag, "marquee", HTMLElement); - handle_element!(document, tag, "meta", HTMLMetaElement); - handle_element!(document, tag, "meter", HTMLMeterElement); - handle_element!(document, tag, "nav", HTMLElement); - handle_element!(document, tag, "nobr", HTMLElement); - handle_element!(document, tag, "noframes", HTMLElement); - handle_element!(document, tag, "noscript", HTMLElement); - 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, "rp", HTMLElement); - handle_element!(document, tag, "rt", HTMLElement); - handle_element!(document, tag, "ruby", HTMLElement); - handle_element!(document, tag, "s", HTMLElement); - handle_element!(document, tag, "samp", HTMLElement); - 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, "spacer", HTMLElement); - handle_element!(document, tag, "span", HTMLSpanElement); - handle_element!(document, tag, "strike", HTMLElement); - handle_element!(document, tag, "strong", HTMLElement); - handle_element!(document, tag, "style", HTMLStyleElement); - handle_element!(document, tag, "sub", HTMLElement); - handle_element!(document, tag, "summary", HTMLElement); - handle_element!(document, tag, "sup", HTMLElement); - 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, "tt", HTMLElement); - handle_element!(document, tag, "track", HTMLTrackElement); - handle_element!(document, tag, "u", HTMLElement); - handle_element!(document, tag, "ul", HTMLUListElement); - handle_element!(document, tag, "var", HTMLElement); - handle_element!(document, tag, "video", HTMLVideoElement); - handle_element!(document, tag, "wbr", HTMLElement); - - return ElementCast::from_temporary(HTMLUnknownElement::new(tag, document)); + handle_element!(document, tag, prefix, "a", HTMLAnchorElement); + handle_element!(document, tag, prefix, "abbr", HTMLElement); + handle_element!(document, tag, prefix, "acronym", HTMLElement); + handle_element!(document, tag, prefix, "address", HTMLElement); + handle_element!(document, tag, prefix, "applet", HTMLAppletElement); + handle_element!(document, tag, prefix, "area", HTMLAreaElement); + handle_element!(document, tag, prefix, "article", HTMLElement); + handle_element!(document, tag, prefix, "aside", HTMLElement); + handle_element!(document, tag, prefix, "audio", HTMLAudioElement); + handle_element!(document, tag, prefix, "b", HTMLElement); + handle_element!(document, tag, prefix, "base", HTMLBaseElement); + handle_element!(document, tag, prefix, "bdi", HTMLElement); + handle_element!(document, tag, prefix, "bdo", HTMLElement); + handle_element!(document, tag, prefix, "bgsound", HTMLElement); + handle_element!(document, tag, prefix, "big", HTMLElement); + handle_element!(document, tag, prefix, "blockquote",HTMLElement); + handle_element!(document, tag, prefix, "body", HTMLBodyElement); + handle_element!(document, tag, prefix, "br", HTMLBRElement); + handle_element!(document, tag, prefix, "button", HTMLButtonElement); + handle_element!(document, tag, prefix, "canvas", HTMLCanvasElement); + handle_element!(document, tag, prefix, "caption", HTMLTableCaptionElement); + handle_element!(document, tag, prefix, "center", HTMLElement); + handle_element!(document, tag, prefix, "cite", HTMLElement); + handle_element!(document, tag, prefix, "code", HTMLElement); + handle_element!(document, tag, prefix, "col", HTMLTableColElement); + handle_element!(document, tag, prefix, "colgroup", HTMLTableColElement); + handle_element!(document, tag, prefix, "data", HTMLDataElement); + handle_element!(document, tag, prefix, "datalist", HTMLDataListElement); + handle_element!(document, tag, prefix, "dd", HTMLElement); + handle_element!(document, tag, prefix, "del", HTMLModElement); + handle_element!(document, tag, prefix, "details", HTMLElement); + handle_element!(document, tag, prefix, "dfn", HTMLElement); + handle_element!(document, tag, prefix, "dir", HTMLDirectoryElement); + handle_element!(document, tag, prefix, "div", HTMLDivElement); + handle_element!(document, tag, prefix, "dl", HTMLDListElement); + handle_element!(document, tag, prefix, "dt", HTMLElement); + handle_element!(document, tag, prefix, "em", HTMLElement); + handle_element!(document, tag, prefix, "embed", HTMLEmbedElement); + handle_element!(document, tag, prefix, "fieldset", HTMLFieldSetElement); + handle_element!(document, tag, prefix, "figcaption",HTMLElement); + handle_element!(document, tag, prefix, "figure", HTMLElement); + handle_element!(document, tag, prefix, "font", HTMLFontElement); + handle_element!(document, tag, prefix, "footer", HTMLElement); + handle_element!(document, tag, prefix, "form", HTMLFormElement); + handle_element!(document, tag, prefix, "frame", HTMLFrameElement); + handle_element!(document, tag, prefix, "frameset", HTMLFrameSetElement); + handle_element!(document, tag, prefix, "h1", HTMLHeadingElement, Heading1); + handle_element!(document, tag, prefix, "h2", HTMLHeadingElement, Heading2); + handle_element!(document, tag, prefix, "h3", HTMLHeadingElement, Heading3); + handle_element!(document, tag, prefix, "h4", HTMLHeadingElement, Heading4); + handle_element!(document, tag, prefix, "h5", HTMLHeadingElement, Heading5); + handle_element!(document, tag, prefix, "h6", HTMLHeadingElement, Heading6); + handle_element!(document, tag, prefix, "head", HTMLHeadElement); + handle_element!(document, tag, prefix, "header", HTMLElement); + handle_element!(document, tag, prefix, "hgroup", HTMLElement); + handle_element!(document, tag, prefix, "hr", HTMLHRElement); + handle_element!(document, tag, prefix, "html", HTMLHtmlElement); + handle_element!(document, tag, prefix, "i", HTMLElement); + handle_element!(document, tag, prefix, "iframe", HTMLIFrameElement); + handle_element!(document, tag, prefix, "img", HTMLImageElement); + handle_element!(document, tag, prefix, "input", HTMLInputElement); + handle_element!(document, tag, prefix, "ins", HTMLModElement); + handle_element!(document, tag, prefix, "isindex", HTMLElement); + handle_element!(document, tag, prefix, "kbd", HTMLElement); + handle_element!(document, tag, prefix, "label", HTMLLabelElement); + handle_element!(document, tag, prefix, "legend", HTMLLegendElement); + handle_element!(document, tag, prefix, "li", HTMLLIElement); + handle_element!(document, tag, prefix, "link", HTMLLinkElement); + handle_element!(document, tag, prefix, "main", HTMLElement); + handle_element!(document, tag, prefix, "map", HTMLMapElement); + handle_element!(document, tag, prefix, "mark", HTMLElement); + handle_element!(document, tag, prefix, "marquee", HTMLElement); + handle_element!(document, tag, prefix, "meta", HTMLMetaElement); + handle_element!(document, tag, prefix, "meter", HTMLMeterElement); + handle_element!(document, tag, prefix, "nav", HTMLElement); + handle_element!(document, tag, prefix, "nobr", HTMLElement); + handle_element!(document, tag, prefix, "noframes", HTMLElement); + handle_element!(document, tag, prefix, "noscript", HTMLElement); + handle_element!(document, tag, prefix, "object", HTMLObjectElement); + handle_element!(document, tag, prefix, "ol", HTMLOListElement); + handle_element!(document, tag, prefix, "optgroup", HTMLOptGroupElement); + handle_element!(document, tag, prefix, "option", HTMLOptionElement); + handle_element!(document, tag, prefix, "output", HTMLOutputElement); + handle_element!(document, tag, prefix, "p", HTMLParagraphElement); + handle_element!(document, tag, prefix, "param", HTMLParamElement); + handle_element!(document, tag, prefix, "pre", HTMLPreElement); + handle_element!(document, tag, prefix, "progress", HTMLProgressElement); + handle_element!(document, tag, prefix, "q", HTMLQuoteElement); + handle_element!(document, tag, prefix, "rp", HTMLElement); + handle_element!(document, tag, prefix, "rt", HTMLElement); + handle_element!(document, tag, prefix, "ruby", HTMLElement); + handle_element!(document, tag, prefix, "s", HTMLElement); + handle_element!(document, tag, prefix, "samp", HTMLElement); + handle_element!(document, tag, prefix, "script", HTMLScriptElement); + handle_element!(document, tag, prefix, "section", HTMLElement); + handle_element!(document, tag, prefix, "select", HTMLSelectElement); + handle_element!(document, tag, prefix, "small", HTMLElement); + handle_element!(document, tag, prefix, "source", HTMLSourceElement); + handle_element!(document, tag, prefix, "spacer", HTMLElement); + handle_element!(document, tag, prefix, "span", HTMLSpanElement); + handle_element!(document, tag, prefix, "strike", HTMLElement); + handle_element!(document, tag, prefix, "strong", HTMLElement); + handle_element!(document, tag, prefix, "style", HTMLStyleElement); + handle_element!(document, tag, prefix, "sub", HTMLElement); + handle_element!(document, tag, prefix, "summary", HTMLElement); + handle_element!(document, tag, prefix, "sup", HTMLElement); + handle_element!(document, tag, prefix, "table", HTMLTableElement); + handle_element!(document, tag, prefix, "tbody", HTMLTableSectionElement); + handle_element!(document, tag, prefix, "td", HTMLTableDataCellElement); + handle_element!(document, tag, prefix, "template", HTMLTemplateElement); + handle_element!(document, tag, prefix, "textarea", HTMLTextAreaElement); + handle_element!(document, tag, prefix, "th", HTMLTableHeaderCellElement); + handle_element!(document, tag, prefix, "time", HTMLTimeElement); + handle_element!(document, tag, prefix, "title", HTMLTitleElement); + handle_element!(document, tag, prefix, "tr", HTMLTableRowElement); + handle_element!(document, tag, prefix, "tt", HTMLElement); + handle_element!(document, tag, prefix, "track", HTMLTrackElement); + handle_element!(document, tag, prefix, "u", HTMLElement); + handle_element!(document, tag, prefix, "ul", HTMLUListElement); + handle_element!(document, tag, prefix, "var", HTMLElement); + handle_element!(document, tag, prefix, "video", HTMLVideoElement); + handle_element!(document, tag, prefix, "wbr", HTMLElement); + + return ElementCast::from_temporary(HTMLUnknownElement::new(tag, prefix, document)); } pub fn parse_html(page: &Page, @@ -376,7 +377,7 @@ pub fn parse_html(page: &Page, SvgNs => ns!(SVG), ns => fail!("Not expecting namespace {:?}", ns), }; - let element: Root = build_element_from_tag(tag.name.clone(), namespace, *tmp).root(); + let element: Root = build_element_from_tag(tag.name.clone(), namespace, None, *tmp).root(); debug!("-- attach attrs"); for attr in tag.attributes.iter() { diff --git a/tests/wpt/metadata/dom/nodes/case.html.ini b/tests/wpt/metadata/dom/nodes/case.html.ini index 6682b11052a2..181257c9eef1 100644 --- a/tests/wpt/metadata/dom/nodes/case.html.ini +++ b/tests/wpt/metadata/dom/nodes/case.html.ini @@ -1,77 +1,3 @@ [case.html] type: testharness - [createElementNS http://www.w3.org/1999/xhtml,abc,abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,abc,Abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,abc,ABC] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,abc,\xc3\xa4] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,abc,\xc3\x84] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,Abc,abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,Abc,Abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,Abc,ABC] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,Abc,\xc3\xa4] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,Abc,\xc3\x84] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,ABC,abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,ABC,Abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,ABC,ABC] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,ABC,\xc3\xa4] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,ABC,\xc3\x84] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\xa4,abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\xa4,Abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\xa4,ABC] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\xa4,\xc3\xa4] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\xa4,\xc3\x84] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\x84,abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\x84,Abc] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\x84,ABC] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\x84,\xc3\xa4] - expected: FAIL - - [createElementNS http://www.w3.org/1999/xhtml,\xc3\x84,\xc3\x84] - expected: FAIL