[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:18:41 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 70988158d8b0533766bd6ee9d3c4107b10a095b0
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jun 14 18:22:41 2002 +0000

            Enabled displaying of text, images and RTF
            Fixed drag & drop
            Committing Richard's changes to KWQPainter
            Upated types that Alex can open.
            Uncommented textFromDOM call.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 7d0993e..8d03378 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,7 @@
+2002-06-14  Chris Blumenberg  <cblu at apple.com>
+
+	Committing Richard's changes to KWQPainter
+
 2002-06-13  Richard Williamson  <rjw at apple.com>
 
     More cleanup to deal with special case of provisional view
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 7d0993e..8d03378 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,7 @@
+2002-06-14  Chris Blumenberg  <cblu at apple.com>
+
+	Committing Richard's changes to KWQPainter
+
 2002-06-13  Richard Williamson  <rjw at apple.com>
 
     More cleanup to deal with special case of provisional view
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7d0993e..8d03378 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,7 @@
+2002-06-14  Chris Blumenberg  <cblu at apple.com>
+
+	Committing Richard's changes to KWQPainter
+
 2002-06-13  Richard Williamson  <rjw at apple.com>
 
     More cleanup to deal with special case of provisional view
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 36674fd..f203033 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -420,11 +420,6 @@ void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
         NSRect ir = NSMakeRect(x, y, sw, sh);
         NSRect fr = NSMakeRect(sx, sy, sw, sh);
         
-		[imageRenderer drawInRect: ir 
-				fromRect: fr
-				operation: NSCompositeSourceOver	// Renders transparency correctly
-				fraction: 1.0];
-				
 		[imageRenderer beginAnimationInView: [NSView focusView]
 		                    inRect: ir
 		                    fromRect: fr];
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 6eb4a22..4bc9592 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,9 @@
+2002-06-14  Chris Blumenberg  <cblu at apple.com>
+
+	Enabled displaying of text, images and RTF
+	Fixed drag & drop
+
+
 2002-06-13  John Sullivan  <sullivan at apple.com>
 
 	Various changes to better support the pasteboard.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 6eb4a22..4bc9592 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,9 @@
+2002-06-14  Chris Blumenberg  <cblu at apple.com>
+
+	Enabled displaying of text, images and RTF
+	Fixed drag & drop
+
+
 2002-06-13  John Sullivan  <sullivan at apple.com>
 
 	Various changes to better support the pasteboard.
diff --git a/WebKit/Misc.subproj/IFDownloadHandler.h b/WebKit/Misc.subproj/IFDownloadHandler.h
index ad2a839..b1237ee 100644
--- a/WebKit/Misc.subproj/IFDownloadHandler.h
+++ b/WebKit/Misc.subproj/IFDownloadHandler.h
@@ -15,6 +15,7 @@
 }
 
 - initWithDataSource:(IFWebDataSource *)dSource;
-- (void)receivedData:(NSData *)data isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data;
+- (void)finishedLoading;
 - (void)cancel;
 @end
diff --git a/WebKit/Misc.subproj/IFDownloadHandler.mm b/WebKit/Misc.subproj/IFDownloadHandler.mm
index 5dec18d..72b51ac 100644
--- a/WebKit/Misc.subproj/IFDownloadHandler.mm
+++ b/WebKit/Misc.subproj/IFDownloadHandler.mm
@@ -25,7 +25,7 @@
     [dataSource release];
 }
 
-- (void)receivedData:(NSData *)data isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data
 {
     NSString *path = [dataSource downloadPath];
     NSFileManager *fileManager;
@@ -43,18 +43,21 @@
     }
     
     [fileHandle writeData:data];
+}
+
+- (void)finishedLoading
+{
+    NSString *path = [dataSource downloadPath];
+    NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
+    
+    [fileHandle closeFile];
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Download complete. Saved to: %s", [path cString]);
     
-    if(isComplete){
+    workspace = [NSWorkspace sharedWorkspace];
+    [workspace noteFileSystemChanged:path];
     
-        [fileHandle closeFile];
-        WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Download complete. Saved to: %s", [path cString]);
-        
-        workspace = [NSWorkspace sharedWorkspace];
-        [workspace noteFileSystemChanged:path];
-        
-        if([dataSource contentPolicy] == IFContentPolicyOpenExternally){
-            [workspace openFile:path];
-        }
+    if([dataSource contentPolicy] == IFContentPolicyOpenExternally){
+        [workspace openFile:path];
     }
 }
 
diff --git a/WebKit/Misc.subproj/WebDownloadHandler.h b/WebKit/Misc.subproj/WebDownloadHandler.h
index ad2a839..b1237ee 100644
--- a/WebKit/Misc.subproj/WebDownloadHandler.h
+++ b/WebKit/Misc.subproj/WebDownloadHandler.h
@@ -15,6 +15,7 @@
 }
 
 - initWithDataSource:(IFWebDataSource *)dSource;
-- (void)receivedData:(NSData *)data isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data;
+- (void)finishedLoading;
 - (void)cancel;
 @end
diff --git a/WebKit/Misc.subproj/WebDownloadHandler.m b/WebKit/Misc.subproj/WebDownloadHandler.m
index 5dec18d..72b51ac 100644
--- a/WebKit/Misc.subproj/WebDownloadHandler.m
+++ b/WebKit/Misc.subproj/WebDownloadHandler.m
@@ -25,7 +25,7 @@
     [dataSource release];
 }
 
-- (void)receivedData:(NSData *)data isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data
 {
     NSString *path = [dataSource downloadPath];
     NSFileManager *fileManager;
@@ -43,18 +43,21 @@
     }
     
     [fileHandle writeData:data];
+}
+
+- (void)finishedLoading
+{
+    NSString *path = [dataSource downloadPath];
+    NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
+    
+    [fileHandle closeFile];
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Download complete. Saved to: %s", [path cString]);
     
-    if(isComplete){
+    workspace = [NSWorkspace sharedWorkspace];
+    [workspace noteFileSystemChanged:path];
     
-        [fileHandle closeFile];
-        WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Download complete. Saved to: %s", [path cString]);
-        
-        workspace = [NSWorkspace sharedWorkspace];
-        [workspace noteFileSystemChanged:path];
-        
-        if([dataSource contentPolicy] == IFContentPolicyOpenExternally){
-            [workspace openFile:path];
-        }
+    if([dataSource contentPolicy] == IFContentPolicyOpenExternally){
+        [workspace openFile:path];
     }
 }
 
diff --git a/WebKit/WebCoreSupport.subproj/IFImageRenderer.m b/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
index 8a070ee..4e06499 100644
--- a/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
@@ -146,6 +146,11 @@
                                                      userInfo:nil
                                                       repeats:NO] retain];
     }
+
+    [self drawInRect: ir 
+                    fromRect: fr
+                    operation: NSCompositeSourceOver	// Renders transparency correctly
+                    fraction: 1.0];
 }
 
 - (void)stopAnimation
diff --git a/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m b/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m
index bb93f8e..ce0cb61 100644
--- a/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m
@@ -51,6 +51,7 @@
     [imageRenderer addRepresentation: rep];
     [imageRenderer setFlipped: YES];
 #endif
+    [imageRenderer setScalesWhenResized: NO];
     return [imageRenderer autorelease];
 }
 
