aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/html/hubbub_html_parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r--src/components/script/html/hubbub_html_parser.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index bfc205aa689..70948f3923f 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -58,6 +58,19 @@ macro_rules! handle_htmlelement(
}
)
)
+macro_rules! handle_htmlmediaelement(
+ ($cx: expr, $tag:expr, $string:expr, $type_id:expr, $ctor:ident) => (
+ if eq_slice($tag, $string) {
+ let _element = @$ctor {
+ parent: HTMLMediaElement::new($type_id, ($tag).to_str())
+ };
+ unsafe {
+ return Node::as_abstract_node(cx, _element);
+ }
+ }
+ )
+)
+
type JSResult = ~[~[u8]];
@@ -262,6 +275,9 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_htmlelement!(cx, tag, "section", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, tag, "small", HTMLElementTypeId, HTMLElement);
+ handle_htmlmediaelement!(cx, tag, "audio", HTMLAudioElementTypeId, HTMLAudioElement);
+ handle_htmlmediaelement!(cx, tag, "video", HTMLVideoElementTypeId, HTMLVideoElement);
+
unsafe {
let element = @HTMLUnknownElement {
parent: HTMLElement::new(HTMLUnknownElementTypeId, tag.to_str())