summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------src/3rdparty0
-rw-r--r--src/core/api/qwebenginecookiestore.cpp3
-rw-r--r--src/core/browser_context_adapter.cpp14
-rw-r--r--src/core/browser_context_adapter.h3
-rw-r--r--src/core/config/linux.pri9
-rw-r--r--src/core/core_gyp_generator.pro3
-rw-r--r--src/core/core_headers.pro2
-rw-r--r--src/core/permission_manager_qt.cpp6
-rw-r--r--src/core/permission_manager_qt.h1
-rw-r--r--src/core/render_widget_host_view_qt.cpp53
-rw-r--r--src/core/render_widget_host_view_qt.h3
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp4
-rw-r--r--src/core/web_contents_adapter.cpp5
-rw-r--r--src/core/web_contents_delegate_qt.cpp28
-rw-r--r--src/core/web_contents_delegate_qt.h2
-rw-r--r--src/core/web_engine_context.cpp28
-rw-r--r--src/plugins/plugins.pro2
-rw-r--r--src/plugins/qwebengineview/images/qwebengineview.pngbin0 -> 1473 bytes
-rw-r--r--src/plugins/qwebengineview/qwebengineview.pro11
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.cpp132
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.h70
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.qrc5
-rw-r--r--src/process/Info_mac.plist2
-rw-r--r--src/process/process.pro33
-rw-r--r--src/src.pro4
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp1
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p.h2
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp3
-rw-r--r--src/webengine/api/qquickwebenginescript.cpp2
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp2
-rw-r--r--src/webengine/api/qquickwebenginetestsupport_p.h1
-rw-r--r--src/webengine/api/qquickwebengineview.cpp9
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h1
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp5
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc44
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc10
-rw-r--r--src/webengine/doc/src/webengineview.qdoc42
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp13
-rw-r--r--src/webenginewidgets/api/qwebenginefullscreenrequest.cpp64
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp5
-rw-r--r--src/webenginewidgets/api/qwebenginescript.cpp2
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc6
-rw-r--r--src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc3
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc4
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp13
-rw-r--r--sync.profile1
-rw-r--r--tests/auto/quick/qmltests/data/icons/small-favicon.pngbin891 -> 878 bytes
-rw-r--r--tests/auto/quick/qquickwebengineview/BLACKLIST2
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp13
-rw-r--r--tests/auto/quick/shared/util.h11
-rw-r--r--tests/auto/quick/tests.pri4
-rw-r--r--tests/auto/widgets/qwebengineaccessibility/BLACKLIST6
-rw-r--r--tools/qmake/mkspecs/features/configure.prf4
53 files changed, 552 insertions, 144 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 3b0bfc5e19ce670e427c856cf368e66e15e060a
+Subproject 349c3122be9f932991f938a33e761b00062a5f5
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 06912ce9..4617882a 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -191,6 +191,9 @@ void QWebEngineCookieStorePrivate::onCookieChanged(const QNetworkCookie &cookie,
to get notified about the success of the operation.
The signal handlers for removal and addition should not be used to execute heavy tasks,
because they might block the IO thread in case of a blocking connection.
+
+ Use QWebEngineProfile::cookieStore() and QQuickWebEngineProfile::cookieStore()
+ to access the cookie store object for a specific profile.
*/
/*!
diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp
index 19280cf1..9980bf11 100644
--- a/src/core/browser_context_adapter.cpp
+++ b/src/core/browser_context_adapter.cpp
@@ -224,8 +224,13 @@ QString BrowserContextAdapter::cookiesPath() const
if (m_offTheRecord)
return QString();
QString basePath = dataPath();
- if (!basePath.isEmpty())
- return basePath % QLatin1String("/Coookies");
+ if (!basePath.isEmpty()) {
+ // This is a typo fix. We still need the old path in order to avoid breaking migration.
+ QDir coookiesFolder(basePath % QLatin1String("/Coookies"));
+ if (coookiesFolder.exists())
+ return coookiesFolder.path();
+ return basePath % QLatin1String("/Cookies");
+ }
return QString();
}
@@ -403,6 +408,11 @@ void BrowserContextAdapter::permissionRequestReply(const QUrl &origin, Permissio
static_cast<PermissionManagerQt*>(browserContext()->GetPermissionManager())->permissionRequestReply(origin, type, reply);
}
+bool BrowserContextAdapter::checkPermission(const QUrl &origin, PermissionType type)
+{
+ return static_cast<PermissionManagerQt*>(browserContext()->GetPermissionManager())->checkPermission(origin, type);
+}
+
QString BrowserContextAdapter::httpAcceptLanguageWithoutQualities() const
{
const QStringList list = m_httpAcceptLanguage.split(QLatin1Char(','));
diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h
index 55ab688a..cbdc80da 100644
--- a/src/core/browser_context_adapter.h
+++ b/src/core/browser_context_adapter.h
@@ -138,6 +138,8 @@ public:
GeolocationPermission = 1,
// Reserved:
// NotificationPermission = 2,
+ AudioCapturePermission = 3,
+ VideoCapturePermission = 4,
};
HttpCacheType httpCacheType() const;
@@ -163,6 +165,7 @@ public:
UserResourceControllerHost *userResourceController();
void permissionRequestReply(const QUrl &origin, PermissionType type, bool reply);
+ bool checkPermission(const QUrl &origin, PermissionType type);
QString httpAcceptLanguageWithoutQualities() const;
QString httpAcceptLanguage() const;
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 7d6c7bfb..3245888e 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -18,11 +18,14 @@ GYP_CONFIG += \
use_gio=0 \
use_gnome_keyring=0 \
use_kerberos=0 \
- use_pango=0
+ use_pango=0 \
+ use_openssl=1
-!use?(nss) {
+use?(nss) {
+ GYP_CONFIG += use_nss_certs=1 \
+ use_openssl_certs=0
+} else {
GYP_CONFIG += use_nss_certs=0 \
- use_openssl=1 \
use_openssl_certs=1
}
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index e04e34c5..639470a3 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -17,6 +17,9 @@ DEFINES += QT_NO_KEYWORDS \
QTWEBENGINECORE_VERSION_STR=\\\"$$MODULE_VERSION\\\" \
BUILDING_CHROMIUM
+# Ensure that response files, generated by qtbase/mkspecs/features/moc.prf, are found by moc.
+MOC_DIR = $$OUT_PWD/$$getConfigDir()/.moc
+
# Assume that we want mobile touch and low-end hardware behaviors
# whenever we are cross compiling.
cross_compile: DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES
diff --git a/src/core/core_headers.pro b/src/core/core_headers.pro
index ebafe58e..52c6ca57 100644
--- a/src/core/core_headers.pro
+++ b/src/core/core_headers.pro
@@ -1,5 +1,5 @@
TARGET = QtWebEngineCore
-CONFIG += no_private_module header_module internal_module
+CONFIG += no_private_module header_module internal_module no_plist
MODULE = webenginecoreheaders
load(qt_module)
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 1562a02c..fd57ad7b 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -99,6 +99,12 @@ void PermissionManagerQt::permissionRequestReply(const QUrl &origin, BrowserCont
}
}
+bool PermissionManagerQt::checkPermission(const QUrl &origin, BrowserContextAdapter::PermissionType type)
+{
+ QPair<QUrl, BrowserContextAdapter::PermissionType> key(origin, type);
+ return m_permissions.contains(key) && m_permissions[key];
+}
+
int PermissionManagerQt::RequestPermission(content::PermissionType permission,
content::RenderFrameHost *frameHost,
const GURL& requesting_origin,
diff --git a/src/core/permission_manager_qt.h b/src/core/permission_manager_qt.h
index 7c42a06e..928f11c6 100644
--- a/src/core/permission_manager_qt.h
+++ b/src/core/permission_manager_qt.h
@@ -57,6 +57,7 @@ public:
typedef BrowserContextAdapter::PermissionType PermissionType;
void permissionRequestReply(const QUrl &origin, PermissionType type, bool reply);
+ bool checkPermission(const QUrl &origin, PermissionType type);
// content::PermissionManager implementation:
int RequestPermission(
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index eaf8485d..27eda06a 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -229,6 +229,7 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget
: m_host(content::RenderWidgetHostImpl::From(widget))
, m_gestureProvider(QtGestureProviderConfig(), this)
, m_sendMotionActionDown(false)
+ , m_touchMotionStarted(false)
, m_chromiumCompositorData(new ChromiumCompositorData)
, m_needsDelegatedFrameAck(false)
, m_didFirstVisuallyNonEmptyLayout(false)
@@ -1005,6 +1006,12 @@ void RenderWidgetHostViewQt::handleWheelEvent(QWheelEvent *ev)
m_host->ForwardWheelEvent(WebEventFactory::toWebWheelEvent(ev, dpiScale()));
}
+void RenderWidgetHostViewQt::clearPreviousTouchMotionState()
+{
+ m_previousTouchPoints.clear();
+ m_touchMotionStarted = false;
+}
+
void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev)
{
// Chromium expects the touch event timestamps to be comparable to base::TimeTicks::Now().
@@ -1019,19 +1026,46 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev)
QList<QTouchEvent::TouchPoint> touchPoints = mapTouchPointIds(ev->touchPoints());
- if (ev->type() == QEvent::TouchCancel) {
- MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::ACTION_CANCEL, ev->modifiers(), dpiScale());
+ switch (ev->type()) {
+ case QEvent::TouchBegin:
+ m_sendMotionActionDown = true;
+ m_touchMotionStarted = true;
+ break;
+ case QEvent::TouchUpdate:
+ m_touchMotionStarted = true;
+ break;
+ case QEvent::TouchCancel:
+ {
+ // Don't process a TouchCancel event if no motion was started beforehand, or if there are
+ // no touch points in the current event or in the previously processed event.
+ if (!m_touchMotionStarted || (touchPoints.isEmpty() && m_previousTouchPoints.isEmpty())) {
+ clearPreviousTouchMotionState();
+ return;
+ }
+
+ // Use last saved touch points for the cancel event, to get rid of a QList assert,
+ // because Chromium expects a MotionEvent::ACTION_CANCEL instance to contain at least
+ // one touch point, whereas a QTouchCancel may not contain any touch points at all.
+ if (touchPoints.isEmpty())
+ touchPoints = m_previousTouchPoints;
+ clearPreviousTouchMotionState();
+ MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::ACTION_CANCEL,
+ ev->modifiers(), dpiScale());
processMotionEvent(cancelEvent);
return;
}
-
- if (ev->type() == QEvent::TouchBegin)
- m_sendMotionActionDown = true;
+ case QEvent::TouchEnd:
+ clearPreviousTouchMotionState();
+ break;
+ default:
+ break;
+ }
// Make sure that ACTION_POINTER_DOWN is delivered before ACTION_MOVE,
// and ACTION_MOVE before ACTION_POINTER_UP.
std::sort(touchPoints.begin(), touchPoints.end(), compareTouchPoints);
+ m_previousTouchPoints = touchPoints;
for (int i = 0; i < touchPoints.size(); ++i) {
ui::MotionEvent::Action action;
switch (touchPoints[i].state()) {
@@ -1039,21 +1073,24 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev)
if (m_sendMotionActionDown) {
action = ui::MotionEvent::ACTION_DOWN;
m_sendMotionActionDown = false;
- } else
+ } else {
action = ui::MotionEvent::ACTION_POINTER_DOWN;
+ }
break;
case Qt::TouchPointMoved:
action = ui::MotionEvent::ACTION_MOVE;
break;
case Qt::TouchPointReleased:
- action = touchPoints.size() > 1 ? ui::MotionEvent::ACTION_POINTER_UP : ui::MotionEvent::ACTION_UP;
+ action = touchPoints.size() > 1 ? ui::MotionEvent::ACTION_POINTER_UP :
+ ui::MotionEvent::ACTION_UP;
break;
default:
// Ignore Qt::TouchPointStationary
continue;
}
- MotionEventQt motionEvent(touchPoints, eventTimestamp, action, ev->modifiers(), dpiScale(), i);
+ MotionEventQt motionEvent(touchPoints, eventTimestamp, action, ev->modifiers(), dpiScale(),
+ i);
processMotionEvent(motionEvent);
}
}
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index b59de6c2..8c9e6b9f 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -214,6 +214,7 @@ public:
private:
void sendDelegatedFrameAck();
void processMotionEvent(const ui::MotionEvent &motionEvent);
+ void clearPreviousTouchMotionState();
QList<QTouchEvent::TouchPoint> mapTouchPointIds(const QList<QTouchEvent::TouchPoint> &inputPoints);
float dpiScale() const;
@@ -223,7 +224,9 @@ private:
ui::FilteredGestureProvider m_gestureProvider;
base::TimeDelta m_eventsToNowDelta;
bool m_sendMotionActionDown;
+ bool m_touchMotionStarted;
QMap<int, int> m_touchIdMapping;
+ QList<QTouchEvent::TouchPoint> m_previousTouchPoints;
scoped_ptr<RenderWidgetHostViewQtDelegate> m_delegate;
QExplicitlySharedDataPointer<ChromiumCompositorData> m_chromiumCompositorData;
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 4503520e..f3ac0f7c 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -89,10 +89,12 @@ class RenderProcessObserverQt : public content::RenderProcessObserver {
public:
void WebKitInitialized() override
{
- // mark qrc as a secure scheme (avoids deprecation warnings)
// Can only be done after blink is initialized.
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);
}
};
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 7ac3ad72..37ad73ff 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -950,6 +950,11 @@ QSizeF WebContentsAdapter::lastContentsSize() const
void WebContentsAdapter::grantMediaAccessPermission(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags flags)
{
Q_D(WebContentsAdapter);
+ // Let the permission manager remember the reply.
+ if (flags & WebContentsAdapterClient::MediaAudioCapture)
+ d->browserContextAdapter->permissionRequestReply(securityOrigin, BrowserContextAdapter::AudioCapturePermission, true);
+ if (flags & WebContentsAdapterClient::MediaVideoCapture)
+ d->browserContextAdapter->permissionRequestReply(securityOrigin, BrowserContextAdapter::VideoCapturePermission, true);
MediaCaptureDevicesDispatcher::GetInstance()->handleMediaAccessPermissionResponse(d->webContents.get(), securityOrigin, flags);
}
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index e7d94d33..2dd75df8 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -135,6 +135,20 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source,
}
}
+bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *source)
+{
+ Q_UNUSED(source)
+
+ // Allow failed URLs to stick around in the URL bar, but only when the error-page is enabled.
+ WebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool isErrorPageEnabled = settings->testAttribute(settings->Attribute::ErrorPageEnabled);
+
+ if (isErrorPageEnabled)
+ return true;
+
+ return false;
+}
+
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)
@@ -441,6 +455,20 @@ void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool pr
m_viewClient->windowCloseRejected();
}
+bool WebContentsDelegateQt::CheckMediaAccessPermission(content::WebContents *web_contents, const GURL& security_origin, content::MediaStreamType type)
+{
+ switch (type) {
+ case content::MEDIA_DEVICE_AUDIO_CAPTURE:
+ return m_viewClient->browserContextAdapter()->checkPermission(toQt(security_origin), BrowserContextAdapter::AudioCapturePermission);
+ case content::MEDIA_DEVICE_VIDEO_CAPTURE:
+ return m_viewClient->browserContextAdapter()->checkPermission(toQt(security_origin), BrowserContextAdapter::VideoCapturePermission);
+ default:
+ LOG(INFO) << "WebContentsDelegateQt::CheckMediaAccessPermission: "
+ << "Unsupported media stream type checked" << type;
+ return false;
+ }
+}
+
FaviconManager *WebContentsDelegateQt::faviconManager()
{
return m_faviconManager.data();
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 12e33eb1..e6deaa40 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -100,10 +100,12 @@ public:
virtual bool IsPopupOrPanel(const content::WebContents *source) const Q_DECL_OVERRIDE;
virtual void UpdateTargetURL(content::WebContents* source, const GURL& url) Q_DECL_OVERRIDE;
virtual void RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target) Q_DECL_OVERRIDE;
+ virtual bool ShouldPreserveAbortedURLs(content::WebContents *source) Q_DECL_OVERRIDE;
virtual void ShowValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view, const base::string16 &main_text, const base::string16 &sub_text) Q_DECL_OVERRIDE;
virtual void HideValidationMessage(content::WebContents *web_contents) Q_DECL_OVERRIDE;
virtual void MoveValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view) Q_DECL_OVERRIDE;
void BeforeUnloadFired(content::WebContents* tab, bool proceed, bool* proceed_to_fire_unload) Q_DECL_OVERRIDE;
+ bool CheckMediaAccessPermission(content::WebContents *web_contents, const GURL& security_origin, content::MediaStreamType type) Q_DECL_OVERRIDE;
// WebContentsObserver overrides
virtual void RenderFrameDeleted(content::RenderFrameHost *render_frame_host) Q_DECL_OVERRIDE;
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index d7254c8b..bf7b2943 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -219,13 +219,10 @@ WebEngineContext::WebEngineContext()
, m_browserRunner(content::BrowserMainRunner::Create())
, m_globalQObject(new QObject())
{
- QVector<QByteArray> args;
- Q_FOREACH (const QString& arg, QCoreApplication::arguments())
- args << arg.toUtf8();
-
- bool useEmbeddedSwitches = args.removeAll("--enable-embedded-switches");
+ QStringList appArgs = QCoreApplication::arguments();
+ bool useEmbeddedSwitches = appArgs.removeAll(QStringLiteral("--enable-embedded-switches"));
#if defined(QTWEBENGINE_EMBEDDED_SWITCHES)
- useEmbeddedSwitches = !args.removeAll("--disable-embedded-switches");
+ useEmbeddedSwitches = !appArgs.removeAll(QStringLiteral("--disable-embedded-switches"));
#endif
#ifdef Q_OS_LINUX
@@ -234,16 +231,31 @@ WebEngineContext::WebEngineContext()
qputenv("force_s3tc_enable", "true");
#endif
-
// Allow us to inject javascript like any webview toolkit.
content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView();
+#if defined(Q_OS_WIN)
+ // We must initialize the command line with the UTF-16 arguments vector we got from
+ // QCoreApplication. CommandLine::Init ignores its arguments on Windows and calls
+ // GetCommandLineW() instead.
+ base::CommandLine::CreateEmpty();
+ base::CommandLine* parsedCommandLine = base::CommandLine::ForCurrentProcess();
+ base::CommandLine::StringVector argv;
+ argv.resize(appArgs.size());
+ std::transform(appArgs.constBegin(), appArgs.constEnd(), argv.begin(), &toString16);
+ parsedCommandLine->InitFromArgv(argv);
+#else
+ QVector<QByteArray> args;
+ Q_FOREACH (const QString& arg, appArgs)
+ args << arg.toUtf8();
+
QVector<const char*> argv(args.size());
for (int i = 0; i < args.size(); ++i)
argv[i] = args[i].constData();
base::CommandLine::Init(argv.size(), argv.constData());
-
base::CommandLine* parsedCommandLine = base::CommandLine::ForCurrentProcess();
+#endif
+
parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
// Enable sandboxing on OS X and Linux (Desktop / Embedded) by default.
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
new file mode 100644
index 00000000..32fce325
--- /dev/null
+++ b/src/plugins/plugins.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+qtHaveModule(designer):qtHaveModule(webenginewidgets): SUBDIRS += qwebengineview
diff --git a/src/plugins/qwebengineview/images/qwebengineview.png b/src/plugins/qwebengineview/images/qwebengineview.png
new file mode 100644
index 00000000..01a0920c
--- /dev/null
+++ b/src/plugins/qwebengineview/images/qwebengineview.png
Binary files differ
diff --git a/src/plugins/qwebengineview/qwebengineview.pro b/src/plugins/qwebengineview/qwebengineview.pro
new file mode 100644
index 00000000..c18b6fe9
--- /dev/null
+++ b/src/plugins/qwebengineview/qwebengineview.pro
@@ -0,0 +1,11 @@
+TARGET = qwebengineview
+QT += designer webenginewidgets
+
+PLUGIN_CLASS_NAME = QWebEngineViewPlugin
+PLUGIN_TYPE = designer
+CONFIG += tool_plugin
+load(qt_plugin)
+
+SOURCES += qwebengineview_plugin.cpp
+HEADERS += qwebengineview_plugin.h
+RESOURCES += qwebengineview_plugin.qrc
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/plugins/qwebengineview/qwebengineview_plugin.cpp
new file mode 100644
index 00000000..2d331571
--- /dev/null
+++ b/src/plugins/qwebengineview/qwebengineview_plugin.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwebengineview_plugin.h"
+
+#include <QtDesigner/QExtensionFactory>
+#include <QtDesigner/QExtensionManager>
+
+#include <QtCore/qplugin.h>
+#include <QWebEngineView>
+
+QT_BEGIN_NAMESPACE
+
+static const char toolTipC[] =
+ QT_TRANSLATE_NOOP(QWebEngineViewPlugin,
+ "A widget for displaying a web page, from the Qt WebEngineWidgets module");
+
+QWebEngineViewPlugin::QWebEngineViewPlugin(QObject *parent) :
+ QObject(parent),
+ m_initialized(false)
+{
+}
+
+QString QWebEngineViewPlugin::name() const
+{
+ return QStringLiteral("QWebEngineView");
+}
+
+QString QWebEngineViewPlugin::group() const
+{
+ return QStringLiteral("Display Widgets");
+}
+
+QString QWebEngineViewPlugin::toolTip() const
+{
+ return tr(toolTipC);
+}
+
+QString QWebEngineViewPlugin::whatsThis() const
+{
+ return tr(toolTipC);
+}
+
+QString QWebEngineViewPlugin::includeFile() const
+{
+ return QStringLiteral("<QtWebEngineWidgets/QWebEngineView>");
+}
+
+QIcon QWebEngineViewPlugin::icon() const
+{
+ return QIcon(QStringLiteral(":/qt-project.org/qwebengineview/images/qwebengineview.png"));
+}
+
+bool QWebEngineViewPlugin::isContainer() const
+{
+ return false;
+}
+
+QWidget *QWebEngineViewPlugin::createWidget(QWidget *parent)
+{
+ return new QWebEngineView(parent);
+}
+
+bool QWebEngineViewPlugin::isInitialized() const
+{
+ return m_initialized;
+}
+
+void QWebEngineViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+ if (m_initialized)
+ return;
+
+ m_initialized = true;
+}
+
+QString QWebEngineViewPlugin::domXml() const
+{
+ return QStringLiteral("\
+ <ui language=\"c++\">\
+ <widget class=\"QWebEngineView\" name=\"webEngineView\">\
+ <property name=\"url\">\
+ <url>\
+ <string>about:blank</string>\
+ </url>\
+ </property>\
+ <property name=\"geometry\">\
+ <rect>\
+ <x>0</x>\
+ <y>0</y>\
+ <width>300</width>\
+ <height>200</height>\
+ </rect>\
+ </property>\
+ </widget>\
+ </ui>");
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.h b/src/plugins/qwebengineview/qwebengineview_plugin.h
new file mode 100644
index 00000000..8fa94625
--- /dev/null
+++ b/src/plugins/qwebengineview/qwebengineview_plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWEBENGINEVIEW_PLUGIN_H
+#define QWEBENGINEVIEW_PLUGIN_H
+
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineViewPlugin: public QObject, public QDesignerCustomWidgetInterface
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface")
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+public:
+ explicit QWebEngineViewPlugin(QObject *parent = Q_NULLPTR);
+
+ QString name() const Q_DECL_OVERRIDE;
+ QString group() const Q_DECL_OVERRIDE;
+ QString toolTip() const Q_DECL_OVERRIDE;
+ QString whatsThis() const Q_DECL_OVERRIDE;
+ QString includeFile() const Q_DECL_OVERRIDE;
+ QIcon icon() const Q_DECL_OVERRIDE;
+ bool isContainer() const Q_DECL_OVERRIDE;
+ QWidget *createWidget(QWidget *parent) Q_DECL_OVERRIDE;
+ bool isInitialized() const Q_DECL_OVERRIDE;
+ void initialize(QDesignerFormEditorInterface *core) Q_DECL_OVERRIDE;
+ QString domXml() const Q_DECL_OVERRIDE;
+
+private:
+ bool m_initialized;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEVIEW_PLUGIN_H
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.qrc b/src/plugins/qwebengineview/qwebengineview_plugin.qrc
new file mode 100644
index 00000000..181625c4
--- /dev/null
+++ b/src/plugins/qwebengineview/qwebengineview_plugin.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/qt-project.org/qwebengineview">
+ <file>images/qwebengineview.png</file>
+ </qresource>
+</RCC>
diff --git a/src/process/Info_mac.plist b/src/process/Info_mac.plist
index de1d010b..dcadc2e8 100644
--- a/src/process/Info_mac.plist
+++ b/src/process/Info_mac.plist
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>@BUNDLEIDENTIFIER@</string>
+ <string>org.qt-project.Qt.QtWebEngineProcess</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
diff --git a/src/process/process.pro b/src/process/process.pro
index eab11189..cdda429e 100644
--- a/src/process/process.pro
+++ b/src/process/process.pro
@@ -1,25 +1,9 @@
TARGET = $$QTWEBENGINEPROCESS_NAME
-TEMPLATE = app
-!build_pass:contains(QT_CONFIG, debug_and_release):contains(QT_CONFIG, build_all): CONFIG += release
+
# Needed to set LSUIElement=1
QMAKE_INFO_PLIST = Info_mac.plist
-load(qt_build_paths)
-contains(QT_CONFIG, qt_framework) {
- # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework.
- DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers
-
- QT += webenginecore
- QMAKE_RPATHDIR += @loader_path/../../../../../../../../Frameworks
-} else {
- CONFIG -= app_bundle
- win32: DESTDIR = $$MODULE_BASE_OUTDIR/bin
- else: DESTDIR = $$MODULE_BASE_OUTDIR/libexec
-
- QT_PRIVATE += webenginecore
-}
-
-msvc: QMAKE_LFLAGS *= /LARGEADDRESSAWARE
+QT += webenginecore
INCLUDEPATH += ../core
@@ -30,9 +14,20 @@ win32 {
support_win.cpp
}
+load(qt_app)
+
+contains(QT_CONFIG, qt_framework) {
+ # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework.
+ DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers
+} else {
+ CONFIG -= app_bundle
+ win32: DESTDIR = $$MODULE_BASE_OUTDIR/bin
+ else: DESTDIR = $$MODULE_BASE_OUTDIR/libexec
+}
+msvc: QMAKE_LFLAGS *= /LARGEADDRESSAWARE
+
contains(QT_CONFIG, qt_framework) {
target.path = $$[QT_INSTALL_LIBS]/QtWebEngineCore.framework/Versions/5/Helpers
} else {
target.path = $$[QT_INSTALL_LIBEXECS]
}
-INSTALLS += target
diff --git a/src/src.pro b/src/src.pro
index 2effb70e..6a6a6abb 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -14,7 +14,8 @@ SUBDIRS += core \
process \
webengine \
webengine_plugin \
- webengine_experimental_plugin
+ webengine_experimental_plugin \
+ plugins
isQMLTestSupportApiEnabled() {
@@ -30,4 +31,5 @@ isQMLTestSupportApiEnabled() {
qtHaveModule(widgets) {
SUBDIRS += webenginewidgets
+ plugins.depends = webenginewidgets
}
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index ffbff95f..c26255e3 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -222,6 +222,7 @@ qint64 QQuickWebEngineDownloadItem::receivedBytes() const
/*!
\qmlproperty QString WebEngineDownloadItem::mimeType
+ \since QtWebEngine 1.2
Holds the MIME type of the download.
*/
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p.h b/src/webengine/api/qquickwebenginedownloaditem_p.h
index c90e526c..0b01fe6f 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p.h
@@ -108,7 +108,7 @@ Q_SIGNALS:
Q_REVISION(2) void savePageFormatChanged();
void receivedBytesChanged();
void totalBytesChanged();
- void mimeTypeChanged();
+ Q_REVISION(1) void mimeTypeChanged();
void pathChanged();
private:
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index b3ed5a62..3873bc9c 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -701,9 +701,10 @@ bool QQuickWebEngineProfile::isSpellCheckEnabled() const
return d->browserContext()->isSpellCheckEnabled();
}
#endif
+
/*!
- Returns the cookie store singleton, if one has been set.
+ Returns the cookie store for this profile.
*/
QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
{
diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp
index 74bd9899..8802a40f 100644
--- a/src/webengine/api/qquickwebenginescript.cpp
+++ b/src/webengine/api/qquickwebenginescript.cpp
@@ -65,6 +65,8 @@ using QtWebEngineCore::UserScript;
not accessible from a different one. The worldId property provides some predefined IDs for this
purpose.
+ \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported.
+
Use \l{WebEngineView::userScripts}{WebEngineView.userScripts} to access a list of scripts
attached to the web view.
*/
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
index 56d4119c..a5796c79 100644
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ b/src/webengine/api/qquickwebenginesettings.cpp
@@ -216,6 +216,8 @@ bool QQuickWebEngineSettings::errorPageEnabled() const
Enables support for Pepper plugins, such as the Flash player.
Disabled by default.
+
+ \sa {Pepper Plugin API Support}
*/
bool QQuickWebEngineSettings::pluginsEnabled() const
{
diff --git a/src/webengine/api/qquickwebenginetestsupport_p.h b/src/webengine/api/qquickwebenginetestsupport_p.h
index 374b4a97..79d51e7a 100644
--- a/src/webengine/api/qquickwebenginetestsupport_p.h
+++ b/src/webengine/api/qquickwebenginetestsupport_p.h
@@ -84,6 +84,7 @@ public:
Q_SIGNALS:
void validationMessageShown(const QString &mainText, const QString &subText);
void windowCloseRejected();
+ void loadVisuallyCommitted();
private:
QScopedPointer<QQuickWebEngineErrorPage> m_errorPage;
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index e2a5d07c..99d6cc74 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -83,6 +83,8 @@
#include <QScreen>
#include <QUrl>
#include <QTimer>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#ifndef QT_NO_ACCESSIBILITY
#include <private/qquickaccessibleattached_p.h>
#endif // QT_NO_ACCESSIBILITY
@@ -171,7 +173,7 @@ RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHo
RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client)
{
Q_Q(QQuickWebEngineView);
- const bool hasWindowCapability = qApp->platformName().toLower() != QLatin1String("eglfs");
+ const bool hasWindowCapability = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows);
RenderWidgetHostViewQtDelegateQuick *quickDelegate = new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ true);
if (hasWindowCapability) {
RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow = new RenderWidgetHostViewQtDelegateQuickWindow(quickDelegate);
@@ -469,7 +471,10 @@ void QQuickWebEngineViewPrivate::loadCommitted()
void QQuickWebEngineViewPrivate::loadVisuallyCommitted()
{
- Q_EMIT e->loadVisuallyCommitted();
+#ifdef ENABLE_QML_TESTSUPPORT_API
+ if (m_testSupport)
+ Q_EMIT m_testSupport->loadVisuallyCommitted();
+#endif
}
Q_STATIC_ASSERT(static_cast<int>(WebEngineError::NoErrorDomain) == static_cast<int>(QQuickWebEngineView::NoErrorDomain));
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 54de7c1b..7f0dcc33 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -105,7 +105,6 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewExperimental : public QObjec
Q_SIGNALS:
void extraContextMenuEntriesComponentChanged();
- void loadVisuallyCommitted();
private:
QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate* viewPrivate);
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
index 6cd13ad5..80105278 100644
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ b/src/webengine/api/qtwebengineglobal.cpp
@@ -65,8 +65,9 @@ namespace QtWebEngine {
Sets up an OpenGL Context that can be shared between processes. This has to be done after
QGuiApplication is created, but before a Qt Quick window is created.
- This has the same effect as passing Qt::AA_ShareOpenGLContexts to the QGuiApplication
- constructor.
+ This has the same effect as setting the Qt::AA_ShareOpenGLContexts
+ attribute with QCoreApplication::setAttribute before constructing
+ QGuiApplication.
*/
void initialize()
{
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index cf757a6d..18c1f462 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -121,11 +121,14 @@
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 Chromium API for
- \e{Content Script Extensions} is implemented by \e {web engine script}. It specifies 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.
+
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
@@ -152,7 +155,7 @@
Each QWebEnginePage belongs to a QWebEngineProfile that can have a QWebEngineSettings
for specifying page settings, a QWebEngineScriptCollection for running scripts on the page, and
a QWebEngineCookieStore for accessing the HTTP cookies of Chromium. A QWebEnginePage can also
- directly point to a script collection or cookie store.
+ directly point to a script collection.
\section1 Embedding Web Content into Qt Quick Applications
@@ -164,19 +167,9 @@
engine must be initialized by using \l QtWebEngine::initialize in the application main source
file, as illustrated by the following code snippet:
- \code
- int main(int argc, char **argv)
- {
- Application app(argc, argv);
-
- QtWebEngine::initialize();
-
- QQmlApplicationEngine appEngine;
- appEngine.load(QUrl("qrc:/main.qml"));
-
- return app.exec();
- }
- \endcode
+ \quotefromfile webengine/minimal/main.cpp
+ \skipto main
+ \printuntil }
An application can load pages into the WebEngineView, using either an URL or HTML string, and
navigate within session history. By default, links to different pages load within the same
@@ -186,22 +179,9 @@
The following sample QML application loads a web page using the \l{WebEngineView::}{url}
property:
- \qml
- import QtQuick 2.1
- import QtQuick.Controls 1.1
- import QtWebEngine 1.1
-
- ApplicationWindow {
- width: 1280
- height: 720
- visible: true
- WebEngineView {
- id: webview
- url: "http://www.qt.io"
- anchors.fill: parent
- }
- }
- \endqml
+ \quotefromfile webengine/minimal/main.qml
+ \skipto import
+ \printuntil /^\}/
\section1 Managing Certificates
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
index 5a81c777..c5f37302 100644
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
@@ -68,8 +68,12 @@
\section1 Pepper Plugin API Support
- Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins. The plugins must be loaded
- manually using the Chromium command line syntax with the \c --register-pepper-plugins argument.
+ 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:
@@ -85,8 +89,6 @@
The MIME type is important because it determines which embeds the plugin is used for.
- This process has been automated for the Pepper Flash player plugin.
-
\section2 Pepper Flash Player Plugin Support
The Pepper Flash player plugin can be loaded automatically if it is installed in one of the
diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc
index 79cb90ab..7b6c66e1 100644
--- a/src/webengine/doc/src/webengineview.qdoc
+++ b/src/webengine/doc/src/webengineview.qdoc
@@ -40,19 +40,9 @@
\l QtWebEngine::initialize in the application main source file, as illustrated by the
following code snippet:
- \code
- int main(int argc, char **argv)
- {
- Application app(argc, argv);
-
- QtWebEngine::initialize();
-
- QQmlApplicationEngine appEngine;
- appEngine.load(QUrl("qrc:/main.qml"));
-
- return app.exec();
- }
- \endcode
+ \quotefromfile webengine/minimal/main.cpp
+ \skipto main
+ \printuntil }
\section2 Loading Web Pages
@@ -62,30 +52,16 @@
The following sample QML application loads a web page using the \c url property:
- \qml
- import QtQuick 2.1
- import QtQuick.Controls 1.1
- import QtWebEngine 1.1
-
- ApplicationWindow {
- width: 1280
- height: 720
- visible: true
- WebEngineView {
- id: webview
- url: "http://www.qt.io"
- anchors.fill: parent
- }
- }
- \endqml
+ \quotefromfile webengine/minimal/main.qml
+ \skipto import
+ \printuntil /^\}/
- The \l loadingChanged() signal is emitted when loading a page begins, ends, or fails. The
- \l loading property holds whether the HTML page is currently loading and the load status is
- reflected in the \l LoadStatus property.
+ The \l loading property holds whether an HTML page is currently loading.
+ The \l loadingChanged() signal is emitted when loading the page begins, ends, or fails.
The title of an HTML page can be accessed with the \l title property. Additionally, a web
page may specify an icon, which can be accessed using the \l icon property. The \l zoomFactor
- property holds the overall size of the contents of the web page.
+ property enables zooming the contents of the web page by a scale factor.
If a certificate error is raised while loading a web page, the \l certificateError() signal is
emitted. Certificate errors are handled by using the methods of the WebEngineCertificateError
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 1101bd48..9ad86800 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -66,14 +66,19 @@ RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderW
setActiveFocusOnTab(true);
#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.
+ // Check that the default QSurfaceFormat OpenGL profile is compatible with the global OpenGL
+ // shared context profile, otherwise this could lead to a nasty crash.
QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext();
if (globalSharedContext) {
QSurfaceFormat sharedFormat = globalSharedContext->format();
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.");
+
+ if (defaultFormat.profile() != sharedFormat.profile()
+ && defaultFormat.profile() == QSurfaceFormat::CoreProfile
+ && defaultFormat.version() >= qMakePair(3, 2)) {
+ qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile is not compatible with the "
+ "global shared context OpenGL profile. Please make sure you set a compatible "
+ "QSurfaceFormat before the QtGui application instance is created.");
}
}
#endif
diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp b/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
index 57e8e31e..bcf2d5d2 100644
--- a/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
+++ b/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
@@ -42,6 +42,64 @@
QT_BEGIN_NAMESPACE
+/*!
+ \class QWebEngineFullScreenRequest
+ \brief The QWebEngineFullScreenRequest class enables accepting or rejecting
+ requests for entering and exiting the fullscreen mode.
+
+ \since 5.6
+
+ \inmodule QtWebEngineWidgets
+
+ To allow elements such as videos to be shown in the fullscreen mode,
+ applications must set QWebEngineSettings::FullScreenSupportEnabled and
+ connect to QWebEnginePage::fullScreenRequested, which takes a
+ QWebEngineFullScreenRequest instance as an argument.
+
+ If an element of a web page requests to be shown in the fullscreen mode,
+ QWebEnginePage::fullScreenRequested will be emitted with an
+ QWebEngineFullScreenRequest instance as an argument where toggleOn() returns
+ \c true. The signal handler needs to then either call accept() or reject().
+
+ If the request to enter the fullscreen mode is accepted, the element
+ requesting fullscreen mode will fill the viewport, but it is up to the
+ application to make the view fullscreen or to move the page to a view that
+ is in the fullscreen mode.
+
+ Likewise, a QWebEnginePage::fullScreenRequested will be emitted when
+ the user wants to leave the full screen mode (that is, through the
+ QWebEnginePage::ExitFullScreen context menu action). In this case,
+ toggleOn() will return \c false, and the signal handler again needs to
+ accept() or reject() the request. If it is accepted, the applicaton needs to
+ make sure that the global window state is restored.
+*/
+
+/*!
+ \property QWebEngineFullScreenRequest::toggleOn
+ \brief Whether the web page has issued a request to enter fullscreen mode.
+*/
+
+/*!
+ \property QWebEngineFullScreenRequest::origin
+ \brief The URL to be opened in the fullscreen mode.
+*/
+
+/*!
+ \fn QWebEngineFullScreenRequest::toggleOn() const
+ Returns \c true if the web page has issued a request to enter the fullscreen
+ mode, otherwise returns \c false.
+*/
+
+/*!
+ \fn QWebEngineFullScreenRequest::origin() const
+ Returns the URL to be opened in the fullscreen mode.
+*/
+
+/*!
+ Creates a request for opening the \a page from the URL specified by
+ \a origin in the fullscreen mode if \a fullscreen is \c true.
+*/
+
QWebEngineFullScreenRequest::QWebEngineFullScreenRequest(QWebEnginePage *page, const QUrl &origin, bool fullscreen)
: m_page(page)
, m_origin(origin)
@@ -49,6 +107,9 @@ QWebEngineFullScreenRequest::QWebEngineFullScreenRequest(QWebEnginePage *page, c
{
}
+/*!
+ Rejects a request to enter or exit the fullscreen mode.
+*/
void QWebEngineFullScreenRequest::reject()
{
if (!m_page) {
@@ -59,6 +120,9 @@ void QWebEngineFullScreenRequest::reject()
m_page->d_func()->setFullScreenMode(!m_toggleOn);
}
+/*!
+ Accepts the request to enter or exit the fullscreen mode.
+*/
void QWebEngineFullScreenRequest::accept()
{
if (!m_page) {
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 22495ee2..22d4d088 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -470,7 +470,9 @@ void QWebEngineProfile::setHttpCacheMaximumSize(int maxSize)
}
/*!
- Returns the cookie store singleton, if one has been set.
+ Returns the cookie store for this profile.
+
+ \since 5.6
*/
QWebEngineCookieStore* QWebEngineProfile::cookieStore()
@@ -485,6 +487,7 @@ QWebEngineCookieStore* QWebEngineProfile::cookieStore()
The profile does not take ownership of the pointer.
+ \since 5.6
\sa QWebEngineUrlRequestInfo
*/
diff --git a/src/webenginewidgets/api/qwebenginescript.cpp b/src/webenginewidgets/api/qwebenginescript.cpp
index 97760c10..73dd5075 100644
--- a/src/webenginewidgets/api/qwebenginescript.cpp
+++ b/src/webenginewidgets/api/qwebenginescript.cpp
@@ -61,6 +61,8 @@ using QtWebEngineCore::UserScript;
not accessible from a different one. ScriptWorldId provides some predefined IDs for this
purpose.
+ \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported.
+
Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access
the collection of scripts associated with a single page or a
number of pages sharing the same profile.
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index f1c678de..6f41c81f 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -53,8 +53,8 @@
using the icon() or its URL using the iconUrl() property.
If the title or the icon changes, the corresponding titleChanged(), iconChanged()
and iconUrlChanged() signals will be emitted.
- The zoomFactor() property can be used to change the overall size
- of the content displayed in the page.
+ The zoomFactor() property enables zooming the contents of the web page by a
+ scale factor.
The loadStarted() signal is emitted when the page begins to load, whereas the loadProgress()
signal is emitted whenever an element of the web page completes loading, such as an embedded
@@ -636,6 +636,8 @@
/*!
\property QWebEnginePage::zoomFactor
\brief the zoom factor for the page content
+
+ Valid values are within the range from \c{0.25} to \c{5.0}. The default factor is \c{1.0}.
*/
/*!
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
index 5750d05f..cb75c69f 100644
--- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
@@ -130,8 +130,9 @@
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)
\value FullScreenSupportEnabled
- Enables fullscreen support in an application. Disabled by default.
+ Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
\value ScreenCaptureEnabled
Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
\value WebGLEnabled
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index d7ecdb24..976a1a92 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -59,7 +59,7 @@
Additionally, a web site may specify an icon, which can be accessed
using the iconUrl() property. If the title or the icon changes, the corresponding
titleChanged() and iconUrlChanged() signals will be emitted. The
- zoomFactor() property can be used to change the overall size of the contents of the web view.
+ zoomFactor() property enables zooming the contents of the web page by a scale factor.
If you require a custom context menu, you can implement it by reimplementing
\l{QWidget::}{contextMenuEvent()} and populating your QMenu with the actions
@@ -231,6 +231,8 @@
/*!
\property QWebEngineView::zoomFactor
\brief the zoom factor for the view
+
+ Valid values are within the range from \c{0.25} to \c{5.0}. The default factor is \c{1.0}.
*/
/*!
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 161983b7..3f70187e 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -77,11 +77,16 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(Rende
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.
+ // Check that the default QSurfaceFormat OpenGL profile is compatible with 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.");
+
+ if (defaultFormat.profile() != sharedFormat.profile()
+ && defaultFormat.profile() == QSurfaceFormat::CoreProfile
+ && defaultFormat.version() >= qMakePair(3, 2)) {
+ qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile is not compatible with the "
+ "global shared context OpenGL profile. Please make sure you set a compatible "
+ "QSurfaceFormat before the QtGui application instance is created.");
}
#endif
diff --git a/sync.profile b/sync.profile
index 11d7b054..7d6daec3 100644
--- a/sync.profile
+++ b/sync.profile
@@ -21,6 +21,7 @@
"qtbase" => "",
"qtdeclarative" => "",
"qtxmlpatterns" => "",
+ "qttools" => "",
# FIXME: take examples out into their own module to avoid a potential circular dependency later ?
"qtquickcontrols" => "",
"qtwebchannel" => "",
diff --git a/tests/auto/quick/qmltests/data/icons/small-favicon.png b/tests/auto/quick/qmltests/data/icons/small-favicon.png
index 4462752a..8cf9a50a 100644
--- a/tests/auto/quick/qmltests/data/icons/small-favicon.png
+++ b/tests/auto/quick/qmltests/data/icons/small-favicon.png
Binary files differ
diff --git a/tests/auto/quick/qquickwebengineview/BLACKLIST b/tests/auto/quick/qquickwebengineview/BLACKLIST
new file mode 100644
index 00000000..d4d5c984
--- /dev/null
+++ b/tests/auto/quick/qquickwebengineview/BLACKLIST
@@ -0,0 +1,2 @@
+[transparentWebEngineViews]
+windows
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
index cd1d1ac4..606f5af9 100644
--- a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
+++ b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
@@ -34,6 +34,7 @@
#include <QQuickItem>
#include <QPainter>
#include <qtwebengineglobal.h>
+#include <private/qquickwebenginetestsupport_p.h>
#include <private/qquickwebengineview_p.h>
class TestView : public QQuickView {
@@ -78,6 +79,9 @@ private Q_SLOTS:
private:
void setHtml(const QString &html);
QScopedPointer<TestView> m_view;
+#ifdef ENABLE_QML_TESTSUPPORT_API
+ QScopedPointer<QQuickWebEngineTestSupport> m_testSupport;
+#endif
};
static const QString greenSquare("<div style=\"background-color: #00ff00; position:absolute; left:50px; top: 50px; width: 50px; height: 50px;\"></div>");
@@ -108,6 +112,9 @@ 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()
@@ -183,9 +190,11 @@ void tst_QQuickWebEngineViewGraphics::setHtml(const QString &html)
m_view->create();
QQuickWebEngineView *webEngineView = static_cast<QQuickWebEngineView *>(m_view->rootObject());
- QSignalSpy spy(reinterpret_cast<QObject *>(webEngineView->experimental()), SIGNAL(loadVisuallyCommitted()));
webEngineView->setProperty("url", QUrl(QStringLiteral("data:text/html,%1").arg(htmlData)));
- QVERIFY(!spy.isEmpty() || spy.wait());
+#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/shared/util.h b/tests/auto/quick/shared/util.h
index 8f7a85f6..66b42d01 100644
--- a/tests/auto/quick/shared/util.h
+++ b/tests/auto/quick/shared/util.h
@@ -119,7 +119,16 @@ inline bool waitForLoadFailed(QQuickWebEngineView *webEngineView, int timeout =
inline bool waitForViewportReady(QQuickWebEngineView *webEngineView, int timeout = 10000)
{
- return waitForSignal(reinterpret_cast<QObject *>(webEngineView->experimental()), SIGNAL(loadVisuallyCommitted()), timeout);
+#ifdef ENABLE_QML_TESTSUPPORT_API
+ return waitForSignal(reinterpret_cast<QObject *>(webEngineView->testSupport()), SIGNAL(loadVisuallyCommitted()), timeout);
+#else
+ Q_UNUSED(webEngineView)
+ Q_UNUSED(timeout)
+ qFatal("Test Support API is disabled. The result is not reliable.\
+ Use the following command to build Test Support module and rebuild WebEngineView API:\
+ qmake -r WEBENGINE_CONFIG+=testsupport && make");
+ return false;
+#endif
}
#endif /* UTIL_H */
diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri
index 3c56aef9..efe9ff9d 100644
--- a/tests/auto/quick/tests.pri
+++ b/tests/auto/quick/tests.pri
@@ -17,3 +17,7 @@ macx: CONFIG -= app_bundle
# This define is used by some tests to look up resources in the source tree
DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
+
+isQMLTestSupportApiEnabled() {
+ DEFINES += ENABLE_QML_TESTSUPPORT_API
+}
diff --git a/tests/auto/widgets/qwebengineaccessibility/BLACKLIST b/tests/auto/widgets/qwebengineaccessibility/BLACKLIST
deleted file mode 100644
index 0450f8c1..00000000
--- a/tests/auto/widgets/qwebengineaccessibility/BLACKLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-[hierarchy]
-windows
-[text]
-windows
-[value]
-windows
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
index 7703e341..84ec4d7f 100644
--- a/tools/qmake/mkspecs/features/configure.prf
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -78,9 +78,9 @@ defineTest(runConfigure) {
defineTest(finalizeConfigure) {
linux {
use?(nss) {
- log("SSL............................... Using system NSS$${EOL}")
+ log("Certificate handling.............. Using system NSS$${EOL}")
} else {
- log("SSL............................... Using bundled BoringSSL$${EOL}")
+ log("Certificate handling.............. Using bundled BoringSSL$${EOL}")
}
use?(system_icu) {
packagesExist("icu-uc icu-i18n") {