Stub out readyState and networkState attributes for HTMLMediaElement.

This commit is contained in:
Josh Matthews 2015-11-06 16:28:31 -06:00
parent 3d38a60cee
commit b8b4be34c0
3 changed files with 29 additions and 138 deletions

View file

@ -2,14 +2,19 @@
* 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::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementMethods;
use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementConstants;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use std::cell::Cell;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLMediaElement {
htmlelement: HTMLElement,
network_state: Cell<u16>,
ready_state: Cell<u16>,
}
impl HTMLMediaElement {
@ -18,7 +23,9 @@ impl HTMLMediaElement {
-> HTMLMediaElement {
HTMLMediaElement {
htmlelement:
HTMLElement::new_inherited(tag_name, prefix, document)
HTMLElement::new_inherited(tag_name, prefix, document),
network_state: Cell::new(HTMLMediaElementConstants::NETWORK_EMPTY),
ready_state: Cell::new(HTMLMediaElementConstants::HAVE_NOTHING),
}
}
@ -27,3 +34,13 @@ impl HTMLMediaElement {
&self.htmlelement
}
}
impl HTMLMediaElementMethods for HTMLMediaElement {
fn NetworkState(&self) -> u16 {
self.network_state.get()
}
fn ReadyState(&self) -> u16 {
self.ready_state.get()
}
}