@@ -61,6 +62,7 @@
     //NSData *data = [[NSData alloc] initWithBytesNoCopy: (void *)bytes length: length freeWhenDone: NO];
     NSData *data = [[NSData alloc] initWithBytes: (void *)bytes length: length];
     IFImageRenderer *imageRenderer = [[IFImageRenderer alloc] initWithData: data];
+    [imageRenderer setScalesWhenResized: NO];
     NSArray *reps = [imageRenderer representations];
     NSImageRep *rep = [reps objectAtIndex: 0];
     // Force the image to use the pixel size and ignore the dpi.
@@ -72,7 +74,9 @@
 
 - (id <WebCoreImageRenderer>)imageRendererWithSize: (NSSize)s
 {
-    return [[[IFImageRenderer alloc] initWithSize: s] autorelease];
+    IFImageRenderer *imageRenderer = [[[IFImageRenderer alloc] initWithSize: s] autorelease];
+    [imageRenderer setScalesWhenResized: NO];
+    return imageRenderer;
 }
 
 
diff --git a/WebKit/WebCoreSupport.subproj/IFWebCoreViewFactory.m b/WebKit/WebCoreSupport.subproj/IFWebCoreViewFactory.m
index c5ff6c8..063bb72 100644
--- a/WebKit/WebCoreSupport.subproj/IFWebCoreViewFactory.m
+++ b/WebKit/WebCoreSupport.subproj/IFWebCoreViewFactory.m
@@ -29,7 +29,7 @@
     NSRange r1, r2, r3;
     IFPlugin *plugin;
     uint i;
-    
+        
     arguments = [NSMutableDictionary dictionary];
     for (i = 0; i < [args count]; i++){
         NSString *arg = [args objectAtIndex:i];
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
index 8a070ee..4e06499 100644
--- a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
@@ -146,6 +146,11 @@
                                                      userInfo:nil
                                                       repeats:NO] retain];
     }
+
+    [self drawInRect: ir 
+                    fromRect: fr
+                    operation: NSCompositeSourceOver	// Renders transparency correctly
+                    fraction: 1.0];
 }
 
 - (void)stopAnimation
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m b/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
index bb93f8e..ce0cb61 100644
--- a/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
@@ -51,6 +51,7 @@
     [imageRenderer addRepresentation: rep];
     [imageRenderer setFlipped: YES];
 #endif
+    [imageRenderer setScalesWhenResized: NO];
     return [imageRenderer autorelease];
 }
 
@@ -61,6 +62,7 @@
     //NSData *data = [[NSData alloc] initWithBytesNoCopy: (void *)bytes length: length freeWhenDone: NO];
     NSData *data = [[NSData alloc] initWithBytes: (void *)bytes length: length];
     IFImageRenderer *imageRenderer = [[IFImageRenderer alloc] initWithData: data];
+    [imageRenderer setScalesWhenResized: NO];
     NSArray *reps = [imageRenderer representations];
     NSImageRep *rep = [reps objectAtIndex: 0];
     // Force the image to use the pixel size and ignore the dpi.
@@ -72,7 +74,9 @@
 
 - (id <WebCoreImageRenderer>)imageRendererWithSize: (NSSize)s
 {
-    return [[[IFImageRenderer alloc] initWithSize: s] autorelease];
+    IFImageRenderer *imageRenderer = [[[IFImageRenderer alloc] initWithSize: s] autorelease];
+    [imageRenderer setScalesWhenResized: NO];
+    return imageRenderer;
 }
 
 
diff --git a/WebKit/WebCoreSupport.subproj/WebViewFactory.m b/WebKit/WebCoreSupport.subproj/WebViewFactory.m
index c5ff6c8..063bb72 100644
--- a/WebKit/WebCoreSupport.subproj/WebViewFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebViewFactory.m
@@ -29,7 +29,7 @@
     NSRange r1, r2, r3;
     IFPlugin *plugin;
     uint i;
-    
+        
     arguments = [NSMutableDictionary dictionary];
     for (i = 0; i < [args count]; i++){
         NSString *arg = [args objectAtIndex:i];
diff --git a/WebKit/WebView.subproj/IFDocument.h b/WebKit/WebView.subproj/IFDocument.h
index bca5c9e..ac9509f 100644
--- a/WebKit/WebView.subproj/IFDocument.h
+++ b/WebKit/WebView.subproj/IFDocument.h
@@ -27,6 +27,7 @@
 @end
 
 @protocol IFDocumentRepresentation
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFHTMLRepresentation.h b/WebKit/WebView.subproj/IFHTMLRepresentation.h
index 8a1981f..76cf639 100644
--- a/WebKit/WebView.subproj/IFHTMLRepresentation.h
+++ b/WebKit/WebView.subproj/IFHTMLRepresentation.h
@@ -20,7 +20,7 @@ class KHTMLPart;
 }
 
 - (KHTMLPart *)part;
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
-
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLRepresentation.mm b/WebKit/WebView.subproj/IFHTMLRepresentation.mm
index 2ce5385..198c9b7 100644
--- a/WebKit/WebView.subproj/IFHTMLRepresentation.mm
+++ b/WebKit/WebView.subproj/IFHTMLRepresentation.mm
@@ -27,7 +27,7 @@
     return part;
 }
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
     if(isFirstChunk){
         // FIXME [rjw]:  Do any work need in the kde engine.  This should be removed.
@@ -36,7 +36,7 @@
         part->impl->setDataSource(dataSource);
     }
     
-    part->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], isComplete);
+    part->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], NO);
     
     isFirstChunk = NO;
 }
