[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

mrobinson at webkit.org mrobinson at webkit.org
Fri Jan 21 14:43:42 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit c5be70f22f8c2715a15e2f62e7ea47c798574918
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 27 22:48:21 2010 +0000

    2010-12-27  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Ryosuke Niwa.
    
            [GTK] EditorClient::generateEditorCommands queues up "null string" commands
            https://bugs.webkit.org/show_bug.cgi?id=51569
    
            Prevent adding "null string" editor commands by first checking whether or not
            the command string is null in generateEditorCommands before appending it to the
            list of pending editor command strings.
    
            * WebCoreSupport/EditorClientGtk.cpp:
            (WebKit::EditorClient::generateEditorCommands): Check for the null string (no
            command for this key combination) before appending a command string to the list of
            pending editor commands.
            (WebKit::EditorClient::executePendingEditorCommands): Add an ASSERT which detects
            null command strings.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74697 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 889f18e..d5efd82 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-27  Martin Robinson  <mrobinson at igalia.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [GTK] EditorClient::generateEditorCommands queues up "null string" commands
+        https://bugs.webkit.org/show_bug.cgi?id=51569
+
+        Prevent adding "null string" editor commands by first checking whether or not
+        the command string is null in generateEditorCommands before appending it to the
+        list of pending editor command strings.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::EditorClient::generateEditorCommands): Check for the null string (no
+        command for this key combination) before appending a command string to the list of
+        pending editor commands.
+        (WebKit::EditorClient::executePendingEditorCommands): Add an ASSERT which detects
+        null command strings.
+
 2010-12-27  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 0522f87..3f55cca 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -652,24 +652,23 @@ void EditorClient::generateEditorCommands(const KeyboardEvent* event)
     if (event->ctrlKey())
         modifiers |= CtrlKey;
 
-
-    if (event->type() == eventNames().keydownEvent) {
-        int mapKey = modifiers << 16 | event->keyCode();
-        if (mapKey)
-            m_pendingEditorCommands.append(keyDownCommandsMap.get(mapKey));
+    // For keypress events, we want charCode(), but keyCode() does that.
+    int mapKey = modifiers << 16 | event->keyCode();
+    if (!mapKey)
         return;
-    }
-
-    int mapKey = modifiers << 16 | event->charCode();
-    if (mapKey)
-        m_pendingEditorCommands.append(keyPressCommandsMap.get(mapKey));
+    HashMap<int, const char*>* commandMap = event->type() == eventNames().keydownEvent ?
+        &keyDownCommandsMap : &keyPressCommandsMap;
+    if (const char* commandString = commandMap->get(mapKey))
+        m_pendingEditorCommands.append(commandString);
 }
 
 bool EditorClient::executePendingEditorCommands(Frame* frame, bool allowTextInsertion)
 {
     Vector<Editor::Command> commands;
     for (size_t i = 0; i < m_pendingEditorCommands.size(); i++) {
-        Editor::Command command = frame->editor()->command(m_pendingEditorCommands.at(i));
+        const char* commandString = m_pendingEditorCommands.at(i);
+        ASSERT(commandString);
+        Editor::Command command = frame->editor()->command(commandString);
         if (command.isTextInsertion() && !allowTextInsertion)
             return false;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list