[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:21:00 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cc1dd117344fa2e26f8f7e276ff39805a27f68d8
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jun 24 19:20:05 2002 +0000

    	Remove some unused stuff. Other minor cleanup.
    
            * WebView.subproj/IFDynamicScrollBarsView.h: Remove breakRecursionCycle,
            don't declare updateScrollers or resetCursorRects.
    
            * WebView.subproj/IFDynamicScrollBarsView.m:
            (-[IFDynamicScrollBarsView updateScrollers]): Make this work even for a view
            that doesn't allow scrolling, turning off both scrollers in that case.
            (-[IFDynamicScrollBarsView reflectScrolledClipView:]): Call updateScrollers
    	unconditionally, letting it decide what to do, rather than looking at
    	allowsScrolling. Also, no need to use a boolean to break the recursion cycle,
    	now that updateScrollers does no work if none is needed.
            (-[IFDynamicScrollBarsView setCursor:]): Do nothing if the cursor is not
    	changing. Also handle arrowCursor case here.
            (-[IFDynamicScrollBarsView resetCursorRects]): Call discardCursorRects so
    	the old rects won't keep accumulating.
            (-[IFDynamicScrollBarsView setAllowsScrolling:]): Always call updateScrollers,
    	not just when turning scrolling off.
    
            * WebView.subproj/IFHTMLView.mm:
            (-[IFHTMLView initWithFrame:]): Remove unneeded NSWindowWillCloseNotification
    	and isFlipped field.
            (-[IFHTMLView removeNotifications]): Moved here from NSWindowWillCloseNotification.
            (-[IFHTMLView viewWillMoveToWindow:]): Remove all the notifications when the
    	view is removed from the window.
            (-[IFHTMLView setNeedsLayout:]): Call setNeedsDisplay in the YES case, so the
    	callers don't all have to.
            (-[IFHTMLView isFlipped]): Just return YES. No need to store it.
            (-[IFHTMLView windowResized:]): Add a FIXME, since this is not the way we want
    	to handle view resizing for the long run.
            * WebView.subproj/IFHTMLViewPrivate.h: Remove isFlipped.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1420 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 0ed541e..a0dbda9 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,39 @@
 2002-06-24  Darin Adler  <darin at apple.com>
 
+	Remove some unused stuff. Other minor cleanup.
+
+        * WebView.subproj/IFDynamicScrollBarsView.h: Remove breakRecursionCycle,
+        don't declare updateScrollers or resetCursorRects.
+
+        * WebView.subproj/IFDynamicScrollBarsView.m:
+        (-[IFDynamicScrollBarsView updateScrollers]): Make this work even for a view
+        that doesn't allow scrolling, turning off both scrollers in that case.
+        (-[IFDynamicScrollBarsView reflectScrolledClipView:]): Call updateScrollers
+	unconditionally, letting it decide what to do, rather than looking at
+	allowsScrolling. Also, no need to use a boolean to break the recursion cycle,
+	now that updateScrollers does no work if none is needed.
+        (-[IFDynamicScrollBarsView setCursor:]): Do nothing if the cursor is not
+	changing. Also handle arrowCursor case here.
+        (-[IFDynamicScrollBarsView resetCursorRects]): Call discardCursorRects so
+	the old rects won't keep accumulating.
+        (-[IFDynamicScrollBarsView setAllowsScrolling:]): Always call updateScrollers,
+	not just when turning scrolling off.
+
+        * WebView.subproj/IFHTMLView.mm:
+        (-[IFHTMLView initWithFrame:]): Remove unneeded NSWindowWillCloseNotification
+	and isFlipped field.
+        (-[IFHTMLView removeNotifications]): Moved here from NSWindowWillCloseNotification.
+        (-[IFHTMLView viewWillMoveToWindow:]): Remove all the notifications when the
+	view is removed from the window.
+        (-[IFHTMLView setNeedsLayout:]): Call setNeedsDisplay in the YES case, so the
+	callers don't all have to.
+        (-[IFHTMLView isFlipped]): Just return YES. No need to store it.
+        (-[IFHTMLView windowResized:]): Add a FIXME, since this is not the way we want
+	to handle view resizing for the long run.
+        * WebView.subproj/IFHTMLViewPrivate.h: Remove isFlipped.
+
+2002-06-24  Darin Adler  <darin at apple.com>
+
         Fix the last of the "leak the world" problems. The KHTMLView was leaking
         in IFHTMLView.
 
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 0ed541e..a0dbda9 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,39 @@
 2002-06-24  Darin Adler  <darin at apple.com>
 
+	Remove some unused stuff. Other minor cleanup.
+
+        * WebView.subproj/IFDynamicScrollBarsView.h: Remove breakRecursionCycle,
+        don't declare updateScrollers or resetCursorRects.
+
+        * WebView.subproj/IFDynamicScrollBarsView.m:
+        (-[IFDynamicScrollBarsView updateScrollers]): Make this work even for a view
+        that doesn't allow scrolling, turning off both scrollers in that case.
+        (-[IFDynamicScrollBarsView reflectScrolledClipView:]): Call updateScrollers
+	unconditionally, letting it decide what to do, rather than looking at
+	allowsScrolling. Also, no need to use a boolean to break the recursion cycle,
+	now that updateScrollers does no work if none is needed.
+        (-[IFDynamicScrollBarsView setCursor:]): Do nothing if the cursor is not
+	changing. Also handle arrowCursor case here.
+        (-[IFDynamicScrollBarsView resetCursorRects]): Call discardCursorRects so
+	the old rects won't keep accumulating.
+        (-[IFDynamicScrollBarsView setAllowsScrolling:]): Always call updateScrollers,
+	not just when turning scrolling off.
+
+        * WebView.subproj/IFHTMLView.mm:
+        (-[IFHTMLView initWithFrame:]): Remove unneeded NSWindowWillCloseNotification
+	and isFlipped field.
+        (-[IFHTMLView removeNotifications]): Moved here from NSWindowWillCloseNotification.
+        (-[IFHTMLView viewWillMoveToWindow:]): Remove all the notifications when the
+	view is removed from the window.
+        (-[IFHTMLView setNeedsLayout:]): Call setNeedsDisplay in the YES case, so the
+	callers don't all have to.
+        (-[IFHTMLView isFlipped]): Just return YES. No need to store it.
+        (-[IFHTMLView windowResized:]): Add a FIXME, since this is not the way we want
+	to handle view resizing for the long run.
+        * WebView.subproj/IFHTMLViewPrivate.h: Remove isFlipped.
+
+2002-06-24  Darin Adler  <darin at apple.com>
+
         Fix the last of the "leak the world" problems. The KHTMLView was leaking
         in IFHTMLView.
 
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
index e4d58f0..92f7a5e 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
@@ -17,13 +17,10 @@
 @interface IFDynamicScrollBarsView : NSScrollView <WebCoreFrameView>
 {
     NSCursor *cursor;
-    BOOL breakRecursionCycle;
     BOOL allowsScrolling;
 }
 
-- (void)setAllowsScrolling: (BOOL)flag;
+- (void)setAllowsScrolling:(BOOL)flag;
 - (BOOL)allowsScrolling;
-- (void)updateScrollers;
-- (void)resetCursorRects;
 
 @end
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
index 687bef3..0056e3a 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
@@ -7,74 +7,84 @@
 //
 
 #import <WebKit/IFDynamicScrollBarsView.h>
-#import <WebKit/WebKitDebug.h>
 
 @implementation IFDynamicScrollBarsView
 
-- initWithFrame: (NSRect)frame
+- initWithFrame:(NSRect)frame
 {
-    [super initWithFrame: frame];
+    [super initWithFrame:frame];
     allowsScrolling = YES;
     return self;
 }
 
-// make the horizontal and vertical scroll bars come and go as needed
-- (void) reflectScrolledClipView: (NSClipView*)clipView
-{
-    if (allowsScrolling){    
-        if( clipView == [self contentView] && breakRecursionCycle == NO ) {
-            breakRecursionCycle = YES;
-            
-            [self updateScrollers];
-            
-            breakRecursionCycle = NO;
-        }
-    }
-    [super reflectScrolledClipView: clipView];
-}
-
-
 - (void)updateScrollers
 {
-    BOOL scrollersChanged = NO;
-    if (allowsScrolling){    
-        BOOL scrollsVertically;
-        BOOL scrollsHorizontally;
-        id dview = [self documentView];
-        
-        scrollsVertically = [dview bounds].size.height > [self frame].size.height;
+    BOOL scrollsVertically;
+    BOOL scrollsHorizontally;
+    BOOL scrollersChanged;    
+
+    if (!allowsScrolling) {
+        scrollsVertically = NO;
+        scrollsHorizontally = NO;
+    } else {
+        NSSize documentSize = [[self documentView] bounds].size;
+        NSSize frameSize = [self frame].size;
         
+        scrollsVertically = documentSize.height > frameSize.height;
         if (scrollsVertically)
-            scrollsHorizontally = ([dview bounds].size.width + [NSScroller scrollerWidth]) > [self frame].size.width;
-        else
-            scrollsHorizontally = [dview bounds].size.width > [self frame].size.width;
+            scrollsHorizontally = documentSize.width + [NSScroller scrollerWidth] > frameSize.width;
+        else {
+            scrollsHorizontally = documentSize.width > frameSize.width;
+            if (scrollsHorizontally)
+                scrollsVertically = documentSize.height + [NSScroller scrollerWidth] > frameSize.height;
+        }
+    }
+
+    scrollersChanged = NO;
         
-        if (scrollsHorizontally && !scrollsVertically)
-            scrollsVertically = ([dview bounds].size.height + [NSScroller scrollerWidth]) > [self frame].size.height;
+    if ([self hasVerticalScroller] != scrollsVertically) {
+        [self setHasVerticalScroller:scrollsVertically];
+        scrollersChanged = YES;
+    }
         
-        if ([self hasVerticalScroller] != scrollsVertically){
-            [self setHasVerticalScroller: scrollsVertically];
-            scrollersChanged = YES;
-        }
-            
-        if ([self hasHorizontalScroller] != scrollsHorizontally){
-            [self setHasHorizontalScroller: scrollsHorizontally];
-            scrollersChanged = YES;
-        }
+    if ([self hasHorizontalScroller] != scrollsHorizontally) {
+        [self setHasHorizontalScroller:scrollsHorizontally];
+        scrollersChanged = YES;
     }
     
-    if (scrollersChanged){
+    if (scrollersChanged) {
         [self tile];
-        [self setNeedsDisplay: YES];
+        [self setNeedsDisplay:YES];
     }
 }
 
+// Make the horizontal and vertical scroll bars come and go as needed.
+- (void)reflectScrolledClipView:(NSClipView *)clipView
+{
+    if (clipView == [self contentView]) {
+        [self updateScrollers];
+    }
+    [super reflectScrolledClipView:clipView];
+}
 
 - (void)setCursor:(NSCursor *)cur
 {
-    [cur retain];
+    // Do nothing for cases where the cursor isn't changing.
+    // Also turn arrowCursor into nil.
+    if (!cur) {
+        if (!cursor) {
+            return;
+        }
+    } else {
+        if ([cur isEqual:[NSCursor arrowCursor]]) {
+            cur = nil;
+        } else if (cursor && [cursor isEqual:cur]) {
+            return;
+        }
+    }
+    
     [cursor release];
-    cursor = cur;
+    cursor = [cur retain];
 
     // We have to make both of these calls, because:
     // - Just setting a cursor rect will have no effect, if the mouse cursor is already
@@ -83,26 +93,24 @@
     //   there is no cursor rect set currently and the view has no subviews.
     // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
     // at all, if we are going to want one, and then invalidateCursorRectsForView: to
-    // call resetCursorRects from the proper context that will
-    // actually result in updating the cursor.
+    // call resetCursorRects from the proper context that will actually result in
+    // updating the cursor.
     [self resetCursorRects];
     [[self window] invalidateCursorRectsForView:self];
 }
 
 - (void)resetCursorRects
 {
-    if (cursor != nil && cursor != [NSCursor arrowCursor]) {
+    [self discardCursorRects];
+    if (cursor) {
         [self addCursorRect:[self visibleRect] cursor:cursor];
     }
 }
 
-- (void)setAllowsScrolling: (BOOL)flag
+- (void)setAllowsScrolling:(BOOL)flag
 {
     allowsScrolling = flag;
-    if (allowsScrolling == NO){
-        [self setHasVerticalScroller: NO];
-        [self setHasHorizontalScroller: NO];
-    }
+    [self updateScrollers];
 }
 
 - (BOOL)allowsScrolling
@@ -110,6 +118,4 @@
     return allowsScrolling;
 }
 
-
-
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLView.mm b/WebKit/WebView.subproj/IFHTMLView.mm
index 92c6907..5245b2a 100644
--- a/WebKit/WebView.subproj/IFHTMLView.mm
+++ b/WebKit/WebView.subproj/IFHTMLView.mm
@@ -25,10 +25,6 @@
 
 #import <KWQKHTMLPartImpl.h>
 
- at interface NSScrollView (NSPrivate)
-- (void)_adjustForGrowBox;
- at end
-
 @implementation IFHTMLView
 
 - initWithFrame: (NSRect) frame
@@ -37,7 +33,6 @@
     
     _private = [[IFHTMLViewPrivate alloc] init];
 
-    _private->isFlipped = YES;
     _private->needsLayout = YES;
 
     _private->canDragTo = YES;
@@ -53,11 +48,6 @@
 
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
 
-    // We remove this view as an observer from all window notifications when the window
-    // is closed.  This may be redundant, but ensures that the view has no outstanding
-    // references.
-    [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowWillClose:) name: NSWindowWillCloseNotification object: nil];
-
     return self;
 }
 
@@ -77,10 +67,21 @@
 }
 
 
+- (void)removeNotifications
+{
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResizeNotification object: nil];
+}
+
+
 - (void)viewWillMoveToWindow:(NSWindow *)window
 {
-    if ([self window] && !window)
+    if ([self window] && !window) {
+        [self removeNotifications];
         [self _reset];
+    }
     [super viewWillMoveToWindow:window];
 }
 
@@ -153,7 +154,6 @@
 {
     KHTMLView *widget = _private->widget;
 
-
     // Ensure that we will receive mouse move events.  Is this the best place to put this?
     [[self window] setAcceptsMouseMovedEvents: YES];
     [[self window] _setShouldPostEventNotifications: YES];
@@ -161,19 +161,19 @@
     if (widget->part()->xmlDocImpl() && 
         widget->part()->xmlDocImpl()->renderer()){
         if (_private->needsLayout){
-#ifdef _KWQ_TIMING        
+ #ifdef _KWQ_TIMING        
     double start = CFAbsoluteTimeGetCurrent();
-#endif
+ #endif
 
             WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "doing layout\n");
             //double start = CFAbsoluteTimeGetCurrent();
             widget->layout();
             //WebKitDebugAtLevel (WEBKIT_LOG_TIMING, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
             _private->needsLayout = NO;
-#ifdef _KWQ_TIMING        
+ #ifdef _KWQ_TIMING        
     double thisTime = CFAbsoluteTimeGetCurrent() - start;
     WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s layout seconds = %f\n", widget->part()->baseURL().url().latin1(), thisTime);
-#endif
+ #endif
         }
     }
 
@@ -260,32 +260,6 @@
 }
 
 
-#ifdef DELAY_LAYOUT
-- delayLayout: sender
-{
-    [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(delayLayout:) object: self];
-    WEBKITDEBUG("KWQHTMLView:  delayLayout called\n");
-    [self setNeedsLayout: YES];
-    [self setNeedsDisplay: YES];
-}
-
--(void)notificationReceived:(NSNotification *)notification
-{
-    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
-        WEBKITDEBUG1("KWQHTMLView: Received notification, %s\n", DEBUG_OBJECT([notification name]));
-        [self performSelector:@selector(delayLayout:) withObject:self afterDelay:(NSTimeInterval)0.5];
-    }
-}
-#else
--(void)notificationReceived:(NSNotification *)notification
-{
-    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
-        [self setNeedsLayout: YES];
-        [self setNeedsDisplay: YES];
-    }
-}
-#endif
-
 - (void)setNeedsDisplay:(BOOL)flag
 {
     WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
@@ -297,6 +271,8 @@
 {
     WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
     _private->needsLayout = flag;
+    if (flag)
+        [self setNeedsDisplay:YES];
 }
 
 
@@ -321,7 +297,7 @@
     // no page is yet loaded (2890818). We may need to modify this to always
     // draw the background color, in which case we'll have to make sure the
     // no-widget case is still handled correctly.
-    if (widget == 0l) {
+    if (widget == 0) {
         [[NSColor whiteColor] set];
         NSRectFill(rect);
         return;
@@ -373,55 +349,18 @@
 #endif
 }
 
-- (void)setIsFlipped: (bool)flag
-{
-    _private->isFlipped = flag;
-}
-
-
 - (BOOL)isFlipped 
 {
-    return _private->isFlipped;
-}
-
-
-- (void)viewWillStartLiveResize
-{
-    [super viewWillStartLiveResize];
-}
-
-- (void)viewDidEndLiveResize
-{
-    id scrollView = [[self superview] superview];
-
-    [super viewDidEndLiveResize];
-    
-    if ([scrollView isKindOfClass: [NSScrollView class]]){
-        [scrollView updateScrollers];
-        [scrollView tile];
-        [scrollView setNeedsDisplay: YES];
-    }
-
-    [self setNeedsLayout: YES];
-    [self setNeedsDisplay: YES];
-}
-
-
-- (void)windowWillClose: (NSNotification *)notification
-{
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResizeNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowWillCloseNotification object: nil];
+    return YES;
 }
 
 
 - (void)windowResized: (NSNotification *)notification
 {
-    if ([notification object] == [self window]){
+    // FIXME: This is a hack. We should relayout when the width of our
+    // superview's bounds changes, not when the window is resized.
+    if ([notification object] == [self window]) {
         [self setNeedsLayout: YES];
-        [self setNeedsDisplay: YES];
     }
 }
 
@@ -430,7 +369,6 @@
 {
     if ([notification object] == [self window])
         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
-    
 }
 
 
@@ -480,7 +418,7 @@
 
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
-    if (widget != 0l) {
+    if (widget) {
         widget->viewportMouseReleaseEvent(&kEvent);
     }
 }
@@ -511,7 +449,7 @@
 
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
-    if (widget != 0l) {
+    if (widget) {
         widget->viewportMousePressEvent(&kEvent);
     }
 }
@@ -529,7 +467,7 @@
         [[thisWindow contentView] hitTest:p] == self) {
         QMouseEvent kEvent(QEvent::MouseMove, QPoint((int)p.x, (int)p.y), 0, 0);
         KHTMLView *widget = _private->widget;
-        if (widget != 0l) {
+        if (widget) {
             widget->viewportMouseMoveEvent(&kEvent);
         }
     }
@@ -541,7 +479,7 @@
     
     QMouseEvent kEvent(QEvent::MouseMove, QPoint((int)p.x, (int)p.y), Qt::LeftButton, Qt::LeftButton);
     KHTMLView *widget = _private->widget;
-    if (widget != 0l) {
+    if (widget) {
         widget->viewportMouseMoveEvent(&kEvent);
     }
 }
@@ -555,7 +493,7 @@
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
     
     KHTMLView *widget = _private->widget;
-    if (widget != 0l)
+    if (widget)
         widget->keyPressEvent(&kEvent);
 }
 
@@ -569,33 +507,8 @@
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
     
     KHTMLView *widget = _private->widget;
-    if (widget != 0l)
+    if (widget)
         widget->keyReleaseEvent(&kEvent);
 }
 
