Changeset 69100 in webkit
- Timestamp:
- Oct 5, 2010 3:44:41 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69099 r69100 1 2010-10-05 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Kent Tamura. 4 5 Added event onwebkitspeechchange to invoke on new speech input results. 6 https://bugs.webkit.org/show_bug.cgi?id=47127 7 8 Updated to use onwebkitspeechchange instead of onchange. 9 10 * fast/speech/input-text-speechbutton.html: 11 * fast/speech/speech-button-ignore-generated-events.html: 12 1 13 2010-10-05 Satish Sampath <satish@chromium.org> 2 14 -
trunk/LayoutTests/fast/speech/input-text-speechbutton.html
r69099 r69100 11 11 description('Tests for speech button click with <input type="text" speech>.'); 12 12 13 function on Change() {13 function onWebkitSpeechChange() { 14 14 shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon'); 15 15 setTimeout(function() { … … 17 17 input.dir = 'rtl'; 18 18 input.value = ''; 19 input.on change = function() {19 input.onwebkitspeechchange = function() { 20 20 shouldBeEqualToString('document.getElementById("speechInput").value', 21 21 'Pictures of the moon'); … … 50 50 </script> 51 51 <script src="../js/resources/js-test-post.js"></script> 52 <input id='speechInput' x-webkit-speech on change="onChange()">52 <input id='speechInput' x-webkit-speech onwebkitspeechchange="onWebkitSpeechChange()"> 53 53 </body> 54 54 </html> -
trunk/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
r69099 r69100 30 30 31 31 function setupDispatchEventTest() { 32 document.getElementById('speechInput').on change = function() {32 document.getElementById('speechInput').onwebkitspeechchange = function() { 33 33 testFailed('speech button accepted a programmatic click and fired onChange event.'); 34 34 finishJSTest(); … … 51 51 // Running in DRT, test the eventSender case. 52 52 layoutTestController.setMockSpeechInputResult('Pictures of the moon'); 53 document.getElementById('speechInput').on change = function() {53 document.getElementById('speechInput').onwebkitspeechchange = function() { 54 54 shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon'); 55 55 -
trunk/WebCore/ChangeLog
r69099 r69100 1 2010-10-05 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Kent Tamura. 4 5 Added event onwebkitspeechchange to invoke on new speech input results. 6 https://bugs.webkit.org/show_bug.cgi?id=47127 7 8 * dom/EventNames.h: Added webkitspeechchange event name. 9 * html/HTMLAttributeNames.in: Added onwebkitspeechchange attribute name. 10 * html/HTMLInputElement.cpp: 11 (WebCore::HTMLInputElement::parseMappedAttribute): Handle new attribute set. 12 (WebCore::HTMLInputElement::dispatchWebkitSpeechChangeEvent): Invoke the event handler. 13 * html/HTMLInputElement.h: 14 * html/HTMLInputElement.idl: Added attribute to IDL. 15 * rendering/TextControlInnerElements.cpp: 16 (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Invoke new event handler instead of onChange 17 1 18 2010-10-05 Satish Sampath <satish@chromium.org> 2 19 -
trunk/WebCore/dom/EventNames.h
r66251 r69100 167 167 macro(loadend) \ 168 168 \ 169 macro(webkitfullscreenchange) 169 macro(webkitfullscreenchange) \ 170 \ 171 macro(webkitspeechchange) 170 172 \ 171 173 // end of DOM_EVENT_NAMES_FOR_EACH -
trunk/WebCore/html/HTMLAttributeNames.in
r69099 r69100 207 207 onselect 208 208 onselectstart 209 onwebkitspeechchange 209 210 onstalled 210 211 onstorage -
trunk/WebCore/html/HTMLInputElement.cpp
r69078 r69100 1216 1216 renderer()->updateFromElement(); 1217 1217 setNeedsStyleRecalc(); 1218 } 1218 } else if (attr->name() == onwebkitspeechchangeAttr) 1219 setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAttributeEventListener(this, attr)); 1219 1220 #endif 1220 1221 else … … 2894 2895 return false; 2895 2896 } 2897 2898 void HTMLInputElement::dispatchWebkitSpeechChangeEvent() 2899 { 2900 ASSERT(isSpeechEnabled()); 2901 dispatchEvent(Event::create(eventNames().webkitspeechchangeEvent, true, false)); 2902 } 2896 2903 #endif 2897 2904 -
trunk/WebCore/html/HTMLInputElement.h
r68996 r69100 45 45 virtual ~HTMLInputElement(); 46 46 47 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange); 48 47 49 bool autoComplete() const; 48 50 … … 99 101 #if ENABLE(INPUT_SPEECH) 100 102 virtual bool isSpeechEnabled() const; 101 #endif 103 void dispatchWebkitSpeechChangeEvent(); 104 #endif 102 105 103 106 bool checked() const { return m_checked; } -
trunk/WebCore/html/HTMLInputElement.idl
r69099 r69100 102 102 #if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH 103 103 attribute [Reflect, EnabledAtRuntime] boolean webkitSpeech; 104 attribute [DontEnum] EventListener onwebkitspeechchange; 104 105 #endif 105 106 }; -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r66878 r69100 480 480 RefPtr<HTMLInputElement> holdRef(input); 481 481 input->setValue(result); 482 input->dispatch FormControlChangeEvent();482 input->dispatchWebkitSpeechChangeEvent(); 483 483 renderer()->repaint(); 484 484 }
Note: See TracChangeset
for help on using the changeset viewer.