From a757568022ebefd0d83f69a20c09dcc8bdb98136 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 9 May 2016 16:10:59 +0200 Subject: Blacklist flaky QWebEnginePage::setHtmlWithImageResource test. It used to be an expected fail, then it seemed to work in 5.6, and for some reason it fails again in 5.6.1. Change-Id: I95161e001c3b8af3ea48fc284e448a2d8853e108 Reviewed-by: Peter Varga Reviewed-by: Allan Sandfeld Jensen --- tests/auto/widgets/qwebenginepage/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST index 91858f299..ddfba2612 100644 --- a/tests/auto/widgets/qwebenginepage/BLACKLIST +++ b/tests/auto/widgets/qwebenginepage/BLACKLIST @@ -3,3 +3,6 @@ [macCopyUnicodeToClipboard] osx + +[setHtmlWithImageResource] +* -- cgit v1.2.3 From b96784cc6677bef9bd32afb7ca7e6e713114ee9f Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Wed, 4 May 2016 17:01:45 +0200 Subject: Revert marking qrc: as a local scheme It was causing a regression that broke applications that embedded JavaScript in qrc files and accessed them from other embedded JavaScript files. This is e.g. a typical pattern for applications that used QtWebChannel. This partially reverts 29f9a2fb68568208a70ba9efef0e455b50a4d3e3 Task-number: QTBUG-53108 Change-Id: I8b26395d84258b6d9aca8e0c5f07d4435617f44d Reviewed-by: Kai Koehne Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Michal Klocek --- src/core/renderer/content_renderer_client_qt.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index e53076525..3886e54a0 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -73,8 +73,6 @@ public: blink::WebString qrcScheme(base::ASCIIToUTF16(kQrcSchemeQt)); // mark qrc as a secure scheme (avoids deprecation warnings) blink::WebSecurityPolicy::registerURLSchemeAsSecure(qrcScheme); - // mark qrc as a local scheme (allows local access to qrc) - blink::WebSecurityPolicy::registerURLSchemeAsLocal(qrcScheme); } }; -- cgit v1.2.3 From 272a1421076191e5653607fa06f8b96baeb1159a Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Tue, 10 May 2016 13:44:25 +0200 Subject: Update chromium submodule. Includes the new fix for allowing qrc access to local files. Task-number: QTBUG-52085 Change-Id: Ifae5af52580a41f7d66429324714428694a6b65a Reviewed-by: Allan Sandfeld Jensen --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 013d1b766..19e3d1d3a 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 013d1b76695db496d13da4d69e526ce67a9a6bcc +Subproject commit 19e3d1d3af80efee4377a4e5fcb9c214dba5be4e -- cgit v1.2.3 From b052dcaf308d761fa8df39a09f0296b808c928b5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 20 Apr 2016 20:55:32 +0200 Subject: add missing example install Change-Id: Ifee9bb458de2c15760da21938b5e5bb598936161 Reviewed-by: Joerg Bornemann --- examples/webenginewidgets/cookiebrowser/cookiebrowser.pro | 3 +++ examples/webenginewidgets/demobrowser/demobrowser.pro | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro b/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro index 66ea064ef..6b249cf59 100644 --- a/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro +++ b/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro @@ -17,3 +17,6 @@ FORMS += \ RESOURCES += \ cookiebrowser.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/cookiebrowser +INSTALLS += target diff --git a/examples/webenginewidgets/demobrowser/demobrowser.pro b/examples/webenginewidgets/demobrowser/demobrowser.pro index 113eeb40e..dd5cb8006 100644 --- a/examples/webenginewidgets/demobrowser/demobrowser.pro +++ b/examples/webenginewidgets/demobrowser/demobrowser.pro @@ -80,7 +80,9 @@ mac { TARGET = Demobrowser } -EXAMPLE_FILES = Info_mac.plist demobrowser.icns demobrowser.ico demobrowser.rc +EXAMPLE_FILES = \ + Info_mac.plist demobrowser.icns demobrowser.ico demobrowser.rc \ + cookiejar.h cookiejar.cpp # FIXME: these are currently unused. # install target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/demobrowser -- cgit v1.2.3 From bdaea37070f420bea13a34081e56db1ee792d040 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 9 May 2016 11:01:18 +0200 Subject: [Simplebrowser] Fix command line option parsing. Passing just command line options to Chromium prevents loading of the initial startup url. This happens because the startup url is overridden by the last command line argument, which happens to be a Chromium option, thus an invalid URL. Fix consists in using the last command line argument as the loading url only if it can be parsed as valid url. Change-Id: I3615ef57b6eddc5098de79cba1b1ba6b6af193ef Reviewed-by: Allan Sandfeld Jensen --- examples/webenginewidgets/simplebrowser/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp index 761403fb5..750e7ae43 100644 --- a/examples/webenginewidgets/simplebrowser/main.cpp +++ b/examples/webenginewidgets/simplebrowser/main.cpp @@ -42,6 +42,18 @@ #include "browserwindow.h" #include +QString getCommandLineUrlArgument() +{ + const QStringList args = QCoreApplication::arguments(); + if (args.count() > 1) { + const QString lastArg = args.last(); + const bool isValidUrl = QUrl::fromUserInput(lastArg).isValid(); + if (isValidUrl) + return lastArg; + } + return QString(); +} + int main(int argc, char **argv) { QApplication app(argc, argv); @@ -50,9 +62,9 @@ int main(int argc, char **argv) BrowserWindow *window = new BrowserWindow(); Browser::instance().addWindow(window); - QStringList args = QCoreApplication::arguments(); - if (args.count() > 1) - window->loadPage(args.last()); + const QString url = getCommandLineUrlArgument(); + if (!url.isEmpty()) + window->loadPage(url); else window->loadHomePage(); -- cgit v1.2.3 From f2370c0d09998f382364a9a58932cf717c28a764 Mon Sep 17 00:00:00 2001 From: Ilia Kirianovskii Date: Tue, 16 Feb 2016 11:35:48 +0300 Subject: Fix CXX :visited selector This patch fixes highlighting of visited links and now Acid3 test completely works (100 of 100). The reason is that VisitedLinkMaster must be initialized before a new RenderView will be created. Otherwise, it will not handle content::NOTIFICATION_RENDERER_PROCESS_CREATED event and therefore VisitedLinkSlave will be left uninitialized (salt_ is zero). Because of this reason CSS :visited selector was broken and didn't work. Change-Id: I769cd5dbae2ffb95fd128df634a54e562b9cc91d Reviewed-by: Ilia Kirianovskii Reviewed-by: Joerg Bornemann --- src/core/browser_context_adapter.cpp | 19 ++++++++++++++----- src/core/browser_context_adapter.h | 1 + src/core/web_contents_adapter.cpp | 6 ++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp index 481197eed..702851ba5 100644 --- a/src/core/browser_context_adapter.cpp +++ b/src/core/browser_context_adapter.cpp @@ -101,7 +101,8 @@ void BrowserContextAdapter::setStorageName(const QString &storageName) m_name = storageName; if (m_browserContext->url_request_getter_.get()) m_browserContext->url_request_getter_->updateStorageSettings(); - m_visitedLinksManager.reset(); + if (m_visitedLinksManager) + resetVisitedLinksManager(); } void BrowserContextAdapter::setOffTheRecord(bool offTheRecord) @@ -111,7 +112,8 @@ void BrowserContextAdapter::setOffTheRecord(bool offTheRecord) m_offTheRecord = offTheRecord; if (m_browserContext->url_request_getter_.get()) m_browserContext->url_request_getter_->updateStorageSettings(); - m_visitedLinksManager.reset(); + if (m_visitedLinksManager) + resetVisitedLinksManager(); } BrowserContextQt *BrowserContextAdapter::browserContext() @@ -122,7 +124,7 @@ BrowserContextQt *BrowserContextAdapter::browserContext() WebEngineVisitedLinksManager *BrowserContextAdapter::visitedLinksManager() { if (!m_visitedLinksManager) - m_visitedLinksManager.reset(new WebEngineVisitedLinksManager(this)); + resetVisitedLinksManager(); return m_visitedLinksManager.data(); } @@ -195,7 +197,8 @@ void BrowserContextAdapter::setDataPath(const QString &path) m_dataPath = path; if (m_browserContext->url_request_getter_.get()) m_browserContext->url_request_getter_->updateStorageSettings(); - m_visitedLinksManager.reset(); + if (m_visitedLinksManager) + resetVisitedLinksManager(); } QString BrowserContextAdapter::cachePath() const @@ -336,7 +339,8 @@ void BrowserContextAdapter::setVisitedLinksPolicy(BrowserContextAdapter::Visited if (m_visitedLinksPolicy == visitedLinksPolicy) return; m_visitedLinksPolicy = visitedLinksPolicy; - m_visitedLinksManager.reset(); + if (m_visitedLinksManager) + resetVisitedLinksManager(); } int BrowserContextAdapter::httpCacheMaxSize() const @@ -459,4 +463,9 @@ void BrowserContextAdapter::setHttpAcceptLanguage(const QString &httpAcceptLangu m_browserContext->url_request_getter_->updateUserAgent(); } +void BrowserContextAdapter::resetVisitedLinksManager() +{ + m_visitedLinksManager.reset(new WebEngineVisitedLinksManager(this)); +} + } // namespace QtWebEngineCore diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h index b133eab65..1eeb88770 100644 --- a/src/core/browser_context_adapter.h +++ b/src/core/browser_context_adapter.h @@ -163,6 +163,7 @@ public: private: void updateCustomUrlSchemeHandlers(); + void resetVisitedLinksManager(); QString m_name; bool m_offTheRecord; diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 30c589c56..66d133f60 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -394,6 +394,12 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient) // This should only be necessary after having restored the history to a new WebContentsAdapter. d->webContents->GetController().LoadIfNecessary(); + // Create an instance of WebEngineVisitedLinksManager to catch the first + // content::NOTIFICATION_RENDERER_PROCESS_CREATED event. This event will + // force to initialize visited links in VisitedLinkSlave. + // It must be done before creating a RenderView. + d->browserContextAdapter->visitedLinksManager(); + // Create a RenderView with the initial empty document content::RenderViewHost *rvh = d->webContents->GetRenderViewHost(); Q_ASSERT(rvh); -- cgit v1.2.3 From 47031c68b872718de834656601edd0f8f1931fa7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 11 May 2016 15:29:04 +0200 Subject: Add changes file for 5.6.1 Change-Id: Ic36c55b5deaceb2a7944f33aead62c6cb31a01f9 Reviewed-by: Kai Koehne Reviewed-by: Leena Miettinen --- dist/changes-5.6.1 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 dist/changes-5.6.1 diff --git a/dist/changes-5.6.1 b/dist/changes-5.6.1 new file mode 100644 index 000000000..5a568bda9 --- /dev/null +++ b/dist/changes-5.6.1 @@ -0,0 +1,65 @@ +Qt 5.6.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.6.0. + +Qt 5.6 introduces many new features and improvements as well as bugfixes +over the 5.5.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.6 series is binary compatible with the 5.5.x series. +Applications compiled for 5.5 will continue to run with 5.6. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + + - Chromium Snapshot: + * Security fixes from Chromium up to version 50.0.2661.94 + * [QTBUG-52602] Fixed devtools so it works with newer Chrome releases. + * [QTBUG-52085, QTBUG-53108] qrc urls can now load local files. + + - QtWebEngineCore: + * [QTBUG-52124] Fixed crashes due to multithreaded use of qputenv. + * [QTBUG-52216] Fixed access of labels of MediaStream tracks. + * [QTBUG-52715] Fixed copying images to clipboard. + * [QTBUG-51789] Fixed crashes when instantiating QCoreApplication. + * [QTBUG-52121] Ensured cookies are flushed to disk on exit. + * Fixed numerous race-conditions when changing profile settings and using + custom URL scheme handlers. + + - WebEnginePage: + * [QTBUG-48995] Stopped triggering extra urlChanged signals. + * [QTBUG-51319] Accepted certificate errors are now remembered correctly. + * [QTBUG-51851, QTBUG-51969] Fixed zoom behavior. + * [QTBUG-53033] Reset the selected text of a page when setHtml is called. + * Fixed memory leak in standardContextMenu() + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + + - Linux: + * NSS is now only used for certificate handling. BoringSSL is used + for SSL encryption like on OS X and Windows. + * [QTBUG-48298] Fixed compilation against old Linux kernel headers. + + - Windows: + * [QTBUG-51920] Fixed building on Japanese Windows. + * [QTBUG-50252] Fixed doubled characters when using IME. + * [QTBUG-51971] Fixed CommandLine initialization. + * [QTBUG-51847] Fixed compilation issue with moc. + * [QTBUG-46720] Added support for linking to QtWebEngine from a plugin. + + - OS X: + * [QTBUG-51939] Fixed QtWebEngineProcess not being found after + macdeployqt is used. -- cgit v1.2.3 From f4b806ffbc2f11a5a64fab2856dfe68ae7d603c8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 18 May 2016 14:55:13 +0200 Subject: Fix pasting images to web pages WebKit expects pasted images to have the MIME type image/png (see code and comment in DataObjectItem::getAsFile()). Task-number: QTBUG-53409 Change-Id: I2b0c1244d309687ad190db26c5b00718ed0c4258 Reviewed-by: Allan Sandfeld Jensen --- src/core/clipboard_qt.cpp | 4 +-- .../qwebenginepage/resources/pasteimage.html | 30 +++++++++++++++++++++ .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 31 ++++++++++++++++++++++ .../widgets/qwebenginepage/tst_qwebenginepage.qrc | 1 + 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 tests/auto/widgets/qwebenginepage/resources/pasteimage.html diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp index 9ac5c7a17..e632c5583 100644 --- a/src/core/clipboard_qt.cpp +++ b/src/core/clipboard_qt.cpp @@ -282,6 +282,8 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vectorclear(); const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection); + if (mimeData->hasImage()) + types->push_back(toString16(QStringLiteral("image/png"))); Q_FOREACH (const QString &mimeType, mimeData->formats()) types->push_back(toString16(mimeType)); *contains_filenames = false; @@ -325,8 +327,6 @@ void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string* result) const SkBitmap ClipboardQt::ReadImage(ui::ClipboardType type) const { - // FIXME: Untested, pasting image data seems to only be supported through - // FileReader.readAsDataURL in JavaScript and this isn't working down the pipe for some reason. const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection); QImage image = qvariant_cast(mimeData->imageData()); diff --git a/tests/auto/widgets/qwebenginepage/resources/pasteimage.html b/tests/auto/widgets/qwebenginepage/resources/pasteimage.html new file mode 100644 index 000000000..cc37d9319 --- /dev/null +++ b/tests/auto/widgets/qwebenginepage/resources/pasteimage.html @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 5d53c0468..f29b24933 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -120,6 +121,7 @@ private Q_SLOTS: void geolocationRequestJS(); void loadFinished(); void actionStates(); + void pasteImage(); void popupFormSubmission(); void userStyleSheet(); void userStyleSheetFromLocalFileUrl(); @@ -459,6 +461,35 @@ void tst_QWebEnginePage::actionStates() QTRY_VERIFY(!stopAction->isEnabled()); } +static QImage imageWithoutAlpha(const QImage &image) +{ + QImage result = image; + QPainter painter(&result); + painter.fillRect(result.rect(), Qt::green); + painter.drawImage(0, 0, image); + return result; +} + +void tst_QWebEnginePage::pasteImage() +{ + // Pixels with an alpha value of 0 will have different RGB values after the + // test -> clipboard -> webengine -> test roundtrip. + // Clear the alpha channel to make QCOMPARE happy. + const QImage origImage = imageWithoutAlpha(QImage(":/resources/image.png")); + QClipboard *clipboard = QGuiApplication::clipboard(); + clipboard->setImage(origImage); + QWebEnginePage *page = m_view->page(); + page->load(QUrl("qrc:///resources/pasteimage.html")); + QVERIFY(waitForSignal(m_view, SIGNAL(loadFinished(bool)))); + page->triggerAction(QWebEnginePage::Paste); + QTRY_VERIFY(evaluateJavaScriptSync(page, + "window.myImageDataURL ? window.myImageDataURL.length : 0").toInt() > 0); + QByteArray data = evaluateJavaScriptSync(page, "window.myImageDataURL").toByteArray(); + data.remove(0, data.indexOf(";base64,") + 8); + const QImage image = QImage::fromData(QByteArray::fromBase64(data), "PNG"); + QCOMPARE(image, origImage); +} + class ConsolePage : public QWebEnginePage { public: diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc index c7bffd5bb..91adeb694 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc @@ -12,6 +12,7 @@ resources/script.html resources/user.css resources/image.png + resources/pasteimage.html resources/style.css resources/test1.html resources/test2.html -- cgit v1.2.3 From 3206e85c0f7ee3de9953977ffbb0137de0ee01f3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 18 May 2016 16:29:40 +0200 Subject: Silence zero-as-null-pointer=constant warnings This appears to have been added to headerclean and is now preventing us from integrating. Change-Id: I7c25a85c0d62c945d4f4a68f559000fab8c880cc Reviewed-by: Joerg Bornemann --- src/core/api/qwebenginecookiestore.h | 2 +- src/core/api/qwebengineurlrequestinterceptor.h | 2 +- src/core/api/qwebengineurlschemehandler.h | 2 +- src/webengine/api/qquickwebengineprofile.h | 2 +- src/webenginewidgets/api/qwebenginedownloaditem.h | 2 +- src/webenginewidgets/api/qwebenginepage.h | 8 ++++---- src/webenginewidgets/api/qwebengineprofile.h | 6 +++--- src/webenginewidgets/api/qwebenginesettings.h | 2 +- src/webenginewidgets/api/qwebengineview.h | 6 +++--- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h index b1d625385..eac976fae 100644 --- a/src/core/api/qwebenginecookiestore.h +++ b/src/core/api/qwebenginecookiestore.h @@ -70,7 +70,7 @@ Q_SIGNALS: void cookieRemoved(const QNetworkCookie &cookie); private: - explicit QWebEngineCookieStore(QObject *parent = 0); + explicit QWebEngineCookieStore(QObject *parent = Q_NULLPTR); friend class QtWebEngineCore::BrowserContextAdapter; friend class QtWebEngineCore::CookieMonsterDelegateQt; Q_DISABLE_COPY(QWebEngineCookieStore) diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h index a3b7cf979..e9f9c8d5f 100644 --- a/src/core/api/qwebengineurlrequestinterceptor.h +++ b/src/core/api/qwebengineurlrequestinterceptor.h @@ -52,7 +52,7 @@ class QWEBENGINE_EXPORT QWebEngineUrlRequestInterceptor : public QObject Q_OBJECT Q_DISABLE_COPY(QWebEngineUrlRequestInterceptor) public: - explicit QWebEngineUrlRequestInterceptor(QObject *p = 0) + explicit QWebEngineUrlRequestInterceptor(QObject *p = Q_NULLPTR) : QObject (p) { } diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h index d9fc15250..738bc281b 100644 --- a/src/core/api/qwebengineurlschemehandler.h +++ b/src/core/api/qwebengineurlschemehandler.h @@ -52,7 +52,7 @@ class QWebEngineUrlRequestJob; class QWEBENGINE_EXPORT QWebEngineUrlSchemeHandler : public QObject { Q_OBJECT public: - QWebEngineUrlSchemeHandler(QObject *parent = 0); + QWebEngineUrlSchemeHandler(QObject *parent = Q_NULLPTR); ~QWebEngineUrlSchemeHandler(); virtual void requestStarted(QWebEngineUrlRequestJob*) = 0; diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h index 1850f52fa..1d8608e0f 100644 --- a/src/webengine/api/qquickwebengineprofile.h +++ b/src/webengine/api/qquickwebengineprofile.h @@ -143,7 +143,7 @@ private Q_SLOTS: private: Q_DECLARE_PRIVATE(QQuickWebEngineProfile) - QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *, QObject *parent = 0); + QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *, QObject *parent = Q_NULLPTR); QQuickWebEngineSettings *settings() const; friend class QQuickWebEngineSettings; diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.h b/src/webenginewidgets/api/qwebenginedownloaditem.h index 886d9ab9a..648b91ec9 100644 --- a/src/webenginewidgets/api/qwebenginedownloaditem.h +++ b/src/webenginewidgets/api/qwebenginedownloaditem.h @@ -86,7 +86,7 @@ private: friend class QWebEngineProfilePrivate; - QWebEngineDownloadItem(QWebEngineDownloadItemPrivate*, QObject *parent = 0); + QWebEngineDownloadItem(QWebEngineDownloadItemPrivate*, QObject *parent = Q_NULLPTR); QScopedPointer d_ptr; }; diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h index 811003dd0..911bfe917 100644 --- a/src/webenginewidgets/api/qwebenginepage.h +++ b/src/webenginewidgets/api/qwebenginepage.h @@ -175,8 +175,8 @@ public: KilledTerminationStatus }; - explicit QWebEnginePage(QObject *parent = 0); - QWebEnginePage(QWebEngineProfile *profile, QObject *parent = 0); + explicit QWebEnginePage(QObject *parent = Q_NULLPTR); + QWebEnginePage(QWebEngineProfile *profile, QObject *parent = Q_NULLPTR); ~QWebEnginePage(); QWebEngineHistory *history() const; @@ -195,10 +195,10 @@ public: virtual bool event(QEvent*); #ifdef Q_QDOC - void findText(const QString &subString, FindFlags options = 0); + void findText(const QString &subString, FindFlags options = FindFlags()); void findText(const QString &subString, FindFlags options, FunctorOrLambda resultCallback); #else - void findText(const QString &subString, FindFlags options = 0, const QWebEngineCallback &resultCallback = QWebEngineCallback()); + void findText(const QString &subString, FindFlags options = FindFlags(), const QWebEngineCallback &resultCallback = QWebEngineCallback()); #endif QMenu *createStandardContextMenu(); diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h index 416ef23db..be420c62f 100644 --- a/src/webenginewidgets/api/qwebengineprofile.h +++ b/src/webenginewidgets/api/qwebengineprofile.h @@ -60,8 +60,8 @@ class QWebEngineUrlSchemeHandler; class QWEBENGINEWIDGETS_EXPORT QWebEngineProfile : public QObject { Q_OBJECT public: - explicit QWebEngineProfile(QObject *parent = 0); - explicit QWebEngineProfile(const QString &name, QObject *parent = 0); + explicit QWebEngineProfile(QObject *parent = Q_NULLPTR); + explicit QWebEngineProfile(const QString &name, QObject *parent = Q_NULLPTR); virtual ~QWebEngineProfile(); enum HttpCacheType { @@ -126,7 +126,7 @@ private Q_SLOTS: private: Q_DISABLE_COPY(QWebEngineProfile) Q_DECLARE_PRIVATE(QWebEngineProfile) - QWebEngineProfile(QWebEngineProfilePrivate *, QObject *parent = 0); + QWebEngineProfile(QWebEngineProfilePrivate *, QObject *parent = Q_NULLPTR); friend class QWebEnginePagePrivate; friend class QWebEngineUrlSchemeHandler; diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h index 327fd447b..53c38ef2b 100644 --- a/src/webenginewidgets/api/qwebenginesettings.h +++ b/src/webenginewidgets/api/qwebenginesettings.h @@ -100,7 +100,7 @@ private: friend class QWebEngineProfilePrivate; ~QWebEngineSettings(); - explicit QWebEngineSettings(QWebEngineSettings *parentSettings = 0); + explicit QWebEngineSettings(QWebEngineSettings *parentSettings = Q_NULLPTR); }; QT_END_NAMESPACE diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h index e16bbf4af..34eb6177c 100644 --- a/src/webenginewidgets/api/qwebengineview.h +++ b/src/webenginewidgets/api/qwebengineview.h @@ -61,7 +61,7 @@ class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget { Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) public: - explicit QWebEngineView(QWidget* parent = 0); + explicit QWebEngineView(QWidget* parent = Q_NULLPTR); virtual ~QWebEngineView(); QWebEnginePage* page() const; @@ -90,10 +90,10 @@ public: void setZoomFactor(qreal factor); #ifdef Q_QDOC - void findText(const QString &subString, QWebEnginePage::FindFlags options = 0); + void findText(const QString &subString, QWebEnginePage::FindFlags options = QWebEnginePage::FindFlags()); void findText(const QString &subString, QWebEnginePage::FindFlags options, FunctorOrLambda resultCallback); #else - void findText(const QString &subString, QWebEnginePage::FindFlags options = 0, const QWebEngineCallback &resultCallback = QWebEngineCallback()); + void findText(const QString &subString, QWebEnginePage::FindFlags options = QWebEnginePage::FindFlags(), const QWebEngineCallback &resultCallback = QWebEngineCallback()); #endif virtual QSize sizeHint() const Q_DECL_OVERRIDE; -- cgit v1.2.3 From 1f2109f95a4714fa9b1e16179c8dba8846ef342e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 13 May 2016 16:20:28 +0200 Subject: Doc: HTTP GET method is always used to load URLs Task-number: QTBUG-53314 Change-Id: I575a740cf0cd6e788c7533f4ec87fc910f1d03fa Reviewed-by: Allan Sandfeld Jensen --- src/webengine/doc/src/webengineview.qdoc | 7 +++++-- src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 3 ++- src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc index 574b5e70f..2aeb88b26 100644 --- a/src/webengine/doc/src/webengineview.qdoc +++ b/src/webengine/doc/src/webengineview.qdoc @@ -47,8 +47,11 @@ \section2 Loading Web Pages An application can load pages into the WebEngineView, using either the \l url property or the - \l loadHtml method and navigate within the view's session history. The history is represented - by a WebEngineHistory data model that is held by the \l navigationHistory property. + \l loadHtml method and navigate within the view's session history. The GET + method is always used to load URLs. + + The history is represented by a WebEngineHistory data model that is held by + the \l navigationHistory property. The following sample QML application loads a web page using the \c url property: diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index 9be4a25e7..50578a0e7 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -39,7 +39,8 @@ and findText(). A page can be loaded using load() or setUrl(). Alternatively, if you have - the HTML content readily available, you can use setHtml(). + the HTML content readily available, you can use setHtml(). The GET method is + always used to load URLs. The QWebEnginePage class also offers methods to retrieve both the URL currently loaded by the page (see url()) as well as the URL originally requested diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc index 976a1a924..d03d64a1c 100644 --- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc @@ -37,8 +37,10 @@ It can be used in various applications to display web content live from the Internet. - A \e {web site} can be loaded to a web view with the load() function. Like all - Qt widgets, the show() function must be invoked in order to display + A \e {web site} can be loaded to a web view with the load() function. The + GET method is always used to load URLs. + + Like all Qt widgets, the show() function must be invoked in order to display the web view. The snippet below illustrates this: \snippet simple/main.cpp Using QWebEngineView -- cgit v1.2.3 From b692e1f9dcae08dca2d6a14c69cd9d9cbc679335 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 18 May 2016 16:50:14 +0200 Subject: Remove fake dependencies in embedded linux builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When doing embedded Linux builds we do not use X11 libraries. Change-Id: I704d8fd4853e2187590bc9513f55b7ec61c9c4bd Reviewed-by: Michael Brüning --- tools/qmake/mkspecs/features/configure.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf index 811a88e89..9d7d85535 100644 --- a/tools/qmake/mkspecs/features/configure.prf +++ b/tools/qmake/mkspecs/features/configure.prf @@ -26,7 +26,7 @@ defineTest(runConfigure) { !config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)") REQUIRED_PACKAGES = dbus-1 fontconfig - contains(QT_CONFIG, xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst + !cross_compile: contains(QT_CONFIG, xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst contains(QT_CONFIG, pulseaudio): REQUIRED_PACKAGES += libpulse contains(QT_CONFIG, system-png): REQUIRED_PACKAGES += libpng contains(QT_CONFIG, system-harfbuzz): REQUIRED_PACKAGES += harfbuzz -- cgit v1.2.3 From c1f4f8f21b1b121e8a7aed3c41b93cbff1aaee18 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 19 May 2016 16:34:03 +0200 Subject: Doc: Explain why QSslError values are not used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-53332 Change-Id: Ia3e89287caae50ea043065cb97441ad9796c1dcc Reviewed-by: Michael Brüning --- src/webenginewidgets/api/qwebenginecertificateerror.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.cpp b/src/webenginewidgets/api/qwebenginecertificateerror.cpp index f35175c67..f470e8f0b 100644 --- a/src/webenginewidgets/api/qwebenginecertificateerror.cpp +++ b/src/webenginewidgets/api/qwebenginecertificateerror.cpp @@ -82,6 +82,10 @@ QWebEngineCertificateError::~QWebEngineCertificateError() This enum describes the type of certificate error encountered. + The values of this enum type match the SSL errors Chromium provides. + QSslError::SslError values are not used directly, because the Qt error + categories cannot be mapped to the Chromium error categories. + \value SslPinnedKeyNotInCertificateChain The certificate did not match the built-in public keys pinned for the host name. \value CertificateCommonNameInvalid The certificate's common name did not match the host name. -- cgit v1.2.3 From e02fd70aac4544aceda5289d12c751721ee9a3dc Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 19 May 2016 17:20:12 +0200 Subject: Doc: Add a topic listing supported features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move some features from the platform notes to the new topic. Change-Id: I23bb0593a0e142a18ad4216a03bfe1935965fc10 Reviewed-by: Michael Brüning --- src/webengine/api/qquickwebenginesettings.cpp | 2 +- src/webengine/doc/src/qtwebengine-features.qdoc | 187 +++++++++++++++++++++ src/webengine/doc/src/qtwebengine-index.qdoc | 1 + .../doc/src/qtwebengine-platform-notes.qdoc | 78 --------- .../doc/src/qwebenginesettings_lgpl.qdoc | 2 +- 5 files changed, 190 insertions(+), 80 deletions(-) create mode 100644 src/webengine/doc/src/qtwebengine-features.qdoc diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 246207b31..525d6c8c4 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -214,7 +214,7 @@ bool QQuickWebEngineSettings::errorPageEnabled() const Disabled by default. - \sa {Pepper Plugin API Support} + \sa {Pepper Plugin API} */ bool QQuickWebEngineSettings::pluginsEnabled() const { diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc new file mode 100644 index 000000000..ad053c4a9 --- /dev/null +++ b/src/webengine/doc/src/qtwebengine-features.qdoc @@ -0,0 +1,187 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtwebengine-features.html + \title Qt WebEngine Features + + \brief Summarizes Qt WebEngine features. + + Qt WebEngine supports the following Chromium features: + + \list + \li \l{Audio and Video Codecs} + \li \l{Chromium DevTools} + \li \l{Fullscreen} + \li \l{HTML5 Geolocation} + \li \l{Pepper Plugin API} + \li \l{WebRTC} + \endlist + + \section1 Audio and Video Codecs + + Qt WebEngine supports the MPEG-4 Part 14 (MP4) file format only if the + required proprietary audio and video codecs, such as H.264 and MPEG layer-3 + (MP3), have been enabled. Proprietary codecs can be enabled by passing the + following option to qmake when building Qt WebEngine: + + \code + qmake WEBENGINE_CONFIG+=use_proprietary_codecs + \endcode + + \warning When distributing proprietary codec libraries, you must acquire + licenses for them. + + \l FFmpeg is a cross-platform solution to record, convert, and stream audio + and video. It can be configured for use with several codecs, which rises + licensing issues during distribution with the codec libraries. For some + codecs, open source implementations, such as \l {OpenH264}, are available. + + \section1 Chromium DevTools + + The Chromium DevTools provide the ability to inspect and debug layout and + performance issues of any web content. + + This feature can be tested by launching a Qt WebEngine application with the + command line option \c {--remote-debugging-port=[your-port]} or by setting + the environment variable \c QTWEBENGINE_REMOTE_DEBUGGING, and then using a + Chromium based browser (such as \l{WebEngine Demo Browser Example} + {Demo Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}) to connect + to \c {http://localhost:[your-port]}. + + For more information, see \l {Qt WebEngine Debugging and Profiling}. + + \section1 Fullscreen + + Qt WebEngine supports viewing web content in fullscreen mode. For more + information, see \l{WebEngineSettings::fullscreenSupportEnabled} + {WebEngineSettings.fullscreenSupportEnabled}, + \l{WebEngineView::fullScreenRequested}{WebEngineView.fullScreenRequested}, + QWebEngineSettings::FullScreenSupportEnabled, and + QWebEnginePage::fullScreenRequested. + + This feature can be tested by playing a video from YouTube in \l{WebEngine + Demo Browser Example}{Demo Browser} or \l{WebEngine Quick Nano Browser} + {Nano Browser}, and clicking the full screen icon to go into fullscreen + mode. + + Support for this feature was added in Qt 5.6.0. + + \section1 HTML5 Geolocation + + Qt WebEngine supports JavaScript Geolocation API with \l {Qt Location} as a + backend. The application has to explicitly allow the feature by using + QWebEnginePage::Geolocation or \l{WebEngineView::Feature} + {WebEngineView.Feature}. + + This feature can be tested if Qt Location has been built before Qt WebEngine. + The \c http://html5demos.com/geo page can be opened in the \l{WebEngine Demo + Browser Example}{Demo Browser} and allowed to find the current position of + the user. Note that on Windows an external GPS receiver must be connected to + the application. For more information, see \l{Qt Positioning}. + + \section1 Pepper Plugin API + + Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins if + WebEngineSettings::pluginsEnabled or QWebEngineSettings::PluginsEnabled + is set. + + Except for the Adobe Flash Player plugin, the plugins must be loaded + manually using the Chromium command line syntax with the + \c --register-pepper-plugins argument. The argument value is a list of + entries, separated by commas, that contain the file path and one or several + MIME types, separated by semicolons: + + \code + ;,;; + \endcode + + For example: + + \code + --register-pepper-plugins="libppapi_example.so;application/x-ppapi-example" + \endcode + + The MIME type is important because it determines which embeds the plugin is + used for. + + Support for this feature was added in Qt 5.6.0. + + \section2 Pepper Flash Player Plugin Support + + The Pepper Flash player plugin can be loaded automatically if it is + installed in one of the following locations, depending on the platform: + + \list + \li Windows + \code + C:\Windows\SysWOW64\Macromed\Flash\pepflashplayer*.dll + C:\Windows\System32\Macromed\Flash\pepflashplayer*.dll + \endcode + \li OS X + \code + /Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin + \endcode + \li Linux + \code + /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so + /usr/lib/PepperFlash/libpepflashplayer.so + /usr/lib64/chromium/PepperFlash/libpepflashplayer.so + \endcode + \endlist + + You can also load the Pepper Flash player from a specific location by using + command line arguments: + + \code + --ppapi-flash-path=./libpepflashplayer.so + \endcode + + By default, the Flash version is set to \c{11.2.999.999}. You can use the + \c{ppapi-flash-version=} argument to set another Flash version in the + format \c{major.minor.build.revision}: + + \code + --ppapi-flash-version=16.0.0.235 + \endcode + + This feature can be tested in \l{WebEngine Demo Browser Example}{Demo Browser} + or \l{WebEngine Quick Nano Browser}{Nano Browser} if the Adobe Flash PPAPI + plugin is installed and plugins are enabled in the browser. To test the + feature, the \c https://helpx.adobe.com/flash-player.html page can be opened + in the browser. + + \section1 WebRTC + + WebRTC provides browsers with Real-Time Communications (RTC) capabilities + via simple APIs. For more information, see \l{WebEngineView::Feature} + {WebEngineView.Feature} and QWebEnginePage::Feature. + + This feature can be tested by setting up a webcam or microphone and then + opening \c https://test.webrtc.org/ in \l{WebEngine Widgets Simple Browser + Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}. +*/ diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc index c064b035e..db3a01d30 100644 --- a/src/webengine/doc/src/qtwebengine-index.qdoc +++ b/src/webengine/doc/src/qtwebengine-index.qdoc @@ -46,6 +46,7 @@ \list \li \l{Qt WebEngine Overview} + \li \l{Qt WebEngine Features} \li \l{Qt WebEngine Platform Notes} \li \l{Qt WebEngine Debugging and Profiling} \li \l{Porting from Qt WebKit to Qt WebEngine} diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index 5ec70c0cb..72c2c8b7b 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -118,84 +118,6 @@ \note Qt WebEngine cannot be built for the 32-bit mode of OS X (using the \c macx-clang-32 \c mkspec). - \section1 Pepper Plugin API Support - - Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins if - WebEngineSettings::pluginsEnabled or QWebEngineSettings::PluginsEnabled - is set. - - Except for the Adobe Flash Player plugin, the plugins must be loaded manually using the - Chromium command line syntax with the \c --register-pepper-plugins argument. - The argument value is a list of entries, separated by commas, that contain the file path and - one or several MIME types, separated by semicolons: - - \code - ;,;; - \endcode - - For example: - - \code - --register-pepper-plugins="libppapi_example.so;application/x-ppapi-example" - \endcode - - The MIME type is important because it determines which embeds the plugin is used for. - - \section2 Pepper Flash Player Plugin Support - - The Pepper Flash player plugin can be loaded automatically if it is installed in one of the - following locations, depending on the platform: - - \list - \li Windows - \code - C:\Windows\SysWOW64\Macromed\Flash\pepflashplayer*.dll - C:\Windows\System32\Macromed\Flash\pepflashplayer*.dll - \endcode - \li OS X - \code - /Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin - \endcode - \li Linux - \code - /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so - /usr/lib/PepperFlash/libpepflashplayer.so - /usr/lib64/chromium/PepperFlash/libpepflashplayer.so - \endcode - \endlist - - You can also load the Pepper Flash player from a specific location by using command line - arguments: - - \code - --ppapi-flash-path=./libpepflashplayer.so - \endcode - - By default, the Flash version is set to \c{11.2.999.999}. You can use the - \c{ppapi-flash-version=} argument to set another Flash version in the - in the format \c{major.minor.build.revision}: - - \code - --ppapi-flash-version=16.0.0.235 - \endcode - - \section1 Audio and Video Codec Support - - Qt WebEngine supports the MPEG-4 Part 14 (MP4) file format only if the required proprietary - audio and video codecs, such as H.264 and MPEG layer-3 (MP3), have been enabled. Proprietary - codecs can be enabled by passing the following option to qmake: - - \code - qmake WEBENGINE_CONFIG+=use_proprietary_codecs - \endcode - - \warning When distributing proprietary codec libraries, you must acquire licenses for them. - - \l FFmpeg is a cross-platform solution to record, convert, and stream audio and video. It can - be configured for use with several codecs, which rises licensing issues during distribution - with the codec libraries. For some codecs, open source implementations, such as \l {OpenH264}, - are available. - \section1 Default QSurfaceFormat OpenGL Profile Support If a new default QSurfaceFormat with a modified OpenGL profile has to be set, it should be set diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc index 04fbff925..7feb71577 100644 --- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc @@ -128,7 +128,7 @@ Enables displaying the built-in error pages of Chromium. Enabled by default. \value PluginsEnabled Enables support for Pepper plugins, such as the Flash player. Disabled by default. - See also \l{Pepper Plugin API Support}. (Added in Qt 5.6) + See also \l{Pepper Plugin API}. (Added in Qt 5.6) \value FullScreenSupportEnabled Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6) */ -- cgit v1.2.3 From ad8bc45732eeb2efa6e885d564c10761e7154889 Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Wed, 18 May 2016 15:35:42 +0200 Subject: Let setContent / setHtml fail when content is too big to load. Chromium fails silently - except for a log entry - when the size of the content is larger than 2 MB. This was causing trouble because the user was not informed about the failed load at all. Task-number: QTBUG-53414 Change-Id: I80f3f36b5eac72f3809538c19ff314068b75b61d Reviewed-by: Joerg Bornemann --- src/core/web_contents_adapter.cpp | 8 +++++++- src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 66d133f60..c450768fa 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -68,6 +68,7 @@ #include "content/public/common/page_zoom.h" #include "content/public/common/renderer_preferences.h" #include "content/public/common/url_constants.h" +#include "content/public/common/url_utils.h" #include "content/public/common/web_preferences.h" #include "third_party/WebKit/public/web/WebFindOptions.h" @@ -485,7 +486,12 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT urlString.append(","); urlString.append(encodedData.constData(), encodedData.length()); - content::NavigationController::LoadURLParams params((GURL(urlString))); + GURL dataUrlToLoad(urlString); + if (dataUrlToLoad.spec().size() > content::GetMaxURLChars()) { + d->adapterClient->loadFinished(false, baseUrl, false, net::ERR_ABORTED); + return; + } + content::NavigationController::LoadURLParams params((dataUrlToLoad)); params.load_type = content::NavigationController::LOAD_TYPE_DATA; params.base_url_for_data_url = toGurl(baseUrl); params.virtual_url_for_data_url = baseUrl.isEmpty() ? GURL(url::kAboutBlankURL) : toGurl(baseUrl); diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index 50578a0e7..0900765fc 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -607,6 +607,10 @@ \warning This function works only for HTML, for other mime types (such as XHTML and SVG) setContent() should be used instead. + \warning The content will be percent encoded before being sent to the renderer via IPC. + This may increase its size. The maximum size of the percent encoded content is + 2 megabytes minus 30 bytes. + \sa toHtml(), setContent(), load() */ @@ -622,6 +626,10 @@ \note This method will not affect session or global history for the page. + \warning The content will be percent encoded before being sent to the renderer via IPC. + This may increase its size. The maximum size of the percent encoded content is + 2 megabytes minus 6 bytes plus the length of the mime type string. + \sa toHtml(), setHtml() */ -- cgit v1.2.3