diff options
Diffstat (limited to 'WebCore/rendering/TextControlInnerElements.cpp')
-rw-r--r-- | WebCore/rendering/TextControlInnerElements.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp index b29876a..cf0e864 100644 --- a/WebCore/rendering/TextControlInnerElements.cpp +++ b/WebCore/rendering/TextControlInnerElements.cpp @@ -342,15 +342,15 @@ void SpinButtonElement::setHovered(bool flag) #if ENABLE(INPUT_SPEECH) -inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document* document) - : TextControlInnerElement(document) +inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Node* shadowParent) + : TextControlInnerElement(shadowParent->document(), shadowParent) , m_capturing(false) { } -PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(Document* document) +PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(Node* shadowParent) { - return adoptRef(new InputFieldSpeechButtonElement(document)); + return adoptRef(new InputFieldSpeechButtonElement(shadowParent)); } void InputFieldSpeechButtonElement::defaultEventHandler(Event* event) @@ -372,20 +372,21 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event) input->select(); event->setDefaultHandled(); } - // On mouse up, start speech recognition. + // On mouse up, release capture cleanly. if (event->type() == eventNames().mouseupEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) { if (m_capturing && renderer() && renderer()->visibleToHitTesting()) { if (Frame* frame = document()->frame()) { frame->eventHandler()->setCapturingMouseEventsNode(0); m_capturing = false; } - if (hovered()) { - speechInput()->startRecognition(this); - event->setDefaultHandled(); - } } } + if (event->type() == eventNames().clickEvent) { + speechInput()->startRecognition(this); + event->setDefaultHandled(); + } + if (!event->defaultHandled()) HTMLDivElement::defaultEventHandler(event); } |