@@ -46,4 +46,9 @@
 
 }
 
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource
+{
+
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLView.mm b/WebKit/WebView.subproj/IFHTMLView.mm
index 8c4d426..d8fd936 100644
--- a/WebKit/WebView.subproj/IFHTMLView.mm
+++ b/WebKit/WebView.subproj/IFHTMLView.mm
@@ -12,15 +12,10 @@
 #import <WebKit/IFWebController.h>
 #import <WebKit/IFDynamicScrollBarsView.h>
 #import <WebKit/IFException.h>
-#import <WebKit/IFWebCoreViewFactory.h>
-#import <WebKit/IFTextRendererFactory.h>
-#import <WebKit/IFImageRendererFactory.h>
 #import <WebKit/WebKitDebug.h>
 #import <WebKit/IFHTMLRepresentation.h>
 #import <WebKit/IFNSViewExtras.h>
 
-#import <WebFoundation/IFNSStringExtensions.h>
-
 // Needed for the mouse move notification.
 #import <AppKit/NSResponder_Private.h>
 
@@ -38,10 +33,6 @@
 - initWithFrame: (NSRect) frame
 {
     [super initWithFrame: frame];
-
-    [IFWebCoreViewFactory createSharedFactory];
-    [IFTextRendererFactory createSharedFactory];
-    [IFImageRendererFactory createSharedFactory];
     
     _private = [[IFHTMLViewPrivate alloc] init];
 
@@ -50,8 +41,6 @@
 
     _private->canDragTo = YES;
     _private->canDragFrom = YES;
-    _private->draggingTypes = [[NSArray arrayWithObjects:@"NSFilenamesPboardType", @"NSURLPboardType", @"NSStringPboardType", nil] retain];
-    [self registerForDraggedTypes:_private->draggingTypes];
 
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
@@ -227,71 +216,6 @@
     return _private->canDragTo;
 }
 
-- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
-{
-    NSString *dragType, *file, *URLString;
-    NSArray *files;
-    
-    if(![self canDragTo])
-        return NSDragOperationNone;
-        
-    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
-    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
-        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
-        
-        // FIXME: We only look at the first dragged file (2931225)
-        file = [files objectAtIndex:0];
-        
-        // FIXME: Need the file type database to know what files we handle (2927855)
-        if([[file pathExtension] isEqualToString:@"html"] || [[file pathExtension] isEqualToString:@"htm"])
-            return NSDragOperationCopy;
-    }else if([dragType isEqualToString:@"NSURLPboardType"]){
-        return NSDragOperationCopy;
-    }else if([dragType isEqualToString:@"NSStringPboardType"]){
-        URLString = [[sender draggingPasteboard] stringForType:@"NSStringPboardType"];
-        if([URLString _IF_looksLikeAbsoluteURL])
-            return NSDragOperationCopy;
-    }
-    return NSDragOperationNone;
-}
-
-- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
-{
-    return YES;
-}
-
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
-{
-    IFWebDataSource *dataSource;
-    IFWebFrame *frame;
-    NSArray *files;
-    NSString *file, *dragType;
-    NSURL *URL=nil;
-    
-    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
-    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
-        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
-        file = [files objectAtIndex:0];
-        URL = [NSURL fileURLWithPath:file];
-    }else if([dragType isEqualToString:@"NSURLPboardType"]){
-        // FIXME: Is this the right way to get the URL? How to test?
-        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSURLPboardType"]];
-    }else if([dragType isEqualToString:@"NSStringPboardType"]){
-        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSStringPboardType"]];
-    }
-    
-    if(!URL)
-        return NO;
-        
-    dataSource = [[[IFWebDataSource alloc] initWithURL:URL] autorelease];
-    frame = nil;
-    //frame = [[self controller] frameForView:self];
-    [frame setProvisionalDataSource:dataSource];
-    [frame startLoading];
-    
-    return YES;
-}
-
 // Returns an array of built-in context menu items for this node.
 // Generally called by IFContextMenuHandlers from contextMenuItemsForNode:
 #ifdef TENTATIVE_API
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.h b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
index 51e8958..556f89b 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
@@ -22,7 +22,6 @@ class KHTMLView;
     BOOL needsToApplyStyles;
     BOOL canDragTo;
     BOOL canDragFrom;
-    NSArray *draggingTypes;
     NSCursor *cursor;
     BOOL liveAllowsScrolling;
 }
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.mm b/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
index c93be12..82f7c46 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
@@ -21,7 +21,6 @@
 - (void)dealloc
 {
     [controller release];
-    [draggingTypes release];
     [cursor release];
 
     [super dealloc];
diff --git a/WebKit/WebView.subproj/IFImageRepresentation.h b/WebKit/WebView.subproj/IFImageRepresentation.h
index c24babe..0507b43 100644
--- a/WebKit/WebView.subproj/IFImageRepresentation.h
+++ b/WebKit/WebView.subproj/IFImageRepresentation.h
@@ -3,7 +3,7 @@
 	Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
 
 @class IFError;
 @class IFWebDataSource;
@@ -16,7 +16,7 @@
 }
 
 - (IFImageRenderer *)image;
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
-
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/IFImageRepresentation.m b/WebKit/WebView.subproj/IFImageRepresentation.m
index a1a3507..d0fc3ee 100644
--- a/WebKit/WebView.subproj/IFImageRepresentation.m
+++ b/WebKit/WebView.subproj/IFImageRepresentation.m
@@ -19,18 +19,19 @@
     return self;
 }
 
+
+- (void)dealloc
+{
+    [image release];
+}
+
 - (IFImageRenderer *)image
 {
     return image;
 }
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
-    if(isComplete){
-        NSData *resourceData = [dataSource data];
-        image = [[IFImageRendererFactory alloc] imageRendererWithBytes:[resourceData bytes] 
-                    length:[resourceData length]];
-    }
     //[image incrementalLoadWithBytes:[data bytes] length:[data length] complete:isComplete];
 }
 
@@ -39,4 +40,11 @@
 
 }
 
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource
+{
+    NSData *resourceData = [dataSource data];
+    image = [[[IFImageRendererFactory sharedFactory] imageRendererWithBytes:[resourceData bytes] 
+                length:[resourceData length]] retain];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFImageView.h b/WebKit/WebView.subproj/IFImageView.h
index cc0e398..911f4eb 100644
--- a/WebKit/WebView.subproj/IFImageView.h
+++ b/WebKit/WebView.subproj/IFImageView.h
@@ -3,7 +3,7 @@
 	Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <AppKit/AppKit.h>
+#import <Cocoa/Cocoa.h>
 
 @class IFWebDataSource;
 @class IFImageRepresentation;
diff --git a/WebKit/WebView.subproj/IFImageView.m b/WebKit/WebView.subproj/IFImageView.m
index dc9a78a..fbb416c 100644
--- a/WebKit/WebView.subproj/IFImageView.m
+++ b/WebKit/WebView.subproj/IFImageView.m
@@ -4,9 +4,11 @@
 */
 
 #import "IFImageView.h"
-#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFDynamicScrollBarsView.h>
 #import <WebKit/IFImageRenderer.h>
 #import <WebKit/IFImageRepresentation.h>
+#import <WebKit/IFNSViewExtras.h>
+#import <WebKit/IFWebDataSource.h>
 
 @implementation IFImageView
 
@@ -16,7 +18,6 @@
     if (self) {
         canDragFrom = YES;
         canDragTo = YES;
-        didSetFrame = NO;
     }
     return self;
 }
@@ -27,19 +28,27 @@
     [representation release];
 }
 
+- (BOOL)isFlipped 
+{
+    return YES;
+}
 
 - (void)drawRect:(NSRect)rect {
     IFImageRenderer *image;
-    NSSize imageSize;
     
     image = [representation image];
-    if([representation image]){
-        
-        imageSize = [image size];
-        [image beginAnimationInView:self inRect:rect fromRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)];
+    if(image){
+        [image beginAnimationInView:self inRect:[self frame] fromRect:[self frame]];
     }
 }
 
+- (void)removeFromSuperview
+{
+    NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
+    [(NSScrollView *)scrollView setDrawsBackground:NO];
+    [super removeFromSuperview];
+}
+
 - (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource
 {
 
@@ -55,16 +64,25 @@
 
 }
 
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+}
+
 - (void)layout
 {
-    if([representation image] && !didSetFrame){
-        IFImageRenderer *image = [representation image];
+    IFImageRenderer *image = [representation image];
+    
+    if(image){
+        NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
         NSSize imageSize = [image size];
-        NSRect frame = [self frame];
-        
-        [self setFrame:NSMakeRect(frame.origin.x, frame.origin.x, imageSize.width, imageSize.height)];
-        didSetFrame = YES;
+
+        [self setFrameSize:imageSize];
+        [image setFlipped:YES];
+        [(NSScrollView *)scrollView setDrawsBackground:YES];
+        [(NSScrollView *)scrollView setBackgroundColor:[NSColor whiteColor]];
     }
+
 }
 
 - (void)setCanDragFrom: (BOOL)flag
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.mm b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
index c7058c9..a74f0b1 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.mm
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
@@ -88,8 +88,12 @@
     
     // Don't retain download data
     if([dataSource contentPolicy] != IFContentPolicySave &&
-       [dataSource contentPolicy] != IFContentPolicyOpenExternally)
+       [dataSource contentPolicy] != IFContentPolicyOpenExternally){
        [dataSource _setResourceData:data];
+    }
+    
+    if(IFContentPolicyShow)
+        [[dataSource representation] finishedLoadingWithDataSource:dataSource];
     
     // update progress
     IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
@@ -102,6 +106,7 @@
     [url release];
     url = nil;
     
+    [downloadHandler finishedLoading];
     [downloadHandler release];
     downloadHandler = nil;
 }
@@ -111,7 +116,6 @@
 {
     int contentLength = [sender contentLength];
     int contentLengthReceived = [sender contentLengthReceived];
-    BOOL isComplete = (contentLength == contentLengthReceived);
     NSString *contentType = [sender contentType];
     IFWebFrame *frame = [dataSource webFrame];
     IFWebView *view = [frame view];
@@ -148,7 +152,7 @@
     }
     
     if(contentPolicy == IFContentPolicyShow){
-        [[dataSource representation] receivedData:data withDataSource:dataSource isComplete:isComplete];
+        [[dataSource representation] receivedData:data withDataSource:dataSource];
         [[view documentView] dataSourceUpdated:dataSource];
         
     }else if(contentPolicy == IFContentPolicySave || contentPolicy == IFContentPolicyOpenExternally){
@@ -157,7 +161,7 @@
             [[dataSource _locationChangeHandler] locationChangeDone:nil];
             downloadHandler = [[IFDownloadHandler alloc] initWithDataSource:dataSource];
         }
-        [downloadHandler receivedData:data isComplete:isComplete];
+        [downloadHandler receivedData:data];
         
     }else if(contentPolicy == IFContentPolicyIgnore){
         [sender cancelLoadInBackground];
diff --git a/WebKit/WebView.subproj/IFTextRepresentation.h b/WebKit/WebView.subproj/IFTextRepresentation.h
index 68fcdc5..4b4bcd1 100644
--- a/WebKit/WebView.subproj/IFTextRepresentation.h
+++ b/WebKit/WebView.subproj/IFTextRepresentation.h
@@ -14,7 +14,7 @@
 
 }
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
-
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/IFTextRepresentation.m b/WebKit/WebView.subproj/IFTextRepresentation.m
index ec31613..2274206 100644
--- a/WebKit/WebView.subproj/IFTextRepresentation.m
+++ b/WebKit/WebView.subproj/IFTextRepresentation.m
@@ -8,7 +8,7 @@
 
 @implementation IFTextRepresentation
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
 
 }
