Commit 17077804 authored by abarth@webkit.org's avatar abarth@webkit.org

2009-08-24 Hironori Bono <hbono@chromium.org>

        Reviewed by Adam Barth.

        Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
        <https://bugs.webkit.org/show_bug.cgi?id=27827>.

        Because of the lack of mappings from GDK key-codes to WebKit key-codes,
        Chromium cannot send valid key-codes to JavaScript when a user types
        function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.

        To write layout tests for this issue, added mappings from function-key
        names to platform-specific key-codes to EventSendingController objects
        so that eventSender.keyDown() can send function-key events without using
        platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
        is only for Mac. So this change adds this new test to Skipped tests for other
        platforms to prevent this change from crashing the build trees.)

        * fast/events/keydown-function-keys-expected.txt: Added.
        * fast/events/keydown-function-keys.html: Added.
        * platform/gtk/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:
2009-08-24  Hironori Bono  <hbono@chromium.org>

        Reviewed by Adam Barth.

        Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
        <https://bugs.webkit.org/show_bug.cgi?id=27827>.

        Because of the lack of mappings from GDK key-codes to WebKit key-codes,
        Chromium cannot send valid key-codes to JavaScript when a user types
        function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.

        To write layout tests for this issue, added mappings from function-key
        names to platform-specific key-codes to EventSendingController objects
        so that eventSender.keyDown() can send function-key events without using
        platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
        is only for Mac. So this change adds this new test to Skipped tests for other
        platforms to prevent this change from crashing the build trees.)

        Test: fast/events/keydown-function-keys.html

       * platform/chromium/KeyCodeConversionGtk.cpp: Add mappings from GDK key-codes
        to WebKit key-code for function keys.
        (WebCore::windowsKeyCodeForKeyEvent):
