Changeset 86798 in webkit


Ignore:
Timestamp:
May 18, 2011 3:10:55 PM (13 years ago)
Author:
yi.4.shen@nokia.com
Message:

2011-05-18 Yi Shen <yi.4.shen@nokia.com>

Reviewed by Andreas Kling.

[Qt] Enterkey to go to Newline does not work in the text area(in HTML form)
https://bugs.webkit.org/show_bug.cgi?id=33179

Unskip the fast/events/onsearch-enter.html test.

  • platform/qt/Skipped:

2011-05-18 Yi Shen <yi.4.shen@nokia.com>

Reviewed by Andreas Kling.

[Qt] Enterkey to go to Newline does not work in the text area(in HTML form)
https://bugs.webkit.org/show_bug.cgi?id=33179

Fill the missing key text for the EnterKey event.

Tests: fast/events/onsearch-enter.html

  • platform/qt/PlatformKeyboardEventQt.cpp: (WebCore::keyTextForKeyEvent):

2011-05-18 Yi Shen <yi.4.shen@nokia.com>

Reviewed by Andreas Kling.

[Qt] Enterkey to go to Newline does not work in the text area(in HTML form)
https://bugs.webkit.org/show_bug.cgi?id=33179

Remove the implementation of the handleInputMethodKeydown, which introduces
a regression(r82243) on Linux. Also, add more Api tests for the EnterKey event.

  • WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::handleInputMethodKeydown): Remove implementation.
  • tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods): Add more tests.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86791 r86798  
     12011-05-18  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Enterkey to go to Newline does not work in the text area(in HTML form)
     6        https://bugs.webkit.org/show_bug.cgi?id=33179
     7
     8        Unskip the fast/events/onsearch-enter.html test.
     9
     10        * platform/qt/Skipped:
     11
    1122011-05-18  Rob Buis  <rbuis@rim.com>
    213
  • trunk/LayoutTests/platform/qt/Skipped

    r86764 r86798  
    22502250http/tests/inspector/network/network-size-sync.html
    22512251
    2252 # [Qt]REGRESSION(r82243): fast/events/onsearch-enter.html fails
    2253 # https://bugs.webkit.org/show_bug.cgi?id=57472
    2254 fast/events/onsearch-enter.html
    2255 
    22562252# [Qt] media/video-playbackrate.html fails
    22572253# https://bugs.webkit.org/show_bug.cgi?id=57476
  • trunk/Source/WebCore/ChangeLog

    r86793 r86798  
     12011-05-18  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Enterkey to go to Newline does not work in the text area(in HTML form)
     6        https://bugs.webkit.org/show_bug.cgi?id=33179
     7
     8        Fill the missing key text for the EnterKey event.
     9
     10        Tests: fast/events/onsearch-enter.html
     11
     12        * platform/qt/PlatformKeyboardEventQt.cpp:
     13        (WebCore::keyTextForKeyEvent):
     14
    1152011-05-17  Timothy Hatcher  <timothy@apple.com>
    216
  • trunk/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp

    r86243 r86798  
    586586        if (event->text().isNull())
    587587            return "\t";
     588        break;
     589    case Qt::Key_Enter:
     590        if (event->text().isNull())
     591            return "\r";
    588592    }
    589593    return event->text();
  • trunk/Source/WebKit/qt/ChangeLog

    r86742 r86798  
     12011-05-18  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Enterkey to go to Newline does not work in the text area(in HTML form)
     6        https://bugs.webkit.org/show_bug.cgi?id=33179
     7
     8        Remove the implementation of the handleInputMethodKeydown, which introduces
     9        a regression(r82243) on Linux. Also, add more Api tests for the EnterKey event.
     10
     11        * WebCoreSupport/EditorClientQt.cpp:
     12        (WebCore::EditorClientQt::handleInputMethodKeydown): Remove implementation.
     13        * tests/qwebpage/tst_qwebpage.cpp:
     14        (tst_QWebPage::inputMethods): Add more tests.
     15
    1162011-05-18  Kristóf Kosztyó  <Kosztyo.Kristof@stud.u-szeged.hu>
    217
  • trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp

    r86325 r86798  
    532532}
    533533
    534 void EditorClientQt::handleInputMethodKeydown(KeyboardEvent* event)
    535 {
    536 #ifndef QT_NO_SHORTCUT
    537     const PlatformKeyboardEvent* kevent = event->keyEvent();
    538     if (kevent->type() == PlatformKeyboardEvent::RawKeyDown) {
    539         QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent());
    540         switch (action) {
    541         case QWebPage::InsertParagraphSeparator:
    542         case QWebPage::InsertLineSeparator:
    543             m_page->triggerAction(action);
    544             break;
    545         default:
    546             break;
    547         }
    548     }
    549 #endif
     534void EditorClientQt::handleInputMethodKeydown(KeyboardEvent*)
     535{
    550536}
    551537
  • trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r86154 r86798  
    21512151                                            "</body></html>");
    21522152    page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.focus(); inputEle.select();");
     2153   
     2154    // Enter Key without key text
    21532155    QKeyEvent keyEnter(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier);
    21542156    page->event(&keyEnter);
    21552157    QList<QInputMethodEvent::Attribute> attribs;
    21562158
    2157     QInputMethodEvent eventText("\n", attribs);
     2159    QInputMethodEvent eventText(QString(), attribs);
     2160    eventText.setCommitString("\n");
    21582161    page->event(&eventText);
    21592162
    2160     QInputMethodEvent eventText2("third line", attribs);
     2163    QInputMethodEvent eventText2(QString(), attribs);
     2164    eventText2.setCommitString("third line");
    21612165    page->event(&eventText2);
    21622166    qApp->processEvents();
     
    21642168    QString inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
    21652169    QCOMPARE(inputValue2, QString("\n\nthird line"));
     2170
     2171    // Enter Key with key text '\r'
     2172    page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();");
     2173    inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
     2174    QCOMPARE(inputValue2, QString(""));
     2175
     2176    QKeyEvent keyEnterWithCarriageReturn(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier, "\r");
     2177    page->event(&keyEnterWithCarriageReturn);
     2178    page->event(&eventText);
     2179    page->event(&eventText2);
     2180    qApp->processEvents();
     2181
     2182    inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
     2183    QCOMPARE(inputValue2, QString("\n\nthird line"));
     2184
     2185    // Enter Key with key text '\n'
     2186    page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();");
     2187    inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
     2188    QCOMPARE(inputValue2, QString(""));
     2189
     2190    QKeyEvent keyEnterWithLineFeed(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier, "\n");
     2191    page->event(&keyEnterWithLineFeed);
     2192    page->event(&eventText);
     2193    page->event(&eventText2);
     2194    qApp->processEvents();
     2195
     2196    inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
     2197    QCOMPARE(inputValue2, QString("\n\nthird line"));
     2198
     2199    // Enter Key with key text "\n\r"
     2200    page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();");
     2201    inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
     2202    QCOMPARE(inputValue2, QString(""));
     2203
     2204    QKeyEvent keyEnterWithLFCR(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier, "\n\r");
     2205    page->event(&keyEnterWithLFCR);
     2206    page->event(&eventText);
     2207    page->event(&eventText2);
     2208    qApp->processEvents();
     2209
     2210    inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
     2211    QCOMPARE(inputValue2, QString("\n\nthird line"));
     2212
    21662213    // END - Newline test for textarea
    21672214
Note: See TracChangeset for help on using the changeset viewer.