summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/web_contents_adapter.cpp8
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc5
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc5
3 files changed, 9 insertions, 9 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 1930e7a0e..53bb55b6a 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -591,9 +591,11 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
{
Q_D(WebContentsAdapter);
QByteArray encodedData = data.toPercentEncoding();
- std::string urlString("data:");
- urlString.append(mimeType.toStdString());
- urlString.append(",");
+ std::string urlString;
+ if (!mimeType.isEmpty())
+ urlString = std::string("data:") + mimeType.toStdString() + std::string(",");
+ else
+ urlString = std::string("data:text/plain;charset=US-ASCII,");
urlString.append(encodedData.constData(), encodedData.length());
GURL dataUrlToLoad(urlString);
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 715fce6d0..b7c876ddd 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -638,9 +638,8 @@
/*!
\fn void QWebEnginePage::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
- Sets the content of this page to \a data. If the \a mimeType argument
- is empty, it is currently assumed that the content is HTML but in future versions we may introduce
- auto-detection.
+ Sets the content of the web page to \a data. If the \a mimeType argument
+ is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
External objects referenced in the content are located relative to \a baseUrl.
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index e54c5d507..9de0609b7 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -152,9 +152,8 @@
/*!
\fn void QWebEngineView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
- Sets the content of the web view to the specified content \a data. If the \a mimeType argument
- is empty, it is currently assumed that the content is HTML but in future versions we may
- introduce auto-detection.
+ Sets the content of the web view to \a data. If the \a mimeType argument
+ is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
External objects referenced in the content are located relative to \a baseUrl.