summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-10 10:19:28 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-10 10:19:28 +0100
commitd1f4409a2b1e0143be0d4fd734f3dd83255ea35c (patch)
tree52daa990c1da2c2ce9656fe4065b73a848a57a5a /src/webenginewidgets
parent8e5ac243ac774209b77bec42eda2ec43f9c9b04a (diff)
parent776442f2117c4b2d6dac75ab56b42bd82e2ce6d0 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp tests/auto/widgets/widgets.pro Change-Id: Id9444359ed2e35d469331db96a355c9ea2d095d5
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.h2
-rw-r--r--src/webenginewidgets/api/qwebenginescript.h2
-rw-r--r--src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc9
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc2
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp21
5 files changed, 34 insertions, 2 deletions
diff --git a/src/webenginewidgets/api/qwebenginehistory.h b/src/webenginewidgets/api/qwebenginehistory.h
index 33d91d523..21ebbf41d 100644
--- a/src/webenginewidgets/api/qwebenginehistory.h
+++ b/src/webenginewidgets/api/qwebenginehistory.h
@@ -79,7 +79,9 @@ private:
friend class QWebEngineHistoryPrivate;
};
+#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineHistoryItem)
+#endif
class QWebEngineHistoryPrivate;
class QWEBENGINEWIDGETS_EXPORT QWebEngineHistory {
diff --git a/src/webenginewidgets/api/qwebenginescript.h b/src/webenginewidgets/api/qwebenginescript.h
index e3f65ec59..34c13e4b7 100644
--- a/src/webenginewidgets/api/qwebenginescript.h
+++ b/src/webenginewidgets/api/qwebenginescript.h
@@ -102,7 +102,9 @@ private:
QSharedDataPointer<QtWebEngineCore::UserScript> d;
};
+#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineScript)
+#endif
#ifndef QT_NO_DEBUG_STREAM
QWEBENGINEWIDGETS_EXPORT QDebug operator<<(QDebug, const QWebEngineScript &);
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
index 6b518a1f2..461af086a 100644
--- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
@@ -101,7 +101,14 @@
\value LocalStorageEnabled
Enables support for the HTML 5 local storage feature. Enabled by default.
\value LocalContentCanAccessRemoteUrls
- Allows locally loaded documents to access remote URLs. Disabled by default.
+ Allows locally loaded documents to ignore cross-origin rules so that they can access
+ remote resources that would normally be blocked, because all remote resources are
+ considered cross-origin for a local file. Remote access that would not be blocked by
+ cross-origin rules is still possible when this setting is disabled (default).
+ Note that disabling this setting does not stop XMLHttpRequests or media elements in
+ local files from accessing remote content. Basically, it only stops some HTML
+ subresources, such as scripts, and therefore disabling this setting is not a safety
+ mechanism.
\value XSSAuditingEnabled
Monitors load requests for cross-site scripting attempts. Suspicious scripts are blocked
and reported in the inspector's JavaScript console. Disabled by default, because it
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 397b9f51b..1ec831ac2 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -76,7 +76,7 @@
new windows, such as pop-up windows, you can subclass QWebEngineView and
reimplement the createWindow() function.
- \sa {WebEngine Demo Browser Example}, {WebEngine Content Manipulation Example}, {Markdown Editor Example}
+ \sa {WebEngine Demo Browser Example}, {WebEngine Content Manipulation Example}, {WebEngine Markdown Editor Example}
*/
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 d9a62fce7..90eb0e76e 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -67,9 +67,30 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(Rende
setFocusPolicy(Qt::StrongFocus);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
+
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
+
+ QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext();
+ if (globalSharedContext) {
+ QSurfaceFormat sharedFormat = globalSharedContext->format();
+
+#ifdef Q_OS_OSX
+ // Check that the default QSurfaceFormat OpenGL profile matches the global OpenGL shared
+ // context profile, otherwise this could lead to a nasty crash.
+ QSurfaceFormat defaultFormat = QSurfaceFormat::defaultFormat();
+ if (defaultFormat.profile() != sharedFormat.profile()) {
+ qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile does not match global shared context OpenGL profile. Please make sure you set a new QSurfaceFormat before the QtGui application instance is created.");
+ }
+#endif
+
+ // Make sure the OpenGL profile of the QOpenGLWidget matches the shared context profile.
+ format.setMajorVersion(sharedFormat.majorVersion());
+ format.setMinorVersion(sharedFormat.minorVersion());
+ format.setProfile(sharedFormat.profile());
+ }
+
setFormat(format);
#endif