[oe] [meta-qt5][PATCHv2] fix build of qtwebengine if qtbase has no accessibility

Martin Jansa martin.jansa at gmail.com
Wed Mar 4 02:25:46 UTC 2015


On Tue, Mar 03, 2015 at 08:40:09PM +0100, Martin Jansa wrote:
> From: Stephan Binner <stephan.binner at basyskom.com>
> 
> Signed-off-by: Stephan Binner <stephan.binner at basyskom.com>
> Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> ---
>  recipes-qt/qt5/qtbase.inc                          |   2 +-
>  ...ding-Qt-WebEngine-without-accessiblity-en.patch | 533 +++++++++++++++++++++
>  ...ding-Qt-WebEngine-without-accessiblity-en.patch | 533 +++++++++++++++++++++
>  recipes-qt/qt5/qtwebengine_5.4.1.bb                |   1 +
>  recipes-qt/qt5/qtwebengine_git.bb                  |   1 +
>  5 files changed, 1069 insertions(+), 1 deletion(-)
>  create mode 100644 recipes-qt/qt5/qtwebengine-git/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch
>  create mode 100644 recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch
> 
> diff --git a/recipes-qt/qt5/qtbase.inc b/recipes-qt/qt5/qtbase.inc
> index c6fe358..d7c027f 100644
> --- a/recipes-qt/qt5/qtbase.inc
> +++ b/recipes-qt/qt5/qtbase.inc
> @@ -64,7 +64,7 @@ PACKAGECONFIG[examples] = "-make examples -compile-examples,-nomake examples"
>  PACKAGECONFIG[tools] = "-make tools,-nomake tools"
>  # only for completeness, configure will add libs even if you try to explicitly remove it
>  PACKAGECONFIG[libs] = "-make libs,-nomake libs"
> -# accessibility is required to compile qtquickcontrols and qtwebengine
> +# accessibility is required to compile qtquickcontrols
>  PACKAGECONFIG[accessibility] = "-accessibility,-no-accessibility"
>  PACKAGECONFIG[glib] = "-glib,-no-glib,glib-2.0"
>  # use either system freetype or bundled freetype, if you disable freetype completely
> diff --git a/recipes-qt/qt5/qtwebengine-git/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch b/recipes-qt/qt5/qtwebengine-git/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch
> new file mode 100644
> index 0000000..8a4c216
> --- /dev/null
> +++ b/recipes-qt/qt5/qtwebengine-git/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch
> @@ -0,0 +1,533 @@
> +From 8328f6941685d8a525629b9c0717dbab321fc09e Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning at theqtcompany.com>
> +Date: Tue, 20 Jan 2015 16:20:42 +0100
> +Subject: [PATCH 4/4] Enable building Qt WebEngine without accessiblity
> + enabled.
> +
> +This adds guards that for QT_NO_ACCESSIBILITY being not defined
> +around the code that uses accessibility types.
> +
> +It disables the quicknanobrowser and quicktestbrowser examples
> +which need Qt QuickControls, which has a hard dependency to
> +accessibility being enabled.
> +
> +Task-number: QTBUG-43305
> +Change-Id: Ifa39e3ce447ebc2124f52e00b29b1d7d2231035e
> +Reviewed-by: Andras Becsi <andras.becsi at theqtcompany.com>
> +
> +Upstream-Status: Backport from 5.5
> +https://codereview.qt-project.org/#/c/104207/
> +---
> + examples/webengine/quicknanobrowser/quicknanobrowser.pro |  2 ++
> + src/core/browser_accessibility_manager_qt.cpp            |  6 ++++++
> + src/core/browser_accessibility_manager_qt.h              |  2 ++
> + src/core/browser_accessibility_qt.cpp                    |  4 ++++
> + src/core/browser_accessibility_qt.h                      |  3 +++
> + src/core/render_widget_host_view_qt.cpp                  | 13 ++++++++++++-
> + src/core/render_widget_host_view_qt.h                    |  6 +++++-
> + src/core/web_contents_adapter.cpp                        |  2 ++
> + src/core/web_contents_adapter_client.h                   |  2 ++
> + src/webengine/api/qquickwebengineview.cpp                | 12 ++++++++++++
> + src/webengine/api/qquickwebengineview_p.h                |  2 ++
> + src/webengine/api/qquickwebengineview_p_p.h              |  5 ++++-
> + src/webenginewidgets/api/qwebenginepage.cpp              |  3 +++
> + src/webenginewidgets/api/qwebenginepage.h                |  2 ++
> + src/webenginewidgets/api/qwebenginepage_p.h              |  2 ++
> + src/webenginewidgets/api/qwebengineview.cpp              |  7 ++++++-
> + src/webenginewidgets/api/qwebengineview_p.h              |  3 ++-
> + tests/quicktestbrowser/quicktestbrowser.pro              |  2 ++
> + 18 files changed, 73 insertions(+), 5 deletions(-)
> +
> +diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
> +index 3628b81..a8e57b0 100644
> +--- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro
> ++++ b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
> +@@ -1,3 +1,5 @@
> ++requires(contains(QT_CONFIG, accessibility))
> ++
> + TEMPLATE = app
> + TARGET = quicknanobrowser
> + 
> +diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
> +index 28d0dd7..6729866 100644
> +--- a/src/core/browser_accessibility_manager_qt.cpp
> ++++ b/src/core/browser_accessibility_manager_qt.cpp
> +@@ -45,9 +45,14 @@ namespace content {
> + 
> + BrowserAccessibility *BrowserAccessibilityFactoryQt::Create()
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     return new BrowserAccessibilityQt();
> ++#else
> ++    return 0;
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
> +     QObject* parentObject,
> +     const ui::AXTreeUpdate& initialTree,
> +@@ -131,5 +136,6 @@ void BrowserAccessibilityManagerQt::NotifyAccessibilityEvent(ui::AXEvent event_t
> +         break;
> +     }
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + }
> +diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
> +index 5d8498d..49b3af3 100644
> +--- a/src/core/browser_accessibility_manager_qt.h
> ++++ b/src/core/browser_accessibility_manager_qt.h
> +@@ -38,6 +38,7 @@
> + #define BROWSER_ACCESSIBILITY_MANAGER_QT_H
> + 
> + #include "content/browser/accessibility/browser_accessibility_manager.h"
> ++#ifndef QT_NO_ACCESSIBILITY
> + #include <QtCore/qobject.h>
> + 
> + QT_BEGIN_NAMESPACE
> +@@ -74,4 +75,5 @@ private:
> + 
> + }
> + 
> ++#endif // QT_NO_ACCESSIBILITY
> + #endif
> +diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
> +index b5cd26f..4b8e97a 100644
> +--- a/src/core/browser_accessibility_qt.cpp
> ++++ b/src/core/browser_accessibility_qt.cpp
> +@@ -40,6 +40,8 @@
> + 
> + #include "browser_accessibility_qt.h"
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> ++
> + #include "third_party/WebKit/public/web/WebAXEnums.h"
> + #include "ui/accessibility/ax_node_data.h"
> + 
> +@@ -898,3 +900,5 @@ void BrowserAccessibilityQt::modelChange(QAccessibleTableModelChangeEvent *)
> + }
> + 
> + } // namespace content
> ++
> ++#endif // QT_NO_ACCESSIBILITY
> +diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
> +index db190ff..e87b5d8 100644
> +--- a/src/core/browser_accessibility_qt.h
> ++++ b/src/core/browser_accessibility_qt.h
> +@@ -38,6 +38,8 @@
> + #define BROWSER_ACCESSIBILITY_QT_H
> + 
> + #include <QtGui/qaccessible.h>
> ++
> ++#ifndef QT_NO_ACCESSIBILITY
> + #include "content/browser/accessibility/browser_accessibility.h"
> + 
> + namespace content {
> +@@ -145,4 +147,5 @@ public:
> + 
> + }
> + 
> ++#endif // QT_NO_ACCESSIBILITY
> + #endif
> +diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
> +index c221e94..349028e 100644
> +--- a/src/core/render_widget_host_view_qt.cpp
> ++++ b/src/core/render_widget_host_view_qt.cpp
> +@@ -198,15 +198,18 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget
> +     , m_initPending(false)
> + {
> +     m_host->SetView(this);
> +-
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::installActivationObserver(this);
> +     if (QAccessible::isActive())
> +         content::BrowserAccessibilityStateImpl::GetInstance()->EnableAccessibility();
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + RenderWidgetHostViewQt::~RenderWidgetHostViewQt()
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::removeActivationObserver(this);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + void RenderWidgetHostViewQt::setDelegate(RenderWidgetHostViewQtDelegate* delegate)
> +@@ -296,6 +299,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewQt::GetNativeViewAccessible()
> + 
> + void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded()
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     if (GetBrowserAccessibilityManager())
> +         return;
> + 
> +@@ -303,6 +307,9 @@ void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded()
> +         m_adapterClient->accessibilityParentObject(),
> +         content::BrowserAccessibilityManagerQt::GetEmptyDocument(),
> +         this));
> ++else
> ++    return 0;
> ++#endif // QT_NO_ACCESSIBILITY

