From e4d555219bb95732280eb42fb1e8d77da4ab8b96 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 27 Jun 2016 13:41:02 +0200 Subject: Stop linking both debug and release libraries at the same time. Change-Id: Ide3a8adc320b38a399514c0115bd8e24c37af63d Reviewed-by: Joerg Bornemann --- src/core/core_module.pro | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 62ef71eab..559fbe484 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -114,6 +114,13 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat } } +!win32:!build_pass:debug_and_release { + # Special GNU make target that ensures linking isn't done for both debug and release builds + # at the same time. + notParallel.target = .NOTPARALLEL + QMAKE_EXTRA_TARGETS += notParallel +} + OTHER_FILES = \ $$files(../3rdparty/chromium/*.h, true) \ $$files(../3rdparty/chromium/*.cc, true) \ -- cgit v1.2.1 From 85465e18ec12bc57008ca7e724f6d0928274c93d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 27 Jun 2016 14:45:54 +0200 Subject: Remove handling of DIR_MEDIA_LIBS DIR_MEDIA_LIBS was where ffmpegsumo was before 5.6 which removed it. When we don't have the library it used to be in, we return the fallback path, which by OverridePath will be created if it doesn't exits. DIR_MEDIA_LIBS is not used anywhere by Chromium anymore, so remove the code. Task-number: QTBUG-54258 Change-Id: I1015bd3549c617916c06b633ba3e483ef855ff84 Reviewed-by: Joerg Bornemann --- src/core/content_main_delegate_qt.cpp | 1 - src/core/web_engine_library_info.cpp | 29 ----------------------------- 2 files changed, 30 deletions(-) (limited to 'src') diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index e142436bc..709246210 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -115,7 +115,6 @@ bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code) #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE PathService::Override(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA)); #endif - PathService::Override(content::DIR_MEDIA_LIBS, WebEngineLibraryInfo::getPath(content::DIR_MEDIA_LIBS)); PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES)); SetContentClient(new ContentClientQt); diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index cfe5556de..c38fa6eb5 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -151,33 +151,6 @@ QString subProcessPath() return processPath; } -QString pluginsPath() -{ -#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - static QString pluginsPath = getPath(frameworkBundle()) % QLatin1String("/Libraries"); -#else - static bool initialized = false; - static QString pluginsPath; - - if (!initialized) { - initialized = true; - const QStringList directories = QCoreApplication::libraryPaths(); - Q_FOREACH (const QString &dir, directories) { - const QString candidate = dir % "/" % QLatin1String("qtwebengine"); - if (QFileInfo::exists(candidate)) { - pluginsPath = candidate; - break; - } - } - - if (pluginsPath.isEmpty()) { - pluginsPath = fallbackDir(); - } - } -#endif - return pluginsPath; -} - QString localesPath() { #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) @@ -283,8 +256,6 @@ base::FilePath WebEngineLibraryInfo::getPath(int key) break; case base::DIR_QT_LIBRARY_DATA: return toFilePath(icuDataPath()); - case content::DIR_MEDIA_LIBS: - return toFilePath(pluginsPath()); case ui::DIR_LOCALES: return toFilePath(localesPath()); default: -- cgit v1.2.1 From 2a9bf8ac5d33927d6bdd2ea7c42c2521ae672255 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 12:33:04 +0200 Subject: Doc: Specify types of qmlsignal arguments Change-Id: I8694de2fa43eb7d343e8abcb617939dafab59ebc Reviewed-by: Joerg Bornemann --- src/webengine/doc/src/webengineview.qdoc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc index 2aeb88b26..bdee3da8e 100644 --- a/src/webengine/doc/src/webengineview.qdoc +++ b/src/webengine/doc/src/webengineview.qdoc @@ -474,7 +474,7 @@ */ /*! - \qmlsignal WebEngineView::loadingChanged(loadRequest) + \qmlsignal WebEngineView::loadingChanged(WebEngineLoadRequest loadRequest) This signal is emitted when a page load begins, ends, or fails. The corresponding handler is \c onLoadingChanged. @@ -507,7 +507,7 @@ */ /*! - \qmlsignal WebEngineView::certificateError(error) + \qmlsignal WebEngineView::certificateError(WebEngineCertificateError error) \since QtWebEngine 1.1 This signal is emitted when an invalid certificate error is raised while loading a given request. @@ -516,12 +516,10 @@ type. The corresponding handler is \c onCertificateError. - - \sa WebEngineCertificateError */ /*! - \qmlsignal WebEngineView::linkHovered(hoveredUrl) + \qmlsignal WebEngineView::linkHovered(url hoveredUrl) Within a mouse-driven interface, this signal is emitted when a mouse pointer passes over a link, corresponding to the \c{mouseover} DOM @@ -533,7 +531,7 @@ */ /*! - \qmlsignal WebEngineView::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, message, lineNumber, sourceID) + \qmlsignal WebEngineView::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, string message, int lineNumber, string sourceID) This signal is emitted when a JavaScript program tries to print a \a message to the web browser's console. For example, in case of evaluation errors the source URL may be provided in \a sourceID as well @@ -549,7 +547,7 @@ */ /*! - \qmlsignal WebEngineView::newViewRequested(request) + \qmlsignal WebEngineView::newViewRequested(WebEngineViewRequest request) \since QtWebEngine 1.1 This signal is emitted when a page load is requested to happen in a separate @@ -566,7 +564,7 @@ The corresponding handler is \c onNewViewRequested. - \sa WebEngineNewViewRequest, NewViewDestination, {WebEngine Quick Nano Browser} + \sa NewViewDestination, {WebEngine Quick Nano Browser} */ /*! @@ -578,11 +576,11 @@ The corresponding handler is \c onFullScreenRequested. - \sa WebEngineFullScreenRequest, isFullScreen + \sa isFullScreen */ /*! - \qmlsignal WebEngineView::activeFocusOnPressChanged(bool) + \qmlsignal WebEngineView::activeFocusOnPressChanged(bool activeFocusOnPress) \since QtWebEngine 1.2 This signal is emitted when the ability of the web engine view to get focus when clicked -- cgit v1.2.1 From 04c1f1a0039c7e90f31f5a8245b1d78ceff3a687 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 12:34:41 +0200 Subject: Doc: Do not explicitly mention names of signal handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You can also connect arbitrary methods using the Connections type, or the connect() method. Anyhow, this is standard QML behavior, so no need to mention it in every signal. Change-Id: I419c74eee7ce190c44336d9f25c1a3aa30f36ab4 Reviewed-by: Michal Klocek Reviewed-by: Topi Reiniö --- src/webengine/doc/src/webengineview.qdoc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc index bdee3da8e..5359c0349 100644 --- a/src/webengine/doc/src/webengineview.qdoc +++ b/src/webengine/doc/src/webengineview.qdoc @@ -477,7 +477,6 @@ \qmlsignal WebEngineView::loadingChanged(WebEngineLoadRequest loadRequest) This signal is emitted when a page load begins, ends, or fails. - The corresponding handler is \c onLoadingChanged. When handling the signal with \c onLoadingChanged, various read-only parameters are available on the \a loadRequest: @@ -514,8 +513,6 @@ The certificate error can be handled by using the methods of the WebEngineCertificateError type. - - The corresponding handler is \c onCertificateError. */ /*! @@ -526,8 +523,6 @@ event. This event may also occur in touch interfaces for \c{mouseover} events that are not cancelled with \c{preventDefault()}. \a{hoveredUrl} provides the link's location. - - The corresponding handler is \c onLinkHovered. */ /*! @@ -540,8 +535,8 @@ \a level indicates the severity of the event that triggered the message, that is, whether it was triggered by an error or a less severe event. - The corresponding handler is \c onJavaScriptConsoleMessage. If no handler is specified, - the view will log the messages into a \c js \l{QLoggingCategory}{logging category}. + If no handler is specified, the view will log the messages into a \c js + \l{QLoggingCategory}{logging category}. \sa{Console Logging} */ @@ -562,8 +557,6 @@ \snippet snippets/qtwebengine_webengineview_newviewrequested.qml 0 - The corresponding handler is \c onNewViewRequested. - \sa NewViewDestination, {WebEngine Quick Nano Browser} */ @@ -574,8 +567,6 @@ This signal is emitted when the web page requests fullscreen mode through the JavaScript API. - The corresponding handler is \c onFullScreenRequested. - \sa isFullScreen */ @@ -614,8 +605,6 @@ This signal is emitted whenever the page requests the web browser window to be closed, for example through the JavaScript \c{window.close()} call. - - The corresponding handler is \c onWindowCloseRequested. */ /*! -- cgit v1.2.1 From f5ee1feeed2abbcbe6db2bf9757d692b38fcbcb1 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 30 Jun 2016 16:06:46 +0200 Subject: Fix invalid pointer in script collection after opening popup The script collection has a pointer to webcontents adapter, and when a new adapter is adopted, the pointer in the script collection needs to be updated. Task-number: QTBUG-54419 Change-Id: Ia054e1281ab4db637beab570abda752074dc9280 Reviewed-by: Joerg Bornemann --- src/webenginewidgets/api/qwebenginepage.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 45177d8d8..0d556f15b 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -288,8 +288,11 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W // Overwrite the new page's WebContents with ours. if (newPage->d_func() != this) { + // Keep the old adapter referenced until the scriptcollection is rebound + QExplicitlySharedDataPointer oldWebContents = newPage->d_func()->adapter; newPage->d_func()->adapter = newWebContents; newWebContents->initialize(newPage->d_func()); + newPage->d_func()->scriptCollection.d->rebindToContents(newWebContents); if (!initialGeometry.isEmpty()) emit newPage->geometryChangeRequested(initialGeometry); } -- cgit v1.2.1 From 5b219fc20dbfe6090af45c1dbdb7ad50bc743ca1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 27 Jun 2016 16:52:55 +0200 Subject: Clear internal selected text when searching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously if a selection was made on a web page, and afterwards a find operation is executed, the selection in the web page would be cleared, but the call to selectedText() would still return the old selection. Make sure selectedText() is always cleared, when starting a find operation, as well as when stopping one. Change-Id: If78f0fa1dd836a52184015e749ef5a84b9f784cd Task-number: QTBUG-54071 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- src/core/web_contents_adapter.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index d0dbe5636..79930a541 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit d0dbe5636cb9d424db0c7ee7850c97d578150138 +Subproject commit 79930a541473b2e0f950d040c16ab6f22e4aeef3 diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index c450768fa..709efe9b3 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -782,6 +782,9 @@ void WebContentsAdapter::stopFinding() { Q_D(WebContentsAdapter); d->webContentsDelegate->setLastSearchedString(QString()); + // Clear any previous selection, + // but keep the renderer blue rectangle selection just like Chromium does. + d->webContents->Unselect(); d->webContents->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION); } -- cgit v1.2.1 From ea503a2f07f2505d8d91a7d7999a1fb1b1d6b57c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 30 Jun 2016 16:22:33 +0200 Subject: Let script collection hold a reference to the adapter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While the script collection always follows a page, it is safer to have both hold a reference to the web-contents adapter, so it doesn't get deleted while adapters are being changed. Change-Id: I21e268f7228f13702468df61e0032bdf2f99873a Reviewed-by: Michael Brüning --- src/webenginewidgets/api/qwebenginepage.cpp | 5 ----- .../api/qwebenginescriptcollection.cpp | 18 +++++++++--------- .../api/qwebenginescriptcollection_p.h | 5 +++-- 3 files changed, 12 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 0d556f15b..b35bb54ec 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -288,8 +288,6 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W // Overwrite the new page's WebContents with ours. if (newPage->d_func() != this) { - // Keep the old adapter referenced until the scriptcollection is rebound - QExplicitlySharedDataPointer oldWebContents = newPage->d_func()->adapter; newPage->d_func()->adapter = newWebContents; newWebContents->initialize(newPage->d_func()); newPage->d_func()->scriptCollection.d->rebindToContents(newWebContents); @@ -455,9 +453,6 @@ void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input) { QExplicitlySharedDataPointer newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); if (newWebContents) { - // Keep the old adapter referenced so the user-scripts are not - // unregistered immediately. - QExplicitlySharedDataPointer oldWebContents = adapter; adapter = newWebContents.data(); adapter->initialize(this); if (webChannel) diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp index 117c35b5a..8d581b60a 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp +++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp @@ -172,32 +172,32 @@ QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngine int QWebEngineScriptCollectionPrivate::count() const { - return m_scriptController->registeredScripts(m_contents).count(); + return m_scriptController->registeredScripts(m_contents.data()).count(); } bool QWebEngineScriptCollectionPrivate::contains(const QWebEngineScript &s) const { - return m_scriptController->containsUserScript(*s.d, m_contents); + return m_scriptController->containsUserScript(*s.d, m_contents.data()); } void QWebEngineScriptCollectionPrivate::insert(const QWebEngineScript &script) { if (!script.d) return; - m_scriptController->addUserScript(*script.d, m_contents); + m_scriptController->addUserScript(*script.d, m_contents.data()); } bool QWebEngineScriptCollectionPrivate::remove(const QWebEngineScript &script) { if (!script.d) return false; - return m_scriptController->removeUserScript(*script.d, m_contents); + return m_scriptController->removeUserScript(*script.d, m_contents.data()); } QList QWebEngineScriptCollectionPrivate::toList(const QString &scriptName) const { QList ret; - Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents)) + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) if (scriptName.isNull() || scriptName == script.name()) ret.append(QWebEngineScript(script)); return ret; @@ -205,7 +205,7 @@ QList QWebEngineScriptCollectionPrivate::toList(const QString QWebEngineScript QWebEngineScriptCollectionPrivate::find(const QString &name) const { - Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents)) + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) if (name == script.name()) return QWebEngineScript(script); return QWebEngineScript(); @@ -213,12 +213,12 @@ QWebEngineScript QWebEngineScriptCollectionPrivate::find(const QString &name) co void QWebEngineScriptCollectionPrivate::clear() { - m_scriptController->clearAllScripts(m_contents); + m_scriptController->clearAllScripts(m_contents.data()); } void QWebEngineScriptCollectionPrivate::reserve(int capacity) { - m_scriptController->reserve(m_contents, capacity); + m_scriptController->reserve(m_contents.data(), capacity); } void QWebEngineScriptCollectionPrivate::rebindToContents(QtWebEngineCore::WebContentsAdapter *page) @@ -227,7 +227,7 @@ void QWebEngineScriptCollectionPrivate::rebindToContents(QtWebEngineCore::WebCon Q_ASSERT(page); Q_ASSERT(m_contents != page); - Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents)) { + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) { m_scriptController->addUserScript(script, page); } m_contents = page; diff --git a/src/webenginewidgets/api/qwebenginescriptcollection_p.h b/src/webenginewidgets/api/qwebenginescriptcollection_p.h index b5ae60a2c..931f6c0e8 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection_p.h +++ b/src/webenginewidgets/api/qwebenginescriptcollection_p.h @@ -51,12 +51,13 @@ #include "qtwebenginewidgetsglobal.h" #include "qwebenginescript.h" +#include "web_contents_adapter.h" +#include #include namespace QtWebEngineCore { class UserScriptControllerHost; -class WebContentsAdapter; } // namespace QT_BEGIN_NAMESPACE @@ -78,7 +79,7 @@ public: private: QtWebEngineCore::UserScriptControllerHost *m_scriptController; - QtWebEngineCore::WebContentsAdapter *m_contents; + QExplicitlySharedDataPointer m_contents; }; QT_END_NAMESPACE -- cgit v1.2.1 From 06864c75f4d009bf8fd4e9f88215bb88341ed873 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 30 Jun 2016 17:41:31 +0200 Subject: Switch WebContentsAdapter to using shared pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QExplicitSharedDataPointer is meant for value objects, not for shared objects. Instead switch to using QSharedPointer. Change-Id: Ib3791bbcfde627a67508f2819e141d8c538a4a50 Reviewed-by: Michael Brüning Reviewed-by: Michal Klocek --- src/core/web_contents_adapter.cpp | 6 +++--- src/core/web_contents_adapter.h | 6 +++--- src/core/web_contents_adapter_client.h | 2 +- src/core/web_contents_delegate_qt.cpp | 17 +++++------------ src/core/web_contents_delegate_qt.h | 2 +- src/core/web_engine_settings.h | 1 - src/webengine/api/qquickwebenginenewviewrequest_p.h | 2 +- src/webengine/api/qquickwebengineview.cpp | 12 ++++++------ src/webengine/api/qquickwebengineview_p_p.h | 4 ++-- src/webenginewidgets/api/qwebenginepage.cpp | 12 ++++++------ src/webenginewidgets/api/qwebenginepage_p.h | 4 ++-- src/webenginewidgets/api/qwebenginescriptcollection.cpp | 12 ++++++------ src/webenginewidgets/api/qwebenginescriptcollection_p.h | 8 ++++---- 13 files changed, 40 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 709efe9b3..f447b5480 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -321,14 +321,14 @@ WebContentsAdapterPrivate::~WebContentsAdapterPrivate() webContents.reset(); } -QExplicitlySharedDataPointer WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient) +QSharedPointer WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient) { int currentIndex; ScopedVector entries; deserializeNavigationHistory(input, ¤tIndex, &entries, adapterClient->browserContextAdapter()->browserContext()); if (currentIndex == -1) - return QExplicitlySharedDataPointer(); + return QSharedPointer(); // Unlike WebCore, Chromium only supports Restoring to a new WebContents instance. content::WebContents* newWebContents = createBlankWebContents(adapterClient, adapterClient->browserContextAdapter()->browserContext()); @@ -346,7 +346,7 @@ QExplicitlySharedDataPointer WebContentsAdapter::createFromS content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, *file); } - return QExplicitlySharedDataPointer(new WebContentsAdapter(newWebContents)); + return QSharedPointer::create(newWebContents); } WebContentsAdapter::WebContentsAdapter(content::WebContents *webContents) diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index ce033bdb4..0d9218d38 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -41,7 +41,7 @@ #include "web_contents_adapter_client.h" #include -#include +#include #include #include @@ -61,9 +61,9 @@ class BrowserContextQt; class MessagePassingInterface; class WebContentsAdapterPrivate; -class QWEBENGINE_EXPORT WebContentsAdapter : public QSharedData { +class QWEBENGINE_EXPORT WebContentsAdapter : public QEnableSharedFromThis { public: - static QExplicitlySharedDataPointer createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient); + static QSharedPointer createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient); // Takes ownership of the WebContents. WebContentsAdapter(content::WebContents *webContents = 0); ~WebContentsAdapter(); diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index f0927c9e5..449f382cf 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -206,7 +206,7 @@ public: virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) = 0; virtual void focusContainer() = 0; virtual void unhandledKeyEvent(QKeyEvent *event) = 0; - virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect & initialGeometry) = 0; + virtual void adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect & initialGeometry) = 0; virtual bool isBeingAdopted() = 0; virtual void close() = 0; virtual void windowCloseRejected() = 0; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index bf12537d1..97f0e515d 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -93,7 +93,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents { content::WebContents *target = source; if (params.disposition != CURRENT_TAB) { - WebContentsAdapter *targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture); + QSharedPointer targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture); if (targetAdapter) target = targetAdapter->webContents(); } @@ -139,7 +139,7 @@ bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *sour void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) { Q_UNUSED(source) - WebContentsAdapter *newAdapter = createWindow(new_contents, disposition, initial_pos, user_gesture); + QWeakPointer newAdapter = createWindow(new_contents, disposition, initial_pos, user_gesture); if (was_blocked) *was_blocked = !newAdapter; } @@ -372,20 +372,13 @@ void WebContentsDelegateQt::overrideWebPreferences(content::WebContents *, conte m_viewClient->webEngineSettings()->overrideWebPreferences(webPreferences); } -WebContentsAdapter *WebContentsDelegateQt::createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) +QWeakPointer WebContentsDelegateQt::createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - WebContentsAdapter *newAdapter = new WebContentsAdapter(new_contents); - // Do the first ref-count manually to be able to know if the application is handling adoptNewWindow through the public API. - newAdapter->ref.ref(); + QSharedPointer newAdapter = QSharedPointer::create(new_contents); m_viewClient->adoptNewWindow(newAdapter, static_cast(disposition), user_gesture, toQt(initial_pos)); - if (!newAdapter->ref.deref()) { - // adoptNewWindow didn't increase the ref-count, newAdapter and its new_contents (if non-null) need to be discarded. - delete newAdapter; - newAdapter = 0; - } - + // If the client didn't reference the adapter, it will be deleted now, and the weak pointer zeroed. return newAdapter; } diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 7ead8dc7c..9aace06dd 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -117,7 +117,7 @@ public: void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame); private: - WebContentsAdapter *createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture); + QWeakPointer createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture); WebContentsAdapterClient *m_viewClient; QString m_lastSearchedString; diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h index 3d3d734d0..3036a31a6 100644 --- a/src/core/web_engine_settings.h +++ b/src/core/web_engine_settings.h @@ -39,7 +39,6 @@ #include "qtwebenginecoreglobal.h" -#include #include #include #include diff --git a/src/webengine/api/qquickwebenginenewviewrequest_p.h b/src/webengine/api/qquickwebenginenewviewrequest_p.h index b408812ba..c08ef0aba 100644 --- a/src/webengine/api/qquickwebenginenewviewrequest_p.h +++ b/src/webengine/api/qquickwebenginenewviewrequest_p.h @@ -72,7 +72,7 @@ private: QQuickWebEngineNewViewRequest(); QQuickWebEngineView::NewViewDestination m_destination; bool m_isUserInitiated; - QExplicitlySharedDataPointer m_adapter; + QSharedPointer m_adapter; QUrl m_requestedUrl; friend class QQuickWebEngineView; friend class QQuickWebEngineViewPrivate; diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index ddca1b670..95aaa39e6 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -527,7 +527,7 @@ void QQuickWebEngineViewPrivate::unhandledKeyEvent(QKeyEvent *event) q->window()->sendEvent(q->parentItem(), event); } -void QQuickWebEngineViewPrivate::adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &) +void QQuickWebEngineViewPrivate::adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &) { Q_Q(QQuickWebEngineView); QQuickWebEngineNewViewRequest request; @@ -728,7 +728,7 @@ QAccessible::State QQuickWebEngineViewAccessible::state() const class WebContentsAdapterOwner : public QObject { public: - typedef QExplicitlySharedDataPointer AdapterPtr; + typedef QSharedPointer AdapterPtr; WebContentsAdapterOwner(const AdapterPtr &ptr) : adapter(ptr) {} @@ -755,9 +755,9 @@ 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); + WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis()); adapterOwner->deleteLater(); - adapter = webContents; + adapter = webContents->sharedFromThis(); adapter->initialize(this); // associate the webChannel with the new adapter @@ -810,7 +810,7 @@ void QQuickWebEngineViewPrivate::ensureContentsAdapter() { Q_Q(QQuickWebEngineView); if (!adapter) { - adapter = new WebContentsAdapter(); + adapter = QSharedPointer::create(); adapter->initialize(this); if (m_backgroundColor != Qt::white) adapter->backgroundColorChanged(); @@ -970,7 +970,7 @@ void QQuickWebEngineViewPrivate::setProfile(QQuickWebEngineProfile *profile) if (adapter && adapter->browserContext() != browserContextAdapter()->browserContext()) { // When the profile changes we need to create a new WebContentAdapter and reload the active URL. QUrl activeUrl = adapter->activeUrl(); - adapter = 0; + adapter.reset(); ensureContentsAdapter(); if (!explicitUrl.isValid() && activeUrl.isValid()) diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index aab86bc3a..0fd187ab3 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -142,7 +142,7 @@ public: virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE; virtual void focusContainer() Q_DECL_OVERRIDE; virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE; - virtual void adoptNewWindow(QtWebEngineCore::WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &) Q_DECL_OVERRIDE; + virtual void adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &) Q_DECL_OVERRIDE; virtual bool isBeingAdopted() Q_DECL_OVERRIDE; virtual void close() Q_DECL_OVERRIDE; virtual void windowCloseRejected() Q_DECL_OVERRIDE; @@ -190,7 +190,7 @@ public: static QQuickWebEngineScript *userScripts_at(QQmlListProperty *p, int idx); static void userScripts_clear(QQmlListProperty *p); - QExplicitlySharedDataPointer adapter; + QSharedPointer adapter; QScopedPointer e; QScopedPointer v; QScopedPointer m_history; diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index b35bb54ec..9685d19f1 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -120,13 +120,13 @@ QWebEnginePage::WebAction editorActionForKeyEvent(QKeyEvent* event) } QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) - : adapter(new WebContentsAdapter) + : adapter(QSharedPointer::create()) , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this))) , profile(_profile ? _profile : QWebEngineProfile::defaultProfile()) , settings(new QWebEngineSettings(profile->settings())) , view(0) , isLoading(false) - , scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userScriptController(), adapter.data())) + , scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userScriptController(), adapter)) , m_isBeingAdopted(false) , m_backgroundColor(Qt::white) , fullscreenMode(false) @@ -266,7 +266,7 @@ void QWebEnginePagePrivate::unhandledKeyEvent(QKeyEvent *event) QGuiApplication::sendEvent(view->parentWidget(), event); } -void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) +void QWebEnginePagePrivate::adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) { Q_Q(QWebEnginePage); Q_UNUSED(userGesture); @@ -451,13 +451,13 @@ void QWebEnginePagePrivate::_q_webActionTriggered(bool checked) void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input) { - QExplicitlySharedDataPointer newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); + QSharedPointer newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); if (newWebContents) { - adapter = newWebContents.data(); + adapter = std::move(newWebContents); adapter->initialize(this); if (webChannel) adapter->setWebChannel(webChannel); - scriptCollection.d->rebindToContents(adapter.data()); + scriptCollection.d->rebindToContents(adapter); } } diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index d0023d7bb..41ba84dd0 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -95,7 +95,7 @@ public: virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE; virtual void focusContainer() Q_DECL_OVERRIDE; virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE; - virtual void adoptNewWindow(QtWebEngineCore::WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; + virtual void adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; virtual bool isBeingAdopted() Q_DECL_OVERRIDE; virtual void close() Q_DECL_OVERRIDE; virtual void windowCloseRejected() Q_DECL_OVERRIDE; @@ -143,7 +143,7 @@ public: void setFullScreenMode(bool); - QExplicitlySharedDataPointer adapter; + QSharedPointer adapter; QWebEngineHistory *history; QWebEngineProfile *profile; QWebEngineSettings *settings; diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp index 8d581b60a..1ba16db9d 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp +++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp @@ -164,7 +164,7 @@ QList QWebEngineScriptCollection::toList() const } -QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *controller, QtWebEngineCore::WebContentsAdapter *webContents) +QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *controller, QSharedPointer webContents) : m_scriptController(controller) , m_contents(webContents) { @@ -221,14 +221,14 @@ void QWebEngineScriptCollectionPrivate::reserve(int capacity) m_scriptController->reserve(m_contents.data(), capacity); } -void QWebEngineScriptCollectionPrivate::rebindToContents(QtWebEngineCore::WebContentsAdapter *page) +void QWebEngineScriptCollectionPrivate::rebindToContents(QSharedPointer contents) { Q_ASSERT(m_contents); - Q_ASSERT(page); - Q_ASSERT(m_contents != page); + Q_ASSERT(contents); + Q_ASSERT(m_contents != contents); Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) { - m_scriptController->addUserScript(script, page); + m_scriptController->addUserScript(script, contents.data()); } - m_contents = page; + m_contents = contents; } diff --git a/src/webenginewidgets/api/qwebenginescriptcollection_p.h b/src/webenginewidgets/api/qwebenginescriptcollection_p.h index 931f6c0e8..911764868 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection_p.h +++ b/src/webenginewidgets/api/qwebenginescriptcollection_p.h @@ -53,8 +53,8 @@ #include "qwebenginescript.h" #include "web_contents_adapter.h" -#include #include +#include namespace QtWebEngineCore { class UserScriptControllerHost; @@ -63,14 +63,14 @@ class UserScriptControllerHost; QT_BEGIN_NAMESPACE class QWebEngineScriptCollectionPrivate { public: - QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *, QtWebEngineCore::WebContentsAdapter * = 0); + QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *, QSharedPointer = QSharedPointer()); int count() const; bool contains(const QWebEngineScript &) const; QList toList(const QString &scriptName = QString()) const; QWebEngineScript find(const QString & name) const; - void rebindToContents(QtWebEngineCore::WebContentsAdapter *contents); + void rebindToContents(QSharedPointer contents); void insert(const QWebEngineScript &); bool remove(const QWebEngineScript &); @@ -79,7 +79,7 @@ public: private: QtWebEngineCore::UserScriptControllerHost *m_scriptController; - QExplicitlySharedDataPointer m_contents; + QSharedPointer m_contents; }; QT_END_NAMESPACE -- cgit v1.2.1 From dee43c0084f5c8a241a9b67661868a70167f2e72 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Jul 2016 16:16:06 +0200 Subject: Fix regression with fine-grained wheel events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The division needs to be done in float, otherwise steps smaller than one standard tick will be rounded to zero. Change-Id: Id939be062f1575104ca6cd66f05892841ec27569 Reviewed-by: Michael Brüning --- src/core/web_event_factory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 80f81e954..521a8b78e 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -656,8 +656,8 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev, doub webEvent.modifiers = modifiersForEvent(ev); webEvent.timeStampSeconds = currentTimeForEvent(ev); - webEvent.wheelTicksX = ev->angleDelta().x() / QWheelEvent::DefaultDeltasPerStep; - webEvent.wheelTicksY = ev->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep; + webEvent.wheelTicksX = static_cast(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; + webEvent.wheelTicksY = static_cast(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; // We can't use the device specific QWheelEvent::pixelDelta(), so we calculate // a pixel delta based on ticks and scroll per line. -- cgit v1.2.1 From 7f261437d6a60d1f53624b68ed88fb32bf8c5f1c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Jul 2016 16:06:17 +0200 Subject: Fix regression in text selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While 'button' should officially be none on mouse move events, the aura and windows events set 'button' on mouse move, and selection code appears to depend on it. Change-Id: I49f84e6f9178c3b2cb0f2c2c8a7b1d30141d0b4e Reviewed-by: Michael Brüning --- src/core/web_event_factory.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 521a8b78e..d6b2f4ba9 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -489,6 +489,19 @@ static WebMouseEvent::Button mouseButtonForEvent(QMouseEvent *event) return WebMouseEvent::ButtonRight; else if (event->button() == Qt::MidButton) return WebMouseEvent::ButtonMiddle; + + if (event->type() != QEvent::MouseMove) + return WebMouseEvent::ButtonNone; + + // This is technically wrong, mouse move should always have ButtonNone, + // but it is consistent with aura and selection code depends on it: + if (event->buttons() & Qt::LeftButton) + return WebMouseEvent::ButtonLeft; + else if (event->buttons() & Qt::RightButton) + return WebMouseEvent::ButtonRight; + else if (event->buttons() & Qt::MidButton) + return WebMouseEvent::ButtonMiddle; + return WebMouseEvent::ButtonNone; } -- cgit v1.2.1 From 3855015600418107485b31b0ec2bfa5b987787e7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 8 Jul 2016 14:24:42 +0200 Subject: Allow QWebEnginePage::createWindow to return this Consider a QWebEnginePage subclass that does "return this;" in createWindow. Commit 1f07d2929a made this a no-op to prevent QtWebEngine from crashing. The reason for the crash was access to deleted memory after destroying the current adapter in adoptNewWindow. Defer the adoption in this case to whenever we hit the event loop again. Change-Id: I9674d80ef8b2f301c1446ff505b2486649451ba6 Task-number: QTBUG-42216 Reviewed-by: Michal Klocek --- src/webenginewidgets/api/qwebenginepage.cpp | 27 ++++++++++++++++++++------- src/webenginewidgets/api/qwebenginepage_p.h | 3 +++ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 9685d19f1..dbbac1aed 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -275,6 +276,20 @@ void QWebEnginePagePrivate::adoptNewWindow(QSharedPointer ne if (!newPage) return; + if (newPage->d_func() == this) { + // If createWindow returns /this/ we must delay the adoption. + Q_ASSERT(q == newPage); + QTimer::singleShot(0, q, [this, newPage, newWebContents, initialGeometry] () { + adoptNewWindowImpl(newPage, newWebContents, initialGeometry); + }); + } else { + adoptNewWindowImpl(newPage, newWebContents, initialGeometry); + } +} + +void QWebEnginePagePrivate::adoptNewWindowImpl(QWebEnginePage *newPage, + const QSharedPointer &newWebContents, const QRect &initialGeometry) +{ // Mark the new page as being in the process of being adopted, so that a second mouse move event // sent by newWebContents->initialize() gets filtered in RenderWidgetHostViewQt::forwardEvent. // The first mouse move event is being sent by q->createWindow(). This is necessary because @@ -287,13 +302,11 @@ void QWebEnginePagePrivate::adoptNewWindow(QSharedPointer ne newPage->d_func()->m_isBeingAdopted = true; // Overwrite the new page's WebContents with ours. - if (newPage->d_func() != this) { - newPage->d_func()->adapter = newWebContents; - newWebContents->initialize(newPage->d_func()); - newPage->d_func()->scriptCollection.d->rebindToContents(newWebContents); - if (!initialGeometry.isEmpty()) - emit newPage->geometryChangeRequested(initialGeometry); - } + newPage->d_func()->adapter = newWebContents; + newWebContents->initialize(newPage->d_func()); + newPage->d_func()->scriptCollection.d->rebindToContents(newWebContents); + if (!initialGeometry.isEmpty()) + emit newPage->geometryChangeRequested(initialGeometry); // Page has finished the adoption process. newPage->d_func()->m_isBeingAdopted = false; diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 41ba84dd0..27f582c30 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -96,6 +96,9 @@ public: virtual void focusContainer() Q_DECL_OVERRIDE; virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE; virtual void adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; + void adoptNewWindowImpl(QWebEnginePage *newPage, + const QSharedPointer &newWebContents, + const QRect &initialGeometry); virtual bool isBeingAdopted() Q_DECL_OVERRIDE; virtual void close() Q_DECL_OVERRIDE; virtual void windowCloseRejected() Q_DECL_OVERRIDE; -- cgit v1.2.1 From 1e83a2d1b61b13323163dfe8cac64dad397cb202 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 25 May 2016 16:14:41 +0200 Subject: Propagate the view's screen coordinates on global position change Suppose having a QWebEngineView as one of many child widgets in a layout. Resize some child widget such that the position of the QWebEngineView changes (without changing the position of the top-level window). Chromium must be informed of the changed global position, otherwise popups will be opened at the old position. Also see commit 7f941a34, which originally introduced the coordinate propagation for top-level window moves. Task-number: QTBUG-51244 Change-Id: Ieb372e8d7554700d5e8d1e2148ab778094ea3878 Reviewed-by: Allan Sandfeld Jensen --- .../render_widget_host_view_qt_delegate_widget.cpp | 8 ++++++++ src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h | 1 + 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 2937c94b7..a8300aa05 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -266,6 +266,13 @@ QVariant RenderWidgetHostViewQtDelegateWidget::inputMethodQuery(Qt::InputMethodQ void RenderWidgetHostViewQtDelegateWidget::resizeEvent(QResizeEvent *resizeEvent) { QOpenGLWidget::resizeEvent(resizeEvent); + + const QPoint globalPos = mapToGlobal(pos()); + if (globalPos != m_lastGlobalPos) { + m_lastGlobalPos = globalPos; + m_client->windowBoundsChanged(); + } + m_client->notifyResize(); } @@ -384,6 +391,7 @@ void RenderWidgetHostViewQtDelegateWidget::paintGL() void RenderWidgetHostViewQtDelegateWidget::onWindowPosChanged() { + m_lastGlobalPos = mapToGlobal(pos()); m_client->windowBoundsChanged(); } 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 bccfeb0f4..ecf2d2d33 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h @@ -101,6 +101,7 @@ private: QScopedPointer m_sgRenderer; bool m_isPopup; QColor m_clearColor; + QPoint m_lastGlobalPos; QList m_windowConnections; }; -- cgit v1.2.1 From f2c7c89d9f31b79a1db403602195362bca40c4bb Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 2 Jun 2016 10:14:41 +0900 Subject: Improve OpenGL implementation check Qt WebEngine uses `isOpenGLES` to know whether the OpenGL implementation is EGL with OpenGL ES 2.0. However, some non-ES OpenGL implementation such as eglfs_x11 uses EGL and are compatible with OpenGL ES 2.0. This change allows to use them. Also the change will allow to detect incompatible combinations. (i.e. EGL + ES-incompatible OpenGL, API other than EGL + OpenGL ES) Change-Id: I0abea253696d06ec365bde2176663700e8567f45 Reviewed-by: Alexandru Croitor Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 46 ++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 4bd29dddf..3289a3c23 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -78,8 +78,10 @@ #include "web_engine_library_info.h" #include #include +#include #include #include +#include #include #include @@ -261,15 +263,40 @@ WebEngineContext::WebEngineContext() GLContextHelper::initialize(); - if (usingANGLE() || usingSoftwareDynamicGL() || usingQtQuick2DRenderer()) { - parsedCommandLine->AppendSwitch(switches::kDisableGpu); - } else { - const char *glType = 0; + const char *glType = 0; + if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) { if (qt_gl_global_share_context()) { - if (qt_gl_global_share_context()->isOpenGLES()) { - glType = gfx::kGLImplementationEGLName; + if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) { + if (qt_gl_global_share_context()->isOpenGLES()) { + glType = gfx::kGLImplementationEGLName; + } else { + QOpenGLContext context; + QSurfaceFormat format; + + format.setRenderableType(QSurfaceFormat::OpenGLES); + format.setVersion(2, 0); + + context.setFormat(format); + context.setShareContext(qt_gl_global_share_context()); + if (context.create()) { + QOffscreenSurface surface; + + surface.setFormat(format); + surface.create(); + + if (context.makeCurrent(&surface)) { + if (context.hasExtension("GL_ARB_ES2_compatibility")) + glType = gfx::kGLImplementationEGLName; + + context.doneCurrent(); + } + + surface.destroy(); + } + } } else { - glType = gfx::kGLImplementationDesktopName; + if (!qt_gl_global_share_context()->isOpenGLES()) + glType = gfx::kGLImplementationDesktopName; } } else { qWarning("WebEngineContext used before QtWebEngine::initialize()"); @@ -283,9 +310,12 @@ WebEngineContext::WebEngineContext() break; } } + } + if (glType) parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType); - } + else + parsedCommandLine->AppendSwitch(switches::kDisableGpu); content::UtilityProcessHostImpl::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread); content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread); -- cgit v1.2.1 From 7b0477f14adcb2ccb7e364900df546680cacbfbc Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 15 Jul 2016 16:52:19 +0200 Subject: Fix regression in updating cookie store settings A copy-paste error meant we only updated user-agent settings when cookie store settings changed on a profile. Change-Id: I173ea7dfc309a30a3d3b98ee5ccab74e2abec456 Reviewed-by: Michal Klocek --- src/core/url_request_context_getter_qt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index f7c9e4600..da651517d 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -253,8 +253,8 @@ void URLRequestContextGetterQt::updateCookieStore() { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); QMutexLocker lock(&m_mutex); - m_httpAcceptLanguage = m_browserContext.data()->httpAcceptLanguage(); - m_httpUserAgent = m_browserContext.data()->httpUserAgent(); + m_persistentCookiesPolicy = m_browserContext.data()->persistentCookiesPolicy(); + m_cookiesPath = m_browserContext.data()->cookiesPath(); if (m_contextInitialized && !m_updateAllStorage && !m_updateCookieStore) { m_updateCookieStore = true; -- cgit v1.2.1 From f84869e9d8ea3ea9ced15adcc092558555874606 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 15 Jul 2016 17:17:40 +0200 Subject: Add persistent backend to channel id service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Channel-ids are only supposed to be memory only when running in off the record profiles. We have just never initialized the sql-based backend. We follow the cookie-settings, because channel-ids are used together with cookies, have similar implications, and newer Chromium versions will assert that cookie-store and channel-id store have matching storage models. Change-Id: I0a64146f0ed36a8913706bfc3fcadd7404894745 Reviewed-by: Michael Brüning --- src/core/browser_context_adapter.cpp | 10 ++++++++++ src/core/browser_context_adapter.h | 1 + src/core/url_request_context_getter_qt.cpp | 21 ++++++++++++++++----- src/core/url_request_context_getter_qt.h | 1 + 4 files changed, 28 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp index 702851ba5..66cbdb040 100644 --- a/src/core/browser_context_adapter.cpp +++ b/src/core/browser_context_adapter.cpp @@ -236,6 +236,16 @@ QString BrowserContextAdapter::cookiesPath() const return QString(); } +QString BrowserContextAdapter::channelIdPath() const +{ + if (m_offTheRecord) + return QString(); + QString basePath = dataPath(); + if (!basePath.isEmpty()) + return basePath % QLatin1String("/Origin Bound Certs"); + return QString(); +} + QString BrowserContextAdapter::httpCachePath() const { if (m_offTheRecord) diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h index 1eeb88770..162f89a2d 100644 --- a/src/core/browser_context_adapter.h +++ b/src/core/browser_context_adapter.h @@ -100,6 +100,7 @@ public: QString httpCachePath() const; QString cookiesPath() const; + QString channelIdPath() const; QString httpUserAgent() const; void setHttpUserAgent(const QString &userAgent); diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index da651517d..db2240eb4 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -47,6 +47,7 @@ #include "net/cert/cert_verifier.h" #include "net/dns/host_resolver.h" #include "net/dns/mapped_host_resolver.h" +#include "net/extras/sqlite/sqlite_channel_id_store.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_cache.h" #include "net/http/http_network_session.h" @@ -122,6 +123,7 @@ void URLRequestContextGetterQt::setFullConfiguration(QSharedPointerrequestInterceptor(); m_persistentCookiesPolicy = browserContext->persistentCookiesPolicy(); m_cookiesPath = browserContext->cookiesPath(); + m_channelIdPath = browserContext->channelIdPath(); m_httpAcceptLanguage = browserContext->httpAcceptLanguage(); m_httpUserAgent = browserContext->httpUserAgent(); m_httpCacheType = browserContext->httpCacheType(); @@ -217,11 +219,6 @@ void URLRequestContextGetterQt::generateStorage() net::ProxyConfigService *proxyConfigService = m_proxyConfigService.fetchAndStoreAcquire(0); Q_ASSERT(proxyConfigService); - - m_storage->set_channel_id_service(scoped_ptr(new net::ChannelIDService( - new net::DefaultChannelIDStore(NULL), - base::WorkerPool::GetTaskRunner(true)))); - m_storage->set_cert_verifier(net::CertVerifier::CreateDefault()); scoped_ptr host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); @@ -255,6 +252,7 @@ void URLRequestContextGetterQt::updateCookieStore() QMutexLocker lock(&m_mutex); m_persistentCookiesPolicy = m_browserContext.data()->persistentCookiesPolicy(); m_cookiesPath = m_browserContext.data()->cookiesPath(); + m_channelIdPath = m_browserContext.data()->channelIdPath(); if (m_contextInitialized && !m_updateAllStorage && !m_updateCookieStore) { m_updateCookieStore = true; @@ -272,6 +270,19 @@ void URLRequestContextGetterQt::generateCookieStore() QMutexLocker lock(&m_mutex); m_updateCookieStore = false; + scoped_refptr channel_id_db; + if (!m_channelIdPath.isEmpty() && m_persistentCookiesPolicy != BrowserContextAdapter::NoPersistentCookies) { + channel_id_db = new net::SQLiteChannelIDStore( + toFilePath(m_channelIdPath), + BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( + BrowserThread::GetBlockingPool()->GetSequenceToken())); + } + + m_storage->set_channel_id_service( + scoped_ptr(new net::ChannelIDService( + new net::DefaultChannelIDStore(channel_id_db.get()), + base::WorkerPool::GetTaskRunner(true)))); + // Unset it first to get a chance to destroy and flush the old cookie store before opening a new on possibly the same file. m_storage->set_cookie_store(0); m_cookieDelegate->setCookieMonster(0); diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index 11c3f4e79..9a4c74303 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -127,6 +127,7 @@ private: // FIXME: Should later be moved to a separate ProfileIOData class. BrowserContextAdapter::PersistentCookiesPolicy m_persistentCookiesPolicy; QString m_cookiesPath; + QString m_channelIdPath; QString m_httpAcceptLanguage; QString m_httpUserAgent; BrowserContextAdapter::HttpCacheType m_httpCacheType; -- cgit v1.2.1 From c5e9ac8540efeb9facafb1a8bc1a40e22a6952cf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 16:10:42 +0200 Subject: Doc: Introduce new 'Related Modules' section in Overview Consolidate the description of related modules in a separate section, and place them less prominently at the end of the overview. Also - remove mentioning of (ambiguous) 'web runtime' - fix spelling of supersede Change-Id: Iccac376a6b602ee9d23efd4b856e65b9292d6382 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 1fcae3dfa..f226f6f06 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -31,28 +31,16 @@ The Qt WebEngine module provides a web browser engine that makes it easy to embed content from the World Wide Web into your Qt application on platforms that do not have a native web engine. - The web engine is not intended to function as a \e {Web Runtime}; to display web content in a - QML application by using APIs native to the platform, use the \l{Qt WebView} module, instead. Qt WebEngine provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents, styled using Cascading Style Sheets (CSS) and scripted with JavaScript. HTML documents can be made fully editable by the user through the use of the \c{contenteditable} attribute on HTML elements. - Qt WebEngine supercedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit} - module, which is based on the - WebKit project, but has not been actively synchronized with the upstream WebKit code since - Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt WebKit widgets - application to use Qt WebEngine widgets, see \l{Porting from Qt WebKit to Qt WebEngine}. For new - applications, we recommend using Qt Quick and the WebEngineView QML type. - For more information about the requirements for building Qt WebEngine from source on the supported platforms and for other platform-specific information, see \l{Qt WebEngine Platform Notes}. - The \l {Qt WebChannel} module can be used to create a bi-directional communication channel - between QObject objects on the C++ side and JavaScript on the QML side. - \section1 Qt WebEngine Architecture \image qtwebengine-architecture.png @@ -238,6 +226,20 @@ The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set, delete, and intercept cookies during navigation. + \section1 Related Modules + + Qt WebEngine supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit} + module, which is based on the + WebKit project, but has not been actively synchronized with the upstream WebKit code since + Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt WebKit widgets + application to use Qt WebEngine widgets, see \l{Porting from Qt WebKit to Qt WebEngine}. + + The \l{Qt WebView} module allows to use a native web browser on platforms where one is + available. + + The \l{Qt WebChannel} module can be used to create a bi-directional communication channel + between QObject objects on the C++ side and JavaScript on the QML side. + \section1 License Information Qt WebEngine module is a snapshot of the integration of Chromium into Qt. -- cgit v1.2.1 From 94adae1e3ae59a60a91e61c3830e8581d2a4065e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 20 Jul 2016 15:41:09 +0200 Subject: Doc: Fix WebEngine module diagram - Fix typo - Add dependencies between submodules - Add sources for diagrams Task-number: QTBUG-54382 Change-Id: I88aa1dfd0ba16f3d3ca26d8c9cfa05b0ec1e9c83 Reviewed-by: Kai Koehne --- .../doc/images/qtwebengine-architecture.png | Bin 8098 -> 9890 bytes src/webengine/doc/images/qtwebengine-model.qmodel | 626 ++++++++++++++++ .../doc/images/qtwebengine-modules-model.qmodel | 500 +++++++++++++ .../doc/images/qtwebenginewidgets-model.qmodel | 789 +++++++++++++++++++++ 4 files changed, 1915 insertions(+) create mode 100644 src/webengine/doc/images/qtwebengine-model.qmodel create mode 100644 src/webengine/doc/images/qtwebengine-modules-model.qmodel create mode 100644 src/webengine/doc/images/qtwebenginewidgets-model.qmodel (limited to 'src') diff --git a/src/webengine/doc/images/qtwebengine-architecture.png b/src/webengine/doc/images/qtwebengine-architecture.png index 1c94d385f..979a0ad3f 100644 Binary files a/src/webengine/doc/images/qtwebengine-architecture.png and b/src/webengine/doc/images/qtwebengine-architecture.png differ diff --git a/src/webengine/doc/images/qtwebengine-model.qmodel b/src/webengine/doc/images/qtwebengine-model.qmodel new file mode 100644 index 000000000..f3d5cb52b --- /dev/null +++ b/src/webengine/doc/images/qtwebengine-model.qmodel @@ -0,0 +1,626 @@ + + + + {b4b96dcf-b444-4b48-96a0-0ced0222fbe4} + + + + + + + + {4b17cf3d-b45a-4ca8-b6c2-f0a9db0a0d9e} + + + qtwebengine-model + + + + + + + {d0623590-2a20-468b-9ec5-51987e78ae47} + + + + + + + + + + {d0623590-2a20-468b-9ec5-51987e78ae47} + + + qtwebengine-model + + + + + + + + + + + + {e1622bc8-530c-4d18-ba77-202bad11f1e0} + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + View + x:260;y:70 + x:-45;y:-30;w:90;h:60 + 0 + + + + + + + + + + + + + {0bb9e92a-910d-4a32-877b-fd7e37710f79} + + + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + Profile + x:415;y:155 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {54c2f051-8fdb-48f2-b528-2caa8fd1f854} + + + {999dd0f9-53f0-47bd-90ea-714c0dea50d7} + History + x:110;y:155 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {ae2fed61-96c0-4755-aad1-2d02fbc6e36e} + + + {b2ea9c4f-8b35-46c3-b2a5-3f22d72069e7} + Settings + x:260;y:240 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {95fafacc-66c7-42d0-b27e-e92a69964adf} + + + {e3429382-8484-481e-8690-792b1c1a257e} + {e1622bc8-530c-4d18-ba77-202bad11f1e0} + {0bb9e92a-910d-4a32-877b-fd7e37710f79} + + + + + + + + + + + + + {673bc9c1-a5ff-44ba-b9a6-d17807014a8e} + + + {e505b9c3-2332-4056-b3f0-dbd71a5ccbae} + {e1622bc8-530c-4d18-ba77-202bad11f1e0} + {54c2f051-8fdb-48f2-b528-2caa8fd1f854} + + + + + + + + + + + + + {78e57691-4776-4e73-b0f0-232a1e80da10} + + + {9cfdd75f-182e-4511-bf4c-19f30309318e} + {0bb9e92a-910d-4a32-877b-fd7e37710f79} + {ae2fed61-96c0-4755-aad1-2d02fbc6e36e} + + + + + + + + + + + + + {e76fa55e-b2df-4713-9fab-78434c3c7ed3} + + + {ff72261f-19e3-4983-b10c-856f6070637b} + Action + x:260;y:155 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {305524c2-f2c7-44ba-b30b-51fbfdc81063} + + + {911f495e-313f-4b28-95d6-440b06a05a83} + {e1622bc8-530c-4d18-ba77-202bad11f1e0} + {e76fa55e-b2df-4713-9fab-78434c3c7ed3} + + + + + + + + + + + + + {28ea46b1-ce73-432f-89a6-a97821dbac59} + + + {f1e3fd14-d433-4d95-8ea4-1c4b5aaf4334} + Script + x:415;y:240 + x:-45;y:-30;w:90;h:60 + 0 + + + + + + + + + + + + + {41e806b6-c8fd-4ae5-865d-db55feeb5570} + + + {96788086-5e67-482c-ac8b-0f2a7f0729ff} + Cookie + x:555;y:240 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {99a53c8d-8dc1-4ee5-83bf-ec2ff2677817} + + + {dc399de7-f3b9-4071-84af-b6e5dfa3affe} + {0bb9e92a-910d-4a32-877b-fd7e37710f79} + {28ea46b1-ce73-432f-89a6-a97821dbac59} + + + + + + + + + + + + + {f3833f3d-d01b-4c7c-bfde-91d014aff654} + + + {4dc013fb-ced4-4cc0-99e3-3f4a32acebf7} + {0bb9e92a-910d-4a32-877b-fd7e37710f79} + {41e806b6-c8fd-4ae5-865d-db55feeb5570} + + + + + + + + 1455888691589 + General + + + + + + + + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + + + + + + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + + + View + + + + + + + {e3429382-8484-481e-8690-792b1c1a257e} + + + + + + + + {e3429382-8484-481e-8690-792b1c1a257e} + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + + + + + + + + + + {e505b9c3-2332-4056-b3f0-dbd71a5ccbae} + + + + + + + + {e505b9c3-2332-4056-b3f0-dbd71a5ccbae} + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + {999dd0f9-53f0-47bd-90ea-714c0dea50d7} + + + + + + + + + + {4d826dd3-e455-46f3-8dfc-bb74551f3f00} + + + + + + + + {4d826dd3-e455-46f3-8dfc-bb74551f3f00} + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + {b2ea9c4f-8b35-46c3-b2a5-3f22d72069e7} + + + + + + + + + + {911f495e-313f-4b28-95d6-440b06a05a83} + + + + + + + + {911f495e-313f-4b28-95d6-440b06a05a83} + + + {3507c733-97ee-4b84-835b-4d90f039ca72} + {ff72261f-19e3-4983-b10c-856f6070637b} + + + + + + + + + + + + + + + + + + + + + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + + + + + + + + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + + + Profile + + + + + + + {9cfdd75f-182e-4511-bf4c-19f30309318e} + + + + + + + + {9cfdd75f-182e-4511-bf4c-19f30309318e} + + + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + {b2ea9c4f-8b35-46c3-b2a5-3f22d72069e7} + + + + + + + + + + {dc399de7-f3b9-4071-84af-b6e5dfa3affe} + + + + + + + + {dc399de7-f3b9-4071-84af-b6e5dfa3affe} + + + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + {f1e3fd14-d433-4d95-8ea4-1c4b5aaf4334} + + + + + + + + + + {4dc013fb-ced4-4cc0-99e3-3f4a32acebf7} + + + + + + + + {4dc013fb-ced4-4cc0-99e3-3f4a32acebf7} + + + {ab5f0d96-cf38-430d-bef3-b7bd78952fdb} + {96788086-5e67-482c-ac8b-0f2a7f0729ff} + + + + + + + + + + + + + + + + + + + + + {999dd0f9-53f0-47bd-90ea-714c0dea50d7} + + + + + + + + {999dd0f9-53f0-47bd-90ea-714c0dea50d7} + + + History + + + + + + + + + + {b2ea9c4f-8b35-46c3-b2a5-3f22d72069e7} + + + + + + + + {b2ea9c4f-8b35-46c3-b2a5-3f22d72069e7} + + + Settings + + + + + + + + + + {ff72261f-19e3-4983-b10c-856f6070637b} + + + + + + + + {ff72261f-19e3-4983-b10c-856f6070637b} + + + Action + + + + + + + + + + {f1e3fd14-d433-4d95-8ea4-1c4b5aaf4334} + + + + + + + + {f1e3fd14-d433-4d95-8ea4-1c4b5aaf4334} + + + Script + + + + + + + + + + {96788086-5e67-482c-ac8b-0f2a7f0729ff} + + + + + + + + {96788086-5e67-482c-ac8b-0f2a7f0729ff} + + + Cookie + + + + + + + + + + + + + + + + + + diff --git a/src/webengine/doc/images/qtwebengine-modules-model.qmodel b/src/webengine/doc/images/qtwebengine-modules-model.qmodel new file mode 100644 index 000000000..c1d64b617 --- /dev/null +++ b/src/webengine/doc/images/qtwebengine-modules-model.qmodel @@ -0,0 +1,500 @@ + + + + {4a2bfe98-50e2-435d-8702-93dc2ccbd56b} + + + + + + + + {11ff33c5-f533-494d-9add-55ea216b97a6} + + + qtwebengine-modules-model + + + + + + + {9e8325b8-5731-4c87-9203-fe941456ee06} + + + + + + + + + + {9e8325b8-5731-4c87-9203-fe941456ee06} + + + qtwebengine-modules-model + + + + + + + + + + + + {aee48ad9-14be-47bb-8ebf-1a9b44f1e219} + + + {4d3871a4-ad9d-4b1a-ab68-acfce8ba5f00} + Qt WebEngine Module + x:300;y:70 + x:-275;y:-145;w:550;h:290 + false + 0 + 0 + + + + + + + + + + + + + {b667049f-5302-4e68-8679-c26a7c4c37af} + + + {71104fca-42f0-4145-bf3a-afed38493c8b} + Qt WebEngine Module + Qt WebEngine + x:300;y:15 + x:-75;y:-35;w:150;h:70 + false + 0 + + + + + + + + + + + + + {6d84908c-9500-4b4f-95b8-b723ff8f2fc3} + + + {8e8c6646-1175-4ee1-aa02-cd5669cdf92a} + Qt WebEngine Module + Qt WebEngine Widgets + x:105;y:15 + x:-75;y:-35;w:150;h:70 + false + 0 + + + + + + + + + + + + + {d1260089-4eb6-4465-ac5f-e36ba1ef2311} + + + {c0946aaa-51df-48db-9ceb-351cd32089be} + Qt WebEngine Module + Qt WebEngine Process + x:495;y:15 + x:-75;y:-35;w:150;h:70 + 0 + + + + + + + + + + + + + {7e01513b-4cfc-4154-b445-a9b341b392a3} + + + {6ee7f00e-5dc3-4f45-a3ca-428390b4c74c} + Qt WebEngine Module + Qt WebEngine Core + x:300;y:150 + x:-270;y:-60;w:540;h:120 + false + 0 + + + + + + + + + + + + + {620a2a3d-3a6c-4afc-a9ba-e2a0651b81b8} + + + {ce1e329b-b2ec-465f-bbc7-3cc75160da1a} + Qt WebEngine Core + Chromium + x:300;y:165 + x:-260;y:-35;w:520;h:70 + false + 0 + + + + + + + + + + + + + {d0b02baa-0ce3-437e-a962-0896efb0b2d0} + + + {342a09ff-ab96-40d2-b9f9-300d1f2a067b} + {6d84908c-9500-4b4f-95b8-b723ff8f2fc3} + {7e01513b-4cfc-4154-b445-a9b341b392a3} + + + + + + + + + + + + + {e59a5c27-7bda-44f6-8b7d-a729c2d04ff5} + + + {45bf7ccd-aafc-4ec1-a846-bb2661aa9def} + {b667049f-5302-4e68-8679-c26a7c4c37af} + {7e01513b-4cfc-4154-b445-a9b341b392a3} + + + + + + + + + + + + + {8ae66be6-ad8a-442f-a85d-58e53a684249} + + + {6875416f-210d-4957-b0dc-d1a92a4238ef} + {d1260089-4eb6-4465-ac5f-e36ba1ef2311} + {7e01513b-4cfc-4154-b445-a9b341b392a3} + + + + + + + + 1469021602971 + General + + + + + + + + + + {4d3871a4-ad9d-4b1a-ab68-acfce8ba5f00} + + + + + + + + {4d3871a4-ad9d-4b1a-ab68-acfce8ba5f00} + + + Qt WebEngine Module + + + + + + + {71104fca-42f0-4145-bf3a-afed38493c8b} + + + + + + + + {71104fca-42f0-4145-bf3a-afed38493c8b} + + + Qt WebEngine + + + + + + + {45bf7ccd-aafc-4ec1-a846-bb2661aa9def} + + + + + + + + {45bf7ccd-aafc-4ec1-a846-bb2661aa9def} + + + {71104fca-42f0-4145-bf3a-afed38493c8b} + {6ee7f00e-5dc3-4f45-a3ca-428390b4c74c} + + + + + + + + + + + + + + + + + + + + + {8e8c6646-1175-4ee1-aa02-cd5669cdf92a} + + + + + + + + {8e8c6646-1175-4ee1-aa02-cd5669cdf92a} + + + Qt WebEngine Widgets + + + + + + + {342a09ff-ab96-40d2-b9f9-300d1f2a067b} + + + + + + + + {342a09ff-ab96-40d2-b9f9-300d1f2a067b} + + + {8e8c6646-1175-4ee1-aa02-cd5669cdf92a} + {6ee7f00e-5dc3-4f45-a3ca-428390b4c74c} + + + + + + + + + + {483712c1-3ec0-4271-b02e-b268de07897b} + + + + + + + + {483712c1-3ec0-4271-b02e-b268de07897b} + + + {8e8c6646-1175-4ee1-aa02-cd5669cdf92a} + {71104fca-42f0-4145-bf3a-afed38493c8b} + + + + + + + + + + + + + + + + + + + + + {c0946aaa-51df-48db-9ceb-351cd32089be} + + + + + + + + {c0946aaa-51df-48db-9ceb-351cd32089be} + + + Qt WebEngine Process + + + + + + + {6875416f-210d-4957-b0dc-d1a92a4238ef} + + + + + + + + {6875416f-210d-4957-b0dc-d1a92a4238ef} + + + {c0946aaa-51df-48db-9ceb-351cd32089be} + {6ee7f00e-5dc3-4f45-a3ca-428390b4c74c} + + + + + + + + + + + + + + + + + + + + + {6ee7f00e-5dc3-4f45-a3ca-428390b4c74c} + + + + + + + + {6ee7f00e-5dc3-4f45-a3ca-428390b4c74c} + + + Qt WebEngine Core + + + + + + + {ce1e329b-b2ec-465f-bbc7-3cc75160da1a} + + + + + + + + {ce1e329b-b2ec-465f-bbc7-3cc75160da1a} + + + Chromium + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/webengine/doc/images/qtwebenginewidgets-model.qmodel b/src/webengine/doc/images/qtwebenginewidgets-model.qmodel new file mode 100644 index 000000000..aa59f7b8f --- /dev/null +++ b/src/webengine/doc/images/qtwebenginewidgets-model.qmodel @@ -0,0 +1,789 @@ + + + + {388ed80a-d45a-4746-9b42-b201bdfbe66d} + + + + + + + + {cf413898-e1a1-48a2-be84-dee757d150e1} + + + qtwebenginewidgets-model + + + + + + + {cb7c93b6-ed69-4e54-bca7-23edd2432e88} + + + + + + + + + + {cb7c93b6-ed69-4e54-bca7-23edd2432e88} + + + qtwebenginewidgets-model + + + + + + + + + + + + {9d9a12d1-d237-4d4f-9b55-bdbbc99bd2b1} + + + {1a4983f6-27db-4f8c-90ed-f72df621c50f} + View + x:235;y:-280 + x:-45;y:-30;w:90;h:60 + 0 + + + + + + + + + + + + + {81687d47-fbb1-4843-a394-7d7e5e57a2ff} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + Page + x:235;y:-195 + x:-45;y:-30;w:90;h:60 + 0 + + + + + + + + + + + + + {e6d92a82-f898-448f-945e-26b508249746} + + + {99e69e48-e844-4fc0-942c-aacef280c616} + History + x:90;y:-110 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {9ba8a864-bd21-48e5-9df4-c7065d3ab474} + + + {6b572233-bf3a-43a2-bfe2-e61d57a59a2e} + Settings + x:235;y:-20 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {62872913-7080-421b-b12c-d3c094faa37d} + + + {8afe2dfe-878f-4c40-9f07-c6128611f853} + Profile + x:380;y:-110 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {54a21438-6274-4484-9225-97a47d3514ea} + + + {8e94476c-6a26-4bbc-b134-54a7203a0242} + {9d9a12d1-d237-4d4f-9b55-bdbbc99bd2b1} + {81687d47-fbb1-4843-a394-7d7e5e57a2ff} + + + + + + + + + + + + + {b3f6b700-e506-471b-9341-78a57b55fb20} + + + {48d2b9ae-8462-4c93-9772-77f2520e2bcb} + {81687d47-fbb1-4843-a394-7d7e5e57a2ff} + {e6d92a82-f898-448f-945e-26b508249746} + + + + + + + + + + + + + {5870be46-b8c5-480b-89d0-2ecd38fea9e1} + + + {2ec57f83-da38-4ed1-970c-d416a5f76425} + {81687d47-fbb1-4843-a394-7d7e5e57a2ff} + {62872913-7080-421b-b12c-d3c094faa37d} + + + + + + + + + + + + + {9140249c-7a62-4e4d-846a-398e794e34c6} + + + {9c6691bd-75e5-40af-a662-ecb04e60744e} + {62872913-7080-421b-b12c-d3c094faa37d} + {9ba8a864-bd21-48e5-9df4-c7065d3ab474} + + + + + + + + + + + + + {97fe6f5f-a947-4c62-880d-e2d9258814dd} + + + {2dfae517-4615-42b9-bb33-63369291468f} + Script + x:380;y:-20 + x:-45;y:-30;w:90;h:60 + 0 + + + + + + + + + + + + + {3cb4f4a2-0a1d-4adb-8b72-c438a8102a2b} + + + {8f64c8e2-637e-482e-8565-1bbdcd203709} + Action + x:235;y:-110 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {c962daa4-09b9-411d-a0d1-d1c7b9bd1489} + + + {31cff752-95b7-4994-a5fc-8794dd8a013f} + {62872913-7080-421b-b12c-d3c094faa37d} + {97fe6f5f-a947-4c62-880d-e2d9258814dd} + + + + + + + + + + + + + {a8f88107-5699-4e25-8945-1113d642fdd0} + + + {acca28ee-b184-4cbe-9aaa-befeac08c3bd} + {81687d47-fbb1-4843-a394-7d7e5e57a2ff} + {3cb4f4a2-0a1d-4adb-8b72-c438a8102a2b} + + + + + + + + + + + + + {6208171a-1515-424a-bb4e-5f115b4c21fa} + + + {b19ba8d3-84ca-4718-b62c-575aa5d95c95} + Cookie + x:525;y:-20 + x:-50;y:-30;w:100;h:60 + 0 + + + + + + + + + + + + + {57732b45-63fc-4d87-91fe-c9e9cbdd69ee} + + + {b98164e7-ff69-40e7-ac1b-fe4985f451e7} + {62872913-7080-421b-b12c-d3c094faa37d} + {6208171a-1515-424a-bb4e-5f115b4c21fa} + + + + + + + + 1455889165432 + General + + + + + + + + + + {1a4983f6-27db-4f8c-90ed-f72df621c50f} + + + + + + + + {1a4983f6-27db-4f8c-90ed-f72df621c50f} + + + View + + + + + + + {8e94476c-6a26-4bbc-b134-54a7203a0242} + + + + + + + + {8e94476c-6a26-4bbc-b134-54a7203a0242} + + + {1a4983f6-27db-4f8c-90ed-f72df621c50f} + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + + + + + + + + + + + + + + + + + + + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + + + + + + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + + + Page + + + + + + + {48d2b9ae-8462-4c93-9772-77f2520e2bcb} + + + + + + + + {48d2b9ae-8462-4c93-9772-77f2520e2bcb} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + {99e69e48-e844-4fc0-942c-aacef280c616} + + + + + + + + + + {2ec57f83-da38-4ed1-970c-d416a5f76425} + + + + + + + + {2ec57f83-da38-4ed1-970c-d416a5f76425} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + {8afe2dfe-878f-4c40-9f07-c6128611f853} + + + + + + + + + + {30d6d5e4-eb6b-4816-817d-5a921f823dae} + + + + + + + + {30d6d5e4-eb6b-4816-817d-5a921f823dae} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + {6b572233-bf3a-43a2-bfe2-e61d57a59a2e} + + + + + + + + + + {0011e11e-283e-4ad9-94b0-749d4465eac8} + + + + + + + + {0011e11e-283e-4ad9-94b0-749d4465eac8} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + {2dfae517-4615-42b9-bb33-63369291468f} + + + + + + + + + + {c354a766-0dba-439d-9f6c-538772784181} + + + + + + + + {c354a766-0dba-439d-9f6c-538772784181} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + {8f64c8e2-637e-482e-8565-1bbdcd203709} + + + + + + + + + + {acca28ee-b184-4cbe-9aaa-befeac08c3bd} + + + + + + + + {acca28ee-b184-4cbe-9aaa-befeac08c3bd} + + + {e9446d69-de53-47ab-974e-1b8ae8b6edd7} + {8f64c8e2-637e-482e-8565-1bbdcd203709} + + + + + + + + + + + + + + + + + + + + + {99e69e48-e844-4fc0-942c-aacef280c616} + + + + + + + + {99e69e48-e844-4fc0-942c-aacef280c616} + + + History + + + + + + + {bca413d3-d869-44ce-a68d-38e8ba6de291} + + + + + + + + {bca413d3-d869-44ce-a68d-38e8ba6de291} + + + {99e69e48-e844-4fc0-942c-aacef280c616} + {6b572233-bf3a-43a2-bfe2-e61d57a59a2e} + + + + + + + + + + + + + + + + + + + + + {6b572233-bf3a-43a2-bfe2-e61d57a59a2e} + + + + + + + + {6b572233-bf3a-43a2-bfe2-e61d57a59a2e} + + + Settings + + + + + + + + + + {8afe2dfe-878f-4c40-9f07-c6128611f853} + + + + + + + + {8afe2dfe-878f-4c40-9f07-c6128611f853} + + + Profile + + + + + + + {9c6691bd-75e5-40af-a662-ecb04e60744e} + + + + + + + + {9c6691bd-75e5-40af-a662-ecb04e60744e} + + + {8afe2dfe-878f-4c40-9f07-c6128611f853} + {6b572233-bf3a-43a2-bfe2-e61d57a59a2e} + + + + + + + + + + {31cff752-95b7-4994-a5fc-8794dd8a013f} + + + + + + + + {31cff752-95b7-4994-a5fc-8794dd8a013f} + + + {8afe2dfe-878f-4c40-9f07-c6128611f853} + {2dfae517-4615-42b9-bb33-63369291468f} + + + + + + + + + + {b98164e7-ff69-40e7-ac1b-fe4985f451e7} + + + + + + + + {b98164e7-ff69-40e7-ac1b-fe4985f451e7} + + + {8afe2dfe-878f-4c40-9f07-c6128611f853} + {b19ba8d3-84ca-4718-b62c-575aa5d95c95} + + + + + + + + + + + + + + + + + + + + + {2dfae517-4615-42b9-bb33-63369291468f} + + + + + + + + {2dfae517-4615-42b9-bb33-63369291468f} + + + Script + + + + + + + + + + {8f64c8e2-637e-482e-8565-1bbdcd203709} + + + + + + + + {8f64c8e2-637e-482e-8565-1bbdcd203709} + + + Action + + + + + + + + + + {b19ba8d3-84ca-4718-b62c-575aa5d95c95} + + + + + + + + {b19ba8d3-84ca-4718-b62c-575aa5d95c95} + + + Cookie + + + + + + + + + + + + + + + + + + -- cgit v1.2.1 From 78944ae2443b01e205403fa63c15213e9dff150d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 16:19:41 +0200 Subject: Doc: Move Platform notes into separate section in Overview Change-Id: I40d9c30dd33eb38d1d33c68df4cb4bbc3704c647 GPush-Base: 8ca4a41dfe6887c2637fe2e562f5314b56facd20 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index f226f6f06..c9c21d208 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -37,10 +37,6 @@ made fully editable by the user through the use of the \c{contenteditable} attribute on HTML elements. - For more information about the requirements for building Qt WebEngine from source on the - supported platforms and for other platform-specific information, see - \l{Qt WebEngine Platform Notes}. - \section1 Qt WebEngine Architecture \image qtwebengine-architecture.png @@ -226,6 +222,12 @@ The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set, delete, and intercept cookies during navigation. + \section1 Platform Notes + + Qt WebEngine currently supports only Windows, Linux, and OS X. Due to Chromium build + requirements it also often requires a newer compiler than the rest of Qt. See + \l{Qt WebEngine Platform Notes} for further details. + \section1 Related Modules Qt WebEngine supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit} -- cgit v1.2.1 From d199c598cd7756b03e032c7f01e58edebf8e8d21 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 16:25:41 +0200 Subject: Doc: Move WebKit comparison to porting guide Change-Id: I75d3f5641ccd402ea1a167d14533b70df5744ff7 GPush-Base: 8ca4a41dfe6887c2637fe2e562f5314b56facd20 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 5 +---- src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index c9c21d208..059c145bd 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -77,10 +77,7 @@ \section2 Qt WebEngine Core Module The Qt WebEngine core is based on the \l {Chromium Project}. Chromium provides its own network - and painting engines and is developed tightly together with its dependent modules, and - therefore Qt WebEngine provides better and more reliable support for the latest HTML5 - specification than Qt WebKit. However, Qt WebEngine is thus heavier than Qt WebKit and does - not provide direct access to the network stack and the HTML document through C++ APIs. + and painting engines and is developed tightly together with its dependent modules. Please note that Qt WebEngine is based on Chromium, but does not contain or use any services or add-ons that might be part of the Chrome browser that is built and delivered by Google. diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc index c21a58d73..5822f41b7 100644 --- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc +++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc @@ -35,6 +35,13 @@ \l{http://doc.qt.io/archives/qt-5.3/qml-qtwebkit-webview.html}{QWebView API} to use the \l{Qt WebEngine} QWebEngineView. + \section1 Architecture + + Chromium provides its own network and painting engines, which Qt WebEngine uses. This, among + other things, allows Qt WebEngine to provide better and more reliable support for the latest + HTML5 specification than Qt WebKit. However, Qt WebEngine is thus also heavier than Qt WebKit + and does not provide direct access to the network stack and the HTML document through C++ APIs. + \section1 Class Names The Qt WebEngine equivalent of Qt WebKit C++ classes are prefixed by -- cgit v1.2.1 From 0a3a32c62460a738ff0f1be1962749b8fc869465 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 16:26:39 +0200 Subject: Doc: Use \note tag Change-Id: Ie82c3b34974b391ca69f82d00165c0d46ad6b4af Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 059c145bd..cd5bb1742 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -79,7 +79,7 @@ The Qt WebEngine core is based on the \l {Chromium Project}. Chromium provides its own network and painting engines and is developed tightly together with its dependent modules. - Please note that Qt WebEngine is based on Chromium, but does not contain or use any services + \note Qt WebEngine is based on Chromium, but does not contain or use any services or add-ons that might be part of the Chrome browser that is built and delivered by Google. You can find more detailed information about the differences between Chromium and Chrome in this \l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview} -- cgit v1.2.1 From 90492d45cf51896fac541bd4f14970c6501a6716 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 17:21:22 +0200 Subject: Doc: Move mentioning of QSG in overview to WebEngineWidgets module Currently it was placed under WebEngineProcess, which is confusing. That the scene graph is used for the QtWebEngine module is probably not really interesting, but it's certainly suprising for Qt WebEngine Widgets, hence mention it there. Change-Id: I1a87b0b0d32cc2695c4dfa31aae56c517e39124e Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index cd5bb1742..e87b5fd2d 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -66,6 +66,10 @@ \e cookies. Profiles can be used to isolate pages from each other. A typical use case is a dedicated profile for a \e {private browsing} mode, where no information is permanently saved. + \note The Qt WebEngine Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph} + to compose the elements of a web page into one view. This means that the UI process + requires OpenGL ES 2.0 or OpenGL 2.0 for its rendering. + \section2 Qt WebEngine Module \image qtwebengine-model.png @@ -92,11 +96,6 @@ The Qt WebEngine Process renders web pages and executes JavaScript. - Chromium is tightly integrated to the \l{Qt Quick Scene Graph}{Qt Quick scene graph}, which is - based on OpenGL ES 2.0 or OpenGL 2.0 for its rendering. This provides you with one-pass - compositing of web content and all the Qt Quick UI. The integration to Chromium is transparent - to developers, who just work with Qt and JavaScript. - The document object model (DOM) of a page is constructed when the document is ready, typically when the page is completely loaded. Therefore, executing scripts as soon as a document is created is not suitable for DOM operations, where one has to wait until the DOM is ready. -- cgit v1.2.1 From d1a8eef9134fae8cd43fdbe2eee864a93497da90 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 17:24:33 +0200 Subject: Doc: Replace ambiguous reference to 'C++ implementation' Qt WebEngine and Qt WebEngine Core also have C++ API. Change-Id: I4fa4219cd9c0a984f736585caf84676e64f1155a Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index e87b5fd2d..512b4e208 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -74,9 +74,9 @@ \image qtwebengine-model.png - The Qt WebEngine QML implementation contains the same elements as the C++ implementation, - except that there is no separately accessible web engine page. The supported page functionality - is integrated into the web engine view. + The Qt WebEngine QML implementation contains the same elements as the Qt WebEngine Widgets + implementation, except that there is no separately accessible web engine page. + The supported page functionality is integrated into the web engine view. \section2 Qt WebEngine Core Module -- cgit v1.2.1 From d29884456544a95e7b23600424d54bc85392ed6b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 17:37:56 +0200 Subject: Doc: Condense documentation for Qt WebEngine Process Change-Id: Idf18d236816aab12fb01e1b5725e5ad1c73dbaad Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 512b4e208..5cf3a0eb0 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -94,7 +94,9 @@ \section2 Qt WebEngine Process - The Qt WebEngine Process renders web pages and executes JavaScript. + The Qt WebEngine Process is a separate executable that is used to render web pages and + execute JavaScript. This mitigates security issues and isolates crashes caused by specific + content. The document object model (DOM) of a page is constructed when the document is ready, typically when the page is completely loaded. Therefore, executing scripts as soon as a document is @@ -109,11 +111,6 @@ \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported. - Because the render process is separated from the GUI process, they should ideally share an - OpenGL context to enable one process to access the resources uploaded by the other, such as - images or textures. However, some inter-process communication is needed for safety and - reliability, because it enables restarting a crashed process. - \section1 Embedding Web Content into Widget Based Applications Use the QWebEngineView class to display web pages in the simplest way. Because it is a widget, -- cgit v1.2.1 From 1043c0507981c35047832c3d8e942c3840484b9a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Jun 2016 17:41:39 +0200 Subject: Doc: Move details about script injection in overview to separate section Change-Id: I51562b2dff1ffe4359c6db4a802c406c3706de84 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 5cf3a0eb0..3780e6288 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -98,19 +98,6 @@ execute JavaScript. This mitigates security issues and isolates crashes caused by specific content. - The document object model (DOM) of a page is constructed when the document is ready, typically - when the page is completely loaded. Therefore, executing scripts as soon as a document is - created is not suitable for DOM operations, where one has to wait until the DOM is ready. - - In addition, an injected script shares the same \e world as the other scripts executed on the - page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the - WebEngineScript QML type provide implementations of the Chromium API for - \e{Content Script Extensions}. They specify the - script to run, the injection point, and the world where the script is run. This enables - accessing the DOM to manipulate it within a world. - - \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported. - \section1 Embedding Web Content into Widget Based Applications Use the QWebEngineView class to display web pages in the simplest way. Because it is a widget, @@ -178,6 +165,24 @@ \skipto import \printuntil /^\}/ + \section1 Script Injection + + Qt WebEngine does not allow direct access to the document object model (DOM) of a page. + However, the DOM can be inspected and adapted by injecting scripts. + + The DOM of a page is constructed when the document is ready, typically + when the page is completely loaded. Therefore, executing scripts as soon as a document is + created is not suitable for DOM operations, where one has to wait until the DOM is ready. + + In addition, an injected script shares the same \e world as the other scripts executed on the + page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the + WebEngineScript QML type provide implementations of the Chromium API for + \e{Content Script Extensions}. They specify the + script to run, the injection point, and the world where the script is run. This enables + accessing the DOM to manipulate it within a world. + + \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported. + \section1 Managing Certificates Qt WebEngine uses its own network stack, and therefore QSslConfiguration is not used to -- cgit v1.2.1 From 5cb2aa149bbbdbaf45c1085b0736bb4501896827 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 22 Jul 2016 15:18:20 +0200 Subject: Doc: Link to QWebEngineProfile::downloadRequested from WebAction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-54644 Change-Id: Ief2e92e6baf3057cb4c1835557c51c4728c34ec0 Reviewed-by: Michael Brüning --- src/webengine/doc/src/webengineview.qdoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc index 5359c0349..c84a4d64f 100644 --- a/src/webengine/doc/src/webengineview.qdoc +++ b/src/webengine/doc/src/webengineview.qdoc @@ -756,7 +756,9 @@ \value ToggleMediaMute Mute or unmute the hovered audio or video element. (Added in Qt 5.6) \value DownloadLinkToDisk - Download the current link to the disk. (Added in Qt 5.6) + Download the current link to the disk. To implement download + actions, connect to the QWebEngineProfile::downloadRequested signal. + (Added in Qt 5.6) \value DownloadImageToDisk Download the highlighted image to the disk. (Added in Qt 5.6) \value DownloadMediaToDisk -- cgit v1.2.1 From 808ca6e6917cf17e4c30fcd3ac609164b36594cc Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 20 Jun 2016 11:15:20 +0200 Subject: Prevent a crash after having downloaded a file Since the profile owns the QWebEngineDownloadItem then it is likely that it will still be around when the QWebEngineProfile is deleted. As the QWebEngineDownloadItem is a child of the QWebEngineProfile then it will try to delete it when deleting the QWebEngineProfile which means it cannot trigger a function call into QWebEngineProfilePrivate. Change-Id: I51077a7857fb49a6708224a9e9942d17de6f6778 Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/api/qwebenginedownloaditem.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp index 9fdab3367..bb5fed8af 100644 --- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp +++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp @@ -84,7 +84,6 @@ QWebEngineDownloadItemPrivate::QWebEngineDownloadItemPrivate(QWebEngineProfilePr QWebEngineDownloadItemPrivate::~QWebEngineDownloadItemPrivate() { - profile->downloadDestroyed(downloadId); } void QWebEngineDownloadItemPrivate::update(const BrowserContextAdapterClient::DownloadItemInfo &info) -- cgit v1.2.1 From b6a0cd76dbb29e288bb041aca3125801126f8810 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 1 Jul 2016 15:54:16 +0200 Subject: Move core_generated.gyp to build directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes core_generated.gyp from being generated in the source directory to being generated in the build directory. Task-number: QTBUG-43014 Change-Id: Ia67df47bfadbf5dfca6e60a613dcf7b162b468fd Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- src/core/core.gyp | 12 ------------ src/core/core_gyp_generator.pro | 6 ++++-- src/core/gyp_run.pro | 2 +- src/core/qtwebengine.gypi | 2 +- src/core/resources/resources.gyp | 12 ++++++------ 6 files changed, 13 insertions(+), 23 deletions(-) delete mode 100644 src/core/core.gyp (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 79930a541..9d6566ee1 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 79930a541473b2e0f950d040c16ab6f22e4aeef3 +Subproject commit 9d6566ee193e8996fb867cf776dc13f697400f24 diff --git a/src/core/core.gyp b/src/core/core.gyp deleted file mode 100644 index ea5478cf1..000000000 --- a/src/core/core.gyp +++ /dev/null @@ -1,12 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'qtwebengine', - 'type': 'none', - 'dependencies': [ - 'core_generated.gyp:*', - 'resources/resources.gyp:*', - ], - }, - ] -} diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index 3fe66e41b..ec180d38e 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -2,8 +2,9 @@ # We want the gyp generation step to happen after all the other config steps. For that we need to prepend # our gyp_generator.prf feature to the CONFIG variable since it is processed backwards CONFIG = gyp_generator $$CONFIG -GYPFILE = $$PWD/core_generated.gyp -GYPINCLUDES += qtwebengine.gypi +GYPFILE = $$OUT_PWD/core_generated.gyp +GYPINCLUDES += $$PWD/qtwebengine.gypi +GYPSRCDIR = $$PWD TEMPLATE = lib @@ -19,6 +20,7 @@ DEFINES += QT_NO_KEYWORDS \ # Ensure that response files, generated by qtbase/mkspecs/features/moc.prf, are found by moc. MOC_DIR = $$OUT_PWD/$$getConfigDir()/.moc +RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc # Assume that we want mobile touch and low-end hardware behaviors # whenever we are cross compiling. diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index 36548ff6b..885df908c 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -120,7 +120,7 @@ contains(WEBENGINE_CONFIG, use_proprietary_codecs): GYP_CONFIG += proprietary_co for (config, GYP_CONFIG): GYP_ARGS += "-D $$config" !build_pass { - message("Running gyp_qtwebengine \"$$OUT_PWD\" $${GYP_ARGS}...") + message("Running gyp_qtwebengine \"$$OUT_PWD\" $${GYP_ARGS}.") !system("python $$QTWEBENGINE_ROOT/tools/buildscripts/gyp_qtwebengine \"$$OUT_PWD\" $${GYP_ARGS}"): error("-- running gyp_qtwebengine failed --") } diff --git a/src/core/qtwebengine.gypi b/src/core/qtwebengine.gypi index fc5f17281..585f22324 100644 --- a/src/core/qtwebengine.gypi +++ b/src/core/qtwebengine.gypi @@ -36,7 +36,7 @@ '<(chromium_src_dir)/url/url.gyp:url_lib', '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', - 'chrome_qt.gyp:chrome_qt', + '<(qtwebengine_root)/src/core/chrome_qt.gyp:chrome_qt', ], 'include_dirs': [ '<(chromium_src_dir)', diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp index c37172a5c..9dcdaf0d1 100644 --- a/src/core/resources/resources.gyp +++ b/src/core/resources/resources.gyp @@ -13,16 +13,16 @@ 'qt_install_data%': '', 'qt_install_translations%': '', }, - 'dependencies': [ - '<(chromium_src_dir)/content/app/strings/content_strings.gyp:content_strings', - '<(chromium_src_dir)/blink/public/blink_resources.gyp:blink_resources', - '<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources', - '../chrome_qt.gyp:chrome_resources', - ], 'targets': [ { 'target_name': 'qtwebengine_resources', 'type': 'none', + 'dependencies': [ + '<(chromium_src_dir)/content/app/strings/content_strings.gyp:content_strings', + '<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources', + '<(chromium_src_dir)/third_party/WebKit/public/blink_resources.gyp:blink_resources', + '<(qtwebengine_root)/src/core/chrome_qt.gyp:chrome_resources', + ], 'actions' : [ { 'action_name': 'repack_resources', -- cgit v1.2.1 From fa138d4a76e9e820f01a75771c30dbced8c4e6f3 Mon Sep 17 00:00:00 2001 From: Erwin Kandler Date: Thu, 30 Jun 2016 10:48:48 +0200 Subject: Do not use proxy when connecting to localhost Chromium does not exclude localhost connection from its proxy rules by default. When using a qt proxy with any other form of qt-based connections, connections to localhost are excluded by default. This patch adds localhost connections to the proxy-bypass rules. Change-Id: I76c43a2ae0de8d8fad455445a64a739c6c6b40f0 Reviewed-by: Allan Sandfeld Jensen --- src/core/proxy_config_service_qt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/core/proxy_config_service_qt.cpp b/src/core/proxy_config_service_qt.cpp index fc0959eef..d966e275d 100644 --- a/src/core/proxy_config_service_qt.cpp +++ b/src/core/proxy_config_service_qt.cpp @@ -131,6 +131,7 @@ net::ProxyConfigService::ConfigAvailability ProxyConfigServiceQt::GetLatestProxy qtRules.type = net::ProxyConfig::ProxyRules::TYPE_NO_RULES; } + qtRules.bypass_rules.AddRuleToBypassLocal(); // don't use proxy for connections to localhost m_qtProxyConfig.proxy_rules() = qtRules; *config = m_qtProxyConfig; return CONFIG_VALID; -- cgit v1.2.1