[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 13:25:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 53ca92bb0136fcfd03e91b37d10773ec2f41c85a
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 15 04:38:56 2010 +0000

    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  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-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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67534 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index db70b64..dd8be26 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  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r67503.
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..1b1f14f 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -1122,6 +1122,13 @@ static bool supportedPaste(Frame* frame, EditorCommandSource source)
     return false;
 }
 
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+static bool supportedDismissCorrectionPanel(Frame* frame, EditorCommandSource source)
+{
+    return supportedFromMenuOrKeyBinding(frame, source) && frame->editor()->isShowingCorrectionPanel();
+}
+#endif
+
 // Enabled functions
 
 static bool enabled(Frame*, Event*, EditorCommandSource)
@@ -1467,7 +1474,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 c6dedc4..cc27fa7 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -2,6 +2,22 @@
 
         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-14  Jia Pu  <jpu at apple.com>
+
+        Reviewed by Dan Bernstein.
+
         WebKit should use system wide spell checking preference when application specific one isn't set.
         https://bugs.webkit.org/show_bug.cgi?id=45789
 
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 baeaba0..3ab63f4 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-14  Sam Weinig  <sam at webkit.org>
 
         Fix windows build.
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index 8d599a1..9140f51 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -493,7 +493,7 @@ void WebEditorClient::setInputMethodState(bool)
     notImplemented();
 }
 
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
 void WebEditorClient::showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*)
 {
     notImplemented();
@@ -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..007fcd2 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
+++ b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
@@ -133,9 +133,10 @@ private:
     virtual void getGuessesForWord(const WTF::String&, Vector<WTF::String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !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