This doesn't look right and also fails to build.

| ../../../src/core/render_widget_host_view_qt.cpp: In member function 'virtual void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded()':
| ../../../src/core/render_widget_host_view_qt.cpp:310:1: error: 'else' without a previous 'if'
|  else
|  ^
| ../../../src/core/render_widget_host_view_qt.cpp:311:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
|      return 0;
|             ^

> + }
> + 
> + // Set focus to the associated View component.
> +@@ -953,6 +960,7 @@ void RenderWidgetHostViewQt::AccessibilityFatalError()
> +     SetBrowserAccessibilityManager(NULL);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active)
> + {
> +     if (active)
> +@@ -960,6 +968,7 @@ void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active)
> +     else
> +         content::BrowserAccessibilityStateImpl::GetInstance()->DisableAccessibility();
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void RenderWidgetHostViewQt::handleWheelEvent(QWheelEvent *ev)
> + {
> +@@ -1042,6 +1051,7 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev)
> +     }
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible()
> + {
> +     // Assume we have a screen reader doing stuff
> +@@ -1051,6 +1061,7 @@ QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible()
> +     content::BrowserAccessibilityQt *accQt = static_cast<content::BrowserAccessibilityQt*>(acc);
> +     return accQt;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void RenderWidgetHostViewQt::didFirstVisuallyNonEmptyLayout()
> + {
> +diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
> +index d4a3ff2..fac7efd 100644
> +--- a/src/core/render_widget_host_view_qt.h
> ++++ b/src/core/render_widget_host_view_qt.h
> +@@ -50,6 +50,7 @@
> + #include <QRect>
> + #include <QtGlobal>
> + #include <QtGui/qaccessible.h>
> ++#include <QtGui/QTouchEvent>
> + 
> + #include "delegated_frame_node.h"
> + 
> +@@ -59,7 +60,6 @@ class QFocusEvent;
> + class QHoverEvent;
> + class QKeyEvent;
> + class QMouseEvent;
> +-class QTouchEvent;
> + class QVariant;
> + class QWheelEvent;
> + class QAccessibleInterface;
> +@@ -93,7 +93,9 @@ class RenderWidgetHostViewQt
> +     , public RenderWidgetHostViewQtDelegateClient
> +     , public content::BrowserAccessibilityDelegate
> +     , public base::SupportsWeakPtr<RenderWidgetHostViewQt>
> ++#ifndef QT_NO_ACCESSIBILITY
> +     , public QAccessible::ActivationObserver
> ++#endif // QT_NO_ACCESSIBILITY
> + {
> + public:
> +     RenderWidgetHostViewQt(content::RenderWidgetHost* widget);
> +@@ -213,9 +215,11 @@ public:
> +     virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) const Q_DECL_OVERRIDE  { return gfx::Point(); }
> +     virtual void AccessibilityHitTest(const gfx::Point& point) Q_DECL_OVERRIDE  { }
> +     virtual void AccessibilityFatalError() Q_DECL_OVERRIDE;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual void accessibilityActiveChanged(bool active) Q_DECL_OVERRIDE;
> + 
> +     QAccessibleInterface *GetQtAccessible();
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> +     void didFirstVisuallyNonEmptyLayout();
> + 
> +diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
> +index 3f223f7..e41acd0 100644
> +--- a/src/core/web_contents_adapter.cpp
> ++++ b/src/core/web_contents_adapter.cpp
> +@@ -628,12 +628,14 @@ void WebContentsAdapter::enableInspector(bool enable)
> +     ContentBrowserClientQt::Get()->enableInspector(enable);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QAccessibleInterface *WebContentsAdapter::browserAccessible()
> + {
> +     Q_D(const WebContentsAdapter);
> +     RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(d->webContents->GetRenderWidgetHostView());
> +     return rwhv ? rwhv->GetQtAccessible() : Q_NULLPTR;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void WebContentsAdapter::runJavaScript(const QString &javaScript)
> + {
> +diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h
> +index 8fd401f..df18980 100644
> +--- a/src/core/web_contents_adapter_client.h
> ++++ b/src/core/web_contents_adapter_client.h
> +@@ -168,7 +168,9 @@ public:
> +     virtual void passOnFocus(bool reverse) = 0;
> +     // returns the last QObject (QWidget/QQuickItem) based object in the accessibility
> +     // hierarchy before going into the BrowserAccessibility tree
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual QObject *accessibilityParentObject() = 0;
> ++#endif // QT_NO_ACCESSIBILITY
> +     virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) = 0;
> +     virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) = 0;
> +     virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) = 0;
> +diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
> +index 3497c16..a35cfc3 100644
> +--- a/src/webengine/api/qquickwebengineview.cpp
> ++++ b/src/webengine/api/qquickwebengineview.cpp
> +@@ -61,16 +61,20 @@
> + #include <QScreen>
> + #include <QStringBuilder>
> + #include <QUrl>
> ++#ifndef QT_NO_ACCESSIBILITY
> + #include <private/qquickaccessibleattached_p.h>
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QT_BEGIN_NAMESPACE
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
> + {
> +     if (QQuickWebEngineView *v = qobject_cast<QQuickWebEngineView*>(object))
> +         return new QQuickWebEngineViewAccessible(v);
> +     return 0;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
> +     : adapter(new WebContentsAdapter)
> +@@ -102,7 +106,9 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
> +         // 1x, 2x, 3x etc assets that fit an integral number of pixels.
> +         setDevicePixelRatio(qMax(1, qRound(webPixelRatio)));
> +     }
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::installFactory(&webAccessibleFactory);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()
> +@@ -395,11 +401,13 @@ void QQuickWebEngineViewPrivate::runMediaAccessPermissionRequest(const QUrl &sec
> +    Q_EMIT e->featurePermissionRequested(securityOrigin, feature);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
> + {
> +     Q_Q(QQuickWebEngineView);
> +     return q;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const
> + {
> +@@ -414,6 +422,7 @@ void QQuickWebEngineViewPrivate::setDevicePixelRatio(qreal devicePixelRatio)
> +     m_dpiScale = devicePixelRatio / screen->devicePixelRatio();
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o)
> +     : QAccessibleObject(o)
> + {}
> +@@ -460,6 +469,7 @@ QAccessible::State QQuickWebEngineViewAccessible::state() const
> +     QAccessible::State s;
> +     return s;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents)
> + {
> +@@ -497,8 +507,10 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
> +     this->setActiveFocusOnTab(true);
> +     this->setFlag(QQuickItem::ItemIsFocusScope);
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QQuickAccessibleAttached *accessible = QQuickAccessibleAttached::qmlAttachedProperties(this);
> +     accessible->setRole(QAccessible::Grouping);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + QQuickWebEngineView::~QQuickWebEngineView()
> +diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
> +index 22713ee..f3ceb2c 100644
> +--- a/src/webengine/api/qquickwebengineview_p.h
> ++++ b/src/webengine/api/qquickwebengineview_p.h
> +@@ -155,7 +155,9 @@ private:
> +     friend class QQuickWebEngineViewExperimental;
> +     friend class QQuickWebEngineViewExperimentalExtension;
> +     friend class QQuickWebEngineNewViewRequest;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     friend class QQuickWebEngineViewAccessible;
> ++#endif // QT_NO_ACCESSIBILITY
> + };
> + 
> + QT_END_NAMESPACE
> +diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
> +index 6662f1f..3ab95c6 100644
> +--- a/src/webengine/api/qquickwebengineview_p_p.h
> ++++ b/src/webengine/api/qquickwebengineview_p_p.h
> +@@ -175,7 +175,9 @@ public:
> +     virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
> +     virtual void authenticationRequired(const QUrl&, const QString&, bool, const QString&, QString*, QString*) Q_DECL_OVERRIDE { }
> +     virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
> ++#endif // QT_NO_ACCESSIBILITY
> +     virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
> +     virtual void allowCertificateError(const QExplicitlySharedDataPointer<CertificateErrorController> &errorController);
> + 
> +@@ -202,6 +204,7 @@ private:
> +     qreal m_dpiScale;
> + };
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + class QQuickWebEngineViewAccessible : public QAccessibleObject
> + {
> + public:
> +@@ -217,7 +220,7 @@ public:
> + private:
> +     QQuickWebEngineView *engineView() const { return static_cast<QQuickWebEngineView*>(object()); }
> + };
> +-
> ++#endif // QT_NO_ACCESSIBILITY
> + QT_END_NAMESPACE
> + 
> + QML_DECLARE_TYPE(QQuickWebEngineViewExperimental)
> +diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
> +index 72b16f2..068c175 100644
> +--- a/src/webenginewidgets/api/qwebenginepage.cpp
> ++++ b/src/webenginewidgets/api/qwebenginepage.cpp
> +@@ -39,6 +39,7 @@
> + #include <QApplication>
> + #include <QAuthenticator>
> + #include <QClipboard>
> ++#include <QContextMenuEvent>
> + #include <QFileDialog>
> + #include <QIcon>
> + #include <QInputDialog>
> +@@ -342,10 +343,12 @@ void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &security
> +     Q_EMIT q->featurePermissionRequested(securityOrigin, requestedFeature);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QObject *QWebEnginePagePrivate::accessibilityParentObject()
> + {
> +     return view;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const
> + {
> +diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
> +index 7856b82..9fd81b0 100644
> +--- a/src/webenginewidgets/api/qwebenginepage.h
> ++++ b/src/webenginewidgets/api/qwebenginepage.h
> +@@ -258,7 +258,9 @@ private:
> + 
> +     friend class QWebEngineView;
> +     friend class QWebEngineViewPrivate;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     friend class QWebEngineViewAccessible;
> ++#endif // QT_NO_ACCESSIBILITY
> + };
> + 
> + 
> +diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
> +index 5412922..2307e7a 100644
> +--- a/src/webenginewidgets/api/qwebenginepage_p.h
> ++++ b/src/webenginewidgets/api/qwebenginepage_p.h
> +@@ -135,7 +135,9 @@ public:
> +     virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
> +     virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) Q_DECL_OVERRIDE;
> +     virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
> ++#endif // QT_NO_ACCESSIBILITY
> +     virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
> +     virtual void allowCertificateError(const QExplicitlySharedDataPointer<CertificateErrorController> &controller) Q_DECL_OVERRIDE;
> + 
> +diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
> +index 8d21989..63ac405 100644
> +--- a/src/webenginewidgets/api/qwebengineview.cpp
> ++++ b/src/webenginewidgets/api/qwebengineview.cpp
> +@@ -85,19 +85,22 @@ void QWebEngineViewPrivate::bind(QWebEngineView *view, QWebEnginePage *page)
> +     }
> + }
> + 
> +-
> ++#ifndef QT_NO_ACCESSIBILITY
> + static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
> + {
> +     if (QWebEngineView *v = qobject_cast<QWebEngineView*>(object))
> +         return new QWebEngineViewAccessible(v);
> +     return Q_NULLPTR;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QWebEngineViewPrivate::QWebEngineViewPrivate()
> +     : page(0)
> +     , m_pendingContextMenuEvent(false)
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::installFactory(&webAccessibleFactory);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + QWebEngineView::QWebEngineView(QWidget *parent)
> +@@ -274,6 +277,7 @@ void QWebEngineView::contextMenuEvent(QContextMenuEvent *event)
> +     menu->popup(event->globalPos());
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + int QWebEngineViewAccessible::childCount() const
> + {
> +     if (view() && child(0))
> +@@ -294,6 +298,7 @@ int QWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
> +         return 0;
> +     return -1;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QT_END_NAMESPACE
> + 
> +diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
> +index 9db971f..e0cc3f4 100644
> +--- a/src/webenginewidgets/api/qwebengineview_p.h
> ++++ b/src/webenginewidgets/api/qwebengineview_p.h
> +@@ -59,6 +59,7 @@ public:
> +     bool m_pendingContextMenuEvent;
> + };
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + class QWebEngineViewAccessible : public QAccessibleWidget
> + {
> + public:
> +@@ -72,7 +73,7 @@ public:
> + private:
> +     QWebEngineView *view() const { return static_cast<QWebEngineView*>(object()); }
> + };
> +-
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QT_END_NAMESPACE
> + 
> +diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro
> +index ac8fe74..51ea5a2 100644
> +--- a/tests/quicktestbrowser/quicktestbrowser.pro
> ++++ b/tests/quicktestbrowser/quicktestbrowser.pro
> +@@ -1,3 +1,5 @@
> ++requires(contains(QT_CONFIG, accessibility))
> ++
> + TEMPLATE = app
> + TARGET = quicktestbrowser
> + 
> +-- 
> +2.3.1
> +
> diff --git a/recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch b/recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch
> new file mode 100644
> index 0000000..108e7f5
> --- /dev/null
> +++ b/recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch
> @@ -0,0 +1,533 @@
> +From a2b64b1adf5da47248261dbe9621c64afa1d6e2e Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning at theqtcompany.com>
> +Date: Tue, 20 Jan 2015 16:20:42 +0100
> +Subject: [PATCH 4/4] Enable building Qt WebEngine without accessiblity
> + enabled.
> +
> +This adds guards that for QT_NO_ACCESSIBILITY being not defined
> +around the code that uses accessibility types.
> +
> +It disables the quicknanobrowser and quicktestbrowser examples
> +which need Qt QuickControls, which has a hard dependency to
> +accessibility being enabled.
> +
> +Task-number: QTBUG-43305
> +Change-Id: Ifa39e3ce447ebc2124f52e00b29b1d7d2231035e
> +Reviewed-by: Andras Becsi <andras.becsi at theqtcompany.com>
> +
> +Upstream-Status: Backport from 5.5
> +https://codereview.qt-project.org/#/c/104207/
> +---
> + examples/webengine/quicknanobrowser/quicknanobrowser.pro |  2 ++
> + src/core/browser_accessibility_manager_qt.cpp            |  6 ++++++
> + src/core/browser_accessibility_manager_qt.h              |  2 ++
> + src/core/browser_accessibility_qt.cpp                    |  4 ++++
> + src/core/browser_accessibility_qt.h                      |  3 +++
> + src/core/render_widget_host_view_qt.cpp                  | 13 ++++++++++++-
> + src/core/render_widget_host_view_qt.h                    |  6 +++++-
> + src/core/web_contents_adapter.cpp                        |  2 ++
> + src/core/web_contents_adapter_client.h                   |  2 ++
> + src/webengine/api/qquickwebengineview.cpp                | 12 ++++++++++++
> + src/webengine/api/qquickwebengineview_p.h                |  2 ++
> + src/webengine/api/qquickwebengineview_p_p.h              |  5 ++++-
> + src/webenginewidgets/api/qwebenginepage.cpp              |  3 +++
> + src/webenginewidgets/api/qwebenginepage.h                |  2 ++
> + src/webenginewidgets/api/qwebenginepage_p.h              |  2 ++
> + src/webenginewidgets/api/qwebengineview.cpp              |  7 ++++++-
> + src/webenginewidgets/api/qwebengineview_p.h              |  3 ++-
> + tests/quicktestbrowser/quicktestbrowser.pro              |  2 ++
> + 18 files changed, 73 insertions(+), 5 deletions(-)
> +
> +diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
> +index 3628b81..a8e57b0 100644
> +--- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro
> ++++ b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
> +@@ -1,3 +1,5 @@
> ++requires(contains(QT_CONFIG, accessibility))
> ++
> + TEMPLATE = app
> + TARGET = quicknanobrowser
> + 
> +diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
> +index 28d0dd7..6729866 100644
> +--- a/src/core/browser_accessibility_manager_qt.cpp
> ++++ b/src/core/browser_accessibility_manager_qt.cpp
> +@@ -45,9 +45,14 @@ namespace content {
> + 
> + BrowserAccessibility *BrowserAccessibilityFactoryQt::Create()
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     return new BrowserAccessibilityQt();
> ++#else
> ++    return 0;
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
> +     QObject* parentObject,
> +     const ui::AXTreeUpdate& initialTree,
> +@@ -131,5 +136,6 @@ void BrowserAccessibilityManagerQt::NotifyAccessibilityEvent(ui::AXEvent event_t
> +         break;
> +     }
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + }
> +diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
> +index 5d8498d..49b3af3 100644
> +--- a/src/core/browser_accessibility_manager_qt.h
> ++++ b/src/core/browser_accessibility_manager_qt.h
> +@@ -38,6 +38,7 @@
> + #define BROWSER_ACCESSIBILITY_MANAGER_QT_H
> + 
> + #include "content/browser/accessibility/browser_accessibility_manager.h"
> ++#ifndef QT_NO_ACCESSIBILITY
> + #include <QtCore/qobject.h>
> + 
> + QT_BEGIN_NAMESPACE
> +@@ -74,4 +75,5 @@ private:
> + 
> + }
> + 
> ++#endif // QT_NO_ACCESSIBILITY
> + #endif
> +diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
> +index b5cd26f..4b8e97a 100644
> +--- a/src/core/browser_accessibility_qt.cpp
> ++++ b/src/core/browser_accessibility_qt.cpp
> +@@ -40,6 +40,8 @@
> + 
> + #include "browser_accessibility_qt.h"
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> ++
> + #include "third_party/WebKit/public/web/WebAXEnums.h"
> + #include "ui/accessibility/ax_node_data.h"
> + 
> +@@ -898,3 +900,5 @@ void BrowserAccessibilityQt::modelChange(QAccessibleTableModelChangeEvent *)
> + }
> + 
> + } // namespace content
> ++
> ++#endif // QT_NO_ACCESSIBILITY
> +diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
> +index db190ff..e87b5d8 100644
> +--- a/src/core/browser_accessibility_qt.h
> ++++ b/src/core/browser_accessibility_qt.h
> +@@ -38,6 +38,8 @@
> + #define BROWSER_ACCESSIBILITY_QT_H
> + 
> + #include <QtGui/qaccessible.h>
> ++
> ++#ifndef QT_NO_ACCESSIBILITY
> + #include "content/browser/accessibility/browser_accessibility.h"
> + 
> + namespace content {
> +@@ -145,4 +147,5 @@ public:
> + 
> + }
> + 
> ++#endif // QT_NO_ACCESSIBILITY
> + #endif
> +diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
> +index c221e94..349028e 100644
> +--- a/src/core/render_widget_host_view_qt.cpp
> ++++ b/src/core/render_widget_host_view_qt.cpp
> +@@ -198,15 +198,18 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget
> +     , m_initPending(false)
> + {
> +     m_host->SetView(this);
> +-
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::installActivationObserver(this);
> +     if (QAccessible::isActive())
> +         content::BrowserAccessibilityStateImpl::GetInstance()->EnableAccessibility();
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + RenderWidgetHostViewQt::~RenderWidgetHostViewQt()
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::removeActivationObserver(this);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + void RenderWidgetHostViewQt::setDelegate(RenderWidgetHostViewQtDelegate* delegate)
> +@@ -296,6 +299,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewQt::GetNativeViewAccessible()
> + 
> + void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded()
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     if (GetBrowserAccessibilityManager())
> +         return;
> + 
> +@@ -303,6 +307,9 @@ void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded()
> +         m_adapterClient->accessibilityParentObject(),
> +         content::BrowserAccessibilityManagerQt::GetEmptyDocument(),
> +         this));
> ++else
> ++    return 0;
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + // Set focus to the associated View component.
> +@@ -953,6 +960,7 @@ void RenderWidgetHostViewQt::AccessibilityFatalError()
> +     SetBrowserAccessibilityManager(NULL);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active)
> + {
> +     if (active)
> +@@ -960,6 +968,7 @@ void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active)
> +     else
> +         content::BrowserAccessibilityStateImpl::GetInstance()->DisableAccessibility();
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void RenderWidgetHostViewQt::handleWheelEvent(QWheelEvent *ev)
> + {
> +@@ -1042,6 +1051,7 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev)
> +     }
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible()
> + {
> +     // Assume we have a screen reader doing stuff
> +@@ -1051,6 +1061,7 @@ QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible()
> +     content::BrowserAccessibilityQt *accQt = static_cast<content::BrowserAccessibilityQt*>(acc);
> +     return accQt;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void RenderWidgetHostViewQt::didFirstVisuallyNonEmptyLayout()
> + {
> +diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
> +index d4a3ff2..fac7efd 100644
> +--- a/src/core/render_widget_host_view_qt.h
> ++++ b/src/core/render_widget_host_view_qt.h
> +@@ -50,6 +50,7 @@
> + #include <QRect>
> + #include <QtGlobal>
> + #include <QtGui/qaccessible.h>
> ++#include <QtGui/QTouchEvent>
> + 
> + #include "delegated_frame_node.h"
> + 
> +@@ -59,7 +60,6 @@ class QFocusEvent;
> + class QHoverEvent;
> + class QKeyEvent;
> + class QMouseEvent;
> +-class QTouchEvent;
> + class QVariant;
> + class QWheelEvent;
> + class QAccessibleInterface;
> +@@ -93,7 +93,9 @@ class RenderWidgetHostViewQt
> +     , public RenderWidgetHostViewQtDelegateClient
> +     , public content::BrowserAccessibilityDelegate
> +     , public base::SupportsWeakPtr<RenderWidgetHostViewQt>
> ++#ifndef QT_NO_ACCESSIBILITY
> +     , public QAccessible::ActivationObserver
> ++#endif // QT_NO_ACCESSIBILITY
> + {
> + public:
> +     RenderWidgetHostViewQt(content::RenderWidgetHost* widget);
> +@@ -213,9 +215,11 @@ public:
> +     virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) const Q_DECL_OVERRIDE  { return gfx::Point(); }
> +     virtual void AccessibilityHitTest(const gfx::Point& point) Q_DECL_OVERRIDE  { }
> +     virtual void AccessibilityFatalError() Q_DECL_OVERRIDE;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual void accessibilityActiveChanged(bool active) Q_DECL_OVERRIDE;
> + 
> +     QAccessibleInterface *GetQtAccessible();
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> +     void didFirstVisuallyNonEmptyLayout();
> + 
> +diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
> +index 3f223f7..e41acd0 100644
> +--- a/src/core/web_contents_adapter.cpp
> ++++ b/src/core/web_contents_adapter.cpp
> +@@ -628,12 +628,14 @@ void WebContentsAdapter::enableInspector(bool enable)
> +     ContentBrowserClientQt::Get()->enableInspector(enable);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QAccessibleInterface *WebContentsAdapter::browserAccessible()
> + {
> +     Q_D(const WebContentsAdapter);
> +     RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(d->webContents->GetRenderWidgetHostView());
> +     return rwhv ? rwhv->GetQtAccessible() : Q_NULLPTR;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void WebContentsAdapter::runJavaScript(const QString &javaScript)
> + {
> +diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h
> +index 8fd401f..df18980 100644
> +--- a/src/core/web_contents_adapter_client.h
> ++++ b/src/core/web_contents_adapter_client.h
> +@@ -168,7 +168,9 @@ public:
> +     virtual void passOnFocus(bool reverse) = 0;
> +     // returns the last QObject (QWidget/QQuickItem) based object in the accessibility
> +     // hierarchy before going into the BrowserAccessibility tree
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual QObject *accessibilityParentObject() = 0;
> ++#endif // QT_NO_ACCESSIBILITY
> +     virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) = 0;
> +     virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) = 0;
> +     virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) = 0;
> +diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
> +index 3497c16..a35cfc3 100644
> +--- a/src/webengine/api/qquickwebengineview.cpp
> ++++ b/src/webengine/api/qquickwebengineview.cpp
> +@@ -61,16 +61,20 @@
> + #include <QScreen>
> + #include <QStringBuilder>
> + #include <QUrl>
> ++#ifndef QT_NO_ACCESSIBILITY
> + #include <private/qquickaccessibleattached_p.h>
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QT_BEGIN_NAMESPACE
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
> + {
> +     if (QQuickWebEngineView *v = qobject_cast<QQuickWebEngineView*>(object))
> +         return new QQuickWebEngineViewAccessible(v);
> +     return 0;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
> +     : adapter(new WebContentsAdapter)
> +@@ -102,7 +106,9 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
> +         // 1x, 2x, 3x etc assets that fit an integral number of pixels.
> +         setDevicePixelRatio(qMax(1, qRound(webPixelRatio)));
> +     }
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::installFactory(&webAccessibleFactory);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()
> +@@ -395,11 +401,13 @@ void QQuickWebEngineViewPrivate::runMediaAccessPermissionRequest(const QUrl &sec
> +    Q_EMIT e->featurePermissionRequested(securityOrigin, feature);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
> + {
> +     Q_Q(QQuickWebEngineView);
> +     return q;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const
> + {
> +@@ -414,6 +422,7 @@ void QQuickWebEngineViewPrivate::setDevicePixelRatio(qreal devicePixelRatio)
> +     m_dpiScale = devicePixelRatio / screen->devicePixelRatio();
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o)
> +     : QAccessibleObject(o)
> + {}
> +@@ -460,6 +469,7 @@ QAccessible::State QQuickWebEngineViewAccessible::state() const
> +     QAccessible::State s;
> +     return s;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents)
> + {
> +@@ -497,8 +507,10 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
> +     this->setActiveFocusOnTab(true);
> +     this->setFlag(QQuickItem::ItemIsFocusScope);
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QQuickAccessibleAttached *accessible = QQuickAccessibleAttached::qmlAttachedProperties(this);
> +     accessible->setRole(QAccessible::Grouping);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + QQuickWebEngineView::~QQuickWebEngineView()
> +diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
> +index 22713ee..f3ceb2c 100644
> +--- a/src/webengine/api/qquickwebengineview_p.h
> ++++ b/src/webengine/api/qquickwebengineview_p.h
> +@@ -155,7 +155,9 @@ private:
> +     friend class QQuickWebEngineViewExperimental;
> +     friend class QQuickWebEngineViewExperimentalExtension;
> +     friend class QQuickWebEngineNewViewRequest;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     friend class QQuickWebEngineViewAccessible;
> ++#endif // QT_NO_ACCESSIBILITY
> + };
> + 
> + QT_END_NAMESPACE
> +diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
> +index 6662f1f..3ab95c6 100644
> +--- a/src/webengine/api/qquickwebengineview_p_p.h
> ++++ b/src/webengine/api/qquickwebengineview_p_p.h
> +@@ -175,7 +175,9 @@ public:
> +     virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
> +     virtual void authenticationRequired(const QUrl&, const QString&, bool, const QString&, QString*, QString*) Q_DECL_OVERRIDE { }
> +     virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
> ++#endif // QT_NO_ACCESSIBILITY
> +     virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
> +     virtual void allowCertificateError(const QExplicitlySharedDataPointer<CertificateErrorController> &errorController);
> + 
> +@@ -202,6 +204,7 @@ private:
> +     qreal m_dpiScale;
> + };
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + class QQuickWebEngineViewAccessible : public QAccessibleObject
> + {
> + public:
> +@@ -217,7 +220,7 @@ public:
> + private:
> +     QQuickWebEngineView *engineView() const { return static_cast<QQuickWebEngineView*>(object()); }
> + };
> +-
> ++#endif // QT_NO_ACCESSIBILITY
> + QT_END_NAMESPACE
> + 
> + QML_DECLARE_TYPE(QQuickWebEngineViewExperimental)
> +diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
> +index 72b16f2..068c175 100644
> +--- a/src/webenginewidgets/api/qwebenginepage.cpp
> ++++ b/src/webenginewidgets/api/qwebenginepage.cpp
> +@@ -39,6 +39,7 @@
> + #include <QApplication>
> + #include <QAuthenticator>
> + #include <QClipboard>
> ++#include <QContextMenuEvent>
> + #include <QFileDialog>
> + #include <QIcon>
> + #include <QInputDialog>
> +@@ -342,10 +343,12 @@ void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &security
> +     Q_EMIT q->featurePermissionRequested(securityOrigin, requestedFeature);
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + QObject *QWebEnginePagePrivate::accessibilityParentObject()
> + {
> +     return view;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const
> + {
> +diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
> +index 7856b82..9fd81b0 100644
> +--- a/src/webenginewidgets/api/qwebenginepage.h
> ++++ b/src/webenginewidgets/api/qwebenginepage.h
> +@@ -258,7 +258,9 @@ private:
> + 
> +     friend class QWebEngineView;
> +     friend class QWebEngineViewPrivate;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     friend class QWebEngineViewAccessible;
> ++#endif // QT_NO_ACCESSIBILITY
> + };
> + 
> + 
> +diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
> +index 5412922..2307e7a 100644
> +--- a/src/webenginewidgets/api/qwebenginepage_p.h
> ++++ b/src/webenginewidgets/api/qwebenginepage_p.h
> +@@ -135,7 +135,9 @@ public:
> +     virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
> +     virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) Q_DECL_OVERRIDE;
> +     virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
> ++#ifndef QT_NO_ACCESSIBILITY
> +     virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
> ++#endif // QT_NO_ACCESSIBILITY
> +     virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
> +     virtual void allowCertificateError(const QExplicitlySharedDataPointer<CertificateErrorController> &controller) Q_DECL_OVERRIDE;
> + 
> +diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
> +index 8d21989..63ac405 100644
> +--- a/src/webenginewidgets/api/qwebengineview.cpp
> ++++ b/src/webenginewidgets/api/qwebengineview.cpp
> +@@ -85,19 +85,22 @@ void QWebEngineViewPrivate::bind(QWebEngineView *view, QWebEnginePage *page)
> +     }
> + }
> + 
> +-
> ++#ifndef QT_NO_ACCESSIBILITY
> + static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
> + {
> +     if (QWebEngineView *v = qobject_cast<QWebEngineView*>(object))
> +         return new QWebEngineViewAccessible(v);
> +     return Q_NULLPTR;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QWebEngineViewPrivate::QWebEngineViewPrivate()
> +     : page(0)
> +     , m_pendingContextMenuEvent(false)
> + {
> ++#ifndef QT_NO_ACCESSIBILITY
> +     QAccessible::installFactory(&webAccessibleFactory);
> ++#endif // QT_NO_ACCESSIBILITY
> + }
> + 
> + QWebEngineView::QWebEngineView(QWidget *parent)
> +@@ -274,6 +277,7 @@ void QWebEngineView::contextMenuEvent(QContextMenuEvent *event)
> +     menu->popup(event->globalPos());
> + }
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + int QWebEngineViewAccessible::childCount() const
> + {
> +     if (view() && child(0))
> +@@ -294,6 +298,7 @@ int QWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
> +         return 0;
> +     return -1;
> + }
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QT_END_NAMESPACE
> + 
> +diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
> +index 9db971f..e0cc3f4 100644
> +--- a/src/webenginewidgets/api/qwebengineview_p.h
> ++++ b/src/webenginewidgets/api/qwebengineview_p.h
> +@@ -59,6 +59,7 @@ public:
> +     bool m_pendingContextMenuEvent;
> + };
> + 
> ++#ifndef QT_NO_ACCESSIBILITY
> + class QWebEngineViewAccessible : public QAccessibleWidget
> + {
> + public:
> +@@ -72,7 +73,7 @@ public:
> + private:
> +     QWebEngineView *view() const { return static_cast<QWebEngineView*>(object()); }
> + };
> +-
> ++#endif // QT_NO_ACCESSIBILITY
> + 
> + QT_END_NAMESPACE
> + 
> +diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro
> +index ac8fe74..51ea5a2 100644
> +--- a/tests/quicktestbrowser/quicktestbrowser.pro
> ++++ b/tests/quicktestbrowser/quicktestbrowser.pro
> +@@ -1,3 +1,5 @@
> ++requires(contains(QT_CONFIG, accessibility))
> ++
> + TEMPLATE = app
> + TARGET = quicktestbrowser
> + 
> +-- 
> +2.3.1
> +
> diff --git a/recipes-qt/qt5/qtwebengine_5.4.1.bb b/recipes-qt/qt5/qtwebengine_5.4.1.bb
> index 92e8c04..867d5bd 100644
> --- a/recipes-qt/qt5/qtwebengine_5.4.1.bb
> +++ b/recipes-qt/qt5/qtwebengine_5.4.1.bb
> @@ -8,5 +8,6 @@ SRC_URI += " \
>      file://0001-functions.prf-Don-t-match-QMAKE_EXT_CPP-or-QMAKE_EXT.patch \
>      file://0002-functions.prf-Make-sure-we-only-use-the-file-name-to.patch \
>      file://0003-functions.prf-allow-build-for-linux-oe-g-platform.patch \
> +    file://0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch \
>      file://0001-chromium-base.gypi-include-atomicops_internals_x86_g.patch \
>  "
> diff --git a/recipes-qt/qt5/qtwebengine_git.bb b/recipes-qt/qt5/qtwebengine_git.bb
> index b451c37..133d80d 100644
> --- a/recipes-qt/qt5/qtwebengine_git.bb
> +++ b/recipes-qt/qt5/qtwebengine_git.bb
> @@ -9,6 +9,7 @@ SRC_URI += " \
>      file://0001-functions.prf-Don-t-match-QMAKE_EXT_CPP-or-QMAKE_EXT.patch \
>      file://0002-functions.prf-Make-sure-we-only-use-the-file-name-to.patch \
>      file://0003-functions.prf-allow-build-for-linux-oe-g-platform.patch \
> +    file://0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch \
>      file://0001-chromium-base.gypi-include-atomicops_internals_x86_g.patch \
>  "
>  SRCREV_qtwebengine = "4eceed9ac0b646238e76d77569a619d4dc515ba5"
> -- 
> 2.3.1
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20150304/70dd9ca4/attachment-0002.sig>


More information about the Openembedded-devel mailing list