mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Introduce HTMLModElement::new and use it for del/ins, not the non-existent mod.
This commit is contained in:
parent
b20461f253
commit
5cfa70c769
2 changed files with 19 additions and 1 deletions
|
@ -2,13 +2,30 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
use dom::bindings::codegen::HTMLModElementBinding;
|
||||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||||
|
use dom::document::AbstractDocument;
|
||||||
|
use dom::element::HTMLModElementTypeId;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
|
use dom::node::{AbstractNode, Node, ScriptView};
|
||||||
|
|
||||||
pub struct HTMLModElement {
|
pub struct HTMLModElement {
|
||||||
htmlelement: HTMLElement
|
htmlelement: HTMLElement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl HTMLModElement {
|
||||||
|
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLModElement {
|
||||||
|
HTMLModElement {
|
||||||
|
htmlelement: HTMLElement::new(HTMLModElementTypeId, localName, document)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
|
||||||
|
let element = HTMLModElement::new_inherited(localName, document);
|
||||||
|
Node::reflect_node(@mut element, document, HTMLModElementBinding::Wrap)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl HTMLModElement {
|
impl HTMLModElement {
|
||||||
pub fn Cite(&self) -> DOMString {
|
pub fn Cite(&self) -> DOMString {
|
||||||
None
|
None
|
||||||
|
|
|
@ -240,7 +240,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
|
||||||
handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []);
|
handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []);
|
||||||
handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []);
|
handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []);
|
||||||
handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []);
|
handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []);
|
||||||
handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []);
|
|
||||||
|
|
||||||
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
|
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
|
||||||
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
|
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
|
||||||
|
@ -252,6 +251,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
|
||||||
handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement);
|
handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement);
|
||||||
handle_newable_element!(document, tag, "col", HTMLTableColElement);
|
handle_newable_element!(document, tag, "col", HTMLTableColElement);
|
||||||
handle_newable_element!(document, tag, "colgroup", HTMLTableColElement);
|
handle_newable_element!(document, tag, "colgroup", HTMLTableColElement);
|
||||||
|
handle_newable_element!(document, tag, "del", HTMLModElement);
|
||||||
handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1);
|
handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1);
|
||||||
handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2);
|
handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2);
|
||||||
handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3);
|
handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3);
|
||||||
|
@ -260,6 +260,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
|
||||||
handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
|
handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
|
||||||
handle_newable_element!(document, tag, "iframe", HTMLIFrameElement);
|
handle_newable_element!(document, tag, "iframe", HTMLIFrameElement);
|
||||||
handle_newable_element!(document, tag, "img", HTMLImageElement);
|
handle_newable_element!(document, tag, "img", HTMLImageElement);
|
||||||
|
handle_newable_element!(document, tag, "ins", HTMLModElement);
|
||||||
handle_newable_element!(document, tag, "object", HTMLObjectElement);
|
handle_newable_element!(document, tag, "object", HTMLObjectElement);
|
||||||
handle_newable_element!(document, tag, "ol", HTMLOListElement);
|
handle_newable_element!(document, tag, "ol", HTMLOListElement);
|
||||||
handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement);
|
handle_newable_element!(document, tag, "optgroup", HTMLOptGroupElement);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue