Bug 43146 - Runtime feature switch for speech input
Summary: Runtime feature switch for speech input
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 39485
  Show dependency treegraph
 
Reported: 2010-07-28 14:18 PDT by Satish Sampath
Modified: 2010-07-29 05:40 PDT (History)
7 users (show)

See Also:


Attachments
Patch (6.18 KB, patch)
2010-07-28 14:45 PDT, Satish Sampath
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Satish Sampath 2010-07-28 14:18:11 PDT
Runtime feature switch for speech input
Comment 1 Satish Sampath 2010-07-28 14:45:57 PDT
Created attachment 62879 [details]
Patch
Comment 2 Steve Block 2010-07-29 03:06:55 PDT
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?
Comment 3 Satish Sampath 2010-07-29 03:08:15 PDT
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.
Comment 4 Steve Block 2010-07-29 03:19:52 PDT
> 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?
Comment 5 Satish Sampath 2010-07-29 03:22:13 PDT
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 6 Steve Block 2010-07-29 03:24:30 PDT
Comment on attachment 62879 [details]
Patch

r=me
Comment 7 Hans Wennborg 2010-07-29 03:32:12 PDT
(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 8 WebKit Commit Bot 2010-07-29 04:28:05 PDT
Comment on attachment 62879 [details]
Patch

Clearing flags on attachment: 62879

Committed r64269: <http://trac.webkit.org/changeset/64269>
Comment 9 WebKit Commit Bot 2010-07-29 04:28:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 WebKit Review Bot 2010-07-29 05:40:01 PDT
http://trac.webkit.org/changeset/64269 might have broken Chromium Win Release