2009-08-24  Hironori Bono  <hbono@chromium.org>

        Reviewed by Adam Barth.

        Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
        <https://bugs.webkit.org/show_bug.cgi?id=27827>.

        Because of the lack of mappings from GDK key-codes to WebKit key-codes,
        Chromium cannot send valid key-codes to JavaScript when a user types
        function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.

        To write layout tests for this issue, added mappings from function-key
        names to platform-specific key-codes to EventSendingController objects
        so that eventSender.keyDown() can send function-key events without using
        platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
        is only for Mac. So this change adds this new test to Skipped tests for other
        platforms to prevent this change from crashing the build trees.)

        * DumpRenderTree/mac/EventSendingController.mm:
        (-[EventSendingController keyDown:withModifiers:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0fd9fcc4
2009-08-24 Hironori Bono <hbono@chromium.org>
Reviewed by Adam Barth.
Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
<https://bugs.webkit.org/show_bug.cgi?id=27827>.
Because of the lack of mappings from GDK key-codes to WebKit key-codes,
Chromium cannot send valid key-codes to JavaScript when a user types
function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.
To write layout tests for this issue, added mappings from function-key
names to platform-specific key-codes to EventSendingController objects
so that eventSender.keyDown() can send function-key events without using
platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
is only for Mac. So this change adds this new test to Skipped tests for other
platforms to prevent this change from crashing the build trees.)
* fast/events/keydown-function-keys-expected.txt: Added.
* fast/events/keydown-function-keys.html: Added.
* platform/gtk/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
2009-08-24 Alexey Proskuryakov <ap@apple.com>
Reviewed by Darin Adler.
......
This test verifies the keycodes sent when we press function keys.
Type=keydown,keyCode=112,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=112,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=113,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=113,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=114,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=114,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=115,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=115,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=116,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=116,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=117,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=117,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=118,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=118,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=119,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=119,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=120,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=120,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=121,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=121,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=122,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=122,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keydown,keyCode=123,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
Type=keyup,keyCode=123,ctrlKey=false,shiftKey=false,altKey=false,metaKey=false
<html>
<head>
<title>Event Test (Sending function-key events)</title>
<script language="javascript" type="text/javascript">
function log(str) {
var li = document.createElement("li");
li.appendChild(document.createTextNode(str));
var console = document.getElementById("console");
console.appendChild(li);
}
function onKeyEvent(ev) {
ev = ev || event;
log('Type=' + ev.type + ',' +
'keyCode=' + (ev.which || ev.keyCode) + ',' +
'ctrlKey=' + ev.ctrlKey + ',' +
'shiftKey=' + ev.shiftKey + ',' +
'altKey=' + ev.altKey + ',' +
'metaKey=' + ev.metaKey);
}
</script>
</head>
<body>
<p>This test verifies the keycodes sent when we press function keys.</p>
<textarea id="test" rows="1" cols="40" onkeydown="return onKeyEvent(event);" onkeyup="return onKeyEvent(event);"></textarea>
<ul id="console"></ul>
<script language="javascript" type="text/javascript">
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
var textarea = document.getElementById("test");
textarea.focus();
eventSender.keyDown("F1");
eventSender.keyDown("F2");
eventSender.keyDown("F3");
eventSender.keyDown("F4");
eventSender.keyDown("F5");
eventSender.keyDown("F6");
eventSender.keyDown("F7");
eventSender.keyDown("F8");
eventSender.keyDown("F9");
eventSender.keyDown("F10");
eventSender.keyDown("F11");
eventSender.keyDown("F12");
</script>
</body>
</html>
......@@ -5835,6 +5835,7 @@ webarchive/test-xml-stylesheet.xml
editing/selection/extend-selection-after-double-click.html
fast/events/drag-to-navigate.html
fast/events/prevent-drag-to-navigate.html
fast/events/keydown-function-keys.html
fast/forms/search-delete-while-cancel-button-clicked.html
fast/forms/slider-delete-while-dragging-thumb.html
http/tests/local/drag-over-remote-content.html
......
......@@ -5033,6 +5033,9 @@ fast/harness/override-zzz-reset.html
fast/harness/use-page-cache.html
loader/go-back-to-different-window-size.html
# A test that failed because eventSender cannot send function-key events.
fast/events/keydown-function-keys.html
# This port doesn't support Geolocation.
fast/dom/Geolocation
......
......@@ -621,6 +621,9 @@ fast/forms/menulist-style-color.html
# <rdar://7127902> http/tests/misc/favicon-loads-with-images-disabled.html crashes on Windows debug
http/tests/misc/favicon-loads-with-images-disabled.html
# A test that failed because eventSender cannot send function-key events.
fast/events/keydown-function-keys.html
# This port doesn't support Geolocation.
fast/dom/Geolocation
......
2009-08-24 Hironori Bono <hbono@chromium.org>
Reviewed by Adam Barth.
Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
<https://bugs.webkit.org/show_bug.cgi?id=27827>.
Because of the lack of mappings from GDK key-codes to WebKit key-codes,
Chromium cannot send valid key-codes to JavaScript when a user types
function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.
To write layout tests for this issue, added mappings from function-key
names to platform-specific key-codes to EventSendingController objects
so that eventSender.keyDown() can send function-key events without using
platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
is only for Mac. So this change adds this new test to Skipped tests for other
platforms to prevent this change from crashing the build trees.)
Test: fast/events/keydown-function-keys.html
* platform/chromium/KeyCodeConversionGtk.cpp: Add mappings from GDK key-codes
to WebKit key-code for function keys.
(WebCore::windowsKeyCodeForKeyEvent):
2009-08-24 Antti Koivisto <antti@apple.com>
Reviewed by Simon Fraser.
......@@ -357,6 +357,31 @@ int windowsKeyCodeForKeyEvent(unsigned keycode)
// VKEY_NONAME (FC) Reserved for future use
// VKEY_PA1 (FD) PA1 key
// VKEY_OEM_CLEAR (FE) Clear key
case GDK_F1:
case GDK_F2:
case GDK_F3:
case GDK_F4:
case GDK_F5:
case GDK_F6:
case GDK_F7:
case GDK_F8:
case GDK_F9:
case GDK_F10:
case GDK_F11:
case GDK_F12:
case GDK_F13:
case GDK_F14:
case GDK_F15:
case GDK_F16:
case GDK_F17:
case GDK_F18:
case GDK_F19:
case GDK_F20:
case GDK_F21:
case GDK_F22:
case GDK_F23:
case GDK_F24:
return VKEY_F1 + (keycode - GDK_F1);
default:
return 0;
}
......
2009-08-24 Hironori Bono <hbono@chromium.org>
Reviewed by Adam Barth.
Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
<https://bugs.webkit.org/show_bug.cgi?id=27827>.
Because of the lack of mappings from GDK key-codes to WebKit key-codes,
Chromium cannot send valid key-codes to JavaScript when a user types
function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.
To write layout tests for this issue, added mappings from function-key
names to platform-specific key-codes to EventSendingController objects
so that eventSender.keyDown() can send function-key events without using
platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
is only for Mac. So this change adds this new test to Skipped tests for other
platforms to prevent this change from crashing the build trees.)
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:]):
2009-08-23 Jan Michael Alonzo <jmalonzo@webkit.org>
Reviewed by Xan Lopez.
......
......@@ -506,6 +506,15 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
eventCharacter = [NSString stringWithCharacters:&ch length:1];
}
// Compare the input string with the function-key names defined by the DOM spec (i.e. "F1",...,"F24").
// If the input string is a function-key name, set its key code.
for (unsigned i = 1; i <= 24; i++) {
if ([character isEqualToString:[NSString stringWithFormat:@"F%u", i]]) {
const unichar ch = NSF1FunctionKey + (i - 1);
eventCharacter = [NSString stringWithCharacters:&ch length:1];
}
}
NSString *charactersIgnoringModifiers = eventCharacter;
int modifierFlags = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment