From 4d6084feccab99c0a7b3ecef26bb49c41dd50201 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 18 Jul 2012 13:59:13 +0200 Subject: Imported WebKit commit ff52235a78888e5cb8e286a828a8698042200e67 (http://svn.webkit.org/repository/webkit/trunk@122948) New snapshot that should fix the rendering issues recently introduced --- Source/WebKit/qt/Api/qwebview.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Source/WebKit/qt/Api/qwebview.cpp') diff --git a/Source/WebKit/qt/Api/qwebview.cpp b/Source/WebKit/qt/Api/qwebview.cpp index 296661aa4..a6082cf63 100644 --- a/Source/WebKit/qt/Api/qwebview.cpp +++ b/Source/WebKit/qt/Api/qwebview.cpp @@ -33,6 +33,11 @@ #include "qprinter.h" #include "qdir.h" #include "qfile.h" +#ifndef QT_NO_ACCESSIBILITY +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#include "qwebviewaccessible_p.h" +#endif +#endif class QWebViewPrivate { public: @@ -148,6 +153,23 @@ void QWebViewPrivate::_q_pageDestroyed() {Google Chat Example}, {Fancy Browser Example} */ +#ifndef QT_NO_ACCESSIBILITY +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +static QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObject* object) +{ + Q_UNUSED(key) + + if (QWebPage* page = qobject_cast(object)) + return new QWebPageAccessible(page); + if (QWebView* view = qobject_cast(object)) + return new QWebViewAccessible(view); + if (QWebFrame* frame = qobject_cast(object)) + return new QWebFrameAccessible(frame); + return 0; +} +#endif +#endif + /*! Constructs an empty QWebView with parent \a parent. @@ -167,6 +189,12 @@ QWebView::QWebView(QWidget *parent) setMouseTracking(true); setFocusPolicy(Qt::WheelFocus); + +#ifndef QT_NO_ACCESSIBILITY +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + QAccessible::installFactory(accessibleInterfaceFactory); +#endif +#endif } /*! -- cgit v1.2.1