[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
commit-queue at webkit.org
commit-queue at webkit.org
Fri Jan 21 14:55:23 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 5f354cecd0f1f2474ebb09f790912229ded73a2a
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 4 21:27:04 2011 +0000
2011-01-04 Zhe Su <suzhe at chromium.org>
Reviewed by Kenneth Russell.
1. Remove entry for editing/input/ime-composition-clearpreedit.html test.
2. Improve fast/events/ime-composition-events-001.html to cover more
cases. And fix test expectations of chromium port.
https://bugs.webkit.org/show_bug.cgi?id=51693
* fast/events/ime-composition-events-001-expected.txt:
* fast/events/ime-composition-events-001.html:
* platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt: Removed.
* platform/chromium-win/fast/events/ime-composition-events-001-expected.txt: Removed.
* platform/chromium/fast/events/ime-composition-events-001-expected.txt: Added.
* platform/chromium/test_expectations.txt:
* platform/qt/fast/events/ime-composition-events-001-expected.txt: Added.
2011-01-04 Zhe Su <suzhe at chromium.org>
Reviewed by Kenneth Russell.
Fix insertText, setMarkedText and unmarkText methods of
TextInputController to call corresponding methods of WebKit::WebView
rather than WebKit::WebFrame. This change matches the behavior of
chromium browser.
insertText corresponds to WebView::confirmComposition(text)
setMarkedText corresponds to WebView::setComposition(...)
unmarkText corresponds to WebView::confirmComposition()
https://bugs.webkit.org/show_bug.cgi?id=51693
* DumpRenderTree/chromium/TextInputController.cpp:
(TextInputController::insertText):
(TextInputController::setMarkedText):
(TextInputController::unmarkText):
2011-01-04 Zhe Su <suzhe at chromium.org>
Reviewed by Kenneth Russell.
Changes:
1. Add WebKit::WebWidget::confirmComposition(const WebString& text)
This new method corresponds to Editor::confirmComposition(text) and
Editor::insertText(text). It'll be used by both DumpRenderTree's
TextInputController and chromium browser.
2. Fix WebFrameImpl::insertText
It should call Editor::confirmComposition(text) rather than
Editor::insertText(text) if there is an ongoing composition.
It matches the behavior of WebKit Mac port.
3. Fix WebFrameImpl::setMarkedText
Editor::confirmComposition(text) shouldn't be called in this
method, which incorrectly inserts the text.
https://bugs.webkit.org/show_bug.cgi?id=51693
* public/WebWidget.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::insertText):
(WebKit::WebFrameImpl::setMarkedText):
* src/WebPopupMenuImpl.cpp:
(WebKit::WebPopupMenuImpl::confirmComposition):
* src/WebPopupMenuImpl.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::confirmComposition):
* src/WebViewImpl.h:
* tests/PopupMenuTest.cpp:
(WebKit::TestWebWidget::confirmComposition):
2011-01-04 Zhe Su <suzhe at chromium.org>
Reviewed by Kenneth Russell.
Fix test LayoutTests/fast/events/ime-composition-events-001.html.
https://bugs.webkit.org/show_bug.cgi?id=51693
* Api/qwebpage.cpp:
(QWebPagePrivate::inputMethodEvent): Calls editor->insertText() to
insert the commit string when no composition text is available.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5a356a5..f0addd5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-04 Zhe Su <suzhe at chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ 1. Remove entry for editing/input/ime-composition-clearpreedit.html test.
+ 2. Improve fast/events/ime-composition-events-001.html to cover more
+ cases. And fix test expectations of chromium port.
+ https://bugs.webkit.org/show_bug.cgi?id=51693
+
+ * fast/events/ime-composition-events-001-expected.txt:
+ * fast/events/ime-composition-events-001.html:
+ * platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt: Removed.
+ * platform/chromium-win/fast/events/ime-composition-events-001-expected.txt: Removed.
+ * platform/chromium/fast/events/ime-composition-events-001-expected.txt: Added.
+ * platform/chromium/test_expectations.txt:
+ * platform/qt/fast/events/ime-composition-events-001-expected.txt: Added.
+
2010-12-31 Antti Koivisto <antti at apple.com>
Reviewed by Dave Hyatt.
diff --git a/LayoutTests/fast/events/ime-composition-events-001-expected.txt b/LayoutTests/fast/events/ime-composition-events-001-expected.txt
index e5bfc97..61ddee6 100644
--- a/LayoutTests/fast/events/ime-composition-events-001-expected.txt
+++ b/LayoutTests/fast/events/ime-composition-events-001-expected.txt
@@ -12,3 +12,7 @@ SUCCESS: INPUT - compositionstart - "5"
SUCCESS: INPUT - compositionupdate - "6"
SUCCESS: INPUT - compositionupdate - "7"
SUCCESS: INPUT - compositionend - ""
+SUCCESS: INPUT - textInput - "8"
+SUCCESS: INPUT - compositionstart - "9"
+SUCCESS: INPUT - compositionend - "9"
+SUCCESS: INPUT - textInput - "9"
diff --git a/LayoutTests/fast/events/ime-composition-events-001.html b/LayoutTests/fast/events/ime-composition-events-001.html
index c4d70be..3251c36 100644
--- a/LayoutTests/fast/events/ime-composition-events-001.html
+++ b/LayoutTests/fast/events/ime-composition-events-001.html
@@ -47,6 +47,16 @@ if (window.layoutTestController) {
textInputController.setMarkedText('6', 0, 1);
textInputController.setMarkedText('7', 0, 1);
textInputController.setMarkedText('', 0, 0);
+
+ // Case 3: Insert a text without composition.
+ textInputController.insertText('8');
+
+ // Case 4: Compose a text and commit it by removing the mark.
+ // Only Mac and Chromium ports support unmarkText.
+ if (textInputController.unmarkText) {
+ textInputController.setMarkedText('9', 0, 1);
+ textInputController.unmarkText();
+ }
}
</script>
</body>
diff --git a/LayoutTests/platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt b/LayoutTests/platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt
deleted file mode 100644
index e0184cd..0000000
--- a/LayoutTests/platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-This tests that calling input-method functions sends Composition Events and Text Events introduced in DOM Level 3.
-
-To test manually, enable an IME, input CJK characters, and see this page doesn't show 'FAILED' lines.
-
-
-SUCCESS: INPUT - compositionend - "1"
-SUCCESS: INPUT - textInput - "1"
-SUCCESS: INPUT - compositionstart - "1"
-SUCCESS: INPUT - compositionend - "2"
-SUCCESS: INPUT - textInput - "2"
-SUCCESS: INPUT - compositionstart - "2"
-SUCCESS: INPUT - compositionend - "3"
-SUCCESS: INPUT - textInput - "3"
-SUCCESS: INPUT - compositionstart - "3"
-SUCCESS: INPUT - compositionend - "3"
-SUCCESS: INPUT - textInput - "3"
-SUCCESS: INPUT - textInput - "4"
-SUCCESS: INPUT - compositionend - "5"
-SUCCESS: INPUT - textInput - "5"
-SUCCESS: INPUT - compositionstart - "5"
-SUCCESS: INPUT - compositionend - "6"
-SUCCESS: INPUT - textInput - "6"
-SUCCESS: INPUT - compositionstart - "6"
-SUCCESS: INPUT - compositionend - "7"
-SUCCESS: INPUT - textInput - "7"
-SUCCESS: INPUT - compositionstart - "7"
-SUCCESS: INPUT - compositionend - ""
-SUCCESS: INPUT - textInput - ""
diff --git a/LayoutTests/platform/chromium-win/fast/events/ime-composition-events-001-expected.txt b/LayoutTests/platform/chromium-win/fast/events/ime-composition-events-001-expected.txt
deleted file mode 100644
index e0184cd..0000000
--- a/LayoutTests/platform/chromium-win/fast/events/ime-composition-events-001-expected.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-This tests that calling input-method functions sends Composition Events and Text Events introduced in DOM Level 3.
-
-To test manually, enable an IME, input CJK characters, and see this page doesn't show 'FAILED' lines.
-
-
-SUCCESS: INPUT - compositionend - "1"
-SUCCESS: INPUT - textInput - "1"
-SUCCESS: INPUT - compositionstart - "1"
-SUCCESS: INPUT - compositionend - "2"
-SUCCESS: INPUT - textInput - "2"
-SUCCESS: INPUT - compositionstart - "2"
-SUCCESS: INPUT - compositionend - "3"
-SUCCESS: INPUT - textInput - "3"
-SUCCESS: INPUT - compositionstart - "3"
-SUCCESS: INPUT - compositionend - "3"
-SUCCESS: INPUT - textInput - "3"
-SUCCESS: INPUT - textInput - "4"
-SUCCESS: INPUT - compositionend - "5"
-SUCCESS: INPUT - textInput - "5"
-SUCCESS: INPUT - compositionstart - "5"
-SUCCESS: INPUT - compositionend - "6"
-SUCCESS: INPUT - textInput - "6"
-SUCCESS: INPUT - compositionstart - "6"
-SUCCESS: INPUT - compositionend - "7"
-SUCCESS: INPUT - textInput - "7"
-SUCCESS: INPUT - compositionstart - "7"
-SUCCESS: INPUT - compositionend - ""
-SUCCESS: INPUT - textInput - ""
diff --git a/LayoutTests/platform/chromium/fast/events/ime-composition-events-001-expected.txt b/LayoutTests/platform/chromium/fast/events/ime-composition-events-001-expected.txt
new file mode 100644
index 0000000..61ddee6
--- /dev/null
+++ b/LayoutTests/platform/chromium/fast/events/ime-composition-events-001-expected.txt
@@ -0,0 +1,18 @@
+This tests that calling input-method functions sends Composition Events and Text Events introduced in DOM Level 3.
+
+To test manually, enable an IME, input CJK characters, and see this page doesn't show 'FAILED' lines.
+
+
+SUCCESS: INPUT - compositionstart - "1"
+SUCCESS: INPUT - compositionupdate - "2"
+SUCCESS: INPUT - compositionupdate - "3"
+SUCCESS: INPUT - compositionend - "4"
+SUCCESS: INPUT - textInput - "4"
+SUCCESS: INPUT - compositionstart - "5"
+SUCCESS: INPUT - compositionupdate - "6"
+SUCCESS: INPUT - compositionupdate - "7"
+SUCCESS: INPUT - compositionend - ""
+SUCCESS: INPUT - textInput - "8"
+SUCCESS: INPUT - compositionstart - "9"
+SUCCESS: INPUT - compositionend - "9"
+SUCCESS: INPUT - textInput - "9"
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 3a2063e..40a4ab2 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3043,8 +3043,6 @@ BUGWK51398 MAC : inspector/debugger-expand-scope.html = TIMEOUT
// WebKit roll 74534:74545
BUGWK51536 : fast/css/box-shadow.html = FAIL TIMEOUT
-BUGCR67960 : editing/input/ime-composition-clearpreedit.html = TEXT
-
// WebKit roll 74667:74679
BUGCR68067 LINUX DEBUG : fast/canvas/webgl/tex-image-with-format-and-type.html = TEXT PASS
diff --git a/LayoutTests/platform/qt/fast/events/ime-composition-events-001-expected.txt b/LayoutTests/platform/qt/fast/events/ime-composition-events-001-expected.txt
new file mode 100644
index 0000000..c68ab16
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/events/ime-composition-events-001-expected.txt
@@ -0,0 +1,15 @@
+This tests that calling input-method functions sends Composition Events and Text Events introduced in DOM Level 3.
+
+To test manually, enable an IME, input CJK characters, and see this page doesn't show 'FAILED' lines.
+
+
+SUCCESS: INPUT - compositionstart - "1"
+SUCCESS: INPUT - compositionupdate - "2"
+SUCCESS: INPUT - compositionupdate - "3"
+SUCCESS: INPUT - compositionend - "4"
+SUCCESS: INPUT - textInput - "4"
+SUCCESS: INPUT - compositionstart - "5"
+SUCCESS: INPUT - compositionupdate - "6"
+SUCCESS: INPUT - compositionupdate - "7"
+SUCCESS: INPUT - compositionend - ""
+SUCCESS: INPUT - textInput - "8"
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 2327c54..f5e71e0 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,21 @@
+2011-01-04 Zhe Su <suzhe at chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ Fix insertText, setMarkedText and unmarkText methods of
+ TextInputController to call corresponding methods of WebKit::WebView
+ rather than WebKit::WebFrame. This change matches the behavior of
+ chromium browser.
+ insertText corresponds to WebView::confirmComposition(text)
+ setMarkedText corresponds to WebView::setComposition(...)
+ unmarkText corresponds to WebView::confirmComposition()
+ https://bugs.webkit.org/show_bug.cgi?id=51693
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::insertText):
+ (TextInputController::setMarkedText):
+ (TextInputController::unmarkText):
+
2011-01-04 Dihan Wickremasuriya <dihan.wickremasuriya at nokia.com>
Reviewed by Laszlo Gombos.
diff --git a/Tools/DumpRenderTree/chromium/TextInputController.cpp b/Tools/DumpRenderTree/chromium/TextInputController.cpp
index 3603840..c5dbe29 100644
--- a/Tools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/Tools/DumpRenderTree/chromium/TextInputController.cpp
@@ -79,17 +79,10 @@ void TextInputController::insertText(const CppArgumentList& arguments, CppVarian
{
result->setNull();
- WebFrame* mainFrame = getMainFrame();
- if (!mainFrame)
- return;
if (arguments.size() < 1 || !arguments[0].isString())
return;
- if (mainFrame->hasMarkedText()) {
- mainFrame->unmarkText();
- mainFrame->replaceSelection(WebString());
- }
- mainFrame->insertText(WebString::fromUTF8(arguments[0].toString()));
+ testShell->webView()->confirmComposition(WebString::fromUTF8(arguments[0].toString()));
}
void TextInputController::doCommand(const CppArgumentList& arguments, CppVariant* result)
@@ -108,15 +101,13 @@ void TextInputController::setMarkedText(const CppArgumentList& arguments, CppVar
{
result->setNull();
- WebFrame* mainFrame = getMainFrame();
- if (!mainFrame)
- return;
-
if (arguments.size() >= 3 && arguments[0].isString()
&& arguments[1].isNumber() && arguments[2].isNumber()) {
- mainFrame->setMarkedText(WebString::fromUTF8(arguments[0].toString()),
- arguments[1].toInt32(),
- arguments[2].toInt32());
+ WebVector<WebCompositionUnderline> underlines;
+ testShell->webView()->setComposition(WebString::fromUTF8(arguments[0].toString()),
+ underlines,
+ arguments[1].toInt32(),
+ arguments[1].toInt32() + arguments[2].toInt32());
}
}
@@ -124,11 +115,7 @@ void TextInputController::unmarkText(const CppArgumentList&, CppVariant* result)
{
result->setNull();
- WebFrame* mainFrame = getMainFrame();
- if (!mainFrame)
- return;
-
- mainFrame->unmarkText();
+ testShell->webView()->confirmComposition();
}
void TextInputController::hasMarkedText(const CppArgumentList&, CppVariant* result)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 6ef058c..c4a9fae 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,35 @@
+2011-01-04 Zhe Su <suzhe at chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ Changes:
+ 1. Add WebKit::WebWidget::confirmComposition(const WebString& text)
+ This new method corresponds to Editor::confirmComposition(text) and
+ Editor::insertText(text). It'll be used by both DumpRenderTree's
+ TextInputController and chromium browser.
+ 2. Fix WebFrameImpl::insertText
+ It should call Editor::confirmComposition(text) rather than
+ Editor::insertText(text) if there is an ongoing composition.
+ It matches the behavior of WebKit Mac port.
+ 3. Fix WebFrameImpl::setMarkedText
+ Editor::confirmComposition(text) shouldn't be called in this
+ method, which incorrectly inserts the text.
+
+ https://bugs.webkit.org/show_bug.cgi?id=51693
+
+ * public/WebWidget.h:
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::insertText):
+ (WebKit::WebFrameImpl::setMarkedText):
+ * src/WebPopupMenuImpl.cpp:
+ (WebKit::WebPopupMenuImpl::confirmComposition):
+ * src/WebPopupMenuImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::confirmComposition):
+ * src/WebViewImpl.h:
+ * tests/PopupMenuTest.cpp:
+ (WebKit::TestWebWidget::confirmComposition):
+
2011-01-03 Daniel Bates <dbates at rim.com>
Attempt to fix the Chromium Linux Release build after changeset 74895 <http://trac.webkit.org/changeset/74895>.
diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h
index d010270..ccad134 100644
--- a/WebKit/chromium/public/WebWidget.h
+++ b/WebKit/chromium/public/WebWidget.h
@@ -103,9 +103,18 @@ public:
int selectionEnd) = 0;
// Called to inform the WebWidget to confirm an ongoing composition.
+ // This method is same as confirmComposition(WebString());
// Returns true if there is an ongoing composition.
virtual bool confirmComposition() = 0;
+ // Called to inform the WebWidget to confirm an ongoing composition with a
+ // new composition text. If the text is empty then the current composition
+ // text is confirmed. If there is no ongoing composition, then deletes the
+ // current selection and inserts the text. This method has no effect if
+ // there is no ongoing composition and the text is empty.
+ // Returns true if there is an ongoing composition or the text is inserted.
+ virtual bool confirmComposition(const WebString& text) = 0;
+
// Returns the current text input type of this WebWidget.
virtual WebTextInputType textInputType() = 0;
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index a113644..1519d35 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1074,7 +1074,12 @@ void WebFrameImpl::replaceSelection(const WebString& text)
void WebFrameImpl::insertText(const WebString& text)
{
- frame()->editor()->insertText(text, 0);
+ Editor* editor = frame()->editor();
+
+ if (editor->hasComposition())
+ editor->confirmComposition(text);
+ else
+ editor->insertText(text, 0);
}
void WebFrameImpl::setMarkedText(
@@ -1082,8 +1087,6 @@ void WebFrameImpl::setMarkedText(
{
Editor* editor = frame()->editor();
- editor->confirmComposition(text);
-
Vector<CompositionUnderline> decorations;
editor->setComposition(text, decorations, location, length);
}
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp
index 085a157..63ebed8 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -253,6 +253,11 @@ bool WebPopupMenuImpl::confirmComposition()
return false;
}
+bool WebPopupMenuImpl::confirmComposition(const WebString& text)
+{
+ return false;
+}
+
WebTextInputType WebPopupMenuImpl::textInputType()
{
return WebTextInputTypeNone;
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h
index 221ba03..b8ef7ba 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.h
+++ b/WebKit/chromium/src/WebPopupMenuImpl.h
@@ -73,6 +73,7 @@ public:
const WebVector<WebCompositionUnderline>& underlines,
int selectionStart, int selectionEnd);
virtual bool confirmComposition();
+ virtual bool confirmComposition(const WebString& text);
virtual WebTextInputType textInputType();
virtual WebRect caretOrSelectionBounds();
virtual void setTextDirection(WebTextDirection direction);
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index d77a5b3..e47c89e 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -1303,11 +1303,16 @@ bool WebViewImpl::setComposition(
bool WebViewImpl::confirmComposition()
{
+ return confirmComposition(WebString());
+}
+
+bool WebViewImpl::confirmComposition(const WebString& text)
+{
Frame* focused = focusedWebCoreFrame();
if (!focused || !m_imeAcceptEvents)
return false;
Editor* editor = focused->editor();
- if (!editor || !editor->hasComposition())
+ if (!editor || (!editor->hasComposition() && !text.length()))
return false;
// We should verify the parent node of this IME composition node are
@@ -1321,7 +1326,14 @@ bool WebViewImpl::confirmComposition()
return false;
}
- editor->confirmComposition();
+ if (editor->hasComposition()) {
+ if (text.length())
+ editor->confirmComposition(String(text));
+ else
+ editor->confirmComposition();
+ } else
+ editor->insertText(String(text), 0);
+
return true;
}
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 80abf81..cc25c84 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -105,6 +105,7 @@ public:
int selectionStart,
int selectionEnd);
virtual bool confirmComposition();
+ virtual bool confirmComposition(const WebString& text);
virtual WebTextInputType textInputType();
virtual WebRect caretOrSelectionBounds();
virtual void setTextDirection(WebTextDirection direction);
diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp
index b68980f..4b6b123 100644
--- a/WebKit/chromium/tests/PopupMenuTest.cpp
+++ b/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -139,6 +139,7 @@ public:
int selectionStart,
int selectionEnd) { return true; }
virtual bool confirmComposition() { return true; }
+ virtual bool confirmComposition(const WebString& text) { return true; }
virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; }
virtual WebRect caretOrSelectionBounds() { return WebRect(); }
virtual void setTextDirection(WebTextDirection) { }
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index d2e2c22..483c8b6 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -1096,9 +1096,12 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
setSelectionRange(node, start, start + ev->replacementLength());
// Commit regardless of whether commitString is empty, to get rid of selection.
editor->confirmComposition(ev->commitString());
- } else if (!ev->commitString().isEmpty())
- editor->confirmComposition(ev->commitString());
- else if (!hasSelection && !ev->preeditString().isEmpty())
+ } else if (!ev->commitString().isEmpty()) {
+ if (editor->hasComposition())
+ editor->confirmComposition(ev->commitString());
+ else
+ editor->insertText(ev->commitString(), 0);
+ } else if (!hasSelection && !ev->preeditString().isEmpty())
editor->setComposition(ev->preeditString(), underlines, 0, 0);
else if (ev->preeditString().isEmpty() && editor->hasComposition())
editor->confirmComposition(String());
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index a57a323..886d9ac 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-04 Zhe Su <suzhe at chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ Fix test LayoutTests/fast/events/ime-composition-events-001.html.
+
+ https://bugs.webkit.org/show_bug.cgi?id=51693
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::inputMethodEvent): Calls editor->insertText() to
+ insert the commit string when no composition text is available.
+
2011-01-03 Yi Shen <yi.4.shen at nokia.com>
Reviewed by Adam Barth.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list