From e263573db93c4e2cbf42e6d8d3508415f1354d50 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 8 Jun 2016 15:16:12 +0200 Subject: Don't cancel an IME composition when a modifier key is pressed. When an asian IME is used to compose a new word, and a modifier key is pressed (shift, alt, etc), WebEngine would notify Chromium to cancel the composition, thus clearing the text. But the actual IME window would still be present, and if another "letter" key was pressed, the composition would continue with the previous pre-edit text, which leads to unusual text flickering. The previous behavior was introduced in 31efe25d14 to fix a Windows double character input bug. The current change makes sure to clear the IME composition only in case the last received QInputMethodEvent pre-edit and commit strings were empty, which is not the case when pressing a modifier key for instance. Change-Id: Ic968404c90e1e0eb703fe1c2849990467bedd5e1 Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 7 ++++++- src/core/render_widget_host_view_qt.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 24b148ca5..bb024c557 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -259,6 +259,7 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget , m_didFirstVisuallyNonEmptyLayout(false) , m_adapterClient(0) , m_imeInProgress(false) + , m_receivedEmptyImeText(false) , m_anchorPositionWithinSelection(0) , m_cursorPositionWithinSelection(0) , m_initPending(false) @@ -961,7 +962,7 @@ void RenderWidgetHostViewQt::handleKeyEvent(QKeyEvent *ev) if (IsMouseLocked() && ev->key() == Qt::Key_Escape && ev->type() == QEvent::KeyRelease) UnlockMouse(); - if (m_imeInProgress) { + if (m_imeInProgress && m_receivedEmptyImeText) { // IME composition was not finished with a valid commit string. // We're getting the composition result in a key event. if (ev->key() != 0) { @@ -1039,6 +1040,7 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) : gfx::Range::InvalidRange(); m_host->ImeConfirmComposition(toString16(commitString), replacementRange, false); m_imeInProgress = false; + m_receivedEmptyImeText = false; } else if (!preeditString.isEmpty()) { if (!selectionRange.IsValid()) { // We did not receive a valid selection range, hence the range is going to mark the cursor position. @@ -1048,6 +1050,9 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) } m_host->ImeSetComposition(toString16(preeditString), underlines, selectionRange.start(), selectionRange.end()); m_imeInProgress = true; + m_receivedEmptyImeText = false; + } else { + m_receivedEmptyImeText = true; } } diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 2e6563a67..5a0ea6f03 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -232,6 +232,7 @@ private: ui::TextInputType m_currentInputType; bool m_imeInProgress; + bool m_receivedEmptyImeText; QRect m_cursorRect; size_t m_anchorPositionWithinSelection; size_t m_cursorPositionWithinSelection; -- cgit v1.2.3 From afc9e2d9674f7ab5800df4803cc68c71d1ae691a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 9 Jun 2016 10:38:17 +0200 Subject: Commit the done-so-far IME composition on mouse click. Before this change, it was possible to select parts of the pre-edit text in an ongoing IME composition, by click-dragging with the mouse (which also looked wrong, because the styling of the text did not change to a selection box to signal selection). This is inconsistent with how Chrome does it, which commits the pre-edit string entered so far, when clicking anywhere in the content area or in the input. This change makes sure to commit the pre-edit string when a mouse click is done anywhere on the displayed web page. The behavior was present on Windows and Linux. Change-Id: I9cb148c591b5d09fb4dd477ae96c29ca32cc34de Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index bb024c557..ef7367e06 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -954,6 +954,19 @@ void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event) QCursor::setPos(m_lockedMousePosition); } + if (m_imeInProgress && event->type() == QMouseEvent::MouseButtonPress) { + m_imeInProgress = false; + // Tell input method to commit the pre-edit string entered so far, and finish the + // composition operation. +#ifdef Q_OS_WIN + // Yes the function name is counter-intuitive, but commit isn't actually implemented + // by the Windows QPA, and reset does exactly what is necessary in this case. + qApp->inputMethod()->reset(); +#else + qApp->inputMethod()->commit(); +#endif + } + m_host->ForwardMouseEvent(webEvent); } -- cgit v1.2.3 From ad568f115e9043cc0f689d2674e1df450f2631aa Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 10 Jun 2016 11:46:05 +0200 Subject: Fix backspace to work when removing last IME char. Currently when composing a word using an IME, and backspace is pressed to remove the last character present in the pre-edit string, instead of the character being removed, nothing happens. In reality the character is removed, but Chromium isn't notified of it, and the change will be seen only after another key is pressed. Fix consists in notifying Chromium to cancel the IME composition when both the pre-edit string and the commit string are empty. There is still an issue with japanese, when trying to input "aaa", press space, then "b" and you don't see the "b" until you press one more key. Change-Id: Idf2ef4888caead26d19eabbbdf4f98fbee601049 Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index ef7367e06..15be52b97 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -975,15 +975,16 @@ void RenderWidgetHostViewQt::handleKeyEvent(QKeyEvent *ev) if (IsMouseLocked() && ev->key() == Qt::Key_Escape && ev->type() == QEvent::KeyRelease) UnlockMouse(); - if (m_imeInProgress && m_receivedEmptyImeText) { + if (m_receivedEmptyImeText) { // IME composition was not finished with a valid commit string. // We're getting the composition result in a key event. if (ev->key() != 0) { // The key event is not a result of an IME composition. Cancel IME. m_host->ImeCancelComposition(); - m_imeInProgress = false; + m_receivedEmptyImeText = false; } else { if (ev->type() == QEvent::KeyRelease) { + m_receivedEmptyImeText = false; m_host->ImeConfirmComposition(toString16(ev->text()), gfx::Range::InvalidRange(), false); m_imeInProgress = false; @@ -1065,7 +1066,26 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) m_imeInProgress = true; m_receivedEmptyImeText = false; } else { - m_receivedEmptyImeText = true; + // There are so-far two known cases, when an empty QInputMethodEvent is received. + // First one happens when backspace is used to remove the last character in the pre-edit + // string, thus signaling the end of the composition. + // The second one happens (on Windows) when a Korean char gets composed, but instead of + // the event having a commit string, both strings are empty, and the actual char is received + // as a QKeyEvent after the QInputMethodEvent is processed. + // In lieu of the second case, we can't simply cancel the composition on an empty event, + // and then add the Korean char when QKeyEvent is received, because that leads to text + // flickering in the textarea (or any other element). + // Instead we postpone the processing of the empty QInputMethodEvent by posting it + // to the same focused object, and cancelling the composition on the next event loop tick. + if (!m_receivedEmptyImeText && m_imeInProgress) { + m_receivedEmptyImeText = true; + m_imeInProgress = false; + QInputMethodEvent *eventCopy = new QInputMethodEvent(*ev); + QGuiApplication::postEvent(qApp->focusObject(), eventCopy); + } else { + m_receivedEmptyImeText = false; + m_host->ImeCancelComposition(); + } } } -- cgit v1.2.3 From 089f7968b4a730d88468211ab06208f43bb0613d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 10 Jun 2016 18:08:32 +0200 Subject: Handle IME events which contain both preedit and commit strings. Currently if a QInputMethodEvent is received, which contains text in both the pre-edit and commit strings, Chromium would only show the commit string in the text input (or other html element). The IME though still knows about the non-empty pre-edit string, which means that if another key is pressed, Chromium will suddenly show the content of the previous pre-edit string AND the result of the new key press. To fix this, WebEngine will now properly set the pre-edit string as the new composition, after confirming the previous commit string. Change-Id: If22dd2038aca35a6fe6bb58a521f0a7124c7d468 Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 38 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 15be52b97..4ba7da7fc 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1024,6 +1024,25 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) const QList &attributes = ev->attributes(); std::vector underlines; + auto ensureValidSelectionRange = [&]() { + if (!selectionRange.IsValid()) { + // We did not receive a valid selection range, hence the range is going to mark the + // cursor position. + int newCursorPosition = + (cursorPositionInPreeditString < 0) ? preeditString.length() + : cursorPositionInPreeditString; + selectionRange.set_start(newCursorPosition); + selectionRange.set_end(newCursorPosition); + } + }; + + auto setCompositionForPreEditString = [&](){ + ensureValidSelectionRange(); + m_host->ImeSetComposition(toString16(preeditString), + underlines, + selectionRange.start(), + selectionRange.end()); + }; Q_FOREACH (const QInputMethodEvent::Attribute &attribute, attributes) { switch (attribute.type) { @@ -1053,16 +1072,19 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) gfx::Range replacementRange = (replacementLength > 0) ? gfx::Range(replacementStart, replacementStart + replacementLength) : gfx::Range::InvalidRange(); m_host->ImeConfirmComposition(toString16(commitString), replacementRange, false); - m_imeInProgress = false; + + // We might get a commit string and a pre-edit string in a single event, which means + // we need to confirm the last composition, and start a new composition. + if (!preeditString.isEmpty()) { + setCompositionForPreEditString(); + m_imeInProgress = true; + } else { + m_imeInProgress = false; + } m_receivedEmptyImeText = false; + } else if (!preeditString.isEmpty()) { - if (!selectionRange.IsValid()) { - // We did not receive a valid selection range, hence the range is going to mark the cursor position. - int newCursorPosition = (cursorPositionInPreeditString < 0) ? preeditString.length() : cursorPositionInPreeditString; - selectionRange.set_start(newCursorPosition); - selectionRange.set_end(newCursorPosition); - } - m_host->ImeSetComposition(toString16(preeditString), underlines, selectionRange.start(), selectionRange.end()); + setCompositionForPreEditString(); m_imeInProgress = true; m_receivedEmptyImeText = false; } else { -- cgit v1.2.3 From 323f300fd54d3fdb6f7a4565f305b631a27e76d5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 13 Jun 2016 10:18:29 +0200 Subject: Always show caret when editing an IME pre-edit string. Previously while entering a Japanese succession of characters, followed by transforming a substring into a word suggestion, the caret would disappear, and pressing the arrow keys would not indicate which part of the pre-edit string will be transformed next. This change makes sure the caret is always present, to indicate which part of the pre-edit string will be replaced by a possible IME suggestion. Change-Id: I350310c198bcacf0bcb48217f84b08e95ab8e8ef Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 4ba7da7fc..deb273f49 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1056,8 +1056,11 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) break; } case QInputMethodEvent::Cursor: - if (attribute.length) - cursorPositionInPreeditString = attribute.start; + // Always set the position of the cursor, even if it's marked invisible by Qt, otherwise + // there is no way the user will know which part of the composition string will be + // changed, when performing an IME-specific action (like selecting a different word + // suggestion). + cursorPositionInPreeditString = attribute.start; break; case QInputMethodEvent::Selection: selectionRange.set_start(qMin(attribute.start, (attribute.start + attribute.length))); -- cgit v1.2.3 From aceda160982dd6faba1a80065c9c1e52c549da2c Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 15 Jun 2016 14:54:38 +0200 Subject: Make all examples high-dpi aware Setting the Qt::AA_EnableHighDpiScaling attribute makes sure that the scrollbars are scaled, and that the default zoom level is sensible. Task-number: QTBUG-54113 Change-Id: I0ae7eb97cb9e2824e7f9b92d77cf2986cac66685 Reviewed-by: Allan Sandfeld Jensen --- examples/webengine/minimal/doc/src/minimal.qdoc | 7 +++++-- examples/webengine/minimal/main.cpp | 2 ++ examples/webengine/quicknanobrowser/main.cpp | 2 ++ examples/webenginewidgets/contentmanipulation/main.cpp | 1 + examples/webenginewidgets/cookiebrowser/main.cpp | 1 + examples/webenginewidgets/demobrowser/main.cpp | 1 + examples/webenginewidgets/markdowneditor/main.cpp | 1 + examples/webenginewidgets/minimal/doc/src/minimal.qdoc | 5 ++++- examples/webenginewidgets/minimal/main.cpp | 1 + examples/webenginewidgets/simplebrowser/main.cpp | 2 ++ 10 files changed, 20 insertions(+), 3 deletions(-) diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webengine/minimal/doc/src/minimal.qdoc index c0b89ba5a..5d7ca45e7 100644 --- a/examples/webengine/minimal/doc/src/minimal.qdoc +++ b/examples/webengine/minimal/doc/src/minimal.qdoc @@ -50,8 +50,11 @@ \skipto #include \printto main - In the main function we first instantiate a QGuiApplication object. - We then call \l{QtWebEngine::initialize}, which makes sure that OpenGL + In the \c main function we first set the Qt::AA_EnableHighDpiScaling + attribute. This lets the web view automatically scale on high-dpi displays. + Then we instantiate a QGuiApplication object. + + Next, we call \l{QtWebEngine::initialize}, which makes sure that OpenGL contexts can be shared between the main process and the dedicated renderer process (\c QtWebEngineProcess). This method needs to be called before any OpenGL context is created. diff --git a/examples/webengine/minimal/main.cpp b/examples/webengine/minimal/main.cpp index cc5a1f61e..099b70707 100644 --- a/examples/webengine/minimal/main.cpp +++ b/examples/webengine/minimal/main.cpp @@ -44,7 +44,9 @@ int main(int argc, char *argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); + QtWebEngine::initialize(); QQmlApplicationEngine engine; diff --git a/examples/webengine/quicknanobrowser/main.cpp b/examples/webengine/quicknanobrowser/main.cpp index b7ab03699..31ab26f6f 100644 --- a/examples/webengine/quicknanobrowser/main.cpp +++ b/examples/webengine/quicknanobrowser/main.cpp @@ -68,6 +68,8 @@ static QUrl startupUrl() int main(int argc, char **argv) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + Application app(argc, argv); QtWebEngine::initialize(); diff --git a/examples/webenginewidgets/contentmanipulation/main.cpp b/examples/webenginewidgets/contentmanipulation/main.cpp index a21d881f4..2c6f77c60 100644 --- a/examples/webenginewidgets/contentmanipulation/main.cpp +++ b/examples/webenginewidgets/contentmanipulation/main.cpp @@ -44,6 +44,7 @@ int main(int argc, char * argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); QUrl url; diff --git a/examples/webenginewidgets/cookiebrowser/main.cpp b/examples/webenginewidgets/cookiebrowser/main.cpp index c122eb7c3..15a87609b 100644 --- a/examples/webenginewidgets/cookiebrowser/main.cpp +++ b/examples/webenginewidgets/cookiebrowser/main.cpp @@ -45,6 +45,7 @@ int main(int argc, char *argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); MainWindow window(QUrl("http://qt.io")); window.show(); diff --git a/examples/webenginewidgets/demobrowser/main.cpp b/examples/webenginewidgets/demobrowser/main.cpp index 125d92dc2..7bb55780f 100644 --- a/examples/webenginewidgets/demobrowser/main.cpp +++ b/examples/webenginewidgets/demobrowser/main.cpp @@ -44,6 +44,7 @@ int main(int argc, char **argv) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); Q_INIT_RESOURCE(data); BrowserApplication application(argc, argv); if (!application.isTheOnlyBrowser()) diff --git a/examples/webenginewidgets/markdowneditor/main.cpp b/examples/webenginewidgets/markdowneditor/main.cpp index 73fe58199..a99f401cb 100644 --- a/examples/webenginewidgets/markdowneditor/main.cpp +++ b/examples/webenginewidgets/markdowneditor/main.cpp @@ -45,6 +45,7 @@ int main(int argc, char *argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); MainWindow window; diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc index 22f28e604..dd6a70566 100644 --- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc +++ b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc @@ -42,7 +42,10 @@ \section1 The Code - In \c main.cpp we instantiate a QApplication and a QWebEngineView. The URL + In the \c main function we first set the Qt::AA_EnableHighDpiScaling. + This lets the web view automatically scale on high-dpi displays. + + Next, we instantiate a QApplication and a QWebEngineView. The URL to load is set by calling \l QWebEngineView::setUrl. The view widget is given a reasonable default size, and shown. Finally, QApplication::exec() launches the main event loop. diff --git a/examples/webenginewidgets/minimal/main.cpp b/examples/webenginewidgets/minimal/main.cpp index d9a137739..729d68fa0 100644 --- a/examples/webenginewidgets/minimal/main.cpp +++ b/examples/webenginewidgets/minimal/main.cpp @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); QWebEngineView view; diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp index 750e7ae43..be08c1cb0 100644 --- a/examples/webenginewidgets/simplebrowser/main.cpp +++ b/examples/webenginewidgets/simplebrowser/main.cpp @@ -56,6 +56,8 @@ QString getCommandLineUrlArgument() int main(int argc, char **argv) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication app(argc, argv); app.setWindowIcon(QIcon(QLatin1String(":simplebrowser.svg"))); -- cgit v1.2.3 From 7494836e3a1e61a000fa0f73f91665fa291ec287 Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Mon, 20 Jun 2016 10:24:09 +0200 Subject: Remove infinite loop when loading history. Add a flag to let checkForExpired remove the entries directly. Task-number: QTBUG-54222 Change-Id: Iddac9e50f645d74b95d0ea13ed76d7f858ddd137 Reviewed-by: Allan Sandfeld Jensen --- examples/webenginewidgets/demobrowser/history.cpp | 10 +++++++--- examples/webenginewidgets/demobrowser/history.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/webenginewidgets/demobrowser/history.cpp b/examples/webenginewidgets/demobrowser/history.cpp index 72f96ed4e..ff8258647 100644 --- a/examples/webenginewidgets/demobrowser/history.cpp +++ b/examples/webenginewidgets/demobrowser/history.cpp @@ -127,7 +127,7 @@ void HistoryManager::setHistory(const QList &history, bool loadedAn if (!loadedAndSorted) qSort(m_history.begin(), m_history.end()); - checkForExpired(); + checkForExpired(loadedAndSorted); if (loadedAndSorted) { m_lastSavedUrl = m_history.value(0).url; @@ -153,7 +153,7 @@ HistoryTreeModel *HistoryManager::historyTreeModel() const return m_historyTreeModel; } -void HistoryManager::checkForExpired() +void HistoryManager::checkForExpired(bool removeEntriesDirectly) { if (m_historyLimit < 0 || m_history.isEmpty()) return; @@ -175,7 +175,11 @@ void HistoryManager::checkForExpired() const HistoryItem& item = m_history.last(); // remove from saved file also m_lastSavedUrl = QString(); - emit entryRemoved(item); + + if (removeEntriesDirectly) + m_history.takeLast(); + else + emit entryRemoved(item); } if (nextTimeout > 0) diff --git a/examples/webenginewidgets/demobrowser/history.h b/examples/webenginewidgets/demobrowser/history.h index 2766dd91e..edf7722c4 100644 --- a/examples/webenginewidgets/demobrowser/history.h +++ b/examples/webenginewidgets/demobrowser/history.h @@ -116,7 +116,7 @@ public slots: private slots: void save(); - void checkForExpired(); + void checkForExpired(bool removeExpiredEntriesDirectly = false); protected: void addHistoryItem(const HistoryItem &item); -- cgit v1.2.3 From 7b61d27d51371cca3a4eabf5bb24b0a7509750cc Mon Sep 17 00:00:00 2001 From: Adam Kallai Date: Mon, 20 Jun 2016 16:31:14 +0200 Subject: Doc: Fix the documentation of WebEngineContextMenuData Change-Id: I7ce66ad2f1c1c6a408637c5c541cba22c7260591 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebenginecontextmenudata.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/webengine/api/qquickwebenginecontextmenudata.cpp b/src/webengine/api/qquickwebenginecontextmenudata.cpp index 684903ec0..979d80e34 100644 --- a/src/webengine/api/qquickwebenginecontextmenudata.cpp +++ b/src/webengine/api/qquickwebenginecontextmenudata.cpp @@ -74,7 +74,7 @@ QQuickWebEngineContextMenuData::~QQuickWebEngineContextMenuData() } /*! - \qmlproperty bool WebEngineDownloadItem::isValid + \qmlproperty bool WebEngineContextMenuData::isValid Is \c true if the context data is valid; otherwise \c false. */ @@ -84,7 +84,7 @@ bool QQuickWebEngineContextMenuData::isValid() const } /*! - \qmlproperty QPoint WebEngineDownloadItem::position + \qmlproperty QPoint WebEngineContextMenuData::position Returns the position of the context, usually the mouse position where the context menu event was triggered. @@ -95,7 +95,7 @@ QPoint QQuickWebEngineContextMenuData::position() const } /*! - \qmlproperty QString WebEngineDownloadItem::linkText + \qmlproperty QString WebEngineContextMenuData::linkText Returns the text of a link if the context is a link. */ @@ -105,7 +105,7 @@ QString QQuickWebEngineContextMenuData::linkText() const } /*! - \qmlproperty QUrl WebEngineDownloadItem::linkUrl + \qmlproperty QUrl WebEngineContextMenuData::linkUrl Returns the URL of a link if the context is a link. */ @@ -115,7 +115,7 @@ QUrl QQuickWebEngineContextMenuData::linkUrl() const } /*! - \qmlproperty QString WebEngineDownloadItem::selectedText + \qmlproperty QString WebEngineContextMenuData::selectedText Returns the selected text of the context. */ @@ -125,7 +125,7 @@ QString QQuickWebEngineContextMenuData::selectedText() const } /*! - \qmlproperty QUrl WebEngineDownloadItem::mediaUrl + \qmlproperty QUrl WebEngineContextMenuData::mediaUrl If the context is a media element, returns the URL of that media. */ @@ -135,7 +135,7 @@ QUrl QQuickWebEngineContextMenuData::mediaUrl() const } /*! - \qmlproperty MediaType WebEngineDownloadItem::mediaType + \qmlproperty MediaType WebEngineContextMenuData::mediaType Returns the type of the media element or \c MediaTypeNone if the context is not a media element. @@ -161,7 +161,7 @@ QQuickWebEngineContextMenuData::MediaType QQuickWebEngineContextMenuData::mediaT } /*! - \qmlproperty bool WebEngineDownloadItem::isContentEditable + \qmlproperty bool WebEngineContextMenuData::isContentEditable Returns \c true if the content is editable by the user; otherwise returns \c false. */ -- cgit v1.2.3 From 56bea56b2d8fabc4b09d41531177a22d9297ce2c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 21 Jun 2016 18:14:10 +0200 Subject: Fix python version check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chromium requires python version 2.7.6. Adjust the python version check accordingly. Change-Id: I988371a1c132e63f3c57b3aeacdc1a50a8cf2dce Reviewed-by: Michael Brüning --- tools/qmake/mkspecs/features/functions.prf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 9e8886e86..33bebb47a 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -55,16 +55,20 @@ defineTest(isPlatformSupported) { } defineTest(isPythonVersionSupported) { - python_error_msg = "Python version 2 (2.7 or later) is required to build Qt WebEngine." - python_major_version = $$system('python -c "import sys; print(sys.version_info[0])"') + python_error_msg = "Python version 2 (2.7.6 or later) is required to build Qt WebEngine." + python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"') + python_version ~= s/[()]//g + python_version = $$split(python_version, ',') + python_major_version = $$first(python_version) greaterThan(python_major_version, 2) { skipBuild("Python version 3 is not supported by Chromium.") skipBuild($$python_error_msg) return(false) } - python_minor_version = $$system('python -c "import sys; print(sys.version_info[1])"') - greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true) - skipBuild("Using Python version "$$python_major_version"."$$python_minor_version".") + python_minor_version = $$member(python_version, 1) + python_patch_version = $$member(python_version, 2) + greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 5): return(true) + skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") skipBuild($$python_error_msg) return(false) } -- cgit v1.2.3 From e0bd650cb7f8c8fd3014541b4c49104906e0e139 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 20 Jun 2016 17:14:35 +0200 Subject: Override short-cuts to common editor commands To ensure Chromium is given a chance to handle editor commands, we must override these short-cuts. On OS X we must also perform the action afterwards as these are not handled internally by the Blink Editor. The patch solves copy/paste in flash plugins and copy/paste on OS X when no application short-cuts have been defined. The handling of short-cut override events is based on how it was handled in Qt WebKit Task-number: QTBUG-54221 Change-Id: I748671c7bfa5662aae16c6a4b9bbe5e2bce1b907 Reviewed-by: Alexandru Croitor --- src/webengine/api/qquickwebengineview.cpp | 33 ++++++++++++++++++++ src/webengine/api/qquickwebengineview_p_p.h | 2 ++ .../render_widget_host_view_qt_delegate_quick.cpp | 12 ++++++++ .../render_widget_host_view_qt_delegate_quick.h | 1 + src/webenginewidgets/api/qwebenginepage.cpp | 36 ++++++++++++++++++++++ src/webenginewidgets/api/qwebenginepage_p.h | 2 ++ .../render_widget_host_view_qt_delegate_widget.cpp | 7 +++++ 7 files changed, 93 insertions(+) diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 357f95bc4..6b3614fc5 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -86,6 +86,27 @@ QT_BEGIN_NAMESPACE using namespace QtWebEngineCore; +QQuickWebEngineView::WebAction editorActionForKeyEvent(QKeyEvent* event) +{ + static struct { + QKeySequence::StandardKey standardKey; + QQuickWebEngineView::WebAction action; + } editorActions[] = { + { QKeySequence::Cut, QQuickWebEngineView::Cut }, + { QKeySequence::Copy, QQuickWebEngineView::Copy }, + { QKeySequence::Paste, QQuickWebEngineView::Paste }, + { QKeySequence::Undo, QQuickWebEngineView::Undo }, + { QKeySequence::Redo, QQuickWebEngineView::Redo }, + { QKeySequence::SelectAll, QQuickWebEngineView::SelectAll }, + { QKeySequence::UnknownKey, QQuickWebEngineView::NoWebAction } + }; + for (int i = 0; editorActions[i].standardKey != QKeySequence::UnknownKey; ++i) + if (event == editorActions[i].standardKey) + return editorActions[i].action; + + return QQuickWebEngineView::NoWebAction; +} + #ifndef QT_NO_ACCESSIBILITY static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object) { @@ -489,6 +510,18 @@ void QQuickWebEngineViewPrivate::focusContainer() void QQuickWebEngineViewPrivate::unhandledKeyEvent(QKeyEvent *event) { Q_Q(QQuickWebEngineView); +#ifdef Q_OS_OSX + if (event->type() == QEvent::KeyPress) { + QQuickWebEngineView::WebAction action = editorActionForKeyEvent(event); + if (action != QQuickWebEngineView::NoWebAction) { + // Try triggering a registered short-cut + if (QGuiApplicationPrivate::instance()->shortcutMap.tryShortcut(event)) + return; + q->triggerWebAction(action); + return; + } + } +#endif if (q->parentItem()) q->window()->sendEvent(q->parentItem(), event); } diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index 2a6c2c879..aab86bc3a 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -68,6 +68,8 @@ class QQmlComponent; class QQmlContext; class QQuickWebEngineSettings; +QQuickWebEngineView::WebAction editorActionForKeyEvent(QKeyEvent* event); + #ifdef ENABLE_QML_TESTSUPPORT_API class QQuickWebEngineTestSupport; #endif diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index cd8fc54b9..b10ca8bdb 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -207,6 +207,18 @@ void RenderWidgetHostViewQtDelegateQuick::inputMethodStateChanged(bool editorVis } +bool RenderWidgetHostViewQtDelegateQuick::event(QEvent *event) +{ + if (event->type() == QEvent::ShortcutOverride) { + if (editorActionForKeyEvent(static_cast(event)) != QQuickWebEngineView::NoWebAction) { + event->accept(); + return true; + } + } + + return QQuickItem::event(event); +} + void RenderWidgetHostViewQtDelegateQuick::focusInEvent(QFocusEvent *event) { m_client->forwardEvent(event); diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h index 7c44da9b9..dc0e481db 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h @@ -74,6 +74,7 @@ public: virtual void setClearColor(const QColor &) Q_DECL_OVERRIDE { } protected: + virtual bool event(QEvent *event) Q_DECL_OVERRIDE; virtual void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; virtual void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; virtual void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 0279c9343..45177d8d8 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -77,6 +77,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE using namespace QtWebEngineCore; @@ -96,6 +98,27 @@ static QWebEnginePage::WebWindowType toWindowType(WebContentsAdapterClient::Wind } } +QWebEnginePage::WebAction editorActionForKeyEvent(QKeyEvent* event) +{ + static struct { + QKeySequence::StandardKey standardKey; + QWebEnginePage::WebAction action; + } editorActions[] = { + { QKeySequence::Cut, QWebEnginePage::Cut }, + { QKeySequence::Copy, QWebEnginePage::Copy }, + { QKeySequence::Paste, QWebEnginePage::Paste }, + { QKeySequence::Undo, QWebEnginePage::Undo }, + { QKeySequence::Redo, QWebEnginePage::Redo }, + { QKeySequence::SelectAll, QWebEnginePage::SelectAll }, + { QKeySequence::UnknownKey, QWebEnginePage::NoWebAction } + }; + for (int i = 0; editorActions[i].standardKey != QKeySequence::UnknownKey; ++i) + if (event == editorActions[i].standardKey) + return editorActions[i].action; + + return QWebEnginePage::NoWebAction; +} + QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) : adapter(new WebContentsAdapter) , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this))) @@ -226,6 +249,19 @@ void QWebEnginePagePrivate::focusContainer() void QWebEnginePagePrivate::unhandledKeyEvent(QKeyEvent *event) { +#ifdef Q_OS_OSX + Q_Q(QWebEnginePage); + if (event->type() == QEvent::KeyPress) { + QWebEnginePage::WebAction action = editorActionForKeyEvent(event); + if (action != QWebEnginePage::NoWebAction) { + // Try triggering a registered short-cut + if (QGuiApplicationPrivate::instance()->shortcutMap.tryShortcut(event)) + return; + q->triggerAction(action); + return; + } + } +#endif if (view && view->parentWidget()) QGuiApplication::sendEvent(view->parentWidget(), event); } diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 7b16ed667..d0023d7bb 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -67,6 +67,8 @@ class QWebEngineProfile; class QWebEngineSettings; class QWebEngineView; +QWebEnginePage::WebAction editorActionForKeyEvent(QKeyEvent* event); + class QWebEnginePagePrivate : public QtWebEngineCore::WebContentsAdapterClient { public: 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 78840085f..2937c94b7 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -323,6 +323,13 @@ bool RenderWidgetHostViewQtDelegateWidget::event(QEvent *event) } } + if (event->type() == QEvent::ShortcutOverride) { + if (editorActionForKeyEvent(static_cast(event)) != QWebEnginePage::NoWebAction) { + event->accept(); + return true; + } + } + if (event->type() == QEvent::MouseButtonDblClick) { // QWidget keeps the Qt4 behavior where the DblClick event would replace the Press event. // QtQuick is different by sending both the Press and DblClick events for the second press -- cgit v1.2.3 From f77a9e1bcf87642a443a15688ba65856b0b38c56 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 15 Jun 2016 17:15:54 +0200 Subject: Remove split between 'C++' and 'QML' modules in index page This is somewhat artificial, since the QtWebEngine module now also has public C++ API. Change-Id: I2067a3eb4e84cfac2b3e6766b272445b9bd31ae7 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-index.qdoc | 4 ---- src/webengine/doc/src/qtwebengine-qmlmodule.qdoc | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc index db3a01d30..f1daa29a8 100644 --- a/src/webengine/doc/src/qtwebengine-index.qdoc +++ b/src/webengine/doc/src/qtwebengine-index.qdoc @@ -38,10 +38,6 @@ \annotatedlist qtwebengine-modules - For Qt Quick applications, Qt WebEngine provides the following QML modules: - - \annotatedlist qtwebengine-qmlmodules - \section1 Articles and Guides \list diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc index 7fcddb373..42eeefb4d 100644 --- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc +++ b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc @@ -27,7 +27,7 @@ \qmlmodule QtWebEngine 1.2 \title Qt WebEngine QML Types \brief Provides QML types for rendering web content within a QML application - \ingroup qtwebengine-qmlmodules + \ingroup qtwebengine-modules The QML types can be imported into your application using the following import statements in your .qml file: -- cgit v1.2.3 From 99d3c34167e2ba8c0c505554cdcd4fca20d5223e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 23 Jun 2016 10:03:51 +0200 Subject: Use angleDelta instead of deprecated Qt4 delta Switch to using the Qt5 angleDelta instead of the Qt4 style delta that can only handle single orientation wheel events. Change-Id: I181dda03c7fc9c676100cb31ab7717f9641b625e Reviewed-by: Joerg Bornemann --- src/core/web_event_factory.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index da230479a..80f81e954 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -656,14 +656,11 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev, doub webEvent.modifiers = modifiersForEvent(ev); webEvent.timeStampSeconds = currentTimeForEvent(ev); - if (ev->orientation() == Qt::Horizontal) - webEvent.wheelTicksX = ev->delta() / 120.0f; - else - webEvent.wheelTicksY = ev->delta() / 120.0f; + webEvent.wheelTicksX = ev->angleDelta().x() / QWheelEvent::DefaultDeltasPerStep; + webEvent.wheelTicksY = ev->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep; - - // Since we report the scroll by the pixel, convert the delta to pixel distance using standard scroll step. - // Use the same single scroll step as QTextEdit (in QTextEditPrivate::init [h,v]bar->setSingleStep) + // We can't use the device specific QWheelEvent::pixelDelta(), so we calculate + // a pixel delta based on ticks and scroll per line. static const float cDefaultQtScrollStep = 20.f; webEvent.deltaX = webEvent.wheelTicksX * wheelScrollLines * cDefaultQtScrollStep; -- cgit v1.2.3 From 964963f76acbcc6df8f021b5b36dbc5e726027b6 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 21 Jun 2016 16:01:03 +0200 Subject: Fix memory leak of unhandled certificateError If a user does not handle onCertificateError the instance of QQuickWebEngineCertificateError never gets to JavaScript land and never gets deleted. Create a strong reference before emitting the onCertificateError to guard against the memory leak. Change-Id: I49dbf89445d32291e2f52976f0f5e9deda201fcb Reviewed-by: Simon Hausmann Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebengineview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 6b3614fc5..ddca1b670 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -351,7 +351,8 @@ void QQuickWebEngineViewPrivate::allowCertificateError(const QSharedPointernewQObject(quickController); Q_EMIT q->certificateError(quickController); if (!quickController->deferred() && !quickController->answered()) quickController->rejectCertificate(); -- cgit v1.2.3 From cc8fc6ca09e86a0433d69aaa8c4512da27790049 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 14 Jun 2016 16:15:47 +0200 Subject: Fix inputEventForwardingDisabledWhenActiveFocusOnPressDisabled test. Test was flaky due to a couple of reasons, mainly: 1) Size of event recording widget did not match web view size, which led to some events not being caught. 2) There were some bogus QHoverEvents being sent by QQuickWindow whenever a QQuickItem is repositioned (can happen when using a tiling window manager on a Linux machine). 3) Usual timing issues. Change-Id: Idd9d4fa6bd65095f98125196025e0ad560025348 Reviewed-by: Allan Sandfeld Jensen --- .../tst_qquickwebengineview.cpp | 31 +++++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 7e684a35a..8ea644c32 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -514,9 +514,10 @@ void tst_QQuickWebEngineView::stopSettingFocusWhenDisabled_data() } class MouseTouchEventRecordingItem : public QQuickItem { + Q_OBJECT public: - explicit MouseTouchEventRecordingItem(QQuickItem *parent = 0) : - QQuickItem(parent), m_eventCounter(0) { + explicit MouseTouchEventRecordingItem(QQuickItem* child, QQuickItem *parent = 0) : + QQuickItem(parent), m_eventCounter(0), m_child(child) { setFlag(ItemHasContents); setAcceptedMouseButtons(Qt::AllButtons); setAcceptHoverEvents(true); @@ -536,9 +537,6 @@ public: case QEvent::TouchUpdate: case QEvent::TouchEnd: case QEvent::TouchCancel: - case QEvent::HoverEnter: - case QEvent::HoverMove: - case QEvent::HoverLeave: ++m_eventCounter; event->accept(); return true; @@ -558,16 +556,34 @@ public: return m_eventCounter; } +public Q_SLOTS: + void changeWidth() { + if (m_child) + setWidth(m_child->width()); + } + + void changeHeight() { + if (m_child) + setHeight(m_child->height()); + } + private: int m_eventCounter; + QQuickItem *m_child; }; void tst_QQuickWebEngineView::inputEventForwardingDisabledWhenActiveFocusOnPressDisabled() { QQuickWebEngineView *view = webEngineView(); - MouseTouchEventRecordingItem item; + MouseTouchEventRecordingItem item(view); item.setParentItem(m_window->contentItem()); - item.setSize(QSizeF(640, 480)); + + // Resize the event recorder whenever the view is resized, so that all event positions + // are contained in both of the item regions. + QObject::connect(view, &QQuickItem::widthChanged, &item, + &MouseTouchEventRecordingItem::changeWidth); + QObject::connect(view, &QQuickItem::heightChanged, &item, + &MouseTouchEventRecordingItem::changeHeight); view->setParentItem(&item); view->setSize(QSizeF(640, 480)); m_window->show(); @@ -575,6 +591,7 @@ void tst_QQuickWebEngineView::inputEventForwardingDisabledWhenActiveFocusOnPress // Simulate click and move of mouse, so that last known position in the application // is updated, thus a mouse move event is not generated when we don't expect it. QTest::mouseClick(view->window(), Qt::LeftButton); + QTRY_COMPARE(item.eventCount(), 2); item.clearEventCount(); // First disable view, so it does not receive focus on page load. -- cgit v1.2.3 From 722732d1f089630ad517aef8f94325a51186b274 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 24 Jun 2016 13:17:16 +0200 Subject: Fix detection of MIPS architucture revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were not handling -march= arguments and we were not setting the result in GYP_CONFIG. Task-number: QTBUG-54336 Change-Id: I63e45f153aa46d5879aa968aa6c3d898ef58855e Reviewed-by: Michael Brüning --- src/core/gyp_run.pro | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index 767bd6ac1..36548ff6b 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -89,9 +89,16 @@ contains(QT_ARCH, "mips") { !cross_compile: GYP_CONFIG += sysroot=\"\" GYP_CONFIG += target_arch=mipsel - contains(QMAKE_CFLAGS, "mips32r6"): mips_arch_variant=\"r6\" - else: contains(QMAKE_CFLAGS, "mips32r2"): mips_arch_variant=\"r2\" - else: contains(QMAKE_CFLAGS, "mips32"): mips_arch_variant=\"r1\" + MARCH = $$extractCFlag("-march=.*") + !isEmpty(MARCH) { + equals(MARCH, "mips32r6"): GYP_CONFIG += mips_arch_variant=\"r6\" + else: equals(MARCH, "mips32r2"): GYP_CONFIG += mips_arch_variant=\"r2\" + else: equals(MARCH, "mips32"): GYP_CONFIG += mips_arch_variant=\"r1\" + } else { + contains(QMAKE_CFLAGS, "mips32r6"): GYP_CONFIG += mips_arch_variant=\"r6\" + else: contains(QMAKE_CFLAGS, "mips32r2"): GYP_CONFIG += mips_arch_variant=\"r2\" + else: contains(QMAKE_CFLAGS, "mips32"): GYP_CONFIG += mips_arch_variant=\"r1\" + } contains(QMAKE_CFLAGS, "-mdsp2"): GYP_CONFIG += mips_dsp_rev=2 else: contains(QMAKE_CFLAGS, "-mdsp"): GYP_CONFIG += mips_dsp_rev=1 -- cgit v1.2.3 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(+) 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.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 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(+) 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.3 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 +++ .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 31 +++++++++------------- 3 files changed, 17 insertions(+), 19 deletions(-) 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); } diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 4cff50d3b..ab6db5e2c 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -2970,31 +2970,26 @@ void tst_QWebEnginePage::findText() QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool))); m_page->setHtml(QString("
foo bar
")); QTRY_COMPARE(loadSpy.count(), 1); + + // Select whole page contents. m_page->triggerAction(QWebEnginePage::SelectAll); QTRY_COMPARE(m_page->hasSelection(), true); -#if defined(QWEBENGINEPAGE_SELECTEDHTML) - QVERIFY(!m_page->selectedHtml().isEmpty()); -#endif + + // Invoke a stopFinding() operation, which should clear the currently selected text. m_page->findText(""); - QEXPECT_FAIL("", "Unsupported: findText only highlights and doesn't update the selection.", Continue); - QVERIFY(m_page->selectedText().isEmpty()); -#if defined(QWEBENGINEPAGE_SELECTEDHTML) - QVERIFY(m_page->selectedHtml().isEmpty()); -#endif + QTRY_VERIFY(m_page->selectedText().isEmpty()); + QStringList words = (QStringList() << "foo" << "bar"); foreach (QString subString, words) { + // Invoke a find operation, which should clear the currently selected text, should + // highlight all the found ocurrences, but should not update the selected text to the + // searched for string. m_page->findText(subString); - QEXPECT_FAIL("", "Unsupported: findText only highlights and doesn't update the selection.", Continue); - QCOMPARE(m_page->selectedText(), subString); -#if defined(QWEBENGINEPAGE_SELECTEDHTML) - QVERIFY(m_page->selectedHtml().contains(subString)); -#endif + QTRY_VERIFY(m_page->selectedText().isEmpty()); + + // Search highlights should be cleared, selected text should still be empty. m_page->findText(""); - QEXPECT_FAIL("", "Unsupported: findText only highlights and doesn't update the selection.", Continue); - QVERIFY(m_page->selectedText().isEmpty()); -#if defined(QWEBENGINEPAGE_SELECTEDHTML) - QVERIFY(m_page->selectedHtml().isEmpty()); -#endif + QTRY_VERIFY(m_page->selectedText().isEmpty()); } } -- cgit v1.2.3 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(-) 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.3 From 9e65aaf4e0d0c5b5d927f2fbc5c8aa052bae24b8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 1 Jul 2016 14:14:41 +0200 Subject: Fix building on OS X 10.9 with 10.10 SDK Previously building on OS X 10.9 was only allowed with a 10.10.3 SDK. But there is no supported version of Xcode on 10.9 that would ship with that SDK, which lead to the fact that there was no way to compile WebEngine with an officialy provided toolchain. This patch lowers the requirement of the SDK to 10.10, at the expense of disabling usage of API that was added in the 10.10.3 SDK release (Force Touch API). The required minimum Xcode version is thus bumped to 6.1, and the documentation is updated accordingly. Task-number: QTBUG-54486 Change-Id: I025caa336ceac5b8ea76ef451eb5e6b78abfe0c9 Reviewed-by: Allan Sandfeld Jensen --- src/3rdparty | 2 +- src/core/config/mac_osx.pri | 5 +++++ src/webengine/doc/src/qtwebengine-platform-notes.qdoc | 8 +++++++- tools/qmake/mkspecs/features/configure.prf | 3 +++ tools/qmake/mkspecs/features/functions.prf | 10 ++++++---- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/3rdparty b/src/3rdparty index 77c17ae35..c109a95a0 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 77c17ae35f825cb70e46b880fb0b5ed7be83709c +Subproject commit c109a95a067af783e48f93d1cdeca870cda98878 diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri index 83ddea233..c447add4a 100644 --- a/src/core/config/mac_osx.pri +++ b/src/core/config/mac_osx.pri @@ -1,4 +1,5 @@ include(common.pri) +load(functions) # Reuse the cached sdk version value from mac/sdk.prf if available # otherwise query for it. @@ -26,5 +27,9 @@ GYP_CONFIG += \ clang_use_chrome_plugins=0 \ enable_widevine=1 +# Force touch API is used in 49-based Chromium, which is included starting with 10.10.3 SDK, so we +# disable the API usage if the SDK version is lower. +!isMinOSXSDKVersion(10, 10, 3): GYP_CONFIG += disable_force_touch=1 + QMAKE_MAC_SDK_PATH = "$$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)" exists($$QMAKE_MAC_SDK_PATH): GYP_CONFIG += mac_sdk_path=\"$${QMAKE_MAC_SDK_PATH}\" diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index ecec53bda..989c69d6c 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -114,7 +114,13 @@ \section2 OS X - On OS X, Xcode version 5.1 or later on OS X 10.9 or later is required. + On OS X, the following is required: + + \list + \li OS X 10.9 or later + \li Xcode 6.1 or later + \li OS X 10.10 SDK or later + \endlist \note Qt WebEngine cannot be built for the 32-bit mode of OS X (using the \c macx-clang-32 \c mkspec). diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf index 7ef4b8545..cb6fb8fda 100644 --- a/tools/qmake/mkspecs/features/configure.prf +++ b/tools/qmake/mkspecs/features/configure.prf @@ -128,6 +128,9 @@ defineTest(finalizeConfigure) { } else { log("AppStore Compliant ............... Not enabled (Default, enable with WEBENGINE_CONFIG+=use_appstore_compliant_code)$${EOL}") } + !isMinOSXSDKVersion(10, 10, 3) { + log("Force Touch API usage ............ Not enabled (Because the OS X SDK version to be used \"$${WEBENGINE_OSX_SDK_PRODUCT_VERSION}\" is lower than the required \"10.10.3\")$${EOL}") + } } } diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 33bebb47a..a5cf5ca77 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -23,8 +23,8 @@ defineTest(isPlatformSupported) { skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.") } } else:osx { - lessThan(QMAKE_XCODE_VERSION, 5.1) { - skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.") + lessThan(QMAKE_XCODE_VERSION, 6.1) { + skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 6.1 is required to build Qt WebEngine.") return(false) } # We require OS X 10.9 (darwin version 13.0.0) or newer @@ -33,8 +33,8 @@ defineTest(isPlatformSupported) { skipBuild("Qt WebEngine requires OS X version 10.9 or newer.") return(false) } - !isMinOSXSDKVersion(10, 10, 3): { - skipBuild("Qt WebEngine requires an OS X SDK version 10.10.3 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") + !isMinOSXSDKVersion(10, 10): { + skipBuild("Qt WebEngine requires an OS X SDK version of 10.10 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") return(false) } } else { @@ -101,6 +101,7 @@ defineTest(isMinOSXSDKVersion) { requested_major = $$1 requested_minor = $$2 requested_patch = $$3 + isEmpty(requested_patch): requested_patch = 0 WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null") export(WEBENGINE_OSX_SDK_PRODUCT_VERSION) isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) { @@ -110,6 +111,7 @@ defineTest(isMinOSXSDKVersion) { major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0) minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1) patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2) + isEmpty(patch_version): patch_version = 0 greaterThan(major_version, $$requested_major):return(true) equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true) -- cgit v1.2.3 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(-) 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.3 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(-) 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.3 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(+) 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.3 From bdfe27fef0dfa8cec43eb80ee16e0ab5b8189e8c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 4 Jul 2016 10:16:10 +0200 Subject: Allow building WebEngine 5.7 on OS X 10.9 Currently we require a python version greater than or equal to 2.7.6, to build WebEngine. But OS X 10.9 ships with 2.7.5. Lower the version to 2.7.5 to allow building on OS X 10.9. Change-Id: Ibd40d6afecf9ea8a8e4b31115fdf9b6d1368f0e5 Reviewed-by: Kai Koehne --- tools/qmake/mkspecs/features/functions.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index a5cf5ca77..20fb27817 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -55,7 +55,7 @@ defineTest(isPlatformSupported) { } defineTest(isPythonVersionSupported) { - python_error_msg = "Python version 2 (2.7.6 or later) is required to build Qt WebEngine." + python_error_msg = "Python version 2 (2.7.5 or later) is required to build Qt WebEngine." python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"') python_version ~= s/[()]//g python_version = $$split(python_version, ',') @@ -67,7 +67,7 @@ defineTest(isPythonVersionSupported) { } python_minor_version = $$member(python_version, 1) python_patch_version = $$member(python_version, 2) - greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 5): return(true) + greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") skipBuild($$python_error_msg) return(false) -- cgit v1.2.3 From 43deb1ea53c29780a22ba650f8094f4ba9fb2f1e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 5 Jul 2016 13:56:13 +0200 Subject: Fix flaky qml user script test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I21dfb9146dad44329c490c1c6b32864c70384db3 Reviewed-by: Michael Brüning --- tests/auto/quick/qmltests/data/tst_userScripts.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml index d4f1222f9..358e8f56d 100644 --- a/tests/auto/quick/qmltests/data/tst_userScripts.qml +++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml @@ -114,19 +114,19 @@ Item { appendDocumentTitleScript.injectionPoint = WebEngineScript.Deferred webEngineView.reload(); webEngineView.waitForLoadSucceeded(); - compare(webEngineView.title, "New title with appendix"); + tryCompare(webEngineView, "title", "New title with appendix"); appendDocumentTitleScript.injectionPoint = WebEngineScript.DocumentReady changeDocumentTitleScript.injectionPoint = WebEngineScript.Deferred webEngineView.reload(); webEngineView.waitForLoadSucceeded(); - compare(webEngineView.title, "New title"); + tryCompare(webEngineView, "title", "New title"); // Make sure we can remove scripts from the preload list. webEngineView.userScripts = [ appendDocumentTitleScript ]; webEngineView.reload(); webEngineView.waitForLoadSucceeded(); - compare(webEngineView.title, "Test page 1 with appendix"); + tryCompare(webEngineView, "title", "Test page 1 with appendix"); changeDocumentTitleScript.injectionPoint = WebEngineScript.DocumentReady } -- cgit v1.2.3 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(-) 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.3 From 67166fd9a8bfda0bea09196f793a7fc2ac35c505 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 19 Feb 2016 15:10:04 +0100 Subject: Enable qquickwebengineviewgraphics test in CI This test requires the QtQuick test support API. Exclude it from build if the API isn't available. Blacklist one problematic test case. Remove the - now superfluous - ENABLE_QML_TESTSUPPORT_API checks. Change-Id: I0b36de182628969e1185d685fa098d6140ae8d9c Reviewed-by: Michal Klocek --- tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST | 2 ++ .../qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro | 1 - .../tst_qquickwebengineviewgraphics.cpp | 6 ------ tests/auto/quick/quick.pro | 9 ++++++--- 4 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST diff --git a/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST b/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST new file mode 100644 index 000000000..d0b244ef4 --- /dev/null +++ b/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST @@ -0,0 +1,2 @@ +[showHideShow] +osx windows diff --git a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro index 9471def00..cbd11cdca 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro +++ b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro @@ -1,4 +1,3 @@ include(../tests.pri) -CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp index bb09f890e..5661879d5 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp +++ b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp @@ -92,9 +92,7 @@ private Q_SLOTS: private: void setHtml(const QString &html); QScopedPointer m_view; -#ifdef ENABLE_QML_TESTSUPPORT_API QScopedPointer m_testSupport; -#endif }; static const QString greenSquare("
"); @@ -125,9 +123,7 @@ tst_QQuickWebEngineViewGraphics::~tst_QQuickWebEngineViewGraphics() void tst_QQuickWebEngineViewGraphics::initTestCase() { QtWebEngine::initialize(); -#ifdef ENABLE_QML_TESTSUPPORT_API m_testSupport.reset(new QQuickWebEngineTestSupport); -#endif } void tst_QQuickWebEngineViewGraphics::init() @@ -204,9 +200,7 @@ void tst_QQuickWebEngineViewGraphics::setHtml(const QString &html) QQuickWebEngineView *webEngineView = static_cast(m_view->rootObject()); webEngineView->setProperty("url", QUrl(QStringLiteral("data:text/html,%1").arg(htmlData))); -#ifdef ENABLE_QML_TESTSUPPORT_API webEngineView->setTestSupport(m_testSupport.data()); -#endif QVERIFY(waitForViewportReady(webEngineView)); QCOMPARE(m_view->rootObject()->property("loading"), QVariant(false)); } diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index b278808f6..d220348ab 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -4,7 +4,10 @@ SUBDIRS += \ inspectorserver \ publicapi \ qquickwebenginedefaultsurfaceformat \ - qquickwebengineview \ - qquickwebengineviewgraphics + qquickwebengineview -isQMLTestSupportApiEnabled(): SUBDIRS += qmltests +isQMLTestSupportApiEnabled() { + SUBDIRS += \ + qmltests \ + qquickwebengineviewgraphics +} -- cgit v1.2.3 From 03e0f8043264f054564da9efe82b453e6bf11fc5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 15 Mar 2016 13:40:46 +0100 Subject: Remove tst_QWebEnginePage::localURLSchemes This was a rudimentary test case for QWebSecurityOrigin. This API was replaced in QtWebEngine. Change-Id: If41a7f48906a6b49d5a83c72c69dbfd125804537 Reviewed-by: Michal Klocek --- .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 29 ---------------------- 1 file changed, 29 deletions(-) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index ab6db5e2c..fb3f8ff4e 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -143,7 +143,6 @@ private Q_SLOTS: void textEditing(); void backActionUpdate(); void protectBindingsRuntimeObjectsFromCollector(); - void localURLSchemes(); void testOptionalJSObjects(); void testLocalStorageVisibility(); void testEnablePersistentStorage(); @@ -2460,34 +2459,6 @@ void tst_QWebEnginePage::protectBindingsRuntimeObjectsFromCollector() #endif } -void tst_QWebEnginePage::localURLSchemes() -{ -#if !defined(QWEBENGINESECURITYORIGIN) - QSKIP("QWEBENGINESECURITYORIGIN"); -#else - int i = QWebEngineSecurityOrigin::localSchemes().size(); - - QWebEngineSecurityOrigin::removeLocalScheme("file"); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i); - QWebEngineSecurityOrigin::addLocalScheme("file"); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i); - - QWebEngineSecurityOrigin::removeLocalScheme("qrc"); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i - 1); - QWebEngineSecurityOrigin::addLocalScheme("qrc"); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i); - - QString myscheme = "myscheme"; - QWebEngineSecurityOrigin::addLocalScheme(myscheme); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i + 1); - QVERIFY(QWebEngineSecurityOrigin::localSchemes().contains(myscheme)); - QWebEngineSecurityOrigin::removeLocalScheme(myscheme); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i); - QWebEngineSecurityOrigin::removeLocalScheme(myscheme); - QTRY_COMPARE(QWebEngineSecurityOrigin::localSchemes().size(), i); -#endif -} - #if defined(QWEBENGINEPAGE_SETTINGS) static inline bool testFlag(QWebEnginePage& webPage, QWebEngineSettings::WebAttribute settingAttribute, const QString& jsObjectName, bool settingValue) { -- cgit v1.2.3 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 ++ .../render_widget_host_view_qt_delegate_widget.h | 1 + tests/auto/widgets/qwebenginepage/BLACKLIST | 3 + .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 113 +++++++++++++++++++++ 4 files changed, 125 insertions(+) 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; }; diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST index 91858f299..045783c94 100644 --- a/tests/auto/widgets/qwebenginepage/BLACKLIST +++ b/tests/auto/widgets/qwebenginepage/BLACKLIST @@ -1,3 +1,6 @@ +[comboBoxPopupPositionAfterMove] +linux + [geolocationRequestJS] * diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index fb3f8ff4e..ede50e63f 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -23,10 +23,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -113,6 +115,8 @@ private Q_SLOTS: void initTestCase(); void cleanupTestCase(); void thirdPartyCookiePolicy(); + void comboBoxPopupPositionAfterMove(); + void comboBoxPopupPositionAfterChildMove(); void contextMenuCopy(); void contextMenuPopulatedOnce(); void acceptNavigationRequest(); @@ -238,6 +242,8 @@ private Q_SLOTS: void mouseButtonTranslation(); private: + static QPoint elementCenter(QWebEnginePage *page, const QString &id); + QWebEngineView* m_view; QWebEnginePage* m_page; QWebEngineView* m_inputFieldsTestView; @@ -3113,6 +3119,96 @@ void tst_QWebEnginePage::thirdPartyCookiePolicy() #endif } +static QWindow *findNewTopLevelWindow(const QWindowList &oldTopLevelWindows) +{ + const auto tlws = QGuiApplication::topLevelWindows(); + for (auto w : tlws) { + if (!oldTopLevelWindows.contains(w)) { + return w; + } + } + return nullptr; +} + +void tst_QWebEnginePage::comboBoxPopupPositionAfterMove() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QWebEngineView view; + view.move(screen->availableGeometry().topLeft()); + view.resize(640, 480); + view.show(); + + QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool))); + view.setHtml(QLatin1String("")); + QTRY_COMPARE(loadSpy.count(), 1); + const auto oldTlws = QGuiApplication::topLevelWindows(); + QWindow *window = view.windowHandle(); + QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), + elementCenter(view.page(), "foo")); + + QWindow *popup = nullptr; + QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws)); + QPoint popupPos = popup->position(); + + // Close the popup by clicking somewhere into the page. + QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(1, 1)); + QTRY_VERIFY(!QGuiApplication::topLevelWindows().contains(popup)); + + // Move the top-level QWebEngineView a little and check the popup's position. + const QPoint offset(12, 13); + view.move(screen->availableGeometry().topLeft() + offset); + QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), + elementCenter(view.page(), "foo")); + QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws)); + QCOMPARE(popupPos + offset, popup->position()); +} + +void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove() +{ + QWidget mainWidget; + mainWidget.setLayout(new QHBoxLayout); + + QWidget spacer; + spacer.setMinimumWidth(50); + mainWidget.layout()->addWidget(&spacer); + + QWebEngineView view; + mainWidget.layout()->addWidget(&view); + + QScreen *screen = QGuiApplication::primaryScreen(); + mainWidget.move(screen->availableGeometry().topLeft()); + mainWidget.resize(640, 480); + mainWidget.show(); + + QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool))); + view.setHtml(QLatin1String("")); + QTRY_COMPARE(loadSpy.count(), 1); + const auto oldTlws = QGuiApplication::topLevelWindows(); + QWindow *window = view.window()->windowHandle(); + QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), + view.mapTo(view.window(), elementCenter(view.page(), "foo"))); + + QWindow *popup = nullptr; + QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws)); + QPoint popupPos = popup->position(); + + // Close the popup by clicking somewhere into the page. + QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), + view.mapTo(view.window(), QPoint(1, 1))); + QTRY_VERIFY(!QGuiApplication::topLevelWindows().contains(popup)); + + // Resize the "spacer" widget, and implicitly change the global position of the QWebEngineView. + spacer.setMinimumWidth(100); + QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), + view.mapTo(view.window(), elementCenter(view.page(), "foo"))); + QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws)); + QCOMPARE(popupPos + QPoint(50, 0), popup->position()); +} + #ifdef Q_OS_MAC void tst_QWebEnginePage::macCopyUnicodeToClipboard() { @@ -4992,5 +5088,22 @@ void tst_QWebEnginePage::mouseButtonTranslation() delete view; } +QPoint tst_QWebEnginePage::elementCenter(QWebEnginePage *page, const QString &id) +{ + QVariantList rectList = evaluateJavaScriptSync(page, + "(function(){" + "var elem = document.getElementById('" + id + "');" + "var rect = elem.getBoundingClientRect();" + "return [(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2];" + "})()").toList(); + + if (rectList.count() != 2) { + qWarning("elementCenter failed."); + return QPoint(); + } + + return QPoint(rectList.at(0).toInt(), rectList.at(1).toInt()); +} + QTEST_MAIN(tst_QWebEnginePage) #include "tst_qwebenginepage.moc" -- cgit v1.2.3 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(-) 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.3 From f5ce990665a446fb131cc17c83eaac71eaae0070 Mon Sep 17 00:00:00 2001 From: Adam Kallai Date: Wed, 13 Jul 2016 14:17:04 +0200 Subject: Add missing Q_DECL_OVERRIDE macro This macro is missing from the end of the showColorDialog function in qwebenginepage_p.h. Change-Id: Iec1998244f0b40767c37b89ef65a1b0d7451d3fe Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/api/qwebenginepage_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index fb0b85268..089dc1cc6 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -110,7 +110,7 @@ public: virtual bool isFullScreenMode() const Q_DECL_OVERRIDE; virtual void javascriptDialog(QSharedPointer) Q_DECL_OVERRIDE; virtual void runFileChooser(QtWebEngineCore::FilePickerController *controller) Q_DECL_OVERRIDE; - virtual void showColorDialog(QSharedPointer); + virtual void showColorDialog(QSharedPointer) Q_DECL_OVERRIDE; virtual void didRunJavaScript(quint64 requestId, const QVariant& result) Q_DECL_OVERRIDE; virtual void didFetchDocumentMarkup(quint64 requestId, const QString& result) Q_DECL_OVERRIDE; virtual void didFetchDocumentInnerText(quint64 requestId, const QString& result) Q_DECL_OVERRIDE; -- cgit v1.2.3 From 93eec54dff70bc9a233cdac6b42ca5875ecd8c97 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 15 Jul 2016 16:01:41 +0200 Subject: Blacklist showHideShow test on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was already skipped on OS X and Windows, but it is also unrealiable on Linux. Change-Id: Ie443c97595979a3cc9d34991a5b0b3f9c69f136c Reviewed-by: Michael Brüning --- tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST b/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST index d0b244ef4..9ec23eb6d 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST +++ b/tests/auto/quick/qquickwebengineviewgraphics/BLACKLIST @@ -1,2 +1,2 @@ [showHideShow] -osx windows +* -- cgit v1.2.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 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 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.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 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(-) 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.3 From ab7a206cd6a34952481bb987a3421de3b72694cc Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 20 Jul 2016 14:45:32 +0200 Subject: Doc: Fix grammar A list of three items requires that the verb in the leading sentence take the plural form "are". Change-Id: I054d37d891db3ec1a372b22e9707a59cdaf84922 Reviewed-by: Kai Koehne --- src/webengine/doc/src/qtwebengine-platform-notes.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index 989c69d6c..66e733fa9 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -114,7 +114,7 @@ \section2 OS X - On OS X, the following is required: + On OS X, the following are required: \list \li OS X 10.9 or later -- cgit v1.2.3 From 35b1ded572615a5fb247f92dac928eda906f715e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Jul 2016 17:14:44 +0200 Subject: Fixup Back/Forward short-cuts Remove backspace short-cut, Chromium will already handle that if it is standard on the platform. Also we were not triggering on Back/Forward buttons due to those being mapped to prev/next tab item in Qt. Task-number: QTBUG-54546 Change-Id: I9a4f48c718c5685ca9ca1b032d8b04409ac622ca Reviewed-by: Jesus Fernandez Reviewed-by: Kai Koehne --- .../demobrowser/browsermainwindow.cpp | 22 ++++++++++++++++++++-- .../simplebrowser/browserwindow.cpp | 22 ++++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp index 5d3fa47e5..6b64653b6 100644 --- a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp +++ b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp @@ -406,13 +406,31 @@ void BrowserMainWindow::setupMenu() m_historyBack = new QAction(tr("Back"), this); m_tabWidget->addWebAction(m_historyBack, QWebEnginePage::Back); - m_historyBack->setShortcuts(QKeySequence::Back); + QList backShortcuts = QKeySequence::keyBindings(QKeySequence::Back); + for (auto it = backShortcuts.begin(); it != backShortcuts.end();) { + // Chromium already handles navigate on backspace when appropriate. + if ((*it)[0] == Qt::Key_Backspace) + it = backShortcuts.erase(it); + else + ++it; + } + // For some reason Qt doesn't bind the dedicated Back key to Back. + backShortcuts.append(QKeySequence(Qt::Key_Back)); + m_historyBack->setShortcuts(backShortcuts); m_historyBack->setIconVisibleInMenu(false); historyActions.append(m_historyBack); m_historyForward = new QAction(tr("Forward"), this); m_tabWidget->addWebAction(m_historyForward, QWebEnginePage::Forward); - m_historyForward->setShortcuts(QKeySequence::Forward); + QList fwdShortcuts = QKeySequence::keyBindings(QKeySequence::Forward); + for (auto it = fwdShortcuts.begin(); it != fwdShortcuts.end();) { + if (((*it)[0] & Qt::Key_unknown) == Qt::Key_Backspace) + it = fwdShortcuts.erase(it); + else + ++it; + } + fwdShortcuts.append(QKeySequence(Qt::Key_Forward)); + m_historyForward->setShortcuts(fwdShortcuts); m_historyForward->setIconVisibleInMenu(false); historyActions.append(m_historyForward); diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp index e7d5fd129..c01f912d3 100644 --- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp +++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp @@ -280,7 +280,17 @@ QToolBar *BrowserWindow::createToolBar() navigationBar->toggleViewAction()->setEnabled(false); m_historyBackAction = new QAction(this); - m_historyBackAction->setShortcuts(QKeySequence::Back); + QList backShortcuts = QKeySequence::keyBindings(QKeySequence::Back); + for (auto it = backShortcuts.begin(); it != backShortcuts.end();) { + // Chromium already handles navigate on backspace when appropriate. + if ((*it)[0] == Qt::Key_Backspace) + it = backShortcuts.erase(it); + else + ++it; + } + // For some reason Qt doesn't bind the dedicated Back key to Back. + backShortcuts.append(QKeySequence(Qt::Key_Back)); + m_historyBackAction->setShortcuts(backShortcuts); m_historyBackAction->setIconVisibleInMenu(false); m_historyBackAction->setIcon(QIcon(QStringLiteral(":go-previous.png"))); connect(m_historyBackAction, &QAction::triggered, [this]() { @@ -289,7 +299,15 @@ QToolBar *BrowserWindow::createToolBar() navigationBar->addAction(m_historyBackAction); m_historyForwardAction = new QAction(this); - m_historyForwardAction->setShortcuts(QKeySequence::Forward); + QList fwdShortcuts = QKeySequence::keyBindings(QKeySequence::Forward); + for (auto it = fwdShortcuts.begin(); it != fwdShortcuts.end();) { + if (((*it)[0] & Qt::Key_unknown) == Qt::Key_Backspace) + it = fwdShortcuts.erase(it); + else + ++it; + } + fwdShortcuts.append(QKeySequence(Qt::Key_Forward)); + m_historyForwardAction->setShortcuts(fwdShortcuts); m_historyForwardAction->setIconVisibleInMenu(false); m_historyForwardAction->setIcon(QIcon(QStringLiteral(":go-next.png"))); connect(m_historyForwardAction, &QAction::triggered, [this]() { -- cgit v1.2.3 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(-) 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.3 From dbf7dd27428ff755444eac5e975cb69802ac9771 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 25 Jul 2016 10:02:12 +0200 Subject: Doc: Update to Chromium version used in 5.7 Change-Id: I6ace25fc3085f7816d128be651d00040de6e53d6 Reviewed-by: Michal Klocek --- src/webengine/doc/src/qtwebengine-overview.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 064dfb44b..860bbbd68 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -104,7 +104,7 @@ \l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview} that is part of the documentation in the \l {Chromium Project} upstream source tree. - This version of Qt WebEngine is based on Chromium version 45.0.2554.101, with + This version of Qt WebEngine is based on Chromium version 49.0.2623.111, with additional security fixes from newer versions. \section2 Qt WebEngine Process -- cgit v1.2.3 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 - .../widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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) diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 287e2364a..23a56a9cb 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -42,6 +42,7 @@ #include #include #include +#include class tst_QWebEngineProfile : public QObject { @@ -54,6 +55,7 @@ private Q_SLOTS: void urlSchemeHandlerFailRequest(); void customUserAgent(); void httpAcceptLanguage(); + void downloadItem(); }; void tst_QWebEngineProfile::defaultProfile() @@ -245,5 +247,16 @@ void tst_QWebEngineProfile::httpAcceptLanguage() QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.languages")).toStringList(), QStringList(testLang)); } +void tst_QWebEngineProfile::downloadItem() +{ + qRegisterMetaType(); + QWebEngineProfile testProfile; + QWebEnginePage page(&testProfile); + QSignalSpy downloadSpy(&testProfile, SIGNAL(downloadRequested(QWebEngineDownloadItem *))); + connect(&testProfile, &QWebEngineProfile::downloadRequested, this, [=] (QWebEngineDownloadItem *item) { item->accept(); }); + page.load(QUrl::fromLocalFile(QCoreApplication::applicationFilePath())); + QTRY_COMPARE(downloadSpy.count(), 1); +} + QTEST_MAIN(tst_QWebEngineProfile) #include "tst_qwebengineprofile.moc" -- cgit v1.2.3 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 --- .gitignore | 1 - 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 ++++++------ tools/buildscripts/gyp_qtwebengine | 5 +++-- tools/qmake/mkspecs/features/gyp_generator.prf | 24 ++++++++++++++---------- 9 files changed, 30 insertions(+), 36 deletions(-) delete mode 100644 src/core/core.gyp diff --git a/.gitignore b/.gitignore index 2a74d1302..21aab71d2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ src/core/Debug src/core/Release src/core/api/Release src/core/api/Debug -src/core/core_generated.gyp src/core/gypfiles examples/webengine/quicknanobrowser/quicknanobrowser examples/webengine/quicknanobrowser/quicknanobrowser.app 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', diff --git a/tools/buildscripts/gyp_qtwebengine b/tools/buildscripts/gyp_qtwebengine index ee09de973..d6f12ee2f 100755 --- a/tools/buildscripts/gyp_qtwebengine +++ b/tools/buildscripts/gyp_qtwebengine @@ -108,7 +108,8 @@ if __name__ == '__main__': break if not gyp_file_specified: - args.append(os.path.join(root_dir, 'src/core/core.gyp')) + args.append(os.path.join(root_dir, 'src/core/resources/resources.gyp')) + args.append(os.path.join(output_dir, 'core_generated.gyp')) args.extend(['-I' + i for i in additional_include_files(args)]) @@ -155,7 +156,7 @@ if __name__ == '__main__': # Tweak the output location and format (hardcode ninja for now if not set) args.extend(['--generator-output', '.']) - args.extend(['-Goutput_dir='+ os.path.relpath(output_dir, qtwebengine_root)]) + args.extend(['-Goutput_dir='+ purifyGypVarPath(os.path.relpath(output_dir, qtwebengine_root))]) # Tell gyp not to try finding cl.exe on Windows, Qt already requires the env to be set prior to the build. args.extend(['-G', 'ninja_use_custom_environment_files']) diff --git a/tools/qmake/mkspecs/features/gyp_generator.prf b/tools/qmake/mkspecs/features/gyp_generator.prf index eea11ef09..b2be1bb2c 100644 --- a/tools/qmake/mkspecs/features/gyp_generator.prf +++ b/tools/qmake/mkspecs/features/gyp_generator.prf @@ -6,8 +6,8 @@ load(functions) load(moc) load(resources) -MOC_GEN_DIR = <(SHARED_INTERMEDIATE_DIR)/moc -RCC_GEN_DIR = <(SHARED_INTERMEDIATE_DIR)/rcc +MOC_GEN_DIR = $$MOC_DIR +RCC_GEN_DIR = $$RCC_DIR defineReplace(mocAction) { INPUT_FILE = $$1 @@ -21,11 +21,11 @@ defineReplace(mocAction) { OUTPUT_FILE = $$MOC_GEN_DIR/$${OUTPUT_NAME} contents = " {" \ " 'action_name':'$$OUTPUT_NAME'," \ - " 'inputs': ['$$INPUT_FILE',]," \ + " 'inputs': ['$$GYPSRCDIR//$$INPUT_FILE',]," \ " 'outputs': ['$$OUTPUT_FILE',]," \ " 'action': [" for(token, MOC_COMMAND): contents += " '$$replace(token,\',)'," - contents += " '$$INPUT_FILE'," \ + contents += " '$$GYPSRCDIR/$$INPUT_FILE'," \ " '-o'," \ " '$$OUTPUT_FILE'," \ " ]," \ @@ -42,14 +42,14 @@ defineReplace(rccAction) { CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC) contents = " {" \ " 'action_name':'$$OUTPUT_NAME'," \ - " 'inputs': ['$$INPUT_FILE',]," \ + " 'inputs': ['$$GYPSRCDIR//$$INPUT_FILE',]," \ " 'outputs': ['$$OUTPUT_FILE',]," \ " 'action': [" \ " '$$replace(CLEAN_QMAKE_RCC,\',)'," for(resource_flag, $$QMAKE_RESOURCE_FLAGS): contents += " '$$resource_flag'," contents += " '-name'," \ " '$$EXTERN_FUNC'," \ - " '$$INPUT_FILE'," \ + " '$$GYPSRCDIR/$$INPUT_FILE'," \ " '-o'," \ " '$$OUTPUT_FILE'," contents += " ]," \ @@ -76,6 +76,12 @@ for (incl, GYPINCLUDES): GYP_CONTENTS += " '$$incl'," GYP_CONTENTS += " ]," } +!isEmpty(GYPDEPENDENCIES) { +GYP_CONTENTS += " 'dependencies': [" +for (depend, GYPDEPENDENCIES): GYP_CONTENTS += " '$$depend'," +GYP_CONTENTS += " ]," +} + !isEmpty(QMAKE_FRAMEWORKPATH) { GYP_CONTENTS += " 'mac_framework_dirs': [" for(path, QMAKE_FRAMEWORKPATH): GYP_CONTENTS += " '$$path'," @@ -107,8 +113,8 @@ GYP_CONTENTS += " ]," # Source files to compile GYP_CONTENTS += " 'sources': [" -for (sourcefile, SOURCES): GYP_CONTENTS += " '$$sourcefile'," -for (headerfile, HEADERS): GYP_CONTENTS += " '$$headerfile'," +for (sourcefile, SOURCES): GYP_CONTENTS += " '$$GYPSRCDIR/$$sourcefile'," +for (headerfile, HEADERS): GYP_CONTENTS += " '$$GYPSRCDIR/$$headerfile'," # Add Sources generated by rcc from qrc files. for (resourcefile, RESOURCES) { @@ -128,8 +134,6 @@ for (mocable, MOCABLES) { GYP_CONTENTS += " ]," GYP_CONTENTS += " 'include_dirs': [" for (path, INCLUDEPATH): GYP_CONTENTS += " '$$path'," -# qmake already added MOC_DIR to INCLUDEPATH, but we're telling gyp to use a different one. -GYP_CONTENTS += " '$$MOC_GEN_DIR'," GYP_CONTENTS += " ]," # Generate the actions for moc and rcc -- cgit v1.2.3 From b05b2dfe1eac0c90e15568f0c76eeff0f923e996 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 28 Jul 2016 13:51:34 +0200 Subject: Bump version Change-Id: I66d49814a00196a602187100204c427f6198873e --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 52fc5b4ea..9d4004a02 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ QMAKEPATH += $$PWD/tools/qmake load(qt_build_config) CONFIG += warning_clean -MODULE_VERSION = 5.7.0 +MODULE_VERSION = 5.7.1 -- cgit v1.2.3 From e24186f1c08d69473bc450b035b9063d5cc9fefb Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 28 Jul 2016 14:12:40 +0200 Subject: Update Chromium sub-module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pulls in security updates from Chromium 42 and two gyp fixes. Change-Id: I0466d48c85640cae57e28c9621800bb1d8665655 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index c109a95a0..7f6555e99 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit c109a95a067af783e48f93d1cdeca870cda98878 +Subproject commit 7f6555e9921bfff1886f1e63bb802c252281e882 -- cgit v1.2.3 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(+) 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.3 From 47d6b5ce11d1014548ba69df5d7b698381a8343e Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 22 Jul 2016 12:45:22 +0200 Subject: Reinstall the webChannelTransport on render process switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we now have a state on the render process side in WebChannelIPCTransport to know if we should install the web channel transport or not, it's important to keep this state updated if a new render process is spawned for a WebContentsAdapter. Task-number: QTBUG-53411 Change-Id: Id0e9e537dcf09317ca3dafd4020a7ada8d16bb8b Reviewed-by: Michael Brüning --- src/core/web_channel_ipc_transport_host.cpp | 7 +++++++ src/core/web_channel_ipc_transport_host.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/core/web_channel_ipc_transport_host.cpp b/src/core/web_channel_ipc_transport_host.cpp index ce5ea320b..aef16f0a0 100644 --- a/src/core/web_channel_ipc_transport_host.cpp +++ b/src/core/web_channel_ipc_transport_host.cpp @@ -61,6 +61,13 @@ WebChannelIPCTransportHost::~WebChannelIPCTransportHost() { } +void WebChannelIPCTransportHost::RenderViewHostChanged(content::RenderViewHost *, content::RenderViewHost *) +{ + // This means that we were moved into a different RenderView, possibly in a different + // render process and that we lost our WebChannelIPCTransport object and its state. + Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId)); +} + void WebChannelIPCTransportHost::setWorldId(uint worldId) { if (worldId == m_worldId) diff --git a/src/core/web_channel_ipc_transport_host.h b/src/core/web_channel_ipc_transport_host.h index 9c499ad78..9cc1f3104 100644 --- a/src/core/web_channel_ipc_transport_host.h +++ b/src/core/web_channel_ipc_transport_host.h @@ -58,6 +58,9 @@ public: WebChannelIPCTransportHost(content::WebContents *, uint worldId = 0, QObject *parent = 0); virtual ~WebChannelIPCTransportHost(); + // WebContentsObserver + virtual void RenderViewHostChanged(content::RenderViewHost* old_host, content::RenderViewHost* new_host) Q_DECL_OVERRIDE; + // QWebChannelAbstractTransport virtual void sendMessage(const QJsonObject &message) Q_DECL_OVERRIDE; -- cgit v1.2.3 From 336e706cbc839dd7b7c1d461b6b015600b5f009e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 3 Aug 2016 16:29:17 +0200 Subject: Doc: Move info about deploying Qt WebEngine apps into a separate topic Move information from the Qt docs here in a follow-up change. Also add information in more follow-up changes. Change-Id: I420dcb879332b298247867768e59a736ef466081 Reviewed-by: Kai Koehne --- src/webengine/doc/src/qtwebengine-deploying.qdoc | 44 ++++++++++++++++++++++++ src/webengine/doc/src/qtwebengine-index.qdoc | 1 + src/webengine/doc/src/qtwebengine-overview.qdoc | 12 ------- 3 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 src/webengine/doc/src/qtwebengine-deploying.qdoc diff --git a/src/webengine/doc/src/qtwebengine-deploying.qdoc b/src/webengine/doc/src/qtwebengine-deploying.qdoc new file mode 100644 index 000000000..4aa57c0df --- /dev/null +++ b/src/webengine/doc/src/qtwebengine-deploying.qdoc @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtwebengine-deploying.html + \title Deploying Qt WebEngine Applications + + Qt WebEngine takes advantage of the multi process model that the Chromium + project offers. The multi process model requires the QtWebEngineProcess + executable to be deployed alongside your application. To do this, we + recommend the use of Qt's cross-platform deployment tools. + + Alternatively, if you are carrying out manual deployment, you will find the + QtWebEngineProcess executable in the libexec directory of your Qt + installation. On Windows, QtWebEngineProcess.exe is located in the bin + directory of your Qt application. + + For more information on deploying Qt applications, please see + \l {Deploying Qt Applications}. +*/ diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc index fd7fe2351..c4be591ff 100644 --- a/src/webengine/doc/src/qtwebengine-index.qdoc +++ b/src/webengine/doc/src/qtwebengine-index.qdoc @@ -46,6 +46,7 @@ \li \l{Qt WebEngine Platform Notes} \li \l{Qt WebEngine Licensing} \li \l{Qt WebEngine Debugging and Profiling} + \li \l{Deploying Qt WebEngine Applications} \li \l{Porting from Qt WebKit to Qt WebEngine} \endlist diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index f1b1b69c5..f34b4514b 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -220,18 +220,6 @@ The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set, delete, and intercept cookies during navigation. - \section1 Deploying Qt WebEngine Applications - - Qt WebEngine takes advantage of the multi process model that the Chromium project offers. - The multi process model requires the QtWebEngineProcess executable to be deployed alongside your application. - To do this, we recommend the use of Qt's cross-platform deployment tools. - - Alternatively, if you are carrying out manual deployment, you will find the QtWebEngineProcess executable in the - libexec directory of your Qt installation. - On Windows, QtWebEngineProcess.exe is located in the bin directory of your Qt application. - - For more information on deploying Qt applications, please see \l {Deploying Qt Applications}. - \section1 Platform Notes Qt WebEngine currently supports only Windows, Linux, and OS X. Due to Chromium build -- cgit v1.2.3