[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 06:19:04 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 40b7563fbd116ea6cbb0ee25981da779e4a7331d
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jun 15 00:12:06 2002 +0000
WebBrowser:
Only allow source to be shown if HTML
* BrowserDocument.m:
(-[BrowserDocument _isDocumentHTML]): added
(-[BrowserDocument validateUserInterfaceItem:]):
(-[BrowserDocument viewSource:]):
WebKit:
* WebView.subproj/IFMainURLHandleClient.mm:
(-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]):
If content type is the default type and there is no extension, assume HTML.
(-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
* WebView.subproj/IFWebDataSource.h:
* WebView.subproj/IFWebDataSource.mm:
Made isDocumentHTML public. Changed where needed.
(-[IFWebDataSource isDocumentHTML]):
(-[IFWebDataSource documentSource]):
(-[IFWebDataSource documentTextFromDOM]):
* WebView.subproj/IFWebDataSourcePrivate.h:
* WebView.subproj/IFWebDataSourcePrivate.mm:
(-[IFWebDataSource _stopLoading]):
(-[IFWebDataSource _addError:forResource:]):
* WebView.subproj/IFWebFramePrivate.mm:
(-[IFWebFrame _isLoadComplete]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 33ce8cf..ef13f2a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2002-06-14 Chris Blumenberg <cblu at apple.com>
+
+ * WebView.subproj/IFMainURLHandleClient.mm:
+ (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]):
+ If content type is the default type and there is no extension, assume HTML.
+
+ (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
+ * WebView.subproj/IFWebDataSource.h:
+ * WebView.subproj/IFWebDataSource.mm: Made isDocumentHTML public
+ (-[IFWebDataSource isDocumentHTML]):
+ (-[IFWebDataSource documentSource]):
+ (-[IFWebDataSource documentTextFromDOM]):
+ * WebView.subproj/IFWebDataSourcePrivate.h:
+ * WebView.subproj/IFWebDataSourcePrivate.mm:
+ (-[IFWebDataSource _stopLoading]):
+ (-[IFWebDataSource _addError:forResource:]):
+ * WebView.subproj/IFWebFramePrivate.mm:
+ (-[IFWebFrame _isLoadComplete]):
+
2002-06-14 Darin Adler <darin at apple.com>
* Panels.subproj/IFStandardPanels.m: Fix what I broke last time.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 33ce8cf..ef13f2a 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,22 @@
+2002-06-14 Chris Blumenberg <cblu at apple.com>
+
+ * WebView.subproj/IFMainURLHandleClient.mm:
+ (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]):
+ If content type is the default type and there is no extension, assume HTML.
+
+ (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
+ * WebView.subproj/IFWebDataSource.h:
+ * WebView.subproj/IFWebDataSource.mm: Made isDocumentHTML public
+ (-[IFWebDataSource isDocumentHTML]):
+ (-[IFWebDataSource documentSource]):
+ (-[IFWebDataSource documentTextFromDOM]):
+ * WebView.subproj/IFWebDataSourcePrivate.h:
+ * WebView.subproj/IFWebDataSourcePrivate.mm:
+ (-[IFWebDataSource _stopLoading]):
+ (-[IFWebDataSource _addError:forResource:]):
+ * WebView.subproj/IFWebFramePrivate.mm:
+ (-[IFWebFrame _isLoadComplete]):
+
2002-06-14 Darin Adler <darin at apple.com>
* Panels.subproj/IFStandardPanels.m: Fix what I broke last time.
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.mm b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
index f8fb25c..55ec0ee 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.mm
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
@@ -22,7 +22,7 @@
#import <KWQKHTMLPartImpl.h>
#import <WebFoundation/IFError.h>
-
+#import <WebFoundation/IFFileTypeMappings.h>
@implementation IFMainURLHandleClient
@@ -128,7 +128,12 @@
// Check the mime type and ask the client for the content policy.
if(isFirstChunk){
+ // Make assumption here that if the contentType is the default
+ // and there is no extension, this is text/html
+ if([contentType isEqualToString:IFDefaultMIMEType] && [[[url path] pathExtension] isEqualToString:@""])
+ contentType = @"text/html";
WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
+
[dataSource _setContentType:contentType];
[dataSource _setEncoding:[sender characterSet]];
[[dataSource _locationChangeHandler] requestContentPolicyForMIMEType:contentType];
@@ -222,7 +227,7 @@
url = newURL;
[(IFWebController *)[dataSource controller] _didStartLoading:url];
- if([dataSource _isDocumentHTML])
+ if([dataSource isDocumentHTML])
[[dataSource representation] part]->impl->setBaseURL([[url absoluteString] cString]);
[dataSource _setFinalURL:url];
diff --git a/WebKit/WebView.subproj/IFWebDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
index 367e1d4..ca53666 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -124,13 +124,14 @@
- (IFDOMDocument *)document;
#endif
+- (BOOL)isDocumentHTML;
// Get the source of the document by reconstructing it from the DOM.
- (NSString *)documentTextFromDOM;
// Get the actual source of the document.
-- (NSString *)documentText;
+- (NSString *)documentSource;
// URL reference point, these should probably not be public for 1.0.
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 523dd04..6c160d7 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -239,18 +239,26 @@
- (IFDOMDocument *)document;
#endif
+- (BOOL)isDocumentHTML
+{
+ return [[[self representation] className] isEqualToString:@"IFHTMLRepresentation"];
+}
// Get the actual source of the docment.
-- (NSString *)documentText
+// FIXME: Move to IFHTMLRepresentation
+- (NSString *)documentSource
{
// FIMXE: other encodings
- return [[[NSString alloc] initWithData:[self data] encoding:NSASCIIStringEncoding] autorelease];
+ if([self isDocumentHTML]){
+ return [[[NSString alloc] initWithData:[self data] encoding:NSASCIIStringEncoding] autorelease];
+ }
+ return nil;
}
// FIXME: Move to representation
- (NSString *)documentTextFromDOM
{
- if([self _isDocumentHTML]){
+ if([self isDocumentHTML]){
DOM::DocumentImpl *doc;
NSString *string = nil;
KHTMLPart *part = [[self representation] part];
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index 53efdb0..56fd24c 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -98,7 +98,6 @@
- (void)_clearErrors;
- (void)_setMainDocumentError: (IFError *)error;
- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription;
-- (BOOL)_isDocumentHTML;
+ (NSMutableDictionary *)_repTypes;
+ (BOOL)_canShowMIMEType:(NSString *)MIMEType;
@end
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
index c38b994..ee8b00c 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -209,7 +209,7 @@ static NSMutableDictionary *_repTypes=nil;
[[_private->urlHandles objectAtIndex: i] cancelLoadInBackground];
}
- if ([self _isDocumentHTML])
+ if ([self isDocumentHTML])
[[self representation] part]->closeURL();
}
@@ -356,11 +356,6 @@ static NSMutableDictionary *_repTypes=nil;
[_private->errors setObject: error forKey: resourceDescription];
}
-- (BOOL)_isDocumentHTML
-{
- return [[[self representation] className] isEqualToString:@"IFHTMLRepresentation"];
-}
-
+ (NSMutableDictionary *)_repTypes
{
if(!_repTypes){
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index 019c9c5..dbe458e 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -348,7 +348,7 @@ static const char * const stateNames[6] = {
[self _setState: IFWEBFRAMESTATE_COMPLETE];
- if([ds _isDocumentHTML])
+ if([ds isDocumentHTML])
[[ds representation] part]->end();
// We have to layout the main document as
@@ -366,7 +366,7 @@ static const char * const stateNames[6] = {
[[thisView documentView] layout];
// Jump to anchor point, if necessary.
- if ([ds _isDocumentHTML])
+ if ([ds isDocumentHTML])
[[ds representation] part]->impl->gotoBaseAnchor();
// FIXME: We have to draw the whole document hierarchy. We should be
@@ -380,7 +380,7 @@ static const char * const stateNames[6] = {
[[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError]];
- //if ([ds _isDocumentHTML])
+ //if ([ds isDocumentHTML])
// [[ds representation] part]->closeURL();
return;
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 367e1d4..ca53666 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -124,13 +124,14 @@
- (IFDOMDocument *)document;
#endif
+- (BOOL)isDocumentHTML;
// Get the source of the document by reconstructing it from the DOM.
- (NSString *)documentTextFromDOM;
// Get the actual source of the document.
-- (NSString *)documentText;
+- (NSString *)documentSource;
// URL reference point, these should probably not be public for 1.0.
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 523dd04..6c160d7 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -239,18 +239,26 @@
- (IFDOMDocument *)document;
#endif
+- (BOOL)isDocumentHTML
+{
+ return [[[self representation] className] isEqualToString:@"IFHTMLRepresentation"];
+}
// Get the actual source of the docment.
-- (NSString *)documentText
+// FIXME: Move to IFHTMLRepresentation
+- (NSString *)documentSource
{
// FIMXE: other encodings
- return [[[NSString alloc] initWithData:[self data] encoding:NSASCIIStringEncoding] autorelease];
+ if([self isDocumentHTML]){
+ return [[[NSString alloc] initWithData:[self data] encoding:NSASCIIStringEncoding] autorelease];
+ }
+ return nil;
}
// FIXME: Move to representation
- (NSString *)documentTextFromDOM
{
- if([self _isDocumentHTML]){
+ if([self isDocumentHTML]){
DOM::DocumentImpl *doc;
NSString *string = nil;
KHTMLPart *part = [[self representation] part];
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 53efdb0..56fd24c 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -98,7 +98,6 @@
- (void)_clearErrors;
- (void)_setMainDocumentError: (IFError *)error;
- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription;
-- (BOOL)_isDocumentHTML;
+ (NSMutableDictionary *)_repTypes;
+ (BOOL)_canShowMIMEType:(NSString *)MIMEType;
@end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index c38b994..ee8b00c 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -209,7 +209,7 @@ static NSMutableDictionary *_repTypes=nil;
[[_private->urlHandles objectAtIndex: i] cancelLoadInBackground];
}
- if ([self _isDocumentHTML])
+ if ([self isDocumentHTML])
[[self representation] part]->closeURL();
}
@@ -356,11 +356,6 @@ static NSMutableDictionary *_repTypes=nil;
[_private->errors setObject: error forKey: resourceDescription];
}
-- (BOOL)_isDocumentHTML
-{
- return [[[self representation] className] isEqualToString:@"IFHTMLRepresentation"];
-}
-
+ (NSMutableDictionary *)_repTypes
{
if(!_repTypes){
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 019c9c5..dbe458e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -348,7 +348,7 @@ static const char * const stateNames[6] = {
[self _setState: IFWEBFRAMESTATE_COMPLETE];
- if([ds _isDocumentHTML])
+ if([ds isDocumentHTML])
[[ds representation] part]->end();
// We have to layout the main document as
@@ -366,7 +366,7 @@ static const char * const stateNames[6] = {
[[thisView documentView] layout];
// Jump to anchor point, if necessary.
- if ([ds _isDocumentHTML])
+ if ([ds isDocumentHTML])
[[ds representation] part]->impl->gotoBaseAnchor();
// FIXME: We have to draw the whole document hierarchy. We should be
@@ -380,7 +380,7 @@ static const char * const stateNames[6] = {
[[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError]];
- //if ([ds _isDocumentHTML])
+ //if ([ds isDocumentHTML])
// [[ds representation] part]->closeURL();
return;
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index f8fb25c..55ec0ee 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -22,7 +22,7 @@
#import <KWQKHTMLPartImpl.h>
#import <WebFoundation/IFError.h>
-
+#import <WebFoundation/IFFileTypeMappings.h>
@implementation IFMainURLHandleClient
@@ -128,7 +128,12 @@
// Check the mime type and ask the client for the content policy.
if(isFirstChunk){
+ // Make assumption here that if the contentType is the default
+ // and there is no extension, this is text/html
+ if([contentType isEqualToString:IFDefaultMIMEType] && [[[url path] pathExtension] isEqualToString:@""])
+ contentType = @"text/html";
WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
+
[dataSource _setContentType:contentType];
[dataSource _setEncoding:[sender characterSet]];
[[dataSource _locationChangeHandler] requestContentPolicyForMIMEType:contentType];
@@ -222,7 +227,7 @@
url = newURL;
[(IFWebController *)[dataSource controller] _didStartLoading:url];
- if([dataSource _isDocumentHTML])
+ if([dataSource isDocumentHTML])
[[dataSource representation] part]->impl->setBaseURL([[url absoluteString] cString]);
[dataSource _setFinalURL:url];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index f8fb25c..55ec0ee 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -22,7 +22,7 @@
#import <KWQKHTMLPartImpl.h>
#import <WebFoundation/IFError.h>
-
+#import <WebFoundation/IFFileTypeMappings.h>
@implementation IFMainURLHandleClient
@@ -128,7 +128,12 @@
// Check the mime type and ask the client for the content policy.
if(isFirstChunk){
+ // Make assumption here that if the contentType is the default
+ // and there is no extension, this is text/html
+ if([contentType isEqualToString:IFDefaultMIMEType] && [[[url path] pathExtension] isEqualToString:@""])
+ contentType = @"text/html";
WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
+
[dataSource _setContentType:contentType];
[dataSource _setEncoding:[sender characterSet]];
[[dataSource _locationChangeHandler] requestContentPolicyForMIMEType:contentType];
@@ -222,7 +227,7 @@
url = newURL;
[(IFWebController *)[dataSource controller] _didStartLoading:url];
- if([dataSource _isDocumentHTML])
+ if([dataSource isDocumentHTML])
[[dataSource representation] part]->impl->setBaseURL([[url absoluteString] cString]);
[dataSource _setFinalURL:url];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list