-- (void)setCursor:(NSCursor *)cursor
-{
-    [_private->cursor release];
-    _private->cursor = [cursor retain];
-
-    // We have to make both of these calls, because:
-    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
-    //   inside the area of the rect.
-    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
-    //   there is no cursor rect set currently and the view has no subviews.
-    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
-    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
-    // call resetCursorRects from the proper context that will
-    // actually result in updating the cursor.
-    [self resetCursorRects];
-    [[self window] invalidateCursorRectsForView:self];
-}
-
-- (void)resetCursorRects
-{
-    if (_private->cursor != nil && _private->cursor != [NSCursor arrowCursor]) {
-        [self addCursorRect:[self visibleRect] cursor:_private->cursor];
-    }
-}
-
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.h b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
index 77e4862..f559517 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
@@ -20,7 +20,6 @@ class KHTMLView;
     KHTMLView *widget;
     BOOL widgetOwned;
     KHTMLView *provisionalWidget;
-    BOOL isFlipped;
     BOOL needsLayout;
     BOOL needsToApplyStyles;
     BOOL canDragTo;
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
index e4d58f0..92f7a5e 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
@@ -17,13 +17,10 @@
 @interface IFDynamicScrollBarsView : NSScrollView <WebCoreFrameView>
 {
     NSCursor *cursor;
-    BOOL breakRecursionCycle;
     BOOL allowsScrolling;
 }
 
-- (void)setAllowsScrolling: (BOOL)flag;
+- (void)setAllowsScrolling:(BOOL)flag;
 - (BOOL)allowsScrolling;
-- (void)updateScrollers;
-- (void)resetCursorRects;
 
 @end
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
index 687bef3..0056e3a 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
@@ -7,74 +7,84 @@
 //
 
 #import <WebKit/IFDynamicScrollBarsView.h>
-#import <WebKit/WebKitDebug.h>
 
 @implementation IFDynamicScrollBarsView
 
-- initWithFrame: (NSRect)frame
+- initWithFrame:(NSRect)frame
 {
-    [super initWithFrame: frame];
+    [super initWithFrame:frame];
     allowsScrolling = YES;
     return self;
 }
 
-// make the horizontal and vertical scroll bars come and go as needed
-- (void) reflectScrolledClipView: (NSClipView*)clipView
-{
-    if (allowsScrolling){    
-        if( clipView == [self contentView] && breakRecursionCycle == NO ) {
-            breakRecursionCycle = YES;
-            
-            [self updateScrollers];
-            
-            breakRecursionCycle = NO;
-        }
-    }
-    [super reflectScrolledClipView: clipView];
-}
-
-
 - (void)updateScrollers
 {
-    BOOL scrollersChanged = NO;
-    if (allowsScrolling){    
-        BOOL scrollsVertically;
-        BOOL scrollsHorizontally;
-        id dview = [self documentView];
-        
-        scrollsVertically = [dview bounds].size.height > [self frame].size.height;
+    BOOL scrollsVertically;
+    BOOL scrollsHorizontally;
+    BOOL scrollersChanged;    
+
+    if (!allowsScrolling) {
+        scrollsVertically = NO;
+        scrollsHorizontally = NO;
+    } else {
+        NSSize documentSize = [[self documentView] bounds].size;
+        NSSize frameSize = [self frame].size;
         
+        scrollsVertically = documentSize.height > frameSize.height;
         if (scrollsVertically)
-            scrollsHorizontally = ([dview bounds].size.width + [NSScroller scrollerWidth]) > [self frame].size.width;
-        else
-            scrollsHorizontally = [dview bounds].size.width > [self frame].size.width;
+            scrollsHorizontally = documentSize.width + [NSScroller scrollerWidth] > frameSize.width;
+        else {
+            scrollsHorizontally = documentSize.width > frameSize.width;
+            if (scrollsHorizontally)
+                scrollsVertically = documentSize.height + [NSScroller scrollerWidth] > frameSize.height;
+        }
+    }
+
+    scrollersChanged = NO;
         
-        if (scrollsHorizontally && !scrollsVertically)
-            scrollsVertically = ([dview bounds].size.height + [NSScroller scrollerWidth]) > [self frame].size.height;
+    if ([self hasVerticalScroller] != scrollsVertically) {
+        [self setHasVerticalScroller:scrollsVertically];
+        scrollersChanged = YES;
+    }
         
-        if ([self hasVerticalScroller] != scrollsVertically){
-            [self setHasVerticalScroller: scrollsVertically];
-            scrollersChanged = YES;
-        }
-            
-        if ([self hasHorizontalScroller] != scrollsHorizontally){
-            [self setHasHorizontalScroller: scrollsHorizontally];
-            scrollersChanged = YES;
-        }
+    if ([self hasHorizontalScroller] != scrollsHorizontally) {
+        [self setHasHorizontalScroller:scrollsHorizontally];
+        scrollersChanged = YES;
     }
     
-    if (scrollersChanged){
+    if (scrollersChanged) {
         [self tile];
-        [self setNeedsDisplay: YES];
+        [self setNeedsDisplay:YES];
     }
 }
 
+// Make the horizontal and vertical scroll bars come and go as needed.
+- (void)reflectScrolledClipView:(NSClipView *)clipView
+{
+    if (clipView == [self contentView]) {
+        [self updateScrollers];
+    }
+    [super reflectScrolledClipView:clipView];
+}
 
 - (void)setCursor:(NSCursor *)cur
 {
-    [cur retain];
+    // Do nothing for cases where the cursor isn't changing.
+    // Also turn arrowCursor into nil.
+    if (!cur) {
+        if (!cursor) {
+            return;
+        }
+    } else {
+        if ([cur isEqual:[NSCursor arrowCursor]]) {
+            cur = nil;
+        } else if (cursor && [cursor isEqual:cur]) {
+            return;
+        }
+    }
+    
     [cursor release];
-    cursor = cur;
+    cursor = [cur retain];
 
     // We have to make both of these calls, because:
     // - Just setting a cursor rect will have no effect, if the mouse cursor is already
@@ -83,26 +93,24 @@
     //   there is no cursor rect set currently and the view has no subviews.
     // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
     // at all, if we are going to want one, and then invalidateCursorRectsForView: to
-    // call resetCursorRects from the proper context that will
-    // actually result in updating the cursor.
+    // call resetCursorRects from the proper context that will actually result in
+    // updating the cursor.
     [self resetCursorRects];
     [[self window] invalidateCursorRectsForView:self];
 }
 
 - (void)resetCursorRects
 {
-    if (cursor != nil && cursor != [NSCursor arrowCursor]) {
+    [self discardCursorRects];
+    if (cursor) {
         [self addCursorRect:[self visibleRect] cursor:cursor];
     }
 }
 
-- (void)setAllowsScrolling: (BOOL)flag
+- (void)setAllowsScrolling:(BOOL)flag
 {
     allowsScrolling = flag;
-    if (allowsScrolling == NO){
-        [self setHasVerticalScroller: NO];
-        [self setHasHorizontalScroller: NO];
-    }
+    [self updateScrollers];
 }
 
 - (BOOL)allowsScrolling
@@ -110,6 +118,4 @@
     return allowsScrolling;
 }
 
-
-
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 92c6907..5245b2a 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -25,10 +25,6 @@
 
 #import <KWQKHTMLPartImpl.h>
 
- at interface NSScrollView (NSPrivate)
-- (void)_adjustForGrowBox;
- at end
-
 @implementation IFHTMLView
 
 - initWithFrame: (NSRect) frame
@@ -37,7 +33,6 @@
     
     _private = [[IFHTMLViewPrivate alloc] init];
 
-    _private->isFlipped = YES;
     _private->needsLayout = YES;
 
     _private->canDragTo = YES;
@@ -53,11 +48,6 @@
 
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
 
-    // We remove this view as an observer from all window notifications when the window
-    // is closed.  This may be redundant, but ensures that the view has no outstanding
-    // references.
-    [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowWillClose:) name: NSWindowWillCloseNotification object: nil];
-
     return self;
 }
 
