mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Generate bindings for HTMLTrackElement.
This commit is contained in:
parent
9919bae897
commit
d3108a898d
8 changed files with 94 additions and 0 deletions
|
@ -613,6 +613,7 @@ addHTMLElement('HTMLTemplateElement')
|
|||
addHTMLElement('HTMLTextAreaElement')
|
||||
addHTMLElement('HTMLTimeElement')
|
||||
addHTMLElement('HTMLTitleElement')
|
||||
addHTMLElement('HTMLTrackElement')
|
||||
addHTMLElement('HTMLUListElement')
|
||||
addHTMLElement('HTMLUnknownElement')
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#the-track-element
|
||||
*/
|
||||
|
||||
// import from http://mxr.mozilla.org/mozilla-central/source/dom/webidl/
|
||||
|
||||
/*
|
||||
[Pref="media.webvtt.enabled"]
|
||||
*/
|
||||
interface HTMLTrackElement : HTMLElement {
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString kind;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString src;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString srclang;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString label;
|
||||
[SetterThrows, Pure]
|
||||
attribute boolean default;
|
||||
|
||||
const unsigned short NONE = 0;
|
||||
const unsigned short LOADING = 1;
|
||||
const unsigned short LOADED = 2;
|
||||
const unsigned short ERROR = 3;
|
||||
readonly attribute unsigned short readyState;
|
||||
/*
|
||||
TODO:
|
||||
readonly attribute TextTrack track;
|
||||
*/
|
||||
};
|
|
@ -158,6 +158,8 @@ generate_cacheable_wrapper!(HTMLTitleElement, HTMLTitleElementBinding::Wrap)
|
|||
generate_binding_object!(HTMLTitleElement)
|
||||
generate_cacheable_wrapper!(HTMLTimeElement, HTMLTimeElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTimeElement)
|
||||
generate_cacheable_wrapper!(HTMLTrackElement, HTMLTrackElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLTrackElement)
|
||||
generate_cacheable_wrapper!(HTMLUListElement, HTMLUListElementBinding::Wrap)
|
||||
generate_binding_object!(HTMLUListElement)
|
||||
generate_cacheable_wrapper!(HTMLUnknownElement, HTMLUnknownElementBinding::Wrap)
|
||||
|
|
|
@ -82,6 +82,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
|
|||
ElementNodeTypeId(HTMLTextAreaElementTypeId) => generate_element!(HTMLTextAreaElement),
|
||||
ElementNodeTypeId(HTMLTimeElementTypeId) => generate_element!(HTMLTimeElement),
|
||||
ElementNodeTypeId(HTMLTitleElementTypeId) => generate_element!(HTMLTitleElement),
|
||||
ElementNodeTypeId(HTMLTrackElementTypeId) => generate_element!(HTMLTrackElement),
|
||||
ElementNodeTypeId(HTMLUListElementTypeId) => generate_element!(HTMLUListElement),
|
||||
ElementNodeTypeId(HTMLUnknownElementTypeId) => generate_element!(HTMLUnknownElement),
|
||||
CommentNodeTypeId => generate_element!(Comment),
|
||||
|
|
|
@ -106,6 +106,7 @@ pub enum ElementTypeId {
|
|||
HTMLTextAreaElementTypeId,
|
||||
HTMLTimeElementTypeId,
|
||||
HTMLTitleElementTypeId,
|
||||
HTMLTrackElementTypeId,
|
||||
HTMLUListElementTypeId,
|
||||
HTMLUnknownElementTypeId,
|
||||
}
|
||||
|
|
51
src/components/script/dom/htmltrackelement.rs
Normal file
51
src/components/script/dom/htmltrackelement.rs
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
use dom::bindings::utils::{DOMString, null_string, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTrackElement {
|
||||
parent: HTMLElement,
|
||||
}
|
||||
|
||||
impl HTMLTrackElement {
|
||||
pub fn Kind(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetKind(&mut self, _kind: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Srclang(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetSrclang(&mut self, _srclang: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
null_string
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn Default(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDefault(&mut self, _default: bool, _rv: &mut ErrorResult) {
|
||||
}
|
||||
|
||||
pub fn ReadyState(&self) -> u16 {
|
||||
0
|
||||
}
|
||||
}
|
|
@ -242,6 +242,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
|
|||
handle_element!(cx, tag, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
|
||||
handle_element!(cx, tag, "title", HTMLTitleElementTypeId, HTMLTitleElement, []);
|
||||
handle_element!(cx, tag, "tr", HTMLTableRowElementTypeId, HTMLTableRowElement, []);
|
||||
handle_element!(cx, tag, "track", HTMLTrackElementTypeId, HTMLTrackElement, []);
|
||||
handle_element!(cx, tag, "ul", HTMLUListElementTypeId, HTMLUListElement, []);
|
||||
|
||||
handle_element!(cx, tag, "img", HTMLImageElementTypeId, HTMLImageElement, [(image: None)]);
|
||||
|
|
|
@ -117,6 +117,7 @@ pub mod dom {
|
|||
pub mod htmltextareaelement;
|
||||
pub mod htmltimeelement;
|
||||
pub mod htmltitleelement;
|
||||
pub mod htmltrackelement;
|
||||
pub mod htmlulistelement;
|
||||
pub mod htmlunknownelement;
|
||||
pub mod mouseevent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue