diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-06 12:19:11 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-06 12:19:11 +0200 |
commit | 7439343d169095a510d122ad7c69646a5946cdce (patch) | |
tree | 8540b2bac1e495533585a645e216eaab66b06bd2 | |
parent | 3ecd61aea90cc4b283ffe9409cc10f5fd3476ecf (diff) | |
parent | f8c132ffb7cd32d52bbfe09caa811665a3cb1069 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/3rdparty
src/webengine/api/qquickwebenginesettings.cpp
Change-Id: Ie4abadb076c51d070cbb05f29b9ebcd9705933ad
-rw-r--r-- | src/core/gyp_run.pro | 2 | ||||
-rw-r--r-- | src/core/renderer_host/resource_dispatcher_host_delegate_qt.h | 2 | ||||
-rw-r--r-- | src/core/web_engine_settings.cpp | 1 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginedownloaditem.cpp | 6 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 10 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginesettings.cpp | 2 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 6 | ||||
-rw-r--r-- | src/webengine/api/qtwebengineglobal.cpp | 2 | ||||
-rw-r--r-- | src/webengine/render_widget_host_view_qt_delegate_quick.cpp | 14 | ||||
-rw-r--r-- | src/webengine/render_widget_host_view_qt_delegate_quick.h | 1 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginecontextmenudata.h | 2 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginefullscreenrequest.h | 6 | ||||
-rw-r--r-- | tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp | 11 | ||||
-rw-r--r-- | tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 3 |
14 files changed, 43 insertions, 25 deletions
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index 9f2a44d7b..89b751c4a 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -79,7 +79,7 @@ contains(QT_ARCH, "arm") { # If the toolchain does not explicitly specify to use NEON instructions # we use arm_neon_optional for ARMv7 and newer and let chromium decide # about the mfpu option. - contains(MFPU, "neon")|contains(MFPU, "neon-vfpv4"): GYP_CONFIG += arm_fpu=\"$$MFPU\" arm_neon=1 + contains(MFPU, ".*neon.*"): GYP_CONFIG += arm_fpu=\"$$MFPU\" arm_neon=1 else:!lessThan(MARMV, 7): GYP_CONFIG += arm_neon=0 arm_neon_optional=1 else: GYP_CONFIG += arm_fpu=\"$$MFPU\" arm_neon=0 arm_neon_optional=0 } else { diff --git a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h index a8a65cfb7..6690f9a0f 100644 --- a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h +++ b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h @@ -76,7 +76,7 @@ private: int m_renderProcessId; int m_renderFrameId; - net::AuthChallengeInfo *m_authInfo; + scoped_refptr<net::AuthChallengeInfo> m_authInfo; // The request that wants login data. // Must only be accessed on the IO thread. diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index 8e284c9d6..c17177745 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -306,6 +306,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p prefs->javascript_can_access_clipboard = testAttribute(JavascriptCanAccessClipboard); prefs->tabs_to_links = testAttribute(LinksIncludedInFocusChain); prefs->local_storage_enabled = testAttribute(LocalStorageEnabled); + prefs->databases_enabled = testAttribute(LocalStorageEnabled); prefs->allow_universal_access_from_file_urls = testAttribute(LocalContentCanAccessRemoteUrls); prefs->xss_auditor_enabled = testAttribute(XSSAuditingEnabled); prefs->spatial_navigation_enabled = testAttribute(SpatialNavigationEnabled); diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp index 447937592..8bf319b85 100644 --- a/src/webengine/api/qquickwebenginedownloaditem.cpp +++ b/src/webengine/api/qquickwebenginedownloaditem.cpp @@ -163,7 +163,7 @@ void QQuickWebEngineDownloadItem::cancel() } /*! - \qmlproperty quint32 WebEngineDownloadItem::id + \qmlproperty int WebEngineDownloadItem::id Holds the download item's ID. */ @@ -222,7 +222,7 @@ qint64 QQuickWebEngineDownloadItem::receivedBytes() const } /*! - \qmlproperty QString WebEngineDownloadItem::mimeType + \qmlproperty string WebEngineDownloadItem::mimeType \since QtWebEngine 1.2 Holds the MIME type of the download. @@ -235,7 +235,7 @@ QString QQuickWebEngineDownloadItem::mimeType() const } /*! - \qmlproperty QString WebEngineDownloadItem::path + \qmlproperty string WebEngineDownloadItem::path Holds the full target path where data is being downloaded to. diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 32161570d..1ca97adea 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -288,7 +288,7 @@ QQuickWebEngineProfile::~QQuickWebEngineProfile() } /*! - \qmlproperty QString WebEngineProfile::storageName + \qmlproperty string WebEngineProfile::storageName The storage name that is used to create separate subdirectories for each profile that uses the disk for storing persistent data and cache. @@ -367,7 +367,7 @@ void QQuickWebEngineProfile::setOffTheRecord(bool offTheRecord) } /*! - \qmlproperty QString WebEngineProfile::persistentStoragePath + \qmlproperty string WebEngineProfile::persistentStoragePath The path to the location where the persistent data for the browser and web content are stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links. @@ -404,7 +404,7 @@ void QQuickWebEngineProfile::setPersistentStoragePath(const QString &path) } /*! - \qmlproperty QString WebEngineProfile::cachePath + \qmlproperty string WebEngineProfile::cachePath The path to the location where the profile's caches are stored, in particular the HTTP cache. @@ -439,7 +439,7 @@ void QQuickWebEngineProfile::setCachePath(const QString &path) } /*! - \qmlproperty QString WebEngineProfile::httpUserAgent + \qmlproperty string WebEngineProfile::httpUserAgent The user-agent string sent with HTTP to identify the browser. */ @@ -574,7 +574,7 @@ void QQuickWebEngineProfile::setHttpCacheMaximumSize(int maximumSize) } /*! - \qmlproperty QString WebEngineProfile::httpAcceptLanguage + \qmlproperty string WebEngineProfile::httpAcceptLanguage The value of the Accept-Language HTTP request-header field. diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 56634392c..09bf2708e 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -347,7 +347,7 @@ bool QQuickWebEngineSettings::allowRunningInsecureContent() const } /*! - \qmlproperty QString WebEngineSettings::defaultTextEncoding + \qmlproperty string WebEngineSettings::defaultTextEncoding \since QtWebEngine 1.2 Sets the default encoding. The value must be a string describing an encoding such as "utf-8" or diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 64f7fb5be..61f940f15 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -826,8 +826,10 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent // This throws away the WebContentsAdapter that has been used until now. // All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter. - WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis()); - adapterOwner->deleteLater(); + if (adapter) { + WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis()); + adapterOwner->deleteLater(); + } adapter = webContents->sharedFromThis(); adapter->initialize(this); diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp index 801052782..a242fc6aa 100644 --- a/src/webengine/api/qtwebengineglobal.cpp +++ b/src/webengine/api/qtwebengineglobal.cpp @@ -62,7 +62,7 @@ namespace QtWebEngine { /*! \fn QtWebEngine::initialize() - Sets up an OpenGL Context that can be shared between processes. This has to be done after + Sets up an OpenGL Context that can be shared between threads. This has to be done after QGuiApplication is created, but before a Qt Quick window is created. This has the same effect as setting the Qt::AA_ShareOpenGLContexts diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index 68b097d4a..f79b0ca22 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -343,6 +343,16 @@ void RenderWidgetHostViewQtDelegateQuick::inputMethodEvent(QInputMethodEvent *ev void RenderWidgetHostViewQtDelegateQuick::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { QQuickItem::geometryChanged(newGeometry, oldGeometry); + + if (window()) { + // TODO(pvarga): Use QQuickItem::mapToGlobal from Qt 5.7 + const QPoint globalPos = window()->mapToGlobal(position().toPoint()); + if (globalPos != m_lastGlobalPos) { + m_lastGlobalPos = globalPos; + m_client->windowBoundsChanged(); + } + } + m_client->notifyResize(); } @@ -375,6 +385,10 @@ QSGNode *RenderWidgetHostViewQtDelegateQuick::updatePaintNode(QSGNode *oldNode, void RenderWidgetHostViewQtDelegateQuick::onWindowPosChanged() { + if (window()) { + // TODO(pvarga): Use QQuickItem::mapToGlobal from Qt 5.7 + m_lastGlobalPos = window()->mapToGlobal(position().toPoint()); + } m_client->windowBoundsChanged(); } diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h index de3aff291..385a98a3c 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h @@ -104,6 +104,7 @@ private: QList<QMetaObject::Connection> m_windowConnections; bool m_isPopup; bool m_initialized; + QPoint m_lastGlobalPos; }; } // namespace QtWebEngineCore diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.h b/src/webenginewidgets/api/qwebenginecontextmenudata.h index 1a2ff8de4..97cfe9f65 100644 --- a/src/webenginewidgets/api/qwebenginecontextmenudata.h +++ b/src/webenginewidgets/api/qwebenginecontextmenudata.h @@ -40,7 +40,7 @@ #ifndef QWEBENGINECONTEXTDATA_H #define QWEBENGINECONTEXTDATA_H -#include <qtwebenginewidgetsglobal.h> +#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h> #include <QtCore/qpoint.h> #include <QtCore/qstring.h> #include <QtCore/qurl.h> diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.h b/src/webenginewidgets/api/qwebenginefullscreenrequest.h index 138a76e08..e5f2b7b19 100644 --- a/src/webenginewidgets/api/qwebenginefullscreenrequest.h +++ b/src/webenginewidgets/api/qwebenginefullscreenrequest.h @@ -40,9 +40,9 @@ #ifndef QWEBENGINEFULLSCREENREQUEST_H #define QWEBENGINEFULLSCREENREQUEST_H -#include <qtwebenginewidgetsglobal.h> -#include <qurl.h> -#include <qpointer.h> +#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h> +#include <QtCore/qurl.h> +#include <QtCore/qpointer.h> QT_BEGIN_NAMESPACE class QWebEnginePage; diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 904dfac26..2d68fd744 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -250,9 +250,8 @@ void tst_QQuickWebEngineView::loadProgress() QSignalSpy loadProgressChangedSpy(webEngineView(), SIGNAL(loadProgressChanged())); QVERIFY(waitForLoadSucceeded(webEngineView())); - QVERIFY(loadProgressChangedSpy.count() >= 1); - - QCOMPARE(webEngineView()->loadProgress(), 100); + loadProgressChangedSpy.wait(); + QTRY_COMPARE(webEngineView()->loadProgress(), 100); } void tst_QQuickWebEngineView::show() @@ -507,8 +506,7 @@ void tst_QQuickWebEngineView::printToPdf() QString path = tempDir.path() + "/print_success.pdf"; view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); - QTest::qWait(500); - QVERIFY(QFile::exists(path)); + QTRY_VERIFY(QFile::exists(path)); #if !defined(Q_OS_WIN) path = tempDir.path() + "/print_//fail.pdf"; @@ -516,8 +514,7 @@ void tst_QQuickWebEngineView::printToPdf() path = tempDir.path() + "/print_|fail.pdf"; #endif // #if !defined(Q_OS_WIN) view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); - QTest::qWait(500); - QVERIFY(!QFile::exists(path)); + QTRY_VERIFY(!QFile::exists(path)); } void tst_QQuickWebEngineView::stopSettingFocusWhenDisabled() diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index f7c0914bc..166c5a499 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -2823,6 +2823,9 @@ void tst_QWebEnginePage::testJSPrompt() { JSPromptPage page; bool res; + QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); + page.setHtml(QStringLiteral("<html><body></body></html>")); + QTRY_COMPARE(loadSpy.count(), 1); // OK + QString() res = evaluateJavaScriptSync(&page, |