Changeset 83862 in webkit


Ignore:
Timestamp:
Apr 14, 2011 8:51:53 AM (13 years ago)
Author:
satish@chromium.org
Message:

2011-04-14 Satish Sampath <satish@chromium.org>

Reviewed by Kent Tamura.

Disable speech input for readonly and disabled input fields.
https://bugs.webkit.org/show_bug.cgi?id=58540

  • fast/speech/input-readonly-and-disabled-expected.txt: Added.
  • fast/speech/input-readonly-and-disabled.html: Added.

2011-04-14 Satish Sampath <satish@chromium.org>

Reviewed by Kent Tamura.

Disable speech input for readonly and disabled input fields.
https://bugs.webkit.org/show_bug.cgi?id=58540

Test: fast/speech/input-readonly-and-disabled.html

  • html/shadow/TextControlInnerElements.cpp: (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83861 r83862  
     12011-04-14  Satish Sampath  <satish@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        Disable speech input for readonly and disabled input fields.
     6        https://bugs.webkit.org/show_bug.cgi?id=58540
     7
     8        * fast/speech/input-readonly-and-disabled-expected.txt: Added.
     9        * fast/speech/input-readonly-and-disabled.html: Added.
     10
    1112011-04-14  Ilya Tikhonovsky  <loislo@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r83861 r83862  
     12011-04-14  Satish Sampath  <satish@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        Disable speech input for readonly and disabled input fields.
     6        https://bugs.webkit.org/show_bug.cgi?id=58540
     7
     8        Test: fast/speech/input-readonly-and-disabled.html
     9
     10        * html/shadow/TextControlInnerElements.cpp:
     11        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
     12        (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
     13
    1142011-04-14  Ilya Tikhonovsky  <loislo@chromium.org>
    215
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r80412 r83862  
    394394    RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowAncestorNode()));
    395395
     396    if (input->disabled() || input->isReadOnlyFormControl()) {
     397        if (!event->defaultHandled())
     398            HTMLDivElement::defaultEventHandler(event);
     399        return;
     400    }
     401
    396402    // On mouse down, select the text and set focus.
    397403    if (event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
     
    472478    // here, we take a temporary reference.
    473479    RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowAncestorNode()));
     480    if (input->disabled() || input->isReadOnlyFormControl())
     481        return;
     482
    474483    RefPtr<InputFieldSpeechButtonElement> holdRefButton(this);
    475484    input->setValue(results.isEmpty() ? "" : results[0]->utterance());
Note: See TracChangeset for help on using the changeset viewer.