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

mitz at apple.com mitz at apple.com
Wed Dec 22 13:24:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7b7552379c17cab53cfa618bd6e2273f89116c0d
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 14 07:50:32 2010 +0000

    Only intercept ESC key press when autocorrection UI is visible.
    https://bugs.webkit.org/show_bug.cgi?id=45071
    
    Patch by Jia Pu <jpu at apple.com> on 2010-09-14
    Reviewed by Dan Bernstein.
    
    WebCore:
    
    Only intercept ESC key when autocorrection panel is shown. Otherwise pressing
    ESC will cancel current loading like usual.
    
    * editing/Editor.cpp:
    (WebCore::Editor::isShowingCorrectionPanel): Query editor client whether autocorrection
      panel is shown.
    
    * editing/Editor.h: Added declaration of isShowingCorrectionPanel().
    
    * editing/EditorCommand.cpp:
    (WebCore::supportedDismissCorrectionPanel): Only support executeCancelOperation()
      when autocorrection panel is shown.
    (WebCore::createCommandMap): Replaced isSupported function pointer for
      executeCancelOperation() command with supportedDismissCorrectionPanel().
    
    * loader/EmptyClients.h:
    (WebCore::EmptyEditorClient::isShowingCorrectionPanel): Dummy implementation of
      new member method declared in base class.
    
    * page/EditorClient.h: Declared new member method isShowingCorrectionPanel().
    
    WebKit/mac:
    
    * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
      which provides an inteface to query whether autocorrection panel is shown.
    
    * WebCoreSupport/WebEditorClient.mm:
    (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
      for invalid correction panel tag. Replaced -1 with this constant.
    (WebEditorClient::dismissCorrectionPanel): Ditto
    (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
    
    WebKit2:
    
    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
    (WebKit::WebEditorClient::isShowingCorrectionPanel): Dummy implementation.
    
    * WebProcess/WebCoreSupport/WebEditorClient.h: Adopt new method delcared in base class.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67451 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 441cc5a..850a53d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2010-09-14  Jia Pu  <jpu at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Only intercept ESC key press when autocorrection UI is visible.
+        https://bugs.webkit.org/show_bug.cgi?id=45071
+
+        Only intercept ESC key when autocorrection panel is shown. Otherwise pressing
+        ESC will cancel current loading like usual.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::isShowingCorrectionPanel): Query editor client whether autocorrection
+          panel is shown.
+
+        * editing/Editor.h: Added declaration of isShowingCorrectionPanel().
+
+        * editing/EditorCommand.cpp:
+        (WebCore::supportedDismissCorrectionPanel): Only support executeCancelOperation()
+          when autocorrection panel is shown.
+        (WebCore::createCommandMap): Replaced isSupported function pointer for
+          executeCancelOperation() command with supportedDismissCorrectionPanel().
+
+        * loader/EmptyClients.h:
+        (WebCore::EmptyEditorClient::isShowingCorrectionPanel): Dummy implementation of
+          new member method declared in base class.
+
+        * page/EditorClient.h: Declared new member method isShowingCorrectionPanel().
+
 2010-09-14  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Kent Tamura.
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 3f9a5a5..125ecfa 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -2854,6 +2854,15 @@ void Editor::handleCancelOperation()
 #endif
 }
 
+bool Editor::isShowingCorrectionPanel()
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+    if (client())
+        return client()->isShowingCorrectionPanel();
+#endif
+    return false;
+}
+
 PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint)
 {
     Document* document = m_frame->documentAtPoint(windowPoint);
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 678ec59..7a4a185 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -313,6 +313,7 @@ public:
     void handleCancelOperation();
     void startCorrectionPanelTimer();
     void handleRejectedCorrection();
+    bool isShowingCorrectionPanel();
 
     void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle);
     void pasteAsPlainText(const String&, bool smartReplace);
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 24ceb39..b7558d3 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -1122,6 +1122,11 @@ static bool supportedPaste(Frame* frame, EditorCommandSource source)
     return false;
 }
 
+static bool supportedDismissCorrectionPanel(Frame* frame, EditorCommandSource source)
+{
+    return supportedFromMenuOrKeyBinding(frame, source) && frame->editor()->isShowingCorrectionPanel();
+}
+
 // Enabled functions
 
 static bool enabled(Frame*, Event*, EditorCommandSource)
