From ca2685e063f41e2ccaaee8459344fb52cf1cc5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Mon, 6 Aug 2018 12:44:28 +0200 Subject: [PATCH] Add SpeechSynthesisEvent charLength attribute Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=30004. --- index.bs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.bs b/index.bs index 3356e57..2c763c6 100644 --- a/index.bs +++ b/index.bs @@ -583,6 +583,7 @@ interface SpeechSynthesisUtterance : EventTarget { interface SpeechSynthesisEvent : Event { readonly attribute SpeechSynthesisUtterance utterance; readonly attribute unsigned long charIndex; + readonly attribute unsigned long charLength; readonly attribute float elapsedTime; readonly attribute DOMString name; }; @@ -766,6 +767,11 @@ These events bubble up to SpeechSynthesis. No guarantee is given as to where charIndex will be with respect to word boundaries (such as at the end of the previous word or the beginning of the next word), only that all text before charIndex has already been spoken, and all text after charIndex has not yet been spoken. The user agent must return this value if the speech synthesis engine supports it, otherwise the user agent must return undefined. +
charLength attribute
+
This attribute indicates the length of the text (word or sentence) that will be spoken corresponding to this event. + This attribute is the length, in characters, starting from this event's {{charIndex}}. + The user agent must return this value if the speech synthesis engine supports it or the user agent can otherwise determine it, otherwise the user agent must return undefined.
+
elapsedTime attribute
This attribute indicates the time, in seconds, that this event triggered, relative to when this utterance has begun to be spoken. The user agent must return this value if the speech synthesis engine supports it or the user agent can otherwise determine it, otherwise the user agent must return undefined.