[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:11:47 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 32f610fef9f4bfb55949f80b5a3de08875775f72
Author: satish at chromium.org <satish at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 5 10:44:41 2010 +0000
2010-10-05 Satish Sampath <satish at chromium.org>
Reviewed by Kent Tamura.
Added event onwebkitspeechchange to invoke on new speech input results.
https://bugs.webkit.org/show_bug.cgi?id=47127
Updated to use onwebkitspeechchange instead of onchange.
* fast/speech/input-text-speechbutton.html:
* fast/speech/speech-button-ignore-generated-events.html:
2010-10-05 Satish Sampath <satish at chromium.org>
Reviewed by Kent Tamura.
Added event onwebkitspeechchange to invoke on new speech input results.
https://bugs.webkit.org/show_bug.cgi?id=47127
* dom/EventNames.h: Added webkitspeechchange event name.
* html/HTMLAttributeNames.in: Added onwebkitspeechchange attribute name.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseMappedAttribute): Handle new attribute set.
(WebCore::HTMLInputElement::dispatchWebkitSpeechChangeEvent): Invoke the event handler.
* html/HTMLInputElement.h:
* html/HTMLInputElement.idl: Added attribute to IDL.
* rendering/TextControlInnerElements.cpp:
(WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Invoke new event handler instead of onChange
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 56af857..80cc368 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,17 @@
2010-10-05 Satish Sampath <satish at chromium.org>
+ Reviewed by Kent Tamura.
+
+ Added event onwebkitspeechchange to invoke on new speech input results.
+ https://bugs.webkit.org/show_bug.cgi?id=47127
+
+ Updated to use onwebkitspeechchange instead of onchange.
+
+ * fast/speech/input-text-speechbutton.html:
+ * fast/speech/speech-button-ignore-generated-events.html:
+
+2010-10-05 Satish Sampath <satish at chromium.org>
+
Reviewed by Jeremy Orlow.
Rename @webkitspeech to @x-webkit-speech to follow HTML5 convention.
diff --git a/LayoutTests/fast/speech/input-text-speechbutton.html b/LayoutTests/fast/speech/input-text-speechbutton.html
index b564fd7..6f5bc4b 100644
--- a/LayoutTests/fast/speech/input-text-speechbutton.html
+++ b/LayoutTests/fast/speech/input-text-speechbutton.html
@@ -10,13 +10,13 @@
<script type="text/javascript">
description('Tests for speech button click with <input type="text" speech>.');
-function onChange() {
+function onWebkitSpeechChange() {
shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
setTimeout(function() {
var input = document.getElementById('speechInput');
input.dir = 'rtl';
input.value = '';
- input.onchange = function() {
+ input.onwebkitspeechchange = function() {
shouldBeEqualToString('document.getElementById("speechInput").value',
'Pictures of the moon');
finishJSTest();
@@ -49,6 +49,6 @@ window.jsTestIsAsync = true;
window.successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
-<input id='speechInput' x-webkit-speech onchange="onChange()">
+<input id='speechInput' x-webkit-speech onwebkitspeechchange="onWebkitSpeechChange()">
</body>
</html>
diff --git a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
index 4c2925d..b9b8ec3 100644
--- a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
+++ b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
@@ -29,7 +29,7 @@ function sendClick(useEventSender) {
}
function setupDispatchEventTest() {
- document.getElementById('speechInput').onchange = function() {
+ document.getElementById('speechInput').onwebkitspeechchange = function() {
testFailed('speech button accepted a programmatic click and fired onChange event.');
finishJSTest();
};
@@ -50,7 +50,7 @@ function run() {
if (window.layoutTestController && window.eventSender) {
// Running in DRT, test the eventSender case.
layoutTestController.setMockSpeechInputResult('Pictures of the moon');
- document.getElementById('speechInput').onchange = function() {
+ document.getElementById('speechInput').onwebkitspeechchange = function() {
shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
// The speech button is still in the processing state and does not accept clicks. So ask for
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5312dd7..9f5158c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,22 @@
2010-10-05 Satish Sampath <satish at chromium.org>
+ Reviewed by Kent Tamura.
+
+ Added event onwebkitspeechchange to invoke on new speech input results.
+ https://bugs.webkit.org/show_bug.cgi?id=47127
+
+ * dom/EventNames.h: Added webkitspeechchange event name.
+ * html/HTMLAttributeNames.in: Added onwebkitspeechchange attribute name.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::parseMappedAttribute): Handle new attribute set.
+ (WebCore::HTMLInputElement::dispatchWebkitSpeechChangeEvent): Invoke the event handler.
+ * html/HTMLInputElement.h:
+ * html/HTMLInputElement.idl: Added attribute to IDL.
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Invoke new event handler instead of onChange
+
+2010-10-05 Satish Sampath <satish at chromium.org>
+
Reviewed by Jeremy Orlow.
Rename @webkitspeech to @x-webkit-speech to follow HTML5 convention
diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h
index e50ade0..6440000 100644
--- a/WebCore/dom/EventNames.h
+++ b/WebCore/dom/EventNames.h
@@ -166,7 +166,9 @@ namespace WebCore {
\
macro(loadend) \
\
- macro(webkitfullscreenchange)
+ macro(webkitfullscreenchange) \
+ \
+ macro(webkitspeechchange)
\
// end of DOM_EVENT_NAMES_FOR_EACH
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index 56b4d9c..d5c48c4 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -206,6 +206,7 @@ onseeked
onseeking
onselect
onselectstart
+onwebkitspeechchange
onstalled
onstorage
onsuspend
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 61ad526..0524fc8 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -1215,7 +1215,8 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
if (renderer())
renderer()->updateFromElement();
setNeedsStyleRecalc();
- }
+ } else if (attr->name() == onwebkitspeechchangeAttr)
+ setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAttributeEventListener(this, attr));
#endif
else
HTMLTextFormControlElement::parseMappedAttribute(attr);
@@ -2893,6 +2894,12 @@ bool HTMLInputElement::isSpeechEnabled() const
}
return false;
}
+
+void HTMLInputElement::dispatchWebkitSpeechChangeEvent()
+{
+ ASSERT(isSpeechEnabled());
+ dispatchEvent(Event::create(eventNames().webkitspeechchangeEvent, true, false));
+}
#endif
} // namespace
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index cd98a1d..fb2e0ad 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -44,6 +44,8 @@ public:
static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*);
virtual ~HTMLInputElement();
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange);
+
bool autoComplete() const;
// For ValidityState
@@ -98,7 +100,8 @@ public:
#if ENABLE(INPUT_SPEECH)
virtual bool isSpeechEnabled() const;
-#endif
+ void dispatchWebkitSpeechChangeEvent();
+#endif
bool checked() const { return m_checked; }
void setChecked(bool, bool sendChangeEvent = false);
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index bc3fd2b..1ca7d6c 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 [DontEnum] EventListener onwebkitspeechchange;
#endif
};
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index e5228f0..5d5b8b3 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -479,7 +479,7 @@ void InputFieldSpeechButtonElement::setRecognitionResult(int, const String& resu
// here, we take a temporary reference.
RefPtr<HTMLInputElement> holdRef(input);
input->setValue(result);
- input->dispatchFormControlChangeEvent();
+ input->dispatchWebkitSpeechChangeEvent();
renderer()->repaint();
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list