[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:12:05 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit f68cf5eb8684766811ae8403976c3cfb82ad6354
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 6 02:35:30 2002 +0000
WebCore:
Reviewed by: rjw
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge selectedString]): renamed to reflect WebDocument API change
(-[WebCoreBridge deselectAll]): added
(-[WebCoreBridge elementAtPoint:]): call selectedString
WebKit:
Added WebDocumentText protocol. Made WebHTMLView and WebTextView implement it.
Reviewed by: rjw
* WebView.subproj/WebController.m:
(-[WebController supportsTextEncoding]): check if protocol is WebDocumentText
* WebView.subproj/WebDocument.h:
* WebView.subproj/WebHTMLView.h:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView hasSelection]): call selectedString
(-[WebHTMLView takeFindStringFromSelection:]): call selectedString
(-[WebHTMLView selectAll:]): call selectAll
(-[WebHTMLView string]): part of WebDocumentText protocol
(-[WebHTMLView attributedString]): part of WebDocumentText protocol
(-[WebHTMLView selectedString]): part of WebDocumentText protocol
(-[WebHTMLView selectedAttributedString]): part of WebDocumentText protocol
(-[WebHTMLView selectAll]): part of WebDocumentText protocol
(-[WebHTMLView deselectAll]): part of WebDocumentText protocol
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _writeSelectionToPasteboard:]): call selectedAttributedString
* WebView.subproj/WebTextView.h:
* WebView.subproj/WebTextView.m:
(-[WebTextView string]): part of WebDocumentText protocol
(-[WebTextView attributedString]): part of WebDocumentText protocol
(-[WebTextView selectedString]): part of WebDocumentText protocol
(-[WebTextView selectedAttributedString]): part of WebDocumentText protocol
(-[WebTextView selectAll]): part of WebDocumentText protocol
(-[WebTextView deselectAll]): part of WebDocumentText protocol
WebBrowser:
Fixed: 3119117 - AppleScript text attribute not implemented
Reviewed by: rjw
* BrowserDocument.m:
(-[BrowserDocument text]): Create and return a text storage of the document
* Scripting.subproj/English.lproj/Alexander.scriptTerminology: fixed typo
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index dff4448..7ca0386 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2002-12-05 Chris Blumenberg <cblu at apple.com>
+
+ Reviewed by: rjw
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge selectedString]): renamed to reflect WebDocument API change
+ (-[WebCoreBridge deselectAll]): added
+ (-[WebCoreBridge elementAtPoint:]): call selectedString
+
2002-12-05 David Hyatt <hyatt at apple.com>
Fix relative positioned elements to add in the right offset
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index dff4448..7ca0386 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2002-12-05 Chris Blumenberg <cblu at apple.com>
+
+ Reviewed by: rjw
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge selectedString]): renamed to reflect WebDocument API change
+ (-[WebCoreBridge deselectAll]): added
+ (-[WebCoreBridge elementAtPoint:]): call selectedString
+
2002-12-05 David Hyatt <hyatt at apple.com>
Fix relative positioned elements to add in the right offset
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 0198310..070968c 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -157,8 +157,11 @@ enum FrameBorderStyle {
- (void)setSelectionFrom:(id <WebDOMNode>)start startOffset:(int)startOffset to:(id <WebDOMNode>)end endOffset:(int) endOffset;
-- (NSString *)selectedText;
+- (NSString *)selectedString;
+- (NSAttributedString *)selectedAttributedString;
+
- (void)selectAll;
+- (void)deselectAll;
- (id <WebDOMNode>)selectionStart;
- (int)selectionStartOffset;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index b99ac3b..1274114 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -267,7 +267,7 @@ NSString *WebCoreElementStringKey = @"WebElementString";
_part->gotoAnchor(QString::fromNSString(a));
}
-- (NSString *)selectedText
+- (NSString *)selectedString
{
return [[_part->selectedText().getNSString() copy] autorelease];
}
@@ -277,6 +277,11 @@ NSString *WebCoreElementStringKey = @"WebElementString";
_part->selectAll();
}
+- (void)deselectAll
+{
+ _part->kwq->document()->clearSelection();
+}
+
- (BOOL)isFrameSet
{
return _part->kwq->isFrameSet();
@@ -588,7 +593,7 @@ NSString *WebCoreElementStringKey = @"WebElementString";
}
if (_part->hasSelection()) {
- [element setObject:[self selectedText] forKey:WebCoreElementStringKey];
+ [element setObject:[self selectedString] forKey:WebCoreElementStringKey];
}
return element;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 72c637c..5699fe3 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,34 @@
+2002-12-05 Chris Blumenberg <cblu at apple.com>
+
+ Added WebDocumentText protocol. Made WebHTMLView and WebTextView implement it.
+
+ Reviewed by: rjw
+
+ * WebView.subproj/WebController.m:
+ (-[WebController supportsTextEncoding]): check if protocol is WebDocumentText
+ * WebView.subproj/WebDocument.h:
+ * WebView.subproj/WebHTMLView.h:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView hasSelection]): call selectedString
+ (-[WebHTMLView takeFindStringFromSelection:]): call selectedString
+ (-[WebHTMLView selectAll:]): call selectAll
+ (-[WebHTMLView string]): part of WebDocumentText protocol
+ (-[WebHTMLView attributedString]): part of WebDocumentText protocol
+ (-[WebHTMLView selectedString]): part of WebDocumentText protocol
+ (-[WebHTMLView selectedAttributedString]): part of WebDocumentText protocol
+ (-[WebHTMLView selectAll]): part of WebDocumentText protocol
+ (-[WebHTMLView deselectAll]): part of WebDocumentText protocol
+ * WebView.subproj/WebHTMLViewPrivate.m:
+ (-[WebHTMLView _writeSelectionToPasteboard:]): call selectedAttributedString
+ * WebView.subproj/WebTextView.h:
+ * WebView.subproj/WebTextView.m:
+ (-[WebTextView string]): part of WebDocumentText protocol
+ (-[WebTextView attributedString]): part of WebDocumentText protocol
+ (-[WebTextView selectedString]): part of WebDocumentText protocol
+ (-[WebTextView selectedAttributedString]): part of WebDocumentText protocol
+ (-[WebTextView selectAll]): part of WebDocumentText protocol
+ (-[WebTextView deselectAll]): part of WebDocumentText protocol
+
2002-12-05 Darin Adler <darin at apple.com>
Reviewed by Richard.
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index cd73550..915533d 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -377,7 +377,7 @@ NSString *WebElementStringKey = @"WebElementString";
- (BOOL)supportsTextEncoding
{
id documentView = [[[self mainFrame] webView] documentView];
- return [documentView conformsToProtocol:@protocol(WebDocumentTextEncoding)]
+ return [documentView conformsToProtocol:@protocol(WebDocumentText)]
&& [documentView supportsTextEncoding];
}
diff --git a/WebKit/WebView.subproj/WebDocument.h b/WebKit/WebView.subproj/WebDocument.h
index dfec49f..1385903 100644
--- a/WebKit/WebView.subproj/WebDocument.h
+++ b/WebKit/WebView.subproj/WebDocument.h
@@ -99,12 +99,51 @@
@protocol WebDocumentTextEncoding
@discussion Optional protocol for supporting text encoding.
*/
- at protocol WebDocumentTextEncoding <NSObject>
+ at protocol WebDocumentText <NSObject>
+
/*!
@method supportsTextEncoding
@result YES if the document view support text encoding, NO if it doesn't.
*/
- (BOOL)supportsTextEncoding;
+
+/*!
+ @method string
+ @result String that represents the entire document.
+*/
+- (NSString *)string;
+
+/*!
+ @method attributedString
+ @result Attributed string that represents the entire document.
+*/
+- (NSAttributedString *)attributedString;
+
+/*!
+ @method selectedString
+ @result String that represents the current selection.
+*/
+- (NSString *)selectedString;
+
+/*!
+ @method selectedAttributedString
+ @result Attributed string that represents the current selection.
+*/
+- (NSAttributedString *)selectedAttributedString;
+
+
+/*!
+ @method selectAll
+ @abstract Selects all the text in the document.
+*/
+- (void)selectAll;
+
+/*!
+ @method deselectText
+ @abstract Causes a text selection to lose its selection.
+*/
+- (void)deselectAll;
+
@end
diff --git a/WebKit/WebView.subproj/WebHTMLView.h b/WebKit/WebView.subproj/WebHTMLView.h
index 067117e..e4fe5ce 100644
--- a/WebKit/WebView.subproj/WebHTMLView.h
+++ b/WebKit/WebView.subproj/WebHTMLView.h
@@ -17,7 +17,7 @@
@class WebHTMLView
@discussion A document view of WebView that displays HTML content.
*/
- at interface WebHTMLView : NSView <WebDocumentView, WebDocumentDragSettings, WebDocumentSearching, WebDocumentTextEncoding>
+ at interface WebHTMLView : NSView <WebDocumentView, WebDocumentDragSettings, WebDocumentSearching, WebDocumentText>
{
@private
WebHTMLViewPrivate *_private;
@@ -37,36 +37,5 @@
*/
- (void)reapplyStyles;
-/*!
- @method setContextMenusEnabled:
- @abstract Enables or disables contextual menus.
- @param flag YES to enable contextual menus, NO to disable contextual menus.
-*/
-- (void)setContextMenusEnabled: (BOOL)flag;
-
-/*!
- @method contextMenusEnabled:
- @result Returns YES if contextual menus are enabled, NO if they are not.
-*/
-- (BOOL)contextMenusEnabled;
-
-/*!
- @method deselectText
- @abstract Causes a text selection to lose its selection.
-*/
-- (void)deselectText;
-
-/*!
- @method selectedAttributedText
- @result Attributed string that represents the current selection.
-*/
-- (NSAttributedString *)selectedAttributedText;
-
-/*!
- @method selectedText
- @result String that represents the current selection.
-*/
-- (NSString *)selectedText;
-
@end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 864865c..b7160d4 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -11,6 +11,7 @@
#import <WebKit/WebController.h>
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDOMDocument.h>
#import <WebKit/WebDynamicScrollBarsView.h>
#import <WebKit/WebException.h>
#import <WebKit/WebFrame.h>
@@ -79,7 +80,7 @@
- (BOOL)hasSelection
{
- return [[[self _bridge] selectedText] length] != 0;
+ return [[self selectedString] length] != 0;
}
- (IBAction)takeFindStringFromSelection:(id)sender
@@ -95,7 +96,7 @@
// it doesn't declare the types to the pasteboard and thus doesn't bump the change count.
findPasteboard = [NSPasteboard pasteboardWithName:NSFindPboard];
[findPasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
- [findPasteboard setString:[[self _bridge] selectedText] forType:NSStringPboardType];
+ [findPasteboard setString:[self selectedString] forType:NSStringPboardType];
}
- (void)copy:(id)sender
@@ -109,9 +110,9 @@
return YES;
}
-- (void)selectAll: sender
+- (void)selectAll:(id)sender
{
- [[self _bridge] selectAll];
+ [self selectAll];
}
- (void)jumpToSelection: sender
@@ -343,61 +344,60 @@
return [[self _controller] _menuForElement:element];
}
-- (void)setContextMenusEnabled: (BOOL)flag
+// 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
{
- [NSException raise:WebMethodNotYetImplemented format:@"WebView::setContextMenusEnabled: is not implemented"];
+ return [[self _bridge] searchFor: string direction: forward caseSensitive: caseFlag];
}
-
-- (BOOL)contextMenusEnabled;
+- (NSString *)string
{
- return NO;
+ return [[self attributedString] string];
}
-
-// Remove the selection.
-- (void)deselectText
+- (NSAttributedString *)attributedString
{
- [NSException raise:WebMethodNotYetImplemented format:@"WebView::deselectText: is not implemented"];
+ WebBridge *b = [self _bridge];
+ return [b attributedStringFrom:[b DOMDocument]
+ startOffset:0
+ to:nil
+ endOffset:0];
}
-
-
-// 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
+- (NSString *)selectedString
{
- return [[self _bridge] searchFor: string direction: forward caseSensitive: caseFlag];
+ return [[self _bridge] selectedString];
}
-
// Get an attributed string that represents the current selection.
-- (NSAttributedString *)selectedAttributedText
+- (NSAttributedString *)selectedAttributedString
{
- [NSException raise:WebMethodNotYetImplemented format:@"WebView::selectedText is not implemented"];
- return nil;
+ return [[self _bridge] selectedAttributedString];
}
-
-- (NSString *)selectedText
+- (void)selectAll
{
- return [[self _bridge] selectedText];
+ [[self _bridge] selectAll];
}
+// Remove the selection.
+- (void)deselectAll
+{
+ [[self _bridge] deselectAll];
+}
- (BOOL)isOpaque
{
return YES;
}
-
- (void)setNeedsDisplay:(BOOL)flag
{
LOG(View, "%@ flag = %d", self, (int)flag);
[super setNeedsDisplay: flag];
}
-
- (void)setNeedsLayout: (BOOL)flag
{
LOG(View, "%@ flag = %d", self, (int)flag);
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 1a52bb7..a519daf 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -17,6 +17,7 @@
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebHTMLView.h>
#import <WebKit/WebImageRenderer.h>
#import <WebKit/WebNetscapePluginEmbeddedView.h>
#import <WebKit/WebNSViewExtras.h>
@@ -300,19 +301,12 @@
- (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard
{
- NSAttributedString *attributedString;
- NSData *attributedData;
- WebBridge *b = [self _bridge];
-
[pasteboard declareTypes:[[self class] _pasteboardTypes] owner:nil];
- [pasteboard setString:[b selectedText] forType:NSStringPboardType];
+ [pasteboard setString:[self selectedString] forType:NSStringPboardType];
// Put attributed string on the pasteboard.
- attributedString = [b attributedStringFrom:[b selectionStart]
- startOffset:[b selectionStartOffset]
- to:[b selectionEnd]
- endOffset:[b selectionEndOffset]];
- attributedData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil];
+ NSAttributedString *attributedString = [self selectedAttributedString];
+ NSData *attributedData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil];
[pasteboard setData:attributedData forType:NSRTFPboardType];
#if SUPPORT_HTML_PBOARD
diff --git a/WebKit/WebView.subproj/WebTextView.h b/WebKit/WebView.subproj/WebTextView.h
index f0a33cf..8e220f6 100644
--- a/WebKit/WebView.subproj/WebTextView.h
+++ b/WebKit/WebView.subproj/WebTextView.h
@@ -8,9 +8,9 @@
@protocol WebDocumentView;
@protocol WebDocumentDragSettings;
- at protocol WebDocumentTextEncoding;
+ at protocol WebDocumentText;
- at interface WebTextView : WebSearchableTextView <WebDocumentView, WebDocumentDragSettings, WebDocumentTextEncoding>
+ at interface WebTextView : WebSearchableTextView <WebDocumentView, WebDocumentDragSettings, WebDocumentText>
{
BOOL canDragFrom;
BOOL canDragTo;
diff --git a/WebKit/WebView.subproj/WebTextView.m b/WebKit/WebView.subproj/WebTextView.m
index fc13766..5fa8fd7 100644
--- a/WebKit/WebView.subproj/WebTextView.m
+++ b/WebKit/WebView.subproj/WebTextView.m
@@ -130,7 +130,36 @@
return YES;
}
-// Pass key events to next responder so command-arrows work.
+- (NSString *)string
+{
+ return [super string];
+}
+
+- (NSAttributedString *)attributedString
+{
+ return [self attributedSubstringFromRange:NSMakeRange(0, [[self string] length])];
+}
+
+- (NSString *)selectedString
+{
+ return [[self string] substringWithRange:[self selectedRange]];
+}
+
+- (NSAttributedString *)selectedAttributedString
+{
+ return [self attributedSubstringFromRange:[self selectedRange]];
+}
+
+- (void)selectAll
+{
+ [self setSelectedRange:NSMakeRange(0, [[self string] length])];
+}
+
+- (void)deselectAll
+{
+ [self setSelectedRange:NSMakeRange(0,0)];
+}
+
- (void)keyDown:(NSEvent *)event
{
[[self nextResponder] keyDown:event];
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index cd73550..915533d 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -377,7 +377,7 @@ NSString *WebElementStringKey = @"WebElementString";
- (BOOL)supportsTextEncoding
{
id documentView = [[[self mainFrame] webView] documentView];
- return [documentView conformsToProtocol:@protocol(WebDocumentTextEncoding)]
+ return [documentView conformsToProtocol:@protocol(WebDocumentText)]
&& [documentView supportsTextEncoding];
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list