meta-opendreambox: drop gstreamer 0.10
[opendreambox.git] / meta-opendreambox / recipes-qt / qt4 / qt4 / 0004-QtWebkit-Expose-keypress-event-and-correct-keycode-f.patch
1 From 8c3bd3154ef1622e5bc03dc421f77af0ecae247f Mon Sep 17 00:00:00 2001
2 From: Stephan Reichholf <reichi@opendreambox.org>
3 Date: Wed, 21 Nov 2012 15:16:50 +0100
4 Subject: [PATCH 4/7] QtWebkit: Expose "keypress" event and correct keycode for
5  all key-presses (HbbTV Specifaction requirement)
6
7 ---
8  src/3rdparty/webkit/Source/WebCore/dom/KeyboardEvent.cpp             | 2 ++
9  src/3rdparty/webkit/Source/WebCore/page/EventHandler.cpp             | 5 +----
10  .../webkit/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp    | 3 ---
11  3 files changed, 3 insertions(+), 7 deletions(-)
12
13 diff --git a/src/3rdparty/webkit/Source/WebCore/dom/KeyboardEvent.cpp b/src/3rdparty/webkit/Source/WebCore/dom/KeyboardEvent.cpp
14 index b6ab1b6..22e1156 100644
15 --- a/src/3rdparty/webkit/Source/WebCore/dom/KeyboardEvent.cpp
16 +++ b/src/3rdparty/webkit/Source/WebCore/dom/KeyboardEvent.cpp
17 @@ -136,6 +136,8 @@ int KeyboardEvent::charCode() const
18      if (!m_keyEvent || (type() != eventNames().keypressEvent && !backwardCompatibilityMode))
19          return 0;
20      String text = m_keyEvent->text();
21 +    if(text.isEmpty())
22 +       return m_keyEvent->windowsVirtualKeyCode();
23      return static_cast<int>(text.characterStartingAt(0));
24  }
25  
26 diff --git a/src/3rdparty/webkit/Source/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/Source/WebCore/page/EventHandler.cpp
27 index e26607a..4627226 100644
28 --- a/src/3rdparty/webkit/Source/WebCore/page/EventHandler.cpp
29 +++ b/src/3rdparty/webkit/Source/WebCore/page/EventHandler.cpp
30 @@ -2464,7 +2464,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
31          matchedAnAccessKey = handleAccessKey(initialKeyEvent);
32  
33      // FIXME: it would be fair to let an input method handle KeyUp events before DOM dispatch.
34 -    if (initialKeyEvent.type() == PlatformKeyboardEvent::KeyUp || initialKeyEvent.type() == PlatformKeyboardEvent::Char)
35 +    if (initialKeyEvent.type() == PlatformKeyboardEvent::KeyUp)
36          return !node->dispatchKeyEvent(initialKeyEvent);
37  
38      bool backwardCompatibilityMode = needsKeyboardEventDisambiguationQuirks();
39 @@ -2518,8 +2518,6 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
40  
41      PlatformKeyboardEvent keyPressEvent = initialKeyEvent;
42      keyPressEvent.disambiguateKeyDownEvent(PlatformKeyboardEvent::Char, backwardCompatibilityMode);
43 -    if (keyPressEvent.text().isEmpty())
44 -        return keydownResult;
45      RefPtr<KeyboardEvent> keypress = KeyboardEvent::create(keyPressEvent, m_frame->document()->defaultView());
46      keypress->setTarget(node);
47      if (keydownResult)
48 @@ -2528,7 +2526,6 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
49      keypress->keypressCommands() = keydown->keypressCommands();
50  #endif
51      node->dispatchEvent(keypress, ec);
52 -
53      return keydownResult || keypress->defaultPrevented() || keypress->defaultHandled();
54  }
55  
56 diff --git a/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
57 index 15b9a4a..9c3551a 100644
58 --- a/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
59 +++ b/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
60 @@ -629,9 +629,6 @@ void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
61          */
62          if (m_text.isEmpty() && m_windowsVirtualKeyCode && isVirtualKeyCodeRepresentingCharacter(m_windowsVirtualKeyCode))
63              m_text.append(UChar(m_windowsVirtualKeyCode));
64 -
65 -        m_keyIdentifier = String();
66 -        m_windowsVirtualKeyCode = 0;
67      }
68  }
69  
70 -- 
71 1.9.1
72