webkitSpeechGrammarList.addFromUri should be addFromURI
Reported by
glroyla...@gmail.com,
Aug 14 2017
|
||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Steps to reproduce the problem:
1. gramlist = new webkitSpeechGrammarList()
2. gramlist.addFromURI("localgrammar.grxml") not defined
3. gramlist.addFromUri("localgrammar.grxml") is defined
What is the expected behavior?
The W3C Web Speech API defines addFromURI (not addFromUri) method.
See https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#dfn-addGrammar
See also: https://developer.mozilla.org/en-US/docs/Web/API/SpeechGrammarList/addFromURI
What went wrong?
Developer used the wrong capitalization.
Note: this issue is independent of the functionality of the method.
Did this work before? No
Chrome version: 60.0.3112.90 Channel: n/a
OS Version: 10.0
Flash Version:
Although speech recognition is currently prefixed, the intention is to use specification given by W3C, so all the method names should match.
,
Aug 14 2017
,
Aug 16 2017
Tested the issue on windows 10 using chrome M60 #60.0.3112.101 and M62 #62.0.3187.0 and pasted the given code in console and observed as attached in screenshot. Attched screenshot for reference. @glroylance-- Could you please check attached screenshot and confirm if this is the issue you are talking about or please help us with the expected and actual result screenshots for better understanding. Thanks!
,
Aug 16 2017
,
Aug 16 2017
Yes, that is what I'm talking about. Your screenshot shows the error.
It shows that .addFromURI is undefined; this method is in the spec and should be defined.
It shows that .addFromUri is defined; this method is not in the spec.
You might be faked out because the .addFromUri method returns void. (undefined). That's what it should return.
To see the desired result, you need to look at the gramlist SpeechGrammarList object and see if it was augmented:
gramlist.length > 0 // shows a grammar was added
gramlist[0].src // should show an added URI
Using Chrome on Windows 10:
In an HTML file, I put the following in a script element:
var gramList = new webkitSpeechGrammarList();
console.log("SpeechGrammarList check");
try {
gramList.addFromURI("foo.grxml");
}
catch (e) {
console.log(".addFromURI() failed");
console.log(e);
}
try {
gramList.addFromUri("foo.grxml");
}
catch (e) {
console.log(".addFromUri() failed");
console.log(e);
}
console.log("look at speechGrammarList");
console.log(gramList);
My console log shows:
JScriptTrials.html:3434 SpeechGrammarList check
JScriptTrials.html:3440 .addFromURI() failed
JScriptTrials.html:3441 TypeError: gramList.addFromURI is not a function
at JScriptTrials.html:3437
JScriptTrials.html:3452 look at speechGrammarList
JScriptTrials.html:3453 SpeechGrammarList {0: SpeechGrammar, length: 1}length: 10: SpeechGrammarsrc: "file:///C:/Users/glroy/OneDrive/Documents/foo.grxml"weight: 1__proto__: SpeechGrammarsrc: (...)weight: (...)constructor: ƒ SpeechGrammar()Symbol(Symbol.toStringTag): "SpeechGrammar"get src: ƒ ()set src: ƒ ()get weight: ƒ ()set weight: ƒ ()__proto__: Object__proto__: SpeechGrammarList
,
Aug 16 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 6 2017
Tested this issue on Windows 7, ubuntu 14.04 and Mac 10.12.6 using chrome stable 60.0.3112.113 by following steps mentioned in the comment#5. Navigated to console and entered the provided script and observed no error log. @Reporter: Attaching screenshot for reference, could you please take a look and let me know, is this the expected behavior? If no, please provide the actual behavior. Thanks!
,
Sep 6 2017
There's no error log because the errors have been caught with try. I guess we have to take this in baby steps. If you look at the 755287.png, you will see the line VM423:10 TypeError gramList.addFromURI is not a function That is the current behavior of Chrome, but it is not the correct behavior. gramList.addFromURI should be a function. Well, "addFromURI" should be a function because the WebSpeech API says that there's supposed to be a function by that name. Go to the specification to see that the method/function "addFromURI" is described: https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#dfn-addGrammar Mozilla also talks about the function "addFromURI". https://developer.mozilla.org/en-US/docs/Web/API/SpeechGrammarList/addFromURI The method/function is not "addFromUri". The problem is Blink>Speech has MISSPELLED the function as "addFromUri". I'll say it again, differently. Blink>Speech has the grammar-from-URI function, but misspelled the method/function "addFromURI" as "addFromUri" [sic]. And a third try: Look at the two function names. Pay close attention. There will be a test later: * addFromUri - How Blink>Speech misspells the function. * addFromURI - The function that is defined in the W3C Standard. * addFromURI - The function that Mozilla describes. * ........XX - the mismatched characters
,
Sep 6 2017
Thank you for providing more feedback. Adding requester "divya.padigela@techmahindra.com" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 10 2017
Able to reproduce this issue on reported version 61.0.3163.100 , latest canary 63.0.3236.0 using Mac 10.12.6,Ubuntu 14.04 and Windows 10 with steps mentioned in Comment#0. Same behaviour is seen from M50[50.0.2166.0]. Hence considering this as Non-regression and marking as Untriaged.
,
Jun 21 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8a119eb758aafac618b5251dec408526a5f0da47 commit 8a119eb758aafac618b5251dec408526a5f0da47 Author: Philip Jägenstedt <foolip@chromium.org> Date: Thu Jun 21 12:07:53 2018 Add use counters for some of Web Speech API SpeechGrammarList's addFromURI because it doesn't match the spec: https://github.com/w3c/speech-api/issues/26 SpeechRecognitionEvent's interpretation and emma attributes because they actually always return null and might be better to remove: https://chromium.googlesource.com/chromium/src/+/7ad6ea7c2583942e86017bdd6fd5df991f6a05af/third_party/blink/renderer/modules/speech/speech_recognition_event.h#55 SpeechSynthesis#speak() to measure real SpeechSynthesis usage, like the existing counter for SpeechRecognition#start(). Bug: 755287 Change-Id: I4f7fdcc5630887aaa051ac8ab13f72dab52c8dfb Reviewed-on: https://chromium-review.googlesource.com/1109510 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Philip Jägenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#569222} [modify] https://crrev.com/8a119eb758aafac618b5251dec408526a5f0da47/third_party/blink/public/platform/web_feature.mojom [modify] https://crrev.com/8a119eb758aafac618b5251dec408526a5f0da47/third_party/blink/renderer/modules/speech/speech_grammar_list.idl [modify] https://crrev.com/8a119eb758aafac618b5251dec408526a5f0da47/third_party/blink/renderer/modules/speech/speech_recognition_event.idl [modify] https://crrev.com/8a119eb758aafac618b5251dec408526a5f0da47/third_party/blink/renderer/modules/speech/speech_synthesis.idl [modify] https://crrev.com/8a119eb758aafac618b5251dec408526a5f0da47/tools/metrics/histograms/enums.xml |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by glroyla...@gmail.com
, Aug 14 2017