[Qt][WK2] REGRESSION(100483): It made 2 API tests fail
authoralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Nov 2011 21:45:30 +0000 (21:45 +0000)
committeralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Nov 2011 21:45:30 +0000 (21:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72612

Reviewed by Kenneth Rohde Christiansen.

Make sure that when the view is focused, the page knows about it.
Also set a the view to be the focused item in the failing tests.

* UIProcess/API/qt/qquickwebpage_p.h:
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebView::focusInEvent):
(QQuickWebView::focusOutEvent):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_linkHovered.qml:
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::isViewFocused):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100955 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_linkHovered.qml
Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp

index 2333c6c..8e98aa7 100644 (file)
@@ -1,3 +1,22 @@
+2011-11-21  Alexis Menard  <alexis.menard@openbossa.org>
+
+        [Qt][WK2] REGRESSION(100483): It made 2 API tests fail
+        https://bugs.webkit.org/show_bug.cgi?id=72612
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make sure that when the view is focused, the page knows about it.
+        Also set a the view to be the focused item in the failing tests.
+
+        * UIProcess/API/qt/qquickwebpage_p.h:
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebView::focusInEvent):
+        (QQuickWebView::focusOutEvent):
+        * UIProcess/API/qt/qquickwebview_p.h:
+        * UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_linkHovered.qml:
+        * UIProcess/qt/QtWebPageProxy.cpp:
+        (QtWebPageProxy::isViewFocused):
+
 2011-11-21  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] Speed up debug builds.
index 57a05a8..40dea17 100644 (file)
@@ -72,6 +72,7 @@ private:
     Q_PRIVATE_SLOT(d, void _q_onSceneGraphInitialized());
 
     QQuickWebPagePrivate* d;
+    friend class QQuickWebView;
     friend class QQuickWebViewPrivate;
     friend class QtWebPageProxy;
 };
index 1a486ac..f146c2b 100644 (file)
@@ -603,6 +603,18 @@ void QQuickWebView::geometryChanged(const QRectF& newGeometry, const QRectF& old
     }
 }
 
+void QQuickWebView::focusInEvent(QFocusEvent* event)
+{
+    Q_D(QQuickWebView);
+    d->pageView->event(event);
+}
+
+void QQuickWebView::focusOutEvent(QFocusEvent* event)
+{
+    Q_D(QQuickWebView);
+    d->pageView->event(event);
+}
+
 void QQuickWebView::touchEvent(QTouchEvent* event)
 {
     forceActiveFocus();
index 5eab75a..5c8f236 100644 (file)
@@ -115,6 +115,8 @@ Q_SIGNALS:
 
 protected:
     virtual void geometryChanged(const QRectF&, const QRectF&);
+    virtual void focusInEvent(QFocusEvent*);
+    virtual void focusOutEvent(QFocusEvent*);
     virtual void touchEvent(QTouchEvent* event);
 
 private:
index 99672bf..ea38ac8 100644 (file)
@@ -7,6 +7,7 @@ DesktopWebView {
     id: webView
     width: 200
     height: 400
+    focus: true
 
     property string lastUrl
     property string lastTitle
index 537b5a6..63de4e2 100644 (file)
@@ -493,7 +493,7 @@ bool QtWebPageProxy::isViewWindowActive()
 
 bool QtWebPageProxy::isViewFocused()
 {
-    return m_qmlWebPage->hasFocus();
+    return m_qmlWebView->hasFocus();
 }
 
 bool QtWebPageProxy::isViewVisible()