[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:51:19 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 0229fecc53eac63fa6b14e94100274c15b2d0516
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 29 06:33:19 2009 +0000

    2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Maciej Stachowiak.
    
            Fixed isKeypadEvent behavior for chromium/Mac to correctly report
            keyLocation as DOM_KEY_LOCATION_NUMPAD for numeric pad key events.
            https://bugs.webkit.org/show_bug.cgi?id=28247
    
            Test: fast/events/keydown-numpad-keys.html
    
            * src/mac/WebInputEventFactory.mm:
            (WebKit::isKeypadEvent):
    2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Maciej Stachowiak.
    
            Fixed isKeypadEvent behavior for Mac to correctly report keyLocation
            as DOM_KEY_LOCATION_NUMPAD for numeric pad key events.
            https://bugs.webkit.org/show_bug.cgi?id=28247
    
            Test: fast/events/keydown-numpad-keys.html
    
            * platform/mac/KeyEventMac.mm:
            (WebCore::isKeypadEvent):
    2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Maciej Stachowiak.
    
            Added a layout-test that tests if numeric pad arrow key
            events are correctly reported with keyLocation as
            DOM_KEY_LOCATION_NUMPAD.  Currently this test only passes on Mac.
            https://bugs.webkit.org/show_bug.cgi?id=28247
    
            * fast/events/keydown-numpad-keys-expected.txt: Added.
            * fast/events/keydown-numpad-keys.html: Added.
            * fast/events/script-tests/keydown-numpad-keys.js: Added.
            (recordKeyEvent):
            (testKeyEventWithLocation):
    
            * platform/gtk/Skipped: fast/events/keydown-numpad-keys.html added.
            * platform/qt/Skipped: fast/events/keydown-numpad-keys.html added.
            * platform/win/Skipped: fast/events/keydown-numpad-keys.html added.
    2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Maciej Stachowiak.
    
            Extended EventSender.keyDown method to take another (3rd) argument
            for indicating the keyLocation to make numeric pad key events testable.
            Expected values for the argument is one of the KeyLocationCode
            specified in DOM Level 3
            (http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents).
            https://bugs.webkit.org/show_bug.cgi?id=28247
    
            Test: fast/events/keydown-numpad-keys.html
    
            * DumpRenderTree/mac/EventSendingController.mm:
            (+[EventSendingController isSelectorExcludedFromWebScript:]):
            (+[EventSendingController webScriptNameForSelector:]):
            (-[EventSendingController keyDown:withModifiers:withLocation:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52608 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c6c5ade..d44977c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Added a layout-test that tests if numeric pad arrow key
+        events are correctly reported with keyLocation as
+        DOM_KEY_LOCATION_NUMPAD.  Currently this test only passes on Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=28247
+
+        * fast/events/keydown-numpad-keys-expected.txt: Added.
+        * fast/events/keydown-numpad-keys.html: Added.
+        * fast/events/script-tests/keydown-numpad-keys.js: Added.
+        (recordKeyEvent):
+        (testKeyEventWithLocation):
+
+        * platform/gtk/Skipped: fast/events/keydown-numpad-keys.html added.
+        * platform/qt/Skipped: fast/events/keydown-numpad-keys.html added.
+        * platform/win/Skipped: fast/events/keydown-numpad-keys.html added.
+
 2009-12-28  Mike Moretti  <webkit9 at mordent.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/events/keydown-numpad-keys-expected.txt b/LayoutTests/fast/events/keydown-numpad-keys-expected.txt
new file mode 100644
index 0000000..27a47e3
--- /dev/null
+++ b/LayoutTests/fast/events/keydown-numpad-keys-expected.txt
@@ -0,0 +1,58 @@
+
+This tests keyboard events with KeyLocationCode argument.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 33
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 34
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 36
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 35
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 37
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 39
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 38
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 40
+PASS lastKeyboardEvent.keyLocation is 0
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 33
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 34
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 36
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 35
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 37
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 39
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 38
+PASS lastKeyboardEvent.keyLocation is 3
+PASS lastKeyboardEvent.type is "keydown"
+PASS lastKeyboardEvent.keyCode is 40
+PASS lastKeyboardEvent.keyLocation is 3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/keydown-numpad-keys.html b/LayoutTests/fast/events/keydown-numpad-keys.html
new file mode 100644
index 0000000..0a0ffcb
--- /dev/null
+++ b/LayoutTests/fast/events/keydown-numpad-keys.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/keydown-numpad-keys.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js b/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js
new file mode 100644
index 0000000..bc1b3f4
--- /dev/null
+++ b/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js
@@ -0,0 +1,57 @@
+description("This tests keyboard events with KeyLocationCode argument.");
+
+var lastKeyboardEvent;
+
+function recordKeyEvent(ev) {
+    ev = ev || event;
+    ev.keyCode = (ev.which || ev.keyCode);
+    if (window.eventSender) {
+        lastKeyboardEvent = ev;
+    } else {
+        debug('Type=' + ev.type + ',' +
+              'keyCode=' + ev.keyCode + ',' +
+              'ctrlKey=' + ev.ctrlKey + ',' +
+              'shiftKey=' + ev.shiftKey + ',' +
+              'altKey=' + ev.altKey + ',' +
+              'metaKey=' + ev.metaKey + ',' +
+              'location=' + ev.keyLocation);
+    }
+}
+
+function testKeyEventWithLocation(evString, evLocation, expectedKeyCode) {
+    eventSender.keyDown(evString, [], evLocation);
+    shouldBe("lastKeyboardEvent.type", '"keydown"');
+    shouldEvaluateTo("lastKeyboardEvent.keyCode", expectedKeyCode);
+    shouldEvaluateTo("lastKeyboardEvent.keyLocation", evLocation);
+}
+
+var textarea = document.createElement("textarea");
+textarea.addEventListener("keydown", recordKeyEvent, false);
+document.body.insertBefore(textarea, document.body.firstChild);
+textarea.focus();
+
+if (window.eventSender) {
+    // location=0 indicates that we send events as standard keys.
+    testKeyEventWithLocation("pageUp", 0, 33);
+    testKeyEventWithLocation("pageDown", 0, 34);
+    testKeyEventWithLocation("home", 0, 36);
+    testKeyEventWithLocation("end", 0, 35);
+    testKeyEventWithLocation("leftArrow", 0, 37);
+    testKeyEventWithLocation("rightArrow", 0, 39);
+    testKeyEventWithLocation("upArrow", 0, 38);
+    testKeyEventWithLocation("downArrow", 0, 40);
+
+    // location=3 indicates that we send events as numeric-pad keys.
+    testKeyEventWithLocation("pageUp", 3, 33);
+    testKeyEventWithLocation("pageDown", 3, 34);
+    testKeyEventWithLocation("home", 3, 36);
+    testKeyEventWithLocation("end", 3, 35);
+    testKeyEventWithLocation("leftArrow", 3, 37);
+    testKeyEventWithLocation("rightArrow", 3, 39);
+    testKeyEventWithLocation("upArrow", 3, 38);
+    testKeyEventWithLocation("downArrow", 3, 40);
+} else {
+    debug("This test requires DumpRenderTree.  To manually test, 1) focus on the textarea above and push numpad keys without locking NumLock and 2) see if the location= value is 3 (DOM_KEY_LOCATION_NUMPAD specified in DOM level 3).");
+}
+
+var successfullyParsed = true;
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index c18713d..55d1db0 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -2259,6 +2259,7 @@ fast/events/event-listener-on-link.html
 fast/events/event-sender-mouse-moved.html
 fast/events/focusingUnloadedFrame.html
 fast/events/keydown-1.html
+fast/events/keydown-numpad-keys.html
 fast/events/label-focus.html
 fast/events/mouseout-dead-node.html
 fast/events/onload-re-entry.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 2bbdce5..583e8ff 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -458,6 +458,7 @@ fast/events/drag-in-frames.html
 fast/events/focusingUnloadedFrame.html
 fast/events/js-keyboard-event-creation.html
 fast/events/keydown-1.html
+fast/events/keydown-numpad-keys.html
 fast/events/keypress-insert-tab.html
 fast/events/mouseout-dead-node.html
 fast/events/ondragenter.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index b97abaa..b8eaffb 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -118,6 +118,9 @@ fast/events/attempt-scroll-with-no-scrollbars.html
 # Emacs bindings are used in LayoutTests which fail on boomer. <rdar://problem/5137352>
 fast/events/keydown-1.html
 
+# No support for key event location in EventSender.
+fast/events/keydown-numpad-keys.html
+
 # The eqqivalent of option-tab doesn not exist in Boomer <rdar://problem/5137230>
 fast/events/frame-tab-focus.html
 fast/events/option-tab.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index acfca97..d8212a2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Fixed isKeypadEvent behavior for Mac to correctly report keyLocation
+        as DOM_KEY_LOCATION_NUMPAD for numeric pad key events.
+        https://bugs.webkit.org/show_bug.cgi?id=28247
+
+        Test: fast/events/keydown-numpad-keys.html
+
+        * platform/mac/KeyEventMac.mm:
+        (WebCore::isKeypadEvent):
+
 2009-12-28  Mike Moretti  <webkit9 at mordent.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/mac/KeyEventMac.mm b/WebCore/platform/mac/KeyEventMac.mm
index 0bc8800..2e1579b 100644
--- a/WebCore/platform/mac/KeyEventMac.mm
+++ b/WebCore/platform/mac/KeyEventMac.mm
@@ -368,6 +368,9 @@ static bool isKeypadEvent(NSEvent* event)
             return false;
     }
 
+    if ([event modifierFlags] & NSNumericPadKeyMask)
+        return true;
+
     switch ([event keyCode]) {
         case 71: // Clear
         case 81: // =
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 34ffe5b..7f62309 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Fixed isKeypadEvent behavior for chromium/Mac to correctly report
+        keyLocation as DOM_KEY_LOCATION_NUMPAD for numeric pad key events.
+        https://bugs.webkit.org/show_bug.cgi?id=28247
+
+        Test: fast/events/keydown-numpad-keys.html
+
+        * src/mac/WebInputEventFactory.mm:
+        (WebKit::isKeypadEvent):
+
 2009-12-22  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/chromium/src/mac/WebInputEventFactory.mm b/WebKit/chromium/src/mac/WebInputEventFactory.mm
index d618228..46b0afe 100644
--- a/WebKit/chromium/src/mac/WebInputEventFactory.mm
+++ b/WebKit/chromium/src/mac/WebInputEventFactory.mm
@@ -92,6 +92,9 @@ static bool isKeypadEvent(NSEvent* event)
         return false;
     }
 
+    if ([event modifierFlags] & NSNumericPadKeyMask)
+        return true;
+
     switch ([event keyCode]) {
     case 71: // Clear
     case 81: // =
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ed5efa1..9b8f9da 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-28  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Extended EventSender.keyDown method to take another (3rd) argument
+        for indicating the keyLocation to make numeric pad key events testable.
+        Expected values for the argument is one of the KeyLocationCode
+        specified in DOM Level 3
+        (http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents).
+        https://bugs.webkit.org/show_bug.cgi?id=28247
+
+        Test: fast/events/keydown-numpad-keys.html
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (+[EventSendingController isSelectorExcludedFromWebScript:]):
+        (+[EventSendingController webScriptNameForSelector:]):
+        (-[EventSendingController keyDown:withModifiers:withLocation:]):
+
 2009-12-28  Ariya Hidayat  <ariya.hidayat at gmail.com>
 
         Unreviewed, update my email address.
diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
index 1cba53b..33a04f4 100644
--- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
+++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
@@ -125,7 +125,7 @@ BOOL replayingSavedEvents;
             || aSelector == @selector(contextClick)
             || aSelector == @selector(enableDOMUIEventLogging:)
             || aSelector == @selector(fireKeyboardEventsToElement:)
-            || aSelector == @selector(keyDown:withModifiers:)
+            || aSelector == @selector(keyDown:withModifiers:withLocation:)
             || aSelector == @selector(leapForward:)
             || aSelector == @selector(mouseDown:)
             || aSelector == @selector(mouseMoveToX:Y:)
@@ -154,7 +154,7 @@ BOOL replayingSavedEvents;
         return @"enableDOMUIEventLogging";
     if (aSelector == @selector(fireKeyboardEventsToElement:))
         return @"fireKeyboardEventsToElement";
-    if (aSelector == @selector(keyDown:withModifiers:))
+    if (aSelector == @selector(keyDown:withModifiers:withLocation:))
         return @"keyDown";
     if (aSelector == @selector(leapForward:))
         return @"leapForward";
@@ -474,7 +474,7 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
     savedMouseEvents = nil;
 }
 
-- (void)keyDown:(NSString *)character withModifiers:(WebScriptObject *)modifiers
+- (void)keyDown:(NSString *)character withModifiers:(WebScriptObject *)modifiers withLocation:(unsigned long)keyLocation
 {
     NSString *eventCharacter = character;
     if ([character isEqualToString:@"leftArrow"]) {
@@ -538,6 +538,9 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
         }
     }
 
+    if (keyLocation == DOM_KEY_LOCATION_NUMPAD)
+        modifierFlags |= NSNumericPadKeyMask;
+
     [[[mainFrame frameView] documentView] layout];
 
     NSEvent *event = [NSEvent keyEventWithType:NSKeyDown

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list