From d3de576017249443024058510f06d3bba11d0845 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Tue, 21 Jul 2026 10:21:30 +0200 Subject: [PATCH] Align the style of rejecting promises vs. exception w/ other specs. This is just an editorial change, and fixes #196. --- index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 15694a5..5d3b1a2 100644 --- a/index.bs +++ b/index.bs @@ -406,7 +406,7 @@ See [=default allowlist/'self'=]. When invoked, run these steps: - 1. If the [=current settings object=]'s [=relevant global object=]'s [=associated Document=] is NOT [=fully active=], throw an {{InvalidStateError}} and abort these steps. - 1. If any lang in {{SpeechRecognitionOptions/langs}} of options is not a valid [[!BCP47]] language tag, throw a {{SyntaxError}} and abort these steps. - 1. If the on-device speech recognition language pack for any lang in {{SpeechRecognitionOptions/langs}} of options is unsupported, return a resolved {{Promise}} with false and skip the rest of these steps. 1. Let promise be a new promise. + 1. If the [=current settings object=]'s [=relevant global object=]'s [=associated Document=] is NOT [=fully active=], reject promise with an {{InvalidStateError}}, abort these steps, returning promise. + 1. If any lang in {{SpeechRecognitionOptions/langs}} of options is not a valid [[!BCP47]] language tag, reject promise with a {{SyntaxError}}, abort these steps, returning promise. + 1. If the on-device speech recognition language pack for any lang in {{SpeechRecognitionOptions/langs}} of options is unsupported, resolve promise with false, abort these steps, returning promise. 1. For each lang in {{SpeechRecognitionOptions/langs}} of options, initiate the download of the on-device speech recognition language pack for lang matching the requested {{SpeechRecognitionOptions/quality}} level floor.

Note: The user agent can prompt the user for explicit permission to download the on-device speech recognition language pack. @@ -474,9 +474,9 @@ See