diff options
Diffstat (limited to 'src')
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/api/core_api.pro | 4 | ||||
-rw-r--r-- | src/core/api/qtbug-61521.cpp | 121 | ||||
-rw-r--r-- | src/core/proxy_config_service_qt.cpp | 90 | ||||
-rw-r--r-- | src/core/proxy_config_service_qt.h | 6 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 5 | ||||
-rw-r--r-- | src/core/web_contents_adapter.cpp | 16 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 28 | ||||
-rw-r--r-- | src/core/web_engine_settings.cpp | 25 | ||||
-rw-r--r-- | src/webengine/doc/qtwebengine.qdocconf | 1 | ||||
-rw-r--r-- | src/webengine/doc/src/external-resources.qdoc | 10 | ||||
-rw-r--r-- | src/webengine/doc/src/qtwebengine-debugging.qdoc | 33 | ||||
-rw-r--r-- | src/webengine/doc/src/qtwebengine-features.qdoc | 17 | ||||
-rw-r--r-- | src/webengine/doc/src/qtwebengine-overview.qdoc | 25 | ||||
-rw-r--r-- | src/webengine/doc/src/qtwebengine-platform-notes.qdoc | 6 | ||||
-rw-r--r-- | src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc | 3 |
16 files changed, 348 insertions, 42 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 3deea958f1485b50940e7437c0a3b73ed29ee13 +Subproject 582c5493439ba9ac57c6c14c706f530741f5bfc diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro index d3d47e03a..05166536e 100644 --- a/src/core/api/core_api.pro +++ b/src/core/api/core_api.pro @@ -50,6 +50,8 @@ SOURCES = \ qwebengineurlrequestjob.cpp \ qwebengineurlschemehandler.cpp +### Qt6 Remove this workaround unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!static { - SOURCES += qtbug-60565.cpp + SOURCES += qtbug-60565.cpp \ + qtbug-61521.cpp } diff --git a/src/core/api/qtbug-61521.cpp b/src/core/api/qtbug-61521.cpp new file mode 100644 index 000000000..86d5998ef --- /dev/null +++ b/src/core/api/qtbug-61521.cpp @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <stdlib.h> +#include <malloc.h> + +#define SHIM_ALIAS_SYMBOL(fn) __attribute__((weak, alias(#fn))) +#define SHIM_SYMBOL_VERSION(fn) __asm__(".symver __" #fn "," #fn "@Qt_5") +#define SHIM_HIDDEN __attribute__ ((visibility ("hidden"))) + +extern "C" { + +SHIM_SYMBOL_VERSION(malloc); +void* __malloc(size_t size) + SHIM_ALIAS_SYMBOL(ShimMalloc); + +SHIM_SYMBOL_VERSION(free); +void __free(void* ptr) + SHIM_ALIAS_SYMBOL(ShimFree); + +SHIM_SYMBOL_VERSION(realloc); +void* __realloc(void* ptr, size_t size) + SHIM_ALIAS_SYMBOL(ShimRealloc); + +SHIM_SYMBOL_VERSION(calloc); +void* __calloc(size_t n, size_t size) + SHIM_ALIAS_SYMBOL(ShimCalloc); + +SHIM_SYMBOL_VERSION(cfree); +void __cfree(void* ptr) + SHIM_ALIAS_SYMBOL(ShimCFree); + +SHIM_SYMBOL_VERSION(memalign); +void* __memalign(size_t align, size_t s) + SHIM_ALIAS_SYMBOL(ShimMemalign); + +SHIM_SYMBOL_VERSION(valloc); +void* __valloc(size_t size) + SHIM_ALIAS_SYMBOL(ShimValloc); + +SHIM_SYMBOL_VERSION(pvalloc); +void* __pvalloc(size_t size) + SHIM_ALIAS_SYMBOL(ShimPvalloc); + +SHIM_SYMBOL_VERSION(posix_memalign); +int __posix_memalign(void** r, size_t a, size_t s) + SHIM_ALIAS_SYMBOL(ShimPosixMemalign); + +SHIM_HIDDEN void* ShimMalloc(size_t size) { + return malloc(size); +} + +SHIM_HIDDEN void ShimFree(void* ptr) { + free(ptr); +} + +SHIM_HIDDEN void* ShimRealloc(void* ptr, size_t size) { + return realloc(ptr,size); +} + +SHIM_HIDDEN void* ShimCalloc(size_t n, size_t size) { + return calloc(n,size); +} + +SHIM_HIDDEN void ShimCFree(void* ptr) { + cfree(ptr); +} + +SHIM_HIDDEN void* ShimMemalign(size_t align, size_t s) { + return memalign(align,s); +} + +SHIM_HIDDEN void* ShimValloc(size_t size) { + return valloc(size); +} + +SHIM_HIDDEN void* ShimPvalloc(size_t size) { + return pvalloc(size); +} + +SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) { + return posix_memalign(r,a,s); +} +} // extern "C" diff --git a/src/core/proxy_config_service_qt.cpp b/src/core/proxy_config_service_qt.cpp index fed3da7f5..48f3593e6 100644 --- a/src/core/proxy_config_service_qt.cpp +++ b/src/core/proxy_config_service_qt.cpp @@ -36,6 +36,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + + +//================ Based on ChromeProxyConfigService ======================= // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -60,17 +63,16 @@ net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qt proxyScheme = net::ProxyServer::SCHEME_HTTP; break; case QNetworkProxy::NoProxy: - default: + case QNetworkProxy::DefaultProxy: proxyScheme = net::ProxyServer::SCHEME_DIRECT; break; } return net::ProxyServer(proxyScheme, net::HostPortPair(qtProxy.hostName().toStdString(), qtProxy.port())); } -//================ Based on ChromeProxyConfigService ======================= - ProxyConfigServiceQt::ProxyConfigServiceQt(std::unique_ptr<ProxyConfigService> baseService) : m_baseService(baseService.release()), + m_usesSystemConfiguration(false), m_registeredObserver(false) { } @@ -83,7 +85,6 @@ ProxyConfigServiceQt::~ProxyConfigServiceQt() void ProxyConfigServiceQt::AddObserver(net::ProxyConfigService::Observer *observer) { - RegisterObserver(); m_observers.AddObserver(observer); } @@ -94,26 +95,31 @@ void ProxyConfigServiceQt::RemoveObserver(net::ProxyConfigService::Observer *obs net::ProxyConfigService::ConfigAvailability ProxyConfigServiceQt::GetLatestProxyConfig(net::ProxyConfig *config) { - RegisterObserver(); - - // Ask the base service if available. - net::ProxyConfig systemConfig; - ConfigAvailability systemAvailability = net::ProxyConfigService::CONFIG_UNSET; - if (m_baseService.get()) - systemAvailability = m_baseService->GetLatestProxyConfig(&systemConfig); +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) + m_usesSystemConfiguration = QNetworkProxyFactory::usesSystemConfiguration(); +#endif + if (m_usesSystemConfiguration) { + // Use Chromium's base service to retrieve system settings + net::ProxyConfig systemConfig; + ConfigAvailability systemAvailability = net::ProxyConfigService::CONFIG_UNSET; + if (m_baseService.get()) + systemAvailability = m_baseService->GetLatestProxyConfig(&systemConfig); + *config = systemConfig; + // make sure to get updates via OnProxyConfigChanged + RegisterObserver(); + return systemAvailability; + } + // Use QNetworkProxy::applicationProxy settings const QNetworkProxy &qtProxy = QNetworkProxy::applicationProxy(); if (qtProxy == m_qtApplicationProxy && !m_qtProxyConfig.proxy_rules().empty()) { + // no changes *config = m_qtProxyConfig; return CONFIG_VALID; } + m_qtApplicationProxy = qtProxy; m_qtProxyConfig = net::ProxyConfig(); - if (qtProxy.type() == QNetworkProxy::NoProxy - && QNetworkProxyFactory::usesSystemConfiguration()) { - *config = systemConfig; - return systemAvailability; - } net::ProxyConfig::ProxyRules qtRules; net::ProxyServer server = fromQNetworkProxy(qtProxy); @@ -143,31 +149,51 @@ net::ProxyConfigService::ConfigAvailability ProxyConfigServiceQt::GetLatestProxy void ProxyConfigServiceQt::OnLazyPoll() { - if (m_qtApplicationProxy != QNetworkProxy::applicationProxy()) { - net::ProxyConfig unusedConfig; - OnProxyConfigChanged(unusedConfig, CONFIG_VALID); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) + // We need to update if + // - setUseSystemConfiguration() was called in between + // - user changed application proxy + if (m_usesSystemConfiguration != QNetworkProxyFactory::usesSystemConfiguration() + || (!m_usesSystemConfiguration && m_qtApplicationProxy != QNetworkProxy::applicationProxy())) { + Update(); + } else if (m_usesSystemConfiguration) { + if (m_baseService.get()) + m_baseService->OnLazyPoll(); } - if (m_baseService.get()) - m_baseService->OnLazyPoll(); +#else + if (m_qtApplicationProxy != QNetworkProxy::applicationProxy()) + Update(); +#endif } - +// Called when the base service changed void ProxyConfigServiceQt::OnProxyConfigChanged(const net::ProxyConfig &config, ConfigAvailability availability) { - Q_UNUSED(config); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + Q_UNUSED(config); - if (m_qtApplicationProxy != QNetworkProxy::applicationProxy() - || m_qtApplicationProxy.type() == QNetworkProxy::NoProxy) { - net::ProxyConfig actual_config; - availability = GetLatestProxyConfig(&actual_config); - if (availability == CONFIG_PENDING) - return; - for (net::ProxyConfigService::Observer &observer: m_observers) - observer.OnProxyConfigChanged(actual_config, availability); - } + if (!m_usesSystemConfiguration) + return; + + Update(); +} + +// Update our observers +void ProxyConfigServiceQt::Update() +{ + net::ProxyConfig actual_config; + ConfigAvailability availability = GetLatestProxyConfig(&actual_config); + if (availability == CONFIG_PENDING) + return; + for (net::ProxyConfigService::Observer &observer: m_observers) + observer.OnProxyConfigChanged(actual_config, availability); } +// Register ourselves as observer of the base service. +// This has to be done on the IO thread, and therefore cannot be done +// in the constructor. void ProxyConfigServiceQt::RegisterObserver() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/src/core/proxy_config_service_qt.h b/src/core/proxy_config_service_qt.h index f2f9a2210..7be3289d0 100644 --- a/src/core/proxy_config_service_qt.h +++ b/src/core/proxy_config_service_qt.h @@ -69,13 +69,17 @@ private: void OnProxyConfigChanged(const net::ProxyConfig& config, ConfigAvailability availability) override; + // Retrieve new proxy settings and notify observers. + void Update(); + // Makes sure that the observer registration with the base service is set up. void RegisterObserver(); std::unique_ptr<net::ProxyConfigService> m_baseService; base::ObserverList<net::ProxyConfigService::Observer, true> m_observers; - // Keep the last QNetworkProxy::applicationProxy state around. + // Keep the last state around. + bool m_usesSystemConfiguration; QNetworkProxy m_qtApplicationProxy; net::ProxyConfig m_qtProxyConfig; diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index f90a44044..0c98c9e21 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1124,8 +1124,9 @@ void RenderWidgetHostViewQt::handleKeyEvent(QKeyEvent *ev) if (keyDownTextInsertion) { // Blink won't consume the RawKeyDown, but rather the Char event in this case. - // Make sure to skip the former on the way back. The same os_event will be set on both of them. - webEvent.skip_in_browser = true; + // The RawKeyDown is skipped on the way back (see above). + // The same os_event will be set on both NativeWebKeyboardEvents. + webEvent.skip_in_browser = false; webEvent.setType(blink::WebInputEvent::Char); m_host->ForwardKeyboardEvent(webEvent); } diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 995ba1b2e..c9b46b38a 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -72,6 +72,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/favicon_status.h" #include "content/public/common/content_constants.h" +#include "content/public/common/content_switches.h" #include <content/public/common/drop_data.h> #include "content/public/common/page_state.h" #include "content/public/common/page_zoom.h" @@ -81,6 +82,7 @@ #include "content/public/common/web_preferences.h" #include "third_party/WebKit/public/web/WebFindOptions.h" #include "printing/features/features.h" +#include "ui/gfx/font_render_params.h" #include <QDir> #include <QGuiApplication> @@ -418,6 +420,20 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient) rendererPrefs->caret_blink_interval = 0.5 * static_cast<double>(qtCursorFlashTime) / 1000; rendererPrefs->user_agent_override = d->browserContextAdapter->httpUserAgent().toStdString(); rendererPrefs->accept_languages = d->browserContextAdapter->httpAcceptLanguageWithoutQualities().toStdString(); +#if defined(ENABLE_WEBRTC) + base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess(); + if (commandLine->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) + rendererPrefs->webrtc_ip_handling_policy = commandLine->GetSwitchValueASCII(switches::kForceWebRtcIPHandlingPolicy); +#endif + // Set web-contents font settings to the default font settings as Chromium constantly overrides + // the global font defaults with the font settings of the latest web-contents created. + CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL))); + rendererPrefs->should_antialias_text = params.antialiasing; + rendererPrefs->use_subpixel_positioning = params.subpixel_positioning; + rendererPrefs->hinting = params.hinting; + rendererPrefs->use_autohinter = params.autohinter; + rendererPrefs->use_bitmaps = params.use_bitmaps; + rendererPrefs->subpixel_rendering = params.subpixel_rendering; d->webContents->GetRenderViewHost()->SyncRendererPrefs(); // Create and attach observers to the WebContents. diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index f8875f82e..54564718f 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -333,6 +333,17 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kDisablePepper3DImageChromium); #endif +#if defined(Q_OS_WIN) + // This switch is used in Chromium's gl_context_wgl.cc file to determine whether to create + // an OpenGL Core Profile context. If the switch is not set, it would always try to create a + // Core Profile context, even if Qt uses a legacy profile, which causes + // "Could not share GL contexts" warnings, because it's not possible to share between Core and + // legacy profiles. + // Given that Core profile is not currently supported on Windows anyway, pass this switch to + // get rid of the warnings. + parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext); +#endif + if (useEmbeddedSwitches) { // Inspired by the Android port's default switches if (!parsedCommandLine->HasSwitch(switches::kDisableOverlayScrollbar)) @@ -390,8 +401,23 @@ WebEngineContext::WebEngineContext() } } } else { - if (!qt_gl_global_share_context()->isOpenGLES()) + if (!qt_gl_global_share_context()->isOpenGLES()) { + // Default to Desktop non-Core profile OpenGL. glType = gl::kGLImplementationDesktopName; + + // Check if Core profile was requested and is supported. + QSurfaceFormat globalSharedFormat = qt_gl_global_share_context()->format(); + if (globalSharedFormat.profile() == QSurfaceFormat::CoreProfile) { +#ifdef Q_OS_MACOS + // @TODO_FIXME_ADAPT_QT + // glType = gl::kGLImplementationCoreProfileName; +#else + qWarning("An OpenGL Core Profile was requested, but it is not supported " + "on the current platform. Falling back to a non-Core profile. " + "Note that this might cause rendering issues."); +#endif + } + } } if (qt_gl_global_share_context()->format().profile() == QSurfaceFormat::CompatibilityProfile) diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index fe40298bb..31d120899 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -48,6 +48,7 @@ #include "content/browser/gpu/gpu_process_host.h" #include "content/public/common/content_switches.h" #include "content/public/common/web_preferences.h" +#include "ui/events/event_switches.h" #include <QFont> #include <QTimer> @@ -97,6 +98,29 @@ static inline bool isTouchScreenAvailable() { return touchScreenAvailable; } +static inline bool isTouchEventsAPIEnabled() { + static bool initialized = false; + static bool touchEventsAPIEnabled = false; + if (!initialized) { + base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess(); + + // By default the Touch Events API support (presence of 'ontouchstart' in 'window' object) + // will be determined based on the availability of touch screen devices. + const std::string touchEventsSwitchValue = + parsedCommandLine->HasSwitch(switches::kTouchEventFeatureDetection) ? + parsedCommandLine->GetSwitchValueASCII(switches::kTouchEventFeatureDetection) : + switches::kTouchEventFeatureDetectionAuto; + + if (touchEventsSwitchValue == switches::kTouchEventFeatureDetectionEnabled) + touchEventsAPIEnabled = true; + else if (touchEventsSwitchValue == switches::kTouchEventFeatureDetectionAuto) + touchEventsAPIEnabled = isTouchScreenAvailable(); + + initialized = true; + } + return touchEventsAPIEnabled; +} + WebEngineSettings::WebEngineSettings(WebEngineSettings *_parentSettings) : m_adapter(0) @@ -298,6 +322,7 @@ void WebEngineSettings::doApply() void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *prefs) { // Override for now + prefs->touch_event_feature_detection_enabled = isTouchEventsAPIEnabled(); prefs->device_supports_touch = isTouchScreenAvailable(); if (prefs->viewport_enabled) { // We should enable viewport and viewport-meta together, but since 5.7 we diff --git a/src/webengine/doc/qtwebengine.qdocconf b/src/webengine/doc/qtwebengine.qdocconf index ea9c6f21b..7b1bad4e6 100644 --- a/src/webengine/doc/qtwebengine.qdocconf +++ b/src/webengine/doc/qtwebengine.qdocconf @@ -42,6 +42,7 @@ depends += qtcore \ qtgui \ qtlocation \ qtnetwork \ + qtplatformheaders \ qtprintsupport \ qtpositioning \ qtqml \ diff --git a/src/webengine/doc/src/external-resources.qdoc b/src/webengine/doc/src/external-resources.qdoc index a75c7aaed..6cced588c 100644 --- a/src/webengine/doc/src/external-resources.qdoc +++ b/src/webengine/doc/src/external-resources.qdoc @@ -136,3 +136,13 @@ \externalpage https://http2.akamai.com/demo \title Akamai HTTP/2 Demo */ + +/*! + \externalpage https://www.chromium.org/developers/design-documents/user-scripts + \title User Scripts +*/ + +/*! + \externalpage https://wiki.greasespot.net/Metadata_Block#.40name + \title Metadata Block +*/ diff --git a/src/webengine/doc/src/qtwebengine-debugging.qdoc b/src/webengine/doc/src/qtwebengine-debugging.qdoc index e929fabeb..5ff1c6342 100644 --- a/src/webengine/doc/src/qtwebengine-debugging.qdoc +++ b/src/webengine/doc/src/qtwebengine-debugging.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -71,4 +71,35 @@ For a detailed explanation of the capabilities of developer tools, see the \l {Chrome DevTools} page. + + \section1 Using Command-Line Arguments + + You can use the following command-line arguments while debugging to provide + input for bug reports: + + \list + \li \c {--disable-gpu} disables GPU hardware acceleration. This is + useful when diagnosing OpenGL problems. + \li \c {--disable-logging} disables console logging, which might be + useful for debug builds. + \li \c {--enable-logging --log-level=0} enables console logging and sets + the logging level to 0, which means that messages of the severity + \c info and above are recorded in the log. This is the default for + debug builds. Other possible log levels are \c 1 for warnings, \c 2 + for errors, and \c 3 for fatal errors. + \li \c {--no-sandbox} disables the sandbox for the renderer and plugin + processes. Keep in mind that disabling the sandbox might present a + security risk. + \li \c {--single-process} runs the renderer and plugins in the same + process as the browser. This is useful for getting stack traces for + renderer crashes. + \endlist + + Alternatively, the environment variable QTWEBENGINE_CHROMIUM_FLAGS can be + set. For example, the following value could be set to disable logging while + debugging an application called \e mybrowser: + + \code + QTWEBENGINE_CHROMIUM_FLAGS="--disable-logging" mybrowser + \endcode */ diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc index a5e972023..7850ff35d 100644 --- a/src/webengine/doc/src/qtwebengine-features.qdoc +++ b/src/webengine/doc/src/qtwebengine-features.qdoc @@ -45,6 +45,7 @@ \li \l{Pepper Plugin API} \li \l{Print to PDF} \li \l{Spellchecker} + \li \l{Touch} \li \l{View Source} \li \l{WebRTC} \endlist @@ -343,6 +344,22 @@ Support for this feature was added in Qt 5.8.0. + \section1 Touch + + Qt WebEngine supports touch devices for navigating and interacting with web pages. + + Applications can prohibit the use of touch events in the following ways: + + \list + \li Passing the flag \c --touch-events=disabled on the command line will disable touch event + support in JavaScript API (meaning \c ontouchstart and related handlers will not be present + in the \c document.window object). Touch events will still be delivered to web pages. + + \li Installing an event filter object using \l {QObject::installEventFilter} on the WebEngine + view focus proxy object, and filtering out all touch events. + + \endlist + \section1 View Source Qt WebEngine supports viewing the HTML source of a web page. diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index e180b22c0..e9ca573b7 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -181,8 +181,29 @@ 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. - The following \l Greasemonkey attributes are supported since Qt 5.8: - \c @exclude, \c @include, \c @name, \c @match, and \c @run-at. + Since Qt 5.8, Qt WebEngine supports augmenting a script by using the + following \l{Metadata Block}{Greasemonkey-like attributes}: + + \list + \li \c {@exclude <regexp>} + \li \c {@include <regexp>} + \li \c {@match <regexp>} + \li \c {@name <free text>} + \li \c {@run-at [document-start|document-end|document-idle]} + \endlist + + The attributes determine if and when a \l {User Scripts}{user script} is + run. They must be placed immediately in the beginning of the script, inside + a \c ==UserScript== comment: + + \code + // ==UserScript== + // @include http://*.qt.io/* + // @exclude http://wiki.qt.io/* + // ==/UserScript== + + window.alert("Page is from qt.io, but not wiki.qt.io"); + \endcode \section1 Managing Certificates diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index ec678672c..068d395b6 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -182,4 +182,10 @@ It can be re-enabled by setting the \c QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment variable to a non-empty value. + \section1 Popups in Fullscreen Applications on Windows + Because of a limitation in the Windows compositor, applications that show a fullscreen web + engine view will not properly display popups or other top-level windows. The reason and + workaround for the issue can be found at \l {Fullscreen OpenGL Based Windows} and + \l {QWindowsWindowFunctions::setHasBorderInFullScreen}. + */ diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc index 959f96b10..3da554a81 100644 --- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc +++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc @@ -28,8 +28,7 @@ /*! \module QtWebEngineWidgets \title Qt WebEngine Widgets C++ Classes - \brief Provides a web browser engine as well as C++ classes to render and - interact with web content + \brief Provides C++ classes for rendering web content in a QWidget based application \ingroup modules \ingroup qtwebengine-modules \qtvariable webenginewidgets |