[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 14:58:33 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1551773420caa3f3acd05d4e2cbfab3ed9a1a95d
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 26 19:25:36 2010 +0000

    2010-10-26  Kenichi Ishibashi  <bashi at google.com>
    
            Reviewed by Kent Tamura.
    
            Input Method inserts conversion candidates unexpectedly
            https://bugs.webkit.org/show_bug.cgi?id=46868
    
            Adds a test.
    
            * platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html: Added.
    2010-10-26  Kenichi Ishibashi  <bashi at google.com>
    
            Reviewed by Kent Tamura.
    
            Input Method inserts conversion candidates unexpectedly
            https://bugs.webkit.org/show_bug.cgi?id=46868
    
            Calls updateStyleIfNeeded() before setting selection for the composition to
            avoid inserting the previous composition text into a content editable element
            which has an event handler that changes the style of the element.
    
            Test: platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html
    
            * editing/Editor.cpp:
            (WebCore::Editor::setComposition): calls updateStyleIfNeeded() before setting selection.
    2010-10-26  Kenichi Ishibashi  <bashi at google.com>
    
            Reviewed by Kent Tamura.
    
            Input Method inserts conversion candidates unexpectedly
            https://bugs.webkit.org/show_bug.cgi?id=46868
    
            Adds setComposition() to TextInputController to make DRT emulate
            an input method behavior.
    
            * DumpRenderTree/chromium/TextInputController.cpp:
            (TextInputController::TextInputController):
            (TextInputController::setComposition): Added.
            * DumpRenderTree/chromium/TextInputController.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7ce35d6..c283219 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-26  Kenichi Ishibashi  <bashi at google.com>
+
+        Reviewed by Kent Tamura.
+
+        Input Method inserts conversion candidates unexpectedly
+        https://bugs.webkit.org/show_bug.cgi?id=46868
+
+        Adds a test.
+
+        * platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html: Added.
+
 2010-10-26  Chris Marrin  <cmarrin at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/platform/chromium/fast/text/chromium-mac-duplicate-ime-composition-expected.txt b/LayoutTests/platform/chromium/fast/text/chromium-mac-duplicate-ime-composition-expected.txt
new file mode 100644
index 0000000..28b7710
--- /dev/null
+++ b/LayoutTests/platform/chromium/fast/text/chromium-mac-duplicate-ime-composition-expected.txt
@@ -0,0 +1,6 @@
+This page ensures that the composition text of an input method does not insert into the textarea when the composition text is updated but is not committed. The bug, reported in the issue 46868, should not occur here. When DRT tests this page, it will emulate changing composition text from "first" to "second". After that, the value of the textarea should be "second" and should not be "secondfirst".
+
+For manual test, input text into the following textarea by using an input method. The composition text which is not committed should not be inserted into the textarea.
+
+
+PASS expects = "second", actual = "second"
diff --git a/LayoutTests/platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html b/LayoutTests/platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html
new file mode 100644
index 0000000..adfca99
--- /dev/null
+++ b/LayoutTests/platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+  <script>
+    function check(expect, actual) {
+      var console = document.getElementById('console');
+      var div = document.createElement('div');
+      div.innerHTML = expect == actual ? 'PASS' : 'FAIL';
+      div.innerHTML += ' expects = "' + expect + '", actual = "' + actual + '"';
+      console.appendChild(div);
+    }
+
+    function doTest() {
+      if (!window.layoutTestController)
+        return;
+      layoutTestController.dumpAsText();
+      layoutTestController.waitUntilDone();
+      var textarea = document.getElementById('textarea');
+      var consoleElement = document.getElementById('console');
+      textarea.addEventListener('keydown', function (e) {
+        textarea.style['overflow'] = 'hidden';
+      });
+      layoutTestController.display();
+      textarea.focus();
+      if (textInputController.setComposition) {
+        // Emulates start input method conversion.
+        textInputController.setComposition('first');
+        // Then, emulates change of the composition text of the input method.
+        textInputController.setComposition('second');
+        // Checks whether the textarea does not contain the first composition.
+        check('second', textarea.value);
+      }
+      layoutTestController.notifyDone();
+    }
+  </script>
+</head>
+<body onload="doTest()">
+  <p>This page ensures that the composition text of an input method does not insert into the textarea when the composition text is updated but is not committed. The bug, reported in <a href="https://bugs.webkit.org/show_bug.cgi?id=46868">the issue 46868</a>, should not occur here. When DRT tests this page, it will emulate changing composition text from "first" to "second". After that, the value of the textarea should be "second" and should not be "secondfirst". </p>
+  <p>For manual test, input text into the following textarea by using an input method. The composition text which is not committed should not be inserted into the textarea.</p>
+  <textarea id="textarea"></textarea>
+  <div id="console"></div>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bfad927..c80fe1e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-26  Kenichi Ishibashi  <bashi at google.com>
+
+        Reviewed by Kent Tamura.
+
+        Input Method inserts conversion candidates unexpectedly
+        https://bugs.webkit.org/show_bug.cgi?id=46868
+
+        Calls updateStyleIfNeeded() before setting selection for the composition to
+        avoid inserting the previous composition text into a content editable element
+        which has an event handler that changes the style of the element.
+
+        Test: platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::setComposition): calls updateStyleIfNeeded() before setting selection.
+
 2010-10-26  Mario Sanchez Prada  <msanchez at igalia.com>
 
         Reviewed by Chris Fleizach.
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 4d6d258..2cc1c85 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -1534,6 +1534,11 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin
 
     setIgnoreCompositionSelectionChange(true);
 
