2011-01-04 Zhe Su <suzhe@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@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@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@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
parent 1b41f21f
2011-01-04 Zhe Su <suzhe@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@apple.com>
Reviewed by Dave Hyatt.
......
......@@ -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"
......@@ -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>
......
......@@ -3,26 +3,16 @@ This tests that calling input-method functions sends Composition Events and Text
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 - compositionupdate - "2"
SUCCESS: INPUT - compositionupdate - "3"
SUCCESS: INPUT - compositionend - "4"
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 - compositionupdate - "6"
SUCCESS: INPUT - compositionupdate - "7"
SUCCESS: INPUT - compositionend - ""
SUCCESS: INPUT - textInput - ""
SUCCESS: INPUT - textInput - "8"
SUCCESS: INPUT - compositionstart - "9"
SUCCESS: INPUT - compositionend - "9"
SUCCESS: INPUT - textInput - "9"
......@@ -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
......
......@@ -3,26 +3,13 @@ This tests that calling input-method functions sends Composition Events and Text
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 - compositionupdate - "2"
SUCCESS: INPUT - compositionupdate - "3"
SUCCESS: INPUT - compositionend - "4"
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 - compositionupdate - "6"
SUCCESS: INPUT - compositionupdate - "7"
SUCCESS: INPUT - compositionend - ""
SUCCESS: INPUT - textInput - ""
SUCCESS: INPUT - textInput - "8"
2011-01-04 Zhe Su <suzhe@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@nokia.com>
Reviewed by Laszlo Gombos.
......@@ -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)
......
2011-01-04 Zhe Su <suzhe@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@rim.com>
Attempt to fix the Chromium Linux Release build after changeset 74895 <http://trac.webkit.org/changeset/74895>.
......@@ -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;
......
......@@ -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);
}
......
......@@ -253,6 +253,11 @@ bool WebPopupMenuImpl::confirmComposition()
return false;
}
bool WebPopupMenuImpl::confirmComposition(const WebString& text)
{
return false;
}
WebTextInputType WebPopupMenuImpl::textInputType()
{
return WebTextInputTypeNone;
......
......@@ -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);
......
......@@ -1302,12 +1302,17 @@ 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;
}
......
......@@ -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);
......
......@@ -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) { }
......
......@@ -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());
......
2011-01-04 Zhe Su <suzhe@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@nokia.com>
Reviewed by Adam Barth.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment