mirror of
https://github.com/servo/servo.git
synced 2025-06-18 21:34:30 +00:00
Generate bindings for HTMLAudioElement, HTMLVideoElement.
This commit is contained in:
parent
a76e46416a
commit
17e888bfea
10 changed files with 174 additions and 1 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue