[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

satish at chromium.org satish at chromium.org
Wed Dec 22 14:58:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5dfd357093cb7d6ecb0df9a005180b5fd421b8c4
Author: satish at chromium.org <satish at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 26 20:40:37 2010 +0000

    2010-10-26  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Add a 'grammar' attribute for speech input.
            https://bugs.webkit.org/show_bug.cgi?id=48339
    
            To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
            speech enabled input element. This is passed without validation to the speech recognizer. Typical values
            could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
            It is up to the recognizer to interpret the value and use it as an aid in recognition.
    
            * bindings/generic/RuntimeEnabledFeatures.h:
            (WebCore::RuntimeEnabledFeatures::webkitGrammarEnabled):
            * html/HTMLAttributeNames.in:
            * html/HTMLInputElement.idl:
            * page/SpeechInput.cpp:
            (WebCore::SpeechInput::startRecognition):
            * page/SpeechInput.h:
            * page/SpeechInputClient.h:
            * platform/mock/SpeechInputClientMock.cpp:
            (WebCore::SpeechInputClientMock::startRecognition):
            * platform/mock/SpeechInputClientMock.h:
            * rendering/TextControlInnerElements.cpp:
            (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
    2010-10-26  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Add a 'grammar' attribute for speech input.
            https://bugs.webkit.org/show_bug.cgi?id=48339
    
            To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
            speech enabled input element. This is passed without validation to the speech recognizer. Typical values
            could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
            It is up to the recognizer to interpret the value and use it as an aid in recognition.
    
            * public/WebSpeechInputController.h:
            (WebKit::WebSpeechInputController::startRecognition):
            * src/SpeechInputClientImpl.cpp:
            (WebKit::SpeechInputClientImpl::startRecognition):
            * src/SpeechInputClientImpl.h:
            * src/WebSpeechInputControllerMockImpl.cpp:
            (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
            * src/WebSpeechInputControllerMockImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70567 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index da7dee5..8a8b29b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-10-26  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Add a 'grammar' attribute for speech input.
+        https://bugs.webkit.org/show_bug.cgi?id=48339
+
+        To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
+        speech enabled input element. This is passed without validation to the speech recognizer. Typical values
+        could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
+        It is up to the recognizer to interpret the value and use it as an aid in recognition.
+
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::webkitGrammarEnabled):
+        * html/HTMLAttributeNames.in:
+        * html/HTMLInputElement.idl:
+        * page/SpeechInput.cpp:
+        (WebCore::SpeechInput::startRecognition):
+        * page/SpeechInput.h:
+        * page/SpeechInputClient.h:
+        * platform/mock/SpeechInputClientMock.cpp:
+        (WebCore::SpeechInputClientMock::startRecognition):
+        * platform/mock/SpeechInputClientMock.h:
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+
 2010-10-26  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index b572b2c..4a9a420 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -139,6 +139,7 @@ public:
     static void setSpeechInputEnabled(bool isEnabled) { isSpeechInputEnabled = isEnabled; }
     static bool speechInputEnabled() { return isSpeechInputEnabled; }
     static bool webkitSpeechEnabled() { return isSpeechInputEnabled; }
+    static bool webkitGrammarEnabled() { return isSpeechInputEnabled; }
 
 #if ENABLE(XHR_RESPONSE_BLOB)
     static bool xhrResponseBlobEnabled() { return isXHRResponseBlobEnabled; }
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index d5c48c4..d9759fc 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -260,6 +260,7 @@ sortable
 sortdirection
 span
 x-webkit-speech
+x-webkit-grammar
 spellcheck
 src
 standby
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index 1ca7d6c..b873826 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -101,6 +101,7 @@ module html {
 
 #if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
         attribute [Reflect, EnabledAtRuntime] boolean webkitSpeech;
+        attribute [Reflect, EnabledAtRuntime] boolean webkitGrammar;
         attribute [DontEnum] EventListener onwebkitspeechchange;
 #endif
     };
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index b3f549e..c533a80 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -93,10 +93,10 @@ void SpeechInput::setRecognitionResult(int listenerId, const SpeechInputResultAr
         m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
 }
 
-bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect)
+bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const String& grammar)
 {
     ASSERT(m_listeners.contains(listenerId));
-    return m_client->startRecognition(listenerId, elementRect);
+    return m_client->startRecognition(listenerId, elementRect, grammar);
 }
 
 void SpeechInput::stopRecording(int listenerId)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index b521f3a..08d95de 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -61,7 +61,7 @@ public:
     void unregisterListener(int);
 
     // Methods invoked by the input elements.
-    bool startRecognition(int, const IntRect&);
+    bool startRecognition(int listenerId, const IntRect& elementRect, const String& grammar);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index d5fda17..45b309a 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -31,6 +31,8 @@
 #ifndef SpeechInputClient_h
 #define SpeechInputClient_h
 
+#include <wtf/Forward.h>
+
 #if ENABLE(INPUT_SPEECH)
 
 namespace WebCore {
@@ -48,7 +50,7 @@ public:
     virtual void setListener(SpeechInputListener*) = 0;
 
     // Starts speech recognition and audio recording.
-    virtual bool startRecognition(int requestId, const IntRect& elementRect) = 0;
+    virtual bool startRecognition(int requestId, const IntRect& elementRect, const String& grammar) = 0;
 
     // Stops audio recording and performs recognition with the audio recorded until now
     // (does not discard audio).
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index a1b4da9..0b3c8ac 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -50,7 +50,7 @@ void SpeechInputClientMock::setListener(SpeechInputListener* listener)
     m_listener = listener;
 }
 
-bool SpeechInputClientMock::startRecognition(int requestId, const IntRect&)
+bool SpeechInputClientMock::startRecognition(int requestId, const IntRect& elementRect, const String& grammar)
 {
     if (m_timer.isActive())
         return false;
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index ce83d3b..7900f36 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -50,7 +50,7 @@ public:
 
     // SpeechInputClient methods.
     void setListener(SpeechInputListener*);
-    bool startRecognition(int, const IntRect&);
+    bool startRecognition(int requestId, const IntRect& elementRect, const String& grammar);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index e193ebb..9248395 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -431,7 +431,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
     if (event->type() == eventNames().clickEvent) {
         switch (m_state) {
         case Idle:
-            if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect()))
+            if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect(), input->getAttribute(webkitgrammarAttr)))
                 setState(Recording);
             break;
         case Recording:
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index db2e39a..f53a43f 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-26  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Add a 'grammar' attribute for speech input.
+        https://bugs.webkit.org/show_bug.cgi?id=48339
+
+        To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
+        speech enabled input element. This is passed without validation to the speech recognizer. Typical values
+        could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
+        It is up to the recognizer to interpret the value and use it as an aid in recognition.
+
+        * public/WebSpeechInputController.h:
+        (WebKit::WebSpeechInputController::startRecognition):
+        * src/SpeechInputClientImpl.cpp:
+        (WebKit::SpeechInputClientImpl::startRecognition):
+        * src/SpeechInputClientImpl.h:
+        * src/WebSpeechInputControllerMockImpl.cpp:
+        (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+        * src/WebSpeechInputControllerMockImpl.h:
+
 2010-10-26  Hans Wennborg  <hans at chromium.org>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h
index 5408741..63250cd 100644
--- a/WebKit/chromium/public/WebSpeechInputController.h
+++ b/WebKit/chromium/public/WebSpeechInputController.h
@@ -36,6 +36,7 @@
 namespace WebKit {
 
 struct WebRect;
+class WebString;
 
 // Provides an embedder API called by WebKit.
 class WebSpeechInputController {
@@ -43,6 +44,13 @@ public:
     // Starts speech recognition. Speech will get recorded until the endpointer detects silence,
     // runs to the limit or stopRecording is called. Progress indications and the recognized
     // text are returned via the listener interface.
+    virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar)
+    {
+        startRecognition(requestId, elementRect);
+        return false;
+    }
+
+    // FIXME: Remove this method once chromium implements the above method.
     virtual bool startRecognition(int requestId, const WebRect&)
     {
         WEBKIT_ASSERT_NOT_REACHED();
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 88e13a7..672de63 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -56,10 +56,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener)
     m_listener = listener;
 }
 
-bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect)
+bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const WTF::String& grammar)
 {
     ASSERT(m_listener);
-    return m_controller->startRecognition(requestId, elementRect);
+    return m_controller->startRecognition(requestId, elementRect, grammar);
 }
 
 void SpeechInputClientImpl::stopRecording(int requestId)
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h
index c8c23f8..d2db453 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.h
+++ b/WebKit/chromium/src/SpeechInputClientImpl.h
@@ -54,7 +54,7 @@ public:
 
     // SpeechInputClient methods.
     void setListener(WebCore::SpeechInputListener*);
-    bool startRecognition(int, const WebCore::IntRect&);
+    bool startRecognition(int requestId, const WebCore::IntRect& elementRect, const WTF::String& grammar);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
index bd15fa4..98cc6cf 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -75,9 +75,9 @@ void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const
     m_listener->setRecognitionResult(requestId, result);
 }
 
-bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect)
+bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar)
 {
-    return m_webcoreMock->startRecognition(requestId, elementRect);
+    return m_webcoreMock->startRecognition(requestId, elementRect, grammar);
 }
 
 void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId)
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
index 5d10f89..146793a 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -57,7 +57,7 @@ public:
     void setRecognitionResult(int requestId, const WebCore::SpeechInputResultArray& result);
 
     // WebSpeechInputController methods.
-    bool startRecognition(int requestId, const WebRect& elementRect);
+    bool startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar);
     void cancelRecognition(int requestId);
     void stopRecording(int requestId);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list