@@ -77,10 +67,21 @@
 }
 
 
+- (void)removeNotifications
+{
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResizeNotification object: nil];
+}
+
+
 - (void)viewWillMoveToWindow:(NSWindow *)window
 {
-    if ([self window] && !window)
+    if ([self window] && !window) {
+        [self removeNotifications];
         [self _reset];
+    }
     [super viewWillMoveToWindow:window];
 }
 
@@ -153,7 +154,6 @@
 {
     KHTMLView *widget = _private->widget;
 
-
     // Ensure that we will receive mouse move events.  Is this the best place to put this?
     [[self window] setAcceptsMouseMovedEvents: YES];
     [[self window] _setShouldPostEventNotifications: YES];
@@ -161,19 +161,19 @@
     if (widget->part()->xmlDocImpl() && 
         widget->part()->xmlDocImpl()->renderer()){
         if (_private->needsLayout){
-#ifdef _KWQ_TIMING        
+ #ifdef _KWQ_TIMING        
     double start = CFAbsoluteTimeGetCurrent();
-#endif
+ #endif
 
             WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "doing layout\n");
             //double start = CFAbsoluteTimeGetCurrent();
             widget->layout();
             //WebKitDebugAtLevel (WEBKIT_LOG_TIMING, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
             _private->needsLayout = NO;
-#ifdef _KWQ_TIMING        
+ #ifdef _KWQ_TIMING        
     double thisTime = CFAbsoluteTimeGetCurrent() - start;
     WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s layout seconds = %f\n", widget->part()->baseURL().url().latin1(), thisTime);
-#endif
+ #endif
         }
     }
 
