Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some WebAudio WPTs #21506

Merged
merged 3 commits into from Sep 25, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Throw if time given to AudioScheduledSourceNode.stop is negative

  • Loading branch information
ferjm committed Sep 25, 2018
commit bc6586a9d0489bcbc1d151320eefb8cb33e8853d
@@ -200,10 +200,6 @@ impl AudioBufferSourceNodeMethods for AudioBufferSourceNode {
offset: Option<Finite<f64>>,
duration: Option<Finite<f64>>,
) -> Fallible<()> {
if *when < 0. {
return Err(Error::Range("'when' must be a positive value".to_owned()));
}

if let Some(offset) = offset {
if *offset < 0. {
return Err(Error::Range("'offset' must be a positive value".to_owned()));
@@ -59,6 +59,10 @@ impl AudioScheduledSourceNodeMethods for AudioScheduledSourceNode {

// https://webaudio.github.io/web-audio-api/#dom-audioscheduledsourcenode-start
fn Start(&self, when: Finite<f64>) -> Fallible<()> {
if *when < 0. {
return Err(Error::Range("'when' must be a positive value".to_owned()));
}

if self.started.get() || self.stopped.get() {
return Err(Error::InvalidState);
}
@@ -99,6 +103,10 @@ impl AudioScheduledSourceNodeMethods for AudioScheduledSourceNode {

// https://webaudio.github.io/web-audio-api/#dom-audioscheduledsourcenode-stop
fn Stop(&self, when: Finite<f64>) -> Fallible<()> {
if *when < 0. {
return Err(Error::Range("'when' must be a positive value".to_owned()));
}

if !self.started.get() {
return Err(Error::InvalidState);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.