@@ -18,4 +18,9 @@
 
 }
 
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource
+{
+
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFTextView.h b/WebKit/WebView.subproj/IFTextView.h
index 418c8b0..c04020c 100644
--- a/WebKit/WebView.subproj/IFTextView.h
+++ b/WebKit/WebView.subproj/IFTextView.h
@@ -14,6 +14,7 @@
 {
     BOOL canDragFrom;
     BOOL canDragTo;
+    BOOL isRTF;
 }
 
 - (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/IFTextView.m b/WebKit/WebView.subproj/IFTextView.m
index 56d790b..9b68395 100644
--- a/WebKit/WebView.subproj/IFTextView.m
+++ b/WebKit/WebView.subproj/IFTextView.m
@@ -17,14 +17,17 @@
         canDragTo = YES;
         [[self textContainer] setWidthTracksTextView:YES];
         [self setAutoresizingMask:NSViewWidthSizable];
-        [self setRichText:YES];
+        [self setEditable:NO];
     }
     return self;
 }
 
 - (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource
 {
-
+    if([[dataSource contentType] isEqualToString:@"text/rtf"])
+        isRTF = YES;
+    else
+        isRTF = NO;
 }
 
 - (void)provisionalDataSourceCommitted:(IFWebDataSource *)dataSource
@@ -34,13 +37,29 @@
 
 - (void)dataSourceUpdated:(IFWebDataSource *)dataSource
 {
-    NSString *theString = [[NSString alloc] initWithData:[dataSource data] encoding:NSASCIIStringEncoding];
-    [self setString:theString];
-    [theString release];
+    NSString *theString;
+    
+    //FIXME: This needs to be more efficient
+    
+    if(isRTF){
+        [self setRichText:YES];
+        [self replaceCharactersInRange:NSMakeRange(0,0) withRTF:[dataSource data]];
+    }else{
+        [self setRichText:NO];
+        
+        // set correct encoding
+        theString = [[NSString alloc] initWithData:[dataSource data] encoding:NSASCIIStringEncoding];
+        [self setString:theString];
+        [theString release];
+    }
 }
 
 - (void)layout
 {
+    NSRect superFrame = [[self superview] frame];
+    NSRect frame = [self frame];
+    
+    [self setFrame:NSMakeRect(frame.origin.x, frame.origin.y, superFrame.size.width, frame.size.height)];
 }
 
 - (void)setCanDragFrom: (BOOL)flag
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index f8312d5..61a4270 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -171,5 +171,5 @@ typedef enum {
 - (void)startAnimatedImageLooping;
 
 + (BOOL)canShowMIMEType:(NSString *)MIMEType;
-
++ (BOOL)canShowFile:(NSString *)path;
 @end
diff --git a/WebKit/WebView.subproj/IFWebController.mm b/WebKit/WebView.subproj/IFWebController.mm
index 4155631..06fc5a6 100644
--- a/WebKit/WebView.subproj/IFWebController.mm
+++ b/WebKit/WebView.subproj/IFWebController.mm
@@ -17,6 +17,7 @@
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/WebFoundation.h>
+#import <WebFoundation/IFFileTypeMappings.h>
 
 @implementation IFWebController
 
@@ -307,7 +308,7 @@
     if([IFWebView _canShowMIMEType:MIMEType] && [IFWebDataSource _canShowMIMEType:MIMEType]){
         return YES;
     }else{
-        // Have the plug-ins register views
+        // Have the plug-ins register views and representations
         [IFPluginDatabase installedPlugins];
         if([IFWebView _canShowMIMEType:MIMEType] && [IFWebDataSource _canShowMIMEType:MIMEType])
             return YES;
@@ -315,4 +316,13 @@
     return NO;
 }
 
++ (BOOL)canShowFile:(NSString *)path
+{
+    NSString *MIMEType, *extension = [path pathExtension];
+    
+    MIMEType = [[IFFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+    
+    return [[self class] canShowMIMEType:MIMEType];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFWebDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
index 4c647ff..367e1d4 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -118,15 +118,16 @@
 - (BOOL)isLoading;
 
 
-/*
+
 #ifdef TENTATIVE_API
 // Get DOM access to the document.
 - (IFDOMDocument *)document;
 #endif
 
+
 // Get the source of the document by reconstructing it from the DOM.
 - (NSString *)documentTextFromDOM;
-*/
+
 
 // Get the actual source of the document.
 - (NSString *)documentText;
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index e045c0d..171bbae 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -66,7 +66,7 @@ static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags)
 
 - (NSData *)data
 {
-    if(_private->mainHandle){
+    if(!_private->resourceData){
         return [_private->mainHandle resourceData];
     }else{
         return _private->resourceData;
@@ -253,6 +253,7 @@ static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags)
 // Get the actual source of the docment.
 - (NSString *)documentText
 {
+    // FIMXE: other encodings
     return [[[NSString alloc] initWithData:[self data] encoding:NSASCIIStringEncoding] autorelease];
 }
 
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 5de9ef4..93f68a3 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -7,13 +7,25 @@
 #import <WebKit/IFTextView.h>
 #import <WebKit/IFWebView.h>
 #import <WebKit/IFWebViewPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebCoreViewFactory.h>
+#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebFrame.h>
+#import <WebKit/IFTextRendererFactory.h>
+#import <WebKit/IFImageRendererFactory.h>
+
+#import <WebFoundation/IFNSStringExtensions.h>
 
 @implementation IFWebView
 
 - initWithFrame: (NSRect) frame
 {
     [super initWithFrame: frame];
-    
+ 
+    [IFWebCoreViewFactory createSharedFactory];
+    [IFTextRendererFactory createSharedFactory];
+    [IFImageRendererFactory createSharedFactory];
+   
     _private = [[IFWebViewPrivate alloc] init];
 
     IFDynamicScrollBarsView *scrollView  = [[IFDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,frame.size.width,frame.size.height)];
@@ -24,6 +36,10 @@
     [scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [self addSubview: scrollView];
     
+    _private->draggingTypes = [[NSArray arrayWithObjects:@"NSFilenamesPboardType", 
+                                    @"NSURLPboardType", @"NSStringPboardType", nil] retain];
+    [self registerForDraggedTypes:_private->draggingTypes];
+    
     return self;
 }
 
@@ -68,6 +84,71 @@
     return [[[self documentView] className] isEqualToString:@"IFHTMLView"];
 }
 
+
+- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
+{
+    NSString *dragType, *file, *URLString;
+    NSArray *files;
+        
+    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
+    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
+        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
+        
+        // FIXME: We only look at the first dragged file (2931225)
+        file = [files objectAtIndex:0];
+        
+        if([IFWebController canShowFile:file])
+            return NSDragOperationCopy;
+            
+    }else if([dragType isEqualToString:@"NSURLPboardType"]){
+        //use URLFromPasteboard:
+        return NSDragOperationCopy;
+    }else if([dragType isEqualToString:@"NSStringPboardType"]){
+        URLString = [[sender draggingPasteboard] stringForType:@"NSStringPboardType"];
+        if([URLString _IF_looksLikeAbsoluteURL])
+            return NSDragOperationCopy;
+    }
+    return NSDragOperationNone;
+}
+
+- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+{
+    return YES;
+}
+
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+{
+    IFWebDataSource *dataSource;
+    IFWebFrame *frame;
+    NSArray *files;
+    NSString *file, *dragType;
+    NSURL *URL=nil;
+    
+    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
+    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
+        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
+        file = [files objectAtIndex:0];
+        URL = [NSURL fileURLWithPath:file];
+    }else if([dragType isEqualToString:@"NSURLPboardType"]){
+        // FIXME: Is this the right way to get the URL? How to test?
+        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSURLPboardType"]];
+    }else if([dragType isEqualToString:@"NSStringPboardType"]){
+        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSStringPboardType"]];
+    }
+    
+    if(!URL)
+        return NO;
+        
+    dataSource = [[[IFWebDataSource alloc] initWithURL:URL] autorelease];
+    frame = nil;
+    frame = [[self controller] mainFrame];
+    [frame setProvisionalDataSource:dataSource];
+    [frame startLoading];
+    
+    return YES;
+}
+
+
 + (void) registerViewClass:(Class)viewClass forMIMEType:(NSString *)MIMEType
 {
     NSMutableDictionary *viewTypes = [[self class] _viewTypes];
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.h b/WebKit/WebView.subproj/IFWebViewPrivate.h
index 174cb79..d3f06f6 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.h
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.h
@@ -22,6 +22,8 @@ class QWidget;
     // document view type.
     int marginWidth;
     int marginHeight;
+    
+    NSArray *draggingTypes;
 }
 
 @end
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.mm b/WebKit/WebView.subproj/IFWebViewPrivate.mm
index 281389f..dc94da3 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.mm
@@ -30,6 +30,7 @@ static NSMutableDictionary *_viewTypes=nil;
 - (void)dealloc
 {
     [frameScrollView release];
+    [draggingTypes release];
     [super dealloc];
 }
 
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index f8312d5..61a4270 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -171,5 +171,5 @@ typedef enum {
 - (void)startAnimatedImageLooping;
 
 + (BOOL)canShowMIMEType:(NSString *)MIMEType;
-
++ (BOOL)canShowFile:(NSString *)path;
 @end
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index 4155631..06fc5a6 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -17,6 +17,7 @@
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/WebFoundation.h>
+#import <WebFoundation/IFFileTypeMappings.h>
 
 @implementation IFWebController
 
@@ -307,7 +308,7 @@
     if([IFWebView _canShowMIMEType:MIMEType] && [IFWebDataSource _canShowMIMEType:MIMEType]){
         return YES;
     }else{
-        // Have the plug-ins register views
+        // Have the plug-ins register views and representations
         [IFPluginDatabase installedPlugins];
         if([IFWebView _canShowMIMEType:MIMEType] && [IFWebDataSource _canShowMIMEType:MIMEType])
             return YES;
@@ -315,4 +316,13 @@
     return NO;
 }
 
++ (BOOL)canShowFile:(NSString *)path
+{
+    NSString *MIMEType, *extension = [path pathExtension];
+    
+    MIMEType = [[IFFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+    
+    return [[self class] canShowMIMEType:MIMEType];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 4c647ff..367e1d4 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -118,15 +118,16 @@
 - (BOOL)isLoading;
 
 
-/*
+
 #ifdef TENTATIVE_API
 // Get DOM access to the document.
 - (IFDOMDocument *)document;
 #endif
 
+
 // Get the source of the document by reconstructing it from the DOM.
 - (NSString *)documentTextFromDOM;
-*/
+
 
 // Get the actual source of the document.
 - (NSString *)documentText;
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index e045c0d..171bbae 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -66,7 +66,7 @@ static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags)
 
 - (NSData *)data
 {
-    if(_private->mainHandle){
+    if(!_private->resourceData){
         return [_private->mainHandle resourceData];
     }else{
         return _private->resourceData;
@@ -253,6 +253,7 @@ static id IFWebDataSourceMake(void *url, void *attributes, unsigned flags)
 // Get the actual source of the docment.
 - (NSString *)documentText
 {
+    // FIMXE: other encodings
     return [[[NSString alloc] initWithData:[self data] encoding:NSASCIIStringEncoding] autorelease];
 }
 
diff --git a/WebKit/WebView.subproj/WebDocument.h b/WebKit/WebView.subproj/WebDocument.h
index bca5c9e..ac9509f 100644
--- a/WebKit/WebView.subproj/WebDocument.h
+++ b/WebKit/WebView.subproj/WebDocument.h
@@ -27,6 +27,7 @@
 @end
 
 @protocol IFDocumentRepresentation
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 5de9ef4..93f68a3 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -7,13 +7,25 @@
 #import <WebKit/IFTextView.h>
 #import <WebKit/IFWebView.h>
 #import <WebKit/IFWebViewPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebCoreViewFactory.h>
+#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebFrame.h>
+#import <WebKit/IFTextRendererFactory.h>
+#import <WebKit/IFImageRendererFactory.h>
+
+#import <WebFoundation/IFNSStringExtensions.h>
 
 @implementation IFWebView
 
 - initWithFrame: (NSRect) frame
 {
     [super initWithFrame: frame];
-    
+ 
+    [IFWebCoreViewFactory createSharedFactory];
+    [IFTextRendererFactory createSharedFactory];
+    [IFImageRendererFactory createSharedFactory];
+   
     _private = [[IFWebViewPrivate alloc] init];
 
     IFDynamicScrollBarsView *scrollView  = [[IFDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,frame.size.width,frame.size.height)];
@@ -24,6 +36,10 @@
     [scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [self addSubview: scrollView];
     
+    _private->draggingTypes = [[NSArray arrayWithObjects:@"NSFilenamesPboardType", 
+                                    @"NSURLPboardType", @"NSStringPboardType", nil] retain];
+    [self registerForDraggedTypes:_private->draggingTypes];
+    
     return self;
 }
 
@@ -68,6 +84,71 @@
     return [[[self documentView] className] isEqualToString:@"IFHTMLView"];
 }
 
+
+- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
+{
+    NSString *dragType, *file, *URLString;
+    NSArray *files;
+        
+    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
+    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
+        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
+        
+        // FIXME: We only look at the first dragged file (2931225)
+        file = [files objectAtIndex:0];
+        
+        if([IFWebController canShowFile:file])
+            return NSDragOperationCopy;
+            
+    }else if([dragType isEqualToString:@"NSURLPboardType"]){
+        //use URLFromPasteboard:
+        return NSDragOperationCopy;
+    }else if([dragType isEqualToString:@"NSStringPboardType"]){
+        URLString = [[sender draggingPasteboard] stringForType:@"NSStringPboardType"];
+        if([URLString _IF_looksLikeAbsoluteURL])
+            return NSDragOperationCopy;
+    }
+    return NSDragOperationNone;
+}
+
+- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+{
+    return YES;
+}
+
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+{
+    IFWebDataSource *dataSource;
+    IFWebFrame *frame;
+    NSArray *files;
+    NSString *file, *dragType;
+    NSURL *URL=nil;
+    
+    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
+    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
+        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
+        file = [files objectAtIndex:0];
+        URL = [NSURL fileURLWithPath:file];
+    }else if([dragType isEqualToString:@"NSURLPboardType"]){
+        // FIXME: Is this the right way to get the URL? How to test?
+        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSURLPboardType"]];
+    }else if([dragType isEqualToString:@"NSStringPboardType"]){
+        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSStringPboardType"]];
+    }
+    
+    if(!URL)
+        return NO;
+        
+    dataSource = [[[IFWebDataSource alloc] initWithURL:URL] autorelease];
+    frame = nil;
+    frame = [[self controller] mainFrame];
+    [frame setProvisionalDataSource:dataSource];
+    [frame startLoading];
+    
+    return YES;
+}
+
+
 + (void) registerViewClass:(Class)viewClass forMIMEType:(NSString *)MIMEType
 {
     NSMutableDictionary *viewTypes = [[self class] _viewTypes];
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index 174cb79..d3f06f6 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -22,6 +22,8 @@ class QWidget;
     // document view type.
     int marginWidth;
     int marginHeight;
+    
+    NSArray *draggingTypes;
 }
 
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index 174cb79..d3f06f6 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -22,6 +22,8 @@ class QWidget;
     // document view type.
     int marginWidth;
     int marginHeight;
+    
+    NSArray *draggingTypes;
 }
 
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index 281389f..dc94da3 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -30,6 +30,7 @@ static NSMutableDictionary *_viewTypes=nil;
 - (void)dealloc
 {
     [frameScrollView release];
+    [draggingTypes release];
     [super dealloc];
 }
 
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.h b/WebKit/WebView.subproj/WebHTMLRepresentation.h
index 8a1981f..76cf639 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.h
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.h
@@ -20,7 +20,7 @@ class KHTMLPart;
 }
 
 - (KHTMLPart *)part;
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
-
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.m b/WebKit/WebView.subproj/WebHTMLRepresentation.m
index 2ce5385..198c9b7 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.m
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.m
@@ -27,7 +27,7 @@
     return part;
 }
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
     if(isFirstChunk){
         // FIXME [rjw]:  Do any work need in the kde engine.  This should be removed.
@@ -36,7 +36,7 @@
         part->impl->setDataSource(dataSource);
     }
     
-    part->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], isComplete);
+    part->impl->slotData([dataSource encoding], (const char *)[data bytes], [data length], NO);
     
     isFirstChunk = NO;
 }
@@ -46,4 +46,9 @@
 
 }
 
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource
+{
+
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 8c4d426..d8fd936 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -12,15 +12,10 @@
 #import <WebKit/IFWebController.h>
 #import <WebKit/IFDynamicScrollBarsView.h>
 #import <WebKit/IFException.h>
-#import <WebKit/IFWebCoreViewFactory.h>
-#import <WebKit/IFTextRendererFactory.h>
-#import <WebKit/IFImageRendererFactory.h>
 #import <WebKit/WebKitDebug.h>
 #import <WebKit/IFHTMLRepresentation.h>
 #import <WebKit/IFNSViewExtras.h>
 
-#import <WebFoundation/IFNSStringExtensions.h>
-
 // Needed for the mouse move notification.
 #import <AppKit/NSResponder_Private.h>
 
@@ -38,10 +33,6 @@
 - initWithFrame: (NSRect) frame
 {
     [super initWithFrame: frame];
-
-    [IFWebCoreViewFactory createSharedFactory];
-    [IFTextRendererFactory createSharedFactory];
-    [IFImageRendererFactory createSharedFactory];
     
     _private = [[IFHTMLViewPrivate alloc] init];
 
@@ -50,8 +41,6 @@
 
     _private->canDragTo = YES;
     _private->canDragFrom = YES;
-    _private->draggingTypes = [[NSArray arrayWithObjects:@"NSFilenamesPboardType", @"NSURLPboardType", @"NSStringPboardType", nil] retain];
-    [self registerForDraggedTypes:_private->draggingTypes];
 
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
@@ -227,71 +216,6 @@
     return _private->canDragTo;
 }
 
-- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
-{
-    NSString *dragType, *file, *URLString;
-    NSArray *files;
-    
-    if(![self canDragTo])
-        return NSDragOperationNone;
-        
-    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
-    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
-        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
-        
-        // FIXME: We only look at the first dragged file (2931225)
-        file = [files objectAtIndex:0];
-        
-        // FIXME: Need the file type database to know what files we handle (2927855)
-        if([[file pathExtension] isEqualToString:@"html"] || [[file pathExtension] isEqualToString:@"htm"])
-            return NSDragOperationCopy;
-    }else if([dragType isEqualToString:@"NSURLPboardType"]){
-        return NSDragOperationCopy;
-    }else if([dragType isEqualToString:@"NSStringPboardType"]){
-        URLString = [[sender draggingPasteboard] stringForType:@"NSStringPboardType"];
-        if([URLString _IF_looksLikeAbsoluteURL])
-            return NSDragOperationCopy;
-    }
-    return NSDragOperationNone;
-}
-
-- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
-{
-    return YES;
-}
-
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
-{
-    IFWebDataSource *dataSource;
-    IFWebFrame *frame;
-    NSArray *files;
-    NSString *file, *dragType;
-    NSURL *URL=nil;
-    
-    dragType = [[sender draggingPasteboard] availableTypeFromArray:_private->draggingTypes];
-    if([dragType isEqualToString:@"NSFilenamesPboardType"]){
-        files = [[sender draggingPasteboard] propertyListForType:@"NSFilenamesPboardType"];
-        file = [files objectAtIndex:0];
-        URL = [NSURL fileURLWithPath:file];
-    }else if([dragType isEqualToString:@"NSURLPboardType"]){
-        // FIXME: Is this the right way to get the URL? How to test?
-        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSURLPboardType"]];
-    }else if([dragType isEqualToString:@"NSStringPboardType"]){
-        URL = [NSURL URLWithString:[[sender draggingPasteboard] stringForType:@"NSStringPboardType"]];
-    }
-    
-    if(!URL)
-        return NO;
-        
-    dataSource = [[[IFWebDataSource alloc] initWithURL:URL] autorelease];
-    frame = nil;
-    //frame = [[self controller] frameForView:self];
-    [frame setProvisionalDataSource:dataSource];
-    [frame startLoading];
-    
-    return YES;
-}
-
 // Returns an array of built-in context menu items for this node.
 // Generally called by IFContextMenuHandlers from contextMenuItemsForNode:
 #ifdef TENTATIVE_API
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 51e8958..556f89b 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -22,7 +22,6 @@ class KHTMLView;
     BOOL needsToApplyStyles;
     BOOL canDragTo;
     BOOL canDragFrom;
-    NSArray *draggingTypes;
     NSCursor *cursor;
     BOOL liveAllowsScrolling;
 }
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index c93be12..82f7c46 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -21,7 +21,6 @@
 - (void)dealloc
 {
     [controller release];
-    [draggingTypes release];
     [cursor release];
 
     [super dealloc];
diff --git a/WebKit/WebView.subproj/WebImageRepresentation.h b/WebKit/WebView.subproj/WebImageRepresentation.h
index c24babe..0507b43 100644
--- a/WebKit/WebView.subproj/WebImageRepresentation.h
+++ b/WebKit/WebView.subproj/WebImageRepresentation.h
@@ -3,7 +3,7 @@
 	Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
 
 @class IFError;
 @class IFWebDataSource;
@@ -16,7 +16,7 @@
 }
 
 - (IFImageRenderer *)image;
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
-
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/WebImageRepresentation.m b/WebKit/WebView.subproj/WebImageRepresentation.m
index a1a3507..d0fc3ee 100644
--- a/WebKit/WebView.subproj/WebImageRepresentation.m
+++ b/WebKit/WebView.subproj/WebImageRepresentation.m
@@ -19,18 +19,19 @@
     return self;
 }
 
+
+- (void)dealloc
+{
+    [image release];
+}
+
 - (IFImageRenderer *)image
 {
     return image;
 }
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
-    if(isComplete){
-        NSData *resourceData = [dataSource data];
-        image = [[IFImageRendererFactory alloc] imageRendererWithBytes:[resourceData bytes] 
-                    length:[resourceData length]];
-    }
     //[image incrementalLoadWithBytes:[data bytes] length:[data length] complete:isComplete];
 }
 
@@ -39,4 +40,11 @@
 
 }
 
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource
+{
+    NSData *resourceData = [dataSource data];
+    image = [[[IFImageRendererFactory sharedFactory] imageRendererWithBytes:[resourceData bytes] 
+                length:[resourceData length]] retain];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebImageView.h b/WebKit/WebView.subproj/WebImageView.h
index cc0e398..911f4eb 100644
--- a/WebKit/WebView.subproj/WebImageView.h
+++ b/WebKit/WebView.subproj/WebImageView.h
@@ -3,7 +3,7 @@
 	Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <AppKit/AppKit.h>
+#import <Cocoa/Cocoa.h>
 
 @class IFWebDataSource;
 @class IFImageRepresentation;
diff --git a/WebKit/WebView.subproj/WebImageView.m b/WebKit/WebView.subproj/WebImageView.m
index dc9a78a..fbb416c 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -4,9 +4,11 @@
 */
 
 #import "IFImageView.h"
-#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFDynamicScrollBarsView.h>
 #import <WebKit/IFImageRenderer.h>
 #import <WebKit/IFImageRepresentation.h>
+#import <WebKit/IFNSViewExtras.h>
+#import <WebKit/IFWebDataSource.h>
 
 @implementation IFImageView
 
@@ -16,7 +18,6 @@
     if (self) {
         canDragFrom = YES;
         canDragTo = YES;
-        didSetFrame = NO;
     }
     return self;
 }
@@ -27,19 +28,27 @@
     [representation release];
 }
 
+- (BOOL)isFlipped 
+{
+    return YES;
+}
 
 - (void)drawRect:(NSRect)rect {
     IFImageRenderer *image;
-    NSSize imageSize;
     
     image = [representation image];
-    if([representation image]){
-        
-        imageSize = [image size];
-        [image beginAnimationInView:self inRect:rect fromRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)];
+    if(image){
+        [image beginAnimationInView:self inRect:[self frame] fromRect:[self frame]];
     }
 }
 
+- (void)removeFromSuperview
+{
+    NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
+    [(NSScrollView *)scrollView setDrawsBackground:NO];
+    [super removeFromSuperview];
+}
+
 - (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource
 {
 
@@ -55,16 +64,25 @@
 
 }
 
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+}
+
 - (void)layout
 {
-    if([representation image] && !didSetFrame){
-        IFImageRenderer *image = [representation image];
+    IFImageRenderer *image = [representation image];
+    
+    if(image){
+        NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
         NSSize imageSize = [image size];
-        NSRect frame = [self frame];
-        
-        [self setFrame:NSMakeRect(frame.origin.x, frame.origin.x, imageSize.width, imageSize.height)];
-        didSetFrame = YES;
+
+        [self setFrameSize:imageSize];
+        [image setFlipped:YES];
+        [(NSScrollView *)scrollView setDrawsBackground:YES];
+        [(NSScrollView *)scrollView setBackgroundColor:[NSColor whiteColor]];
     }
+
 }
 
 - (void)setCanDragFrom: (BOOL)flag
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index c7058c9..a74f0b1 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -88,8 +88,12 @@
     
     // Don't retain download data
     if([dataSource contentPolicy] != IFContentPolicySave &&
-       [dataSource contentPolicy] != IFContentPolicyOpenExternally)
+       [dataSource contentPolicy] != IFContentPolicyOpenExternally){
        [dataSource _setResourceData:data];
+    }
+    
+    if(IFContentPolicyShow)
+        [[dataSource representation] finishedLoadingWithDataSource:dataSource];
     
     // update progress
     IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
@@ -102,6 +106,7 @@
     [url release];
     url = nil;
     
+    [downloadHandler finishedLoading];
     [downloadHandler release];
     downloadHandler = nil;
 }
@@ -111,7 +116,6 @@
 {
     int contentLength = [sender contentLength];
     int contentLengthReceived = [sender contentLengthReceived];
-    BOOL isComplete = (contentLength == contentLengthReceived);
     NSString *contentType = [sender contentType];
     IFWebFrame *frame = [dataSource webFrame];
     IFWebView *view = [frame view];
@@ -148,7 +152,7 @@
     }
     
     if(contentPolicy == IFContentPolicyShow){
-        [[dataSource representation] receivedData:data withDataSource:dataSource isComplete:isComplete];
+        [[dataSource representation] receivedData:data withDataSource:dataSource];
         [[view documentView] dataSourceUpdated:dataSource];
         
     }else if(contentPolicy == IFContentPolicySave || contentPolicy == IFContentPolicyOpenExternally){
@@ -157,7 +161,7 @@
             [[dataSource _locationChangeHandler] locationChangeDone:nil];
             downloadHandler = [[IFDownloadHandler alloc] initWithDataSource:dataSource];
         }
-        [downloadHandler receivedData:data isComplete:isComplete];
+        [downloadHandler receivedData:data];
         
     }else if(contentPolicy == IFContentPolicyIgnore){
         [sender cancelLoadInBackground];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index c7058c9..a74f0b1 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -88,8 +88,12 @@
     
     // Don't retain download data
     if([dataSource contentPolicy] != IFContentPolicySave &&
-       [dataSource contentPolicy] != IFContentPolicyOpenExternally)
+       [dataSource contentPolicy] != IFContentPolicyOpenExternally){
        [dataSource _setResourceData:data];
+    }
+    
+    if(IFContentPolicyShow)
+        [[dataSource representation] finishedLoadingWithDataSource:dataSource];
     
     // update progress
     IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
@@ -102,6 +106,7 @@
     [url release];
     url = nil;
     
+    [downloadHandler finishedLoading];
     [downloadHandler release];
     downloadHandler = nil;
 }
@@ -111,7 +116,6 @@
 {
     int contentLength = [sender contentLength];
     int contentLengthReceived = [sender contentLengthReceived];
-    BOOL isComplete = (contentLength == contentLengthReceived);
     NSString *contentType = [sender contentType];
     IFWebFrame *frame = [dataSource webFrame];
     IFWebView *view = [frame view];
@@ -148,7 +152,7 @@
     }
     
     if(contentPolicy == IFContentPolicyShow){
-        [[dataSource representation] receivedData:data withDataSource:dataSource isComplete:isComplete];
+        [[dataSource representation] receivedData:data withDataSource:dataSource];
         [[view documentView] dataSourceUpdated:dataSource];
         
     }else if(contentPolicy == IFContentPolicySave || contentPolicy == IFContentPolicyOpenExternally){
@@ -157,7 +161,7 @@
             [[dataSource _locationChangeHandler] locationChangeDone:nil];
             downloadHandler = [[IFDownloadHandler alloc] initWithDataSource:dataSource];
         }
-        [downloadHandler receivedData:data isComplete:isComplete];
+        [downloadHandler receivedData:data];
         
     }else if(contentPolicy == IFContentPolicyIgnore){
         [sender cancelLoadInBackground];
diff --git a/WebKit/WebView.subproj/WebTextRepresentation.h b/WebKit/WebView.subproj/WebTextRepresentation.h
index 68fcdc5..4b4bcd1 100644
--- a/WebKit/WebView.subproj/WebTextRepresentation.h
+++ b/WebKit/WebView.subproj/WebTextRepresentation.h
@@ -14,7 +14,7 @@
 
 }
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete;
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource;
 - (void)receivedError:(IFError *)error withDataSource:(IFWebDataSource *)dataSource;
-
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource;
 @end
diff --git a/WebKit/WebView.subproj/WebTextRepresentation.m b/WebKit/WebView.subproj/WebTextRepresentation.m
index ec31613..2274206 100644
--- a/WebKit/WebView.subproj/WebTextRepresentation.m
+++ b/WebKit/WebView.subproj/WebTextRepresentation.m
@@ -8,7 +8,7 @@
 
 @implementation IFTextRepresentation
 
-- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource isComplete:(BOOL)isComplete
+- (void)receivedData:(NSData *)data withDataSource:(IFWebDataSource *)dataSource
 {
 
 }
@@ -18,4 +18,9 @@
 
 }
 
+- (void)finishedLoadingWithDataSource:(IFWebDataSource *)dataSource
+{
+
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebTextView.h b/WebKit/WebView.subproj/WebTextView.h
index 418c8b0..c04020c 100644
--- a/WebKit/WebView.subproj/WebTextView.h
+++ b/WebKit/WebView.subproj/WebTextView.h
@@ -14,6 +14,7 @@
 {
     BOOL canDragFrom;
     BOOL canDragTo;
+    BOOL isRTF;
 }
 
 - (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/WebTextView.m b/WebKit/WebView.subproj/WebTextView.m
index 56d790b..9b68395 100644
--- a/WebKit/WebView.subproj/WebTextView.m
+++ b/WebKit/WebView.subproj/WebTextView.m
@@ -17,14 +17,17 @@
         canDragTo = YES;
         [[self textContainer] setWidthTracksTextView:YES];
         [self setAutoresizingMask:NSViewWidthSizable];
-        [self setRichText:YES];
+        [self setEditable:NO];
     }
     return self;
 }
 
 - (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource
 {
-
+    if([[dataSource contentType] isEqualToString:@"text/rtf"])
+        isRTF = YES;
+    else
+        isRTF = NO;
 }
 
 - (void)provisionalDataSourceCommitted:(IFWebDataSource *)dataSource
@@ -34,13 +37,29 @@
 
 - (void)dataSourceUpdated:(IFWebDataSource *)dataSource
 {
-    NSString *theString = [[NSString alloc] initWithData:[dataSource data] encoding:NSASCIIStringEncoding];
-    [self setString:theString];
-    [theString release];
+    NSString *theString;
+    
+    //FIXME: This needs to be more efficient
+    
+    if(isRTF){
+        [self setRichText:YES];
+        [self replaceCharactersInRange:NSMakeRange(0,0) withRTF:[dataSource data]];
+    }else{
+        [self setRichText:NO];
+        
+        // set correct encoding
+        theString = [[NSString alloc] initWithData:[dataSource data] encoding:NSASCIIStringEncoding];
+        [self setString:theString];
+        [theString release];
+    }
 }
 
 - (void)layout
 {
+    NSRect superFrame = [[self superview] frame];
+    NSRect frame = [self frame];
+    
+    [self setFrame:NSMakeRect(frame.origin.x, frame.origin.y, superFrame.size.width, frame.size.height)];
 }
 
 - (void)setCanDragFrom: (BOOL)flag
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index f8312d5..61a4270 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -171,5 +171,5 @@ typedef enum {
 - (void)startAnimatedImageLooping;
 
 + (BOOL)canShowMIMEType:(NSString *)MIMEType;
-
++ (BOOL)canShowFile:(NSString *)path;
 @end
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 4155631..06fc5a6 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -17,6 +17,7 @@
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/WebFoundation.h>
+#import <WebFoundation/IFFileTypeMappings.h>
 
 @implementation IFWebController
 
@@ -307,7 +308,7 @@
     if([IFWebView _canShowMIMEType:MIMEType] && [IFWebDataSource _canShowMIMEType:MIMEType]){
         return YES;
     }else{
-        // Have the plug-ins register views
+        // Have the plug-ins register views and representations
         [IFPluginDatabase installedPlugins];
         if([IFWebView _canShowMIMEType:MIMEType] && [IFWebDataSource _canShowMIMEType:MIMEType])
             return YES;
@@ -315,4 +316,13 @@
     return NO;
 }
 
++ (BOOL)canShowFile:(NSString *)path
+{
+    NSString *MIMEType, *extension = [path pathExtension];
+    
+    MIMEType = [[IFFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+    
+    return [[self class] canShowMIMEType:MIMEType];
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list