Changeset 67534 in webkit
- Timestamp:
- Sep 14, 2010 9:38:56 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r67532 r67534 1 2010-09-14 Jia Pu <jpu@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Only intercept ESC key press when autocorrection UI is visible. 6 https://bugs.webkit.org/show_bug.cgi?id=45071 7 8 Only intercept ESC key when autocorrection panel is shown. Otherwise pressing 9 ESC will cancel current loading like usual. 10 11 * editing/Editor.cpp: 12 (WebCore::Editor::isShowingCorrectionPanel): Query editor client whether autocorrection 13 panel is shown. 14 15 * editing/Editor.h: Added declaration of isShowingCorrectionPanel(). 16 17 * editing/EditorCommand.cpp: 18 (WebCore::supportedDismissCorrectionPanel): Only support executeCancelOperation() 19 when autocorrection panel is shown. 20 (WebCore::createCommandMap): Replaced isSupported function pointer for 21 executeCancelOperation() command with supportedDismissCorrectionPanel(). 22 23 * loader/EmptyClients.h: 24 (WebCore::EmptyEditorClient::isShowingCorrectionPanel): Dummy implementation of 25 new member method declared in base class. 26 27 * page/EditorClient.h: Declared new member method isShowingCorrectionPanel(). 28 1 29 2010-09-14 Sheriff Bot <webkit.review.bot@gmail.com> 2 30 -
trunk/WebCore/editing/Editor.cpp
r67458 r67534 2855 2855 } 2856 2856 2857 bool Editor::isShowingCorrectionPanel() 2858 { 2859 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 2860 if (client()) 2861 return client()->isShowingCorrectionPanel(); 2862 #endif 2863 return false; 2864 } 2865 2857 2866 PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint) 2858 2867 { -
trunk/WebCore/editing/Editor.h
r67458 r67534 314 314 void startCorrectionPanelTimer(); 315 315 void handleRejectedCorrection(); 316 bool isShowingCorrectionPanel(); 316 317 317 318 void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle); -
trunk/WebCore/editing/EditorCommand.cpp
r67458 r67534 1122 1122 return false; 1123 1123 } 1124 1125 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 1126 static bool supportedDismissCorrectionPanel(Frame* frame, EditorCommandSource source) 1127 { 1128 return supportedFromMenuOrKeyBinding(frame, source) && frame->editor()->isShowingCorrectionPanel(); 1129 } 1130 #endif 1124 1131 1125 1132 // Enabled functions … … 1468 1475 { "YankAndSelect", { executeYankAndSelect, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1469 1476 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 1470 { "CancelOperation", { executeCancelOperation, supported FromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1477 { "CancelOperation", { executeCancelOperation, supportedDismissCorrectionPanel, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1471 1478 #endif 1472 1479 }; -
trunk/WebCore/loader/EmptyClients.h
r67458 r67534 471 471 virtual void showCorrectionPanel(const FloatRect&, const String&, const String&, Editor*) { } 472 472 virtual void dismissCorrectionPanel(bool) { } 473 virtual bool isShowingCorrectionPanel() { return false; } 473 474 #endif 474 475 virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { } -
trunk/WebCore/page/EditorClient.h
r67458 r67534 192 192 virtual void showCorrectionPanel(const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacmentString, Editor*) = 0; 193 193 virtual void dismissCorrectionPanel(bool correctionAccepted) = 0; 194 virtual bool isShowingCorrectionPanel() = 0; 194 195 #endif 195 196 -
trunk/WebKit/mac/ChangeLog
r67533 r67534 1 2010-09-14 Jia Pu <jpu@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Only intercept ESC key press when autocorrection UI is visible. 6 https://bugs.webkit.org/show_bug.cgi?id=45071 7 8 * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(), 9 which provides an inteface to query whether autocorrection panel is shown. 10 11 * WebCoreSupport/WebEditorClient.mm: 12 (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag, 13 for invalid correction panel tag. Replaced -1 with this constant. 14 (WebEditorClient::dismissCorrectionPanel): Ditto 15 (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown. 16 1 17 2010-09-14 Jia Pu <jpu@apple.com> 2 18 -
trunk/WebKit/mac/WebCoreSupport/WebEditorClient.h
r67458 r67534 136 136 virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*); 137 137 virtual void dismissCorrectionPanel(bool correctionAccepted); 138 virtual bool isShowingCorrectionPanel(); 138 139 #endif 139 140 private: -
trunk/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r67458 r67534 88 88 } 89 89 90 static const int InvalidCorrectionPanelTag = 0; 91 90 92 #ifdef BUILDING_ON_TIGER 91 93 @interface NSSpellChecker (NotYetPublicMethods) … … 185 187 , m_haveUndoRedoOperations(false) 186 188 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 187 , m_correctionPanelTag( -1)189 , m_correctionPanelTag(InvalidCorrectionPanelTag) 188 190 #endif 189 191 { … … 885 887 void WebEditorClient::dismissCorrectionPanel(bool correctionAccepted) 886 888 { 887 if (m_correctionPanelTag >= 0) {889 if (m_correctionPanelTag != InvalidCorrectionPanelTag) { 888 890 [[NSSpellChecker sharedSpellChecker] dismissCorrection:m_correctionPanelTag acceptCorrection:correctionAccepted]; 889 m_correctionPanelTag = -1;891 m_correctionPanelTag = InvalidCorrectionPanelTag; 890 892 } 893 } 894 895 bool WebEditorClient::isShowingCorrectionPanel() 896 { 897 return m_correctionPanelTag != InvalidCorrectionPanelTag; 891 898 } 892 899 #endif -
trunk/WebKit2/ChangeLog
r67510 r67534 1 2010-09-14 Jia Pu <jpu@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Only intercept ESC key press when autocorrection UI is visible. 6 https://bugs.webkit.org/show_bug.cgi?id=45071 7 8 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 9 (WebKit::WebEditorClient::isShowingCorrectionPanel): Dummy implementation. 10 11 * WebProcess/WebCoreSupport/WebEditorClient.h: Adopt new method delcared in base class. 12 1 13 2010-09-14 Sam Weinig <sam@webkit.org> 2 14 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r67458 r67534 494 494 } 495 495 496 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)496 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 497 497 void WebEditorClient::showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*) 498 498 { … … 504 504 notImplemented(); 505 505 } 506 507 bool WebEditorClient::isShowingCorrectionPanel() 508 { 509 notImplemented(); 510 return false; 511 } 506 512 #endif 507 513 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
r67458 r67534 134 134 virtual void willSetInputMethodState(); 135 135 virtual void setInputMethodState(bool enabled); 136 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)136 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 137 137 virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*); 138 138 virtual void dismissCorrectionPanel(bool correctionAccepted); 139 virtual bool isShowingCorrectionPanel(); 139 140 #endif 140 141 WebPage* m_page;
Note: See TracChangeset
for help on using the changeset viewer.