diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/dom/KeyboardEvent.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/dom/KeyboardEvent.cpp')
-rw-r--r-- | Source/WebCore/dom/KeyboardEvent.cpp | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/Source/WebCore/dom/KeyboardEvent.cpp b/Source/WebCore/dom/KeyboardEvent.cpp index 1c6119f5b..be506a78a 100644 --- a/Source/WebCore/dom/KeyboardEvent.cpp +++ b/Source/WebCore/dom/KeyboardEvent.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2001 Peter Kelly (pmk@post.com) * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2005, 2006, 2007, 2013 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -92,29 +92,36 @@ static inline KeyboardEvent::KeyLocationCode keyLocationCode(const PlatformKeybo } } +KeyboardEventInit::KeyboardEventInit() + : location(0) + , ctrlKey(false) + , altKey(false) + , shiftKey(false) + , metaKey(false) +{ +} + KeyboardEvent::KeyboardEvent() - : m_keyLocation(DOM_KEY_LOCATION_STANDARD) + : m_location(DOM_KEY_LOCATION_STANDARD) , m_altGraphKey(false) { } KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view) : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), - true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey()) + true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey()) , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) , m_keyIdentifier(key.keyIdentifier()) - , m_keyLocation(keyLocationCode(key)) + , m_location(keyLocationCode(key)) , m_altGraphKey(false) { } -KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view, - const String &keyIdentifier, unsigned keyLocation, - bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) - : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, altKey, shiftKey, metaKey) - , m_keyIdentifier(keyIdentifier) - , m_keyLocation(keyLocation) - , m_altGraphKey(altGraphKey) +KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventInit& initializer) + : UIEventWithKeyState(eventType, initializer.bubbles, initializer.cancelable, initializer.view, initializer.detail, initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializer.metaKey) + , m_keyIdentifier(initializer.keyIdentifier) + , m_location(initializer.location) + , m_altGraphKey(false) { } @@ -123,7 +130,7 @@ KeyboardEvent::~KeyboardEvent() } void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, - const String &keyIdentifier, unsigned keyLocation, + const String &keyIdentifier, unsigned location, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) { if (dispatched()) @@ -132,7 +139,7 @@ void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, initUIEvent(type, canBubble, cancelable, view, 0); m_keyIdentifier = keyIdentifier; - m_keyLocation = keyLocation; + m_location = location; m_ctrlKey = ctrlKey; m_shiftKey = shiftKey; m_altKey = altKey; |