[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:32:13 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0bf60c4164386120eec86919a2553443c032a380
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 16 22:29:21 2002 +0000

    WebKit:
    
    	Split searchability out from WebTextView so it could be used
    	elsewhere (specifically, in DOM window).
    
            * Misc.subproj/WebSearchableTextView.h: Added.
            * Misc.subproj/WebSearchableTextView.m: Added.
            (-[WebSearchableTextView searchFor:direction:caseSensitive:]):
            (-[NSString findString:selectedRange:options:wrap:]):
    	New class, split out from WebTextView, which now inherits from it.
    
            * WebView.subproj/WebTextView.h:
            * WebView.subproj/WebTextView.m:
    	Took out the searching stuff and put it in WebSearchableTextView;
    	made WebTextView inherit from WebSearchableTextView.
    
            * WebKit.pbproj/project.pbxproj: Added new files, made
    	WebSearchableTextView.h be Private.
    
    WebBrowser:
    
    	Made Find on Page work in DOM window; useful for debugging.
    
            * Debug/DOMTree.h: Turned DOMTree into an NSWindowController, and
    	implement protocol ProvidesSearchTarget
            * Debug/DOMTree.m:
            (-[DOMTree windowNibName]): standard NSWindowController stuff.
            (-[DOMTree targetForSearch]): return the textview
            (-[DOMTree awakeFromNib]): set properties of the textview; for some
    	reason, Interface Builder won't let you make an NSTextView be a custom
    	subview class in the nib, so you have to use a custom class, so you can't
    	set the standard NSTextView settings in the nib.
            (-[DOMTree itemSelected:]): Fixed typo, removed unnecessary return value.
    
            * Debug/DebugUtilities.m:
            (-[BrowserDocument showDOMTree:]): removed nib-loading line since
    	NSWindowControllers do this automatically.
    
            * Debug/DOMTree.nib: Made text view be a WebSearchableTextView;
    	also tweaked layout just a little (so "#document" doesn't clip by
    	default, e.g.)
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1853 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3da8bec..9716193 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,24 @@
 2002-08-16  John Sullivan  <sullivan at apple.com>
 
+	Split searchability out from WebTextView so it could be used
+	elsewhere (specifically, in DOM window).
+
+        * Misc.subproj/WebSearchableTextView.h: Added.
+        * Misc.subproj/WebSearchableTextView.m: Added.
+        (-[WebSearchableTextView searchFor:direction:caseSensitive:]):
+        (-[NSString findString:selectedRange:options:wrap:]):
+	New class, split out from WebTextView, which now inherits from it.
+
+        * WebView.subproj/WebTextView.h:
+        * WebView.subproj/WebTextView.m:
+	Took out the searching stuff and put it in WebSearchableTextView;
+	made WebTextView inherit from WebSearchableTextView.
+
+        * WebKit.pbproj/project.pbxproj: Added new files, made
+	WebSearchableTextView.h be Private.
+
+2002-08-16  John Sullivan  <sullivan at apple.com>
+
 	- fixed 3025394 -- Bookmarks & History items do not remember their icons
 	across launches
 	- fixed 3025421 -- Dragging from location field proxy icon to favorites bar 
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 3da8bec..9716193 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,24 @@
 2002-08-16  John Sullivan  <sullivan at apple.com>
 
+	Split searchability out from WebTextView so it could be used
+	elsewhere (specifically, in DOM window).
+
+        * Misc.subproj/WebSearchableTextView.h: Added.
+        * Misc.subproj/WebSearchableTextView.m: Added.
+        (-[WebSearchableTextView searchFor:direction:caseSensitive:]):
+        (-[NSString findString:selectedRange:options:wrap:]):
+	New class, split out from WebTextView, which now inherits from it.
+
+        * WebView.subproj/WebTextView.h:
+        * WebView.subproj/WebTextView.m:
+	Took out the searching stuff and put it in WebSearchableTextView;
+	made WebTextView inherit from WebSearchableTextView.
+
+        * WebKit.pbproj/project.pbxproj: Added new files, made
+	WebSearchableTextView.h be Private.
+
+2002-08-16  John Sullivan  <sullivan at apple.com>
+
 	- fixed 3025394 -- Bookmarks & History items do not remember their icons
 	across launches
 	- fixed 3025421 -- Dragging from location field proxy icon to favorites bar 
diff --git a/WebKit/Misc.subproj/WebSearchableTextView.h b/WebKit/Misc.subproj/WebSearchableTextView.h
new file mode 100644
index 0000000..0d70582
--- /dev/null
+++ b/WebKit/Misc.subproj/WebSearchableTextView.h
@@ -0,0 +1,14 @@
+//
+//  WebSearchableTextView.h
+//  WebKit
+//
+//  Created by John Sullivan on Fri Aug 16 2002.
+//  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+ at protocol WebDocumentSearching;
+
+ at interface WebSearchableTextView : NSTextView <WebDocumentSearching>
+ at end
diff --git a/WebKit/Misc.subproj/WebSearchableTextView.m b/WebKit/Misc.subproj/WebSearchableTextView.m
new file mode 100644
index 0000000..1c277f0
--- /dev/null
+++ b/WebKit/Misc.subproj/WebSearchableTextView.m
@@ -0,0 +1,78 @@
+//
+//  WebSearchableTextView.m
+//  WebKit
+//
+//  Created by John Sullivan on Fri Aug 16 2002.
+//  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import "WebSearchableTextView.h"
+#import "WebDocument.h"
+
+ at interface NSString (_Web_StringTextFinding)
+- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)mask wrap:(BOOL)wrapFlag;
+ at end
+
+ at implementation WebSearchableTextView
+
+- (BOOL)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag
+{
+    BOOL lastFindWasSuccessful = NO;
+    NSString *textContents = [self string];
+    unsigned textLength;
+
+    if (textContents && (textLength = [textContents length])) {
+        NSRange range;
+        unsigned options = 0;
+
+        if (!forward)
+            options |= NSBackwardsSearch;
+
+        if (!caseFlag)
+            options |= NSCaseInsensitiveSearch;
+
+        range = [textContents findString:string selectedRange:[self selectedRange] options:options wrap:YES];
+        if (range.length) {
+            [self setSelectedRange:range];
+            [self scrollRangeToVisible:range];
+            lastFindWasSuccessful = YES;
+        }
+    }
+
+    return lastFindWasSuccessful;
+}
+
+ at end
+
+ at implementation NSString (_Web_StringTextFinding)
+
+- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)options wrap:(BOOL)wrap
+{
+    BOOL forwards = (options & NSBackwardsSearch) == 0;
+    unsigned length = [self length];
+    NSRange searchRange, range;
+
+    if (forwards) {
+        searchRange.location = NSMaxRange(selectedRange);
+        searchRange.length = length - searchRange.location;
+        range = [self rangeOfString:string options:options range:searchRange];
+        if ((range.length == 0) && wrap) {	/* If not found look at the first part of the string */
+            searchRange.location = 0;
+            searchRange.length = selectedRange.location;
+            range = [self rangeOfString:string options:options range:searchRange];
+        }
+    } else {
+        searchRange.location = 0;
+        searchRange.length = selectedRange.location;
+        range = [self rangeOfString:string options:options range:searchRange];
+        if ((range.length == 0) && wrap) {
+            searchRange.location = NSMaxRange(selectedRange);
+            searchRange.length = length - searchRange.location;
+            range = [self rangeOfString:string options:options range:searchRange];
+        }
+}
+return range;
+}
+
+ at end
+
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 9d0fca3..ac625e3 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -268,6 +268,7 @@
 				3519E9EF02F0DF570ACA2ACA,
 				F5E7B24703025CE801A80180,
 				F501251D0302EA04018635CE,
