[Webkit-unassigned] [Bug 20027] New: Keyup/keydown keyIdentifier assignments are not W3C compliant

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 13 07:12:53 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=20027

           Summary: Keyup/keydown keyIdentifier assignments are not W3C
                    compliant
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jacobsallanster at gmail.com


Safari, on Windows XP, attached an attribute named keyIdentifier to Event
objects.  The intent was clearly an attempt to implement part of the behavior
of the textInput event type as described in the W3C DOM Level 3 Event
specification.  The intent was good but the execution is not in compliance with
the specification.

On all layouts, Safari is simply prepending "U+" to the value of the keyCode in
hex.  This works for simple ASCII characters but is not correct for thousands
of other keys.  The consequences for web development are severe for keys on the
extreme right of the keyboard (so-called OEM keys) that are often associated
with punctuation characters.  It also makes coding much less natural for
languages other than English.

This bug report addresses the hard part of the problem:  what to do with keys
that are used for letters and digits.  Control characters (like arrow keys or
the Ctrl key) are not addressed.

The keyIdentifier should be a function of both layout and keycode.  The
keyIdentifier should not simply be the keycode converted into hex.  The W3C
specification says that the assignment should reflect the Unicode values of the
characters produced by the key.

The algorithm used here:


1. Use a numeric value if it is available in normal, shift, or AltGr state.

2. If 1 does not apply and if the key has an upper/lower case assignment that
is state dependent, use the Unicode for an upper case character.

3. If neither 1 nor 2 applies, use the Unicode for the normal state key
assignment.

4. If 1, 2, and 3 do not apply, use the Unicode for the shift state key
assignment.

5. If 1, 2, 3, and 4 do not apply, use the Unicode for the AltGr state key
assignment.

Shift state is obtained by depressing the Shift key and then the key in
question.  The less familiar AltGr state obtains when epressing the right Alt
key and then the key in question.  The Shift+AltGr state obtains when the Shift
and right Alt keys are depressed when the key in question is keyed down. 
Normal state obtains when a key is depressed and neither the Shift nor the Alt
keys are depressed.  There is one more state that obtains for the Hebrew layout
that is not relevant to this bug.

The algorithm sketched above can be used to construct a new mapping for each of
the Windows keyboard layouts.  The table does not fit in a Bugzilla description
field.  The mapping starts out as follows:

mysql> select distinct layout,keycode,upper(w3cIdentifier) from keymap where
os='Win' and browser='IE' order by layout,keycode;
+---------------------------------------+---------+----------------------+
| layout                                | keycode | upper(w3cIdentifier) |
+---------------------------------------+---------+----------------------+
| Albanian                              |      48 | U+0030               | 
| Albanian                              |      49 | U+0031               | 
| Albanian                              |      50 | U+0032               | 
| Albanian                              |      51 | U+0033               | 
| Albanian                              |      52 | U+0034               | 
| Albanian                              |      53 | U+0035               | 
| Albanian                              |      54 | U+0036               | 
| Albanian                              |      55 | U+0037               | 
| Albanian                              |      56 | U+0038               | 
| Albanian                              |      57 | U+0039               | 
| Albanian                              |      65 | U+0041               | 
| Albanian                              |      66 | U+0042               | 
| Albanian                              |      67 | U+0043               | 
| Albanian                              |      68 | U+0044               | 
| Albanian                              |      69 | U+0045               | 
| Albanian                              |      70 | U+0046               | 
| Albanian                              |      71 | U+0047               | 
| Albanian                              |      72 | U+0048               | 
| Albanian                              |      73 | U+0049               | 
| Albanian                              |      74 | U+004A               | 
| Albanian                              |      75 | U+004B               | 
| Albanian                              |      76 | U+004C               | 
| Albanian                              |      77 | U+004D               | 
| Albanian                              |      78 | U+004E               | 
| Albanian                              |      79 | U+004F               | 
| Albanian                              |      80 | U+0050               | 
| Albanian                              |      81 | U+0051               | 
| Albanian                              |      82 | U+0052               | 
| Albanian                              |      83 | U+0053               | 
| Albanian                              |      84 | U+0054               | 
| Albanian                              |      85 | U+0055               | 
| Albanian                              |      86 | U+0056               | 
| Albanian                              |      87 | U+0057               | 
| Albanian                              |      88 | U+0058               | 
| Albanian                              |      89 | U+0059               | 
| Albanian                              |      90 | U+005A               | 
| Albanian                              |     186 | U+00CB               | 
| Albanian                              |     187 | U+003D               | 
| Albanian                              |     188 | U+002C               | 
| Albanian                              |     189 | U+002D               | 
| Albanian                              |     190 | U+002E               | 
| Albanian                              |     191 | U+002F               | 
| Albanian                              |     192 | U+005C               | 
| Albanian                              |     219 | U+00C7               | 
| Albanian                              |     220 | U+005D               | 
| Albanian                              |     221 | U+0040               | 
| Albanian                              |     222 | U+005B               | 
| Albanian                              |     226 | U+003C               | 
| Arabic (101)                          |      48 | U+0030               | 
| Arabic (101)                          |      49 | U+0031               | 
| Arabic (101)                          |      50 | U+0032               | 
| Arabic (101)                          |      51 | U+0033               | 
| Arabic (101)                          |      52 | U+0034               | 
| Arabic (101)                          |      53 | U+0035               | 
| Arabic (101)                          |      54 | U+0036               | 
| Arabic (101)                          |      55 | U+0037               | 
| Arabic (101)                          |      56 | U+0038               | 
| Arabic (101)                          |      57 | U+0039               | 
| Arabic (101)                          |      65 | U+0634               | 
| Arabic (101)                          |      66 | U+0644               | 
| Arabic (101)                          |      67 | U+0624               | 
| Arabic (101)                          |      68 | U+064A               | 
| Arabic (101)                          |      69 | U+062B               | 
| Arabic (101)                          |      70 | U+0628               | 
| Arabic (101)                          |      71 | U+0644               | 
| Arabic (101)                          |      72 | U+0627               | 
| Arabic (101)                          |      73 | U+0647               | 
| Arabic (101)                          |      74 | U+062A               | 
| Arabic (101)                          |      75 | U+0646               | 
| Arabic (101)                          |      76 | U+0645               | 
| Arabic (101)                          |      77 | U+0649               | 
| Arabic (101)                          |      78 | U+0627               | 
| Arabic (101)                          |      79 | U+062E               | 
| Arabic (101)                          |      80 | U+062D               | 
| Arabic (101)                          |      81 | U+0636               | 
| Arabic (101)                          |      82 | U+0642               | 
| Arabic (101)                          |      83 | U+0633               | 
| Arabic (101)                          |      84 | U+0641               | 
| Arabic (101)                          |      85 | U+0639               | 
| Arabic (101)                          |      86 | U+0631               | 
| Arabic (101)                          |      87 | U+0635               | 
| Arabic (101)                          |      88 | U+0621               | 
| Arabic (101)                          |      89 | U+063A               | 
| Arabic (101)                          |      90 | U+0626               | 
| Arabic (101)                          |     186 | U+0643               | 
| Arabic (101)                          |     187 | U+003D               | 
| Arabic (101)                          |     188 | U+0629               | 
| Arabic (101)                          |     189 | U+002D               | 
| Arabic (101)                          |     190 | U+0648               | 
| Arabic (101)                          |     191 | U+0632               | 
| Arabic (101)                          |     192 | U+0630               | 
| Arabic (101)                          |     219 | U+062C               | 
| Arabic (101)                          |     220 | U+005C               | 
| Arabic (101)                          |     221 | U+062F               | 
| Arabic (101)                          |     222 | U+0637               |


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list