Commit 76fa3b9b authored by Charlie Harrison's avatar Charlie Harrison Committed by Commit Bot

Deprecate speechSynthesis.speak() without user activation

See intent to deprecate:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/XpkevOngqUs

The deprecation will target M71.

Bug: 812767
Change-Id: Id4448a91047def16194a47efdacc152070dace82
Reviewed-on: https://chromium-review.googlesource.com/1157231Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580550}
parent 1a696109
......@@ -579,6 +579,10 @@ DeprecationInfo GetDeprecationInfo(WebFeature feature) {
"https://www.chromestatus.com/feature/"
"6708326821789696 for more details.",
MilestoneString(kM70))};
case WebFeature::kTextToSpeech_SpeakDisallowedByAutoplay:
return {"TextToSpeech_DisallowedByAutoplay", kM71,
WillBeRemoved("speechSynthesis.speak() without user activation",
kM71, "5687444770914304")};
// Features that aren't deprecated don't have a deprecation message.
default:
......
......@@ -27,6 +27,7 @@
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/deprecation.h"
#include "third_party/blink/renderer/core/frame/use_counter.h"
#include "third_party/blink/renderer/core/html/media/autoplay_policy.h"
#include "third_party/blink/renderer/core/timing/dom_window_performance.h"
......@@ -119,8 +120,8 @@ void SpeechSynthesis::speak(SpeechSynthesisUtterance* utterance) {
UseCounter::CountCrossOriginIframe(
*document, WebFeature::kTextToSpeech_SpeakCrossOrigin);
if (!IsAllowedToStartByAutoplay()) {
UseCounter::Count(document,
WebFeature::kTextToSpeech_SpeakDisallowedByAutoplay);
Deprecation::CountDeprecation(
document, WebFeature::kTextToSpeech_SpeakDisallowedByAutoplay);
}
utterance_queue_.push_back(utterance);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment