[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:20:39 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 59302da5950d336f81d587b11f774dbb52b04518
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jun 19 19:46:45 2002 +0000

    WebCore:
    
    	- fixed 2956444 -- mac os x feedback form missing textarea
    
    	* kwq/WebCoreFrameView.h: Added.
    
    	* kwq/KWQWidget.mm:
    	(QWidget::setCursor): Checked for cursor-setting call based on the
    	WebCoreFrameView protocol instead of using an informal protocol.
    	Also walk up the view chain so the cursor actually gets set.
    	(QWidget::internalSetGeometry): Changed the special case in here to use the new
    	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
    	Also add comments to explain the hack better and mention the code in QScrollView.
    
    	* kwq/KWQScrollView.mm:
    	(-[NSView _KWQ_isScrollView]): Gave these KWQ names instead of IF names.
    	(-[NSView _KWQ_getDocumentView]): Gave these KWQ names instead of IF names.
    	(QScrollView::addChild): Changed the special case in here to use the new
    	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
    	Also add comments to explain the hack better and mention the code in QWidget.
    
    	Other changes:
    
    	* kwq/kwqdebug.h: Cloned improved assert code from WebFoundation.
    
    	* kwq/KWQTextArea.h: Removed unused isReadOnly/setReadOnly.
    	* kwq/KWQTextArea.mm: Removed unused isReadOnly/setReadOnly.
    
    	* kwq/WebCoreViewFactory.h: Removed extraneous import and WebCoreCursorSetting
    	API from here.
    
    	* kwq/KWQTextEdit.mm: Tweaked.
    	* kwq/kparts/part.h: Tweaked.
    
    WebKit:
    
    	Fixed a storage leak and made some other changes to go along with
    	corresponding WebCore changes.
    
    	* WebCoreSupport.subproj/IFResourceURLHandleClient.m:
    	(-[IFResourceURLHandleClient didStartLoadingWithURL:]): Added.
    	(-[IFResourceURLHandleClient didStopLoading]): Added.
    	(-[IFResourceURLHandleClient dealloc]):
    	(-[IFResourceURLHandleClient IFURLHandleResourceDidBeginLoading:]):
    	(-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]):
    	(-[IFResourceURLHandleClient IFURLHandleResourceDidFinishLoading:data:]):
    	(-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]):
    	(-[IFResourceURLHandleClient IFURLHandle:didRedirectToURL:]):
    	Use didStartLoadingWithURL and didStopLoading to cure problems where the
    	handle would be left in the data sources list of loading handles.
    
    	* WebView.subproj/IFDynamicScrollBarsView.h: Changed to conform to the
    	WebCoreFrameView protocol.
    
    	* Misc.subproj/WebKitDebug.h: Cloned improved assert code from WebFoundation.
    
    	* WebView.subproj/IFDynamicScrollBarsView.m: Fixed comment.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 24be631..a50cfc7 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,37 @@
+2002-06-19  Darin Adler  <darin at apple.com>
+
+	- fixed 2956444 -- mac os x feedback form missing textarea
+
+	* kwq/WebCoreFrameView.h: Added.
+
+	* kwq/KWQWidget.mm:
+	(QWidget::setCursor): Checked for cursor-setting call based on the
+	WebCoreFrameView protocol instead of using an informal protocol.
+	Also walk up the view chain so the cursor actually gets set.
+	(QWidget::internalSetGeometry): Changed the special case in here to use the new
+	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
+	Also add comments to explain the hack better and mention the code in QScrollView.
+
+	* kwq/KWQScrollView.mm:
+	(-[NSView _KWQ_isScrollView]): Gave these KWQ names instead of IF names.
+	(-[NSView _KWQ_getDocumentView]): Gave these KWQ names instead of IF names.
+	(QScrollView::addChild): Changed the special case in here to use the new
+	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
+	Also add comments to explain the hack better and mention the code in QWidget.
+
+	Other changes:
+
+	* kwq/kwqdebug.h: Cloned improved assert code from WebFoundation.
+
+	* kwq/KWQTextArea.h: Removed unused isReadOnly/setReadOnly.
+	* kwq/KWQTextArea.mm: Removed unused isReadOnly/setReadOnly.
+
+	* kwq/WebCoreViewFactory.h: Removed extraneous import and WebCoreCursorSetting
+	API from here.
+
+	* kwq/KWQTextEdit.mm: Tweaked.
+	* kwq/kparts/part.h: Tweaked.
+
 2002-06-18  Kenneth Kocienda  <kocienda at apple.com>
 
         Fix for this bug:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 24be631..a50cfc7 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,37 @@
+2002-06-19  Darin Adler  <darin at apple.com>
+
+	- fixed 2956444 -- mac os x feedback form missing textarea
+
+	* kwq/WebCoreFrameView.h: Added.
+
+	* kwq/KWQWidget.mm:
+	(QWidget::setCursor): Checked for cursor-setting call based on the
+	WebCoreFrameView protocol instead of using an informal protocol.
+	Also walk up the view chain so the cursor actually gets set.
+	(QWidget::internalSetGeometry): Changed the special case in here to use the new
+	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
+	Also add comments to explain the hack better and mention the code in QScrollView.
+
+	* kwq/KWQScrollView.mm:
+	(-[NSView _KWQ_isScrollView]): Gave these KWQ names instead of IF names.
+	(-[NSView _KWQ_getDocumentView]): Gave these KWQ names instead of IF names.
+	(QScrollView::addChild): Changed the special case in here to use the new
+	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
+	Also add comments to explain the hack better and mention the code in QWidget.
+
+	Other changes:
+
+	* kwq/kwqdebug.h: Cloned improved assert code from WebFoundation.
+
+	* kwq/KWQTextArea.h: Removed unused isReadOnly/setReadOnly.
+	* kwq/KWQTextArea.mm: Removed unused isReadOnly/setReadOnly.
+
+	* kwq/WebCoreViewFactory.h: Removed extraneous import and WebCoreCursorSetting
+	API from here.
+
+	* kwq/KWQTextEdit.mm: Tweaked.
+	* kwq/kparts/part.h: Tweaked.
+
 2002-06-18  Kenneth Kocienda  <kocienda at apple.com>
 
         Fix for this bug:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 24be631..a50cfc7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,37 @@
