[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
eric at webkit.org
eric at webkit.org
Wed Jan 20 22:29:41 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 9327f45a088accb2a9996357fc10f14e1039ae8b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 19 22:50:50 2010 +0000
2010-01-19 Kent Tamura <tkent at chromium.org>
Reviewed by Darin Adler.
[DRT][Mac] Add modifiers parameter to eventSender.mouseDown() and eventSender.mouseUp()
https://bugs.webkit.org/show_bug.cgi?id=33783
Some listbox tests check selection behavior by click events with
"meta" or "shift" keys. Behaviors for such modifier keys are
platform-dependent. The new parameter of mouseDown() and mouseUp()
allows to specify not only concrete modifier keys such as
"shiftKey" "metaKey", but also functional names like
"addSelectionKey" "rangeSelectionKey".
* DumpRenderTree/mac/EventSendingController.mm:
(+[EventSendingController isSelectorExcludedFromWebScript:]):
(+[EventSendingController webScriptNameForSelector:]):
(buildModifierFlags):
(-[EventSendingController mouseDown:withModifiers:]):
(-[EventSendingController mouseDown:]):
(-[EventSendingController mouseUp:withModifiers:]):
(-[EventSendingController mouseUp:]):
(-[EventSendingController keyDown:withModifiers:withLocation:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 291d4a2..72a8916 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2010-01-19 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ [DRT][Mac] Add modifiers parameter to eventSender.mouseDown() and eventSender.mouseUp()
+ https://bugs.webkit.org/show_bug.cgi?id=33783
+
+ Some listbox tests check selection behavior by click events with
+ "meta" or "shift" keys. Behaviors for such modifier keys are
+ platform-dependent. The new parameter of mouseDown() and mouseUp()
+ allows to specify not only concrete modifier keys such as
+ "shiftKey" "metaKey", but also functional names like
+ "addSelectionKey" "rangeSelectionKey".
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ (+[EventSendingController webScriptNameForSelector:]):
+ (buildModifierFlags):
+ (-[EventSendingController mouseDown:withModifiers:]):
+ (-[EventSendingController mouseDown:]):
+ (-[EventSendingController mouseUp:withModifiers:]):
+ (-[EventSendingController mouseUp:]):
+ (-[EventSendingController keyDown:withModifiers:withLocation:]):
+
2010-01-19 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
index 33a04f4..5d920c6 100644
--- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
+++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
@@ -128,8 +128,10 @@ BOOL replayingSavedEvents;
|| aSelector == @selector(keyDown:withModifiers:withLocation:)
|| aSelector == @selector(leapForward:)
|| aSelector == @selector(mouseDown:)
+ || aSelector == @selector(mouseDown:withModifiers:)
|| aSelector == @selector(mouseMoveToX:Y:)
|| aSelector == @selector(mouseUp:)
+ || aSelector == @selector(mouseUp:withModifiers:)
|| aSelector == @selector(scheduleAsynchronousClick)
|| aSelector == @selector(textZoomIn)
|| aSelector == @selector(textZoomOut)
@@ -158,9 +160,9 @@ BOOL replayingSavedEvents;
return @"keyDown";
if (aSelector == @selector(leapForward:))
return @"leapForward";
- if (aSelector == @selector(mouseDown:))
+ if (aSelector == @selector(mouseDown:) || aSelector == @selector(mouseDown:withModifiers:))
return @"mouseDown";
- if (aSelector == @selector(mouseUp:))
+ if (aSelector == @selector(mouseUp:) || aSelector == @selector(mouseUp:withModifiers:))
return @"mouseUp";
if (aSelector == @selector(mouseMoveToX:Y:))
return @"mouseMoveTo";
@@ -285,7 +287,26 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
clickCount++;
}
-- (void)mouseDown:(int)buttonNumber
+static int buildModifierFlags(const WebScriptObject* modifiers)
+{
+ int flags = 0;
+ if (![modifiers isKindOfClass:[WebScriptObject class]])
+ return flags;
+ for (unsigned i = 0; [[modifiers webScriptValueAtIndex:i] isKindOfClass:[NSString class]]; i++) {
+ NSString* modifierName = (NSString*)[modifiers webScriptValueAtIndex:i];
+ if ([modifierName isEqual:@"ctrlKey"])
+ flags |= NSControlKeyMask;
+ else if ([modifierName isEqual:@"shiftKey"] || [modifierName isEqual:@"rangeSelectionKey"])
+ flags |= NSShiftKeyMask;
+ else if ([modifierName isEqual:@"altKey"])
+ flags |= NSAlternateKeyMask;
+ else if ([modifierName isEqual:@"metaKey"] || [modifierName isEqual:@"addSelectionKey"])
+ flags |= NSCommandKeyMask;
+ }
+ return flags;
+}
+
+- (void)mouseDown:(int)buttonNumber withModifiers:(WebScriptObject*)modifiers
{
[[[mainFrame frameView] documentView] layout];
[self updateClickCountForButton:buttonNumber];
@@ -293,7 +314,7 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
NSEventType eventType = eventTypeForMouseButtonAndAction(buttonNumber, MouseDown);
NSEvent *event = [NSEvent mouseEventWithType:eventType
location:lastMousePosition
- modifierFlags:0
+ modifierFlags:buildModifierFlags(modifiers)
timestamp:[self currentEventTime]
windowNumber:[[[mainFrame webView] window] windowNumber]
context:[NSGraphicsContext currentContext]
@@ -309,6 +330,11 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
}
}
+- (void)mouseDown:(int)buttonNumber
+{
+ [self mouseDown:buttonNumber withModifiers:nil];
+}
+
- (void)textZoomIn
{
[[mainFrame webView] makeTextLarger:self];
@@ -329,13 +355,14 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
[[mainFrame webView] zoomPageOut:self];
}
-- (void)mouseUp:(int)buttonNumber
+- (void)mouseUp:(int)buttonNumber withModifiers:(WebScriptObject*)modifiers
{
if (dragMode && !replayingSavedEvents) {
- NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseUp:)]];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseUp:withModifiers:)]];
[invocation setTarget:self];
- [invocation setSelector:@selector(mouseUp:)];
+ [invocation setSelector:@selector(mouseUp:withModifiers:)];
[invocation setArgument:&buttonNumber atIndex:2];
+ [invocation setArgument:&modifiers atIndex:3];
[EventSendingController saveEvent:invocation];
[EventSendingController replaySavedEvents];
@@ -347,7 +374,7 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
NSEventType eventType = eventTypeForMouseButtonAndAction(buttonNumber, MouseUp);
NSEvent *event = [NSEvent mouseEventWithType:eventType
location:lastMousePosition
- modifierFlags:0
+ modifierFlags:buildModifierFlags(modifiers)
timestamp:[self currentEventTime]
windowNumber:[[[mainFrame webView] window] windowNumber]
context:[NSGraphicsContext currentContext]
@@ -383,6 +410,11 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
}
}
+- (void)mouseUp:(int)buttonNumber
+{
+ [self mouseUp:buttonNumber withModifiers:nil];
+}
+
- (void)mouseMoveToX:(int)x Y:(int)y
{
if (dragMode && leftMouseButtonDown && !replayingSavedEvents) {
@@ -524,19 +556,7 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
charactersIgnoringModifiers = [character lowercaseString];
}
- if ([modifiers isKindOfClass:[WebScriptObject class]]) {
- for (unsigned i = 0; [[modifiers webScriptValueAtIndex:i] isKindOfClass:[NSString class]]; i++) {
- NSString *modifier = (NSString *)[modifiers webScriptValueAtIndex:i];
- if ([modifier isEqual:@"ctrlKey"])
- modifierFlags |= NSControlKeyMask;
- else if ([modifier isEqual:@"shiftKey"])
- modifierFlags |= NSShiftKeyMask;
- else if ([modifier isEqual:@"altKey"])
- modifierFlags |= NSAlternateKeyMask;
- else if ([modifier isEqual:@"metaKey"])
- modifierFlags |= NSCommandKeyMask;
- }
- }
+ modifierFlags |= buildModifierFlags(modifiers);
if (keyLocation == DOM_KEY_LOCATION_NUMPAD)
modifierFlags |= NSNumericPadKeyMask;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list