Runtime feature switch for speech input
Created attachment 62879 [details] Patch
Comment on attachment 62879 [details] Patch WebCore/bindings/generic/RuntimeEnabledFeatures.h:123 + static bool speechInputEnabled() { return isSpeechInputEnabled; } For DeviceOrientation, the flag was used by Page to prevent the controller being created if the feature is disabled. Is there no equivalent use for Speech?
The flag is used to not expose the 'speech' attribute in HTMLInputElement.idl . Without that attribute, the page cannot turn on speech input, hence nothing else needs to be disabled in code.
> The flag is used to not expose the 'speech' attribute in HTMLInputElement.idl . Without that attribute, > the page cannot turn on speech input, hence nothing else needs to be disabled in code. Sure, but I think Hans added the extra use of the flag for DeviceOrientation to avoid unnecessary member initialisation. Just wondering if we can do any of that here, for consistency?
For speech input, the controller (of type SpeechInput) is created in Webcore/page/Page.cpp lazily, i.e. on first use. Without the IDL attribute enabled at runtime, this call will never be made so the controller will remain null.
Comment on attachment 62879 [details] Patch r=me
(In reply to comment #4) > > The flag is used to not expose the 'speech' attribute in HTMLInputElement.idl . Without that attribute, > > the page cannot turn on speech input, hence nothing else needs to be disabled in code. > Sure, but I think Hans added the extra use of the flag for DeviceOrientation to avoid unnecessary member initialisation. Just wondering if we can do any of that here, for consistency? The reason for the extra use of the flag was to prevent the controller being instantiated if a page did window.addEventListener('deviceorientation'). As I understand, that shouldn't be an issue with speech, as the attribute to the input tag is the only entry point to this functionality.
Comment on attachment 62879 [details] Patch Clearing flags on attachment: 62879 Committed r64269: <http://trac.webkit.org/changeset/64269>
All reviewed patches have been landed. Closing bug.
http://trac.webkit.org/changeset/64269 might have broken Chromium Win Release