+2002-06-19  Darin Adler  <darin at apple.com>
+
+	- fixed 2956444 -- mac os x feedback form missing textarea
+
+	* kwq/WebCoreFrameView.h: Added.
+
+	* kwq/KWQWidget.mm:
+	(QWidget::setCursor): Checked for cursor-setting call based on the
+	WebCoreFrameView protocol instead of using an informal protocol.
+	Also walk up the view chain so the cursor actually gets set.
+	(QWidget::internalSetGeometry): Changed the special case in here to use the new
+	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
+	Also add comments to explain the hack better and mention the code in QScrollView.
+
+	* kwq/KWQScrollView.mm:
+	(-[NSView _KWQ_isScrollView]): Gave these KWQ names instead of IF names.
+	(-[NSView _KWQ_getDocumentView]): Gave these KWQ names instead of IF names.
+	(QScrollView::addChild): Changed the special case in here to use the new
+	WebCoreFrameView protocol, so it won't happen for all NSScrollView objects.
+	Also add comments to explain the hack better and mention the code in QWidget.
+
+	Other changes:
+
+	* kwq/kwqdebug.h: Cloned improved assert code from WebFoundation.
+
+	* kwq/KWQTextArea.h: Removed unused isReadOnly/setReadOnly.
+	* kwq/KWQTextArea.mm: Removed unused isReadOnly/setReadOnly.
+
+	* kwq/WebCoreViewFactory.h: Removed extraneous import and WebCoreCursorSetting
+	API from here.
+
+	* kwq/KWQTextEdit.mm: Tweaked.
+	* kwq/kparts/part.h: Tweaked.
+
 2002-06-18  Kenneth Kocienda  <kocienda at apple.com>
 
         Fix for this bug:
diff --git a/WebCore/kwq/KWQKPartsPart.h b/WebCore/kwq/KWQKPartsPart.h
index 1e71d4b..811b6cd 100644
--- a/WebCore/kwq/KWQKPartsPart.h
+++ b/WebCore/kwq/KWQKPartsPart.h
@@ -49,8 +49,8 @@ public:
     QWidget *widget() const { return m_widget; }
     void setWidget(QWidget *widget) { m_widget = widget; }
     
-    void ref() { m_ref++; }
-    void deref() { if(m_ref) m_ref--; if (!m_ref) delete this; }
+    void ref() { ++m_ref; }
+    void deref() { if (!--m_ref) delete this; }
     
     bool event(QEvent *event) { customEvent((QCustomEvent *)event); return true; }
     virtual void customEvent(QCustomEvent *) { }
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 9cf3ea2..b4edca2 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -25,6 +25,8 @@
 
 #import <qscrollview.h>
 
+#import <WebCoreFrameView.h>
+
 #import <kwqdebug.h>
 
 /*
@@ -34,61 +36,56 @@
 
     QScrollView's view is a NSScrollView (or subclass of NSScrollView) in most
     cases (except for provisional widgets).  That scrollview is a subview of an
-    IFWebView.  The IFWebView's documentView will also be the scroll view's 
+    WebCoreFrameView.  The WebCoreFrameView's documentView will also be the scroll view's 
     documentView.
     
-    The IFWebView's size is the frame size.  The IFWebView's documentView
+    The WebCoreFrameView's size is the frame size.  The WebCoreFrameView's documentView
     corresponds to the frame content size.  The scrollview itself is autosized to the
-    IFWebView's size (see QWidget::resize).
+    WebCoreFrameView's size (see QWidget::resize).
 */
 
- at interface NSView (IFExtensions)
-- (BOOL)_IF_isScrollView;
-- (NSView *)_IF_getDocumentView;
+ at interface NSView (KWQExtensions)
+- (BOOL)_KWQ_isScrollView;
+- (NSView *)_KWQ_getDocumentView;
 @end
 
+ at implementation NSView (KWQExtensions)
+
+- (BOOL)_KWQ_isScrollView
+{
+    return [self isKindOfClass:[NSScrollView class]];
+}
 
- at implementation NSView (IFExtensions)
-- (NSView *)_IF_getDocumentView
+- (NSView *)_KWQ_getDocumentView
 {
-    if ([self respondsToSelector: @selector(documentView)]){
-        NSScrollView *sv = (NSScrollView *)self; // Compile complains about in-line cast.
+    if ([self respondsToSelector: @selector(documentView)]) {
+        NSScrollView *sv = (NSScrollView *)self; // Compiler complains about in-line cast.
         return [sv documentView];
     }
     return nil;
 }
 
-
-- (BOOL)_IF_isScrollView
-{
-    if([self isKindOfClass: [NSScrollView class]])
-        return YES;
-    return NO;
-}
 @end
 
-
 QScrollView::QScrollView(QWidget *parent, const char *name, int f)
     : QFrame(parent)
 {
 }
 
-
 QWidget* QScrollView::viewport() const
 {
     return const_cast<QScrollView *>(this);
 }
 
-
 int QScrollView::visibleWidth() const
 {
     NSScrollView *view = (NSScrollView *)getView();
     int visibleWidth;
-    if ([view _IF_isScrollView]){
+    if ([view _KWQ_isScrollView]) {
         visibleWidth = (int)[view documentVisibleRect].size.width;
-    }
-    else
+    } else {
         visibleWidth = (int)[view bounds].size.width;
+    }
 
     return visibleWidth;
 }
@@ -99,11 +96,11 @@ int QScrollView::visibleHeight() const
     NSScrollView *view = (NSScrollView *)getView();
     int visibleHeight;
     
-    if ([view _IF_isScrollView]){
+    if ([view _KWQ_isScrollView]) {
         visibleHeight = (int)[view documentVisibleRect].size.height;
-    }
-    else
+    } else {
         visibleHeight = (int)[view bounds].size.height;
+    }
         
     return visibleHeight;
 }
@@ -112,7 +109,7 @@ int QScrollView::visibleHeight() const
 int QScrollView::contentsWidth() const
 {
     NSView *docView, *view = getView();
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         return (int)[docView bounds].size.width;
     return (int)[view bounds].size.width;
@@ -122,7 +119,7 @@ int QScrollView::contentsWidth() const
 int QScrollView::contentsHeight() const
 {
     NSView *docView, *view = getView();
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         return (int)[docView bounds].size.height;
     return (int)[view bounds].size.height;
@@ -131,7 +128,7 @@ int QScrollView::contentsHeight() const
 int QScrollView::contentsX() const
 {
     NSView *docView, *view = getView();
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         return (int)[docView bounds].origin.x;
     return 0;
@@ -140,7 +137,7 @@ int QScrollView::contentsX() const
 int QScrollView::contentsY() const
 {
     NSView *docView, *view = getView();
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         return (int)[docView bounds].origin.y;
     return 0;
@@ -164,7 +161,7 @@ void QScrollView::scrollBy(int dx, int dy)
 void QScrollView::setContentsPos(int x, int y)
 {
     NSView *docView, *view = getView();    
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         view = docView;
         
@@ -187,7 +184,7 @@ void QScrollView::setHScrollBarMode(ScrollBarMode)
 
 void QScrollView::addChild(QWidget* child, int x, int y)
 {
-    NSView *thisView, *thisDocView, *subView;
+    NSView *thisView, *thisDocView, *subview;
 
     KWQ_ASSERT(child != this);
 
@@ -195,25 +192,29 @@ void QScrollView::addChild(QWidget* child, int x, int y)
         child->move(x, y);
     
     thisView = getView();
-    thisDocView = [thisView _IF_getDocumentView];
+    thisDocView = [thisView _KWQ_getDocumentView];
     if (thisDocView)
         thisView = thisDocView;
 
-    subView = child->getView();
-    if ([subView _IF_isScrollView]) {
-        subView = [subView superview];
+    subview = child->getView();
+
+    // It's a bit of a hack, but when we are asked to add the widget for the top level of
+    // a frame, we need to instead add the containing frame widget. See also the similar
+    // code in QWidget::internalSetGeometry.
+    if ([[subview superview] conformsToProtocol:@protocol(WebCoreFrameView)]) {
+        subview = [subview superview];
     }
     
-    KWQ_ASSERT(subView != thisView);
+    KWQ_ASSERT(subview != thisView);
 
-    if ([subView superview] == thisView) {
+    if ([subview superview] == thisView) {
         return;
     }
     
-    [subView removeFromSuperview];
+    [subview removeFromSuperview];
     
-    KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "Adding %p %s at (%d,%d) w %d h %d\n", subView, [[[subView class] className] cString], x, y, (int)[subView frame].size.width, (int)[subView frame].size.height);
-    [thisView addSubview: subView];
+    KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "Adding %p %s at (%d,%d) w %d h %d\n", subview, [[[subview class] className] cString], x, y, (int)[subview frame].size.width, (int)[subview frame].size.height);
+    [thisView addSubview:subview];
 }
 
 void QScrollView::removeChild(QWidget* child)
@@ -225,8 +226,8 @@ void QScrollView::resizeContents(int w, int h)
 {
     KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "%p %s at w %d h %d\n", getView(), [[[getView() class] className] cString], w, h);
     NSView *view = getView();
-    if ([view _IF_isScrollView]){
-        view = [view _IF_getDocumentView];
+    if ([view _KWQ_isScrollView]){
+        view = [view _KWQ_getDocumentView];
         
         KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "%p %s at w %d h %d\n", view, [[[view class] className] cString], w, h);
         if (w < 0)
@@ -244,8 +245,8 @@ void QScrollView::updateContents(int x, int y, int w, int h)
 {
     NSView *view = getView();
 
-    if ([view _IF_isScrollView])
-        view = [view _IF_getDocumentView];
+    if ([view _KWQ_isScrollView])
+        view = [view _KWQ_getDocumentView];
 
     [view displayRect: NSMakeRect (x, y, w, h)];
 }
@@ -255,7 +256,6 @@ void QScrollView::updateContents(const QRect &rect)
     return updateContents(rect.x(), rect.y(), rect.width(), rect.height());
 }
 
-
 void QScrollView::repaintContents(int x, int y, int w, int h, bool erase)
 {
     KWQDEBUGLEVEL (KWQ_LOG_FRAMES, "%p %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
@@ -272,7 +272,7 @@ void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
 {
     NSView *docView, *view = getView();    
      
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         view = docView;
         
@@ -286,7 +286,7 @@ void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
 {
     NSView *docView, *view = getView();    
 
-    docView = [view _IF_getDocumentView];
+    docView = [view _KWQ_getDocumentView];
     if (docView)
         view = docView;
         
diff --git a/WebCore/kwq/KWQTextArea.h b/WebCore/kwq/KWQTextArea.h
index a936943..e7605f9 100644
--- a/WebCore/kwq/KWQTextArea.h
+++ b/WebCore/kwq/KWQTextArea.h
@@ -25,29 +25,25 @@
  
 #import <Cocoa/Cocoa.h>
 
-
 class QWidget;
 
-
 @interface KWQTextArea : NSScrollView
 {
     NSTextView *textView;
     QWidget *widget;
     BOOL wrap;
 }
-- initWithFrame: (NSRect)r widget: (QWidget *)w; 
+- initWithFrame:(NSRect)r widget:(QWidget *)w; 
 
 // The following methods corresponds to methods required by KDE.
-- (void) setWordWrap: (BOOL)f;
-- (BOOL) wordWrap;
-- (BOOL) isReadOnly;
-- (void) setReadOnly: (BOOL)flag;
-- (void) setText: (NSString *)s;
+- (void)setWordWrap:(BOOL)wrap;
+- (BOOL)wordWrap;
+- (void)setText:(NSString *)s;
 - (NSString *)text;
-- (NSString *)textForLine: (int)line;
-- (int) numLines;
-- (void) selectAll;
-- (void) setEditable: (BOOL)flag;
+- (int)numLines;
+- (NSString *)textForLine:(int)line;
+- (void)selectAll;
+- (void)setEditable:(BOOL)flag;
 - (BOOL)isEditable;
 
 // paragraph-oriented functions for the benefit of QTextEdit
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 2cf89ad..a98ad14 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -22,10 +22,11 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
-#import <qwidget.h>
 
 #import <KWQTextArea.h>
 
+#import <qwidget.h>
+
 /*
     This widget is used to implement the <TEXTAREA> element.
     
@@ -37,24 +38,23 @@
               OFF - Text is not wrapped.  It is kept to single line, although if
                     the user enters a return the line IS broken.  This emulates
                     Mac IE 5.1.
-     SOFT|VIRUTAL - Text is wrapped, but not actually broken.  
+     SOFT|VIRTUAL - Text is wrapped, but not actually broken.  
     HARD|PHYSICAL - Text is wrapped, and text is broken into seperate lines.
                          
-    kde expects a line based widget.  It uses a line API to convert text into multiple lines
-    when wrapping is set to HARD.  To support kde with implement [textLine] and [numLines].
+    KDE expects a line based widget.  It uses a line API to convert text into multiple lines
+    when wrapping is set to HARD.  To support KDE we implement [textLine] and [numLines].
     
-    If the wrap mode HARD kde will repeatedly call textForLine: (via emulated API in KWQTextEdit)
+    If the wrap mode HARD KDE will repeatedly call textForLine: (via emulated API in KWQTextEdit)
     to construct the text with inserted \n.
 */
 
-
 @implementation KWQTextArea
 
 const float LargeNumberForText = 1.0e7;
 
-- initWithFrame: (NSRect)r
+- initWithFrame:(NSRect)r
 {
-    return [self initWithFrame: r widget: 0];
+    return [self initWithFrame:r widget:0];
 }
 
 - (void)_createTextView
@@ -67,35 +67,35 @@ const float LargeNumberForText = 1.0e7;
     
     textFrame.origin.x = textFrame.origin.y = 0;
     if (frame.size.width > 0 && frame.size.height > 0)
-        textFrame.size = [NSScrollView contentSizeForFrameSize:frame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType: [self borderType]];
+        textFrame.size = [NSScrollView contentSizeForFrameSize:frame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType:[self borderType]];
     else {
         textFrame.size.width = LargeNumberForText;
         textFrame.size.height = LargeNumberForText;
     }
         
-    textView = [[NSTextView alloc] initWithFrame: textFrame];
-    [[textView textContainer] setWidthTracksTextView: YES];
+    textView = [[NSTextView alloc] initWithFrame:textFrame];
+    [[textView textContainer] setWidthTracksTextView:YES];
     
     // Setup attributes for default cases WRAP=SOFT|VIRTUAL and WRAP=HARD|PHYSICAL.
     // If WRAP=OFF we reset many of these attributes.
-    [style setLineBreakMode: NSLineBreakByWordWrapping];
-    [style setAlignment: NSLeftTextAlignment];
-    attr = [NSDictionary dictionaryWithObjectsAndKeys: style, NSParagraphStyleAttributeName, nil];
-    [textView setTypingAttributes: attr];
-    [textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+    [style setLineBreakMode:NSLineBreakByWordWrapping];
+    [style setAlignment:NSLeftTextAlignment];
+    attr = [NSDictionary dictionaryWithObjectsAndKeys:style, NSParagraphStyleAttributeName, nil];
+    [textView setTypingAttributes:attr];
+    [textView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
 
-    [textView setDelegate: self];
+    [textView setDelegate:self];
     
-    [self setDocumentView: textView];
+    [self setDocumentView:textView];
 }
 
-- initWithFrame: (NSRect) r widget: (QWidget *)w 
+- initWithFrame:(NSRect)r widget:(QWidget *)w 
 {
-    [super initWithFrame: r];
+    [super initWithFrame:r];
 
-    [self setHasVerticalScroller: YES];
-    [self setHasHorizontalScroller: NO];
-    [self setBorderType: NSLineBorder];
+    [self setHasVerticalScroller:YES];
+    [self setHasHorizontalScroller:NO];
+    [self setBorderType:NSLineBorder];
 
     //if (r.size.width > 0 && r.size.height > 0)
         [self _createTextView];
@@ -112,7 +112,7 @@ const float LargeNumberForText = 1.0e7;
 }
 
 
-- (void) setWordWrap: (BOOL)f
+- (void)setWordWrap:(BOOL)f
 {
     if (f == wrap)
         return;
@@ -122,67 +122,53 @@ const float LargeNumberForText = 1.0e7;
     NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
     
     if (f){
-        [self setHasHorizontalScroller: NO];
-        [textView setHorizontallyResizable: NO];
-        [[textView textContainer] setWidthTracksTextView: NO];
-        [style setLineBreakMode: NSLineBreakByWordWrapping];
+        [self setHasHorizontalScroller:NO];
+        [textView setHorizontallyResizable:NO];
+        [[textView textContainer] setWidthTracksTextView:NO];
+        [style setLineBreakMode:NSLineBreakByWordWrapping];
     }
     else {
         [self setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
         [[self contentView] setAutoresizesSubviews:YES];
-        [self setHasHorizontalScroller: YES];
+        [self setHasHorizontalScroller:YES];
 
         [[textView textContainer] setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
         [[textView textContainer] setWidthTracksTextView:NO];
         [[textView textContainer] setHeightTracksTextView:NO];
 
-        [textView setMinSize: [textView frame].size];
+        [textView setMinSize:[textView frame].size];
         [textView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
-        [textView setHorizontallyResizable: YES];
+        [textView setHorizontallyResizable:YES];
 
-        [style setLineBreakMode: NSLineBreakByClipping];
+        [style setLineBreakMode:NSLineBreakByClipping];
     }
     
-    [style setAlignment: NSLeftTextAlignment];
-    attr = [NSDictionary dictionaryWithObjectsAndKeys: style, NSParagraphStyleAttributeName, nil];
+    [style setAlignment:NSLeftTextAlignment];
+    attr = [NSDictionary dictionaryWithObjectsAndKeys:style, NSParagraphStyleAttributeName, nil];
     
     [textView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
-    [textView setTypingAttributes: attr];
+    [textView setTypingAttributes:attr];
     
     wrap = f;
 }
 
 
-- (BOOL) wordWrap
+- (BOOL)wordWrap
 {
     return wrap;
 }
 
-
-- (BOOL) isReadOnly
-{
-    return [textView isEditable] ? NO : YES;
-}
-
-
-- (void) setReadOnly: (BOOL)flag
-{
-    return [textView setEditable: flag?NO:YES];
-}
-
-- (void) setText: (NSString *)s
+- (void)setText:(NSString *)s
 {
-    [textView setString: s];
+    [textView setString:s];
 }
 
-
 - (NSString *)text
 {
     return [textView string];
 }
 
-
-- (NSString *)textForLine: (int)line
+- (NSString *)textForLine:(int)line
 {
     NSRange glyphRange = NSMakeRange(0,0), characterRange;
     int lineCount = 0;
@@ -195,8 +181,8 @@ const float LargeNumberForText = 1.0e7;
         characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL];
         if (line == lineCount){
             // I hope this works, the alternative is
-            // [[view string] substringWithRange: characterRange]
-            stringLine = [[[textView textStorage] attributedSubstringFromRange: characterRange] string];
+            // [[view string] substringWithRange:characterRange]
+            stringLine = [[[textView textStorage] attributedSubstringFromRange:characterRange] string];
             return stringLine;
         }
         lineCount++;
@@ -220,18 +206,17 @@ const float LargeNumberForText = 1.0e7;
 }
 
 
-- (void) selectAll
+- (void)selectAll
 {
-    [textView setSelectedRange: NSMakeRange(0, [[textView textStorage] length])];
+    [textView setSelectedRange:NSMakeRange(0, [[textView textStorage] length])];
 }
 
 
-- (void) setEditable: (BOOL)flag
+- (void)setEditable:(BOOL)flag
 {
     [textView setEditable: flag];
 }
 
-
 - (BOOL)isEditable
 {
     return [textView isEditable];
@@ -400,7 +385,6 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
     // FIXME: is this right? Cocoa text view docs are impenetrable
     NSString *text = [textView string];
     NSRange range = RangeOfParagraph(text, paragraph);
-
     if (range.location == NSNotFound) {
 	[textView setMarkedText:@"" selectedRange:NSMakeRange([text length], 0)];
     } else {
@@ -409,6 +393,3 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
 }
 
 @end
-
-
-
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index a0b6984..d7f2706 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -27,28 +27,23 @@
 
 #import <KWQTextArea.h>
 
-#import <kwqdebug.h>
-
 QTextEdit::QTextEdit(QWidget *parent)
 {
-    KWQTextArea *textView;
-    
-    textView = [[KWQTextArea alloc] initWithFrame:NSMakeRect(0,0,0,0) widget: this];
-    setView (textView);
+    KWQTextArea *textView = [[KWQTextArea alloc] initWithFrame:NSMakeRect(0,0,0,0) widget:this];
+    setView(textView);
     [textView release];
 }
 
 void QTextEdit::setText(const QString &string)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    
-    [textView setText:QSTRING_TO_NSSTRING (string)];
+    [textView setText:string.getNSString()];
 }
 
 QString QTextEdit::text()
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    return NSSTRING_TO_QSTRING ([textView text]);
+    return QString::fromNSString([textView text]);
 }
 
 int QTextEdit::paragraphs() const
@@ -66,7 +61,7 @@ int QTextEdit::paragraphLength(int paragraph) const
 QString QTextEdit::text(int paragraph)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    return NSSTRING_TO_QSTRING([textView textForParagraph:paragraph]);
+    return QString::fromNSString([textView textForParagraph:paragraph]);
 }
 
 int QTextEdit::lineOfChar(int paragraph, int index)
@@ -90,47 +85,33 @@ void QTextEdit::setCursorPosition(int paragraph, int index)
 QTextEdit::WrapStyle QTextEdit::wordWrap() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    
-    if ([textView wordWrap]) {
-        return QTextEdit::WidgetWidth;
-    } else {
-	return QTextEdit::NoWrap;
-    }
+    return [textView wordWrap] ? WidgetWidth : NoWrap;
 }
 
-void QTextEdit::setWordWrap(WrapStyle f)
+void QTextEdit::setWordWrap(WrapStyle style)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-
-    if (f == QTextEdit::WidgetWidth) {
-        [textView setWordWrap: TRUE];
-    } else {
-        [textView setWordWrap: FALSE];
-    }
+    [textView setWordWrap:style == WidgetWidth];
 }
 
-void QTextEdit::setTextFormat(TextFormat f)
+void QTextEdit::setTextFormat(TextFormat)
 {
-    if (f != PlainText) {
-	_logNotYetImplemented();
-    }
 }
 
 void QTextEdit::setTabStopWidth(int)
 {
-	_logNotYetImplemented();
 }
 
-bool QTextEdit::isReadOnly () const
+bool QTextEdit::isReadOnly() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    return [textView isEditable] ? NO : YES;
+    return ![textView isEditable];
 }
 
-void QTextEdit::setReadOnly (bool flag)
+void QTextEdit::setReadOnly(bool flag)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    [textView setEditable: (BOOL)flag ? NO : YES];
+    [textView setEditable:!flag];
 }
 
 void QTextEdit::selectAll()
@@ -142,11 +123,11 @@ void QTextEdit::selectAll()
 int QTextEdit::verticalScrollBarWidth() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    return (int) [[textView verticalScroller] frame].size.width;
+    return (int)[[textView verticalScroller] frame].size.width;
 }
 
 int QTextEdit::horizontalScrollBarHeight() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    return (int) [[textView horizontalScroller] frame].size.height;
+    return (int)[[textView horizontalScroller] frame].size.height;
 }
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index ef37679..be7ced6 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -25,12 +25,12 @@
 
 #import <qwidget.h>
 
-#import <WebCoreViewFactory.h>
-
-#import <kwqdebug.h>
+#import <WebCoreFrameView.h>
 
 #import <KWQView.h>
 
+#import <kwqdebug.h>
+
 /*
     A QWidget rougly corresponds to an NSView.  In Qt a QFrame and QMainWindow inherit
     from a QWidget.  In Cocoa a NSWindow does not inherit from NSView.  We
@@ -267,9 +267,12 @@ void QWidget::setCursor(const QCursor &cur)
 {
     data->cursor = cur;
     
-    id view = data->view;
-    if ([view respondsToSelector:@selector(setCursor:)]) { 
-        [view setCursor:data->cursor.handle()];
+    NSView *view = data->view;
+    while (view) {
+        if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) { 
+            [view setCursor:data->cursor.handle()];
+        }
+        view = [view superview];
     }
 }
 
@@ -309,11 +312,15 @@ void QWidget::hide()
 
 void QWidget::internalSetGeometry(int x, int y, int w, int h)
 {
-    id view = getView();
-    // If we're an scroll view, that means we're a khtmlview, so get
-    // the IFWebView and resize that.
-    if ([view isKindOfClass: [NSScrollView class]])
-       view = [view superview];
+    NSView *view = getView();
+    
+    // It's a bit of a hack, but when we resize the widget for the top level of
+    // a frame, we need to resize the containing frame widget also. See also
+    // the similar code in QScrollView::addChild.
+    if ([[view superview] conformsToProtocol:@protocol(WebCoreFrameView)]) {
+        view = [view superview];
+    }
+    
     [view setFrame:NSMakeRect(x, y, w, h)];
 }
 
diff --git a/WebCore/kwq/WebCoreResourceLoader.h b/WebCore/kwq/WebCoreFrameView.h
similarity index 84%
copy from WebCore/kwq/WebCoreResourceLoader.h
copy to WebCore/kwq/WebCoreFrameView.h
index d7e3e23..438b736 100644
--- a/WebCore/kwq/WebCoreResourceLoader.h
+++ b/WebCore/kwq/WebCoreFrameView.h
@@ -23,14 +23,12 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import <Foundation/Foundation.h>
+ at class NSCursor;
 
- at protocol WebCoreResourceLoader <NSObject>
-
-- (void)addData:(NSData *)data;
-
-// Either cancel or finish will be called before the loader is released, but never both.
-- (void)cancel;
-- (void)finish;
+// Among other things, this protocol is a way for an NSScrollView to detect
+// that the view it's embedded in is one that should be resized when the
+// scroll view is resized.
 
+ at protocol WebCoreFrameView
+- (void)setCursor:(NSCursor *)cursor;
 @end
diff --git a/WebCore/kwq/WebCoreViewFactory.h b/WebCore/kwq/WebCoreViewFactory.h
index eb07f27..e2cfdcc 100644
--- a/WebCore/kwq/WebCoreViewFactory.h
+++ b/WebCore/kwq/WebCoreViewFactory.h
@@ -23,9 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import <Cocoa/Cocoa.h>
-
 @class NSArray;
+ at class NSDictionary;
 @class NSString;
 @class NSView;
 
@@ -51,7 +50,3 @@
 - (NSArray *)mimeTypes; // array of NSArrays with 3 parts of MIME type in each
 
 @end
-
- at protocol WebCoreCursorSetting
-- (void)setCursor:(NSCursor *)cursor;
- at end
diff --git a/WebCore/kwq/kparts/part.h b/WebCore/kwq/kparts/part.h
index 1e71d4b..811b6cd 100644
--- a/WebCore/kwq/kparts/part.h
+++ b/WebCore/kwq/kparts/part.h
@@ -49,8 +49,8 @@ public:
     QWidget *widget() const { return m_widget; }
     void setWidget(QWidget *widget) { m_widget = widget; }
     
-    void ref() { m_ref++; }
-    void deref() { if(m_ref) m_ref--; if (!m_ref) delete this; }
+    void ref() { ++m_ref; }
+    void deref() { if (!--m_ref) delete this; }
     
     bool event(QEvent *event) { customEvent((QCustomEvent *)event); return true; }
     virtual void customEvent(QCustomEvent *) { }
diff --git a/WebCore/kwq/kwqdebug.h b/WebCore/kwq/kwqdebug.h
index d66c622..9f74d96 100644
--- a/WebCore/kwq/kwqdebug.h
+++ b/WebCore/kwq/kwqdebug.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -89,32 +89,32 @@ void KWQLog(unsigned int level, const char *file, int line, const char *function
 #import <sys/time.h>
 #import <sys/resource.h>
 
-#define KWQ_ASSERTION_FAILURE \
+#define KWQ_ASSERTION_FAILURE(str_expr) \
     do { \
         struct rlimit _rlimit = {RLIM_INFINITY, RLIM_INFINITY}; \
         setrlimit(RLIMIT_CORE, &_rlimit); \
-        fprintf(stderr, "=================\nASSERTION FAILURE at %s:%d %s\n=================\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+            fprintf(stderr, "=================\nASSERTION FAILED: %s (%s:%d %s)\n=================\n", str_expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
         raise(SIGQUIT); \
     } while (0)
 
 #define KWQ_ASSERT(expr) \
     do { \
         if (!(expr)) { \
-            KWQ_ASSERTION_FAILURE; \
+            KWQ_ASSERTION_FAILURE(#expr); \
         } \
     } while (0)
 
-#define KWQ_ASSERT_VALID_ARG(arg,expr) \
+#define KWQ_ASSERT_VALID_ARG(arg, expr) \
     do { \
         if (!(expr)) { \
-            KWQ_ASSERTION_FAILURE; \
+            KWQ_ASSERTION_FAILURE("bad arg " #arg " (" #expr ")"); \
         } \
     } while (0)
-
+    
 #define KWQ_ASSERT_NOT_NIL(arg) \
     do { \
         if ((arg) == nil) { \
-            KWQ_ASSERTION_FAILURE; \
+            KWQ_ASSERTION_FAILURE("bad arg " #arg " (" #arg " not nil )"); \
         } \
     } while (0)
 
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 38e6f43..d220ec7 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2002-06-19  Darin Adler  <darin at apple.com>
+
+	Fixed a storage leak and made some other changes to go along with
+	corresponding WebCore changes.
+
+	* WebCoreSupport.subproj/IFResourceURLHandleClient.m:
+	(-[IFResourceURLHandleClient didStartLoadingWithURL:]): Added.
+	(-[IFResourceURLHandleClient didStopLoading]): Added.
+	(-[IFResourceURLHandleClient dealloc]):
+	(-[IFResourceURLHandleClient IFURLHandleResourceDidBeginLoading:]):
+	(-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]):
+	(-[IFResourceURLHandleClient IFURLHandleResourceDidFinishLoading:data:]):
+	(-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]):
+	(-[IFResourceURLHandleClient IFURLHandle:didRedirectToURL:]):
+	Use didStartLoadingWithURL and didStopLoading to cure problems where the
+	handle would be left in the data sources list of loading handles.
+
+	* WebView.subproj/IFDynamicScrollBarsView.h: Changed to conform to the
+	WebCoreFrameView protocol.
+
+	* Misc.subproj/WebKitDebug.h: Cloned improved assert code from WebFoundation.
+
+	* WebView.subproj/IFDynamicScrollBarsView.m: Fixed comment.
+
 2002-06-19  Chris Blumenberg  <cblu at apple.com>
 
 	Call setWindow in layout so that plug-in content is drawn without 
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 38e6f43..d220ec7 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,27 @@
+2002-06-19  Darin Adler  <darin at apple.com>
+
+	Fixed a storage leak and made some other changes to go along with
+	corresponding WebCore changes.
+
+	* WebCoreSupport.subproj/IFResourceURLHandleClient.m:
+	(-[IFResourceURLHandleClient didStartLoadingWithURL:]): Added.
+	(-[IFResourceURLHandleClient didStopLoading]): Added.
+	(-[IFResourceURLHandleClient dealloc]):
+	(-[IFResourceURLHandleClient IFURLHandleResourceDidBeginLoading:]):
+	(-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]):
+	(-[IFResourceURLHandleClient IFURLHandleResourceDidFinishLoading:data:]):
+	(-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]):
+	(-[IFResourceURLHandleClient IFURLHandle:didRedirectToURL:]):
+	Use didStartLoadingWithURL and didStopLoading to cure problems where the
+	handle would be left in the data sources list of loading handles.
+
+	* WebView.subproj/IFDynamicScrollBarsView.h: Changed to conform to the
+	WebCoreFrameView protocol.
+
+	* Misc.subproj/WebKitDebug.h: Cloned improved assert code from WebFoundation.
+
+	* WebView.subproj/IFDynamicScrollBarsView.m: Fixed comment.
+
 2002-06-19  Chris Blumenberg  <cblu at apple.com>
 
 	Call setWindow in layout so that plug-in content is drawn without 
diff --git a/WebKit/Misc.subproj/WebKitDebug.h b/WebKit/Misc.subproj/WebKitDebug.h
index cb7c4b5..eb84a02 100644
--- a/WebKit/Misc.subproj/WebKitDebug.h
+++ b/WebKit/Misc.subproj/WebKitDebug.h
@@ -1,5 +1,5 @@
 /*	WebKitDebug.h
-	Copyright 2001, Apple, Inc. All rights reserved.
+	Copyright 2001, 2002, Apple, Inc. All rights reserved.
 */
 
 #import <Foundation/Foundation.h>
@@ -79,32 +79,32 @@ void WebKitLog(unsigned int level, const char *file, int line, const char *funct
 #import <sys/time.h>
 #import <sys/resource.h>
 
-#define WEBKIT_ASSERTION_FAILURE \
+#define WEBKIT_ASSERTION_FAILURE(str_expr) \
     do { \
         struct rlimit _rlimit = {RLIM_INFINITY, RLIM_INFINITY}; \
         setrlimit(RLIMIT_CORE, &_rlimit); \
-        fprintf(stderr, "=================\nASSERTION FAILURE at %s:%d %s\n=================\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+            fprintf(stderr, "=================\nASSERTION FAILED: %s (%s:%d %s)\n=================\n", str_expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
         raise(SIGQUIT); \
     } while (0)
 
 #define WEBKIT_ASSERT(expr) \
     do { \
         if (!(expr)) { \
-            WEBKIT_ASSERTION_FAILURE; \
+            WEBKIT_ASSERTION_FAILURE(#expr); \
         } \
     } while (0)
 
-#define WEBKIT_ASSERT_VALID_ARG(arg,expr) \
+#define WEBKIT_ASSERT_VALID_ARG(arg, expr) \
     do { \
         if (!(expr)) { \
-            WEBKIT_ASSERTION_FAILURE; \
+            WEBKIT_ASSERTION_FAILURE("bad arg " #arg " (" #expr ")"); \
         } \
     } while (0)
     
 #define WEBKIT_ASSERT_NOT_NIL(arg) \
     do { \
         if ((arg) == nil) { \
-            WEBKIT_ASSERTION_FAILURE; \
+            WEBKIT_ASSERTION_FAILURE("bad arg " #arg " (" #arg " not nil )"); \
         } \
     } while (0)
 
diff --git a/WebKit/WebCoreSupport.subproj/IFResourceURLHandleClient.m b/WebKit/WebCoreSupport.subproj/IFResourceURLHandleClient.m
index 6aed69a..4ee225c 100644
--- a/WebKit/WebCoreSupport.subproj/IFResourceURLHandleClient.m
+++ b/WebKit/WebCoreSupport.subproj/IFResourceURLHandleClient.m
@@ -31,12 +31,29 @@
     return self;
 }
 
+- (void)didStartLoadingWithURL:(NSURL *)URL
+{
+    WEBKIT_ASSERT(currentURL == nil);
+    currentURL = [URL retain];
+    [[dataSource controller] _didStartLoading:currentURL];
+}
+
+- (void)didStopLoading
+{
+    WEBKIT_ASSERT(currentURL != nil);
+    [[dataSource controller] _didStopLoading:currentURL];
+    [currentURL release];
+    currentURL = nil;
+}
+
 - (void)dealloc
 {
 #ifdef WEBFOUNDATION_LOAD_MESSAGES_FIXED
     WEBKIT_ASSERT(currentURL == nil);
 #else
-    [currentURL release];
+    if (currentURL) {
+        [self didStopLoading];
+    }
 #endif
     
     [loader release];
@@ -82,10 +99,7 @@
 
 - (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)handle
 {
-    WEBKIT_ASSERT(currentURL == nil);
-
-    currentURL = [[handle url] retain];
-    [[dataSource controller] _didStartLoading:[handle url]];
+    [self didStartLoadingWithURL:[handle url]];
     [self receivedProgressWithHandle:handle complete: NO];
 }
 
@@ -113,10 +127,8 @@
     
     [[dataSource controller] _receivedProgress:[IFLoadProgress progress]
         forResourceHandle:handle fromDataSource:dataSource complete: YES];
-    [[dataSource controller] _didStopLoading:[handle url]];
-    
-    [currentURL release];
-    currentURL = nil;
+
+    [self didStopLoading];
 }
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)handle data:(NSData *)data
@@ -136,15 +148,14 @@
     }
     
     [self receivedProgressWithHandle:handle complete: YES];
-
-    [[dataSource controller] _didStopLoading:[handle url]];
     
-    [currentURL release];
-    currentURL = nil;
+    [self didStopLoading];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)handle resourceDidFailLoadingWithResult:(IFError *)error
 {
+    // FIXME: This assert starting firing, so I made it lenient like the cancel one above.
+    // I don't know what's going on.
 #ifdef WEBFOUNDATION_LOAD_MESSAGES_FIXED
     WEBKIT_ASSERT([currentURL isEqual:[handle redirectedURL] ? [handle redirectedURL] : [handle url]]);
 #else
@@ -157,10 +168,8 @@
     
     [[dataSource controller] _receivedError:error forResourceHandle:handle
         partialProgress:[IFLoadProgress progressWithURLHandle:handle] fromDataSource:dataSource];
-    [[dataSource controller] _didStopLoading:[handle url]];
-    
-    [currentURL release];
-    currentURL = nil;
+
+    [self didStopLoading];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)handle didRedirectToURL:(NSURL *)URL
@@ -168,18 +177,18 @@
     WEBKIT_ASSERT(currentURL != nil);
     WEBKIT_ASSERT([URL isEqual:[handle redirectedURL]]);
 
-    [[dataSource controller] _didStopLoading:currentURL];
-
     [dataSource _setFinalURL:URL];
     [[dataSource _bridge] setURL:URL];
 
+    // FIXME: We do want to tell the client about redirects.
+    // But the current API doesn't give any way to tell redirects on
+    // the main page from redirects on subresources, so for now we are
+    // just disabling this. Before, we had code that tried to send the
+    // redirect, but sent it to the wrong object.
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
     
-    [[dataSource controller] _didStartLoading:URL];
-    
-    [URL retain];
-    [currentURL release];
-    currentURL = URL;
+    [self didStopLoading];
+    [self didStartLoadingWithURL:URL];
 }
 
 @end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 6aed69a..4ee225c 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -31,12 +31,29 @@
     return self;
 }
 
+- (void)didStartLoadingWithURL:(NSURL *)URL
+{
+    WEBKIT_ASSERT(currentURL == nil);
+    currentURL = [URL retain];
+    [[dataSource controller] _didStartLoading:currentURL];
+}
+
+- (void)didStopLoading
+{
+    WEBKIT_ASSERT(currentURL != nil);
+    [[dataSource controller] _didStopLoading:currentURL];
+    [currentURL release];
+    currentURL = nil;
+}
+
 - (void)dealloc
 {
 #ifdef WEBFOUNDATION_LOAD_MESSAGES_FIXED
     WEBKIT_ASSERT(currentURL == nil);
 #else
-    [currentURL release];
+    if (currentURL) {
+        [self didStopLoading];
+    }
 #endif
     
     [loader release];
@@ -82,10 +99,7 @@
 
 - (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)handle
 {
-    WEBKIT_ASSERT(currentURL == nil);
-
-    currentURL = [[handle url] retain];
-    [[dataSource controller] _didStartLoading:[handle url]];
+    [self didStartLoadingWithURL:[handle url]];
     [self receivedProgressWithHandle:handle complete: NO];
 }
 
@@ -113,10 +127,8 @@
     
     [[dataSource controller] _receivedProgress:[IFLoadProgress progress]
         forResourceHandle:handle fromDataSource:dataSource complete: YES];
-    [[dataSource controller] _didStopLoading:[handle url]];
-    
-    [currentURL release];
-    currentURL = nil;
+
+    [self didStopLoading];
 }
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)handle data:(NSData *)data
@@ -136,15 +148,14 @@
     }
     
     [self receivedProgressWithHandle:handle complete: YES];
-
-    [[dataSource controller] _didStopLoading:[handle url]];
     
-    [currentURL release];
-    currentURL = nil;
+    [self didStopLoading];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)handle resourceDidFailLoadingWithResult:(IFError *)error
 {
+    // FIXME: This assert starting firing, so I made it lenient like the cancel one above.
+    // I don't know what's going on.
 #ifdef WEBFOUNDATION_LOAD_MESSAGES_FIXED
     WEBKIT_ASSERT([currentURL isEqual:[handle redirectedURL] ? [handle redirectedURL] : [handle url]]);
 #else
@@ -157,10 +168,8 @@
     
     [[dataSource controller] _receivedError:error forResourceHandle:handle
         partialProgress:[IFLoadProgress progressWithURLHandle:handle] fromDataSource:dataSource];
-    [[dataSource controller] _didStopLoading:[handle url]];
-    
-    [currentURL release];
-    currentURL = nil;
+
+    [self didStopLoading];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)handle didRedirectToURL:(NSURL *)URL
@@ -168,18 +177,18 @@
     WEBKIT_ASSERT(currentURL != nil);
     WEBKIT_ASSERT([URL isEqual:[handle redirectedURL]]);
 
-    [[dataSource controller] _didStopLoading:currentURL];
-
     [dataSource _setFinalURL:URL];
     [[dataSource _bridge] setURL:URL];
 
+    // FIXME: We do want to tell the client about redirects.
+    // But the current API doesn't give any way to tell redirects on
+    // the main page from redirects on subresources, so for now we are
+    // just disabling this. Before, we had code that tried to send the
+    // redirect, but sent it to the wrong object.
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
     
-    [[dataSource controller] _didStartLoading:URL];
-    
-    [URL retain];
-    [currentURL release];
-    currentURL = URL;
+    [self didStopLoading];
+    [self didStartLoadingWithURL:URL];
 }
 
 @end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 6aed69a..4ee225c 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -31,12 +31,29 @@
     return self;
 }
 
