Introduce HTMLTable{Data,Header}CellElement::new.

This commit is contained in:
Ms2ger 2013-10-31 15:31:15 +01:00
parent 618447445f
commit a972c470a7
4 changed files with 37 additions and 15 deletions

View file

@ -67,17 +67,6 @@ macro_rules! handle_newable_element(
}
)
)
macro_rules! handle_htmltablecellelement(
($cx: expr,
$document: expr,
$tag: expr,
$string: expr,
$type_id: expr,
$ctor: ident) => (
handle_element_base!(htmltablecellelement, HTMLTableCellElement,
$cx, $document, $tag, $string, $type_id, $ctor, []);
)
)
macro_rules! handle_element_base(
($parent: ident,
$parent_init: ident,
@ -299,11 +288,10 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement);
handle_newable_element!(document, tag, "audio", HTMLAudioElement);
handle_newable_element!(document, tag, "td", HTMLTableDataCellElement);
handle_newable_element!(document, tag, "th", HTMLTableHeaderCellElement);
handle_newable_element!(document, tag, "video", HTMLVideoElement);
handle_htmltablecellelement!(cx, document, tag, "td", HTMLTableDataCellElementTypeId, HTMLTableDataCellElement);
handle_htmltablecellelement!(cx, document, tag, "th", HTMLTableHeaderCellElementTypeId, HTMLTableHeaderCellElement);
return HTMLUnknownElement::new(tag.to_str(), document);
}