Reviewed by Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jan 2007 04:12:45 +0000 (04:12 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jan 2007 04:12:45 +0000 (04:12 +0000)
        - made the deferral of mouse events until drag completes conditional
          it's needed for drag testing, and harmful for selection testing

        * DumpRenderTree/EventSendingController.h: Added inDragMode boolean.
        * DumpRenderTree/EventSendingController.m:
        (+[EventSendingController isSelectorExcludedFromWebScript:]): Added setDragMode:.
        (+[EventSendingController webScriptNameForSelector:]): Added name for setDragMode,
        and remove unneeded clearKillRing name.
        (-[EventSendingController init]): Initialize inDragMode to true.
        (-[EventSendingController dealloc]): Removed overzealous assertions -- we should
        not be asserting things that are dependent on the test content!
        (-[EventSendingController leapForward:]): Only queue events in drag mode.
        (-[EventSendingController setDragMode:]): Added.
        (-[EventSendingController mouseDown]): Removed overzealous assertion.
        (-[EventSendingController mouseUp]): Removed overzealous assertions.
        Only queue events in drag mode.
        (-[EventSendingController mouseMoveToX:Y:]): Only queue events in drag mode.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19099 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/EventSendingController.h
WebKitTools/DumpRenderTree/EventSendingController.m

index bb8e9b0..a7b60bd 100644 (file)
@@ -1,3 +1,25 @@
+2007-01-24  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - made the deferral of mouse events until drag completes conditional
+          it's needed for drag testing, and harmful for selection testing
+
+        * DumpRenderTree/EventSendingController.h: Added inDragMode boolean.
+        * DumpRenderTree/EventSendingController.m:
+        (+[EventSendingController isSelectorExcludedFromWebScript:]): Added setDragMode:.
+        (+[EventSendingController webScriptNameForSelector:]): Added name for setDragMode,
+        and remove unneeded clearKillRing name.
+        (-[EventSendingController init]): Initialize inDragMode to true.
+        (-[EventSendingController dealloc]): Removed overzealous assertions -- we should
+        not be asserting things that are dependent on the test content!
+        (-[EventSendingController leapForward:]): Only queue events in drag mode.
+        (-[EventSendingController setDragMode:]): Added.
+        (-[EventSendingController mouseDown]): Removed overzealous assertion.
+        (-[EventSendingController mouseUp]): Removed overzealous assertions.
+        Only queue events in drag mode.
+        (-[EventSendingController mouseMoveToX:Y:]): Only queue events in drag mode.
+
 2007-01-24  Lars Knoll <lars@trolltech.com>
 
         Reviewed by Zack
index 718a485..e93df4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
  
 #import <Cocoa/Cocoa.h>
-
 #import <WebKit/WebKit.h>
 
-@interface EventSendingController : NSObject <DOMEventListener> {
+@interface EventSendingController : NSObject <DOMEventListener>
+{
     BOOL down;
+    BOOL inDragMode;
     int clickCount;
     NSTimeInterval lastClick;
     int eventNumber;
@@ -48,4 +49,3 @@
 @end
 
 extern NSPoint lastMousePosition;
-
index 9a08675..8476645 100644 (file)
@@ -107,7 +107,8 @@ BOOL replayingSavedEvents;
             || aSelector == @selector(keyDown:withModifiers:)
             || aSelector == @selector(enableDOMUIEventLogging:)
             || aSelector == @selector(fireKeyboardEventsToElement:)
-            || aSelector == @selector(clearKillRing))
+            || aSelector == @selector(clearKillRing)
+            || aSelector == @selector(setDragMode:))
         return NO;
     return YES;
 }
@@ -124,17 +125,22 @@ BOOL replayingSavedEvents;
         return @"enableDOMUIEventLogging";
     if (aSelector == @selector(fireKeyboardEventsToElement:))
         return @"fireKeyboardEventsToElement";
-    if (aSelector == @selector(clearKillRing))
-        return @"clearKillRing";
+    if (aSelector == @selector(setDragMode:))
+        return @"setDragMode";
     return nil;
 }
 
+- (id)init
+{
+    self = [super init];
+    if (self)
+        inDragMode = YES;
+    return self;
+}
+
 - (void)dealloc
 {
-    assert(!down);
-    assert([savedMouseEvents count] == 0);
     [savedMouseEvents release];
-    savedMouseEvents = nil;
     [super dealloc];
 }
 
@@ -145,7 +151,7 @@ BOOL replayingSavedEvents;
 
 - (void)leapForward:(int)milliseconds
 {
-    if (down && !replayingSavedEvents) {
+    if (inDragMode && down && !replayingSavedEvents) {
         NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(leapForward:)]];
         [invocation setTarget:self];
         [invocation setSelector:@selector(leapForward:)];
@@ -164,11 +170,13 @@ BOOL replayingSavedEvents;
     _NSNewKillRingSequence();
 }
 
-- (void)mouseDown
+- (void)setDragMode:(BOOL)dragMode
 {
-    assert(!down);
-    assert(!replayingSavedEvents);
+    inDragMode = dragMode;
+}
 
+- (void)mouseDown
+{
     [[[frame frameView] documentView] layout];
     if ([self currentEventTime] - lastClick >= 1)
         clickCount = 1;
@@ -193,9 +201,7 @@ BOOL replayingSavedEvents;
 
 - (void)mouseUp
 {
-    assert(down);
-
-    if (!replayingSavedEvents) {
+    if (inDragMode && !replayingSavedEvents) {
         NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseUp)]];
         [invocation setTarget:self];
         [invocation setSelector:@selector(mouseUp)];
@@ -206,7 +212,6 @@ BOOL replayingSavedEvents;
         return;
     }
 
-
     [[[frame frameView] documentView] layout];
     NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseUp 
                                         location:lastMousePosition 
@@ -244,7 +249,7 @@ BOOL replayingSavedEvents;
 
 - (void)mouseMoveToX:(int)x Y:(int)y
 {
-    if (down && !replayingSavedEvents) {
+    if (inDragMode && down && !replayingSavedEvents) {
         NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseMoveToX:Y:)]];
         [invocation setTarget:self];
         [invocation setSelector:@selector(mouseMoveToX:Y:)];