Created attachment 54511 [details] a test case (Copied from <http://crbug.com/42627>.) What steps will reproduce the problem? 1. Open the attached HTML file with Safari Windows (or Chrome Windows), and; 2. Press an altgraph (or right-alt) key. Result: The keydown event sets e.altGraphKey=false. Expected Result: e.altGraphKey=true. Is it possible to add a member function 'PlatformKeyboardEvent::altGraphKey()' so the KeyboardEvent class can set its m_altGraphKey value from a PlatformKeyboardEvent object? Regards, Hironori Bono
Created attachment 54542 [details] A proposed fix Greetings, I wrote a quick fix for this issue. Is it possible to review it and give me comments? Regards, Hironori Bono
Did you test that this works as expected in IE? AltGr is weird, see bug 34002 for an unexpected behavior we saw before.
(In reply to comment #2) > Did you test that this works as expected in IE? AltGr is weird, see bug 34002 > for an unexpected behavior we saw before. Thank you for your comment. I'm afraid it is a little hard to say my change works "as expected in IE" because IE doesn't have this altGraphKey property of WebKit. IE uses altLeft property to distinguish a left-alt key and an alt-graph (right alt) key. That is, this altLeft property becomes false when we type an alt-graph (or right alt) key and becomes true whey we type a left alt key, respectively. Even though I don't have any idea why WebKit added this altGraphKey property, my change makes altGraphKey true if altLeft is false and makes altGraphKey false if altLeft is true for compatibility with IE. (*1) <http://msdn.microsoft.com/en-us/library/ms533076(VS.85).aspx> As for Bug 34002, yes. an alt-graph key causes weird behaviors on Windows. So, it may be a good idea to provide a way that notifies such weird behaviors are caused by an alt-graph key. Obviously, there are some other options for this purpose: e.g. setting DOM_KEY_LOCATION_RIGHT, adding the altLeft property of IE, etc. So, it is definitely helpful to give me your thoughts about which is the best option. Regards, Hironori Bono
This property was added in <http://trac.webkit.org/changeset/5402>, because it was present in DOM 3 Events spec at the time. It's no longer in the spec. But my understanding is that AltGr is not the same as right Alt - event.altGraphKey should be false if one presses the right Alt key on a U.S. keyboard layout, but it should be true if the same physical key is pressed on a Polish keyboard layout. I'm not 100% sure about that, and I don't know how we can tell the difference.
(In reply to comment #4) > This property was added in <http://trac.webkit.org/changeset/5402>, because it > was present in DOM 3 Events spec at the time. It's no longer in the spec. > > But my understanding is that AltGr is not the same as right Alt - > event.altGraphKey should be false if one presses the right Alt key on a U.S. > keyboard layout, but it should be true if the same physical key is pressed on a > Polish keyboard layout. I'm not 100% sure about that, and I don't know how we > can tell the difference. Thank you for your comment. To read the issue list of W3C (*1), it seems W3C people dropped this altGraphKey attribute because they encourage to use the keyLocation property to distinguish a left key and a right key. I would like to cancel this review request and write another change that adds DOM_LOCATION_RIGHT to the keyLocation attribute as written in the latest DOM spec. (I don't stick to this change at all because I just would like to provide a method to distinguish a left key and a right key.) (*1) <http://www.w3.org/2002/07/DOM-Level-3-Events-issues/issues.html#duerst19> Sorry for bothering you with this change. Regards, Hironori Bono