summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/TextControlInnerElements.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/TextControlInnerElements.cpp')
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 24e1d74..b29876a 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -232,7 +232,13 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
m_capturing = false;
}
if (hovered()) {
+ RefPtr<HTMLInputElement> protector(input);
+ String oldValue = input->value();
input->setValue("");
+ if (!oldValue.isEmpty()) {
+ toRenderTextControl(input->renderer())->setChangedSinceLastChangeEvent(true);
+ input->dispatchEvent(Event::create(eventNames().inputEvent, true, false));
+ }
input->onSearch();
event->setDefaultHandled();
}
@@ -374,7 +380,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
m_capturing = false;
}
if (hovered()) {
- speechInput()->startRecognition();
+ speechInput()->startRecognition(this);
event->setDefaultHandled();
}
}
@@ -386,17 +392,20 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
SpeechInput* InputFieldSpeechButtonElement::speechInput()
{
- if (!m_speechInput)
- m_speechInput.set(new SpeechInput(document()->page()->speechInputClient(), this));
- return m_speechInput.get();
+ return document()->page()->speechInput();
}
-void InputFieldSpeechButtonElement::recordingComplete()
+void InputFieldSpeechButtonElement::didCompleteRecording()
{
// FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is
// in progress.
}
+void InputFieldSpeechButtonElement::didCompleteRecognition()
+{
+ // FIXME: Add UI feedback here to indicate that audio recognition has ended.
+}
+
void InputFieldSpeechButtonElement::setRecognitionResult(const String& result)
{
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());