aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/html/hubbub_html_parser.rs
diff options
context:
space:
mode:
authorTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2013-10-15 22:37:06 +0900
committerTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2013-10-15 22:37:06 +0900
commit0de35fdc2f7325c5c43bdb2e47259a85fbbfce28 (patch)
tree520f97317b7557238adbef5fca51fb48a907d937 /src/components/script/html/hubbub_html_parser.rs
parent74d84ba09925109de97987ff6dc85ae5ba2235d5 (diff)
downloadservo-0de35fdc2f7325c5c43bdb2e47259a85fbbfce28.tar.gz
servo-0de35fdc2f7325c5c43bdb2e47259a85fbbfce28.zip
Implement HTMLTableDataCellElement & HTMLTableHeaderCellElement.
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r--src/components/script/html/hubbub_html_parser.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index 66953315fea..234517929d1 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -69,6 +69,18 @@ macro_rules! handle_htmlmediaelement(
}
)
)
+macro_rules! handle_htmltablecellelement(
+ ($cx: expr, $tag:expr, $string:expr, $type_id:expr, $ctor:ident) => (
+ if eq_slice($tag, $string) {
+ let _element = @$ctor {
+ htmlelement: HTMLTableCellElement::new($type_id, ($tag).to_str(), document)
+ };
+ unsafe {
+ return Node::as_abstract_node(cx, _element);
+ }
+ }
+ )
+)
pub struct JSFile {
@@ -260,8 +272,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
handle_element!(cx, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
handle_element!(cx, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []);
- handle_element!(cx, tag, "th", HTMLTableCellElementTypeId, HTMLTableCellElement, []);
- handle_element!(cx, tag, "td", HTMLTableCellElementTypeId, HTMLTableCellElement, []);
handle_element!(cx, tag, "col", HTMLTableColElementTypeId, HTMLTableColElement, []);
handle_element!(cx, tag, "colgroup",HTMLTableColElementTypeId, HTMLTableColElement, []);
handle_element!(cx, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
@@ -293,6 +303,9 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_htmlmediaelement!(cx, tag, "audio", HTMLAudioElementTypeId, HTMLAudioElement);
handle_htmlmediaelement!(cx, tag, "video", HTMLVideoElementTypeId, HTMLVideoElement);
+ handle_htmltablecellelement!(cx, tag, "td", HTMLTableDataCellElementTypeId, HTMLTableDataCellElement);
+ handle_htmltablecellelement!(cx, tag, "th", HTMLTableHeaderCellElementTypeId, HTMLTableHeaderCellElement);
+
let element = @HTMLUnknownElement {
htmlelement: HTMLElement::new(HTMLUnknownElementTypeId, tag.to_str(), document)
};