From b8a00c9ffd67445c42027b6dfabdbec8f84a6714 Mon Sep 17 00:00:00 2001 From: sullivan Date: Thu, 14 Jul 2005 00:26:25 +0000 Subject: [PATCH] Reviewed by Maciej Stachowiak. - cleaned up Find-related experimental code that I checked in a while back * WebView.subproj/WebHTMLView.m: (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): remove variant of this method that had findInSelection flag; this method is now the same as it was on Tiger. * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): ditto git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9751 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/ChangeLog | 15 +++++++++++++++ WebKit/WebView.subproj/WebHTMLView.m | 13 +------------ WebKit/WebView.subproj/WebView.m | 31 +++---------------------------- 3 files changed, 19 insertions(+), 40 deletions(-) diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index ef2da54..0e2551d 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,18 @@ +2005-07-13 John Sullivan + + Reviewed by Maciej Stachowiak. + + - cleaned up Find-related experimental code that I checked in a while back + + * WebView.subproj/WebHTMLView.m: + (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): + remove variant of this method that had findInSelection flag; this method is now + the same as it was on Tiger. + + * WebView.subproj/WebView.m: + (-[WebView searchFor:direction:caseSensitive:wrap:]): + ditto + 2005-07-12 Geoffrey Garen -rolled in patch by opendarwin.org@mitzpettel.com diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m index e756237..6daac0e 100644 --- a/WebKit/WebView.subproj/WebHTMLView.m +++ b/WebKit/WebView.subproj/WebHTMLView.m @@ -2334,20 +2334,9 @@ static WebHTMLView *lastHitView = nil; return [[self _webView] _menuForElement:element defaultItems:nil]; } -// Search from the end of the currently selected location, or from the beginning of the -// document if nothing is selected. - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag { - return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag findInSelection:NO]; -} - -// Private method that adds a findInSelection parameter; might be public someday -// FIXME: this is currently discovered using respondsToSelector; no SPI or API yet -// FIXME: this needs to be done for other WebDocumentSearching implementors also, such as -// WebPDFView and WebSearchableTextView -- (BOOL)_searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)inSelectionFlag -{ - return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag findInSelection:inSelectionFlag]; + return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag]; } - (DOMRange *)_documentRange diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m index 5e772fa..8dd919a 100644 --- a/WebKit/WebView.subproj/WebView.m +++ b/WebKit/WebView.subproj/WebView.m @@ -190,11 +190,6 @@ macro(yankAndSelect) \ - (BOOL)_shouldAutoscrollForDraggingInfo:(id)dragInfo; @end -@interface NSObject (WebDocumentSearchingHack) -// FIXME: this should be part of a protocol (new version of ) -- (BOOL)_searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)inSelectionFlag; -@end - @interface WebView (WebFileInternal) - (void)_preflightSpellChecker; - (BOOL)_continuousCheckingAllowed; @@ -2169,9 +2164,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) : [curr _previousFrameWithWrap:wrapFlag]; } -// Search from the end of the currently selected location, or from the beginning of the -// document if nothing is selected. Deals with subframes. -- (BOOL)_searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)findInSelection +- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag { // Get the frame holding the selection, or start with the main frame WebFrame *startFrame = [self _frameForCurrentSelection]; @@ -2199,13 +2192,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) // Note at this point we are assuming the search will be done top-to-bottom, // not starting at any selection that exists. See 3228554. - BOOL success; - if ([searchView respondsToSelector:@selector(_searchFor:direction:caseSensitive:wrap:findInSelection:)]) { - success = [searchView _searchFor:string direction:forward caseSensitive:caseFlag wrap:NO findInSelection:findInSelection]; - } else { - success = [searchView searchFor:string direction:forward caseSensitive:caseFlag wrap:NO]; - } - if (success) { + if ([searchView searchFor:string direction:forward caseSensitive:caseFlag wrap:NO]) { [[self window] makeFirstResponder:searchView]; return YES; } @@ -2216,13 +2203,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) // Search contents of startFrame, on the other side of the selection that we did earlier. // We cheat a bit and just research with wrap on if (wrapFlag && startHasSelection && startSearchView) { - BOOL success; - if ([startSearchView respondsToSelector:@selector(_searchFor:direction:caseSensitive:wrap:findInSelection:)]) { - success = [startSearchView _searchFor:string direction:forward caseSensitive:caseFlag wrap:YES findInSelection:findInSelection]; - } else { - success = [startSearchView searchFor:string direction:forward caseSensitive:caseFlag wrap:YES]; - } - if (success) { + if ([startSearchView searchFor:string direction:forward caseSensitive:caseFlag wrap:YES]) { [[self window] makeFirstResponder:startSearchView]; return YES; } @@ -2230,12 +2211,6 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag) return NO; } -- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag -{ - return [self _searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag findInSelection:NO]; -} - - + (void)registerViewClass:(Class)viewClass representationClass:(Class)representationClass forMIMEType:(NSString *)MIMEType { [[WebFrameView _viewTypesAllowImageTypeOmission:YES] setObject:viewClass forKey:MIMEType]; -- 1.8.3.1