Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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.</dd>

<dt><dfn attribute for=SpeechSynthesisEvent>charLength</dfn> attribute</dt>
<dd>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.</dd>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not possible to "return undefined" since the type is unsigned long. This needs to be fixed here, above and below before merging this PR.

Copy link
Contributor

@sjdallst sjdallst Dec 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined seems to make sense. Any object that does not have the attribute that a user asks for will return undefined by default.


<dt><dfn attribute for=SpeechSynthesisEvent>elapsedTime</dfn> attribute</dt>
<dd>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.</dd>
Expand Down