+				F560BEBE030DAF4401C1A526,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -354,6 +355,7 @@
 				F5F732D302FF4D4F01A80180,
 				F5E7B24803025CE801A80180,
 				F501251E0302EA04018635CE,
+				F560BEBF030DAF4401C1A526,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -431,6 +433,8 @@
 				25C29825016E29620ECA149E,
 				F508946902B71D59018A9CD4,
 				F508946A02B71D59018A9CD4,
+				F560BEBC030DAF4401C1A526,
+				F560BEBD030DAF4401C1A526,
 				F59668C802AD2923018635CA,
 				F59668C902AD2923018635CA,
 			);
@@ -1608,6 +1612,31 @@
 			settings = {
 			};
 		};
+		F560BEBC030DAF4401C1A526 = {
+			isa = PBXFileReference;
+			path = WebSearchableTextView.h;
+			refType = 4;
+		};
+		F560BEBD030DAF4401C1A526 = {
+			isa = PBXFileReference;
+			path = WebSearchableTextView.m;
+			refType = 4;
+		};
+		F560BEBE030DAF4401C1A526 = {
+			fileRef = F560BEBC030DAF4401C1A526;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
+			};
+		};
+		F560BEBF030DAF4401C1A526 = {
+			fileRef = F560BEBD030DAF4401C1A526;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		F567433E026B5B7B01A80181 = {
 			isa = PBXFileReference;
 			path = WebLocationChangeHandler.h;
diff --git a/WebKit/WebView.subproj/WebTextView.h b/WebKit/WebView.subproj/WebTextView.h
index cd621ab..e520a3f 100644
--- a/WebKit/WebView.subproj/WebTextView.h
+++ b/WebKit/WebView.subproj/WebTextView.h
@@ -4,12 +4,12 @@
 */
 
 #import <Cocoa/Cocoa.h>
+#import "WebSearchableTextView.h"
 
 @protocol WebDocumentLoading;
 @protocol WebDocumentDragSettings;
- at protocol WebDocumentSearching;
 
- at interface WebTextView : NSTextView <WebDocumentLoading, WebDocumentDragSettings, WebDocumentSearching>
+ at interface WebTextView : WebSearchableTextView <WebDocumentLoading, WebDocumentDragSettings>
 {
     BOOL canDragFrom;
     BOOL canDragTo;
diff --git a/WebKit/WebView.subproj/WebTextView.m b/WebKit/WebView.subproj/WebTextView.m
index 76e8a2c..6880219 100644
--- a/WebKit/WebView.subproj/WebTextView.m
+++ b/WebKit/WebView.subproj/WebTextView.m
@@ -8,43 +8,6 @@
 #import <WebKit/WebDataSource.h>
 #import <WebKit/WebPreferences.h>
 
- at interface NSString (NSStringTextFinding)
-
-- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)mask wrap:(BOOL)wrapFlag;
-
- at end
-
- at implementation NSString (_Web_StringTextFinding)
-
-- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)options wrap:(BOOL)wrap {
-    BOOL forwards = (options & NSBackwardsSearch) == 0;
-    unsigned length = [self length];
-    NSRange searchRange, range;
-
-    if (forwards) {
-	searchRange.location = NSMaxRange(selectedRange);
-	searchRange.length = length - searchRange.location;
-	range = [self rangeOfString:string options:options range:searchRange];
-        if ((range.length == 0) && wrap) {	/* If not found look at the first part of the string */
-	    searchRange.location = 0;
-            searchRange.length = selectedRange.location;
-            range = [self rangeOfString:string options:options range:searchRange];
-        }
-    } else {
-	searchRange.location = 0;
-	searchRange.length = selectedRange.location;
-        range = [self rangeOfString:string options:options range:searchRange];
-        if ((range.length == 0) && wrap) {
-            searchRange.location = NSMaxRange(selectedRange);
-            searchRange.length = length - searchRange.location;
-            range = [self rangeOfString:string options:options range:searchRange];
-        }
-    }
-    return range;
-}        
-
- at end
-
 @implementation WebTextView
 
 - (id)initWithFrame:(NSRect)frame
@@ -133,33 +96,6 @@
     return canDragTo;
 }
 
-- (BOOL)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag
-{
-    BOOL lastFindWasSuccessful = NO;
-    NSString *textContents = [self string];
-    unsigned textLength;
-    
-    if (textContents && (textLength = [textContents length])) {
-        NSRange range;
-        unsigned options = 0;
-        
-        if (!forward) 
-            options |= NSBackwardsSearch;
-            
-        if (!caseFlag)
-            options |= NSCaseInsensitiveSearch;
-            
-        range = [textContents findString:string selectedRange:[self selectedRange] options:options wrap:YES];
-        if (range.length) {
-            [self setSelectedRange:range];
-            [self scrollRangeToVisible:range];
-            lastFindWasSuccessful = YES;
-        }
-    }
-
-    return lastFindWasSuccessful;
-}
-
 - (void)defaultsChanged:(NSNotification *)notification
 {
     if(![self isRichText]){

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list