@@ -260,32 +260,6 @@
 }
 
 
-#ifdef DELAY_LAYOUT
-- delayLayout: sender
-{
-    [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(delayLayout:) object: self];
-    WEBKITDEBUG("KWQHTMLView:  delayLayout called\n");
-    [self setNeedsLayout: YES];
-    [self setNeedsDisplay: YES];
-}
-
--(void)notificationReceived:(NSNotification *)notification
-{
-    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
-        WEBKITDEBUG1("KWQHTMLView: Received notification, %s\n", DEBUG_OBJECT([notification name]));
-        [self performSelector:@selector(delayLayout:) withObject:self afterDelay:(NSTimeInterval)0.5];
-    }
-}
-#else
--(void)notificationReceived:(NSNotification *)notification
-{
-    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
-        [self setNeedsLayout: YES];
-        [self setNeedsDisplay: YES];
-    }
-}
-#endif
-
 - (void)setNeedsDisplay:(BOOL)flag
 {
     WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
@@ -297,6 +271,8 @@
 {
     WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
     _private->needsLayout = flag;
+    if (flag)
+        [self setNeedsDisplay:YES];
 }
 
 
@@ -321,7 +297,7 @@
     // no page is yet loaded (2890818). We may need to modify this to always
     // draw the background color, in which case we'll have to make sure the
     // no-widget case is still handled correctly.
-    if (widget == 0l) {
+    if (widget == 0) {
         [[NSColor whiteColor] set];
         NSRectFill(rect);
         return;
@@ -373,55 +349,18 @@
 #endif
 }
 
-- (void)setIsFlipped: (bool)flag
-{
-    _private->isFlipped = flag;
-}
-
-
 - (BOOL)isFlipped 
 {
-    return _private->isFlipped;
-}
-
-
-- (void)viewWillStartLiveResize
-{
-    [super viewWillStartLiveResize];
-}
-
-- (void)viewDidEndLiveResize
-{
-    id scrollView = [[self superview] superview];
-
-    [super viewDidEndLiveResize];
-    
-    if ([scrollView isKindOfClass: [NSScrollView class]]){
-        [scrollView updateScrollers];
-        [scrollView tile];
-        [scrollView setNeedsDisplay: YES];
-    }
-
-    [self setNeedsLayout: YES];
-    [self setNeedsDisplay: YES];
-}
-
-
-- (void)windowWillClose: (NSNotification *)notification
-{
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResizeNotification object: nil];
-    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowWillCloseNotification object: nil];
+    return YES;
 }
 
 
 - (void)windowResized: (NSNotification *)notification
 {
-    if ([notification object] == [self window]){
+    // FIXME: This is a hack. We should relayout when the width of our
+    // superview's bounds changes, not when the window is resized.
+    if ([notification object] == [self window]) {
         [self setNeedsLayout: YES];
-        [self setNeedsDisplay: YES];
     }
 }
 
@@ -430,7 +369,6 @@
 {
     if ([notification object] == [self window])
         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
-    
 }
 
 
@@ -480,7 +418,7 @@
 
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
-    if (widget != 0l) {
+    if (widget) {
         widget->viewportMouseReleaseEvent(&kEvent);
     }
 }
@@ -511,7 +449,7 @@
 
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
-    if (widget != 0l) {
+    if (widget) {
         widget->viewportMousePressEvent(&kEvent);
     }
 }
@@ -529,7 +467,7 @@
         [[thisWindow contentView] hitTest:p] == self) {
         QMouseEvent kEvent(QEvent::MouseMove, QPoint((int)p.x, (int)p.y), 0, 0);
         KHTMLView *widget = _private->widget;
-        if (widget != 0l) {
+        if (widget) {
             widget->viewportMouseMoveEvent(&kEvent);
         }
     }
@@ -541,7 +479,7 @@
     
     QMouseEvent kEvent(QEvent::MouseMove, QPoint((int)p.x, (int)p.y), Qt::LeftButton, Qt::LeftButton);
     KHTMLView *widget = _private->widget;
-    if (widget != 0l) {
+    if (widget) {
         widget->viewportMouseMoveEvent(&kEvent);
     }
 }
@@ -555,7 +493,7 @@
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
     
     KHTMLView *widget = _private->widget;
-    if (widget != 0l)
+    if (widget)
         widget->keyPressEvent(&kEvent);
 }
 
@@ -569,33 +507,8 @@
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
     
     KHTMLView *widget = _private->widget;
-    if (widget != 0l)
+    if (widget)
         widget->keyReleaseEvent(&kEvent);
 }
 
-- (void)setCursor:(NSCursor *)cursor
-{
-    [_private->cursor release];
-    _private->cursor = [cursor retain];
-
-    // We have to make both of these calls, because:
-    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
-    //   inside the area of the rect.
-    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
-    //   there is no cursor rect set currently and the view has no subviews.
-    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
-    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
-    // call resetCursorRects from the proper context that will
-    // actually result in updating the cursor.
-    [self resetCursorRects];
-    [[self window] invalidateCursorRectsForView:self];
-}
-
-- (void)resetCursorRects
-{
-    if (_private->cursor != nil && _private->cursor != [NSCursor arrowCursor]) {
-        [self addCursorRect:[self visibleRect] cursor:_private->cursor];
-    }
-}
-
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 77e4862..f559517 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -20,7 +20,6 @@ class KHTMLView;
     KHTMLView *widget;
     BOOL widgetOwned;
     KHTMLView *provisionalWidget;
-    BOOL isFlipped;
     BOOL needsLayout;
     BOOL needsToApplyStyles;
     BOOL canDragTo;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list