@@ -1467,7 +1472,7 @@ static const CommandMap& createCommandMap()
         { "Yank", { executeYank, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "YankAndSelect", { executeYankAndSelect, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-        { "CancelOperation", { executeCancelOperation, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "CancelOperation", { executeCancelOperation, supportedDismissCorrectionPanel, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
 #endif
     };
 
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index 30b7857..b3a196d 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -470,6 +470,7 @@ public:
 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     virtual void showCorrectionPanel(const FloatRect&, const String&, const String&, Editor*) { }
     virtual void dismissCorrectionPanel(bool) { }
+    virtual bool isShowingCorrectionPanel() { return false; }
 #endif
     virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { }
     virtual void updateSpellingUIWithMisspelledWord(const String&) { }
diff --git a/WebCore/page/EditorClient.h b/WebCore/page/EditorClient.h
index d50a1f5..c9d5f6a 100644
--- a/WebCore/page/EditorClient.h
+++ b/WebCore/page/EditorClient.h
@@ -191,6 +191,7 @@ public:
 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     virtual void showCorrectionPanel(const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacmentString, Editor*) = 0;
     virtual void dismissCorrectionPanel(bool correctionAccepted) = 0;
+    virtual bool isShowingCorrectionPanel() = 0;
 #endif
 
     virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail) = 0;
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 8532395..b5c1cd2 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-14  Jia Pu  <jpu at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Only intercept ESC key press when autocorrection UI is visible.
+        https://bugs.webkit.org/show_bug.cgi?id=45071
+
+        * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
+          which provides an inteface to query whether autocorrection panel is shown.
+
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
+          for invalid correction panel tag. Replaced -1 with this constant.
+        (WebEditorClient::dismissCorrectionPanel): Ditto
+        (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
+
 2010-09-13  Darin Adler  <darin at apple.com>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h
index bddf87d..0afe384 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h
@@ -135,6 +135,7 @@ public:
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*);
     virtual void dismissCorrectionPanel(bool correctionAccepted);
+    virtual bool isShowingCorrectionPanel();
 #endif
 private:
     void registerCommandForUndoOrRedo(PassRefPtr<WebCore::EditCommand>, bool isRedo);
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index dfeea70..0b49563 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -87,6 +87,8 @@ static WebViewInsertAction kit(EditorInsertAction coreAction)
     return static_cast<WebViewInsertAction>(coreAction);
 }
 
+static const int InvalidCorrectionPanelTag = 0;
+
 #ifdef BUILDING_ON_TIGER
 @interface NSSpellChecker (NotYetPublicMethods)
 - (void)learnWord:(NSString *)word;
@@ -184,7 +186,7 @@ WebEditorClient::WebEditorClient(WebView *webView)
     , m_undoTarget([[[WebEditorUndoTarget alloc] init] autorelease])
     , m_haveUndoRedoOperations(false)
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-    , m_correctionPanelTag(-1)
+    , m_correctionPanelTag(InvalidCorrectionPanelTag)
 #endif
 {
 }
@@ -884,11 +886,16 @@ void WebEditorClient::showCorrectionPanel(const FloatRect& boundingBoxOfReplaced
 
 void WebEditorClient::dismissCorrectionPanel(bool correctionAccepted)
 {
-    if (m_correctionPanelTag >= 0) {
+    if (m_correctionPanelTag != InvalidCorrectionPanelTag) {
         [[NSSpellChecker sharedSpellChecker] dismissCorrection:m_correctionPanelTag acceptCorrection:correctionAccepted];
-        m_correctionPanelTag = -1;
+        m_correctionPanelTag = InvalidCorrectionPanelTag;
     }
 }
+
+bool WebEditorClient::isShowingCorrectionPanel()
+{
+    return m_correctionPanelTag != InvalidCorrectionPanelTag;
+}
 #endif
 
 void WebEditorClient::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 825f6a7..64ae677 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-14  Jia Pu  <jpu at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Only intercept ESC key press when autocorrection UI is visible.
+        https://bugs.webkit.org/show_bug.cgi?id=45071
+
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::isShowingCorrectionPanel): Dummy implementation.
+
+        * WebProcess/WebCoreSupport/WebEditorClient.h: Adopt new method delcared in base class.
+
 2010-09-13  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Jon Honeycutt.
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index 8d599a1..8f060eb 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -503,6 +503,12 @@ void WebEditorClient::dismissCorrectionPanel(bool correctionAccepted)
 {
     notImplemented();
 }
+
+bool WebEditorClient::isShowingCorrectionPanel()
+{
+    notImplemented();
+    return false;
+}
 #endif
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
index 6f89a31..38a3b35 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
+++ b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
@@ -136,6 +136,7 @@ private:
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*);
     virtual void dismissCorrectionPanel(bool correctionAccepted);
+    virtual bool isShowingCorrectionPanel();
 #endif
     WebPage* m_page;
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list