- Revision
- 86798
- Author
- [email protected]
- Date
- 2011-05-18 15:10:55 -0700 (Wed, 18 May 2011)
Log Message
2011-05-18 Yi Shen <[email protected]>
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 <[email protected]>
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 <[email protected]>
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.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (86797 => 86798)
--- trunk/LayoutTests/ChangeLog 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/LayoutTests/ChangeLog 2011-05-18 22:10:55 UTC (rev 86798)
@@ -1,3 +1,14 @@
+2011-05-18 Yi Shen <[email protected]>
+
+ 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 Rob Buis <[email protected]>
Reviewed by Nikolas Zimmermann.
Modified: trunk/LayoutTests/platform/qt/Skipped (86797 => 86798)
--- trunk/LayoutTests/platform/qt/Skipped 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/LayoutTests/platform/qt/Skipped 2011-05-18 22:10:55 UTC (rev 86798)
@@ -2249,10 +2249,6 @@
http/tests/inspector/network/network-size-chunked.html
http/tests/inspector/network/network-size-sync.html
-# [Qt]REGRESSION(r82243): fast/events/onsearch-enter.html fails
-# https://bugs.webkit.org/show_bug.cgi?id=57472
-fast/events/onsearch-enter.html
-
# [Qt] media/video-playbackrate.html fails
# https://bugs.webkit.org/show_bug.cgi?id=57476
media/video-playbackrate.html
Modified: trunk/Source/WebCore/ChangeLog (86797 => 86798)
--- trunk/Source/WebCore/ChangeLog 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/Source/WebCore/ChangeLog 2011-05-18 22:10:55 UTC (rev 86798)
@@ -1,3 +1,17 @@
+2011-05-18 Yi Shen <[email protected]>
+
+ 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-17 Timothy Hatcher <[email protected]>
Update the the context menu to reflect the system search provider on Mac.
Modified: trunk/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp (86797 => 86798)
--- trunk/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp 2011-05-18 22:10:55 UTC (rev 86798)
@@ -585,6 +585,10 @@
case Qt::Key_Backtab:
if (event->text().isNull())
return "\t";
+ break;
+ case Qt::Key_Enter:
+ if (event->text().isNull())
+ return "\r";
}
return event->text();
}
Modified: trunk/Source/WebKit/qt/ChangeLog (86797 => 86798)
--- trunk/Source/WebKit/qt/ChangeLog 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/Source/WebKit/qt/ChangeLog 2011-05-18 22:10:55 UTC (rev 86798)
@@ -1,3 +1,18 @@
+2011-05-18 Yi Shen <[email protected]>
+
+ 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.
+
2011-05-18 Kristóf Kosztyó <[email protected]>
Reviewed by Csaba Osztrogonác.
Modified: trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp (86797 => 86798)
--- trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp 2011-05-18 22:10:55 UTC (rev 86798)
@@ -531,22 +531,8 @@
#endif // QT_NO_SHORTCUT
}
-void EditorClientQt::handleInputMethodKeydown(KeyboardEvent* event)
+void EditorClientQt::handleInputMethodKeydown(KeyboardEvent*)
{
-#ifndef QT_NO_SHORTCUT
- const PlatformKeyboardEvent* kevent = event->keyEvent();
- if (kevent->type() == PlatformKeyboardEvent::RawKeyDown) {
- QWebPage::WebAction action = ""
- switch (action) {
- case QWebPage::InsertParagraphSeparator:
- case QWebPage::InsertLineSeparator:
- m_page->triggerAction(action);
- break;
- default:
- break;
- }
- }
-#endif
}
EditorClientQt::EditorClientQt(QWebPage* page)
Modified: trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp (86797 => 86798)
--- trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 2011-05-18 22:04:57 UTC (rev 86797)
+++ trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 2011-05-18 22:10:55 UTC (rev 86798)
@@ -2150,19 +2150,66 @@
"<textarea rows='5' cols='1' id='input5' value=''/>" \
"</body></html>");
page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.focus(); inputEle.select();");
+
+ // Enter Key without key text
QKeyEvent keyEnter(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier);
page->event(&keyEnter);
QList<QInputMethodEvent::Attribute> attribs;
- QInputMethodEvent eventText("\n", attribs);
+ QInputMethodEvent eventText(QString(), attribs);
+ eventText.setCommitString("\n");
page->event(&eventText);
- QInputMethodEvent eventText2("third line", attribs);
+ QInputMethodEvent eventText2(QString(), attribs);
+ eventText2.setCommitString("third line");
page->event(&eventText2);
qApp->processEvents();
QString inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
QCOMPARE(inputValue2, QString("\n\nthird line"));
+
+ // Enter Key with key text '\r'
+ page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();");
+ inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
+ QCOMPARE(inputValue2, QString(""));
+
+ QKeyEvent keyEnterWithCarriageReturn(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier, "\r");
+ page->event(&keyEnterWithCarriageReturn);
+ page->event(&eventText);
+ page->event(&eventText2);
+ qApp->processEvents();
+
+ inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
+ QCOMPARE(inputValue2, QString("\n\nthird line"));
+
+ // Enter Key with key text '\n'
+ page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();");
+ inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
+ QCOMPARE(inputValue2, QString(""));
+
+ QKeyEvent keyEnterWithLineFeed(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier, "\n");
+ page->event(&keyEnterWithLineFeed);
+ page->event(&eventText);
+ page->event(&eventText2);
+ qApp->processEvents();
+
+ inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
+ QCOMPARE(inputValue2, QString("\n\nthird line"));
+
+ // Enter Key with key text "\n\r"
+ page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();");
+ inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
+ QCOMPARE(inputValue2, QString(""));
+
+ QKeyEvent keyEnterWithLFCR(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier, "\n\r");
+ page->event(&keyEnterWithLFCR);
+ page->event(&eventText);
+ page->event(&eventText2);
+ qApp->processEvents();
+
+ inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString();
+ QCOMPARE(inputValue2, QString("\n\nthird line"));
+
// END - Newline test for textarea
delete container;