WebKitTools:
authoralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2008 00:32:52 +0000 (00:32 +0000)
committeralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2008 00:32:52 +0000 (00:32 +0000)
        Reviewed by Alexey and Darin.

        Adding "home" and "end" to DRT's keydown since
        DOM key events can't handle keyIdentifiers at this point.

        * DumpRenderTree/mac/EventSendingController.mm:
        (-[EventSendingController keyDown:withModifiers:]):
        * DumpRenderTree/win/EventSender.cpp:
        (keyDownCallback):

LayoutTests:

        Reviewed by Alexey and Darin.

        * editing/selection/move-begin-end.html:
        add a codepath that will test the same kind of functionality for home and end keys
        * platform/win/Skipped:
        removing section of tests that have been resolved

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

LayoutTests/ChangeLog
LayoutTests/editing/selection/move-begin-end.html
LayoutTests/platform/win/Skipped
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/EventSendingController.mm
WebKitTools/DumpRenderTree/win/EventSender.cpp

index e3d4c76..26c2942 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-04  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Alexey and Darin.
+
+        * editing/selection/move-begin-end.html:
+        add a codepath that will test the same kind of functionality for home and end keys
+        * platform/win/Skipped:
+        removing section of tests that have been resolved
+
 2008-01-04  Oliver Hunt  <oliver@apple.com>
 
         RS=Adam
 2008-01-04  Oliver Hunt  <oliver@apple.com>
 
         RS=Adam
index 96dd3a7..4166cab 100644 (file)
@@ -13,40 +13,56 @@ if (window.layoutTestController)
                     log('This test must be run by DumpRenderTree!') 
                     return;
                 }
                     log('This test must be run by DumpRenderTree!') 
                     return;
                 }
+
+                var onMacPlatform = false;
+                if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
+                    onMacPlatform = true;
                 
                 var area = document.getElementById('area');
                 area.focus();
                 
                 var sel = window.getSelection();
                 // Position the caret at the beginning of the string.
                 
                 var area = document.getElementById('area');
                 area.focus();
                 
                 var sel = window.getSelection();
                 // Position the caret at the beginning of the string.
-                eventSender.keyDown(String.fromCharCode(0xf702));
+                eventSender.keyDown("leftArrow");
 
                 // Now move to the end
 
                 // Now move to the end
-                eventSender.keyDown(String.fromCharCode(0xf703), ["metaKey"]);
+                if (onMacPlatform)
+                    eventSender.keyDown("rightArrow", ["metaKey"]);
+                else
+                    eventSender.keyDown("end");
 
                 if (sel.baseOffset != 9 || sel.extentOffset != 9)
                     return;
                 
                 // Now move back to the beginning
 
                 if (sel.baseOffset != 9 || sel.extentOffset != 9)
                     return;
                 
                 // Now move back to the beginning
-                eventSender.keyDown(String.fromCharCode(0xf702), ["metaKey"]);
+                if (onMacPlatform)
+                    eventSender.keyDown("leftArrow", ["metaKey"]);
+                else
+                    eventSender.keyDown("home");
 
                 if (sel.baseOffset != 0 || sel.extentOffset != 0)
                     return;
 
                 // Now move to the end, selecting
 
                 if (sel.baseOffset != 0 || sel.extentOffset != 0)
                     return;
 
                 // Now move to the end, selecting
-                eventSender.keyDown(String.fromCharCode(0xf703), ["metaKey", "shiftKey"]);
+                if (onMacPlatform)
+                    eventSender.keyDown("rightArrow", ["metaKey", "shiftKey"]);
+                else
+                    eventSender.keyDown("end",["shiftKey"]);
 
                 if (sel.baseOffset != 0 || sel.extentOffset != 9)
                     return;
 
 
                 if (sel.baseOffset != 0 || sel.extentOffset != 9)
                     return;
 
-                // Deselect but position the caret at the end                
-                eventSender.keyDown(String.fromCharCode(0xf703));
+                // Deselect but position the caret at the end
+                eventSender.keyDown("rightArrow");
                 
                 if (sel.baseOffset != 9 || sel.extentOffset != 9)
                     return;
                 
                 // Now move to the beginning, selecting
                 
                 if (sel.baseOffset != 9 || sel.extentOffset != 9)
                     return;
                 
                 // Now move to the beginning, selecting
-                eventSender.keyDown(String.fromCharCode(0xf702), ["metaKey", "shiftKey"]);
+                if (onMacPlatform)
+                    eventSender.keyDown("leftArrow", ["metaKey", "shiftKey"]);
+                else
+                    eventSender.keyDown("home",["shiftKey"]);
                 
                 if (sel.baseOffset != 9 || sel.extentOffset != 0)
                     return;
                 
                 if (sel.baseOffset != 9 || sel.extentOffset != 0)
                     return;
index 88a7798..69a2cfa 100644 (file)
@@ -215,15 +215,6 @@ fast/dom/wrapper-classes.html
 # This test uses Mac-specific key codes <rdar://problem/5076426>
 fast/events/arrow-navigation.html
 
 # This test uses Mac-specific key codes <rdar://problem/5076426>
 fast/events/arrow-navigation.html
 
-# Selection seems to fail for some LayoutTests <rdar://problem/5130762>
-editing/selection/move-begin-end.html
-fast/inline/dirtyLinesForInline.html
-fast/text/textIteratorNilRenderer.html
-svg/custom/pointer-events-image.svg
-svg/custom/pointer-events-path.svg
-svg/custom/pointer-events-text.svg
-svg/custom/text-hit-test.svg
-
 # Emacs bindings are used in LayoutTests which fail on boomer. <rdar://problem/5137352>
 fast/events/keydown-1.html
 
 # Emacs bindings are used in LayoutTests which fail on boomer. <rdar://problem/5137352>
 fast/events/keydown-1.html
 
index 70fac13..66ac491 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-04  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Alexey and Darin.
+
+        Adding "home" and "end" to DRT's keydown since
+        DOM key events can't handle keyIdentifiers at this point. 
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController keyDown:withModifiers:]):
+        * DumpRenderTree/win/EventSender.cpp:
+        (keyDownCallback):
+
 2008-01-04  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
 2008-01-04  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
index 8f6a154..8e9be38 100644 (file)
@@ -371,6 +371,12 @@ BOOL replayingSavedEvents;
     } else if ([character isEqualToString:@"pageDown"]) {
         const unichar ch = NSPageDownFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
     } else if ([character isEqualToString:@"pageDown"]) {
         const unichar ch = NSPageDownFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+    } else if ([character isEqualToString:@"home"]) {
+        const unichar ch = NSHomeFunctionKey;
+        eventCharacter = [NSString stringWithCharacters:&ch length:1];
+    } else if ([character isEqualToString:@"end"]) {
+        const unichar ch = NSEndFunctionKey;
+        eventCharacter = [NSString stringWithCharacters:&ch length:1];
     } else if ([character isEqualToString:@"delete"]) {
         const unichar ch = 0x7f;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
     } else if ([character isEqualToString:@"delete"]) {
         const unichar ch = 0x7f;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
index 7fec10a..0e71c80 100644 (file)
@@ -310,6 +310,10 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
         virtualKeyCode = VK_PRIOR;
     else if (JSStringIsEqualToUTF8CString(character, "pageDown"))
         virtualKeyCode = VK_NEXT;
         virtualKeyCode = VK_PRIOR;
     else if (JSStringIsEqualToUTF8CString(character, "pageDown"))
         virtualKeyCode = VK_NEXT;
+    else if (JSStringIsEqualToUTF8CString(character, "home"))
+        virtualKeyCode = VK_HOME;
+    else if (JSStringIsEqualToUTF8CString(character, "end"))
+        virtualKeyCode = VK_END;
     else if (JSStringIsEqualToUTF8CString(character, "delete"))
         virtualKeyCode = VK_BACK;
     else {
     else if (JSStringIsEqualToUTF8CString(character, "delete"))
         virtualKeyCode = VK_BACK;
     else {