diff options
Diffstat (limited to 'recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch')
-rw-r--r-- | recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch | 532 |
1 files changed, 0 insertions, 532 deletions
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 deleted file mode 100644 index 63387c75..00000000 --- a/recipes-qt/qt5/qtwebengine/0004-Enable-building-Qt-WebEngine-without-accessiblity-en.patch +++ /dev/null | |||
@@ -1,532 +0,0 @@ | |||
1 | From 6ba64ed2e7136c5a9067d7e1793c0db15e762403 Mon Sep 17 00:00:00 2001 | ||
2 | From: Stephan Binner <stephan.binner@basyskom.com> | ||
3 | Date: Wed, 4 Mar 2015 12:39:29 +0100 | ||
4 | Subject: [PATCH 4/4] Enable building Qt WebEngine without accessiblity | ||
5 | enabled. | ||
6 | |||
7 | This adds guards that for QT_NO_ACCESSIBILITY being not defined | ||
8 | around the code that uses accessibility types. | ||
9 | |||
10 | It disables the quicknanobrowser and quicktestbrowser examples | ||
11 | which need Qt QuickControls, which has a hard dependency to | ||
12 | accessibility being enabled. | ||
13 | |||
14 | Upstream-Status: Backport from 5.5 | ||
15 | https://codereview.qt-project.org/#/c/104207/ | ||
16 | |||
17 | Backport of d95b9295c970401939d2779cbdc9e2a8c7965277 from 5.5 | ||
18 | |||
19 | Change-Id: I2a2a0a6196fcb3baa39603d9c929183b454f39ed | ||
20 | Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com> | ||
21 | --- | ||
22 | examples/webengine/quicknanobrowser/quicknanobrowser.pro | 2 ++ | ||
23 | src/core/browser_accessibility_manager_qt.cpp | 6 ++++++ | ||
24 | src/core/browser_accessibility_manager_qt.h | 2 ++ | ||
25 | src/core/browser_accessibility_qt.cpp | 4 ++++ | ||
26 | src/core/browser_accessibility_qt.h | 3 +++ | ||
27 | src/core/render_widget_host_view_qt.cpp | 11 ++++++++++- | ||
28 | src/core/render_widget_host_view_qt.h | 6 +++++- | ||
29 | src/core/web_contents_adapter.cpp | 2 ++ | ||
30 | src/core/web_contents_adapter_client.h | 2 ++ | ||
31 | src/webengine/api/qquickwebengineview.cpp | 12 ++++++++++++ | ||
32 | src/webengine/api/qquickwebengineview_p.h | 2 ++ | ||
33 | src/webengine/api/qquickwebengineview_p_p.h | 5 ++++- | ||
34 | src/webenginewidgets/api/qwebenginepage.cpp | 3 +++ | ||
35 | src/webenginewidgets/api/qwebenginepage.h | 2 ++ | ||
36 | src/webenginewidgets/api/qwebenginepage_p.h | 2 ++ | ||
37 | src/webenginewidgets/api/qwebengineview.cpp | 7 ++++++- | ||
38 | src/webenginewidgets/api/qwebengineview_p.h | 3 ++- | ||
39 | tests/quicktestbrowser/quicktestbrowser.pro | 2 ++ | ||
40 | 18 files changed, 71 insertions(+), 5 deletions(-) | ||
41 | |||
42 | diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webengine/quicknanobrowser/quicknanobrowser.pro | ||
43 | index 3628b81..a8e57b0 100644 | ||
44 | --- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro | ||
45 | +++ b/examples/webengine/quicknanobrowser/quicknanobrowser.pro | ||
46 | @@ -1,3 +1,5 @@ | ||
47 | +requires(contains(QT_CONFIG, accessibility)) | ||
48 | + | ||
49 | TEMPLATE = app | ||
50 | TARGET = quicknanobrowser | ||
51 | |||
52 | diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp | ||
53 | index 28d0dd7..6729866 100644 | ||
54 | --- a/src/core/browser_accessibility_manager_qt.cpp | ||
55 | +++ b/src/core/browser_accessibility_manager_qt.cpp | ||
56 | @@ -45,9 +45,14 @@ namespace content { | ||
57 | |||
58 | BrowserAccessibility *BrowserAccessibilityFactoryQt::Create() | ||
59 | { | ||
60 | +#ifndef QT_NO_ACCESSIBILITY | ||
61 | return new BrowserAccessibilityQt(); | ||
62 | +#else | ||
63 | + return 0; | ||
64 | +#endif // QT_NO_ACCESSIBILITY | ||
65 | } | ||
66 | |||
67 | +#ifndef QT_NO_ACCESSIBILITY | ||
68 | BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt( | ||
69 | QObject* parentObject, | ||
70 | const ui::AXTreeUpdate& initialTree, | ||
71 | @@ -131,5 +136,6 @@ void BrowserAccessibilityManagerQt::NotifyAccessibilityEvent(ui::AXEvent event_t | ||
72 | break; | ||
73 | } | ||
74 | } | ||
75 | +#endif // QT_NO_ACCESSIBILITY | ||
76 | |||
77 | } | ||
78 | diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h | ||
79 | index 5d8498d..49b3af3 100644 | ||
80 | --- a/src/core/browser_accessibility_manager_qt.h | ||
81 | +++ b/src/core/browser_accessibility_manager_qt.h | ||
82 | @@ -38,6 +38,7 @@ | ||
83 | #define BROWSER_ACCESSIBILITY_MANAGER_QT_H | ||
84 | |||
85 | #include "content/browser/accessibility/browser_accessibility_manager.h" | ||
86 | +#ifndef QT_NO_ACCESSIBILITY | ||
87 | #include <QtCore/qobject.h> | ||
88 | |||
89 | QT_BEGIN_NAMESPACE | ||
90 | @@ -74,4 +75,5 @@ private: | ||
91 | |||
92 | } | ||
93 | |||
94 | +#endif // QT_NO_ACCESSIBILITY | ||
95 | #endif | ||
96 | diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp | ||
97 | index b5cd26f..4b8e97a 100644 | ||
98 | --- a/src/core/browser_accessibility_qt.cpp | ||
99 | +++ b/src/core/browser_accessibility_qt.cpp | ||
100 | @@ -40,6 +40,8 @@ | ||
101 | |||
102 | #include "browser_accessibility_qt.h" | ||
103 | |||
104 | +#ifndef QT_NO_ACCESSIBILITY | ||
105 | + | ||
106 | #include "third_party/WebKit/public/web/WebAXEnums.h" | ||
107 | #include "ui/accessibility/ax_node_data.h" | ||
108 | |||
109 | @@ -898,3 +900,5 @@ void BrowserAccessibilityQt::modelChange(QAccessibleTableModelChangeEvent *) | ||
110 | } | ||
111 | |||
112 | } // namespace content | ||
113 | + | ||
114 | +#endif // QT_NO_ACCESSIBILITY | ||
115 | diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h | ||
116 | index db190ff..e87b5d8 100644 | ||
117 | --- a/src/core/browser_accessibility_qt.h | ||
118 | +++ b/src/core/browser_accessibility_qt.h | ||
119 | @@ -38,6 +38,8 @@ | ||
120 | #define BROWSER_ACCESSIBILITY_QT_H | ||
121 | |||
122 | #include <QtGui/qaccessible.h> | ||
123 | + | ||
124 | +#ifndef QT_NO_ACCESSIBILITY | ||
125 | #include "content/browser/accessibility/browser_accessibility.h" | ||
126 | |||
127 | namespace content { | ||
128 | @@ -145,4 +147,5 @@ public: | ||
129 | |||
130 | } | ||
131 | |||
132 | +#endif // QT_NO_ACCESSIBILITY | ||
133 | #endif | ||
134 | diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp | ||
135 | index c221e94..4c8a2c1 100644 | ||
136 | --- a/src/core/render_widget_host_view_qt.cpp | ||
137 | +++ b/src/core/render_widget_host_view_qt.cpp | ||
138 | @@ -198,15 +198,18 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget | ||
139 | , m_initPending(false) | ||
140 | { | ||
141 | m_host->SetView(this); | ||
142 | - | ||
143 | +#ifndef QT_NO_ACCESSIBILITY | ||
144 | QAccessible::installActivationObserver(this); | ||
145 | if (QAccessible::isActive()) | ||
146 | content::BrowserAccessibilityStateImpl::GetInstance()->EnableAccessibility(); | ||
147 | +#endif // QT_NO_ACCESSIBILITY | ||
148 | } | ||
149 | |||
150 | RenderWidgetHostViewQt::~RenderWidgetHostViewQt() | ||
151 | { | ||
152 | +#ifndef QT_NO_ACCESSIBILITY | ||
153 | QAccessible::removeActivationObserver(this); | ||
154 | +#endif // QT_NO_ACCESSIBILITY | ||
155 | } | ||
156 | |||
157 | void RenderWidgetHostViewQt::setDelegate(RenderWidgetHostViewQtDelegate* delegate) | ||
158 | @@ -296,6 +299,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewQt::GetNativeViewAccessible() | ||
159 | |||
160 | void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded() | ||
161 | { | ||
162 | +#ifndef QT_NO_ACCESSIBILITY | ||
163 | if (GetBrowserAccessibilityManager()) | ||
164 | return; | ||
165 | |||
166 | @@ -303,6 +307,7 @@ void RenderWidgetHostViewQt::CreateBrowserAccessibilityManagerIfNeeded() | ||
167 | m_adapterClient->accessibilityParentObject(), | ||
168 | content::BrowserAccessibilityManagerQt::GetEmptyDocument(), | ||
169 | this)); | ||
170 | +#endif // QT_NO_ACCESSIBILITY | ||
171 | } | ||
172 | |||
173 | // Set focus to the associated View component. | ||
174 | @@ -953,6 +958,7 @@ void RenderWidgetHostViewQt::AccessibilityFatalError() | ||
175 | SetBrowserAccessibilityManager(NULL); | ||
176 | } | ||
177 | |||
178 | +#ifndef QT_NO_ACCESSIBILITY | ||
179 | void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active) | ||
180 | { | ||
181 | if (active) | ||
182 | @@ -960,6 +966,7 @@ void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active) | ||
183 | else | ||
184 | content::BrowserAccessibilityStateImpl::GetInstance()->DisableAccessibility(); | ||
185 | } | ||
186 | +#endif // QT_NO_ACCESSIBILITY | ||
187 | |||
188 | void RenderWidgetHostViewQt::handleWheelEvent(QWheelEvent *ev) | ||
189 | { | ||
190 | @@ -1042,6 +1049,7 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev) | ||
191 | } | ||
192 | } | ||
193 | |||
194 | +#ifndef QT_NO_ACCESSIBILITY | ||
195 | QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible() | ||
196 | { | ||
197 | // Assume we have a screen reader doing stuff | ||
198 | @@ -1051,6 +1059,7 @@ QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible() | ||
199 | content::BrowserAccessibilityQt *accQt = static_cast<content::BrowserAccessibilityQt*>(acc); | ||
200 | return accQt; | ||
201 | } | ||
202 | +#endif // QT_NO_ACCESSIBILITY | ||
203 | |||
204 | void RenderWidgetHostViewQt::didFirstVisuallyNonEmptyLayout() | ||
205 | { | ||
206 | diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h | ||
207 | index d4a3ff2..fac7efd 100644 | ||
208 | --- a/src/core/render_widget_host_view_qt.h | ||
209 | +++ b/src/core/render_widget_host_view_qt.h | ||
210 | @@ -50,6 +50,7 @@ | ||
211 | #include <QRect> | ||
212 | #include <QtGlobal> | ||
213 | #include <QtGui/qaccessible.h> | ||
214 | +#include <QtGui/QTouchEvent> | ||
215 | |||
216 | #include "delegated_frame_node.h" | ||
217 | |||
218 | @@ -59,7 +60,6 @@ class QFocusEvent; | ||
219 | class QHoverEvent; | ||
220 | class QKeyEvent; | ||
221 | class QMouseEvent; | ||
222 | -class QTouchEvent; | ||
223 | class QVariant; | ||
224 | class QWheelEvent; | ||
225 | class QAccessibleInterface; | ||
226 | @@ -93,7 +93,9 @@ class RenderWidgetHostViewQt | ||
227 | , public RenderWidgetHostViewQtDelegateClient | ||
228 | , public content::BrowserAccessibilityDelegate | ||
229 | , public base::SupportsWeakPtr<RenderWidgetHostViewQt> | ||
230 | +#ifndef QT_NO_ACCESSIBILITY | ||
231 | , public QAccessible::ActivationObserver | ||
232 | +#endif // QT_NO_ACCESSIBILITY | ||
233 | { | ||
234 | public: | ||
235 | RenderWidgetHostViewQt(content::RenderWidgetHost* widget); | ||
236 | @@ -213,9 +215,11 @@ public: | ||
237 | virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) const Q_DECL_OVERRIDE { return gfx::Point(); } | ||
238 | virtual void AccessibilityHitTest(const gfx::Point& point) Q_DECL_OVERRIDE { } | ||
239 | virtual void AccessibilityFatalError() Q_DECL_OVERRIDE; | ||
240 | +#ifndef QT_NO_ACCESSIBILITY | ||
241 | virtual void accessibilityActiveChanged(bool active) Q_DECL_OVERRIDE; | ||
242 | |||
243 | QAccessibleInterface *GetQtAccessible(); | ||
244 | +#endif // QT_NO_ACCESSIBILITY | ||
245 | |||
246 | void didFirstVisuallyNonEmptyLayout(); | ||
247 | |||
248 | diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp | ||
249 | index 3f223f7..e41acd0 100644 | ||
250 | --- a/src/core/web_contents_adapter.cpp | ||
251 | +++ b/src/core/web_contents_adapter.cpp | ||
252 | @@ -628,12 +628,14 @@ void WebContentsAdapter::enableInspector(bool enable) | ||
253 | ContentBrowserClientQt::Get()->enableInspector(enable); | ||
254 | } | ||
255 | |||
256 | +#ifndef QT_NO_ACCESSIBILITY | ||
257 | QAccessibleInterface *WebContentsAdapter::browserAccessible() | ||
258 | { | ||
259 | Q_D(const WebContentsAdapter); | ||
260 | RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(d->webContents->GetRenderWidgetHostView()); | ||
261 | return rwhv ? rwhv->GetQtAccessible() : Q_NULLPTR; | ||
262 | } | ||
263 | +#endif // QT_NO_ACCESSIBILITY | ||
264 | |||
265 | void WebContentsAdapter::runJavaScript(const QString &javaScript) | ||
266 | { | ||
267 | diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h | ||
268 | index 8fd401f..df18980 100644 | ||
269 | --- a/src/core/web_contents_adapter_client.h | ||
270 | +++ b/src/core/web_contents_adapter_client.h | ||
271 | @@ -168,7 +168,9 @@ public: | ||
272 | virtual void passOnFocus(bool reverse) = 0; | ||
273 | // returns the last QObject (QWidget/QQuickItem) based object in the accessibility | ||
274 | // hierarchy before going into the BrowserAccessibility tree | ||
275 | +#ifndef QT_NO_ACCESSIBILITY | ||
276 | virtual QObject *accessibilityParentObject() = 0; | ||
277 | +#endif // QT_NO_ACCESSIBILITY | ||
278 | virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) = 0; | ||
279 | virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) = 0; | ||
280 | virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) = 0; | ||
281 | diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp | ||
282 | index 3497c16..a35cfc3 100644 | ||
283 | --- a/src/webengine/api/qquickwebengineview.cpp | ||
284 | +++ b/src/webengine/api/qquickwebengineview.cpp | ||
285 | @@ -61,16 +61,20 @@ | ||
286 | #include <QScreen> | ||
287 | #include <QStringBuilder> | ||
288 | #include <QUrl> | ||
289 | +#ifndef QT_NO_ACCESSIBILITY | ||
290 | #include <private/qquickaccessibleattached_p.h> | ||
291 | +#endif // QT_NO_ACCESSIBILITY | ||
292 | |||
293 | QT_BEGIN_NAMESPACE | ||
294 | |||
295 | +#ifndef QT_NO_ACCESSIBILITY | ||
296 | static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object) | ||
297 | { | ||
298 | if (QQuickWebEngineView *v = qobject_cast<QQuickWebEngineView*>(object)) | ||
299 | return new QQuickWebEngineViewAccessible(v); | ||
300 | return 0; | ||
301 | } | ||
302 | +#endif // QT_NO_ACCESSIBILITY | ||
303 | |||
304 | QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate() | ||
305 | : adapter(new WebContentsAdapter) | ||
306 | @@ -102,7 +106,9 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate() | ||
307 | // 1x, 2x, 3x etc assets that fit an integral number of pixels. | ||
308 | setDevicePixelRatio(qMax(1, qRound(webPixelRatio))); | ||
309 | } | ||
310 | +#ifndef QT_NO_ACCESSIBILITY | ||
311 | QAccessible::installFactory(&webAccessibleFactory); | ||
312 | +#endif // QT_NO_ACCESSIBILITY | ||
313 | } | ||
314 | |||
315 | QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate() | ||
316 | @@ -395,11 +401,13 @@ void QQuickWebEngineViewPrivate::runMediaAccessPermissionRequest(const QUrl &sec | ||
317 | Q_EMIT e->featurePermissionRequested(securityOrigin, feature); | ||
318 | } | ||
319 | |||
320 | +#ifndef QT_NO_ACCESSIBILITY | ||
321 | QObject *QQuickWebEngineViewPrivate::accessibilityParentObject() | ||
322 | { | ||
323 | Q_Q(QQuickWebEngineView); | ||
324 | return q; | ||
325 | } | ||
326 | +#endif // QT_NO_ACCESSIBILITY | ||
327 | |||
328 | WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const | ||
329 | { | ||
330 | @@ -414,6 +422,7 @@ void QQuickWebEngineViewPrivate::setDevicePixelRatio(qreal devicePixelRatio) | ||
331 | m_dpiScale = devicePixelRatio / screen->devicePixelRatio(); | ||
332 | } | ||
333 | |||
334 | +#ifndef QT_NO_ACCESSIBILITY | ||
335 | QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o) | ||
336 | : QAccessibleObject(o) | ||
337 | {} | ||
338 | @@ -460,6 +469,7 @@ QAccessible::State QQuickWebEngineViewAccessible::state() const | ||
339 | QAccessible::State s; | ||
340 | return s; | ||
341 | } | ||
342 | +#endif // QT_NO_ACCESSIBILITY | ||
343 | |||
344 | void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents) | ||
345 | { | ||
346 | @@ -497,8 +507,10 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent) | ||
347 | this->setActiveFocusOnTab(true); | ||
348 | this->setFlag(QQuickItem::ItemIsFocusScope); | ||
349 | |||
350 | +#ifndef QT_NO_ACCESSIBILITY | ||
351 | QQuickAccessibleAttached *accessible = QQuickAccessibleAttached::qmlAttachedProperties(this); | ||
352 | accessible->setRole(QAccessible::Grouping); | ||
353 | +#endif // QT_NO_ACCESSIBILITY | ||
354 | } | ||
355 | |||
356 | QQuickWebEngineView::~QQuickWebEngineView() | ||
357 | diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h | ||
358 | index 22713ee..f3ceb2c 100644 | ||
359 | --- a/src/webengine/api/qquickwebengineview_p.h | ||
360 | +++ b/src/webengine/api/qquickwebengineview_p.h | ||
361 | @@ -155,7 +155,9 @@ private: | ||
362 | friend class QQuickWebEngineViewExperimental; | ||
363 | friend class QQuickWebEngineViewExperimentalExtension; | ||
364 | friend class QQuickWebEngineNewViewRequest; | ||
365 | +#ifndef QT_NO_ACCESSIBILITY | ||
366 | friend class QQuickWebEngineViewAccessible; | ||
367 | +#endif // QT_NO_ACCESSIBILITY | ||
368 | }; | ||
369 | |||
370 | QT_END_NAMESPACE | ||
371 | diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h | ||
372 | index 6662f1f..3ab95c6 100644 | ||
373 | --- a/src/webengine/api/qquickwebengineview_p_p.h | ||
374 | +++ b/src/webengine/api/qquickwebengineview_p_p.h | ||
375 | @@ -175,7 +175,9 @@ public: | ||
376 | virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE; | ||
377 | virtual void authenticationRequired(const QUrl&, const QString&, bool, const QString&, QString*, QString*) Q_DECL_OVERRIDE { } | ||
378 | virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE; | ||
379 | +#ifndef QT_NO_ACCESSIBILITY | ||
380 | virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE; | ||
381 | +#endif // QT_NO_ACCESSIBILITY | ||
382 | virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE; | ||
383 | virtual void allowCertificateError(const QExplicitlySharedDataPointer<CertificateErrorController> &errorController); | ||
384 | |||
385 | @@ -202,6 +204,7 @@ private: | ||
386 | qreal m_dpiScale; | ||
387 | }; | ||
388 | |||
389 | +#ifndef QT_NO_ACCESSIBILITY | ||
390 | class QQuickWebEngineViewAccessible : public QAccessibleObject | ||
391 | { | ||
392 | public: | ||
393 | @@ -217,7 +220,7 @@ public: | ||
394 | private: | ||
395 | QQuickWebEngineView *engineView() const { return static_cast<QQuickWebEngineView*>(object()); } | ||
396 | }; | ||
397 | - | ||
398 | +#endif // QT_NO_ACCESSIBILITY | ||
399 | QT_END_NAMESPACE | ||
400 | |||
401 | QML_DECLARE_TYPE(QQuickWebEngineViewExperimental) | ||
402 | diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp | ||
403 | index 72b16f2..068c175 100644 | ||
404 | --- a/src/webenginewidgets/api/qwebenginepage.cpp | ||
405 | +++ b/src/webenginewidgets/api/qwebenginepage.cpp | ||
406 | @@ -39,6 +39,7 @@ | ||
407 | #include <QApplication> | ||
408 | #include <QAuthenticator> | ||
409 | #include <QClipboard> | ||
410 | +#include <QContextMenuEvent> | ||
411 | #include <QFileDialog> | ||
412 | #include <QIcon> | ||
413 | #include <QInputDialog> | ||
414 | @@ -342,10 +343,12 @@ void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &security | ||
415 | Q_EMIT q->featurePermissionRequested(securityOrigin, requestedFeature); | ||
416 | } | ||
417 | |||
418 | +#ifndef QT_NO_ACCESSIBILITY | ||
419 | QObject *QWebEnginePagePrivate::accessibilityParentObject() | ||
420 | { | ||
421 | return view; | ||
422 | } | ||
423 | +#endif // QT_NO_ACCESSIBILITY | ||
424 | |||
425 | void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const | ||
426 | { | ||
427 | diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h | ||
428 | index 7856b82..9fd81b0 100644 | ||
429 | --- a/src/webenginewidgets/api/qwebenginepage.h | ||
430 | +++ b/src/webenginewidgets/api/qwebenginepage.h | ||
431 | @@ -258,7 +258,9 @@ private: | ||
432 | |||
433 | friend class QWebEngineView; | ||
434 | friend class QWebEngineViewPrivate; | ||
435 | +#ifndef QT_NO_ACCESSIBILITY | ||
436 | friend class QWebEngineViewAccessible; | ||
437 | +#endif // QT_NO_ACCESSIBILITY | ||
438 | }; | ||
439 | |||
440 | |||
441 | diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h | ||
442 | index 5412922..2307e7a 100644 | ||
443 | --- a/src/webenginewidgets/api/qwebenginepage_p.h | ||
444 | +++ b/src/webenginewidgets/api/qwebenginepage_p.h | ||
445 | @@ -135,7 +135,9 @@ public: | ||
446 | virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE; | ||
447 | virtual void authenticationRequired(const QUrl &requestUrl, const QString &realm, bool isProxy, const QString &challengingHost, QString *outUser, QString *outPassword) Q_DECL_OVERRIDE; | ||
448 | virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE; | ||
449 | +#ifndef QT_NO_ACCESSIBILITY | ||
450 | virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE; | ||
451 | +#endif // QT_NO_ACCESSIBILITY | ||
452 | virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE; | ||
453 | virtual void allowCertificateError(const QExplicitlySharedDataPointer<CertificateErrorController> &controller) Q_DECL_OVERRIDE; | ||
454 | |||
455 | diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp | ||
456 | index 8d21989..63ac405 100644 | ||
457 | --- a/src/webenginewidgets/api/qwebengineview.cpp | ||
458 | +++ b/src/webenginewidgets/api/qwebengineview.cpp | ||
459 | @@ -85,19 +85,22 @@ void QWebEngineViewPrivate::bind(QWebEngineView *view, QWebEnginePage *page) | ||
460 | } | ||
461 | } | ||
462 | |||
463 | - | ||
464 | +#ifndef QT_NO_ACCESSIBILITY | ||
465 | static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object) | ||
466 | { | ||
467 | if (QWebEngineView *v = qobject_cast<QWebEngineView*>(object)) | ||
468 | return new QWebEngineViewAccessible(v); | ||
469 | return Q_NULLPTR; | ||
470 | } | ||
471 | +#endif // QT_NO_ACCESSIBILITY | ||
472 | |||
473 | QWebEngineViewPrivate::QWebEngineViewPrivate() | ||
474 | : page(0) | ||
475 | , m_pendingContextMenuEvent(false) | ||
476 | { | ||
477 | +#ifndef QT_NO_ACCESSIBILITY | ||
478 | QAccessible::installFactory(&webAccessibleFactory); | ||
479 | +#endif // QT_NO_ACCESSIBILITY | ||
480 | } | ||
481 | |||
482 | QWebEngineView::QWebEngineView(QWidget *parent) | ||
483 | @@ -274,6 +277,7 @@ void QWebEngineView::contextMenuEvent(QContextMenuEvent *event) | ||
484 | menu->popup(event->globalPos()); | ||
485 | } | ||
486 | |||
487 | +#ifndef QT_NO_ACCESSIBILITY | ||
488 | int QWebEngineViewAccessible::childCount() const | ||
489 | { | ||
490 | if (view() && child(0)) | ||
491 | @@ -294,6 +298,7 @@ int QWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const | ||
492 | return 0; | ||
493 | return -1; | ||
494 | } | ||
495 | +#endif // QT_NO_ACCESSIBILITY | ||
496 | |||
497 | QT_END_NAMESPACE | ||
498 | |||
499 | diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h | ||
500 | index 9db971f..e0cc3f4 100644 | ||
501 | --- a/src/webenginewidgets/api/qwebengineview_p.h | ||
502 | +++ b/src/webenginewidgets/api/qwebengineview_p.h | ||
503 | @@ -59,6 +59,7 @@ public: | ||
504 | bool m_pendingContextMenuEvent; | ||
505 | }; | ||
506 | |||
507 | +#ifndef QT_NO_ACCESSIBILITY | ||
508 | class QWebEngineViewAccessible : public QAccessibleWidget | ||
509 | { | ||
510 | public: | ||
511 | @@ -72,7 +73,7 @@ public: | ||
512 | private: | ||
513 | QWebEngineView *view() const { return static_cast<QWebEngineView*>(object()); } | ||
514 | }; | ||
515 | - | ||
516 | +#endif // QT_NO_ACCESSIBILITY | ||
517 | |||
518 | QT_END_NAMESPACE | ||
519 | |||
520 | diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro | ||
521 | index ac8fe74..51ea5a2 100644 | ||
522 | --- a/tests/quicktestbrowser/quicktestbrowser.pro | ||
523 | +++ b/tests/quicktestbrowser/quicktestbrowser.pro | ||
524 | @@ -1,3 +1,5 @@ | ||
525 | +requires(contains(QT_CONFIG, accessibility)) | ||
526 | + | ||
527 | TEMPLATE = app | ||
528 | TARGET = quicktestbrowser | ||
529 | |||
530 | -- | ||
531 | 2.3.1 | ||
532 | |||