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


The following commit has been merged in the debian/unstable branch:
commit 3fe440811a6933c106807bc45525e43fe2ab8a1a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 10 00:46:11 2003 +0000

    	Ensure that the autoscroll timer is always stopped if a mouse up event is lost.
    
            Reviewed by John.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLViewPrivate dealloc]):
            (-[WebHTMLView _startAutoscrollTimer:]):
            (-[WebHTMLView _stopAutoscrollTimer]):
            (-[WebHTMLView _autoscroll]):
            (-[WebHTMLView mouseDown:]):
            * WebView.subproj/WebHTMLViewPrivate.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 045227e..8d28554 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2003-10-09  Richard Williamson   <rjw at apple.com>
+
+	Ensure that the autoscroll timer is always stopped if a mouse up event is lost.
+
+        Reviewed by John.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLViewPrivate dealloc]):
+        (-[WebHTMLView _startAutoscrollTimer:]):
+        (-[WebHTMLView _stopAutoscrollTimer]):
+        (-[WebHTMLView _autoscroll]):
+        (-[WebHTMLView mouseDown:]):
+        * WebView.subproj/WebHTMLViewPrivate.h:
+
 2003-10-09  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3333897>: should support navigator.plugins.refresh as a way to add a plugin without restarting Safari
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 7a0ea4a..8e7c6ca 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -25,6 +25,7 @@
 #import <WebKit/WebUnicode.h>
 #import <WebKit/WebViewPrivate.h>
 
+#import <AppKit/NSGraphicsContextPrivate.h>
 #import <AppKit/NSResponder_Private.h>
 #import <CoreGraphics/CGContextGState.h>
 
@@ -90,6 +91,7 @@ static BOOL forceRealHitTest = NO;
 - (void)dealloc
 {
     ASSERT(autoscrollTimer == nil);
+    ASSERT(autoscrollTriggerEvent == nil);
     
     [pluginController destroyAllPlugins];
     
@@ -744,11 +746,12 @@ static WebHTMLView *lastHitView = nil;
     return [[self _bridge] selectionRect];
 }
 
-- (void)_startAutoscrollTimer
+- (void)_startAutoscrollTimer: (NSEvent *)triggerEvent
 {
     if (_private->autoscrollTimer == nil) {
         _private->autoscrollTimer = [[NSTimer scheduledTimerWithTimeInterval:AUTOSCROLL_INTERVAL
             target:self selector:@selector(_autoscroll) userInfo:nil repeats:YES] retain];
+        _private->autoscrollTriggerEvent = [triggerEvent retain];
     }
 }
 
@@ -756,14 +759,22 @@ static WebHTMLView *lastHitView = nil;
 {
     NSTimer *timer = _private->autoscrollTimer;
     _private->autoscrollTimer = nil;
+    [_private->autoscrollTriggerEvent release];
+    _private->autoscrollTriggerEvent = nil;
     [timer invalidate];
     [timer release];
 }
 
+
 - (void)_autoscroll
 {
-    NSEvent *mouseUpEvent = [NSApp nextEventMatchingMask:NSLeftMouseUpMask untilDate:nil inMode:NSEventTrackingRunLoopMode dequeue:NO];
-    if (mouseUpEvent) {
+    int isStillDown;
+    
+    // Guarantee that the autoscroll timer is invalidated, even if we don't receive
+    // a mouse up event.
+    PSstilldown([_private->autoscrollTriggerEvent eventNumber], &isStillDown);
+    if (!isStillDown){
+        [self _stopAutoscrollTimer];
         return;
     }
 
@@ -1410,7 +1421,7 @@ static WebHTMLView *lastHitView = nil;
     }
     
     _private->ignoringMouseDraggedEvents = NO;
-    [self _startAutoscrollTimer];
+    [self _startAutoscrollTimer:event];
     
     // Record the mouse down position so we can determine drag hysteresis.
     [_private->mouseDownEvent release];
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index e336622..433404d 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -42,6 +42,7 @@
     void *trackingRectUserData;
     
     NSTimer *autoscrollTimer;
+    NSEvent *autoscrollTriggerEvent;
 }
 @end
 
@@ -80,7 +81,7 @@
 
 - (NSRect)_selectionRect;
 
-- (void)_startAutoscrollTimer;
+- (void)_startAutoscrollTimer:(NSEvent *)event;
 - (void)_stopAutoscrollTimer;
 
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list