Skip to content
  • ch.dumez@sisa.samsung.com's avatar
    Add support for KeyboardEvent.location attribute · b3d683ac
    ch.dumez@sisa.samsung.com authored
    https://bugs.webkit.org/show_bug.cgi?id=119326
    
    Reviewed by Benjamin Poulain.
    
    Source/WebCore:
    
    Add support for KeyboardEvent.location attribute as per the latest specification:
    http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-KeyboardEvent
    
    IE10, Firefox 22 and recently Blink all support KeyboardEvent.location already.
    
    The deprecated 'keyLocation' attribute was not removed to maintain backward
    compatibility.
    
    No new tests, covered by existing tests.
    
    * bindings/objc/PublicDOMInterfaces.h:
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateConstructorDefinition):
    * dom/KeyboardEvent.cpp:
    (WebCore::KeyboardEventInit::KeyboardEventInit):
    (WebCore::KeyboardEvent::KeyboardEvent):
    (WebCore::KeyboardEvent::initKeyboardEvent):
    * dom/KeyboardEvent.h:
    (WebCore::KeyboardEvent::location):
    * dom/KeyboardEvent.idl:
    
    Source/WebKit/win:
    
    Add new location attribute to DOMKeyboardEvent.
    
    * DOMEventsClasses.cpp:
    (DOMKeyboardEvent::location):
    * DOMEventsClasses.h:
    * Interfaces/DOMEvents.idl:
    
    Tools:
    
    Rename the deprecated 'keyLocation' to 'location' in Mac's DRT code.
    
    * DumpRenderTree/mac/EventSendingController.mm:
    (-[EventSendingController keyDown:withModifiers:withLocation:]):
    (-[EventSendingController keyDownWrapper:withModifiers:withLocation:]):
    (-[EventSendingController scheduleAsynchronousKeyDown:withModifiers:withLocation:]):
    (-[EventSendingController handleEvent:]):
    (-[EventSendingController fireKeyboardEventsToElement:]):
    
    LayoutTests:
    
    Rename KeyboardEvent.keyLocation to KeyboardEvent.location in the
    tests and add test cases to make sure that the deprecated
    KeyboardEvent.keyLocation still works.
    
    * fast/events/arrow-keys-on-body-expected.txt:
    * fast/events/arrow-keys-on-body.html:
    * fast/events/constructors/keyboard-event-constructor-expected.txt:
    * fast/events/constructors/keyboard-event-constructor.html:
    * fast/events/init-events-expected.txt:
    * fast/events/js-keyboard-event-creation.html:
    * fast/events/keydown-leftright-keys-expected.txt:
    * fast/events/keydown-leftright-keys.html:
    * fast/events/keydown-numpad-keys-expected.txt:
    * fast/events/script-tests/init-events.js:
    * fast/events/script-tests/keydown-numpad-keys.js:
    (recordKeyEvent):
    (testKeyEventWithLocation):
    * platform/mac/fast/events/objc-keyboard-event-creation.html:
    * platform/win/fast/events/keyLocation-numpad.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b3d683ac