+- (void)didStartLoadingWithURL:(NSURL *)URL
+{
+    WEBKIT_ASSERT(currentURL == nil);
+    currentURL = [URL retain];
+    [[dataSource controller] _didStartLoading:currentURL];
+}
+
+- (void)didStopLoading
+{
+    WEBKIT_ASSERT(currentURL != nil);
+    [[dataSource controller] _didStopLoading:currentURL];
+    [currentURL release];
+    currentURL = nil;
+}
+
 - (void)dealloc
 {
 #ifdef WEBFOUNDATION_LOAD_MESSAGES_FIXED
     WEBKIT_ASSERT(currentURL == nil);
 #else
-    [currentURL release];
+    if (currentURL) {
+        [self didStopLoading];
+    }
 #endif
     
     [loader release];
@@ -82,10 +99,7 @@
 
 - (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)handle
 {
-    WEBKIT_ASSERT(currentURL == nil);
-
-    currentURL = [[handle url] retain];
-    [[dataSource controller] _didStartLoading:[handle url]];
+    [self didStartLoadingWithURL:[handle url]];
     [self receivedProgressWithHandle:handle complete: NO];
 }
 
@@ -113,10 +127,8 @@
     
     [[dataSource controller] _receivedProgress:[IFLoadProgress progress]
         forResourceHandle:handle fromDataSource:dataSource complete: YES];
-    [[dataSource controller] _didStopLoading:[handle url]];
-    
-    [currentURL release];
-    currentURL = nil;
+
+    [self didStopLoading];
 }
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)handle data:(NSData *)data
@@ -136,15 +148,14 @@
     }
     
     [self receivedProgressWithHandle:handle complete: YES];
-
-    [[dataSource controller] _didStopLoading:[handle url]];
     
-    [currentURL release];
-    currentURL = nil;
+    [self didStopLoading];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)handle resourceDidFailLoadingWithResult:(IFError *)error
 {
+    // FIXME: This assert starting firing, so I made it lenient like the cancel one above.
+    // I don't know what's going on.
 #ifdef WEBFOUNDATION_LOAD_MESSAGES_FIXED
     WEBKIT_ASSERT([currentURL isEqual:[handle redirectedURL] ? [handle redirectedURL] : [handle url]]);
 #else
@@ -157,10 +168,8 @@
     
     [[dataSource controller] _receivedError:error forResourceHandle:handle
         partialProgress:[IFLoadProgress progressWithURLHandle:handle] fromDataSource:dataSource];
-    [[dataSource controller] _didStopLoading:[handle url]];
-    
-    [currentURL release];
-    currentURL = nil;
+
+    [self didStopLoading];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)handle didRedirectToURL:(NSURL *)URL
@@ -168,18 +177,18 @@
     WEBKIT_ASSERT(currentURL != nil);
     WEBKIT_ASSERT([URL isEqual:[handle redirectedURL]]);
 
-    [[dataSource controller] _didStopLoading:currentURL];
-
     [dataSource _setFinalURL:URL];
     [[dataSource _bridge] setURL:URL];
 
