Changeset 86406 in webkit
- Timestamp:
- May 12, 2011 6:19:03 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86404 r86406 1 2011-05-12 Jia Pu <jpu@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Regression caused by changeset 86281 6 https://bugs.webkit.org/show_bug.cgi?id=60712 7 8 Changed wording in some tests to reflect AppKit UI change. 9 10 * manual-tests/autocorrection/delete-to-end-of-word-to-show-reversion.html: 11 * manual-tests/autocorrection/move-to-end-of-word-to-show-reversion.html: 12 1 13 2011-05-12 Daniel Bates <dbates@rim.com> 2 14 -
trunk/Source/WebCore/manual-tests/autocorrection/delete-to-end-of-word-to-show-reversion.html
r77577 r86406 33 33 <body> 34 34 <div><p>This test verifies that reversion panel is shown when user moves carret to previously corrected word using delete key.</p> 35 <p>After seeing the reversion panel, press ESC key, then spacekey. You should see the phrase "the mesage". </p>35 <p>After seeing the reversion panel, press down key followed by return key. You should see the phrase "the mesage". </p> 36 36 <p style="color:green">Note, this test can fail due to user specific spell checking data. If the user has previously frequently revert 'message' to 'mesage'. To fix this, remove all files in ~/Library/Spelling, then kill AppleSpell.service process.</p> 37 37 <div contenteditable id="root" class="editing"> -
trunk/Source/WebCore/manual-tests/autocorrection/move-to-end-of-word-to-show-reversion.html
r77577 r86406 33 33 <body> 34 34 <div><p>This test verifies that reversion panel is shown when user moves carret to previously corrected word</p> 35 <p>After seeing the reversion panel, press ESC key, then spacekey. You should see the phrase "the mesage". </p>35 <p>After seeing the reversion panel, press down key followed by return key. You should see the phrase "the mesage". </p> 36 36 <p style="color:green">Note, this test can fail due to user specific spell checking data. If the user has previously frequently revert 'message' to 'mesage'. To fix this, remove all files in ~/Library/Spelling, then kill AppleSpell.service process.</p> 37 37 <div contenteditable id="root" class="editing"> -
trunk/Source/WebKit/mac/ChangeLog
r86391 r86406 1 2011-05-12 Jia Pu <jpu@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Regression caused by changeset 86281 6 https://bugs.webkit.org/show_bug.cgi?id=60712 7 <rdar://problem/9427970> 8 9 Removed the condition variable. [NSSpellChecker dismissCorrectionIndicatorForView:] is blocking. 10 So handleAcceptedReplacement() triggered by dismissInternal() will return before dismissInternal() 11 returns. So we don't need to use the condition to coordinate between these two function. In fact, 12 all callbacks are delivered on main thread. We don't really need any locking here. 13 14 Since now we don't have distinction between dismiss() and dismissSoon(). dismissSoon() has 15 been removed. 16 17 * WebCoreSupport/CorrectionPanel.h: 18 * WebCoreSupport/CorrectionPanel.mm: 19 (CorrectionPanel::CorrectionPanel): 20 (CorrectionPanel::show): 21 (CorrectionPanel::dismiss): 22 (CorrectionPanel::dismissInternal): 23 (CorrectionPanel::handleAcceptedReplacement): 24 * WebCoreSupport/WebEditorClient.mm: 25 (WebEditorClient::dismissCorrectionPanelSoon): 26 1 27 2011-05-12 Patrick Gansterer <paroga@webkit.org> 2 28 -
trunk/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h
r86281 r86406 40 40 ~CorrectionPanel(); 41 41 void show(WebView*, WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); 42 void dismiss(WebCore::ReasonForDismissingCorrectionPanel); 43 String dismissSoon(WebCore::ReasonForDismissingCorrectionPanel); 42 String dismiss(WebCore::ReasonForDismissingCorrectionPanel); 44 43 static void recordAutocorrectionResponse(WebView*, NSCorrectionResponse, const String& replacedString, const String& replacementString); 45 44 46 45 private: 47 46 bool isShowing() const { return m_view; } 48 voiddismissInternal(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally);47 String dismissInternal(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally); 49 48 void handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType); 50 49 … … 52 51 WebCore::ReasonForDismissingCorrectionPanel m_reasonForDismissing; 53 52 RetainPtr<WebView> m_view; 54 RetainPtr<NSString> m_resultForSynchronousDismissal; 55 RetainPtr<NSCondition> m_resultCondition; 56 bool m_isDismissing; 53 RetainPtr<NSString> m_resultForDismissal; 57 54 }; 58 55 -
trunk/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm
r86281 r86406 47 47 : m_wasDismissedExternally(false) 48 48 , m_reasonForDismissing(ReasonForDismissingCorrectionPanelIgnored) 49 , m_resultCondition(AdoptNS, [[NSCondition alloc] init])50 , m_isDismissing(false)51 49 { 52 50 } … … 80 78 handleAcceptedReplacement(acceptedString, replacedStringAsNSString, replacementStringAsNSString, indicatorType); 81 79 }]; 82 m_isDismissing = false;83 80 } 84 81 85 voidCorrectionPanel::dismiss(ReasonForDismissingCorrectionPanel reason)82 String CorrectionPanel::dismiss(ReasonForDismissingCorrectionPanel reason) 86 83 { 87 dismissInternal(reason, true);84 return dismissInternal(reason, true); 88 85 } 89 86 90 String CorrectionPanel::dismissSoon(ReasonForDismissingCorrectionPanel reason) 91 { 92 dismissInternal(reason, true); 93 [m_resultCondition.get() lock]; 94 while (m_isDismissing) 95 [m_resultCondition.get() wait]; 96 [m_resultCondition.get() unlock]; 97 return m_resultForSynchronousDismissal.get(); 98 } 99 100 void CorrectionPanel::dismissInternal(ReasonForDismissingCorrectionPanel reason, bool dismissingExternally) 87 String CorrectionPanel::dismissInternal(ReasonForDismissingCorrectionPanel reason, bool dismissingExternally) 101 88 { 102 89 if (!isShowing()) 103 return; 104 105 m_isDismissing = true; 90 return String(); 91 106 92 m_wasDismissedExternally = dismissingExternally; 107 93 m_reasonForDismissing = reason; 108 m_resultFor SynchronousDismissal.clear();94 m_resultForDismissal.clear(); 109 95 [[NSSpellChecker sharedSpellChecker] dismissCorrectionIndicatorForView:m_view.get()]; 110 m_view.clear();96 return m_resultForDismissal.get(); 111 97 } 112 98 … … 117 103 118 104 void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType correctionIndicatorType) 119 { 105 { 106 if (!m_view) 107 return; 108 120 109 NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker]; 121 110 NSInteger documentTag = [m_view.get() spellCheckerDocumentTag]; … … 142 131 } 143 132 144 if (!m_wasDismissedExternally)145 [m_view.get() handleCorrectionPanelResult:acceptedReplacement];133 [m_view.get() handleCorrectionPanelResult:acceptedReplacement]; 134 m_view.clear(); 146 135 if (acceptedReplacement) 147 m_resultForSynchronousDismissal.adoptNS([acceptedReplacement copy]); 148 149 [m_resultCondition.get() lock]; 150 m_isDismissing = false; 151 [m_resultCondition.get() signal]; 152 [m_resultCondition.get() unlock]; 136 m_resultForDismissal.adoptNS([acceptedReplacement copy]); 153 137 } 154 138 -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r85302 r86406 876 876 String WebEditorClient::dismissCorrectionPanelSoon(ReasonForDismissingCorrectionPanel reasonForDismissing) 877 877 { 878 return m_correctionPanel.dismiss Soon(reasonForDismissing);878 return m_correctionPanel.dismiss(reasonForDismissing); 879 879 } 880 880 -
trunk/Source/WebKit2/ChangeLog
r86380 r86406 1 2011-05-12 Jia Pu <jpu@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Regression caused by changeset 86281 6 https://bugs.webkit.org/show_bug.cgi?id=60712 7 <rdar://problem/9427970> 8 9 Removed the condition variable. [NSSpellChecker dismissCorrectionIndicatorForView:] is blocking. 10 So handleAcceptedReplacement() triggered by dismissInternal() will return before dismissInternal() 11 returns. So we don't need to use the condition to coordinate between these two function. In fact, 12 all callbacks are delivered on main thread. We don't really need any locking here. 13 14 Since now we don't have distinction between dismiss() and dismissSoon(). dismissSoon() has 15 been removed. 16 17 * UIProcess/API/mac/PageClientImpl.mm: 18 (WebKit::PageClientImpl::dismissCorrectionPanelSoon): 19 * UIProcess/mac/CorrectionPanel.h: 20 * UIProcess/mac/CorrectionPanel.mm: 21 (WebKit::CorrectionPanel::CorrectionPanel): 22 (WebKit::CorrectionPanel::show): 23 (WebKit::CorrectionPanel::dismiss): 24 (WebKit::CorrectionPanel::dismissInternal): 25 (WebKit::CorrectionPanel::handleAcceptedReplacement): 26 1 27 2011-05-12 Brian Weinstein <bweinstein@apple.com> 2 28 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r85376 r86406 433 433 { 434 434 #if !defined(BUILDING_ON_SNOW_LEOPARD) 435 return m_correctionPanel.dismiss Soon(reason);435 return m_correctionPanel.dismiss(reason); 436 436 #else 437 437 return String(); -
trunk/Source/WebKit2/UIProcess/mac/CorrectionPanel.h
r86281 r86406 41 41 ~CorrectionPanel(); 42 42 void show(WKView*, WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); 43 void dismiss(WebCore::ReasonForDismissingCorrectionPanel); 44 String dismissSoon(WebCore::ReasonForDismissingCorrectionPanel); 43 String dismiss(WebCore::ReasonForDismissingCorrectionPanel); 45 44 static void recordAutocorrectionResponse(WKView*, NSCorrectionResponse, const String& replacedString, const String& replacementString); 46 45 47 46 private: 48 47 bool isShowing() const { return m_view; } 49 voiddismissInternal(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally);48 String dismissInternal(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally); 50 49 void handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType); 51 50 … … 53 52 WebCore::ReasonForDismissingCorrectionPanel m_reasonForDismissing; 54 53 RetainPtr<WKView> m_view; 55 RetainPtr<NSString> m_resultForSynchronousDismissal; 56 RetainPtr<NSCondition> m_resultCondition; 57 bool m_isDismissing; 54 RetainPtr<NSString> m_resultForDismissal; 58 55 }; 59 56 -
trunk/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm
r86281 r86406 53 53 : m_wasDismissedExternally(false) 54 54 , m_reasonForDismissing(ReasonForDismissingCorrectionPanelIgnored) 55 , m_resultCondition(AdoptNS, [[NSCondition alloc] init])56 , m_isDismissing(false)57 55 { 58 56 } … … 87 85 handleAcceptedReplacement(acceptedString, replacedStringAsNSString, replacementStringAsNSString, indicatorType); 88 86 }]; 89 m_isDismissing = false;90 87 } 91 88 92 voidCorrectionPanel::dismiss(ReasonForDismissingCorrectionPanel reason)89 String CorrectionPanel::dismiss(ReasonForDismissingCorrectionPanel reason) 93 90 { 94 dismissInternal(reason, true);91 return dismissInternal(reason, true); 95 92 } 96 93 97 String CorrectionPanel::dismissSoon(ReasonForDismissingCorrectionPanel reason) 98 { 99 dismissInternal(reason, true); 100 [m_resultCondition.get() lock]; 101 while (m_isDismissing) 102 [m_resultCondition.get() wait]; 103 [m_resultCondition.get() unlock]; 104 return m_resultForSynchronousDismissal.get(); 105 } 106 107 void CorrectionPanel::dismissInternal(ReasonForDismissingCorrectionPanel reason, bool dismissingExternally) 94 String CorrectionPanel::dismissInternal(ReasonForDismissingCorrectionPanel reason, bool dismissingExternally) 108 95 { 109 96 if (!isShowing()) 110 return ;97 return String(); 111 98 112 m_isDismissing = true;113 99 m_wasDismissedExternally = dismissingExternally; 114 100 m_reasonForDismissing = reason; 115 m_resultFor SynchronousDismissal.clear();101 m_resultForDismissal.clear(); 116 102 [[NSSpellChecker sharedSpellChecker] dismissCorrectionIndicatorForView:m_view.get()]; 117 m_view.clear();103 return m_resultForDismissal.get(); 118 104 } 119 105 … … 125 111 void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType correctionIndicatorType) 126 112 { 113 if (!m_view) 114 return; 115 127 116 NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker]; 128 117 NSInteger documentTag = [m_view.get() spellCheckerDocumentTag]; … … 148 137 break; 149 138 } 150 151 if (!m_wasDismissedExternally)152 [m_view.get() handleCorrectionPanelResult:acceptedReplacement];139 140 [m_view.get() handleCorrectionPanelResult:acceptedReplacement]; 141 m_view.clear(); 153 142 if (acceptedReplacement) 154 m_resultForSynchronousDismissal.adoptNS([acceptedReplacement copy]); 155 156 [m_resultCondition.get() lock]; 157 m_isDismissing = false; 158 [m_resultCondition.get() signal]; 159 [m_resultCondition.get() unlock]; 143 m_resultForDismissal.adoptNS([acceptedReplacement copy]); 160 144 } 161 145
Note: See TracChangeset
for help on using the changeset viewer.