[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:17:14 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 3f843e6ae5b53c71fd7ed1411df5ff2c076ec2bd
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jun 6 15:18:45 2002 +0000
* MIME.subproj/IFContentHandler.m:
(-[IFContentHandler initWithURL:MIMEType:MIMEHandlerType:]): Add call to
[super init].
(-[IFContentHandler useTemplate:withGlobal:]): New helper function.
Also got rid of <title> from templates, since there's no need for us to
provide a fake title if it's just the URL.
(-[IFContentHandler HTMLDocument]): Reduce use of copied and pasted code.
(-[IFContentHandler dealloc]): Add call to [super dealloc].
* Resources/image_document_template.html: Remove <title>.
* Resources/plugin_document_template.html: Remove <title>.
* Resources/text_document_template.html: Remove <title>.
* WebView.subproj/IFMainURLHandleClient.mm:
(-[IFMainURLHandleClient processData:isComplete:allDataReceived:]):
Remove some unneeded type casts.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5208dba..223065a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2002-06-06 Darin Adler <darin at apple.com>
+
+ * MIME.subproj/IFContentHandler.m:
+ (-[IFContentHandler initWithURL:MIMEType:MIMEHandlerType:]): Add call to
+ [super init].
+ (-[IFContentHandler useTemplate:withGlobal:]): New helper function.
+ Also got rid of <title> from templates, since there's no need for us to
+ provide a fake title if it's just the URL.
+ (-[IFContentHandler HTMLDocument]): Reduce use of copied and pasted code.
+ (-[IFContentHandler dealloc]): Add call to [super dealloc].
+
+ * Resources/image_document_template.html: Remove <title>.
+ * Resources/plugin_document_template.html: Remove <title>.
+ * Resources/text_document_template.html: Remove <title>.
+
+ * WebView.subproj/IFMainURLHandleClient.mm:
+ (-[IFMainURLHandleClient processData:isComplete:allDataReceived:]):
+ Remove some unneeded type casts.
+
2002-06-05 Maciej Stachowiak <mjs at apple.com>
Fixed Radar 2936155 - crash in IFAuthenticationPanel
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 5208dba..223065a 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,22 @@
+2002-06-06 Darin Adler <darin at apple.com>
+
+ * MIME.subproj/IFContentHandler.m:
+ (-[IFContentHandler initWithURL:MIMEType:MIMEHandlerType:]): Add call to
+ [super init].
+ (-[IFContentHandler useTemplate:withGlobal:]): New helper function.
+ Also got rid of <title> from templates, since there's no need for us to
+ provide a fake title if it's just the URL.
+ (-[IFContentHandler HTMLDocument]): Reduce use of copied and pasted code.
+ (-[IFContentHandler dealloc]): Add call to [super dealloc].
+
+ * Resources/image_document_template.html: Remove <title>.
+ * Resources/plugin_document_template.html: Remove <title>.
+ * Resources/text_document_template.html: Remove <title>.
+
+ * WebView.subproj/IFMainURLHandleClient.mm:
+ (-[IFMainURLHandleClient processData:isComplete:allDataReceived:]):
+ Remove some unneeded type casts.
+
2002-06-05 Maciej Stachowiak <mjs at apple.com>
Fixed Radar 2936155 - crash in IFAuthenticationPanel
diff --git a/WebKit/MIME.subproj/IFContentHandler.m b/WebKit/MIME.subproj/IFContentHandler.m
index ff90576..ca7e859 100644
--- a/WebKit/MIME.subproj/IFContentHandler.m
+++ b/WebKit/MIME.subproj/IFContentHandler.m
@@ -9,14 +9,12 @@ static NSString *imageDocumentTemplate = nil;
static NSString *pluginDocumentTemplate = nil;
static NSString *textDocumentTemplate = nil;
-static BOOL imageDocumentLoaded = NO;
-static BOOL pluginDocumentLoaded = NO;
-static BOOL textDocumentLoaded = NO;
-
@implementation IFContentHandler
- initWithURL:(NSURL *)URL MIMEType:(NSString *)theMIMEType MIMEHandlerType:(IFMIMEHandlerType)theMIMEHandlerType;
{
+ [super init];
+
handlerType = theMIMEHandlerType;
MIMEType = [theMIMEType retain];
URLString = [[URL absoluteString] retain];
@@ -24,55 +22,35 @@ static BOOL textDocumentLoaded = NO;
return self;
}
-- (NSString *) HTMLDocument
+- (NSString *)useTemplate:(NSString *)templateName withGlobal:(NSString **)global
{
- NSString *path;
NSBundle *bundle;
+ NSString *path;
NSData *data;
- if(handlerType == IFMIMEHANDLERTYPE_IMAGE){
- if(!imageDocumentLoaded){
- bundle = [NSBundle bundleForClass:[IFContentHandler class]];
- if ((path = [bundle pathForResource:@"image_document_template" ofType:@"html"])) {
- data = [[NSData alloc] initWithContentsOfFile:path];
- if (data) {
- imageDocumentTemplate = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
- [data release];
- }
+ if (!*global) {
+ bundle = [NSBundle bundleForClass:[IFContentHandler class]];
+ path = [bundle pathForResource:templateName ofType:@"html"];
+ if (path) {
+ data = [[NSData alloc] initWithContentsOfFile:path];
+ if (data) {
+ *global = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
+ [data release];
}
- imageDocumentLoaded = YES;
- }
- return [NSString stringWithFormat:imageDocumentTemplate, URLString, URLString];
- }
-
- else if(handlerType == IFMIMEHANDLERTYPE_PLUGIN){
- if(!pluginDocumentLoaded){
- bundle = [NSBundle bundleForClass:[IFContentHandler class]];
- if ((path = [bundle pathForResource:@"plugin_document_template" ofType:@"html"])) {
- data = [[NSData alloc] initWithContentsOfFile:path];
- if (data) {
- pluginDocumentTemplate = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
- [data release];
- }
- }
- pluginDocumentLoaded = YES;
}
- return [NSString stringWithFormat:pluginDocumentTemplate, URLString, URLString, MIMEType, @"%", @"%"];
}
+ return [NSString stringWithFormat:*global, URLString, MIMEType];
+}
- else if(handlerType == IFMIMEHANDLERTYPE_TEXT){
- if(!textDocumentLoaded){
- bundle = [NSBundle bundleForClass:[IFContentHandler class]];
- if ((path = [bundle pathForResource:@"text_document_template" ofType:@"html"])) {
- data = [[NSData alloc] initWithContentsOfFile:path];
- if (data) {
- textDocumentTemplate = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
- [data release];
- }
- }
- textDocumentLoaded = YES;
- }
- return [NSString stringWithFormat:textDocumentTemplate, URLString];
+- (NSString *) HTMLDocument
+{
+ switch (handlerType) {
+ case IFMIMEHANDLERTYPE_IMAGE:
+ return [self useTemplate:@"image_document_template" withGlobal:&imageDocumentTemplate];
+ case IFMIMEHANDLERTYPE_PLUGIN:
+ return [self useTemplate:@"plugin_document_template" withGlobal:&pluginDocumentTemplate];
+ case IFMIMEHANDLERTYPE_TEXT:
+ return [self useTemplate:@"text_document_template" withGlobal:&textDocumentTemplate];
}
return nil;
}
@@ -86,5 +64,7 @@ static BOOL textDocumentLoaded = NO;
{
[MIMEType release];
[URLString release];
+ [super dealloc];
}
+
@end
diff --git a/WebKit/Resources/image_document_template.html b/WebKit/Resources/image_document_template.html
index e0a4099..5b3c29b 100644
--- a/WebKit/Resources/image_document_template.html
+++ b/WebKit/Resources/image_document_template.html
@@ -1,20 +1,9 @@
<html>
<head>
<style type="text/css">
- at media print {
- body {
- display: block;
- margin: 2cm;
- }
-}
- at media screen {
- body {
- display: block;
- margin: 0px;
- }
-}
+ at media print { body { display: block; margin: 2cm; } }
+ at media screen { body { display: block; margin: 0px; } }
</style>
-<title>%@</title>
</head>
<body><img src="%@"></body>
-</html>
\ No newline at end of file
+</html>
diff --git a/WebKit/Resources/plugin_document_template.html b/WebKit/Resources/plugin_document_template.html
index faa70b7..26c4389 100644
--- a/WebKit/Resources/plugin_document_template.html
+++ b/WebKit/Resources/plugin_document_template.html
@@ -1,22 +1,9 @@
<html>
<head>
<style type="text/css">
- at media print {
- body {
- display: block;
- margin: 2cm;
- }
-}
- at media screen {
- body {
- display: block;
- margin: 0px;
- }
-}
+ at media print { body { display: block; margin: 2cm; } }
+ at media screen { body { display: block; margin: 0px; } }
</style>
-<title>%@</title>
</head>
-<body>
-<center><embed src="%@" type="%@" width=100%@ height=100%@ wkfullmode></center>
-</body>
-</html>
\ No newline at end of file
+<body><center><embed src="%@" type="%@" width=100%% height=100%% wkfullmode></center></body>
+</html>
diff --git a/WebKit/Resources/text_document_template.html b/WebKit/Resources/text_document_template.html
index 7db088e..360473f 100644
--- a/WebKit/Resources/text_document_template.html
+++ b/WebKit/Resources/text_document_template.html
@@ -1,6 +1,3 @@
<html>
-<head>
-<title>%@</title>
-</head>
<body>
<pre>
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.mm b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
index 11d1a3c..e9ffe0c 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.mm
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
@@ -221,7 +221,7 @@
contentHandler = [[IFContentHandler alloc] initWithURL:url MIMEType:MIMEType MIMEHandlerType:handlerType];
fakeHTMLDocument = [contentHandler HTMLDocument];
fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
- part->impl->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), allDataReceived);
+ part->impl->slotData(encoding, fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), allDataReceived);
[contentHandler release];
sentFakeDocForNonHTMLContentType = YES;
}
@@ -263,7 +263,7 @@
contentHandler = [[IFContentHandler alloc] initWithURL:url MIMEType:MIMEType MIMEHandlerType:IFMIMEHANDLERTYPE_TEXT];
fakeHTMLDocument = [contentHandler textHTMLDocumentBottom];
fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
- part->impl->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), YES);
+ part->impl->slotData(encoding, fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), YES);
[contentHandler release];
}
}
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 11d1a3c..e9ffe0c 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -221,7 +221,7 @@
contentHandler = [[IFContentHandler alloc] initWithURL:url MIMEType:MIMEType MIMEHandlerType:handlerType];
fakeHTMLDocument = [contentHandler HTMLDocument];
fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
- part->impl->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), allDataReceived);
+ part->impl->slotData(encoding, fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), allDataReceived);
[contentHandler release];
sentFakeDocForNonHTMLContentType = YES;
}
@@ -263,7 +263,7 @@
contentHandler = [[IFContentHandler alloc] initWithURL:url MIMEType:MIMEType MIMEHandlerType:IFMIMEHANDLERTYPE_TEXT];
fakeHTMLDocument = [contentHandler textHTMLDocumentBottom];
fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
- part->impl->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), YES);
+ part->impl->slotData(encoding, fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), YES);
[contentHandler release];
}
}
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 11d1a3c..e9ffe0c 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -221,7 +221,7 @@
contentHandler = [[IFContentHandler alloc] initWithURL:url MIMEType:MIMEType MIMEHandlerType:handlerType];
fakeHTMLDocument = [contentHandler HTMLDocument];
fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
- part->impl->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), allDataReceived);
+ part->impl->slotData(encoding, fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), allDataReceived);
[contentHandler release];
sentFakeDocForNonHTMLContentType = YES;
}
@@ -263,7 +263,7 @@
contentHandler = [[IFContentHandler alloc] initWithURL:url MIMEType:MIMEType MIMEHandlerType:IFMIMEHANDLERTYPE_TEXT];
fakeHTMLDocument = [contentHandler textHTMLDocumentBottom];
fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
- part->impl->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), YES);
+ part->impl->slotData(encoding, fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes), YES);
[contentHandler release];
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list