+    // FIXME: We do want to tell the client about redirects.
+    // But the current API doesn't give any way to tell redirects on
+    // the main page from redirects on subresources, so for now we are
+    // just disabling this. Before, we had code that tried to send the
+    // redirect, but sent it to the wrong object.
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
     
-    [[dataSource controller] _didStartLoading:URL];
-    
-    [URL retain];
-    [currentURL release];
-    currentURL = URL;
+    [self didStopLoading];
+    [self didStartLoadingWithURL:URL];
 }
 
 @end
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
index 57c4605..e4d58f0 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
@@ -1,14 +1,20 @@
 //
-//  DynamicScrollBarsView.h
-//  WebBrowser
+//  IFDynamicScrollBarsView.h
+//  WebKit
 //
 //  Created by John Sullivan on Tue Jan 22 2002.
-//  Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
+//  Copyright (c) 2001, 2002 Apple Computer, Inc. All rights reserved.
 //
 
 #import <Cocoa/Cocoa.h>
 
- at interface IFDynamicScrollBarsView : NSScrollView 
+#import <WebCoreFrameView.h>
+
+// FIXME: This has grown to be more than just a dynamic scroll bar view.
+// We want to rename this class at least, and perhaps break it up into
+// more than one class.
+
+ at interface IFDynamicScrollBarsView : NSScrollView <WebCoreFrameView>
 {
     NSCursor *cursor;
     BOOL breakRecursionCycle;
@@ -18,7 +24,6 @@
 - (void)setAllowsScrolling: (BOOL)flag;
 - (BOOL)allowsScrolling;
 - (void)updateScrollers;
-- (void)setCursor:(NSCursor *)cur;
 - (void)resetCursorRects;
 
 @end
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
index 51891df..76256fc 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
@@ -1,9 +1,9 @@
 //
-//  DynamicScrollBarsView.m
-//  WebBrowser
+//  IFDynamicScrollBarsView.m
+//  WebKit
 //
 //  Created by John Sullivan on Tue Jan 22 2002.
-//  Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
+//  Copyright (c) 2001, 2002 Apple Computer, Inc. All rights reserved.
 //
 
 #import <WebKit/IFDynamicScrollBarsView.h>
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
index 57c4605..e4d58f0 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
@@ -1,14 +1,20 @@
 //
-//  DynamicScrollBarsView.h
-//  WebBrowser
+//  IFDynamicScrollBarsView.h
+//  WebKit
 //
 //  Created by John Sullivan on Tue Jan 22 2002.
-//  Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
+//  Copyright (c) 2001, 2002 Apple Computer, Inc. All rights reserved.
 //
 
 #import <Cocoa/Cocoa.h>
 
- at interface IFDynamicScrollBarsView : NSScrollView 
+#import <WebCoreFrameView.h>
+
+// FIXME: This has grown to be more than just a dynamic scroll bar view.
+// We want to rename this class at least, and perhaps break it up into
+// more than one class.
+
+ at interface IFDynamicScrollBarsView : NSScrollView <WebCoreFrameView>
 {
     NSCursor *cursor;
     BOOL breakRecursionCycle;
@@ -18,7 +24,6 @@
 - (void)setAllowsScrolling: (BOOL)flag;
 - (BOOL)allowsScrolling;
 - (void)updateScrollers;
-- (void)setCursor:(NSCursor *)cur;
 - (void)resetCursorRects;
 
 @end
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
index 51891df..76256fc 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
@@ -1,9 +1,9 @@
 //
-//  DynamicScrollBarsView.m
-//  WebBrowser
+//  IFDynamicScrollBarsView.m
+//  WebKit
 //
 //  Created by John Sullivan on Tue Jan 22 2002.
-//  Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
+//  Copyright (c) 2001, 2002 Apple Computer, Inc. All rights reserved.
 //
 
 #import <WebKit/IFDynamicScrollBarsView.h>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list