From a833bc8e4e2a2545c8920c329b084a9373c261c5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 3 Jun 2016 14:05:49 +0200 Subject: Remove documentation of QWebEnginePage::ToggleSpellcheck This action is not in Qt 5.7 Change-Id: I78b77b1d0cc84145b1883da1014efa38e110d00a Reviewed-by: Michal Klocek Reviewed-by: Leena Miettinen --- src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index a6cb0a384..00e253170 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -152,7 +152,6 @@ \value Unselect Clear the current selection. (Added in Qt 5.7) \value SavePage Save the current page to disk. MHTML is the default format that is used to store the web page on disk. (Added in Qt 5.7) - \value ToggleSpellcheck Enable or disable the spell checker. (Added in Qt 5.7) \omitvalue WebActionCount -- cgit v1.2.3 From bcc580aaa9ae5121db701d2e5ad03ef312f4e4ab Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 9 Jun 2016 15:01:36 +0200 Subject: Fix memory leak of authentication qml dialog Change-Id: I951c78e53ff0e05918daf34076fffc44b813a8d2 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/ui_delegates_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 96b3e3a77..16554da68 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -359,9 +359,12 @@ void UIDelegatesManager::showDialog(QSharedPointerurl()); static int acceptIndex = dialogController->metaObject()->indexOfSlot("accept(QString,QString)"); + static int deleteLaterIndex = authenticationDialog->metaObject()->indexOfSlot("deleteLater()"); QObject::connect(authenticationDialog, acceptSignal.method(), dialogController.data(), dialogController->metaObject()->method(acceptIndex)); + QObject::connect(authenticationDialog, acceptSignal.method(), authenticationDialog, authenticationDialog->metaObject()->method(deleteLaterIndex)); static int rejectIndex = dialogController->metaObject()->indexOfSlot("reject()"); QObject::connect(authenticationDialog, rejectSignal.method(), dialogController.data(), dialogController->metaObject()->method(rejectIndex)); + QObject::connect(authenticationDialog, rejectSignal.method(), authenticationDialog, authenticationDialog->metaObject()->method(deleteLaterIndex)); authenticationDialogComponent->completeCreate(); QMetaObject::invokeMethod(authenticationDialog, "open"); -- cgit v1.2.3 From 9764fa47ee9b4f8ccf1c7cb0dc073bdc8a4f9c86 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 9 Jun 2016 16:02:10 +0200 Subject: Fix memory leak of qml menu Current qml menu implementation uses always WebEngineView as the parent of the menu. However menu can be triggered several times during WebEngineView lifetime, each time creating new menu component. Use onDone menu signal instead to delete menu. Change-Id: I1a6064451e95453268a2cd46899e297e769dc1f1 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/ui_delegates_manager.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 16554da68..88c4b7c19 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -204,7 +204,7 @@ void UIDelegatesManager::addMenuSeparator(QObject *menu) QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title, const QPoint& pos) { - + Q_ASSERT(parentMenu); if (!ensureComponentLoaded(Menu)) return 0; QQmlContext *context = qmlContext(m_view); @@ -217,18 +217,18 @@ QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title, QQmlProperty(menu, QStringLiteral("title")).write(title); if (!pos.isNull()) QQmlProperty(menu, QStringLiteral("pos")).write(pos); - if (!parentMenu) { - QQmlProperty doneSignal(menu, QStringLiteral("onDone")); - static int deleteLaterIndex = menu->metaObject()->indexOfSlot("deleteLater()"); - if (doneSignal.isSignalProperty()) - QObject::connect(menu, doneSignal.method(), menu, menu->metaObject()->method(deleteLaterIndex)); - } else { - menu->setParent(parentMenu); - QQmlListReference entries(parentMenu, defaultPropertyName(parentMenu), qmlEngine(m_view)); - if (entries.isValid()) - entries.append(menu); - } + menu->setParent(parentMenu); + + QQmlProperty doneSignal(menu, QStringLiteral("onDone")); + static int deleteLaterIndex = menu->metaObject()->indexOfSlot("deleteLater()"); + CHECK_QML_SIGNAL_PROPERTY(doneSignal, menuComponent->url()); + QObject::connect(menu, doneSignal.method(), menu, menu->metaObject()->method(deleteLaterIndex)); + + QQmlListReference entries(parentMenu, defaultPropertyName(parentMenu), qmlEngine(m_view)); + if (entries.isValid()) + entries.append(menu); + menuComponent->completeCreate(); return menu; } -- cgit v1.2.3 From 0f51b90fd881910825f1a8584d420f5fdd7365d9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 4 Mar 2016 10:01:00 +0100 Subject: [Reapply] Blacklist getUserMediaRequest on Windows This change was lost in the last merge from 5.6, but is still needed. Task-number: QTBUG-51652 Change-Id: Ic87ebb19ddda7d06ea12bd0826ddf10d404a75d8 Reviewed-by: Joerg Bornemann --- tests/auto/widgets/qwebenginepage/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST index fcd36ba83..507fb7dbd 100644 --- a/tests/auto/widgets/qwebenginepage/BLACKLIST +++ b/tests/auto/widgets/qwebenginepage/BLACKLIST @@ -1,2 +1,5 @@ [macCopyUnicodeToClipboard] osx + +[getUserMediaRequest] +windows -- cgit v1.2.3 From c7aeb3b03ecce75c40d3f53352e8b7b3a4d6d050 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 10 Jun 2016 14:46:24 +0200 Subject: Enable -fno_delete_null_pointer_checks on V8 for G++ 6 Detect g++ 6 and disable null pointer check optimizations on v8. Change-Id: I5064823af3784786d455ce86592b5e65c1020f21 Task-number: QTBUG-53956 Reviewed-by: Joerg Bornemann --- src/3rdparty | 2 +- src/core/config/linux.pri | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 168cc2b83..ba36da6c1 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 168cc2b83c53e4e68bf89b331d92da88a99d2bf3 +Subproject commit ba36da6c1f59da7687f6924cc558105dcd1c44dc diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 8854a4bdf..b579e2a3f 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -29,6 +29,8 @@ use?(nss) { use_openssl_certs=1 } +gcc:!clang: greaterThan(QT_GCC_MAJOR_VERSION, 5): GYP_CONFIG += v8_no_delete_null_pointer_checks=1 + contains(QT_CONFIG, system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1 contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1 contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1 -- cgit v1.2.3 From ca6762abde85fe3104ec4f064b85319474ba2deb Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 10 Jun 2016 15:06:03 +0200 Subject: Fix the IPC webChannelTransport not being available on reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gin JavaScript binging gets destroyed on page reload after all references to it disappear from the previous document. Do like other gin wrapper and reinstall the transport binding on DidCreateDocumentElement, following how it's done by the MojoBindingsController. Task-number: QTBUG-53411 Change-Id: Ibcd9ef9dbedc5762d4f2210fd81f68e5b9127680 Reviewed-by: Michael Brüning --- src/core/renderer/web_channel_ipc_transport.cpp | 12 +++++++++++ src/core/renderer/web_channel_ipc_transport.h | 4 ++++ .../qwebenginescript/tst_qwebenginescript.cpp | 25 ++++++++++++++++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp index d1e5f2245..6bbbe28bd 100644 --- a/src/core/renderer/web_channel_ipc_transport.cpp +++ b/src/core/renderer/web_channel_ipc_transport.cpp @@ -153,6 +153,8 @@ content::RenderView *WebChannelTransport::GetRenderView(v8::Isolate *isolate) WebChannelIPCTransport::WebChannelIPCTransport(content::RenderView *renderView) : content::RenderViewObserver(renderView) + , m_installed(false) + , m_installedWorldId(0) { } @@ -162,6 +164,8 @@ void WebChannelIPCTransport::installWebChannel(uint worldId) if (!webView) return; WebChannelTransport::Install(webView->mainFrame(), worldId); + m_installed = true; + m_installedWorldId = worldId; } void WebChannelIPCTransport::uninstallWebChannel(uint worldId) @@ -170,6 +174,7 @@ void WebChannelIPCTransport::uninstallWebChannel(uint worldId) if (!webView) return; WebChannelTransport::Uninstall(webView->mainFrame(), worldId); + m_installed = false; } void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector &binaryJSON, uint worldId) @@ -217,6 +222,13 @@ void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector & frame->callFunctionEvenIfScriptDisabled(callback, webChannelObjectValue->ToObject(), argc, argv); } +void WebChannelIPCTransport::DidCreateDocumentElement(blink::WebLocalFrame* frame) +{ + blink::WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); + if (m_installed && frame == main_frame) + WebChannelTransport::Install(frame, m_installedWorldId); +} + bool WebChannelIPCTransport::OnMessageReceived(const IPC::Message &message) { bool handled = true; diff --git a/src/core/renderer/web_channel_ipc_transport.h b/src/core/renderer/web_channel_ipc_transport.h index f799f47af..fcee13bda 100644 --- a/src/core/renderer/web_channel_ipc_transport.h +++ b/src/core/renderer/web_channel_ipc_transport.h @@ -58,7 +58,11 @@ private: void dispatchWebChannelMessage(const std::vector &binaryJSON, uint worldId); void installWebChannel(uint worldId); void uninstallWebChannel(uint worldId); + virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) override; virtual bool OnMessageReceived(const IPC::Message &message) Q_DECL_OVERRIDE; + + bool m_installed; + uint m_installedWorldId; }; } // namespace diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp index ad10234f4..d5ecd8841 100644 --- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp +++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp @@ -37,6 +37,7 @@ private Q_SLOTS: void scriptModifications(); void webChannel_data(); void webChannel(); + void noTransportWithoutWebChannel(); }; void tst_QWebEngineScript::domEditing() @@ -180,13 +181,17 @@ private: void tst_QWebEngineScript::webChannel_data() { QTest::addColumn("worldId"); - QTest::newRow("MainWorld") << static_cast(QWebEngineScript::MainWorld); - QTest::newRow("ApplicationWorld") << static_cast(QWebEngineScript::ApplicationWorld); + QTest::addColumn("reloadFirst"); + QTest::newRow("MainWorld") << static_cast(QWebEngineScript::MainWorld) << false; + QTest::newRow("ApplicationWorld") << static_cast(QWebEngineScript::ApplicationWorld) << false; + QTest::newRow("MainWorldWithReload") << static_cast(QWebEngineScript::MainWorld) << true; + QTest::newRow("ApplicationWorldWithReload") << static_cast(QWebEngineScript::ApplicationWorld) << true; } void tst_QWebEngineScript::webChannel() { QFETCH(int, worldId); + QFETCH(bool, reloadFirst); QWebEnginePage page; TestObject testObject; QScopedPointer channel(new QWebChannel(this)); @@ -205,6 +210,11 @@ void tst_QWebEngineScript::webChannel() page.scripts().insert(script); page.setHtml(QStringLiteral("")); waitForSignal(&page, SIGNAL(loadFinished(bool))); + if (reloadFirst) { + // Check that the transport is also reinstalled on navigation + page.triggerAction(QWebEnginePage::Reload); + waitForSignal(&page, SIGNAL(loadFinished(bool))); + } page.runJavaScript(QLatin1String( "new QWebChannel(qt.webChannelTransport," " function(channel) {" @@ -218,6 +228,17 @@ void tst_QWebEngineScript::webChannel() QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid)); } +void tst_QWebEngineScript::noTransportWithoutWebChannel() +{ + QWebEnginePage page; + page.setHtml(QStringLiteral("")); + + QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid)); + page.triggerAction(QWebEnginePage::Reload); + waitForSignal(&page, SIGNAL(loadFinished(bool))); + QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid)); +} + QTEST_MAIN(tst_QWebEngineScript) #include "tst_qwebenginescript.moc" -- cgit v1.2.3 From 31d568295a2d8dcfe12ff62348aa768c75d2dfe7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 13 Jun 2016 10:58:23 +0200 Subject: Add missing Q_DECL_OVERRIDE specifiers. Fixes warnings when building with clang. Task-number: QTBUG-51295 Change-Id: I4ede7e4ea5c1c3924b3bba852834b8066b539825 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebengineview_p.h | 4 ++-- src/webengine/api/qquickwebengineview_p_p.h | 2 +- src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index 93ef9e4fb..0654471cf 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -317,8 +317,8 @@ Q_SIGNALS: Q_REVISION(2) void windowCloseRequested(); protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); - void itemChange(ItemChange, const ItemChangeData &); + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QQuickWebEngineView) diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index c01603cff..9ac86aa5c 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -163,7 +163,7 @@ public: virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE; #endif // QT_NO_ACCESSIBILITY virtual QtWebEngineCore::WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE; - virtual void allowCertificateError(const QSharedPointer &errorController); + virtual void allowCertificateError(const QSharedPointer &errorController) Q_DECL_OVERRIDE; virtual void runGeolocationPermissionRequest(QUrl const&) Q_DECL_OVERRIDE; virtual void showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText) Q_DECL_OVERRIDE; virtual void hideValidationMessage() Q_DECL_OVERRIDE; diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h index fddc79c2f..bccfeb0f4 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h @@ -88,7 +88,7 @@ protected: void initializeGL() Q_DECL_OVERRIDE; void paintGL() Q_DECL_OVERRIDE; - QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; private slots: void onWindowPosChanged(); -- cgit v1.2.3 From 712dad5b9aa2d08ac29dec1bd380fdd08d9ffe3f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 14 Jun 2016 11:46:40 +0200 Subject: Expose WebEngineProfile.clearHttpCache() The method is documented to be available in the QML API, but hasn't been exposed so far. Change-Id: I6f2b8ae132dc10718f1b9181eefeef5c2f2eeed6 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebengineprofile.h | 2 +- src/webengine/plugin/plugins.qmltypes | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h index 9240132b2..dc5aa7df8 100644 --- a/src/webengine/api/qquickwebengineprofile.h +++ b/src/webengine/api/qquickwebengineprofile.h @@ -127,7 +127,7 @@ public: void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *); void removeAllUrlSchemeHandlers(); - void clearHttpCache(); + Q_REVISION(2) Q_INVOKABLE void clearHttpCache(); static QQuickWebEngineProfile *defaultProfile(); diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes index fa35b141e..23ba77235 100644 --- a/src/webengine/plugin/plugins.qmltypes +++ b/src/webengine/plugin/plugins.qmltypes @@ -225,6 +225,7 @@ Module { name: "downloadFinished" Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true } } + Method { name: "clearHttpCache"; revision: 2 } } Component { name: "QQuickWebEngineScript" -- cgit v1.2.3 From cf8bc1899abbce736a29841a10119fc0ca8b8b42 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 14 Jun 2016 12:46:23 +0200 Subject: Stop forwarding OS synthesized touch-to-mouse events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the change, chromium would process an onclick handler twice, once due to a touch event, and another time due to the OS synthesized mouse event. Patch makes sure only the touch events are forwarded to Chromium. This is consistent with mainline Chrome behavior. Task-number: QTBUG-53201 Change-Id: I16f46b94890c2f6fa9a9089f7c721ec79e0bc96b Reviewed-by: Kai Koehne Reviewed-by: Michael Brüning --- src/core/render_widget_host_view_qt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index cc0510666..5183f6732 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -878,6 +878,13 @@ bool RenderWidgetHostViewQt::IsPopup() const void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event) { + // Don't forward mouse events synthesized by the system, which are caused by genuine touch + // events. Chromium would then process for e.g. a mouse click handler twice, once due to the + // system synthesized mouse event, and another time due to a touch-to-gesture-to-mouse + // transformation done by Chromium. + if (event->source() == Qt::MouseEventSynthesizedBySystem) + return; + blink::WebMouseEvent webEvent = WebEventFactory::toWebMouseEvent(event, dpiScale()); if (event->type() == QMouseEvent::MouseButtonPress) { if (event->button() != m_clickHelper.lastPressButton -- cgit v1.2.3 From 818a2ce5dc773db55938968d5f6e7a2fd758f68a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Jun 2016 16:19:29 +0200 Subject: Fix translation of multiple pressed mouse buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were reporting any mouse button event where the left mouse button was held as a left mouse button event. We should instead separate the button changed and the ones held. Also adds test of the translation. Change-Id: I1139d6615d54a036dfe843fdb1d1c90b23b467b5 Reviewed-by: Alexandru Croitor Reviewed-by: Michael Brüning --- src/core/web_event_factory.cpp | 8 ++--- .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 36 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 2e6fde214..da230479a 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWebEngine module of the Qt Toolkit. @@ -483,11 +483,11 @@ static inline double currentTimeForEvent(const QInputEvent* event) static WebMouseEvent::Button mouseButtonForEvent(QMouseEvent *event) { - if (event->button() == Qt::LeftButton || (event->buttons() & Qt::LeftButton)) + if (event->button() == Qt::LeftButton) return WebMouseEvent::ButtonLeft; - else if (event->button() == Qt::RightButton || (event->buttons() & Qt::RightButton)) + else if (event->button() == Qt::RightButton) return WebMouseEvent::ButtonRight; - else if (event->button() == Qt::MidButton || (event->buttons() & Qt::MidButton)) + else if (event->button() == Qt::MidButton) return WebMouseEvent::ButtonMiddle; return WebMouseEvent::ButtonNone; } diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index f8012c1df..4cff50d3b 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -236,6 +236,7 @@ private Q_SLOTS: void toPlainTextLoadFinishedRace_data(); void toPlainTextLoadFinishedRace(); void setZoomFactor(); + void mouseButtonTranslation(); private: QWebEngineView* m_view; @@ -4990,5 +4991,40 @@ void tst_QWebEnginePage::setZoomFactor() delete page; } +void tst_QWebEnginePage::mouseButtonTranslation() +{ + QWebEngineView *view = new QWebEngineView; + + QSignalSpy spy(view, SIGNAL(loadFinished(bool))); + view->setHtml(QStringLiteral( + "\ + \ +
\ +
\ + ")); + view->show(); + QTest::qWaitForWindowExposed(view); + QTRY_VERIFY(spy.count() == 1); + + QVERIFY(view->focusProxy() != nullptr); + + QMouseEvent evpres(QEvent::MouseButtonPress, view->rect().center(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QGuiApplication::sendEvent(view->focusProxy(), &evpres); + + QTRY_COMPARE(evaluateJavaScriptSync(view->page(), "lastEvent.button").toInt(), 0); + QCOMPARE(evaluateJavaScriptSync(view->page(), "lastEvent.buttons").toInt(), 1); + + QMouseEvent evpres2(QEvent::MouseButtonPress, view->rect().center(), Qt::RightButton, Qt::LeftButton | Qt::RightButton, Qt::NoModifier); + QGuiApplication::sendEvent(view->focusProxy(), &evpres2); + + QTRY_COMPARE(evaluateJavaScriptSync(view->page(), "lastEvent.button").toInt(), 2); + QCOMPARE(evaluateJavaScriptSync(view->page(), "lastEvent.buttons").toInt(), 3); + + delete view; +} + QTEST_MAIN(tst_QWebEnginePage) #include "tst_qwebenginepage.moc" -- cgit v1.2.3 From 994dcd2ea2b13cdfae17b2d01ae8dfa0c58306f3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Jun 2016 16:58:41 +0200 Subject: Load the devtools resources as optional We separated the devtools resources so users might remove them if they do not need them. We should therefore avoid error messages when they are not present. Task-number: QTBUG-53879 Change-Id: I52321b7a04683a33ec4cfe8e389889f0ea721f70 Reviewed-by: Kai Koehne --- src/core/resource_bundle_qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp index 2a482c52d..fa5c04524 100644 --- a/src/core/resource_bundle_qt.cpp +++ b/src/core/resource_bundle_qt.cpp @@ -50,7 +50,7 @@ void ResourceBundle::LoadCommonResources() AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_PAK), SCALE_FACTOR_NONE); AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_100P_PAK), SCALE_FACTOR_100P); AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_200P_PAK), SCALE_FACTOR_200P); - AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_DEVTOOLS_PAK), SCALE_FACTOR_NONE); + AddOptionalDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_DEVTOOLS_PAK), SCALE_FACTOR_NONE); } gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) -- cgit v1.2.3 From 68028b6ea7812609dd7c91b96fa6595a89a049d2 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 14 Jun 2016 11:05:45 +0200 Subject: Fix license header in qwebenginesettings Change-Id: I77a9bdfb34dd01ae212d0f58cddaed4a7cf15917 Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/api/qwebenginesettings.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h index 0ba728c94..8eda50ee2 100644 --- a/src/webenginewidgets/api/qwebenginesettings.h +++ b/src/webenginewidgets/api/qwebenginesettings.h @@ -5,7 +5,7 @@ ** ** This file is part of the QtWebEngine module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,13 +14,24 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** -- cgit v1.2.3 From 60d790a2da2f85c1a5eaca4a51a743147e5694e7 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 15 Jun 2016 14:28:20 +0200 Subject: Doc: Make Chromium security fix information less specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New security fixes are added for new Qt 5.6.x versions. Change-Id: Ibf67bde7003b99d729fe8ac23b86c8ff46182ee6 Reviewed-by: Joerg Bornemann Reviewed-by: Michael Brüning --- src/webengine/doc/src/qtwebengine-overview.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index bf4e7a315..1fcae3dfa 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -104,8 +104,8 @@ \l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview} that is part of the documentation in the \l {Chromium Project} upstream source tree. - This version of Qt WebEngine is based on Chromium snapshot version 45.0.2554.101, with - additional security fixes from the 46, 47 and 48 branches of the \l {Chromium Project}. + This version of Qt WebEngine is based on Chromium version 45.0.2554.101, with + additional security fixes from newer versions. \section2 Qt WebEngine Process -- cgit v1.2.3 From 134b8e304f376e38d25f4d34de73e44fb31b2a70 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Jun 2016 16:27:03 +0200 Subject: Do not forward invalid mouse events to blink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blink can not handle more than the three main mouse-buttons, and we were translating a press of an extra mouse-button as a mouse-down of the button ButtonNone. Instead ignore mouse-button events blink does not currently support. Task-number: QTBUG-53799 Change-Id: If1d3ba6bd331ec8ad0ff45bcd674e67763ee9097 Reviewed-by: Michael Brüning --- src/core/render_widget_host_view_qt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 5183f6732..c088b09e9 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -886,6 +886,13 @@ void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event) return; blink::WebMouseEvent webEvent = WebEventFactory::toWebMouseEvent(event, dpiScale()); + if ((webEvent.type == blink::WebInputEvent::MouseDown || webEvent.type == blink::WebInputEvent::MouseUp) + && webEvent.button == blink::WebMouseEvent::ButtonNone) { + // Blink can only handle the 3 main mouse-buttons and may assert when processing mouse-down for no button. + return; + } + + if (event->type() == QMouseEvent::MouseButtonPress) { if (event->button() != m_clickHelper.lastPressButton || (event->timestamp() - m_clickHelper.lastPressTimestamp > static_cast(qGuiApp->styleHints()->mouseDoubleClickInterval())) -- cgit v1.2.3 From 6a658bb9779f995d9b06bf769f920773fd9b6b8a Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Wed, 15 Jun 2016 08:39:04 +0800 Subject: Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" See http://comments.gmane.org/gmane.comp.lib.qt.devel/25771 Change-Id: I17d14f31f608d0665c04598f7899238b86113ae5 Reviewed-by: Allan Sandfeld Jensen --- LICENSE.GPLv2 | 2 +- LICENSE.GPLv3 | 2 +- LICENSE.LGPLv3 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.GPLv2 b/LICENSE.GPLv2 index 6dbb032fd..a42447778 100644 --- a/LICENSE.GPLv2 +++ b/LICENSE.GPLv2 @@ -3,7 +3,7 @@ The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd. Contact: http://www.qt.io/licensing/ - You may use, distribute and copy the Qt GUI Toolkit under the terms of + You may use, distribute and copy the Qt Toolkit under the terms of GNU General Public License version 2, which is displayed below. ------------------------------------------------------------------------- diff --git a/LICENSE.GPLv3 b/LICENSE.GPLv3 index 4e49b122a..71c4ad49c 100644 --- a/LICENSE.GPLv3 +++ b/LICENSE.GPLv3 @@ -3,7 +3,7 @@ The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd. Contact: http://www.qt.io/licensing/ - You may use, distribute and copy the Qt GUI Toolkit under the terms of + You may use, distribute and copy the Qt Toolkit under the terms of GNU Lesser General Public License version 3. That license references the General Public License version 3, that is displayed below. Other portions of the Qt Toolkit may be licensed directly under this license. diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3 index 26d0bf16f..1f78e0508 100644 --- a/LICENSE.LGPLv3 +++ b/LICENSE.LGPLv3 @@ -3,7 +3,7 @@ The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd. Contact: http://www.qt.io/licensing/ - You may use, distribute and copy the Qt GUI Toolkit under the terms of + You may use, distribute and copy the Qt Toolkit under the terms of GNU Lesser General Public License version 3, which is displayed below. This license makes reference to the version 3 of the GNU General Public License, which you can find in the LICENSE.GPLv3 file. -- cgit v1.2.3 From ed581090eaf6f6d683fc70852b3b1c573e4f6aaf Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 8 Jun 2016 14:15:17 +0200 Subject: Follow hotspot hints in custom cursors We shouldn't ignore defined hotspots for cursors we adapt from pixmaps. Change-Id: Ia9c1e29e6374116d4564b306d0e199baaf5d494f Reviewed-by: Joerg Bornemann --- src/core/render_widget_host_view_qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index c088b09e9..a0dcb8197 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -540,7 +540,7 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor) case blink::WebCursorInfo::TypeCustom: if (cursorInfo.custom_image.colorType() == SkColorType::kN32_SkColorType) { QImage cursor = toQImage(cursorInfo.custom_image, QImage::Format_ARGB32); - m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor))); + m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor), cursorInfo.hotspot.x(), cursorInfo.hotspot.y())); return; } // Use arrow cursor as fallback in case the Chromium implementation changes. -- cgit v1.2.3 From df6d3709a442591b286ceb47a3fd984a16da5d8b Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 14 Jun 2016 11:49:26 +0200 Subject: Doc: Add canceling authentication to porting instructions It has changed from how it was done in Qt WebKit. The following sentence needs to be changed, because "this" no longer refers to the correct thing. Task-number: QTBUG-53849 Change-Id: I11be382c92a4ab729585d334a4f3c0abe46bb3e4 Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc index 96b33c9ca..c21a58d73 100644 --- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc +++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc @@ -207,7 +207,15 @@ connect(&page, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticate(QNetworkReply*,QAuthenticator*))); \endcode - This also affects the way in which certificates are managed. For more information, see + \note In Qt WebEngine, the QAuthenticator must be explicitly set to null to + cancel authentication: + + \code + *authenticator = QAuthenticator(); + \endcode + + Omitting the \c QNetworkAccessManager also affects the way in which + certificates are managed. For more information, see \l {Managing Certificates}. \section1 Notes About Individual Methods -- cgit v1.2.3 From 57f826abff6155c017f76eba1958979a2bc143a4 Mon Sep 17 00:00:00 2001 From: Adam Kallai Date: Thu, 28 Apr 2016 12:04:10 +0200 Subject: Add QML test for scrollPosition Change-Id: Ia7541befb43d2b6fdd09b13ca51fc7d09b955964 Reviewed-by: Peter Varga --- .../auto/quick/qmltests/data/TestWebEngineView.qml | 2 +- tests/auto/quick/qmltests/data/test4.html | 11 +++ .../quick/qmltests/data/tst_scrollPosition.qml | 81 ++++++++++++++++++++++ tests/auto/quick/qmltests/qmltests.pro | 1 + 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 tests/auto/quick/qmltests/data/tst_scrollPosition.qml diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml index 34fc5fb2f..0d2a34645 100644 --- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml +++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml @@ -28,7 +28,7 @@ import QtQuick 2.0 import QtTest 1.0 -import QtWebEngine 1.2 +import QtWebEngine 1.3 WebEngineView { property var loadStatus: null diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html index 8f75af606..142b53668 100644 --- a/tests/auto/quick/qmltests/data/test4.html +++ b/tests/auto/quick/qmltests/data/test4.html @@ -12,6 +12,17 @@ +

+ +
bla00
bla01
diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml new file mode 100644 index 000000000..08bb0f3b4 --- /dev/null +++ b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.0 +import QtWebEngine 1.3 + +TestWebEngineView { + id: webEngineView + width: 300 + height: 400 + + property var testUrl: Qt.resolvedUrl("test4.html") + + SignalSpy { + id: scrollPositionSpy + target: webEngineView + signalName: "onScrollPositionChanged" + } + + TestCase { + name: "ScrollPosition" + when: windowShown + + function init() { + webEngineView.url = Qt.resolvedUrl("about:blank"); + verify(webEngineView.waitForLoadSucceeded()); + } + + function test_scrollPosition() { + webEngineView.url = testUrl; + verify(webEngineView.waitForLoadSucceeded()); + + keyPress(Qt.Key_Return); // Focus is on the scroll button. + + tryCompare(scrollPositionSpy, "count", 1); + compare(webEngineView.scrollPosition.x, 0); + compare(webEngineView.scrollPosition.y, 600); + } + + function test_scrollPositionAfterReload() { + webEngineView.url = testUrl; + verify(webEngineView.waitForLoadSucceeded()); + tryCompare(webEngineView.scrollPosition, "y", 0); + + keyPress(Qt.Key_Return); // Focus is on the scroll button. + scrollPositionSpy.wait(); + + webEngineView.reload(); + verify(webEngineView.waitForLoadSucceeded()); + + tryCompare(webEngineView.scrollPosition, "x", 0); + tryCompare(webEngineView.scrollPosition, "y", 600); + } + } +} diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 64f7414ce..0158a7268 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -59,6 +59,7 @@ OTHER_FILES += \ $$PWD/data/tst_navigationRequested.qml \ $$PWD/data/tst_properties.qml \ $$PWD/data/tst_runJavaScript.qml \ + $$PWD/data/tst_scrollPosition.qml \ $$PWD/data/tst_titleChanged.qml \ $$PWD/data/tst_unhandledKeyEventPropagation.qml \ $$PWD/data/tst_userScripts.qml \ -- cgit v1.2.3 From aaa91ea2551f7df5ff9023c8fa7743e76070bac9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 8 Jun 2016 14:03:43 +0200 Subject: Support WebCursors Qt doesn't have cursor types for Use Chromium's Aura cursors when we don't have Qt equivalents. These cursors were also supported in QtWebKit. Note this depends on Aura being used, which means OS X still doesn't have the new cursors. Task-number: QTBUG-53593 Change-Id: I9fbbf102dd313da5a6836069b4d7ece057d8c946 Reviewed-by: Alexandru Croitor Reviewed-by: Joerg Bornemann --- src/core/render_widget_host_view_qt.cpp | 55 +++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index a0dcb8197..220761ef3 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -68,6 +68,10 @@ #include "ui/events/gesture_detection/motion_event.h" #include "ui/gfx/geometry/size_conversions.h" +#if defined(USE_AURA) +#include "ui/base/cursor/cursors_aura.h" +#endif + #include #include #include @@ -455,7 +459,10 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor) { content::WebCursor::CursorInfo cursorInfo; webCursor.GetCursorInfo(&cursorInfo); - Qt::CursorShape shape; + Qt::CursorShape shape = Qt::ArrowCursor; +#if defined(USE_AURA) + int auraType = -1; +#endif switch (cursorInfo.type) { case blink::WebCursorInfo::TypePointer: shape = Qt::ArrowCursor; @@ -513,17 +520,42 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor) case blink::WebCursorInfo::TypeMove: shape = Qt::SizeAllCursor; break; + case blink::WebCursorInfo::TypeProgress: + shape = Qt::BusyCursor; + break; +#if defined(USE_AURA) case blink::WebCursorInfo::TypeVerticalText: + auraType = ui::kCursorVerticalText; + break; case blink::WebCursorInfo::TypeCell: + auraType = ui::kCursorCell; + break; case blink::WebCursorInfo::TypeContextMenu: + auraType = ui::kCursorContextMenu; + break; case blink::WebCursorInfo::TypeAlias: - case blink::WebCursorInfo::TypeProgress: + auraType = ui::kCursorAlias; + break; case blink::WebCursorInfo::TypeCopy: + auraType = ui::kCursorCopy; + break; case blink::WebCursorInfo::TypeZoomIn: + auraType = ui::kCursorZoomIn; + break; case blink::WebCursorInfo::TypeZoomOut: - // FIXME: Load from the resource bundle. - shape = Qt::ArrowCursor; + auraType = ui::kCursorZoomOut; + break; +#else + case blink::WebCursorInfo::TypeVerticalText: + case blink::WebCursorInfo::TypeCell: + case blink::WebCursorInfo::TypeContextMenu: + case blink::WebCursorInfo::TypeAlias: + case blink::WebCursorInfo::TypeCopy: + case blink::WebCursorInfo::TypeZoomIn: + case blink::WebCursorInfo::TypeZoomOut: + // FIXME: Support on OS X break; +#endif case blink::WebCursorInfo::TypeNoDrop: case blink::WebCursorInfo::TypeNotAllowed: shape = Qt::ForbiddenCursor; @@ -543,13 +575,18 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor) m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor), cursorInfo.hotspot.x(), cursorInfo.hotspot.y())); return; } - // Use arrow cursor as fallback in case the Chromium implementation changes. - shape = Qt::ArrowCursor; break; - default: - Q_UNREACHABLE(); - shape = Qt::ArrowCursor; } +#if defined(USE_AURA) + if (auraType > 0) { + SkBitmap bitmap; + gfx::Point hotspot; + if (ui::GetCursorBitmap(auraType, &bitmap, &hotspot)) { + m_delegate->updateCursor(QCursor(QPixmap::fromImage(toQImage(bitmap)), hotspot.x(), hotspot.y())); + return; + } + } +#endif m_delegate->updateCursor(QCursor(shape)); } -- cgit v1.2.3 From d5cde6f1b4f7a8a2cfd4a9dbdf63cd2e2502c000 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 15 Jun 2016 10:42:05 +0200 Subject: Fix access to deleted memory on QWebEnginePage destruction Suppose QWebEnginePage is destroyed while there's still a combobox popup open. We would crash with the following stack trace: 1 QtWebEngineCore::RenderWidgetHostViewQt::dpiScale 2 QtWebEngineCore::RenderWidgetHostViewQt::GetViewBounds 3 content::RenderWidgetHostImpl::SendScreenRects 4 content::RenderWidgetHostImpl::OnRenderViewReady ... 16 base::MessageLoop::DoWork 17 WebEngineContext::destroy 18 `anonymous namespace'::destroyContext 19 qt_call_post_routines 20 QApplication::~QApplication RenderWidgetHostViewQt still holds a pointer to WebContentsAdapterClient. To fix this, expose the QObject owning the adapter client, and hide RenderWidgetHostViewQt when it is destroyed so it won't try to render. Change-Id: Ide5543197b35038a3e1c7491ceda3f5ad10f6f07 Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 5 +++++ src/core/render_widget_host_view_qt.h | 1 + src/core/web_contents_adapter_client.h | 1 + src/webengine/api/qquickwebengineview.cpp | 6 ++++++ src/webengine/api/qquickwebengineview_p_p.h | 1 + src/webenginewidgets/api/qwebenginepage.cpp | 6 ++++++ src/webenginewidgets/api/qwebenginepage_p.h | 1 + 7 files changed, 21 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 220761ef3..24b148ca5 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -273,6 +273,7 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget RenderWidgetHostViewQt::~RenderWidgetHostViewQt() { + QObject::disconnect(m_adapterClientDestroyedConnection); #ifndef QT_NO_ACCESSIBILITY QAccessible::removeActivationObserver(this); #endif // QT_NO_ACCESSIBILITY @@ -288,6 +289,10 @@ void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterC Q_ASSERT(!m_adapterClient); m_adapterClient = adapterClient; + QObject::disconnect(m_adapterClientDestroyedConnection); + m_adapterClientDestroyedConnection = QObject::connect(adapterClient->holdingQObject(), + &QObject::destroyed, [this] { + m_adapterClient = nullptr; }); if (m_initPending) InitAsChild(0); } diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 2a56f61a4..2e6563a67 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -226,6 +226,7 @@ private: bool m_didFirstVisuallyNonEmptyLayout; uint32 m_pendingOutputSurfaceId; + QMetaObject::Connection m_adapterClientDestroyedConnection; WebContentsAdapterClient *m_adapterClient; MultipleMouseClickHelper m_clickHelper; diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index e6d25a8fb..f0927c9e5 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -240,6 +240,7 @@ public: virtual void requestGeometryChange(const QRect &geometry) = 0; virtual void allowCertificateError(const QSharedPointer &errorController) = 0; virtual bool isEnabled() const = 0; + virtual const QObject *holdingQObject() const = 0; virtual QSharedPointer browserContextAdapter() = 0; diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index f0458b869..357f95bc4 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -628,6 +628,12 @@ WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const return m_settings->d_ptr.data(); } +const QObject *QQuickWebEngineViewPrivate::holdingQObject() const +{ + Q_Q(const QQuickWebEngineView); + return q; +} + void QQuickWebEngineViewPrivate::setDevicePixelRatio(qreal devicePixelRatio) { Q_Q(QQuickWebEngineView); diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index 9ac86aa5c..2a6c2c879 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -172,6 +172,7 @@ public: int exitCode) Q_DECL_OVERRIDE; virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE { Q_UNUSED(geometry); } virtual bool isEnabled() const Q_DECL_OVERRIDE; + const QObject *holdingQObject() const Q_DECL_OVERRIDE; virtual QSharedPointer browserContextAdapter() Q_DECL_OVERRIDE; diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 2fd026682..0279c9343 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -440,6 +440,12 @@ QSharedPointer QWebEnginePagePrivate::browserContextAdapt return profile->d_ptr->browserContext(); } +const QObject *QWebEnginePagePrivate::holdingQObject() const +{ + Q_Q(const QWebEnginePage); + return q; +} + QWebEnginePage::QWebEnginePage(QObject* parent) : QObject(parent) , d_ptr(new QWebEnginePagePrivate()) diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 8e5be51d0..7b16ed667 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -125,6 +125,7 @@ public: int exitCode) Q_DECL_OVERRIDE; virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE; virtual bool isEnabled() const Q_DECL_OVERRIDE; + const QObject *holdingQObject() const Q_DECL_OVERRIDE; virtual QSharedPointer browserContextAdapter() Q_DECL_OVERRIDE; -- cgit v1.2.3 From 925711f5f9b02392a58244e51ba7f9ea3f192b62 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 16 Jun 2016 10:34:26 +0200 Subject: Translate audio/video capture permission MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Complete the translation for the permission types we support, but assert against media capture permission request coming in via the permission manager so we can catch if Chromium changes how they are handled. Change-Id: Ia56ebe38fd163f724de7c564c3e6098717903dfb Reviewed-by: Michael Brüning --- src/core/permission_manager_qt.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp index 36ce476cd..9603dc94c 100644 --- a/src/core/permission_manager_qt.cpp +++ b/src/core/permission_manager_qt.cpp @@ -55,14 +55,16 @@ BrowserContextAdapter::PermissionType toQt(content::PermissionType type) switch (type) { case content::PermissionType::GEOLOCATION: return BrowserContextAdapter::GeolocationPermission; + case content::PermissionType::AUDIO_CAPTURE: + return BrowserContextAdapter::AudioCapturePermission; + case content::PermissionType::VIDEO_CAPTURE: + return BrowserContextAdapter::VideoCapturePermission; case content::PermissionType::NOTIFICATIONS: case content::PermissionType::MIDI_SYSEX: case content::PermissionType::PUSH_MESSAGING: case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: case content::PermissionType::MIDI: case content::PermissionType::DURABLE_STORAGE: - case content::PermissionType::AUDIO_CAPTURE: - case content::PermissionType::VIDEO_CAPTURE: case content::PermissionType::NUM: break; } @@ -117,6 +119,9 @@ int PermissionManagerQt::RequestPermission(content::PermissionType permission, callback.Run(content::PERMISSION_STATUS_DENIED); return kNoPendingOperation; } + // Audio and video-capture should not come this way currently + Q_ASSERT(permissionType != BrowserContextAdapter::AudioCapturePermission + && permissionType != BrowserContextAdapter::VideoCapturePermission); content::WebContents *webContents = frameHost->GetRenderViewHost()->GetDelegate()->GetAsWebContents(); WebContentsDelegateQt* contentsDelegate = static_cast(webContents->GetDelegate()); -- cgit v1.2.3 From 92a28473afb97ee50332f6fe81960c7241ca82d5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 16 Jun 2016 11:34:07 +0200 Subject: Stabilize FilePicker QML autotests Switch from timed wait to using tryCompare. Task-number: QTBUG-53777 Change-Id: I845fb8ee7b84641bd23314794512960634423d54 Reviewed-by: Joerg Bornemann --- tests/auto/quick/qmltests/data/tst_filePicker.qml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml index 02b2dd024..f9c50c4e8 100644 --- a/tests/auto/quick/qmltests/data/tst_filePicker.qml +++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml @@ -81,10 +81,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test1.html")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) // The ui delegate is invoked asynchronously - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "test1.html") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "test1.html") } function test_acceptMultipleFilesSelection() { @@ -96,10 +94,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test2.html")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "test1.html,test2.html") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "test1.html,test2.html") } function test_acceptDirectory() { @@ -110,10 +106,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) // The ui delegate is invoked asynchronously - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "data") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "data") } function test_reject() { -- cgit v1.2.3 From 528088cb61eaacb63e87ea8e06f59d1536e43799 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 8 Jun 2016 14:44:15 +0200 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pulls in the PDB location fix, an updated libjpeg_turbo and the backport of a crash fix. Task-number: QTBUG-52938 Task-number: QTBUG-53800 Task-number: QTBUG-54023 Change-Id: Ic773b082d26825758e8986e8d77f8f5bc7b80f83 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index dc08e3972..d0dbe5636 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit dc08e3972d36a63dd477de0de005b3e81a5674d9 +Subproject commit d0dbe5636cb9d424db0c7ee7850c97d578150138 -- cgit v1.2.3 From 42623ee69c62372afad8c11135f44bb4f6bc0cfd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 17 Jun 2016 11:27:24 +0200 Subject: fix logical mismerge from 5.6 iphonesimulator_and_iphoneos was renamed to simulator_and_device in 5.7. Change-Id: I0be78eb67b9f9867548108235eb180874f66cb95 Reviewed-by: Allan Sandfeld Jensen --- src/core/api/core_api.pro | 2 +- src/core/gyp_run.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro index a9f5adaba..6e2d606b2 100644 --- a/src/core/api/core_api.pro +++ b/src/core/api/core_api.pro @@ -15,7 +15,7 @@ CONFIG -= create_prl # Copy this logic from qt_module.prf so that the intermediate library can be # created to the same rules as the final module linking in core_module.pro. !host_build:if(win32|mac):!macx-xcode { - contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos + contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release contains(QT_CONFIG, build_all):CONFIG += build_all } diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index 35b85b4c7..a1b33e258 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -34,7 +34,7 @@ force_debug_info { # Copy this logic from qt_module.prf so that ninja can run according # to the same rules as the final module linking in core_module.pro. !host_build:if(win32|mac):!macx-xcode { - contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos + contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release contains(QT_CONFIG, build_all):CONFIG += build_all } -- cgit v1.2.3 From e91f09947b55dda8a13b2aeb0963836dee2ece8d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 22 Apr 2016 21:02:27 +0200 Subject: make use of COPIES Change-Id: I440ead04e386362593d50c491508676bb5d0ff64 Reviewed-by: Joerg Bornemann --- src/core/core_module.pro | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 702b92441..20b719547 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -89,29 +89,10 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat # !use?(system_icu) { - icudt2build.input = icu.files - icudt2build.output = $$[QT_INSTALL_DATA/get]/resources/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} - icudt2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} - icudt2build.name = COPY ${QMAKE_FILE_IN} - icudt2build.CONFIG = no_link no_clean target_predeps - QMAKE_EXTRA_COMPILERS += icudt2build + COPIES += icu } - resources2build.input = resources.files - resources2build.output = $$[QT_INSTALL_DATA/get]/resources/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} - resources2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} - resources2build.name = COPY ${QMAKE_FILE_IN} - resources2build.CONFIG = no_link no_clean target_predeps - - QMAKE_EXTRA_COMPILERS += resources2build - - locales2build.input = locales.files - locales2build.output = $$[QT_INSTALL_DATA/get]/translations/qtwebengine_locales/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} - locales2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} - locales2build.name = COPY ${QMAKE_FILE_IN} - locales2build.CONFIG = no_link no_clean target_predeps - - QMAKE_EXTRA_COMPILERS += locales2build + COPIES += resources locales } } -- cgit v1.2.3