[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:40:54 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 9e12e6afc632037e533845bc207c9b98729d74ab
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 7 08:23:34 2009 +0000

    2009-10-07  Martin Robinson  <martin.james.robinson at gmail.com>
    
            [GTK] Segfault while testing fast/events/keydown-keypress-preventDefault.html
            https://bugs.webkit.org/show_bug.cgi?id=30121
    
            Clear previous preedit or pending composition before storing new ones.
            This can happen when a WebView receives a native keydown event without
            a matching keyup event or when preventDefault() is called on DOM keydown
            events.
    
            * WebCoreSupport/EditorClientGtk.cpp:
            (WebKit::setPendingComposition):
            (WebKit::setPendingPreedit):
            (WebKit::clearPendingIMData):
            (WebKit::imContextCommitted):
            (WebKit::imContextPreeditChanged):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49233 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index fe66440..37862b8 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-07  Martin Robinson  <martin.james.robinson at gmail.com>
+
+        [GTK] Segfault while testing fast/events/keydown-keypress-preventDefault.html
+        https://bugs.webkit.org/show_bug.cgi?id=30121
+
+        Clear previous preedit or pending composition before storing new ones.
+        This can happen when a WebView receives a native keydown event without
+        a matching keyup event or when preventDefault() is called on DOM keydown
+        events.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::setPendingComposition):
+        (WebKit::setPendingPreedit):
+        (WebKit::clearPendingIMData):
+        (WebKit::imContextCommitted):
+        (WebKit::imContextPreeditChanged):
+
 2009-10-06  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 7854891..7121163 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -52,29 +52,37 @@ namespace WebKit {
 static gchar* pendingComposition = 0;
 static gchar* pendingPreedit = 0;
 
-static void clearPendingIMData()
+static void setPendingComposition(gchar* newComposition)
 {
     g_free(pendingComposition);
-    pendingComposition = 0;
+    pendingComposition = newComposition;
+}
+
+static void setPendingPreedit(gchar* newPreedit)
+{
     g_free(pendingPreedit);
-    pendingPreedit = 0;
+    pendingPreedit = newPreedit;
+}
+
+static void clearPendingIMData()
+{
+    setPendingComposition(0);
+    setPendingPreedit(0);
 }
 static void imContextCommitted(GtkIMContext* context, const gchar* str, EditorClient* client)
 {
-    ASSERT(!pendingComposition);
-
     // This signal will fire during a keydown event. We want the contents of the
     // field to change right before the keyup event, so we wait until then to actually
     // commit this composition.
-    pendingComposition = g_strdup(str);
+    setPendingComposition(g_strdup(str));
 }
 
 static void imContextPreeditChanged(GtkIMContext* context, EditorClient* client)
 {
-    ASSERT(!pendingPreedit);
-
     // We ignore the provided PangoAttrList for now.
-    gtk_im_context_get_preedit_string(context, &pendingPreedit, NULL, NULL);
+    gchar* newPreedit = 0;
+    gtk_im_context_get_preedit_string(context, &newPreedit, NULL, NULL);
+    setPendingPreedit(newPreedit);
 }
 
 void EditorClient::setInputMethodState(bool active)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list