+    // Updates styles before setting selection for composition to prevent
+    // inserting the previous composition text into text nodes oddly.
+    // See https://bugs.webkit.org/show_bug.cgi?id=46868
+    m_frame->document()->updateStyleIfNeeded();
+
     selectComposition();
 
     if (m_frame->selection()->isNone()) {
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c771bec..aeb6eed 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-26  Kenichi Ishibashi  <bashi at google.com>
+
+        Reviewed by Kent Tamura.
+
+        Input Method inserts conversion candidates unexpectedly
+        https://bugs.webkit.org/show_bug.cgi?id=46868
+
+        Adds setComposition() to TextInputController to make DRT emulate
+        an input method behavior.
+
+        * DumpRenderTree/chromium/TextInputController.cpp:
+        (TextInputController::TextInputController):
+        (TextInputController::setComposition): Added.
+        * DumpRenderTree/chromium/TextInputController.h:
+
 2010-10-26  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
index 7af4e9f..d9c794c 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -33,9 +33,11 @@
 
 #include "TestShell.h"
 #include "WebBindings.h"
+#include "WebCompositionUnderline.h"
 #include "WebFrame.h"
 #include "WebRange.h"
 #include "WebString.h"
+#include "WebVector.h"
 #include "WebView.h"
 #include <wtf/StringExtras.h>
 #include <string>
@@ -66,6 +68,7 @@ TextInputController::TextInputController(TestShell* shell)
     bindMethod("substringFromRange", &TextInputController::substringFromRange);
     bindMethod("unmarkText", &TextInputController::unmarkText);
     bindMethod("validAttributesForMarkedText", &TextInputController::validAttributesForMarkedText);
+    bindMethod("setComposition", &TextInputController::setComposition);
 }
 
 WebFrame* TextInputController::getMainFrame()
@@ -232,3 +235,27 @@ void TextInputController::makeAttributedString(const CppArgumentList&, CppVarian
     // FIXME: Implement this.
     result->setNull();
 }
+
+void TextInputController::setComposition(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    WebView* view = getMainFrame() ? getMainFrame()->view() : 0;
+    if (!view)
+        return;
+
+    if (arguments.size() < 1)
+        return;
+
+    // Sends a keydown event with key code = 0xE5 to emulate input method behavior.
+    WebKeyboardEvent keyDown;
+    keyDown.type = WebInputEvent::RawKeyDown;
+    keyDown.modifiers = 0;
+    keyDown.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY
+    keyDown.setKeyIdentifierFromWindowsKeyCode();
+    view->handleInputEvent(keyDown);
+
+    WebVector<WebCompositionUnderline> underlines;
+    WebString text(WebString::fromUTF8(arguments[0].toString()));
+    view->setComposition(text, underlines, 0, text.length());
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.h b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
index 9896be5..3a3907f 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.h
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
@@ -61,6 +61,7 @@ public:
     void characterIndexForPoint(const CppArgumentList&, CppVariant*);
     void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
     void makeAttributedString(const CppArgumentList&, CppVariant*);
+    void setComposition(const CppArgumentList&, CppVariant*);
 
 private:
     // Returns the test shell's main WebFrame.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list