[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:18:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6ddc870e6d393cc96597db7d8fd2a45d7e5a2e54
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jun 13 10:31:39 2002 +0000

        Lots of cleanup.  Fixed most regressions.
        Added removal of scrollbars during resizing,
        not sure if it's the correct behavior, but it makes resizing
        much smoother.  Let's see what people think.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1343 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b06afd4..a186d5c 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,45 @@
+2002-06-13  Richard Williamson  <rjw at apple.com>
+
+    Lots of cleanup.  Fixed most regressions.
+    Added removal of scrollbars during resizing,
+    not sure if it's the correct behavior, but it makes resizing
+    much smoother.  Let's see what people think.
+    
+	* WebView.subproj/IFDynamicScrollBarsView.h:
+	* WebView.subproj/IFDynamicScrollBarsView.m:
+	(-[IFDynamicScrollBarsView initWithFrame:]):
+	(-[IFDynamicScrollBarsView reflectScrolledClipView:]):
+	(-[IFDynamicScrollBarsView updateScrollers]):
+	(-[IFDynamicScrollBarsView setCursor:]):
+	(-[IFDynamicScrollBarsView setAllowsScrolling:]):
+	(-[IFDynamicScrollBarsView allowsScrolling]):
+	* WebView.subproj/IFHTMLView.mm:
+	(-[IFHTMLView provisionalDataSourceChanged:]):
+	(-[IFHTMLView provisionalDataSourceCommitted:]):
+	(-[IFHTMLView viewWillStartLiveResize]):
+	(-[IFHTMLView viewDidEndLiveResize]):
+	* WebView.subproj/IFHTMLViewPrivate.h:
+	* WebView.subproj/IFHTMLViewPrivate.mm:
+	(-[IFHTMLViewPrivate dealloc]):
+	(-[IFHTMLView _provisionalWidget]):
+	* WebView.subproj/IFWebFramePrivate.mm:
+	(-[IFWebFrame _timedLayout:]):
+	(-[IFWebFrame _isLoadComplete]):
+	* WebView.subproj/IFWebView.h:
+	* WebView.subproj/IFWebView.mm:
+	(-[IFWebView initWithFrame:]):
+	(-[IFWebView setAllowsScrolling:]):
+	(-[IFWebView allowsScrolling]):
+	(-[IFWebView frameScrollView]):
+	(-[IFWebView documentView]):
+	(+[IFWebView createViewForMIMEType:]):
+	(-[IFWebView isOpaque]):
+	(-[IFWebView drawRect:]):
+	* WebView.subproj/IFWebViewPrivate.h:
+	* WebView.subproj/IFWebViewPrivate.mm:
+	(-[IFWebViewPrivate dealloc]):
+	(-[IFWebView _setDocumentView:]):
+
 2002-06-13  Chris Blumenberg  <cblu at apple.com>
 
 	Removed MIME.subproj. Moved IFDownloadHandler to Misc.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index b06afd4..a186d5c 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,45 @@
+2002-06-13  Richard Williamson  <rjw at apple.com>
+
+    Lots of cleanup.  Fixed most regressions.
+    Added removal of scrollbars during resizing,
+    not sure if it's the correct behavior, but it makes resizing
+    much smoother.  Let's see what people think.
+    
+	* WebView.subproj/IFDynamicScrollBarsView.h:
+	* WebView.subproj/IFDynamicScrollBarsView.m:
+	(-[IFDynamicScrollBarsView initWithFrame:]):
+	(-[IFDynamicScrollBarsView reflectScrolledClipView:]):
+	(-[IFDynamicScrollBarsView updateScrollers]):
+	(-[IFDynamicScrollBarsView setCursor:]):
+	(-[IFDynamicScrollBarsView setAllowsScrolling:]):
+	(-[IFDynamicScrollBarsView allowsScrolling]):
+	* WebView.subproj/IFHTMLView.mm:
+	(-[IFHTMLView provisionalDataSourceChanged:]):
+	(-[IFHTMLView provisionalDataSourceCommitted:]):
+	(-[IFHTMLView viewWillStartLiveResize]):
+	(-[IFHTMLView viewDidEndLiveResize]):
+	* WebView.subproj/IFHTMLViewPrivate.h:
+	* WebView.subproj/IFHTMLViewPrivate.mm:
+	(-[IFHTMLViewPrivate dealloc]):
+	(-[IFHTMLView _provisionalWidget]):
+	* WebView.subproj/IFWebFramePrivate.mm:
+	(-[IFWebFrame _timedLayout:]):
+	(-[IFWebFrame _isLoadComplete]):
+	* WebView.subproj/IFWebView.h:
+	* WebView.subproj/IFWebView.mm:
+	(-[IFWebView initWithFrame:]):
+	(-[IFWebView setAllowsScrolling:]):
+	(-[IFWebView allowsScrolling]):
+	(-[IFWebView frameScrollView]):
+	(-[IFWebView documentView]):
+	(+[IFWebView createViewForMIMEType:]):
+	(-[IFWebView isOpaque]):
+	(-[IFWebView drawRect:]):
+	* WebView.subproj/IFWebViewPrivate.h:
+	* WebView.subproj/IFWebViewPrivate.mm:
+	(-[IFWebViewPrivate dealloc]):
+	(-[IFWebView _setDocumentView:]):
+
 2002-06-13  Chris Blumenberg  <cblu at apple.com>
 
 	Removed MIME.subproj. Moved IFDownloadHandler to Misc.
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
index fcef782..57c4605 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
@@ -10,8 +10,15 @@
 
 @interface IFDynamicScrollBarsView : NSScrollView 
 {
-    bool breakRecursionCycle;
     NSCursor *cursor;
+    BOOL breakRecursionCycle;
+    BOOL allowsScrolling;
 }
 
+- (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 d5276c7..18ea174 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
@@ -11,32 +11,57 @@
 
 @implementation IFDynamicScrollBarsView
 
+- initWithFrame: (NSRect)frame
+{
+    [super initWithFrame: frame];
+    allowsScrolling = YES;
+    return self;
+}
+
 // make the horizontal and vertical scroll bars come and go as needed
 - (void) reflectScrolledClipView: (NSClipView*)clipView
 {
-    id dview = [self documentView];
-        
-    if( clipView == [self contentView] && breakRecursionCycle == NO ) {
+    if (allowsScrolling){    
+        if( clipView == [self contentView] && breakRecursionCycle == NO ) {
+            breakRecursionCycle = YES;
+            
+            [self updateScrollers];
+            
+            breakRecursionCycle = NO;
+        }
+    }
+    [super reflectScrolledClipView: clipView];
+}
+
+
+- (void)updateScrollers
+{
+    if (allowsScrolling){    
         BOOL scrollsVertically;
         BOOL scrollsHorizontally;
-    
-        breakRecursionCycle = YES;
+        id dview = [self documentView];
         
         scrollsVertically = [dview bounds].size.height > [self frame].size.height;
-        scrollsHorizontally = [dview bounds].size.width > [self frame].size.width;
-    
+        
+        if (scrollsVertically)
+            scrollsHorizontally = ([dview bounds].size.width + [NSScroller scrollerWidth]) > [self frame].size.width;
+        else
+            scrollsHorizontally = [dview bounds].size.width > [self frame].size.width;
+        
+        if (scrollsHorizontally && !scrollsVertically)
+            scrollsVertically = ([dview bounds].size.height + [NSScroller scrollerWidth]) > [self frame].size.height;
+        
         [self setHasVerticalScroller: scrollsVertically];
         [self setHasHorizontalScroller: scrollsHorizontally];
-        
-        breakRecursionCycle = NO;
     }
-    [super reflectScrolledClipView: clipView];
 }
 
+
 - (void)setCursor:(NSCursor *)cur
 {
-    [cur release];
-    cursor = [cur retain];
+    [cur retain];
+    [cursor release];
+    cursor = cur;
 
     // We have to make both of these calls, because:
     // - Just setting a cursor rect will have no effect, if the mouse cursor is already
@@ -58,4 +83,20 @@
     }
 }
 
+- (void)setAllowsScrolling: (BOOL)flag
+{
+    allowsScrolling = flag;
+    if (allowsScrolling == NO){
+        [self setHasVerticalScroller: NO];
+        [self setHasHorizontalScroller: NO];
+    }
+}
+
+- (BOOL)allowsScrolling
+{
+    return allowsScrolling;
+}
+
+
+
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLView.mm b/WebKit/WebView.subproj/IFHTMLView.mm
index 52b8b29..8c4d426 100644
--- a/WebKit/WebView.subproj/IFHTMLView.mm
+++ b/WebKit/WebView.subproj/IFHTMLView.mm
@@ -106,8 +106,6 @@
     // the actual view once the datasource has been committed.
     provisionalView = [[IFHTMLView alloc] initWithFrame: NSMakeRect (0,0,0,0)];
         
-    // PROBLEM!!  This provisionalView may become the actual view in the case
-    // of a sub frame.  We need to create an IFWebView/IFDSV here.
     _private->provisionalWidget->setView (provisionalView);
     
     [provisionalView release];
@@ -127,12 +125,9 @@
 {
     IFHTMLViewPrivate *data = _private;
     IFWebView *webView = (IFWebView *)[self _IF_superviewWithName:@"IFWebView"];
+    id frameScrollView = [webView frameScrollView];
     
-    // Setup the real view.
-    if ([webView _frameScrollView])
-        data->provisionalWidget->setView ([webView _frameScrollView]);
-    else
-        data->provisionalWidget->setView (self);
+    data->provisionalWidget->setView (frameScrollView);
 
     // Only delete the widget if we're the top level widget.  In other
     // cases the widget is associated with a RenderFrame which will
@@ -474,12 +469,32 @@
 }
 
 
+- (void)viewWillStartLiveResize
+{
+    id scrollView = [[self superview] superview];
+    _private->liveAllowsScrolling = [scrollView allowsScrolling];
+    [scrollView setAllowsScrolling: NO];
+}
+
+- (void)viewDidEndLiveResize
+{
+    id scrollView = [[self superview] superview];
+    [scrollView setAllowsScrolling: _private->liveAllowsScrolling];
+    [self setNeedsLayout: YES];
+    [self setNeedsDisplay: YES];
+    [scrollView updateScrollers];
+}
+
+
 - (void)windowResized: (NSNotification *)notification
 {
-    if ([notification object] == [self window])
+    if ([notification object] == [self window]){
         [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
 }
 
+
 - (void)_addModifiers:(unsigned)modifiers toState:(int *)state
 {
     if (modifiers & NSControlKeyMask)
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.h b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
index 16770e7..51e8958 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
@@ -17,14 +17,14 @@ class KHTMLView;
     IFWebController *controller;
     KHTMLView *widget;
     KHTMLView *provisionalWidget;
-    NSScrollView *frameScrollView;
-    bool isFlipped;
-    bool needsLayout;
-    bool needsToApplyStyles;
-    bool canDragTo;
-    bool canDragFrom;
+    BOOL isFlipped;
+    BOOL needsLayout;
+    BOOL needsToApplyStyles;
+    BOOL canDragTo;
+    BOOL canDragFrom;
     NSArray *draggingTypes;
     NSCursor *cursor;
+    BOOL liveAllowsScrolling;
 }
 
 @end
@@ -36,7 +36,4 @@ class KHTMLView;
 - (KHTMLView *)_provisionalWidget;
 - (void)_stopPlugins;
 - (void)_removeSubviews;
-- (void)_setFrameScrollView: (NSScrollView *)sv;
-- (NSScrollView *)_frameScrollView;
-- (void)_setupScrollers;
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.mm b/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
index fdf0fb6..c93be12 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
@@ -21,13 +21,9 @@
 - (void)dealloc
 {
     [controller release];
-    [frameScrollView release];
     [draggingTypes release];
     [cursor release];
 
-    //if (widget)
-    //    delete widget;
-
     [super dealloc];
 }
 
@@ -118,35 +114,4 @@
     return _private->provisionalWidget;    
 }
 
-- (void)_setFrameScrollView: (NSScrollView *)sv
-{
-    [sv retain];
-    [_private->frameScrollView release];
-    _private->frameScrollView = sv;    
-    //[sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-    //[sv setHasVerticalScroller: YES];
-    //[sv setHasHorizontalScroller: YES];
-    [self setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-    [sv setDocumentView: self];
-}
-
-- (NSScrollView *)_frameScrollView
-{
-    return _private->frameScrollView;    
-}
-
-- (void)_setupScrollers
-{
-    BOOL scrollsVertically;
-    BOOL scrollsHorizontally;
-
-    if ([self _frameScrollView]) {
-        scrollsVertically = [self bounds].size.height > [[self _frameScrollView] frame].size.height;
-        scrollsHorizontally = [self bounds].size.width > [[self _frameScrollView] frame].size.width;
-    
-        [[self _frameScrollView] setHasVerticalScroller: scrollsVertically];
-        [[self _frameScrollView] setHasHorizontalScroller: scrollsHorizontally];
-    }
-}
-
 @end
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index a4b628c..d0079d3 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -3,16 +3,17 @@
 	    
     Copyright 2001, Apple, Inc. All rights reserved.
 */
-#import <WebKit/IFWebDataSource.h>
-#import <WebKit/IFWebDataSourcePrivate.h>
-#import <WebKit/IFWebViewPrivate.h>
-#import <WebKit/IFWebFramePrivate.h>
-#import <WebKit/IFPreferencesPrivate.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFLocationChangeHandler.h>
+#import <WebKit/IFDynamicScrollBarsView.h>
 #import <WebKit/IFHTMLRepresentation.h>
 #import <WebKit/IFHTMLView.h>
 #import <WebKit/IFHTMLViewPrivate.h>
+#import <WebKit/IFLocationChangeHandler.h>
+#import <WebKit/IFPreferencesPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
+#import <WebKit/IFWebFramePrivate.h>
+#import <WebKit/IFWebViewPrivate.h>
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/IFError.h>
@@ -137,12 +138,15 @@ static const char * const stateNames[6] = {
     
     _private->scheduledLayoutPending = NO;
     if (_private->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE) {
+        id documentView = [[self view] documentView];
+        
         if ([self controller])
             WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s:  performing timed layout, %f seconds since start of document load\n", [[self name] cString], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
             
-        if([[[self view] documentView] isKindOfClass: NSClassFromString(@"IFHTMLView")])
-            [[[self view] documentView] setNeedsLayout: YES];
-        [[[self view] documentView] setNeedsDisplay: YES];
+        if([[self view] isDocumentHTML])
+            [documentView setNeedsLayout: YES];
+            
+        [documentView setNeedsDisplay: YES];
     }
     else {
         if ([self controller])
@@ -331,6 +335,7 @@ static const char * const stateNames[6] = {
             if (![ds isLoading]) {
                 id mainView = [[[self controller] mainFrame] view];
                 id thisView = [self view];
+                id mainDocumentView = [mainView documentView];
 
                 [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 
@@ -340,30 +345,31 @@ static const char * const stateNames[6] = {
                 if ([mainView isDocumentHTML]){
                     // May need to relayout each time a frame is completely
                     // loaded.
-                    [[mainView documentView] setNeedsLayout: YES];
+                    [mainDocumentView setNeedsLayout: YES];
                 }
                 
                 if ([thisView isDocumentHTML]){
                     // Layout this view (eventually).
                     [[thisView documentView] setNeedsLayout: YES];
                 }
-                
+
+                // Jump to anchor point, if necessary.
+                if ([ds _isDocumentHTML])
+                    [[ds representation] part]->impl->gotoBaseAnchor();
+                                   
                 // Draw this view (eventually), and it's scroll view
                 // (eventually).
-                [thisView setNeedsDisplay: YES];
-                if ([thisView _frameScrollView])
-                    [[thisView _frameScrollView] setNeedsDisplay: YES];
+                //[[thisView documentView] setNeedsDisplay: YES];
+                //[[thisView frameScrollView] setNeedsDisplay: YES];
+                [[thisView frameScrollView] display];
+                [[thisView documentView] display];
 
                 // Force a relayout and draw NOW if we are complete are the top level.
                 if ([[self controller] mainFrame] == self) {
-                    [[mainView documentView] layout];
-                    [[mainView documentView] display];
+                    [mainDocumentView layout];
+                    [mainDocumentView display];
                 }
  
-                // Jump to anchor point, if necessary.
-                if ([ds _isDocumentHTML])
-                    [[ds representation] part]->impl->gotoBaseAnchor();
-                   
                 [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError]];
  
                 //if ([ds _isDocumentHTML])
diff --git a/WebKit/WebView.subproj/IFWebView.h b/WebKit/WebView.subproj/IFWebView.h
index 85ef6e5..8ce3430 100644
--- a/WebKit/WebView.subproj/IFWebView.h
+++ b/WebKit/WebView.subproj/IFWebView.h
@@ -27,7 +27,8 @@
 // Note that the controller is not retained.
 - (IFWebController *)controller;
 
-- (id)documentView;
+- frameScrollView;
+- documentView;
 
 - (BOOL) isDocumentHTML;
 
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 88ff4a8..5de9ef4 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -16,11 +16,13 @@
     
     _private = [[IFWebViewPrivate alloc] init];
 
-    IFDynamicScrollBarsView *scrollView  = [[IFDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,0,0)];
+    IFDynamicScrollBarsView *scrollView  = [[IFDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,frame.size.width,frame.size.height)];
+    _private->frameScrollView = scrollView;
+    [scrollView setDrawsBackground: NO];
     [scrollView setHasVerticalScroller: NO];
     [scrollView setHasHorizontalScroller: NO];
-    [self _setFrameScrollView: scrollView];
-    [scrollView release];
+    [scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+    [self addSubview: scrollView];
     
     return self;
 }
@@ -34,18 +36,24 @@
 
 - (void)setAllowsScrolling: (BOOL)flag
 {
-    _private->allowsScrolling = flag;
+    [[self frameScrollView] setAllowsScrolling: flag];
 }
 
 - (BOOL)allowsScrolling
 {
-    return _private->allowsScrolling;
+    return [[self frameScrollView] allowsScrolling];
 }
 
 
-- (id)documentView
+- frameScrollView
 {
-    return _private->documentView;
+    return _private->frameScrollView;
+}   
+
+
+- documentView
+{
+    return [[self frameScrollView] documentView];
 }
 
 // Note that the controller is not retained.
@@ -90,5 +98,14 @@
     return nil;
 }
 
+- (BOOL)isOpaque
+{
+    return YES;
+}
+
+- (void)drawRect:(NSRect)rect
+{
+}
+
 
 @end
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.h b/WebKit/WebView.subproj/IFWebViewPrivate.h
index db43810..174cb79 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.h
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.h
@@ -10,20 +10,18 @@
 
 class QWidget;
 
+ at class IFDynamicScrollBarsView;
 
 @interface IFWebViewPrivate : NSObject
 {
     IFWebController *controller;
-    id documentView;
-    NSScrollView *frameScrollView;
+    IFDynamicScrollBarsView *frameScrollView;
     
     // These margin values are used to temporarily hold
     // the margins of a frame until we have the appropriate
     // document view type.
     int marginWidth;
     int marginHeight;
-    
-    BOOL allowsScrolling;
 }
 
 @end
@@ -31,9 +29,6 @@ class QWidget;
 @interface IFWebView (IFPrivate)
 - (void)_setDocumentView:(id <IFDocumentLoading>)view;
 - (void)_setController: (IFWebController *)controller;
-- (void)_setFrameScrollView: (NSScrollView *)sv;
-- (NSScrollView *)_frameScrollView;
-- (void)_setupScrollers;
 - (int)_marginWidth;
 - (int)_marginHeight;
 + (NSMutableDictionary *)_viewTypes;
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.mm b/WebKit/WebView.subproj/IFWebViewPrivate.mm
index 1d75df0..281389f 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.mm
@@ -30,7 +30,6 @@ static NSMutableDictionary *_viewTypes=nil;
 - (void)dealloc
 {
     [frameScrollView release];
-    [documentView release];
     [super dealloc];
 }
 
@@ -60,50 +59,16 @@ static NSMutableDictionary *_viewTypes=nil;
 
 - (void)_setDocumentView:(id)view
 {
-    [[self _frameScrollView] setDocumentView: view];
-    
-    // Set the size of the new document scroll view to the size
-    // of the IFWebView.
-    [[self _frameScrollView] setFrame:[self frame]];
-    
-    [view retain];
-    [_private->documentView release];
-    _private->documentView = view;
+    [[self frameScrollView] setDocumentView: view];    
 }
 
+
 - (void)_setController: (IFWebController *)controller
 {
     // Not retained; the controller owns the view.
     _private->controller = controller;    
 }
 
-- (void)_setFrameScrollView: (NSScrollView *)sv
-{
-    [sv retain];
-    [_private->frameScrollView release];
-    _private->frameScrollView = sv;    
-    [sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-    [self addSubview: sv];
-}
-
-- (NSScrollView *)_frameScrollView
-{
-    return _private->frameScrollView;    
-}
-
-- (void)_setupScrollers
-{
-    BOOL scrollsVertically;
-    BOOL scrollsHorizontally;
-
-    if ([self _frameScrollView]) {
-        scrollsVertically = [self bounds].size.height > [[self _frameScrollView] frame].size.height;
-        scrollsHorizontally = [self bounds].size.width > [[self _frameScrollView] frame].size.width;
-    
-        [[self _frameScrollView] setHasVerticalScroller: scrollsVertically];
-        [[self _frameScrollView] setHasHorizontalScroller: scrollsHorizontally];
-    }
-}
 
 + (NSMutableDictionary *)_viewTypes
 {
@@ -118,6 +83,7 @@ static NSMutableDictionary *_viewTypes=nil;
     return _viewTypes;
 }
 
+
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType
 {
     NSMutableDictionary *viewTypes = [[self class] _viewTypes];
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
index fcef782..57c4605 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
@@ -10,8 +10,15 @@
 
 @interface IFDynamicScrollBarsView : NSScrollView 
 {
-    bool breakRecursionCycle;
     NSCursor *cursor;
+    BOOL breakRecursionCycle;
+    BOOL allowsScrolling;
 }
 
+- (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 d5276c7..18ea174 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
@@ -11,32 +11,57 @@
 
 @implementation IFDynamicScrollBarsView
 
+- initWithFrame: (NSRect)frame
+{
+    [super initWithFrame: frame];
+    allowsScrolling = YES;
+    return self;
+}
+
 // make the horizontal and vertical scroll bars come and go as needed
 - (void) reflectScrolledClipView: (NSClipView*)clipView
 {
-    id dview = [self documentView];
-        
-    if( clipView == [self contentView] && breakRecursionCycle == NO ) {
+    if (allowsScrolling){    
+        if( clipView == [self contentView] && breakRecursionCycle == NO ) {
+            breakRecursionCycle = YES;
+            
+            [self updateScrollers];
+            
+            breakRecursionCycle = NO;
+        }
+    }
+    [super reflectScrolledClipView: clipView];
+}
+
+
+- (void)updateScrollers
+{
+    if (allowsScrolling){    
         BOOL scrollsVertically;
         BOOL scrollsHorizontally;
-    
-        breakRecursionCycle = YES;
+        id dview = [self documentView];
         
         scrollsVertically = [dview bounds].size.height > [self frame].size.height;
-        scrollsHorizontally = [dview bounds].size.width > [self frame].size.width;
-    
+        
+        if (scrollsVertically)
+            scrollsHorizontally = ([dview bounds].size.width + [NSScroller scrollerWidth]) > [self frame].size.width;
+        else
+            scrollsHorizontally = [dview bounds].size.width > [self frame].size.width;
+        
+        if (scrollsHorizontally && !scrollsVertically)
+            scrollsVertically = ([dview bounds].size.height + [NSScroller scrollerWidth]) > [self frame].size.height;
+        
         [self setHasVerticalScroller: scrollsVertically];
         [self setHasHorizontalScroller: scrollsHorizontally];
-        
-        breakRecursionCycle = NO;
     }
-    [super reflectScrolledClipView: clipView];
 }
 
+
 - (void)setCursor:(NSCursor *)cur
 {
-    [cur release];
-    cursor = [cur retain];
+    [cur retain];
+    [cursor release];
+    cursor = cur;
 
     // We have to make both of these calls, because:
     // - Just setting a cursor rect will have no effect, if the mouse cursor is already
@@ -58,4 +83,20 @@
     }
 }
 
+- (void)setAllowsScrolling: (BOOL)flag
+{
+    allowsScrolling = flag;
+    if (allowsScrolling == NO){
+        [self setHasVerticalScroller: NO];
+        [self setHasHorizontalScroller: NO];
+    }
+}
+
+- (BOOL)allowsScrolling
+{
+    return allowsScrolling;
+}
+
+
+
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index a4b628c..d0079d3 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -3,16 +3,17 @@
 	    
     Copyright 2001, Apple, Inc. All rights reserved.
 */
-#import <WebKit/IFWebDataSource.h>
-#import <WebKit/IFWebDataSourcePrivate.h>
-#import <WebKit/IFWebViewPrivate.h>
-#import <WebKit/IFWebFramePrivate.h>
-#import <WebKit/IFPreferencesPrivate.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFLocationChangeHandler.h>
+#import <WebKit/IFDynamicScrollBarsView.h>
 #import <WebKit/IFHTMLRepresentation.h>
 #import <WebKit/IFHTMLView.h>
 #import <WebKit/IFHTMLViewPrivate.h>
+#import <WebKit/IFLocationChangeHandler.h>
+#import <WebKit/IFPreferencesPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebDataSource.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
+#import <WebKit/IFWebFramePrivate.h>
+#import <WebKit/IFWebViewPrivate.h>
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/IFError.h>
@@ -137,12 +138,15 @@ static const char * const stateNames[6] = {
     
     _private->scheduledLayoutPending = NO;
     if (_private->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE) {
+        id documentView = [[self view] documentView];
+        
         if ([self controller])
             WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s:  performing timed layout, %f seconds since start of document load\n", [[self name] cString], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
             
-        if([[[self view] documentView] isKindOfClass: NSClassFromString(@"IFHTMLView")])
-            [[[self view] documentView] setNeedsLayout: YES];
-        [[[self view] documentView] setNeedsDisplay: YES];
+        if([[self view] isDocumentHTML])
+            [documentView setNeedsLayout: YES];
+            
+        [documentView setNeedsDisplay: YES];
     }
     else {
         if ([self controller])
@@ -331,6 +335,7 @@ static const char * const stateNames[6] = {
             if (![ds isLoading]) {
                 id mainView = [[[self controller] mainFrame] view];
                 id thisView = [self view];
+                id mainDocumentView = [mainView documentView];
 
                 [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 
@@ -340,30 +345,31 @@ static const char * const stateNames[6] = {
                 if ([mainView isDocumentHTML]){
                     // May need to relayout each time a frame is completely
                     // loaded.
-                    [[mainView documentView] setNeedsLayout: YES];
+                    [mainDocumentView setNeedsLayout: YES];
                 }
                 
                 if ([thisView isDocumentHTML]){
                     // Layout this view (eventually).
                     [[thisView documentView] setNeedsLayout: YES];
                 }
-                
+
+                // Jump to anchor point, if necessary.
+                if ([ds _isDocumentHTML])
+                    [[ds representation] part]->impl->gotoBaseAnchor();
+                                   
                 // Draw this view (eventually), and it's scroll view
                 // (eventually).
-                [thisView setNeedsDisplay: YES];
-                if ([thisView _frameScrollView])
-                    [[thisView _frameScrollView] setNeedsDisplay: YES];
+                //[[thisView documentView] setNeedsDisplay: YES];
+                //[[thisView frameScrollView] setNeedsDisplay: YES];
+                [[thisView frameScrollView] display];
+                [[thisView documentView] display];
 
                 // Force a relayout and draw NOW if we are complete are the top level.
                 if ([[self controller] mainFrame] == self) {
-                    [[mainView documentView] layout];
-                    [[mainView documentView] display];
+                    [mainDocumentView layout];
+                    [mainDocumentView display];
                 }
  
-                // Jump to anchor point, if necessary.
-                if ([ds _isDocumentHTML])
-                    [[ds representation] part]->impl->gotoBaseAnchor();
-                   
                 [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError]];
  
                 //if ([ds _isDocumentHTML])
diff --git a/WebKit/WebView.subproj/WebFrameView.h b/WebKit/WebView.subproj/WebFrameView.h
index 85ef6e5..8ce3430 100644
--- a/WebKit/WebView.subproj/WebFrameView.h
+++ b/WebKit/WebView.subproj/WebFrameView.h
@@ -27,7 +27,8 @@
 // Note that the controller is not retained.
 - (IFWebController *)controller;
 
-- (id)documentView;
+- frameScrollView;
+- documentView;
 
 - (BOOL) isDocumentHTML;
 
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 88ff4a8..5de9ef4 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -16,11 +16,13 @@
     
     _private = [[IFWebViewPrivate alloc] init];
 
-    IFDynamicScrollBarsView *scrollView  = [[IFDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,0,0)];
+    IFDynamicScrollBarsView *scrollView  = [[IFDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,frame.size.width,frame.size.height)];
+    _private->frameScrollView = scrollView;
+    [scrollView setDrawsBackground: NO];
     [scrollView setHasVerticalScroller: NO];
     [scrollView setHasHorizontalScroller: NO];
-    [self _setFrameScrollView: scrollView];
-    [scrollView release];
+    [scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+    [self addSubview: scrollView];
     
     return self;
 }
@@ -34,18 +36,24 @@
 
 - (void)setAllowsScrolling: (BOOL)flag
 {
-    _private->allowsScrolling = flag;
+    [[self frameScrollView] setAllowsScrolling: flag];
 }
 
 - (BOOL)allowsScrolling
 {
-    return _private->allowsScrolling;
+    return [[self frameScrollView] allowsScrolling];
 }
 
 
-- (id)documentView
+- frameScrollView
 {
-    return _private->documentView;
+    return _private->frameScrollView;
+}   
+
+
+- documentView
+{
+    return [[self frameScrollView] documentView];
 }
 
 // Note that the controller is not retained.
@@ -90,5 +98,14 @@
     return nil;
 }
 
+- (BOOL)isOpaque
+{
+    return YES;
+}
+
+- (void)drawRect:(NSRect)rect
+{
+}
+
 
 @end
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index db43810..174cb79 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -10,20 +10,18 @@
 
 class QWidget;
 
+ at class IFDynamicScrollBarsView;
 
 @interface IFWebViewPrivate : NSObject
 {
     IFWebController *controller;
-    id documentView;
-    NSScrollView *frameScrollView;
+    IFDynamicScrollBarsView *frameScrollView;
     
     // These margin values are used to temporarily hold
     // the margins of a frame until we have the appropriate
     // document view type.
     int marginWidth;
     int marginHeight;
-    
-    BOOL allowsScrolling;
 }
 
 @end
@@ -31,9 +29,6 @@ class QWidget;
 @interface IFWebView (IFPrivate)
 - (void)_setDocumentView:(id <IFDocumentLoading>)view;
 - (void)_setController: (IFWebController *)controller;
-- (void)_setFrameScrollView: (NSScrollView *)sv;
-- (NSScrollView *)_frameScrollView;
-- (void)_setupScrollers;
 - (int)_marginWidth;
 - (int)_marginHeight;
 + (NSMutableDictionary *)_viewTypes;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index db43810..174cb79 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -10,20 +10,18 @@
 
 class QWidget;
 
+ at class IFDynamicScrollBarsView;
 
 @interface IFWebViewPrivate : NSObject
 {
     IFWebController *controller;
-    id documentView;
-    NSScrollView *frameScrollView;
+    IFDynamicScrollBarsView *frameScrollView;
     
     // These margin values are used to temporarily hold
     // the margins of a frame until we have the appropriate
     // document view type.
     int marginWidth;
     int marginHeight;
-    
-    BOOL allowsScrolling;
 }
 
 @end
@@ -31,9 +29,6 @@ class QWidget;
 @interface IFWebView (IFPrivate)
 - (void)_setDocumentView:(id <IFDocumentLoading>)view;
 - (void)_setController: (IFWebController *)controller;
-- (void)_setFrameScrollView: (NSScrollView *)sv;
-- (NSScrollView *)_frameScrollView;
-- (void)_setupScrollers;
 - (int)_marginWidth;
 - (int)_marginHeight;
 + (NSMutableDictionary *)_viewTypes;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index 1d75df0..281389f 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -30,7 +30,6 @@ static NSMutableDictionary *_viewTypes=nil;
 - (void)dealloc
 {
     [frameScrollView release];
-    [documentView release];
     [super dealloc];
 }
 
@@ -60,50 +59,16 @@ static NSMutableDictionary *_viewTypes=nil;
 
 - (void)_setDocumentView:(id)view
 {
-    [[self _frameScrollView] setDocumentView: view];
-    
-    // Set the size of the new document scroll view to the size
-    // of the IFWebView.
-    [[self _frameScrollView] setFrame:[self frame]];
-    
-    [view retain];
-    [_private->documentView release];
-    _private->documentView = view;
+    [[self frameScrollView] setDocumentView: view];    
 }
 
+
 - (void)_setController: (IFWebController *)controller
 {
     // Not retained; the controller owns the view.
     _private->controller = controller;    
 }
 
-- (void)_setFrameScrollView: (NSScrollView *)sv
-{
-    [sv retain];
-    [_private->frameScrollView release];
-    _private->frameScrollView = sv;    
-    [sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-    [self addSubview: sv];
-}
-
-- (NSScrollView *)_frameScrollView
-{
-    return _private->frameScrollView;    
-}
-
-- (void)_setupScrollers
-{
-    BOOL scrollsVertically;
-    BOOL scrollsHorizontally;
-
-    if ([self _frameScrollView]) {
-        scrollsVertically = [self bounds].size.height > [[self _frameScrollView] frame].size.height;
-        scrollsHorizontally = [self bounds].size.width > [[self _frameScrollView] frame].size.width;
-    
-        [[self _frameScrollView] setHasVerticalScroller: scrollsVertically];
-        [[self _frameScrollView] setHasHorizontalScroller: scrollsHorizontally];
-    }
-}
 
 + (NSMutableDictionary *)_viewTypes
 {
@@ -118,6 +83,7 @@ static NSMutableDictionary *_viewTypes=nil;
     return _viewTypes;
 }
 
+
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType
 {
     NSMutableDictionary *viewTypes = [[self class] _viewTypes];
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 52b8b29..8c4d426 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -106,8 +106,6 @@
     // the actual view once the datasource has been committed.
     provisionalView = [[IFHTMLView alloc] initWithFrame: NSMakeRect (0,0,0,0)];
         
-    // PROBLEM!!  This provisionalView may become the actual view in the case
-    // of a sub frame.  We need to create an IFWebView/IFDSV here.
     _private->provisionalWidget->setView (provisionalView);
     
     [provisionalView release];
@@ -127,12 +125,9 @@
 {
     IFHTMLViewPrivate *data = _private;
     IFWebView *webView = (IFWebView *)[self _IF_superviewWithName:@"IFWebView"];
+    id frameScrollView = [webView frameScrollView];
     
-    // Setup the real view.
-    if ([webView _frameScrollView])
-        data->provisionalWidget->setView ([webView _frameScrollView]);
-    else
-        data->provisionalWidget->setView (self);
+    data->provisionalWidget->setView (frameScrollView);
 
     // Only delete the widget if we're the top level widget.  In other
     // cases the widget is associated with a RenderFrame which will
@@ -474,12 +469,32 @@
 }
 
 
+- (void)viewWillStartLiveResize
+{
+    id scrollView = [[self superview] superview];
+    _private->liveAllowsScrolling = [scrollView allowsScrolling];
+    [scrollView setAllowsScrolling: NO];
+}
+
+- (void)viewDidEndLiveResize
+{
+    id scrollView = [[self superview] superview];
+    [scrollView setAllowsScrolling: _private->liveAllowsScrolling];
+    [self setNeedsLayout: YES];
+    [self setNeedsDisplay: YES];
+    [scrollView updateScrollers];
+}
+
+
 - (void)windowResized: (NSNotification *)notification
 {
-    if ([notification object] == [self window])
+    if ([notification object] == [self window]){
         [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
 }
 
+
 - (void)_addModifiers:(unsigned)modifiers toState:(int *)state
 {
     if (modifiers & NSControlKeyMask)
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 16770e7..51e8958 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -17,14 +17,14 @@ class KHTMLView;
     IFWebController *controller;
     KHTMLView *widget;
     KHTMLView *provisionalWidget;
-    NSScrollView *frameScrollView;
-    bool isFlipped;
-    bool needsLayout;
-    bool needsToApplyStyles;
-    bool canDragTo;
-    bool canDragFrom;
+    BOOL isFlipped;
+    BOOL needsLayout;
+    BOOL needsToApplyStyles;
+    BOOL canDragTo;
+    BOOL canDragFrom;
     NSArray *draggingTypes;
     NSCursor *cursor;
+    BOOL liveAllowsScrolling;
 }
 
 @end
@@ -36,7 +36,4 @@ class KHTMLView;
 - (KHTMLView *)_provisionalWidget;
 - (void)_stopPlugins;
 - (void)_removeSubviews;
-- (void)_setFrameScrollView: (NSScrollView *)sv;
-- (NSScrollView *)_frameScrollView;
-- (void)_setupScrollers;
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index fdf0fb6..c93be12 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -21,13 +21,9 @@
 - (void)dealloc
 {
     [controller release];
-    [frameScrollView release];
     [draggingTypes release];
     [cursor release];
 
-    //if (widget)
-    //    delete widget;
-
     [super dealloc];
 }
 
@@ -118,35 +114,4 @@
     return _private->provisionalWidget;    
 }
 
-- (void)_setFrameScrollView: (NSScrollView *)sv
-{
-    [sv retain];
-    [_private->frameScrollView release];
-    _private->frameScrollView = sv;    
-    //[sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-    //[sv setHasVerticalScroller: YES];
-    //[sv setHasHorizontalScroller: YES];
-    [self setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-    [sv setDocumentView: self];
-}
-
-- (NSScrollView *)_frameScrollView
-{
-    return _private->frameScrollView;    
-}
-
-- (void)_setupScrollers
-{
-    BOOL scrollsVertically;
-    BOOL scrollsHorizontally;
-
-    if ([self _frameScrollView]) {
-        scrollsVertically = [self bounds].size.height > [[self _frameScrollView] frame].size.height;
-        scrollsHorizontally = [self bounds].size.width > [[self _frameScrollView] frame].size.width;
-    
-        [[self _frameScrollView] setHasVerticalScroller: scrollsVertically];
-        [[self _frameScrollView] setHasHorizontalScroller: scrollsHorizontally];
-    }
-}
-
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list