[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:27:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e98f7d94a54f6e9a8008a88cde9f4757cd5768ef
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Mar 7 03:30:05 2003 +0000
WebKit:
API changes. WebCapabilities -> WebContentTypes.
Move fileExtension from WebDataSource to WebContentTypes
Reviewed by chris.
* Misc.subproj/WebNSPasteboardExtras.m:
(-[NSPasteboard _web_bestURL]):
* WebKit.exp:
* WebView.subproj/WebController.h:
* WebView.subproj/WebController.m:
(+[WebContentTypes suggestedFileExtensionForMIMEType:]):
(-[WebController supportsTextEncoding]):
(-[WebController setCustomTextEncodingName:]):
(-[WebController _mainFrameOverrideEncoding]):
(-[WebController customTextEncodingName]):
(-[WebController stringByEvaluatingJavaScriptFromString:]):
(-[WebController userAgentForURL:]):
* WebView.subproj/WebControllerPrivate.h:
* WebView.subproj/WebDataSource.h:
* WebView.subproj/WebDataSource.m:
* WebView.subproj/WebDefaultPolicyDelegate.m:
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient continueAfterContentPolicy:response:]):
WebBrowser:
API changes. WebCapabilities -> WebContentTypes.
Move fileExtension from WebDataSource to WebContentTypes
Reviewed by chris.
* BrowserDocument.m:
(-[BrowserDocument fileType]):
* BrowserWebController.m:
(-[BrowserWebController contentPolicyForMIMEType:andRequest:inFrame:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 24f6e8c..e58bfee 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2003-03-06 Richard Williamson <rjw at apple.com>
+
+ API changes. WebCapabilities -> WebContentTypes.
+ Move fileExtension from WebDataSource to WebContentTypes
+
+ Reviewed by chris.
+
+ * Misc.subproj/WebNSPasteboardExtras.m:
+ (-[NSPasteboard _web_bestURL]):
+ * WebKit.exp:
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebController.m:
+ (+[WebContentTypes suggestedFileExtensionForMIMEType:]):
+ (-[WebController supportsTextEncoding]):
+ (-[WebController setCustomTextEncodingName:]):
+ (-[WebController _mainFrameOverrideEncoding]):
+ (-[WebController customTextEncodingName]):
+ (-[WebController stringByEvaluatingJavaScriptFromString:]):
+ (-[WebController userAgentForURL:]):
+ * WebView.subproj/WebControllerPrivate.h:
+ * WebView.subproj/WebDataSource.h:
+ * WebView.subproj/WebDataSource.m:
+ * WebView.subproj/WebDefaultPolicyDelegate.m:
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient continueAfterContentPolicy:response:]):
+
2003-03-06 Chris Blumenberg <cblu at apple.com>
Implemented WebDownload API.
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.m b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
index 0771bbd..1ee49c6 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.m
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
@@ -66,7 +66,7 @@ NSString *WebURLNamePboardType = nil;
NSString *file = [files objectAtIndex:0];
BOOL isDirectory;
if([[NSFileManager defaultManager] fileExistsAtPath:file isDirectory:&isDirectory] && !isDirectory){
- if ([WebCapabilities canShowFile:file]) {
+ if ([WebContentTypes canShowFile:file]) {
return [[NSURL fileURLWithPath:file] _web_canonicalize];
}
}
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 84c9a25..820f9d6 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -2,7 +2,7 @@
.objc_class_name_WebBookmark
.objc_class_name_WebBookmarkGroup
.objc_class_name_WebBookmarkImporter
-.objc_class_name_WebCapabilities
+.objc_class_name_WebContentTypes
.objc_class_name_WebController
.objc_class_name_WebCoreStatistics
.objc_class_name_WebDataSource
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index f325c6f..054d947 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -19,7 +19,7 @@
@class WebPreferences;
@class WebView;
- at interface WebCapabilities : NSObject
+ at interface WebContentTypes : NSObject
/*!
@method canShowMIMEType:
@abstract Checks if the WebKit can show content of a certain MIME type.
@@ -36,6 +36,14 @@
*/
+ (BOOL)canShowFile:(NSString *)path;
+/*!
+ @method suggestedFileExtensionForMIMEType:
+ @param MIMEType The MIME type to check.
+ @result The extension based on the MIME type
+*/
++ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType;
+
+
@end
// These strings are keys into the element dictionary provided in
@@ -296,6 +304,7 @@ extern NSString *WebElementLinkLabelKey; // NSString of the text within the anch
*/
- (NSString *)userAgentForURL:(NSURL *)URL;
+
/*!
@method supportsTextEncoding
@abstract Find out if the current web page supports text encodings.
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index 362bfaf..7ced2ab 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -30,6 +30,7 @@
#import <WebKit/WebWindowOperationsDelegate.h>
#import <WebFoundation/WebAssertions.h>
+#import <WebFoundation/WebFileTypeMappings.h>
#import <WebFoundation/WebNSUserDefaultsExtras.h>
#import <WebFoundation/WebResource.h>
@@ -54,7 +55,8 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
- at implementation WebCapabilities
+ at implementation WebContentTypes
+
+ (BOOL)canShowMIMEType:(NSString *)MIMEType
{
if([WebView _canShowMIMEType:MIMEType] && [WebDataSource _canShowMIMEType:MIMEType]){
@@ -76,6 +78,11 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
return [[self class] canShowMIMEType:MIMEType];
}
++ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)type
+{
+ return [[WebFileTypeMappings sharedMappings] preferredExtensionForMIMEType:type];
+}
+
@end
@implementation WebController
@@ -304,13 +311,51 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
return [[_private->userAgentOverride retain] autorelease];
}
+- (BOOL)supportsTextEncoding
+{
+ id documentView = [[[self mainFrame] webView] documentView];
+ return [documentView conformsToProtocol:@protocol(WebDocumentText)]
+ && [documentView supportsTextEncoding];
+}
+
+- (void)setCustomTextEncodingName:(NSString *)encoding
+{
+ NSString *oldEncoding = [self customTextEncodingName];
+ if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) {
+ return;
+ }
+ [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:encoding];
+}
+
+- (NSString *)_mainFrameOverrideEncoding
+{
+ WebDataSource *dataSource = [[self mainFrame] provisionalDataSource];
+ if (dataSource == nil) {
+ dataSource = [[self mainFrame] dataSource];
+ }
+ if (dataSource == nil) {
+ return nil;
+ }
+ return [dataSource _overrideEncoding];
+}
+
+- (NSString *)customTextEncodingName
+{
+ return [self _mainFrameOverrideEncoding];
+}
+
+- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
+{
+ return [[[self mainFrame] _bridge] stringByEvaluatingJavaScriptFromString:script];
+}
+
// Get the appropriate user-agent string for a particular URL.
- (NSString *)userAgentForURL:(NSURL *)URL
{
if (_private->userAgentOverride) {
return [[_private->userAgentOverride retain] autorelease];
}
-
+
// Look to see if we need to spoof.
// First step is to get the host as a C-format string.
UserAgentStringType type = Safari;
@@ -351,16 +396,16 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
}
}
}
-
+
NSString **userAgentStorage = &_private->userAgent[type];
NSString *userAgent = *userAgentStorage;
if (userAgent) {
return [[userAgent retain] autorelease];
}
-
- // FIXME: Some day we will start reporting the actual CPU here instead of hardcoding PPC.
+ // FIXME: Some day we will start reporting the actual CPU here instead of hardcoding PPC.
+
NSString *language = [NSUserDefaults _web_preferredLanguageCode];
id sourceVersion = [[NSBundle bundleForClass:[WebController class]]
objectForInfoDictionaryKey:(id)kCFBundleVersionKey];
@@ -395,47 +440,9 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
}
break;
}
-
+
*userAgentStorage = [userAgent retain];
return userAgent;
}
-- (BOOL)supportsTextEncoding
-{
- id documentView = [[[self mainFrame] webView] documentView];
- return [documentView conformsToProtocol:@protocol(WebDocumentText)]
- && [documentView supportsTextEncoding];
-}
-
-- (void)setCustomTextEncodingName:(NSString *)encoding
-{
- NSString *oldEncoding = [self customTextEncodingName];
- if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) {
- return;
- }
- [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:encoding];
-}
-
-- (NSString *)_mainFrameOverrideEncoding
-{
- WebDataSource *dataSource = [[self mainFrame] provisionalDataSource];
- if (dataSource == nil) {
- dataSource = [[self mainFrame] dataSource];
- }
- if (dataSource == nil) {
- return nil;
- }
- return [dataSource _overrideEncoding];
-}
-
-- (NSString *)customTextEncodingName
-{
- return [self _mainFrameOverrideEncoding];
-}
-
-- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
-{
- return [[[self mainFrame] _bridge] stringByEvaluatingJavaScriptFromString:script];
-}
-
@end
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.h b/WebKit/WebView.subproj/WebControllerPrivate.h
index c2d3cf5..488154c 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPrivate.h
@@ -55,13 +55,13 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
@interface WebController (WebPrivate)
/*!
- at method frameForDataSource:
- @abstract Return the frame associated with the data source.
- @discussion Traverses the frame tree to find the frame associated
- with a datasource.
- @param datasource The datasource to match against each frame.
- @result The frame that has the associated datasource.
- */
+ @method frameForDataSource:
+ @abstract Return the frame associated with the data source.
+ @discussion Traverses the frame tree to find the frame associated
+ with a datasource.
+ @param datasource The datasource to match against each frame.
+ @result The frame that has the associated datasource.
+*/
- (WebFrame *)_frameForDataSource: (WebDataSource *)dataSource;
/*!
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 2657484..68d967c 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -103,12 +103,6 @@
- (NSString *)pageTitle;
/*!
- @method fileExtension
- @result The extension based on the MIME type
-*/
-- (NSString *)fileExtension;
-
-/*!
@method mainDocumentError
@result Returns a WebError associated with the load of the main document, or nil if no error occurred.
*/
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index c861036..bf78202 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -132,11 +132,6 @@
return _private->pageTitle;
}
-- (NSString *)fileExtension
-{
- return [[WebFileTypeMappings sharedMappings] preferredExtensionForMIMEType:[[self response] contentType]];
-}
-
- (WebError *)mainDocumentError
{
return _private->mainDocumentError;
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index 4b40ee2..e290c1b 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -42,12 +42,12 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
if(isDirectory)
return WebPolicyIgnore;
- if([WebCapabilities canShowMIMEType:type])
+ if([WebContentTypes canShowMIMEType:type])
return WebPolicyShow;
return WebPolicyIgnore;
}
- if ([WebCapabilities canShowMIMEType:type]) {
+ if ([WebContentTypes canShowMIMEType:type]) {
return WebPolicyShow;
} else {
return WebPolicyIgnore;
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 9ee3901..612f198 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -162,7 +162,7 @@
switch (contentPolicy) {
case WebPolicyShow:
- if (![WebCapabilities canShowMIMEType:[r contentType]]) {
+ if (![WebContentTypes canShowMIMEType:[r contentType]]) {
[[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:[req URL]];
[self stopLoadingForPolicyChange];
return;
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 9ee3901..612f198 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -162,7 +162,7 @@
switch (contentPolicy) {
case WebPolicyShow:
- if (![WebCapabilities canShowMIMEType:[r contentType]]) {
+ if (![WebContentTypes canShowMIMEType:[r contentType]]) {
[[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:[req URL]];
[self stopLoadingForPolicyChange];
return;
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index f325c6f..054d947 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -19,7 +19,7 @@
@class WebPreferences;
@class WebView;
- at interface WebCapabilities : NSObject
+ at interface WebContentTypes : NSObject
/*!
@method canShowMIMEType:
@abstract Checks if the WebKit can show content of a certain MIME type.
@@ -36,6 +36,14 @@
*/
+ (BOOL)canShowFile:(NSString *)path;
+/*!
+ @method suggestedFileExtensionForMIMEType:
+ @param MIMEType The MIME type to check.
+ @result The extension based on the MIME type
+*/
++ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType;
+
+
@end
// These strings are keys into the element dictionary provided in
@@ -296,6 +304,7 @@ extern NSString *WebElementLinkLabelKey; // NSString of the text within the anch
*/
- (NSString *)userAgentForURL:(NSURL *)URL;
+
/*!
@method supportsTextEncoding
@abstract Find out if the current web page supports text encodings.
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 362bfaf..7ced2ab 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -30,6 +30,7 @@
#import <WebKit/WebWindowOperationsDelegate.h>
#import <WebFoundation/WebAssertions.h>
+#import <WebFoundation/WebFileTypeMappings.h>
#import <WebFoundation/WebNSUserDefaultsExtras.h>
#import <WebFoundation/WebResource.h>
@@ -54,7 +55,8 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
- at implementation WebCapabilities
+ at implementation WebContentTypes
+
+ (BOOL)canShowMIMEType:(NSString *)MIMEType
{
if([WebView _canShowMIMEType:MIMEType] && [WebDataSource _canShowMIMEType:MIMEType]){
@@ -76,6 +78,11 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
return [[self class] canShowMIMEType:MIMEType];
}
++ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)type
+{
+ return [[WebFileTypeMappings sharedMappings] preferredExtensionForMIMEType:type];
+}
+
@end
@implementation WebController
@@ -304,13 +311,51 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
return [[_private->userAgentOverride retain] autorelease];
}
+- (BOOL)supportsTextEncoding
+{
+ id documentView = [[[self mainFrame] webView] documentView];
+ return [documentView conformsToProtocol:@protocol(WebDocumentText)]
+ && [documentView supportsTextEncoding];
+}
+
+- (void)setCustomTextEncodingName:(NSString *)encoding
+{
+ NSString *oldEncoding = [self customTextEncodingName];
+ if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) {
+ return;
+ }
+ [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:encoding];
+}
+
+- (NSString *)_mainFrameOverrideEncoding
+{
+ WebDataSource *dataSource = [[self mainFrame] provisionalDataSource];
+ if (dataSource == nil) {
+ dataSource = [[self mainFrame] dataSource];
+ }
+ if (dataSource == nil) {
+ return nil;
+ }
+ return [dataSource _overrideEncoding];
+}
+
+- (NSString *)customTextEncodingName
+{
+ return [self _mainFrameOverrideEncoding];
+}
+
+- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
+{
+ return [[[self mainFrame] _bridge] stringByEvaluatingJavaScriptFromString:script];
+}
+
// Get the appropriate user-agent string for a particular URL.
- (NSString *)userAgentForURL:(NSURL *)URL
{
if (_private->userAgentOverride) {
return [[_private->userAgentOverride retain] autorelease];
}
-
+
// Look to see if we need to spoof.
// First step is to get the host as a C-format string.
UserAgentStringType type = Safari;
@@ -351,16 +396,16 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
}
}
}
-
+
NSString **userAgentStorage = &_private->userAgent[type];
NSString *userAgent = *userAgentStorage;
if (userAgent) {
return [[userAgent retain] autorelease];
}
-
- // FIXME: Some day we will start reporting the actual CPU here instead of hardcoding PPC.
+ // FIXME: Some day we will start reporting the actual CPU here instead of hardcoding PPC.
+
NSString *language = [NSUserDefaults _web_preferredLanguageCode];
id sourceVersion = [[NSBundle bundleForClass:[WebController class]]
objectForInfoDictionaryKey:(id)kCFBundleVersionKey];
@@ -395,47 +440,9 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
}
break;
}
-
+
*userAgentStorage = [userAgent retain];
return userAgent;
}
-- (BOOL)supportsTextEncoding
-{
- id documentView = [[[self mainFrame] webView] documentView];
- return [documentView conformsToProtocol:@protocol(WebDocumentText)]
- && [documentView supportsTextEncoding];
-}
-
-- (void)setCustomTextEncodingName:(NSString *)encoding
-{
- NSString *oldEncoding = [self customTextEncodingName];
- if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) {
- return;
- }
- [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:encoding];
-}
-
-- (NSString *)_mainFrameOverrideEncoding
-{
- WebDataSource *dataSource = [[self mainFrame] provisionalDataSource];
- if (dataSource == nil) {
- dataSource = [[self mainFrame] dataSource];
- }
- if (dataSource == nil) {
- return nil;
- }
- return [dataSource _overrideEncoding];
-}
-
-- (NSString *)customTextEncodingName
-{
- return [self _mainFrameOverrideEncoding];
-}
-
-- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
-{
- return [[[self mainFrame] _bridge] stringByEvaluatingJavaScriptFromString:script];
-}
-
@end
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index c2d3cf5..488154c 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -55,13 +55,13 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
@interface WebController (WebPrivate)
/*!
- at method frameForDataSource:
- @abstract Return the frame associated with the data source.
- @discussion Traverses the frame tree to find the frame associated
- with a datasource.
- @param datasource The datasource to match against each frame.
- @result The frame that has the associated datasource.
- */
+ @method frameForDataSource:
+ @abstract Return the frame associated with the data source.
+ @discussion Traverses the frame tree to find the frame associated
+ with a datasource.
+ @param datasource The datasource to match against each frame.
+ @result The frame that has the associated datasource.
+*/
- (WebFrame *)_frameForDataSource: (WebDataSource *)dataSource;
/*!
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list