summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-09 15:22:24 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-09 15:22:24 +0200
commit0eac492b5c66b1774118c387dd527ad419e51be7 (patch)
tree37324fdefd615e433dd65073390d7b9996d660d3
parent5d6086d1b97461b35c143839a8a6ba1b990bb87c (diff)
parent99d46a8a918dee7323bc3d4f1624c47c097f9a3a (diff)
downloadqtwebengine-0eac492b5c66b1774118c387dd527ad419e51be7.tar.gz
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I495adfcbb010ac29dc64e051c030a92d27859ca6
-rw-r--r--config_help.txt3
-rw-r--r--dist/changes-5.12.379
-rw-r--r--examples/webengine/customdialogs/doc/src/customdialogs.qdoc2
-rw-r--r--examples/webengine/customdialogs/main.cpp1
-rw-r--r--examples/webengine/minimal/doc/src/minimal.qdoc4
-rw-r--r--examples/webengine/quicknanobrowser/BrowserDialog.qml2
-rw-r--r--examples/webengine/quicknanobrowser/DownloadView.qml2
-rw-r--r--examples/webengine/quicknanobrowser/main.cpp5
-rw-r--r--examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc20
-rw-r--r--examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc2
-rw-r--r--examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc6
-rw-r--r--examples/webenginewidgets/maps/doc/src/maps.qdoc2
-rw-r--r--examples/webenginewidgets/minimal/doc/src/minimal.qdoc4
-rw-r--r--examples/webenginewidgets/printme/data/data.qrc7
-rw-r--r--examples/webenginewidgets/printme/data/icon.svg24
-rw-r--r--examples/webenginewidgets/printme/data/index.html24
-rw-r--r--examples/webenginewidgets/printme/data/style.css72
-rw-r--r--examples/webenginewidgets/printme/doc/images/printme-example.pngbin0 -> 42074 bytes
-rw-r--r--examples/webenginewidgets/printme/doc/src/printme.qdoc98
-rw-r--r--examples/webenginewidgets/printme/main.cpp76
-rw-r--r--examples/webenginewidgets/printme/printhandler.cpp115
-rw-r--r--examples/webenginewidgets/printme/printhandler.h79
-rw-r--r--examples/webenginewidgets/printme/printme.pro9
-rw-r--r--examples/webenginewidgets/simplebrowser/browser.cpp13
-rw-r--r--examples/webenginewidgets/simplebrowser/browser.h2
-rw-r--r--examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc27
-rw-r--r--examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc4
-rw-r--r--examples/webenginewidgets/spellchecker/main.cpp1
-rw-r--r--examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc6
-rw-r--r--examples/webenginewidgets/webenginewidgets.pro7
-rw-r--r--examples/webenginewidgets/webui/doc/src/webui.qdoc6
-rw-r--r--mkspecs/features/configure.prf4
-rw-r--r--mkspecs/features/gn_generator.prf45
-rw-r--r--mkspecs/features/platform.prf2
m---------src/3rdparty0
-rw-r--r--src/buildtools/gn.pro10
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp4
-rw-r--r--src/core/api/qwebenginecallback.h20
-rw-r--r--src/core/api/qwebenginecallback_p.h85
-rw-r--r--src/core/api/qwebengineclientcertificatestore.cpp12
-rw-r--r--src/core/api/qwebengineclientcertificatestore.h2
-rw-r--r--src/core/api/qwebenginecookiestore.cpp21
-rw-r--r--src/core/api/qwebenginecookiestore.h4
-rw-r--r--src/core/api/qwebenginecookiestore_p.h6
-rw-r--r--src/core/api/qwebenginehttprequest.cpp42
-rw-r--r--src/core/api/qwebenginehttprequest.h19
-rw-r--r--src/core/api/qwebenginemessagepumpscheduler_p.h3
-rw-r--r--src/core/api/qwebenginenotification.cpp6
-rw-r--r--src/core/api/qwebenginequotarequest.cpp3
-rw-r--r--src/core/api/qwebenginequotarequest.h3
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.cpp2
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.h6
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp29
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h2
-rw-r--r--src/core/api/qwebengineurlrequestinfo_p.h11
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.h8
-rw-r--r--src/core/api/qwebengineurlrequestjob.cpp5
-rw-r--r--src/core/api/qwebengineurlrequestjob.h4
-rw-r--r--src/core/api/qwebengineurlscheme.cpp17
-rw-r--r--src/core/api/qwebengineurlscheme.h4
-rw-r--r--src/core/api/qwebengineurlschemehandler.h2
-rw-r--r--src/core/clipboard_change_observer.h64
-rw-r--r--src/core/clipboard_qt.cpp88
-rw-r--r--src/core/clipboard_qt.h59
-rw-r--r--src/core/compositor/compositor.cpp2
-rw-r--r--src/core/compositor/compositor_resource_tracker.cpp8
-rw-r--r--src/core/config/linux.pri3
-rw-r--r--src/core/config/windows.pri22
-rw-r--r--src/core/content_main_delegate_qt.cpp2
-rw-r--r--src/core/core_chromium.pri6
-rw-r--r--src/core/core_module.pro4
-rw-r--r--src/core/core_project.pro5
-rw-r--r--src/core/doc/src/qtwebenginecore-index.qdoc6
-rw-r--r--src/core/doc/src/qtwebenginecore-module.qdoc2
-rw-r--r--src/core/download_manager_delegate_qt.cpp11
-rw-r--r--src/core/file_picker_controller.cpp31
-rw-r--r--src/core/printing/print_view_manager_qt.cpp28
-rw-r--r--src/core/profile_io_data_qt.cpp16
-rw-r--r--src/core/profile_qt.cpp4
-rw-r--r--src/core/profile_qt.h2
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
-rw-r--r--src/core/render_widget_host_view_qt_delegate.h1
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp7
-rw-r--r--src/core/renderer/user_resource_controller.cpp11
-rw-r--r--src/core/web_engine_context.cpp23
-rw-r--r--src/core/web_engine_context_threads.cpp2
-rw-r--r--src/core/web_engine_library_info.cpp30
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp4
-rw-r--r--src/webengine/api/qquickwebengineloadrequest.cpp2
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp4
-rw-r--r--src/webengine/doc/qtwebengine.qdocconf3
-rw-r--r--src/webengine/doc/src/external-resources.qdoc12
-rw-r--r--src/webengine/doc/src/qtwebengine-debugging.qdoc12
-rw-r--r--src/webengine/doc/src/qtwebengine-deploying.qdoc28
-rw-r--r--src/webengine/doc/src/qtwebengine-examples.qdoc2
-rw-r--r--src/webengine/doc/src/qtwebengine-features.qdoc54
-rw-r--r--src/webengine/doc/src/qtwebengine-index.qdoc4
-rw-r--r--src/webengine/doc/src/qtwebengine-module.qdoc2
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc54
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc32
-rw-r--r--src/webengine/doc/src/qwebengine-licensing.qdoc2
-rw-r--r--src/webengine/doc/src/webengineview_lgpl.qdoc6
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp7
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.h1
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp5
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.h1
-rw-r--r--src/webengine/ui_delegates_manager.cpp2
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp4
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp9
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp6
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp2
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h1
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc4
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc2
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc2
-rw-r--r--src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc72
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc2
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc4
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp7
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h1
-rw-r--r--tests/auto/quick/dialogs/WebView.qml2
-rw-r--r--tests/auto/quick/dialogs/tst_dialogs.cpp3
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST9
-rw-r--r--tests/auto/quick/qmltests/data/multifileupload.html2
-rw-r--r--tests/auto/quick/qmltests/data/singlefileupload.html2
-rw-r--r--tests/auto/quick/qmltests/data/tst_filePicker.qml106
-rw-r--r--tests/auto/widgets/offscreen/test.html7
-rw-r--r--tests/auto/widgets/offscreen/tst_offscreen.cpp3
-rw-r--r--tests/auto/widgets/offscreen/tst_offscreen.qrc6
-rw-r--r--tests/auto/widgets/origins/tst_origins.cpp49
-rw-r--r--tests/auto/widgets/proxypac/proxypac.pro3
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/BLACKLIST2
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp14
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp29
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp9
-rw-r--r--tests/auto/widgets/qwebenginescript/BLACKLIST3
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp51
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp46
-rw-r--r--tests/auto/widgets/widgets.pro4
-rw-r--r--tools/scripts/version_resolver.py2
140 files changed, 1600 insertions, 633 deletions
diff --git a/config_help.txt b/config_help.txt
index 8055de910..48236c18a 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -1,4 +1,5 @@
-Webengine options:
+WebEngine options:
+
-webengine-alsa ................ Enable ALSA support [auto] (Linux only)
-webengine-pulseaudio .......... Enable PulseAudio support [auto]
(Linux only)
diff --git a/dist/changes-5.12.3 b/dist/changes-5.12.3
new file mode 100644
index 000000000..344025378
--- /dev/null
+++ b/dist/changes-5.12.3
@@ -0,0 +1,79 @@
+Qt 5.12.3 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.2.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.12.3 Changes *
+****************************************************************************
+
+Behavior Changes
+----------------
+
+ - [QTBUG-74490] Client side redirects are no longer reported as link clicked.
+
+Chromium
+--------
+
+ - Security fixes from Chromium up to version 73.0.3683.75, including:
+
+ * CVE-2019-5787
+ * CVE-2019-5789
+ * CVE-2019-5790
+ * CVE-2019-5791
+ * CVE-2019-5792
+ * CVE-2019-5793
+ * CVE-2019-5794
+ * CVE-2019-5795
+ * CVE-2019-5797
+ * CVE-2019-5802
+ * CVE-2019-5803
+ * Security issue 905509
+ * Security issue 906437
+ * Security issue 906652
+ * Security issue 906739
+ * Security issue 913212
+ * Security issue 914511
+ * Security issue 916874
+ * Security issue 917608
+ * Security issue 917707
+ * Security issue 919340
+ * Security issue 919572
+ * Security issue 924905
+ * Security issue 929088
+ * Security issue 931640
+ * Security issue 938251
+ * Security issue 933743
+
+
+General
+-------
+
+ - [QTBUG-73833] Fixed crash with dynamic_cast in event filter.
+ - [QTBUG-74021] Fixed crash on exit if the app leaked a page.
+ - [QTBUG-74116] Fixed crash on exit for rare QML setup.
+ - [QTBUG-74484] Fixed default style of media controls for audio playback.
+ - [QTBUG-74519] Fixed regression in setting background colors.
+ - [QTBUG-74659] Fixed quotes and other characters being escaped in tooltips.
+ - [QTBUG-74764] Fixed deduplication naming of 100+ downloads on Windows.
+
+
+Examples
+--------
+
+ - Quicknanobrowser status bubble hid correctly.
+ - Recipebrowser rendering and tabbing fixed.
diff --git a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc b/examples/webengine/customdialogs/doc/src/customdialogs.qdoc
index 3fc888a77..5c550ed5e 100644
--- a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc
+++ b/examples/webengine/customdialogs/doc/src/customdialogs.qdoc
@@ -29,7 +29,7 @@
\example webengine/customdialogs
\title WebEngine Qt Quick Custom Dialogs Example
\ingroup webengine-examples
- \brief Customizes UI elements of Qt WebEngine's dialogs.
+ \brief Customizes UI elements of \QWE's dialogs.
\image customdialogs.png
diff --git a/examples/webengine/customdialogs/main.cpp b/examples/webengine/customdialogs/main.cpp
index 35f39211d..82a3eca63 100644
--- a/examples/webengine/customdialogs/main.cpp
+++ b/examples/webengine/customdialogs/main.cpp
@@ -66,6 +66,7 @@ typedef QGuiApplication Application;
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
Application app(argc, argv);
QtWebEngine::initialize();
diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webengine/minimal/doc/src/minimal.qdoc
index 8d12afc7c..4fc62bddb 100644
--- a/examples/webengine/minimal/doc/src/minimal.qdoc
+++ b/examples/webengine/minimal/doc/src/minimal.qdoc
@@ -29,7 +29,7 @@
\example webengine/minimal
\title WebEngine Qt Quick Minimal Example
\ingroup webengine-examples
- \brief Displays a web page using the Qt Quick integration of Qt WebEngine.
+ \brief Displays a web page using the Qt Quick integration of \QWE.
\image minimal-example.png
@@ -52,7 +52,7 @@
In the \c main function we first set the
\l{QCoreApplication::organizationName} property. This affects the locations
- where Qt WebEngine stores persistent and cached data (see also
+ where \QWE stores persistent and cached data (see also
\l{WebEngineProfile::cachePath} and
\l{WebEngineProfile::persistentStoragePath}).
diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webengine/quicknanobrowser/BrowserDialog.qml
index 6b0b3acd6..a7ff9a55b 100644
--- a/examples/webengine/quicknanobrowser/BrowserDialog.qml
+++ b/examples/webengine/quicknanobrowser/BrowserDialog.qml
@@ -50,7 +50,7 @@
import QtQuick 2.1
import QtQuick.Window 2.2
-import QtWebEngine 1.7
+import QtWebEngine 1.9
Window {
id: window
diff --git a/examples/webengine/quicknanobrowser/DownloadView.qml b/examples/webengine/quicknanobrowser/DownloadView.qml
index ed28c761c..f6ebeab4a 100644
--- a/examples/webengine/quicknanobrowser/DownloadView.qml
+++ b/examples/webengine/quicknanobrowser/DownloadView.qml
@@ -51,7 +51,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0
-import QtWebEngine 1.2
+import QtWebEngine 1.9
import QtQuick.Layouts 1.0
Rectangle {
diff --git a/examples/webengine/quicknanobrowser/main.cpp b/examples/webengine/quicknanobrowser/main.cpp
index 18ba7b3e2..8d032f5d8 100644
--- a/examples/webengine/quicknanobrowser/main.cpp
+++ b/examples/webengine/quicknanobrowser/main.cpp
@@ -89,7 +89,10 @@ int main(int argc, char **argv)
Utils utils;
appEngine.rootContext()->setContextProperty("utils", &utils);
appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
- QMetaObject::invokeMethod(appEngine.rootObjects().first(), "load", Q_ARG(QVariant, startupUrl()));
+ if (!appEngine.rootObjects().isEmpty())
+ QMetaObject::invokeMethod(appEngine.rootObjects().first(), "load", Q_ARG(QVariant, startupUrl()));
+ else
+ qFatal("Failed to load sources");
return app.exec();
}
diff --git a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
index 0321c22e4..63a0af361 100644
--- a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
@@ -101,7 +101,7 @@
width.
\skipto WebEngineView
- \printuntil KeyNavigation.priority
+ \printuntil Layout.fillHeight
We then disable the \l{WebEngineSettings::focusOnNavigationEnabled}{focusOnNavigationEnabled}
setting to make sure that the \l{WebEngineView} does not steal focus from the \c RecipeList
@@ -110,19 +110,25 @@
ContextMenuRequest.
\skipto focusOnNavigationEnabled
- \printto firstLoadComplete
+ \printuntil }
When the application starts, instead of directly showing the \l{WebEngineView}, we show a
placeholder \l{Rectangle} with a \l{BusyIndicator} to provide a nicer user experience while the
- application is loading. Once the first page in the view is loaded, we start a \l{Timer} that
+ application is loading.
+
+ \printuntil }
+ \dots 12
+ \skipto Rectangle
+ \printuntil }
+
+ Once the first page in the view is loaded, we start a \l{Timer} that
will hide the placeholder and show the actual page. The delay provides more time for the recipe
images to load, so that when the view is shown, the page is completely rendered. The timer also
shows a help \l{ToolTip} that informs the user on how to navigate the recipes.
- \printuntil busy.running = true
- \printline }
- \printline }
- \printline }
+ \quotefromfile webengine/recipebrowser/resources/qml/main.qml
+ \skipto Timer {
+ \printuntil }
Let's see what the \c RecipeList item looks like from the inside. The root item is a
FocusScope to allow transferring focus to the child ListView whenever the root item receives
diff --git a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
index a1b4eeb18..316e11a9b 100644
--- a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
+++ b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
@@ -29,7 +29,7 @@
\example webenginewidgets/cookiebrowser
\title WebEngine Cookie Browser Example
\ingroup webengine-widgetexamples
- \brief A cookie browser based on Qt WebEngine Widgets.
+ \brief A cookie browser based on \QWE Widgets.
\image cookiebrowser.png
diff --git a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
index eea7f7c09..37fe3eb50 100644
--- a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
+++ b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
@@ -29,11 +29,11 @@
\example webenginewidgets/html2pdf
\title WebEngine Widgets Html2Pdf Example
\ingroup webengine-widgetexamples
- \brief Converts web pages to PDF documents using Qt WebEngine.
+ \brief Converts web pages to PDF documents using \QWE.
\image html2pdf-example.png
- \e {Html2Pdf} demonstrates how to use Qt WebEngine to implement a
+ \e {Html2Pdf} demonstrates how to use \QWE to implement a
command-line application for converting web pages into PDF documents.
\include examples-run.qdocinc
@@ -90,7 +90,7 @@
\skipto int main
\printuntil /^\}/
- Note that to use Qt WebEngine Widgets we need to create a \l QApplication
+ Note that to use \QWE Widgets we need to create a \l QApplication
and not a \l QCoreApplication, even though this is a command line
application.
*/
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index 5e4a5cd83..489a5a780 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -38,7 +38,7 @@
The \l {https://www.w3.org/TR/geolocation-API/}{Geolocation API} is a
JavaScript API that web applications can use to determine the user's
- physical location to show on a map, for example. As Qt WebEngine relies on
+ physical location to show on a map, for example. As \QWE relies on
\l {Qt Location} to power this API a viable location backend is needed for
the target platform.
diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
index d0b25c4b8..b04390d23 100644
--- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
+++ b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
@@ -29,7 +29,7 @@
\example webenginewidgets/minimal
\title WebEngine Widgets Minimal Example
\ingroup webengine-widgetexamples
- \brief Displays a web page using Qt WebEngine Widgets.
+ \brief Displays a web page using \QWE Widgets.
\image minimal-example.png
@@ -53,7 +53,7 @@
In the \c main function we first set the
\l{QCoreApplication::organizationName} property. This affects the locations
- where Qt WebEngine stores persistent and cached data (see also
+ where \QWE stores persistent and cached data (see also
\l{QWebEngineProfile::cachePath} and
\l{QWebEngineProfile::persistentStoragePath}).
diff --git a/examples/webenginewidgets/printme/data/data.qrc b/examples/webenginewidgets/printme/data/data.qrc
new file mode 100644
index 000000000..a9c76cc7e
--- /dev/null
+++ b/examples/webenginewidgets/printme/data/data.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>index.html</file>
+ <file>style.css</file>
+ <file>icon.svg</file>
+ </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/printme/data/icon.svg b/examples/webenginewidgets/printme/data/icon.svg
new file mode 100644
index 000000000..b90ff26dd
--- /dev/null
+++ b/examples/webenginewidgets/printme/data/icon.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="94px" height="94px" viewBox="0 0 94 94" enable-background="new 0 0 94 94" xml:space="preserve">
+<g>
+ <circle fill="none" cx="47" cy="47" r="47"/>
+ <g>
+ <path fill="#46A2DA" d="M47,92.979c-11.779,0-23.559-4.484-32.526-13.451C-3.461,61.591-3.461,32.409,14.472,14.474
+ C32.41-3.463,61.592-3.461,79.526,14.473c17.935,17.936,17.935,47.119,0.002,65.054l-0.002,0.001
+ C70.559,88.495,58.779,92.979,47,92.979z"/>
+ </g>
+ <path fill="#80C342" d="M93,47C93,21.595,72.405,1,47,1C34.297,1,22.797,6.149,14.473,14.473l65.054,65.054
+ C87.851,71.203,93,59.703,93,47z"/>
+ <g>
+ <path fill="#46A2DA" d="M47,65c-4.808,0-9.328-1.873-12.728-5.272c-7.018-7.019-7.018-18.438,0-25.456
+ C37.672,30.873,42.192,29,47,29s9.328,1.873,12.728,5.272c7.018,7.019,7.018,18.438,0,25.456C56.328,63.127,51.808,65,47,65z"/>
+ <path fill="#FFFFFF" d="M62.248,59.919c6.671-7.858,6.312-19.644-1.105-27.061C57.237,28.953,52.118,27,47,27
+ c-5.118,0-10.237,1.953-14.142,5.858c-7.81,7.81-7.81,20.474,0,28.284C36.763,65.047,41.882,67,47,67
+ c4.379,0,8.752-1.441,12.372-4.3L77.88,81.209c0.989-0.895,1.935-1.837,2.843-2.814L62.248,59.919z M35.686,58.314
+ c-6.238-6.238-6.238-16.389,0-22.627C38.708,32.664,42.726,31,47,31c4.274,0,8.292,1.664,11.314,4.686
+ c6.238,6.238,6.238,16.389,0,22.627C55.292,61.336,51.274,63,47,63C42.726,63,38.708,61.336,35.686,58.314z"/>
+ </g>
+</g>
+</svg>
diff --git a/examples/webenginewidgets/printme/data/index.html b/examples/webenginewidgets/printme/data/index.html
new file mode 100644
index 000000000..cf286e85a
--- /dev/null
+++ b/examples/webenginewidgets/printme/data/index.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>PrintMe</title>
+ <link rel="stylesheet" type="text/css" href="style.css">
+ <script>
+ function printNow() {
+ window.print();
+ }
+ </script>
+ </head>
+ <body>
+ <form class="form">
+ <img class="logo" src="icon.svg" alt="qtwebengine">
+ <div class="header">
+ <h1>Hello Paper World!</h1>
+ <h2>Press Ctrl+p to print with print preview</h2>
+ <h2>Press Ctrl+Shift+p to print without print preview</h2>
+ <h2>Click the button to print using JavaScript</h2>
+ <p class="button" onclick="printNow()">Print Now</p>
+ </form>
+ </body>
+</html>
diff --git a/examples/webenginewidgets/printme/data/style.css b/examples/webenginewidgets/printme/data/style.css
new file mode 100644
index 000000000..cf6a2b7bf
--- /dev/null
+++ b/examples/webenginewidgets/printme/data/style.css
@@ -0,0 +1,72 @@
+html,body {
+ height:100%;
+ width:100%;
+ margin:0;
+}
+ body {
+ display:flex;
+}
+ .logo {
+ width: 75px;
+ height: 75px;
+ float: left;
+ margin: 20px 20px 0px 20px;
+ -webkit-animation:spin 8s linear infinite;
+}
+ @-webkit-keyframes spin {
+ 100% {
+ -webkit-transform: rotate(360deg);
+ }
+}
+ .header {
+ display: inline
+}
+ .form {
+ width: 480px;
+ height: 170px;
+ background: -webkit-linear-gradient(bottom, #ddd, #fff);
+ border: 1px solid #999;
+ border-radius: 12px;
+ color: #46a;
+ font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
+ font-size: 14px;
+ font-style: italic;
+ font-weight: bold;
+ margin: auto;
+ padding: 10px;
+ position: relative;
+ line-height: 26px;
+ text-decoration: none;
+ -webkit-box-shadow: 0px 0px 5px #444;
+}
+ h1 {
+ padding-left:40px;
+ color: #46a2da;
+}
+ h2 {
+ color: #80c342;
+ font-size: 13px;
+ margin-top: -20px;
+}
+ span {
+ margin-left: 20px;
+}
+ .button{
+ display: inline-block;
+ background: #46a2da;
+ width: 100px;
+ height: 30px;
+ padding: 0px;
+ text-align: center;
+ font-weight: bold;
+ color: #ffffff;
+ text-decoration: none;
+ border: 1px solid #999;
+ margin-left: 190px;
+}
+ .button:hover {
+ background-color: #46a200
+}
+ .button:active {
+ background-color: #3e8e41;
+}
diff --git a/examples/webenginewidgets/printme/doc/images/printme-example.png b/examples/webenginewidgets/printme/doc/images/printme-example.png
new file mode 100644
index 000000000..a636972fd
--- /dev/null
+++ b/examples/webenginewidgets/printme/doc/images/printme-example.png
Binary files differ
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
new file mode 100644
index 000000000..d05d5147b
--- /dev/null
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example webenginewidgets/printme
+ \title WebEngine Widgets PrintMe Example
+ \ingroup webengine-widgetexamples
+ \brief Demonstrates how to print web pages using Qt WebEngine Widgets.
+
+ \image printme-example.png
+
+ \e PrintMe demonstrates how to use the \l{QWebEnginePage} and
+ \l{QPrintDialog} classes to print a web page. Further, it shows how
+ to implement print preview by using the \l{QPrintPreviewDialog} class.
+ For completeness, it also illustrates how to trigger a printing request
+ within JavaScript.
+
+ \include examples-run.qdocinc
+
+ \section1 Simple HTML Page
+
+ In this example, we create an internal HTML page that is added as a resource
+ collection file (.qrc). The page shows only a small HTML message box that
+ explains how to trigger printing by using keyboard shortcuts or clicking a
+ button. The button has the JavaScript \c{onclick} event attribute that calls
+ the JavaScript \c{window.print()} function.
+
+ \quotefromfile webenginewidgets/printme/data/index.html
+ \skipto <html
+ \printuntil html>
+
+ \section1 Main Function
+
+ In the \c main function, we first instantiate a QWebEngineView and set the
+ URL to our internal HTML page. Next, we create a \c PrintHandler instance
+ and pass the requested page. For convenience, we also create keyboard
+ shortcuts that can be used to call a print dialog or print preview dialog.
+
+ \quotefromfile webenginewidgets/printme/main.cpp
+ \skipto QWebEngineView view
+ \printto return
+
+ \section1 Print Handler
+
+ In the \c{PrintHandler} function, we first implement \c{printPreview()},
+ where we instantiate \l{QPrinter} together with \l{QPrintPreviewDialog}.
+ We need the \l{QPrintPreviewDialog::paintRequested} handle to generate a
+ set of preview pages.
+
+ \quotefromfile webenginewidgets/printme/printhandler.cpp
+ \skipto PrintHandler::printPreview(
+ \printuntil /^\}/
+
+ Now we can implement the \c{PrintHandler::printDocument()} slot, which is
+ called in response to the \l{QPrintPreviewDialog::paintRequested} signal.
+
+ \quotefromfile webenginewidgets/printme/printhandler.cpp
+ \skipto PrintHandler::printDocument(
+ \printuntil /^\}/
+
+ To do actual painting on a printer, we call the \l{QWebEnginePage::print()}
+ function. Because this call blocks the main event loop, we need to create
+ a local one. We begin the local event loop by calling
+ \l{QEventLoop::exec()}. When the local event loop terminates,
+ we check for \c{result} and report any errors that occurred.
+
+ The last function we implement, \c{PrintHandler::print()}, is trivial,
+ because it simply opens \l{QPrintDialog} and calls the previously
+ implemented \c{PrintHandler::printDocument()}.
+
+ \quotefromfile webenginewidgets/printme/printhandler.cpp
+ \skipto PrintHandler::print(
+ \printuntil /^\}/
+*/
diff --git a/examples/webenginewidgets/printme/main.cpp b/examples/webenginewidgets/printme/main.cpp
new file mode 100644
index 000000000..e4d6d9dc8
--- /dev/null
+++ b/examples/webenginewidgets/printme/main.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "printhandler.h"
+#include <QApplication>
+#include <QShortcut>
+#include <QWebEngineView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication app(argc, argv);
+
+ QWebEngineView view;
+ view.setUrl(QUrl(QStringLiteral("qrc:/index.html")));
+ view.resize(1024, 750);
+ view.show();
+
+ PrintHandler handler;
+ handler.setPage(view.page());
+
+ auto printPreviewShortCut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_P), &view);
+ auto printShortCut = new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P), &view);
+
+ QObject::connect(printPreviewShortCut, &QShortcut::activated, &handler, &PrintHandler::printPreview);
+ QObject::connect(printShortCut, &QShortcut::activated, &handler, &PrintHandler::print);
+
+ return app.exec();
+}
diff --git a/examples/webenginewidgets/printme/printhandler.cpp b/examples/webenginewidgets/printme/printhandler.cpp
new file mode 100644
index 000000000..d8c4fc177
--- /dev/null
+++ b/examples/webenginewidgets/printme/printhandler.cpp
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "printhandler.h"
+#include <QEventLoop>
+#include <QPrintDialog>
+#include <QPrinter>
+#include <QPainter>
+#include <QPrintPreviewDialog>
+#include <QWebEnginePage>
+
+PrintHandler::PrintHandler(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+void PrintHandler::setPage(QWebEnginePage *page)
+{
+ Q_ASSERT(!m_page);
+ m_page = page;
+ connect(m_page, &QWebEnginePage::printRequested, this, &PrintHandler::printPreview);
+}
+
+void PrintHandler::print()
+{
+ QPrinter printer(QPrinter::HighResolution);
+ QPrintDialog dialog(&printer, m_page->view());
+ if (dialog.exec() != QDialog::Accepted)
+ return;
+ printDocument(&printer);
+}
+
+void PrintHandler::printDocument(QPrinter *printer)
+{
+ QEventLoop loop;
+ bool result;
+ auto printPreview = [&](bool success) { result = success; loop.quit(); };
+ m_page->print(printer, std::move(printPreview));
+ loop.exec();
+ if (!result) {
+ QPainter painter;
+ if (painter.begin(printer)) {
+ QFont font = painter.font();
+ font.setPixelSize(20);
+ painter.setFont(font);
+ painter.drawText(QPointF(10,25),
+ QStringLiteral("Could not generate print preview."));
+
+ painter.end();
+ }
+ }
+}
+
+void PrintHandler::printPreview()
+{
+ if (!m_page)
+ return;
+ if (m_inPrintPreview)
+ return;
+ m_inPrintPreview = true;
+ QPrinter printer;
+ QPrintPreviewDialog preview(&printer, m_page->view());
+ connect(&preview, &QPrintPreviewDialog::paintRequested,
+ this, &PrintHandler::printDocument);
+ preview.exec();
+ m_inPrintPreview = false;
+}
diff --git a/examples/webenginewidgets/printme/printhandler.h b/examples/webenginewidgets/printme/printhandler.h
new file mode 100644
index 000000000..69b71f4a8
--- /dev/null
+++ b/examples/webenginewidgets/printme/printhandler.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PRINTHANDLER_H
+#define PRINTHANDLER_H
+
+#include <QObject>
+
+QT_BEGIN_NAMESPACE
+class QPainter;
+class QPrinter;
+class QWebEnginePage;
+QT_END_NAMESPACE
+
+class PrintHandler : public QObject
+{
+ Q_OBJECT
+public:
+ PrintHandler(QObject *parent = nullptr);
+ void setPage(QWebEnginePage *page);
+
+public slots:
+ void print();
+ void printPreview();
+ void printDocument(QPrinter *printer);
+
+private:
+ QWebEnginePage *m_page = nullptr;
+ bool m_inPrintPreview = false;
+};
+
+#endif // PRINTHANDLER_H
diff --git a/examples/webenginewidgets/printme/printme.pro b/examples/webenginewidgets/printme/printme.pro
new file mode 100644
index 000000000..15b3959d5
--- /dev/null
+++ b/examples/webenginewidgets/printme/printme.pro
@@ -0,0 +1,9 @@
+QT += webenginewidgets printsupport
+
+HEADERS = printhandler.h
+SOURCES = main.cpp \
+ printhandler.cpp
+RESOURCES = data/data.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/printme
+INSTALLS += target
diff --git a/examples/webenginewidgets/simplebrowser/browser.cpp b/examples/webenginewidgets/simplebrowser/browser.cpp
index 5c6dbd35e..68458b2a4 100644
--- a/examples/webenginewidgets/simplebrowser/browser.cpp
+++ b/examples/webenginewidgets/simplebrowser/browser.cpp
@@ -51,8 +51,6 @@
#include "browser.h"
#include "browserwindow.h"
-#include <QWebEngineProfile>
-
Browser::Browser()
{
// Quit application if the download manager window is the only remaining window
@@ -61,14 +59,17 @@ Browser::Browser()
QObject::connect(
QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested,
&m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);
- QObject::connect(
- &m_otrProfile, &QWebEngineProfile::downloadRequested,
- &m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);
}
BrowserWindow *Browser::createWindow(bool offTheRecord)
{
- auto profile = offTheRecord ? &m_otrProfile : QWebEngineProfile::defaultProfile();
+ if (offTheRecord && !m_otrProfile) {
+ m_otrProfile.reset(new QWebEngineProfile);
+ QObject::connect(
+ m_otrProfile.get(), &QWebEngineProfile::downloadRequested,
+ &m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);
+ }
+ auto profile = offTheRecord ? m_otrProfile.get() : QWebEngineProfile::defaultProfile();
auto mainWindow = new BrowserWindow(this, profile, false);
m_windows.append(mainWindow);
QObject::connect(mainWindow, &QObject::destroyed, [this, mainWindow]() {
diff --git a/examples/webenginewidgets/simplebrowser/browser.h b/examples/webenginewidgets/simplebrowser/browser.h
index fbc8465d2..4c17121df 100644
--- a/examples/webenginewidgets/simplebrowser/browser.h
+++ b/examples/webenginewidgets/simplebrowser/browser.h
@@ -73,6 +73,6 @@ public:
private:
QVector<BrowserWindow*> m_windows;
DownloadManagerWidget m_downloadManagerWidget;
- QWebEngineProfile m_otrProfile;
+ QScopedPointer<QWebEngineProfile> m_otrProfile;
};
#endif // BROWSER_H
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index b0c426232..251ca5ad8 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -29,7 +29,7 @@
\example webenginewidgets/simplebrowser
\title WebEngine Widgets Simple Browser Example
\ingroup webengine-widgetexamples
- \brief A simple browser based on Qt WebEngine Widgets.
+ \brief A simple browser based on \QWE Widgets.
\image simplebrowser.png
@@ -267,10 +267,10 @@
Alternatively we could implement private browsing on the tab-level, with
some tabs in a window in normal mode, others in private mode.
- Implementing private browsing is quite easy using Qt WebEngine. All one has
+ Implementing private browsing is quite easy using \QWE. All one has
to do is to create a new \l{QWebEngineProfile} and use it in the
\l{QWebEnginePage} instead of the default profile. In the example this new
- profile is created and owned by the \c Browser object:
+ profile is owned by the \c Browser object:
\quotefromfile webenginewidgets/simplebrowser/browser.h
\skipto /^class Browser$/
@@ -285,15 +285,24 @@
\printline m_otrProfile
\printline /^\};$/
- The default constructor for \l{QWebEngineProfile} already puts it in
- \e{off-the-record} mode. All that is left to do is to pass the appropriate
- profile down to the appropriate \l QWebEnginePage objects. The \c Browser
- object will hand to each new \c BrowserWindow either the global default
- profile (see \l{QWebEngineProfile::defaultProfile}) or its own
- off-the-record profile:
+ Required profile for \e{private browsing} is created together with its
+ first window. The default constructor for \l{QWebEngineProfile} already
+ puts it in \e{off-the-record} mode.
\quotefromfile webenginewidgets/simplebrowser/browser.cpp
+
\skipto Browser::createWindow
+ \printuntil m_otrProfile.reset
+ \dots
+
+ All that is left to do is to pass the appropriate profile down to the
+ appropriate \l QWebEnginePage objects. The \c Browser object will hand to
+ each new \c BrowserWindow either the global default profile
+ (see \l{QWebEngineProfile::defaultProfile}) or one shared
+ \e{off-the-record} profile instance:
+
+ \dots
+ \skipto m_otrProfile.get
\printuntil mainWindow = new BrowserWindow
\skipto return mainWindow
\printuntil /^\}/
diff --git a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
index ff7b43a1b..ecdb1c818 100644
--- a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
+++ b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
@@ -41,7 +41,7 @@
\section1 Dictionaries
To be able to check the spelling, we need to provide the spellchecker with
- dictionaries. The Qt WebEngine spellchecker supports dictionaries provided by the
+ dictionaries. The \QWE spellchecker supports dictionaries provided by the
\l {Hunspell project} on all platforms and native dictionaries provided by macOS.
In this example, we want to support the English and German languages.
@@ -102,7 +102,7 @@
the actual language display name. We will use that mapping to display names
of dictionaries in the context menu. Spellchecking is disabled by default.
Therefore we also enable spellchecker and set the \e English dictionary.
- When Qt WebEngine's spellcheck service initializes, it will try to load the
+ When \QWE's spellcheck service initializes, it will try to load the
\c bdict dictionaries and to check them for consistency.
Any errors are logged by using the qWarning() function.
diff --git a/examples/webenginewidgets/spellchecker/main.cpp b/examples/webenginewidgets/spellchecker/main.cpp
index c2951fe00..bf056ea9e 100644
--- a/examples/webenginewidgets/spellchecker/main.cpp
+++ b/examples/webenginewidgets/spellchecker/main.cpp
@@ -54,6 +54,7 @@
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
WebView view;
diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
index 9f6add6ae..5c455345b 100644
--- a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
+++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
@@ -40,8 +40,8 @@
cross-browser Javascript API that enables a web page to request that one of
its HTML elements be made to occupy the user's entire screen. It is
commonly used for full screen video playback via the \c <video> element, but
- can in principle be used to display any HTML content in full screen mode. Qt
- WebEngine supports this API, however it is disabled by default. This example
+ can in principle be used to display any HTML content in full screen mode.
+ \QWE supports this API, however it is disabled by default. This example
shows the steps needed to switch it on, including:
\list
@@ -94,7 +94,7 @@
\skipto MainWindow::MainWindow
\printuntil setCentralWidget
- We then configure Qt WebEngine to advertise support for the Fullscreen API:
+ We then configure \QWE to advertise support for the Fullscreen API:
\printline QWebEngineSettings
diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro
index 20c7ead50..0d47aac80 100644
--- a/examples/webenginewidgets/webenginewidgets.pro
+++ b/examples/webenginewidgets/webenginewidgets.pro
@@ -1,5 +1,5 @@
include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginecore
+QT_FOR_CONFIG += webenginecore webenginecore-private
TEMPLATE=subdirs
@@ -7,7 +7,6 @@ SUBDIRS += \
minimal \
contentmanipulation \
cookiebrowser \
- html2pdf \
simplebrowser \
stylesheetbrowser \
videoplayer \
@@ -16,6 +15,10 @@ SUBDIRS += \
qtConfig(webengine-geolocation): SUBDIRS += maps
qtConfig(webengine-webchannel): SUBDIRS += markdowneditor
+qtConfig(webengine-printing-and-pdf) {
+ SUBDIRS += printme html2pdf
+}
+
qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile {
SUBDIRS += spellchecker
} else {
diff --git a/examples/webenginewidgets/webui/doc/src/webui.qdoc b/examples/webenginewidgets/webui/doc/src/webui.qdoc
index 47d9fbad1..949b358a7 100644
--- a/examples/webenginewidgets/webui/doc/src/webui.qdoc
+++ b/examples/webenginewidgets/webui/doc/src/webui.qdoc
@@ -35,8 +35,8 @@
\e {WebUI} demonstrates how to implement a custom scheme in a secure way.
- Aside from the built-in URL schemes, such as \c {http} and \c {qrc}, Qt
- WebEngine may be extended with \e {custom schemes} by creating \e {custom
+ Aside from the built-in URL schemes, such as \c {http} and \c {qrc},
+ \QWE may be extended with \e {custom schemes} by creating \e {custom
scheme handlers}. This example shows:
\list
@@ -111,7 +111,7 @@
made already at the top of the \c {main} function. This is so because custom
schemes need to be registered as early as possible so that that they can be
passed to all subprocesses. Specifically, custom schemes need to be registered
- before any other Qt WebEngine classes are instantiated by the application.
+ before any other \QWE classes are instantiated by the application.
\section1 Handling Requests
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index d7d382a4f..42e5b40c9 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -4,6 +4,10 @@ load(functions)
load(platform)
defineTest(runConfigure) {
+ !qtHaveModule(gui) {
+ skipBuild("QtWebEngine requires QtGui.")
+ return(false)
+ }
!exists(src/3rdparty/chromium) {
skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf
index e6ae263ac..78b56d123 100644
--- a/mkspecs/features/gn_generator.prf
+++ b/mkspecs/features/gn_generator.prf
@@ -26,6 +26,8 @@ isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn)
isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py"
isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py"
+GN_CONTENTS += "import(\"//build/config/jumbo.gni\")"
+
# MOC SETUP
GN_CONTENTS += "moc_source_h_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\","
@@ -118,13 +120,18 @@ GN_CONTENTS += "config(\"$${TARGET}_config\") {"
}
# Stop the barrage of unused variables warnings.
-gcc|clang {
+gcc|clang|clang_cl {
QMAKE_CXXFLAGS += "-Wno-unused-parameter"
QMAKE_CXXFLAGS += "-Wno-unused-variable"
} else:msvc {
QMAKE_CXXFLAGS += /wd4100 /wd4101
}
+# Chromium activates this, but we need it off to be able to compile QFlags
+clang_cl {
+ QMAKE_CXXFLAGS += "-fno-complete-member-pointers"
+}
+
!isEmpty(QMAKE_CXXFLAGS) {
GN_CONTENTS += " cflags_cc = ["
for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
@@ -169,6 +176,26 @@ GN_CONTENTS += "}"
# TARGET SETUP
+GN_CONTENTS += "jumbo_source_set(\"$${TARGET}_MOC\") {"
+GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ]"
+GN_CONTENTS += " configs += [ \"//build/config:precompiled_headers\" ]"
+GN_CONTENTS += " sources = []"
+GN_CONTENTS += " deps = []"
+GN_CONTENTS += " if (moc_source_h_files != []) {"
+GN_CONTENTS += " deps += ["
+GN_CONTENTS += " \":generate_h_mocs\","
+GN_CONTENTS += " ]"
+# Add moc output files to compile
+GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")"
+GN_CONTENTS += " }"
+GN_CONTENTS += " if (moc_source_cpp_files != []) {"
+GN_CONTENTS += " deps += ["
+GN_CONTENTS += " \":generate_cpp_mocs\","
+GN_CONTENTS += " ]"
+GN_CONTENTS += " }"
+GN_CONTENTS += "}"
+
+
TARGET_TYPE = $$getTargetType()
GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {"
@@ -177,7 +204,8 @@ GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {"
for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")"
}
-GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ] "
+GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ]"
+GN_CONTENTS += " configs += [ \"//build/config:precompiled_headers\" ]"
# Source files to compile
GN_CONTENTS += " sources = ["
@@ -220,18 +248,7 @@ win32 {
CONFIG(rtti): GN_CONTENTS += " configs += [\"//build/config/compiler:rtti\"]"
}
-GN_CONTENTS += " if (moc_source_h_files != []) {"
-GN_CONTENTS += " deps += ["
-GN_CONTENTS += " \":generate_h_mocs\","
-GN_CONTENTS += " ]"
-# Add moc output files to compile
-GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")"
-GN_CONTENTS += " }"
-GN_CONTENTS += " if (moc_source_cpp_files != []) {"
-GN_CONTENTS += " deps += ["
-GN_CONTENTS += " \":generate_cpp_mocs\","
-GN_CONTENTS += " ]"
-GN_CONTENTS += " }"
+GN_CONTENTS += " deps += [ \":$${TARGET}_MOC\" ]"
GN_CONTENTS += "}"
GN_CONTENTS += ""
GN_CONTENTS += "if (!defined(core_include_dirs)) {"\
diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
index 9adc02f75..53ea51014 100644
--- a/mkspecs/features/platform.prf
+++ b/mkspecs/features/platform.prf
@@ -26,7 +26,7 @@ defineTest(isPlatformSupported) {
skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
}
!msvc|intel_icl {
- skipBuild("Qt WebEngine on Windows requires MSVC.")
+ skipBuild("Qt WebEngine on Windows requires MSVC or Clang (MSVC mode).")
return(false)
}
!isMinWinSDKVersion(10, 16299): {
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 3d95374cb8de20b3e15538f1ecb5b78bf9d1cdc
+Subproject 0ac2b1fddcd3e1b1e18bf7c7c14a6466deb9ba8
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
index 30ada9357..b6bf9cfc4 100644
--- a/src/buildtools/gn.pro
+++ b/src/buildtools/gn.pro
@@ -18,9 +18,13 @@ build_pass|!debug_and_release {
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
gn_bootstrap = $$system_path($$absolute_path(gn/build/gen.py, $$src_3rd_party_dir))
- gn_configure = $$system_quote($$gn_bootstrap) --no-last-commit-position --out-path $$out_path \
- --cc \"$$which($$QMAKE_CC)\" --cxx \"$$which($$QMAKE_CXX)\" \
- --ld \"$$which($$QMAKE_LINK)\"
+ gn_gen_args = --no-last-commit-position --out-path $$out_path \
+ --cc \"$$which($$QMAKE_CC)\" --cxx \"$$which($$QMAKE_CXX)\" \
+ --ld \"$$which($$QMAKE_LINK)\"
+
+ msvc:!clang_cl: gn_gen_args += --use-lto
+
+ gn_configure = $$system_quote($$gn_bootstrap) $$gn_gen_args
macos {
gn_configure += --isysroot \"$$QMAKE_MAC_SDK_PATH\"
}
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index abdb92e28..abc2bd406 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -58,7 +58,8 @@ QT_END_NAMESPACE
#ifndef QT_NO_OPENGL
#ifdef Q_OS_MACOS
-static bool needsOfflineRendererWorkaround() {
+static bool needsOfflineRendererWorkaround()
+{
size_t hwmodelsize = 0;
if (sysctlbyname("hw.model", nullptr, &hwmodelsize, nullptr, 0) == -1)
@@ -134,4 +135,3 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
#endif // QT_NO_OPENGL
}
} // namespace QtWebEngineCore
-
diff --git a/src/core/api/qwebenginecallback.h b/src/core/api/qwebenginecallback.h
index b981b2afb..49efc50b2 100644
--- a/src/core/api/qwebenginecallback.h
+++ b/src/core/api/qwebenginecallback.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
namespace QtWebEnginePrivate {
-template <typename T>
+template<typename T>
class QWebEngineCallbackPrivateBase : public QSharedData {
public:
QWebEngineCallbackPrivateBase() {}
@@ -62,32 +62,32 @@ public:
virtual void operator()(T) = 0;
};
-template <typename T, typename F>
+template<typename T, typename F>
class QWebEngineCallbackPrivate : public QWebEngineCallbackPrivateBase<T> {
public:
- QWebEngineCallbackPrivate(F callable)
- : m_callable(callable)
- {}
+ QWebEngineCallbackPrivate(F callable) : m_callable(callable) {}
void operator()(T value) override { m_callable(value); }
+
private:
F m_callable;
};
} // namespace QtWebEnginePrivate
-template <typename T>
+template<typename T>
class QWebEngineCallback {
public:
- template <typename F>
+ template<typename F>
QWebEngineCallback(F f)
: d(new QtWebEnginePrivate::QWebEngineCallbackPrivate<T, F>(f))
- { }
- QWebEngineCallback() { }
+ {}
+ QWebEngineCallback() {}
void swap(QWebEngineCallback &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
operator bool() const { return d; }
+
private:
friend class QtWebEngineCore::CallbackDirectory;
- QExplicitlySharedDataPointer<QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> > d;
+ QExplicitlySharedDataPointer<QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T>> d;
};
Q_DECLARE_SHARED(QWebEngineCallback<int>)
diff --git a/src/core/api/qwebenginecallback_p.h b/src/core/api/qwebenginecallback_p.h
index 24b4495df..133a86f6d 100644
--- a/src/core/api/qwebenginecallback_p.h
+++ b/src/core/api/qwebenginecallback_p.h
@@ -62,11 +62,11 @@
#include <type_traits>
// keep in sync with Q_DECLARE_SHARED... in qwebenginecallback.h
-#define FOR_EACH_TYPE(F) \
- F(bool) \
- F(int) \
- F(const QString &) \
- F(const QByteArray &) \
+#define FOR_EACH_TYPE(F) \
+ F(bool) \
+ F(int) \
+ F(const QString &) \
+ F(const QByteArray &) \
F(const QVariant &)
namespace QtWebEngineCore {
@@ -82,7 +82,7 @@ public:
{
// "Cancel" pending callbacks by calling them with an invalid value.
// This guarantees that each callback is called exactly once.
- for (CallbackSharedDataPointerBase * const sharedPtrBase: m_callbackMap) {
+ for (CallbackSharedDataPointerBase *const sharedPtrBase : m_callbackMap) {
Q_ASSERT(sharedPtrBase);
sharedPtrBase->invokeEmpty();
delete sharedPtrBase;
@@ -106,20 +106,18 @@ public:
template<typename T>
void invokeEmpty(const QWebEngineCallback<T> &callback);
-#define DEFINE_INVOKE_FOR_TYPE(Type) \
- void invoke(quint64 callbackId, Type result) { \
- invokeInternal<Type>(callbackId, std::forward<Type>(result)); \
- }
+#define DEFINE_INVOKE_FOR_TYPE(Type) \
+ void invoke(quint64 callbackId, Type result) { invokeInternal<Type>(callbackId, std::forward<Type>(result)); }
FOR_EACH_TYPE(DEFINE_INVOKE_FOR_TYPE)
#undef DEFINE_INVOKE_FOR_TYPE
- template <typename A>
+ template<typename A>
void invokeDirectly(const QWebEngineCallback<typename std::remove_reference<A>::type &> &callback, A &argument)
{
return callback.d.data()->operator()(argument);
}
- template <typename A>
+ template<typename A>
void invokeDirectly(const QWebEngineCallback<typename std::remove_reference<A>::type> &callback, const A &argument)
{
return callback.d.data()->operator()(std::forward<const A &>(argument));
@@ -127,39 +125,45 @@ public:
private:
struct CallbackSharedDataPointerBase {
- virtual ~CallbackSharedDataPointerBase() { }
+ virtual ~CallbackSharedDataPointerBase() {}
virtual void invokeEmpty() = 0;
virtual void doRef() = 0;
virtual void doDeref() = 0;
- virtual operator bool () const = 0;
+ virtual operator bool() const = 0;
};
- template <typename T>
+ template<typename T>
struct CallbackSharedDataPointer : public CallbackSharedDataPointerBase {
- CallbackDirectory* parent;
+ CallbackDirectory *parent;
QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback;
~CallbackSharedDataPointer() { doDeref(); }
- CallbackSharedDataPointer() : parent(0), callback(0) { }
+ CallbackSharedDataPointer() : parent(0), callback(0) {}
CallbackSharedDataPointer(const CallbackSharedDataPointer<T> &other)
- : parent(other.parent), callback(other.callback) { doRef(); }
+ : parent(other.parent), callback(other.callback)
+ {
+ doRef();
+ }
CallbackSharedDataPointer(CallbackDirectory *p, QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *c)
- : parent(p), callback(c) { Q_ASSERT(callback); doRef(); }
+ : parent(p), callback(c)
+ {
+ Q_ASSERT(callback);
+ doRef();
+ }
void invokeEmpty() override;
- operator bool () const override { return callback; }
+ operator bool() const override { return callback; }
private:
void doRef() override;
void doDeref() override;
};
- QHash<quint64, CallbackSharedDataPointerBase*> m_callbackMap;
+ QHash<quint64, CallbackSharedDataPointerBase *> m_callbackMap;
};
template<typename T>
-inline
-void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCallback<T> &callback)
+inline void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCallback<T> &callback)
{
if (!callback.d)
return;
@@ -167,10 +171,9 @@ void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCal
}
template<typename T>
-inline
-void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
+inline void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
{
- CallbackSharedDataPointerBase * const sharedPtrBase = m_callbackMap.take(callbackId);
+ CallbackSharedDataPointerBase *const sharedPtrBase = m_callbackMap.take(callbackId);
if (!sharedPtrBase)
return;
@@ -181,8 +184,7 @@ void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
}
template<typename T>
-inline
-void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback)
+inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback)
{
Q_ASSERT(callback);
using NoRefT = typename std::remove_reference<T>::type;
@@ -192,24 +194,21 @@ void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallba
}
template<>
-inline
-void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<bool> *callback)
+inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<bool> *callback)
{
Q_ASSERT(callback);
(*callback)(false);
}
template<>
-inline
-void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<int> *callback)
+inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<int> *callback)
{
Q_ASSERT(callback);
(*callback)(0);
}
template<typename T>
-inline
-void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
+inline void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
{
if (!callback.d)
return;
@@ -217,9 +216,8 @@ void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
invokeEmptyInternal(callback.d.data());
}
-template <typename T>
-inline
-void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
+template<typename T>
+inline void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
{
if (!callback)
return;
@@ -227,9 +225,8 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
callback->ref.ref();
}
-template <typename T>
-inline
-void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
+template<typename T>
+inline void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
{
if (!callback)
return;
@@ -237,9 +234,8 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
delete callback;
}
-template <typename T>
-inline
-void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
+template<typename T>
+inline void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
{
if (!callback)
return;
@@ -248,8 +244,7 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
parent->invokeEmptyInternal(callback);
}
-#define CHECK_RELOCATABLE(x) \
- Q_STATIC_ASSERT((QTypeInfoQuery<QWebEngineCallback< x > >::isRelocatable));
+#define CHECK_RELOCATABLE(x) Q_STATIC_ASSERT((QTypeInfoQuery<QWebEngineCallback<x>>::isRelocatable));
FOR_EACH_TYPE(CHECK_RELOCATABLE)
#undef CHECK_RELOCATABLE
diff --git a/src/core/api/qwebengineclientcertificatestore.cpp b/src/core/api/qwebengineclientcertificatestore.cpp
index 854628b29..84f273328 100644
--- a/src/core/api/qwebengineclientcertificatestore.cpp
+++ b/src/core/api/qwebengineclientcertificatestore.cpp
@@ -49,13 +49,6 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(ssl)
/*!
- \class QWebEngineClientCertificateStore::Entry
- \inmodule QtWebEngineCore
- \since 5.13
- \brief This structure holds the certificate and the private key.
-*/
-
-/*!
\class QWebEngineClientCertificateStore
\inmodule QtWebEngineCore
\since 5.13
@@ -68,9 +61,8 @@ QT_BEGIN_NAMESPACE
*/
QWebEngineClientCertificateStore::QWebEngineClientCertificateStore(QtWebEngineCore::ClientCertificateStoreData *storeData)
- : m_storeData(storeData)
-{
-}
+ : m_storeData(storeData)
+{}
/*!
Destroys this QWebEngineClientCertificateStore object.
diff --git a/src/core/api/qwebengineclientcertificatestore.h b/src/core/api/qwebengineclientcertificatestore.h
index 68705e80b..a4c83bb2e 100644
--- a/src/core/api/qwebengineclientcertificatestore.h
+++ b/src/core/api/qwebengineclientcertificatestore.h
@@ -49,7 +49,7 @@
namespace QtWebEngineCore {
struct ClientCertificateStoreData;
class ProfileAdapter;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 3897fb128..40594b9c0 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -47,15 +47,14 @@
#include <QByteArray>
#include <QUrl>
-
namespace {
-inline GURL toGurl(const QUrl& url)
+inline GURL toGurl(const QUrl &url)
{
return GURL(url.toString().toStdString());
}
-}
+} // namespace
QT_BEGIN_NAMESPACE
@@ -68,8 +67,7 @@ QWebEngineCookieStorePrivate::QWebEngineCookieStorePrivate(QWebEngineCookieStore
, m_deleteAllCookiesPending(false)
, m_getAllCookiesPending(false)
, delegate(0)
-{
-}
+{}
void QWebEngineCookieStorePrivate::processPendingUserCookies()
{
@@ -112,7 +110,8 @@ void QWebEngineCookieStorePrivate::rejectPendingUserCookies()
m_pendingUserCookies.clear();
}
-void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin)
+void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie,
+ const QUrl &origin)
{
const quint64 currentCallbackId = callback ? m_nextCallbackId++ : static_cast<quint64>(CallbackDirectory::NoCallbackId);
@@ -201,7 +200,7 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
toGurl(firstPartyUrl),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
- QWebEngineCookieStore::FilterRequest request = { firstPartyUrl, url, thirdParty, false, 0};
+ QWebEngineCookieStore::FilterRequest request = { firstPartyUrl, url, thirdParty, false, 0 };
return filterCallback(request);
}
@@ -249,10 +248,7 @@ QWebEngineCookieStore::QWebEngineCookieStore(QObject *parent)
Destroys this QWebEngineCookieStore object.
*/
-QWebEngineCookieStore::~QWebEngineCookieStore()
-{
-
-}
+QWebEngineCookieStore::~QWebEngineCookieStore() {}
/*!
Adds \a cookie to the cookie store.
@@ -298,7 +294,8 @@ void QWebEngineCookieStore::loadAllCookies()
//TODO: use callbacks or delete dummy ones
if (d_ptr->m_getAllCookiesPending)
return;
- d_ptr->callbackDirectory.registerCallback(CallbackDirectory::GetAllCookiesCallbackId, QWebEngineCallback<const QByteArray&>());
+ d_ptr->callbackDirectory.registerCallback(CallbackDirectory::GetAllCookiesCallbackId,
+ QWebEngineCallback<const QByteArray &>());
//this will trigger cookieAdded signal
d_ptr->getAllCookies();
}
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index 36bb64ccf..3d313ac23 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -52,7 +52,7 @@
namespace QtWebEngineCore {
class ProfileAdapter;
class CookieMonsterDelegateQt;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -93,6 +93,6 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QWebEngineCookieStore*)
+Q_DECLARE_METATYPE(QWebEngineCookieStore *)
#endif // QWEBENGINECOOKIESTORE_H
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index 3df0e3590..a79e2b095 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -66,8 +66,7 @@ class CookieMonsterDelegateQt;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate
-{
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
Q_DECLARE_PUBLIC(QWebEngineCookieStore)
struct CookieData {
quint64 callbackId;
@@ -76,9 +75,10 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate
};
friend class QTypeInfo<CookieData>;
QWebEngineCookieStore *q_ptr;
+
public:
QtWebEngineCore::CallbackDirectory callbackDirectory;
- std::function<bool(const QWebEngineCookieStore::FilterRequest&)> filterCallback;
+ std::function<bool(const QWebEngineCookieStore::FilterRequest &)> filterCallback;
QVector<CookieData> m_pendingUserCookies;
quint64 m_nextCallbackId;
bool m_deleteSessionCookiesPending;
diff --git a/src/core/api/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp
index b64af4466..3395cc99f 100644
--- a/src/core/api/qwebenginehttprequest.cpp
+++ b/src/core/api/qwebenginehttprequest.cpp
@@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE
\value Post The POST method.
*/
-class QWebEngineHttpRequestPrivate : public QSharedData
-{
+class QWebEngineHttpRequestPrivate : public QSharedData {
public:
QUrl url;
QWebEngineHttpRequest::Method method;
@@ -77,23 +76,18 @@ public:
Headers headers;
QByteArray postData;
- inline QWebEngineHttpRequestPrivate()
- {
- }
+ QWebEngineHttpRequestPrivate() {}
- ~QWebEngineHttpRequestPrivate()
- {
- }
+ ~QWebEngineHttpRequestPrivate() {}
- QWebEngineHttpRequestPrivate(const QWebEngineHttpRequestPrivate &other)
- : QSharedData(other)
+ QWebEngineHttpRequestPrivate(const QWebEngineHttpRequestPrivate &other) : QSharedData(other)
{
method = other.method;
url = other.url;
headers = other.headers;
}
- inline bool operator==(const QWebEngineHttpRequestPrivate &other) const
+ bool operator==(const QWebEngineHttpRequestPrivate &other) const
{
return method == other.method
&& url == other.url
@@ -128,10 +122,7 @@ QWebEngineHttpRequest::QWebEngineHttpRequest(const QUrl &url,
/*!
Creates a copy of \a other.
*/
-QWebEngineHttpRequest::QWebEngineHttpRequest(const QWebEngineHttpRequest &other)
- : d(other.d)
-{
-}
+QWebEngineHttpRequest::QWebEngineHttpRequest(const QWebEngineHttpRequest &other) : d(other.d) {}
/*!
Disposes of the QWebEngineHttpRequest object.
@@ -207,7 +198,6 @@ QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url,
return result;
}
-
/*!
Returns the method this WebEngine request is using.
@@ -291,8 +281,7 @@ bool QWebEngineHttpRequest::hasHeader(const QByteArray &headerName) const
*/
QByteArray QWebEngineHttpRequest::header(const QByteArray &headerName) const
{
- QWebEngineHttpRequestPrivate::Headers::ConstIterator it =
- d->findHeader(headerName);
+ QWebEngineHttpRequestPrivate::Headers::ConstIterator it = d->findHeader(headerName);
if (it != d->headers.constEnd())
return it->second;
return QByteArray();
@@ -334,16 +323,15 @@ void QWebEngineHttpRequest::unsetHeader(const QByteArray &key)
d->setHeader(key, QByteArray());
}
-QWebEngineHttpRequestPrivate::Headers::ConstIterator
-QWebEngineHttpRequestPrivate::findHeader(const QByteArray &key) const
+QWebEngineHttpRequestPrivate::Headers::ConstIterator QWebEngineHttpRequestPrivate::findHeader(const QByteArray &key) const
{
Headers::ConstIterator it = headers.constBegin();
Headers::ConstIterator end = headers.constEnd();
- for ( ; it != end; ++it)
+ for (; it != end; ++it)
if (qstricmp(it->first.constData(), key.constData()) == 0)
return it;
- return end; // not found
+ return end; // not found
}
QWebEngineHttpRequestPrivate::Headers QWebEngineHttpRequestPrivate::allHeaders() const
@@ -355,9 +343,8 @@ QVector<QByteArray> QWebEngineHttpRequestPrivate::headersKeys() const
{
QVector<QByteArray> result;
result.reserve(headers.size());
- Headers::ConstIterator it = headers.constBegin(),
- end = headers.constEnd();
- for ( ; it != end; ++it)
+ Headers::ConstIterator it = headers.constBegin(), end = headers.constEnd();
+ for (; it != end; ++it)
result << it->first;
return result;
@@ -385,8 +372,7 @@ void QWebEngineHttpRequestPrivate::unsetHeader(const QByteArray &key)
auto firstEqualsKey = [&key](const HeaderPair &header) {
return qstricmp(header.first.constData(), key.constData()) == 0;
};
- headers.erase(std::remove_if(headers.begin(), headers.end(), firstEqualsKey),
- headers.end());
+ headers.erase(std::remove_if(headers.begin(), headers.end(), firstEqualsKey), headers.end());
}
/*!
@@ -408,7 +394,7 @@ void QWebEngineHttpRequestPrivate::setHeaderInternal(const QByteArray &key, cons
unsetHeader(key);
if (value.isNull())
- return; // only wanted to erase key
+ return; // only wanted to erase key
HeaderPair pair;
pair.first = key;
diff --git a/src/core/api/qwebenginehttprequest.h b/src/core/api/qwebenginehttprequest.h
index 8735dfb8e..1c4d7837b 100644
--- a/src/core/api/qwebenginehttprequest.h
+++ b/src/core/api/qwebenginehttprequest.h
@@ -49,11 +49,9 @@
QT_BEGIN_NAMESPACE
-
class QWebEngineHttpRequestPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest
-{
+class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest {
public:
enum Method {
Get,
@@ -61,22 +59,23 @@ public:
};
explicit QWebEngineHttpRequest(const QUrl &url = QUrl(),
- const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get);
+ const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get);
QWebEngineHttpRequest(const QWebEngineHttpRequest &other);
~QWebEngineHttpRequest();
#ifdef Q_COMPILER_RVALUE_REFS
- QWebEngineHttpRequest &operator=(QWebEngineHttpRequest &&other) Q_DECL_NOTHROW { swap(other);
- return *this; }
+ QWebEngineHttpRequest &operator=(QWebEngineHttpRequest &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
#endif
QWebEngineHttpRequest &operator=(const QWebEngineHttpRequest &other);
- static QWebEngineHttpRequest postRequest(const QUrl &url,
- const QMap<QString, QString> &postData);
+ static QWebEngineHttpRequest postRequest(const QUrl &url, const QMap<QString, QString> &postData);
void swap(QWebEngineHttpRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QWebEngineHttpRequest &other) const;
- inline bool operator!=(const QWebEngineHttpRequest &other) const
- { return !operator==(other); }
+ inline bool operator!=(const QWebEngineHttpRequest &other) const { return !operator==(other); }
Method method() const;
void setMethod(QWebEngineHttpRequest::Method method);
diff --git a/src/core/api/qwebenginemessagepumpscheduler_p.h b/src/core/api/qwebenginemessagepumpscheduler_p.h
index 46ed62f54..07b2ca203 100644
--- a/src/core/api/qwebenginemessagepumpscheduler_p.h
+++ b/src/core/api/qwebenginemessagepumpscheduler_p.h
@@ -59,8 +59,7 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject
-{
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject {
Q_OBJECT
public:
QWebEngineMessagePumpScheduler(std::function<void()> callback);
diff --git a/src/core/api/qwebenginenotification.cpp b/src/core/api/qwebenginenotification.cpp
index 0b1d48ce9..f91eabd25 100644
--- a/src/core/api/qwebenginenotification.cpp
+++ b/src/core/api/qwebenginenotification.cpp
@@ -90,13 +90,11 @@ public:
*/
QWebEngineNotification::QWebEngineNotification(const QSharedPointer<UserNotificationController> &controller)
: d_ptr(new QWebEngineNotificationPrivate(this, controller))
-{ }
+{}
/*! \internal
*/
-QWebEngineNotification::~QWebEngineNotification()
-{
-}
+QWebEngineNotification::~QWebEngineNotification() {}
/*!
Returns \c true if the two notifications belong to the same message chain.
diff --git a/src/core/api/qwebenginequotarequest.cpp b/src/core/api/qwebenginequotarequest.cpp
index 49c9f041f..7686d0806 100644
--- a/src/core/api/qwebenginequotarequest.cpp
+++ b/src/core/api/qwebenginequotarequest.cpp
@@ -64,8 +64,7 @@ QT_BEGIN_NAMESPACE
/*! \internal */
QWebEngineQuotaRequest::QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController> controller)
: d_ptr(controller)
-{
-}
+{}
/*!
Rejects a request for larger persistent storage.
diff --git a/src/core/api/qwebenginequotarequest.h b/src/core/api/qwebenginequotarequest.h
index 1f6333b3b..da72116c8 100644
--- a/src/core/api/qwebenginequotarequest.h
+++ b/src/core/api/qwebenginequotarequest.h
@@ -47,7 +47,7 @@
namespace QtWebEngineCore {
class QuotaPermissionContextQt;
class QuotaRequestController;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -63,6 +63,7 @@ public:
qint64 requestedSize() const;
bool operator==(const QWebEngineQuotaRequest &that) const { return d_ptr == that.d_ptr; }
bool operator!=(const QWebEngineQuotaRequest &that) const { return d_ptr != that.d_ptr; }
+
private:
QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController>);
friend QtWebEngineCore::QuotaPermissionContextQt;
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp b/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
index 1921f78f4..a3960327d 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
/*! \internal */
QWebEngineRegisterProtocolHandlerRequest::QWebEngineRegisterProtocolHandlerRequest(
- QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr)
+ QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr)
: d_ptr(std::move(d_ptr))
{}
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.h b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
index 281e81e73..67caf1590 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.h
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
@@ -47,7 +47,7 @@
namespace QtWebEngineCore {
class RegisterProtocolHandlerRequestController;
class WebContentsDelegateQt;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -63,9 +63,9 @@ public:
QString scheme() const;
bool operator==(const QWebEngineRegisterProtocolHandlerRequest &that) const { return d_ptr == that.d_ptr; }
bool operator!=(const QWebEngineRegisterProtocolHandlerRequest &that) const { return d_ptr != that.d_ptr; }
+
private:
- QWebEngineRegisterProtocolHandlerRequest(
- QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>);
+ QWebEngineRegisterProtocolHandlerRequest(QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>);
friend QtWebEngineCore::WebContentsDelegateQt;
QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr;
};
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index dc2d07740..3cbb4da17 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -68,8 +68,10 @@ ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::RESOURCE
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::FormSubmittedNavigation, QWebEngineUrlRequestInfo::NavigationTypeFormSubmitted)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::BackForwardNavigation, QWebEngineUrlRequestInfo::NavigationTypeBackForward)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::FormSubmittedNavigation,
+ QWebEngineUrlRequestInfo::NavigationTypeFormSubmitted)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::BackForwardNavigation,
+ QWebEngineUrlRequestInfo::NavigationTypeBackForward)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::ReloadNavigation, QWebEngineUrlRequestInfo::NavigationTypeReload)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, QWebEngineUrlRequestInfo::NavigationTypeOther)
@@ -82,7 +84,7 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q
The QWebEngineUrlRequestInfo is useful for setting extra header fields for requests
or for redirecting certain requests without payload data to another URL.
This class cannot be instantiated or copied by the user, instead it will
- be created by Qt WebEngine and sent through the virtual function
+ be created by \QWE and sent through the virtual function
QWebEngineUrlRequestInterceptor::interceptRequest() if an interceptor has been set.
*/
@@ -124,8 +126,9 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q
execution of this function is finished.
*/
-
-QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource, QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu, const QByteArray &m)
+QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
+ QWebEngineUrlRequestInfo::NavigationType navigation,
+ const QUrl &u, const QUrl &fpu, const QByteArray &m)
: resourceType(resource)
, navigationType(navigation)
, shouldBlockRequest(false)
@@ -133,31 +136,24 @@ QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRe
, firstPartyUrl(fpu)
, method(m)
, changed(false)
-{
-}
+{}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p)
- : d_ptr(p.d_ptr.take())
-{
-}
+QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p) : d_ptr(p.d_ptr.take()) {}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::~QWebEngineUrlRequestInfo()
-{
-}
+QWebEngineUrlRequestInfo::~QWebEngineUrlRequestInfo() {}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPrivate *p)
- : d_ptr(p)
+QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPrivate *p) : d_ptr(p)
{
d_ptr->q_ptr = this;
}
@@ -247,7 +243,6 @@ QUrl QWebEngineUrlRequestInfo::firstPartyUrl() const
return d_ptr->firstPartyUrl;
}
-
/*!
Returns the HTTP method of the request (for example, GET or POST).
*/
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index f37693cda..cf5a4801d 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -48,7 +48,7 @@
namespace QtWebEngineCore {
class NetworkDelegateQt;
class URLRequestNotification;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h
index 9afd04398..9d795b2b5 100644
--- a/src/core/api/qwebengineurlrequestinfo_p.h
+++ b/src/core/api/qwebengineurlrequestinfo_p.h
@@ -65,15 +65,12 @@ class URLRequest;
QT_BEGIN_NAMESPACE
-class QWebEngineUrlRequestInfoPrivate
-{
+class QWebEngineUrlRequestInfoPrivate {
Q_DECLARE_PUBLIC(QWebEngineUrlRequestInfo)
public:
- QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource
- , QWebEngineUrlRequestInfo::NavigationType navigation
- , const QUrl &u
- , const QUrl &fpu
- , const QByteArray &m);
+ QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
+ QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu,
+ const QByteArray &m);
QWebEngineUrlRequestInfo::ResourceType resourceType;
QWebEngineUrlRequestInfo::NavigationType navigationType;
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index 027486b40..4d3020306 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -50,15 +50,11 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject
-{
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject {
Q_OBJECT
Q_DISABLE_COPY(QWebEngineUrlRequestInterceptor)
public:
- explicit QWebEngineUrlRequestInterceptor(QObject *p = nullptr)
- : QObject (p)
- {
- }
+ explicit QWebEngineUrlRequestInterceptor(QObject *p = nullptr) : QObject(p) {}
virtual void interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
};
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp
index bc860b3b3..3bb9d1732 100644
--- a/src/core/api/qwebengineurlrequestjob.cpp
+++ b/src/core/api/qwebengineurlrequestjob.cpp
@@ -84,11 +84,10 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QWebEngineUrlRequestJob::QWebEngineUrlRequestJob(URLRequestCustomJobDelegate * p)
+QWebEngineUrlRequestJob::QWebEngineUrlRequestJob(URLRequestCustomJobDelegate *p)
: QObject(p) // owned by the jobdelegate and deleted when the job is done
, d_ptr(p)
-{
-}
+{}
/*!
\internal
diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h
index dee09b6e1..6d4a9e734 100644
--- a/src/core/api/qwebengineurlrequestjob.h
+++ b/src/core/api/qwebengineurlrequestjob.h
@@ -49,7 +49,7 @@
namespace QtWebEngineCore {
class URLRequestCustomJobDelegate;
class URLRequestCustomJobProxy;
-} // namespace
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -83,7 +83,7 @@ private:
QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate *);
friend class QtWebEngineCore::URLRequestCustomJobProxy;
- QtWebEngineCore::URLRequestCustomJobDelegate* d_ptr;
+ QtWebEngineCore::URLRequestCustomJobDelegate *d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlscheme.cpp b/src/core/api/qwebengineurlscheme.cpp
index 9f7288f2d..f4efad717 100644
--- a/src/core/api/qwebengineurlscheme.cpp
+++ b/src/core/api/qwebengineurlscheme.cpp
@@ -48,8 +48,7 @@ QT_BEGIN_NAMESPACE
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::Path, url::SCHEME_WITHOUT_AUTHORITY)
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::Host, url::SCHEME_WITH_HOST)
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::HostAndPort, url::SCHEME_WITH_HOST_AND_PORT)
-ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation,
- url::SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION)
+ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation, url::SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION)
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::PortUnspecified, url::PORT_UNSPECIFIED)
@@ -88,7 +87,7 @@ public:
URLs.
Custom URL schemes must be configured early at application startup, before
- creating any Qt WebEngine classes. In general this means the schemes need to be configured before
+ creating any \QWE classes. In general this means the schemes need to be configured before
a QGuiApplication or QApplication instance is created.
Every registered scheme configuration applies globally to all profiles.
@@ -193,10 +192,7 @@ public:
Content-Security-Policy checks.
*/
-QWebEngineUrlScheme::QWebEngineUrlScheme(QWebEngineUrlSchemePrivate *d)
- : d(d)
-{
-}
+QWebEngineUrlScheme::QWebEngineUrlScheme(QWebEngineUrlSchemePrivate *d) : d(d) {}
/*!
Constructs a web engine URL scheme with default values.
@@ -378,6 +374,11 @@ void QWebEngineUrlScheme::registerScheme(const QWebEngineUrlScheme &scheme)
return;
}
+ if (url::IsStandard(scheme.d->name.data(), url::Component(0, scheme.d->name.size()))) {
+ qWarning() << "QWebEngineUrlScheme::registerScheme: Scheme" << scheme.name() << "is a standard scheme";
+ return;
+ }
+
if (g_schemesLocked) {
qWarning() << "QWebEngineUrlScheme::registerScheme: Too late to register scheme" << scheme.name();
return;
@@ -394,7 +395,7 @@ void QWebEngineUrlScheme::registerScheme(const QWebEngineUrlScheme &scheme)
*/
QWebEngineUrlScheme QWebEngineUrlScheme::schemeByName(const QByteArray &name)
{
- base::StringPiece namePiece{name.data(), static_cast<size_t>(name.size())};
+ base::StringPiece namePiece{ name.data(), static_cast<size_t>(name.size()) };
if (const url::CustomScheme *cs = url::CustomScheme::FindScheme(namePiece))
return QWebEngineUrlScheme(new QWebEngineUrlSchemePrivate(*cs));
return QWebEngineUrlScheme();
diff --git a/src/core/api/qwebengineurlscheme.h b/src/core/api/qwebengineurlscheme.h
index f3ceb0596..095b47320 100644
--- a/src/core/api/qwebengineurlscheme.h
+++ b/src/core/api/qwebengineurlscheme.h
@@ -46,7 +46,9 @@
#include <QtCore/qobjectdefs.h>
#include <QtCore/qshareddata.h>
-namespace QtWebEngineCore { class WebEngineContext; }
+namespace QtWebEngineCore {
+class WebEngineContext;
+}
QT_BEGIN_NAMESPACE
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index be80241f1..09c5b08cb 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -58,7 +58,7 @@ public:
QWebEngineUrlSchemeHandler(QObject *parent = Q_NULLPTR);
~QWebEngineUrlSchemeHandler();
- virtual void requestStarted(QWebEngineUrlRequestJob*) = 0;
+ virtual void requestStarted(QWebEngineUrlRequestJob *) = 0;
private:
Q_DISABLE_COPY(QWebEngineUrlSchemeHandler)
diff --git a/src/core/clipboard_change_observer.h b/src/core/clipboard_change_observer.h
new file mode 100644
index 000000000..f9b33fc93
--- /dev/null
+++ b/src/core/clipboard_change_observer.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 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$
+**
+****************************************************************************/
+
+#ifndef CLIPBOARD_CHANGE_OBSERVER_H
+#define CLIPBOARD_CHANGE_OBSERVER_H
+
+#include <QClipboard>
+#include <QMap>
+#include <QObject>
+
+namespace QtWebEngineCore {
+
+class ClipboardChangeObserver : public QObject {
+ Q_OBJECT
+public:
+ ClipboardChangeObserver();
+ quint64 getSequenceNumber(QClipboard::Mode mode) { return sequenceNumber.value(mode); }
+
+private Q_SLOTS:
+ void trackChange(QClipboard::Mode mode);
+
+private:
+ QMap<QClipboard::Mode, quint64> sequenceNumber;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // CLIPBOARD_CHANGE_OBSERVER_H
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index d7fa225cd..f4a14570a 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -42,15 +42,15 @@
// found in the LICENSE.Chromium file.
#include "clipboard_qt.h"
-#include "ui/base/clipboard/clipboard.h"
-#include "ui/base/clipboard/clipboard_constants.h"
-#include "ui/base/clipboard/clipboard_format_type.h"
-
+#include "clipboard_change_observer.h"
#include "type_conversion.h"
#include "base/logging.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/custom_data_helper.h"
+#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
#include <QGuiApplication>
#include <QImage>
@@ -91,12 +91,13 @@ QMimeData *getUncommittedData()
return uncommittedData.data();
}
-} // namespace
+} // namespace
namespace ui {
// Factory function
-Clipboard* Clipboard::Create() {
+Clipboard *Clipboard::Create()
+{
return new ClipboardQt;
}
@@ -104,7 +105,7 @@ Clipboard* Clipboard::Create() {
namespace QtWebEngineCore {
-void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap& objects)
+void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap &objects)
{
DCHECK(CalledOnValidThread());
DCHECK(IsSupportedClipboardType(type));
@@ -114,7 +115,9 @@ void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap& objects)
// Commit the accumulated data.
if (uncommittedData)
- QGuiApplication::clipboard()->setMimeData(uncommittedData.take(), type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ QGuiApplication::clipboard()->setMimeData(uncommittedData.take(),
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard
+ : QClipboard::Selection);
if (type == ui::CLIPBOARD_TYPE_COPY_PASTE && IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) {
ObjectMap::const_iterator text_iter = objects.find(CBF_TEXT);
@@ -126,17 +129,17 @@ void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap& objects)
}
}
-void ClipboardQt::WriteText(const char* text_data, size_t text_len)
+void ClipboardQt::WriteText(const char *text_data, size_t text_len)
{
getUncommittedData()->setText(QString::fromUtf8(text_data, text_len));
}
-void ClipboardQt::WriteHTML(const char* markup_data, size_t markup_len, const char* url_data, size_t url_len)
+void ClipboardQt::WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len)
{
getUncommittedData()->setHtml(QString::fromUtf8(markup_data, markup_len));
}
-void ClipboardQt::WriteRTF(const char* rtf_data, size_t data_len)
+void ClipboardQt::WriteRTF(const char *rtf_data, size_t data_len)
{
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeRTF), QByteArray(rtf_data, data_len));
}
@@ -146,12 +149,12 @@ void ClipboardQt::WriteWebSmartPaste()
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeWebkitSmartPaste), QByteArray());
}
-void ClipboardQt::WriteBitmap(const SkBitmap& bitmap)
+void ClipboardQt::WriteBitmap(const SkBitmap &bitmap)
{
getUncommittedData()->setImageData(toQImage(bitmap).copy());
}
-void ClipboardQt::WriteBookmark(const char* title_data, size_t title_len, const char* url_data, size_t url_len)
+void ClipboardQt::WriteBookmark(const char *title_data, size_t title_len, const char *url_data, size_t url_len)
{
// FIXME: Untested, seems to be used only for drag-n-drop.
// Write as a mozilla url (UTF16: URL, newline, title).
@@ -159,29 +162,32 @@ void ClipboardQt::WriteBookmark(const char* title_data, size_t title_len, const
QString title = QString::fromUtf8(title_data, title_len);
QByteArray data;
- data.append(reinterpret_cast<const char*>(url.utf16()), url.size() * 2);
+ data.append(reinterpret_cast<const char *>(url.utf16()), url.size() * 2);
data.append('\n');
- data.append(reinterpret_cast<const char*>(title.utf16()), title.size() * 2);
+ data.append(reinterpret_cast<const char *>(title.utf16()), title.size() * 2);
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeMozillaURL), data);
}
-void ClipboardQt::WriteData(const ui::ClipboardFormatType& format, const char* data_data, size_t data_len)
+void ClipboardQt::WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len)
{
getUncommittedData()->setData(QString::fromStdString(format.ToString()), QByteArray(data_data, data_len));
}
-bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType& format, ui::ClipboardType type) const
+bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardType type) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
return mimeData && mimeData->hasFormat(QString::fromStdString(format.ToString()));
}
void ClipboardQt::Clear(ui::ClipboardType type)
{
- QGuiApplication::clipboard()->clear(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ QGuiApplication::clipboard()->clear(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard
+ : QClipboard::Selection);
}
-void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16>* types, bool* contains_filenames) const
+void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16> *types,
+ bool *contains_filenames) const
{
if (!types || !contains_filenames) {
NOTREACHED();
@@ -189,7 +195,8 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::s
}
types->clear();
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
if (mimeData->hasImage() && !mimeData->formats().contains(QStringLiteral("image/png")))
@@ -203,22 +210,24 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::s
ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
}
-
-void ClipboardQt::ReadText(ui::ClipboardType type, base::string16* result) const
+void ClipboardQt::ReadText(ui::ClipboardType type, base::string16 *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (mimeData)
*result = toString16(mimeData->text());
}
-void ClipboardQt::ReadAsciiText(ui::ClipboardType type, std::string* result) const
+void ClipboardQt::ReadAsciiText(ui::ClipboardType type, std::string *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (mimeData)
*result = mimeData->text().toStdString();
}
-void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::string* src_url, uint32_t* fragment_start, uint32_t* fragment_end) const
+void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16 *markup, std::string *src_url,
+ uint32_t *fragment_start, uint32_t *fragment_end) const
{
markup->clear();
if (src_url)
@@ -226,16 +235,18 @@ void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::
*fragment_start = 0;
*fragment_end = 0;
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
*markup = toString16(mimeData->html());
*fragment_end = static_cast<uint32_t>(markup->length());
}
-void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string* result) const
+void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
const QByteArray byteArray = mimeData->data(QString::fromLatin1(ui::kMimeTypeRTF));
@@ -244,7 +255,8 @@ void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string* result) const
SkBitmap ClipboardQt::ReadImage(ui::ClipboardType type) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return SkBitmap();
QImage image = qvariant_cast<QImage>(mimeData->imageData());
@@ -267,21 +279,22 @@ SkBitmap ClipboardQt::ReadImage(ui::ClipboardType type) const
return bitmap;
}
-void ClipboardQt::ReadCustomData(ui::ClipboardType clipboard_type, const base::string16& type, base::string16* result) const
+void ClipboardQt::ReadCustomData(ui::ClipboardType clipboard_type, const base::string16 &type, base::string16 *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(clipboard_type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ clipboard_type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
const QByteArray customData = mimeData->data(QString::fromLatin1(ui::kMimeTypeWebCustomData));
ui::ReadCustomDataForType(customData.constData(), customData.size(), type, result);
}
-void ClipboardQt::ReadBookmark(base::string16* title, std::string* url) const
+void ClipboardQt::ReadBookmark(base::string16 *title, std::string *url) const
{
NOTIMPLEMENTED();
}
-void ClipboardQt::ReadData(const ui::ClipboardFormatType& format, std::string* result) const
+void ClipboardQt::ReadData(const ui::ClipboardFormatType &format, std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData();
if (!mimeData)
@@ -292,7 +305,8 @@ void ClipboardQt::ReadData(const ui::ClipboardFormatType& format, std::string* r
uint64_t ClipboardQt::GetSequenceNumber(ui::ClipboardType type) const
{
- return clipboardChangeObserver()->getSequenceNumber(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ return clipboardChangeObserver()->getSequenceNumber(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard
+ : QClipboard::Selection);
}
-} // namespace QtWebEngineCore
+} // namespace QtWebEngineCore
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index d5fa35af6..7884da167 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -42,57 +42,36 @@
#include "ui/base/clipboard/clipboard.h"
-#include <QClipboard>
-#include <QMap>
-#include <QObject>
-
namespace QtWebEngineCore {
-class ClipboardChangeObserver : public QObject {
- Q_OBJECT
-public:
- ClipboardChangeObserver();
- quint64 getSequenceNumber(QClipboard::Mode mode) {
- return sequenceNumber.value(mode);
- }
-
-private Q_SLOTS:
- void trackChange(QClipboard::Mode mode);
-
-private:
- QMap<QClipboard::Mode, quint64> sequenceNumber;
-};
-
class ClipboardQt : public ui::Clipboard {
public:
uint64_t GetSequenceNumber(ui::ClipboardType type) const override;
- bool IsFormatAvailable(const ui::ClipboardFormatType& format, ui::ClipboardType type) const override;
+ bool IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardType type) const override;
void Clear(ui::ClipboardType type) override;
- void ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16>* types, bool* contains_filenames) const override;
- void ReadText(ui::ClipboardType type, base::string16* result) const override;
- void ReadAsciiText(ui::ClipboardType type, std::string* result) const override;
- void ReadHTML(ui::ClipboardType type,
- base::string16* markup,
- std::string* src_url,
- uint32_t* fragment_start,
- uint32_t* fragment_end) const override;
- void ReadRTF(ui::ClipboardType type, std::string* result) const override;
+ void ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16> *types,
+ bool *contains_filenames) const override;
+ void ReadText(ui::ClipboardType type, base::string16 *result) const override;
+ void ReadAsciiText(ui::ClipboardType type, std::string *result) const override;
+ void ReadHTML(ui::ClipboardType type, base::string16 *markup, std::string *src_url, uint32_t *fragment_start,
+ uint32_t *fragment_end) const override;
+ void ReadRTF(ui::ClipboardType type, std::string *result) const override;
SkBitmap ReadImage(ui::ClipboardType type) const override;
- void ReadCustomData(ui::ClipboardType clipboard_type, const base::string16& type, base::string16* result) const override;
- void ReadBookmark(base::string16* title, std::string* url) const override;
- void ReadData(const ui::ClipboardFormatType& format, std::string* result) const override;
+ void ReadCustomData(ui::ClipboardType clipboard_type, const base::string16 &type, base::string16 *result) const override;
+ void ReadBookmark(base::string16 *title, std::string *url) const override;
+ void ReadData(const ui::ClipboardFormatType &format, std::string *result) const override;
- void OnPreShutdown() override { }
+ void OnPreShutdown() override {}
protected:
- void WriteObjects(ui::ClipboardType type, const ObjectMap& objects) override;
- void WriteText(const char* text_data, size_t text_len) override;
- void WriteHTML(const char* markup_data, size_t markup_len, const char* url_data, size_t url_len) override;
- void WriteRTF(const char* rtf_data, size_t data_len) override;
- void WriteBookmark(const char* title_data, size_t title_len, const char* url_data, size_t url_len) override;
+ void WriteObjects(ui::ClipboardType type, const ObjectMap &objects) override;
+ void WriteText(const char *text_data, size_t text_len) override;
+ void WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len) override;
+ void WriteRTF(const char *rtf_data, size_t data_len) override;
+ void WriteBookmark(const char *title_data, size_t title_len, const char *url_data, size_t url_len) override;
void WriteWebSmartPaste() override;
- void WriteBitmap(const SkBitmap& bitmap) override;
- void WriteData(const ui::ClipboardFormatType& format, const char* data_data, size_t data_len) override;
+ void WriteBitmap(const SkBitmap &bitmap) override;
+ void WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len) override;
};
} // namespace QtWebEngineCore
diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index cc45db9e7..56693961c 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -56,7 +56,7 @@ Compositor::Compositor(content::RenderWidgetHost *host)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI});
+ m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE});
m_beginFrameSource =
std::make_unique<viz::DelayBasedBeginFrameSource>(
std::make_unique<viz::DelayBasedTimeSource>(m_taskRunner.get()),
diff --git a/src/core/compositor/compositor_resource_tracker.cpp b/src/core/compositor/compositor_resource_tracker.cpp
index 6530f3249..73242c693 100644
--- a/src/core/compositor/compositor_resource_tracker.cpp
+++ b/src/core/compositor/compositor_resource_tracker.cpp
@@ -213,6 +213,9 @@ void CompositorResourceTracker::scheduleUpdateMailboxes(std::vector<CompositorRe
#if QT_CONFIG(opengl)
scoped_refptr<base::SingleThreadTaskRunner> gpuTaskRunner = gpu_task_runner();
DCHECK(gpuTaskRunner);
+ thread_local bool currentThreadIsGpu = gpuTaskRunner->BelongsToCurrentThread();
+ if (currentThreadIsGpu)
+ return updateMailboxes(std::move(resources));
gpuTaskRunner->PostTask(
FROM_HERE,
base::BindOnce(&CompositorResourceTracker::updateMailboxes,
@@ -243,8 +246,11 @@ void CompositorResourceTracker::updateMailboxes(std::vector<CompositorResource *
void CompositorResourceTracker::scheduleRunSubmitCallback()
{
+ thread_local bool currentThreadIsUi = content::BrowserThread::CurrentlyOn(content::BrowserThread::UI);
+ if (currentThreadIsUi)
+ return runSubmitCallback();
base::PostTaskWithTraits(
- FROM_HERE, { content::BrowserThread::UI },
+ FROM_HERE, { content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE },
base::BindOnce(&CompositorResourceTracker::runSubmitCallback,
m_weakPtrFactory.GetWeakPtr()));
}
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 3eb436910..95b7a4bda 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -36,8 +36,7 @@ clang {
gn_args += \
is_clang=true \
clang_use_chrome_plugins=false \
- clang_base_path=\"$${clang_prefix}\" \
- use_lld=false
+ clang_base_path=\"$${clang_prefix}\"
linux-clang-libc++: gn_args += use_libcxx=true
} else {
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index 9eb15830d..429e4e45f 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -1,7 +1,6 @@
include(common.pri)
gn_args += \
- is_clang=false \
use_sysroot=false \
enable_session_service=false \
ninja_use_custom_environment_files=false \
@@ -9,6 +8,22 @@ gn_args += \
win_linker_timing=true \
com_init_check_hook_disabled=true
+use_lld_linker: gn_args += use_lld=true
+else: gn_args += use_lld=false
+
+clang_cl {
+ clang_full_path = $$system_path($$which($${QMAKE_CXX}))
+ # Remove the "\bin\clang-cl.exe" part:
+ clang_dir = $$dirname(clang_full_path)
+ clang_prefix = $$join(clang_dir,,,"\..")
+ gn_args += \
+ is_clang=true \
+ clang_use_chrome_plugins=false \
+ clang_base_path=$$system_quote($$system_path($$clean_path($$clang_prefix)))
+} else {
+ gn_args += is_clang=false
+}
+
isDeveloperBuild() {
gn_args += \
is_win_fastlink=true
@@ -56,6 +71,8 @@ msvc:contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
msvc {
equals(MSVC_VER, 15.0) {
MSVS_VERSION = 2017
+ } else: equals(MSVC_VER, 16.0) {
+ MSVS_VERSION = 2019
} else {
error("Visual Studio compiler version \"$$MSVC_VER\" is not supported by Qt WebEngine")
}
@@ -69,7 +86,6 @@ msvc {
GN_TARGET_CPU = $$gnArch($$QT_ARCH)
gn_args += target_cpu=\"$$GN_TARGET_CPU\"
-
} else {
- error("Qt WebEngine for Windows can only be built with the Microsoft Visual Studio C++ compiler")
+ error("Qt WebEngine for Windows can only be built with a Microsoft Visual Studio C++ compatible compiler")
}
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index dc32bb8c1..57f8af63c 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -226,9 +226,7 @@ static void SafeOverridePathImpl(const char *keyName, int key, const base::FileP
bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
{
SafeOverridePath(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE));
-#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
SafeOverridePath(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA));
-#endif
SafeOverridePath(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
#if QT_CONFIG(webengine_spellchecker)
SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));
diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri
index 89fb40864..4d8db0d1e 100644
--- a/src/core/core_chromium.pri
+++ b/src/core/core_chromium.pri
@@ -37,6 +37,11 @@ qtConfig(egl): CONFIG += egl
INCLUDEPATH += $$PWD $$PWD/api
+clang_cl {
+ QMAKE_CFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
+ QMAKE_CXXFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
+}
+
SOURCES = \
accessibility_activation_observer.cpp \
accessibility_tree_formatter_qt.cpp \
@@ -149,6 +154,7 @@ HEADERS = \
certificate_error_controller_p.h \
certificate_error_controller.h \
client_cert_select_controller.h \
+ clipboard_change_observer.h \
clipboard_qt.h \
command_line_pref_store_qt.h \
color_chooser_qt.h \
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 3b5d37f29..e2fa3494d 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -55,7 +55,7 @@ LIBS_PRIVATE += -L$$api_library_path
CONFIG *= no_smart_library_merge
osx {
LIBS_PRIVATE += -Wl,-force_load,$${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-} else:msvc {
+} else: win32 {
!isDeveloperBuild() {
# Remove unused functions and data in debug non-developer builds, because the binaries will
# be smaller in the shipped packages.
@@ -74,7 +74,7 @@ osx {
LIBS_PRIVATE += -Wl,-whole-archive -l$$api_library_name -Wl,-no-whole-archive
}
-win32-msvc* {
+win32 {
POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib
} else {
POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
diff --git a/src/core/core_project.pro b/src/core/core_project.pro
index ecb4a3ab5..3205ac604 100644
--- a/src/core/core_project.pro
+++ b/src/core/core_project.pro
@@ -1,7 +1,10 @@
TEMPLATE = lib
# Fake project to make QtCreator happy.
-include(core_common.pri)
+include(core_chromium.pri)
+
+HEADERS =
+SOURCES =
linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
diff --git a/src/core/doc/src/qtwebenginecore-index.qdoc b/src/core/doc/src/qtwebenginecore-index.qdoc
index 4d540e277..692e33d1d 100644
--- a/src/core/doc/src/qtwebenginecore-index.qdoc
+++ b/src/core/doc/src/qtwebenginecore-index.qdoc
@@ -29,9 +29,9 @@
\page qtwebenginecore-index.html
\title Qt WebEngine Core
- \brief Provides common API shared by Qt WebEngine and Qt WebEngine Widgets.
+ \brief Provides common API shared by \QWE and \QWE Widgets.
- Qt WebEngine Core provides API shared by \l {Qt WebEngine} and \l {Qt WebEngine Widgets}.
+ \QWE Core provides API shared by \l {Qt WebEngine} and \l {Qt WebEngine Widgets}.
\section1 Getting Started
@@ -61,7 +61,7 @@
This is a snapshot of the integration of Chromium into Qt.
Qt Commercial Edition licensees that wish to distribute applications that
- use the Qt WebEngine module need to be aware of their obligations under the
+ use the \QWE module need to be aware of their obligations under the
GNU Library General Public License (LGPLv2).
Developers using the Open Source Edition can choose to redistribute
diff --git a/src/core/doc/src/qtwebenginecore-module.qdoc b/src/core/doc/src/qtwebenginecore-module.qdoc
index 65e0766de..c976d024c 100644
--- a/src/core/doc/src/qtwebenginecore-module.qdoc
+++ b/src/core/doc/src/qtwebenginecore-module.qdoc
@@ -39,7 +39,7 @@
\snippet qtwebenginecore_build_snippet.qdoc 1
- If you use qmake to build your projects, Qt WebEngine Core is usually
+ If you use qmake to build your projects, \QWE Core is usually
indirectly included through the \l{Qt WebEngine QML Types}{Qt WebEngine} or
\l{Qt WebEngine Widgets C++ Classes}{Qt WebEngine Widgets} modules.
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 724b33a7a..2af958068 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -175,8 +175,15 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
int uniquifier = base::GetUniquePathNumber(tmpFilePath, base::FilePath::StringType());
if (uniquifier > 0)
suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", uniquifier)).AsUTF8Unsafe());
- else if (uniquifier == -1)
- suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(base::StringPrintf(" - %s", base::TimeToISO8601(item->GetStartTime()).c_str())).AsUTF8Unsafe());
+ else if (uniquifier == -1) {
+ base::Time::Exploded exploded;
+ item->GetStartTime().LocalExplode(&exploded);
+ std::string suffix = base::StringPrintf(
+ " - %04d-%02d-%02dT%02d%02d%02d.%03d", exploded.year, exploded.month,
+ exploded.day_of_month, exploded.hour, exploded.minute,
+ exploded.second, exploded.millisecond);
+ suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(suffix).AsUTF8Unsafe());
+ }
item->AddObserver(this);
QList<ProfileAdapterClient*> clients = m_profileAdapter->clients();
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 05aed8d2b..3e64afd20 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -63,24 +63,35 @@ FilePickerController::~FilePickerController() = default;
void FilePickerController::accepted(const QStringList &files)
{
- FilePickerController::filesSelectedInChooser(files);
+ QStringList stringList;
+
+ for (const QString &file : files) {
+ if (QDir(file).isAbsolute())
+ stringList.append(file);
+ else
+ qWarning("Ignore invalid item in FilePickerController::accepted(QStringList): %s", qPrintable(file));
+ }
+
+ FilePickerController::filesSelectedInChooser(stringList);
}
void FilePickerController::accepted(const QVariant &files)
{
QStringList stringList;
+ QList<QUrl> urlList = QUrl::fromStringList(files.toStringList());
- if (files.canConvert(QVariant::StringList)) {
- stringList = files.toStringList();
- } else if (files.canConvert<QList<QUrl> >()) {
- const QList<QUrl> urls = files.value<QList<QUrl>>();
- for (const QUrl &url : urls)
- stringList.append(url.toLocalFile());
+ if (urlList.isEmpty()) {
+ FilePickerController::accepted(stringList);
} else {
- qWarning("An unhandled type '%s' was provided in FilePickerController::accepted(QVariant)", files.typeName());
+ for (const QUrl &url : qAsConst(urlList)) {
+ if (url.isValid() && url.scheme() == "file" && !url.path().isEmpty())
+ stringList.append(url.path());
+ else
+ qWarning("Ignore invalid item in FilePickerController::accepted(QVariant): %s", qPrintable(url.toString()));
+ }
+
+ FilePickerController::accepted(stringList);
}
-
- FilePickerController::filesSelectedInChooser(stringList);
}
void FilePickerController::rejected()
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 2bf11990a..b6a2b42ec 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -151,21 +151,12 @@ static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayo
bool useCustomMargins)
{
base::DictionaryValue *printSettings = createPrintSettings();
-
- //Set page size attributes, chromium expects these in micrometers
- QRectF pageSizeInMillimeter = pageLayout.pageSize().rect(QPageSize::Millimeter);
- if (!useCustomMargins) {
- // QPrinter will extend this size with its margins
- QMarginsF margins = pageLayout.margins(QPageLayout::Millimeter);
- pageSizeInMillimeter = pageSizeInMillimeter.marginsRemoved(margins);
- }
- std::unique_ptr<base::DictionaryValue> sizeDict(new base::DictionaryValue);
- sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMillimeter.width() * kMicronsToMillimeter);
- sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMillimeter.height() * kMicronsToMillimeter);
- printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict));
+ QRectF pageSizeInMillimeter;
if (useCustomMargins) {
// Apply page margins when printing to PDF
+ pageSizeInMillimeter = pageLayout.pageSize().rect(QPageSize::Millimeter);
+
QMargins pageMarginsInPoints = pageLayout.marginsPoints();
std::unique_ptr<base::DictionaryValue> marginsDict(new base::DictionaryValue);
marginsDict->SetInteger(printing::kSettingMarginTop, pageMarginsInPoints.top());
@@ -175,12 +166,23 @@ static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayo
printSettings->Set(printing::kSettingMarginsCustom, std::move(marginsDict));
printSettings->SetInteger(printing::kSettingMarginsType, printing::CUSTOM_MARGINS);
+
+ // pageSizeInMillimeter is in portrait orientation. Transpose it if necessary.
+ printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
} else {
// QPrinter will handle margins
+ pageSizeInMillimeter = pageLayout.paintRect(QPageLayout::Millimeter);
printSettings->SetInteger(printing::kSettingMarginsType, printing::NO_MARGINS);
+
+ // pageSizeInMillimeter already contains the orientation.
+ printSettings->SetBoolean(printing::kSettingLandscape, false);
}
- printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
+ //Set page size attributes, chromium expects these in micrometers
+ std::unique_ptr<base::DictionaryValue> sizeDict(new base::DictionaryValue);
+ sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMillimeter.width() * kMicronsToMillimeter);
+ sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMillimeter.height() * kMicronsToMillimeter);
+ printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict));
return printSettings;
}
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 5d317b7f0..96248a55a 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -49,6 +49,7 @@
#include "content/public/common/content_features.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
+#include "chrome/common/chrome_switches.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/ct_log_verifier.h"
@@ -100,13 +101,6 @@
namespace QtWebEngineCore {
-static const char* const kDefaultAuthSchemes[] = { net::kBasicAuthScheme,
- net::kDigestAuthScheme,
-#if QT_CONFIG(webengine_kerberos)
- net::kNegotiateAuthScheme,
-#endif
- net::kNtlmAuthScheme };
-
static bool doNetworkSessionParamsMatch(const net::HttpNetworkSession::Params &first,
const net::HttpNetworkSession::Params &second)
{
@@ -345,8 +339,14 @@ void ProfileIODataQt::generateStorage()
m_storage->set_ct_policy_enforcer(base::WrapUnique(new net::DefaultCTPolicyEnforcer()));
m_storage->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
m_storage->set_ssl_config_service(std::make_unique<net::SSLConfigServiceDefaults>());
+ if (!m_httpAuthPreferences) {
+ m_httpAuthPreferences.reset(new net::HttpAuthPreferences());
+ std::string serverWhitelist = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kAuthServerWhitelist);
+ m_httpAuthPreferences->SetServerWhitelist(serverWhitelist);
+ }
m_storage->set_http_auth_handler_factory(net::HttpAuthHandlerFactory::CreateDefault(
- m_urlRequestContext->host_resolver()));
+ m_urlRequestContext->host_resolver(),
+ m_httpAuthPreferences.get()));
m_storage->set_transport_security_state(std::make_unique<net::TransportSecurityState>());
if (!m_dataPath.isEmpty()) {
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index 14a39de49..5977a28a8 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -246,7 +246,9 @@ content::BackgroundSyncController* ProfileQt::GetBackgroundSyncController()
content::BrowsingDataRemoverDelegate *ProfileQt::GetBrowsingDataRemoverDelegate()
{
- return new BrowsingDataRemoverDelegateQt();
+ if (!m_removerDelegate)
+ m_removerDelegate.reset(new BrowsingDataRemoverDelegateQt);
+ return m_removerDelegate.get();
}
content::PermissionControllerDelegate *ProfileQt::GetPermissionControllerDelegate()
diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h
index 5a602f56a..704c5a6e4 100644
--- a/src/core/profile_qt.h
+++ b/src/core/profile_qt.h
@@ -60,6 +60,7 @@ class ExtensionSystemQt;
namespace QtWebEngineCore {
+class BrowsingDataRemoverDelegateQt;
class ProfileAdapter;
class PermissionManagerQt;
class SSLHostStateDelegateQt;
@@ -130,6 +131,7 @@ private:
friend class ContentBrowserClientQt;
friend class WebContentsAdapter;
scoped_refptr<net::URLRequestContextGetter> m_urlRequestContextGetter;
+ std::unique_ptr<BrowsingDataRemoverDelegateQt> m_removerDelegate;
std::unique_ptr<PermissionManagerQt> m_permissionManager;
std::unique_ptr<SSLHostStateDelegateQt> m_sslHostStateDelegate;
std::unique_ptr<PrefService> m_prefService;
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 414fc6582..994e3a3d6 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -666,9 +666,9 @@ void RenderWidgetHostViewQt::DidCreateNewRendererCompositorFrameSink(viz::mojom:
void RenderWidgetHostViewQt::SubmitCompositorFrame(const viz::LocalSurfaceId &local_surface_id, viz::CompositorFrame frame, base::Optional<viz::HitTestRegionList>)
{
bool scrollOffsetChanged = (m_lastScrollOffset != frame.metadata.root_scroll_offset);
- bool contentsSizeChanged = (m_lastContentsSize != frame.metadata.scrollable_viewport_size);
+ bool contentsSizeChanged = (m_lastContentsSize != frame.metadata.root_layer_size);
m_lastScrollOffset = frame.metadata.root_scroll_offset;
- m_lastContentsSize = frame.metadata.scrollable_viewport_size;
+ m_lastContentsSize = frame.metadata.root_layer_size;
// Force to process swap messages
uint32_t frame_token = frame.metadata.frame_token;
@@ -934,9 +934,9 @@ void RenderWidgetHostViewQt::visualPropertiesChanged()
m_viewRectInDips = toGfx(m_delegate->viewGeometry().toAlignedRect());
gfx::Rect oldWindowRect = m_windowRectInDips;
- QWindow *window = m_delegate->window();
- m_windowRectInDips = window ? toGfx(window->frameGeometry()) : gfx::Rect();
+ m_windowRectInDips = toGfx(m_delegate->windowGeometry());
+ QWindow *window = m_delegate->window();
content::ScreenInfo oldScreenInfo = m_screenInfo;
m_screenInfo = screenInfoFromQScreen(window ? window->screen() : nullptr);
diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h
index cbf92a8d4..6066284d9 100644
--- a/src/core/render_widget_host_view_qt_delegate.h
+++ b/src/core/render_widget_host_view_qt_delegate.h
@@ -91,6 +91,7 @@ public:
virtual ~RenderWidgetHostViewQtDelegate() { }
virtual void initAsPopup(const QRect&) = 0;
virtual QRectF viewGeometry() const = 0;
+ virtual QRect windowGeometry() const = 0;
virtual void setKeyboardFocus() = 0;
virtual bool hasKeyboardFocus() = 0;
virtual void lockMouse() = 0;
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index fa1e20f24..f69a8b64f 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -152,7 +152,14 @@ void ContentRendererClientQt::RenderThreadStarted()
blink::WebString file(blink::WebString::FromASCII("file"));
blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(qrc, file, blink::WebString(), true,
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
+ // Allow the pdf viewer extension to access chrome resources
+ blink::WebURL pdfViewerExtension(blink::KURL("chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai"));
+ blink::WebString chromeResources(blink::WebString::FromASCII("chrome"));
+ blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(pdfViewerExtension, chromeResources, blink::WebString(), true,
+ network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
+
ExtensionsRendererClientQt::GetInstance()->RenderThreadStarted();
#endif
}
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 46f5de2c2..be5e6f043 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -138,7 +138,6 @@ public:
private:
// RenderFrameObserver implementation.
void DidCommitProvisionalLoad(bool is_same_document_navigation, ui::PageTransition transition) override;
- void DidClearWindowObject() override;
void DidFinishDocumentLoad() override;
void DidFinishLoad() override;
void FrameDetached() override;
@@ -241,14 +240,10 @@ void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad
// that the WebChannelTransportHost is ready to receive messages.
m_runner.reset(new Runner(render_frame()->GetWebFrame()));
-}
-void UserResourceController::RenderFrameObserverHelper::DidClearWindowObject()
-{
- // This is called both before and after DidCommitProvisionalLoad, non-null
- // m_runner means it's after.
- if (m_runner)
- m_runner->run(UserScriptData::DocumentElementCreation);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::BindOnce(&Runner::run, m_runner->AsWeakPtr(), UserScriptData::DocumentElementCreation));
}
void UserResourceController::RenderFrameObserverHelper::DidFinishDocumentLoad()
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 7c6b6669d..33cc723f5 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -196,9 +196,9 @@ void WebEngineContext::destroyProfileAdapter()
{
if (content::RenderProcessHost::run_renderer_in_process()) {
Q_ASSERT(m_profileAdapters.count() == 1);
- // this might be default profile
- m_defaultProfileAdapter.release();
- delete m_profileAdapters.first();
+ // this is a default profile
+ m_defaultProfileAdapter.reset();
+ Q_ASSERT(m_profileAdapters.isEmpty());
}
}
@@ -216,9 +216,11 @@ void WebEngineContext::addProfileAdapter(ProfileAdapter *profileAdapter)
}
}
- if (content::RenderProcessHost::run_renderer_in_process() &&
- !m_profileAdapters.isEmpty()) {
- qFatal("Single mode supports only single profile.");
+ if (content::RenderProcessHost::run_renderer_in_process()){
+ if (!m_profileAdapters.isEmpty())
+ qFatal("Single mode supports only single profile.");
+ // there is only one profle therefore make it 'default'
+ m_defaultProfileAdapter.reset(profileAdapter);
}
m_profileAdapters.append(profileAdapter);
}
@@ -307,8 +309,13 @@ WebEngineContext *WebEngineContext::current()
ProfileAdapter *WebEngineContext::createDefaultProfileAdapter()
{
Q_ASSERT(!m_destroyed);
- if (!m_defaultProfileAdapter)
- m_defaultProfileAdapter.reset(new ProfileAdapter(QStringLiteral("Default")));
+ if (!m_defaultProfileAdapter) {
+ ProfileAdapter *profile = new ProfileAdapter(QStringLiteral("Default"));
+ // profile when added to m_profileAdapters might be set default
+ // profile in case of single-process
+ if (!m_defaultProfileAdapter)
+ m_defaultProfileAdapter.reset(profile);
+ }
return m_defaultProfileAdapter.get();
}
diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp
index 75f8bd470..e92cf3e9b 100644
--- a/src/core/web_engine_context_threads.cpp
+++ b/src/core/web_engine_context_threads.cpp
@@ -82,7 +82,7 @@ struct GpuThreadControllerQt : content::GpuThreadController
if (s_gpuProcessDestroyed)
return;
- s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::NORMAL);
+ s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::DISPLAY);
auto gpuInit = std::make_unique<gpu::GpuInit>();
gpuInit->InitializeInProcess(base::CommandLine::ForCurrentProcess(), gpuPreferences);
auto childThread = new content::GpuChildThread(params, std::move(gpuInit));
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 12ffd91e6..1c8316430 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -257,34 +257,6 @@ QString dictionariesPath()
}
#endif // QT_CONFIG(webengine_spellchecker)
-QString icuDataPath()
-{
- static bool initialized = false;
- static QString potentialResourcesPath =
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- getResourcesPath(frameworkBundle());
-#else
- QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources");
-#endif
- if (!initialized) {
- initialized = true;
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) {
- qWarning("Qt WebEngine ICU data not found at %s. Trying parent directory...", qPrintable(potentialResourcesPath));
- potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath);
- }
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) {
- qWarning("Qt WebEngine ICU data not found at %s. Trying application directory...", qPrintable(potentialResourcesPath));
- potentialResourcesPath = QCoreApplication::applicationDirPath();
- }
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) {
- qWarning("Qt WebEngine ICU data not found at %s. Trying fallback directory... The application MAY NOT work.", qPrintable(potentialResourcesPath));
- potentialResourcesPath = fallbackDir();
- }
- }
-
- return potentialResourcesPath;
-}
-
QString resourcesDataPath()
{
static bool initialized = false;
@@ -341,7 +313,7 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
break;
case base::DIR_QT_LIBRARY_DATA:
- return toFilePath(icuDataPath());
+ return toFilePath(resourcesDataPath());
case ui::DIR_LOCALES:
return toFilePath(localesPath());
#if QT_CONFIG(webengine_spellchecker)
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index 8aff4e625..cbd0e994a 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -136,7 +136,7 @@ QQuickWebEngineDownloadItemPrivate::~QQuickWebEngineDownloadItemPrivate()
\l{WebEngineProfile::downloadRequested}{downloadRequested} signal together
with a newly created WebEngineDownloadItem. The application can then examine
this item and decide whether to accept it or not. A signal handler must
- explicitly call accept() on the item for Qt WebEngine to actually start
+ explicitly call accept() on the item for \QWE to actually start
downloading and writing data to disk. If no signal handler calls accept(),
then the download request will be automatically rejected and nothing will be
written to disk.
@@ -155,7 +155,7 @@ QQuickWebEngineDownloadItemPrivate::~QQuickWebEngineDownloadItemPrivate()
\section2 Web Page Downloads
In addition to normal file downloads, which consist simply of retrieving
- some raw bytes from the network and writing them to disk, Qt WebEngine also
+ some raw bytes from the network and writing them to disk, \QWE also
supports saving complete web pages, which involves parsing the page's HTML,
downloading any dependent resources, and potentially packaging everything
into a special file format (\l savePageFormat). To check if a download is
diff --git a/src/webengine/api/qquickwebengineloadrequest.cpp b/src/webengine/api/qquickwebengineloadrequest.cpp
index b3422c516..5ad99ea2e 100644
--- a/src/webengine/api/qquickwebengineloadrequest.cpp
+++ b/src/webengine/api/qquickwebengineloadrequest.cpp
@@ -127,7 +127,7 @@ QString QQuickWebEngineLoadRequest::errorString() const
\value WebEngineView.NoErrorDomain
Error type is not known.
\value WebEngineView.InternalErrorDomain
- Content cannot be interpreted by Qt WebEngine.
+ Content cannot be interpreted by \QWE.
\value WebEngineView.ConnectionErrorDomain
Error results from a faulty network connection.
\value WebEngineView.CertificateErrorDomain
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
index d181f44aa..a11618dba 100644
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ b/src/webengine/api/qtwebengineglobal.cpp
@@ -54,9 +54,9 @@ namespace QtWebEngine {
\ingroup qtwebengine-namespaces
\keyword QtWebEngine Namespace
- \brief Helper functions for the Qt WebEngine (Qt Quick) module.
+ \brief Helper functions for the \QWE (Qt Quick) module.
- The \l[CPP]{QtWebEngine} namespace is part of the Qt WebEngine module.
+ The \l[CPP]{QtWebEngine} namespace is part of the \QWE module.
*/
/*!
diff --git a/src/webengine/doc/qtwebengine.qdocconf b/src/webengine/doc/qtwebengine.qdocconf
index b1e3a2ded..50f2e2ceb 100644
--- a/src/webengine/doc/qtwebengine.qdocconf
+++ b/src/webengine/doc/qtwebengine.qdocconf
@@ -81,4 +81,7 @@ navigation.landingpage = "Qt WebEngine"
navigation.cppclassespage = "Qt WebEngine C++ Classes and Namespaces"
navigation.qmltypespage = "Qt WebEngine QML Types"
+# \QWE macro expands to 'Qt WebEngine' without auto-linking anywhere.
+macro.QWE = "Qt \\WebEngine"
+
Cpp.ignoretokens += Q_WEBENGINE_EXPORT QWEBENGINEWIDGETS_EXPORT
diff --git a/src/webengine/doc/src/external-resources.qdoc b/src/webengine/doc/src/external-resources.qdoc
index e4fe9bba6..55f6a68a3 100644
--- a/src/webengine/doc/src/external-resources.qdoc
+++ b/src/webengine/doc/src/external-resources.qdoc
@@ -95,18 +95,6 @@
\title Hunspell Project
*/
-/*
- This prevents autolinking of each occurrence of 'WebEngine'
- To link to the WebEngine QML type, use explicit linking:
- \l [QML] WebEngine
- \sa {QtWebEngine::}{WebEngine}
-*/
-/*!
- \externalpage nolink
- \title WebEngine
- \internal
-*/
-
/*!
\externalpage https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
\title RFC 2616 section 19.5.1
diff --git a/src/webengine/doc/src/qtwebengine-debugging.qdoc b/src/webengine/doc/src/qtwebengine-debugging.qdoc
index b8b004095..088db5f87 100644
--- a/src/webengine/doc/src/qtwebengine-debugging.qdoc
+++ b/src/webengine/doc/src/qtwebengine-debugging.qdoc
@@ -31,7 +31,7 @@
\section1 Console Logging
- JavaScript executed inside Qt WebEngine can use the
+ JavaScript executed inside \QWE can use the
\l{Chrome console API} to log information to a console. The logging messages
are forwarded to Qt's logging facilities inside a \c js
\l{QLoggingCategory}{logging category}. However, only warning and fatal
@@ -40,19 +40,19 @@
by reimplementing \l{QWebEnginePage::javaScriptConsoleMessage()}, or
connecting to \l{WebEngineView::javaScriptConsoleMessage()}.
- All messages can also be accessed through the Qt WebEngine developer
+ All messages can also be accessed through the \QWE developer
tools.
\section1 Qt WebEngine Developer Tools
- The Qt WebEngine module provides web developer tools that make it easy
+ The \QWE module provides web developer tools that make it easy
to inspect and debug layout and performance issues of any web content.
The developer tools are accessed as a local web page using a Chromium or
- Qt WebEngine based browser, such as the Chrome browser.
+ \QWE based browser, such as the Chrome browser.
- To activate the developer tools, start an application that uses Qt
- WebEngine with the command-line arguments:
+ To activate the developer tools, start an application that uses \QWE
+ with the command-line arguments:
\badcode
--remote-debugging-port=<port_number>
diff --git a/src/webengine/doc/src/qtwebengine-deploying.qdoc b/src/webengine/doc/src/qtwebengine-deploying.qdoc
index c9f0f3580..7b9f3fd4a 100644
--- a/src/webengine/doc/src/qtwebengine-deploying.qdoc
+++ b/src/webengine/doc/src/qtwebengine-deploying.qdoc
@@ -34,7 +34,7 @@
\l{Deploying Applications on macOS}{macdeployqt} automate the steps to
generate a stand-alone application package.
- When manually deploying applications that depend on Qt WebEngine, all the
+ When manually deploying applications that depend on \QWE, all the
files that are required to run the application have to be included:
libraries, QML imports, plugins, and translations.
@@ -42,27 +42,27 @@
\section1 Target Platforms
- Qt WebEngine does try to support all \l{Supported Platforms} of Qt. However,
+ \QWE does try to support all \l{Supported Platforms} of Qt. However,
due to different requirements of Chromium this is not always possible. Known
limitations are:
\list
- \li Qt WebEngine currently supports only Windows, Linux, and \macos.
+ \li \QWE currently supports only Windows, Linux, and \macos.
- \li On Windows, Qt WebEngine only supports Windows Vista or newer as
+ \li On Windows, \QWE only supports Windows Vista or newer as
target platform. Due to use of newer API in Chromium, Windows XP is
not supported. WinRT is not supported, either.
\endlist
\section1 Deploying Applications Manually
- When manually deploying applications that depend on Qt WebEngine, the
+ When manually deploying applications that depend on \QWE, the
following files might have to be deployed:
\list
\li Libraries
\li QML imports
- \li Qt WebEngine process
+ \li \QWE process
\li Resources
\li Translations
\li Audio and video codecs
@@ -71,7 +71,7 @@
\section2 Deploying Libraries
The following libraries must be deployed with applications that depend on
- Qt WebEngine:
+ \QWE:
\list
\li QtWebEngineCore library
@@ -84,10 +84,10 @@
If Qt Quick integration is used in the application, the QtWebEngine import
directory needs to be deployed.
- \section2 Deploying Qt WebEngine Processes
+ \section2 Deploying \QWE Processes
- Qt WebEngine takes advantage of the multi-process model that the Chromium
- project offers. The multi-process model requires that the Qt WebEngine
+ \QWE takes advantage of the multi-process model that the Chromium
+ project offers. The multi-process model requires that the \QWE
Process executable be deployed alongside your application.
The WebEngine process is executed for each QWebEngineView or WebEngineView
@@ -96,18 +96,18 @@
running. This is a common approach used by most modern web engines to
provide a stable browsing experience.
- At runtime, Qt WebEngine looks for the \c QtWebEngineProcess executable in
+ At runtime, \QWE looks for the \c QtWebEngineProcess executable in
the directory that
QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) returns.
For Qt installations, this is \c QTDIR/libexec (Linux) or \c QTDIR\bin
(Windows). The path can be changed by defining a \c qt.conf file, for
example. Alternatively, an executable path can be set as a value of the
- \c QTWEBENGINEPROCESS_PATH environment variable. On \macos, Qt WebEngine
+ \c QTWEBENGINEPROCESS_PATH environment variable. On \macos, \QWE
looks for the executable in \c .app/Helpers/QtWebEngineProcess.
\section2 Deploying Resources
- Qt WebEngine requires the following resource files:
+ \QWE requires the following resource files:
\list
\li \c qtwebengine_resources.pak contains the resources needed by
@@ -120,7 +120,7 @@
DPI displays.
\li \c icudtl.dat provides support for International Components for
Unicode (ICU). It is the Chromium version of ICU, which is not
- needed if Qt WebEngine was configured to use the system ICU.
+ needed if \QWE was configured to use the system ICU.
\endlist
Resources are searched from the following locations:
diff --git a/src/webengine/doc/src/qtwebengine-examples.qdoc b/src/webengine/doc/src/qtwebengine-examples.qdoc
index 24604e3dd..d31895078 100644
--- a/src/webengine/doc/src/qtwebengine-examples.qdoc
+++ b/src/webengine/doc/src/qtwebengine-examples.qdoc
@@ -28,7 +28,7 @@
/*!
\group webengine-examples
\title Qt WebEngine Examples
- \brief Examples demonstrating the Qt WebEngine usage.
+ \brief Examples demonstrating the \QWE usage.
\ingroup all-examples
These examples and demonstrations show a range of different uses for \l{Qt WebEngine},
diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc
index f53c118a8..5c6bdda5d 100644
--- a/src/webengine/doc/src/qtwebengine-features.qdoc
+++ b/src/webengine/doc/src/qtwebengine-features.qdoc
@@ -29,9 +29,9 @@
\page qtwebengine-features.html
\title Qt WebEngine Features
- \brief Summarizes Qt WebEngine features.
+ \brief Summarizes \QWE features.
- Qt WebEngine supports the following features:
+ \QWE supports the following features:
\list
\li \l{Audio and Video Codecs}
@@ -55,7 +55,7 @@
\section1 Audio and Video Codecs
- Qt WebEngine supports the MPEG-4 Part 14 (MP4) file format only if the
+ \QWE supports the MPEG-4 Part 14 (MP4) file format only if the
required proprietary audio and video codecs, such as H.264 and MPEG layer-3
(MP3), have been enabled. Proprietary codecs can be enabled by passing the
following option to the \c configure tool when configuring Qt:
@@ -73,8 +73,8 @@
For more information, see \l{Qt Configure Options}.
- When using qmake to build just the Qt WebEngine module, the following
- command can be used (in this example, the Qt WebEngine source code is
+ When using qmake to build just the \QWE module, the following
+ command can be used (in this example, the \QWE source code is
located in \c {C:\qt\qtwebengine}):
\code
@@ -95,7 +95,7 @@
The Chromium DevTools provide the ability to inspect and debug layout and
performance issues of any web content.
- This feature can be tested by launching a Qt WebEngine application with the
+ This feature can be tested by launching a \QWE application with the
command line option \c {--remote-debugging-port=[your-port]} or by setting
the environment variable \c QTWEBENGINE_REMOTE_DEBUGGING, and then using a
Chromium based browser (such as \l{WebEngine Widgets Simple Browser Example}
@@ -116,12 +116,12 @@
\section1 Client Certificates
Some web servers, in particular many intranet sites, require the client to
- authenticate itself with a certificate, called a \e {client certificate}. Qt WebEngine
+ authenticate itself with a certificate, called a \e {client certificate}. \QWE
will read the client certificates installed in the system settings in macOS and
Windows, and on Linux those installed into the NSS database. Certificates can
be installed into the NSS database using the \c pk12util tool.
- By default, QtWebEngine will not offer any client certificates to servers, as doing
+ By default, \QWE will not offer any client certificates to servers, as doing
so uniquely identifies the user and might violate privacy expectations.
To activate support for client certificates, an application needs to listen to
@@ -132,7 +132,7 @@
\section1 Custom Schemes
- Qt WebEngine makes it possible for the application to define its own custom
+ \QWE makes it possible for the application to define its own custom
URL schemes with specialized security policies and transport mechanisms.
Custom schemes can be used to implement alternative network protocols with
@@ -145,7 +145,7 @@
\section1 Drag and Drop
- Qt WebEngine supports HTML5 drag and drop.
+ \QWE supports HTML5 drag and drop.
This feature can be tested by opening an HTML5 drag and drop demo, such as
\l{HTML5 Demos - Drag and Drop}, \l{HTML5 Demos - Simple Drag and Drop}, or
@@ -160,7 +160,7 @@
\section1 Fullscreen
- Qt WebEngine supports viewing web content in fullscreen mode. For more
+ \QWE supports viewing web content in fullscreen mode. For more
information, see \l{WebEngineSettings::fullscreenSupportEnabled}
{WebEngineSettings.fullscreenSupportEnabled},
\l{WebEngineView::fullScreenRequested}{WebEngineView.fullScreenRequested},
@@ -176,7 +176,7 @@
\section1 HTML5 DRM
- Qt WebEngine supports viewing DRM protected videos if the \l{Widevine DRM}
+ \QWE supports viewing DRM protected videos if the \l{Widevine DRM}
plugin has been installed.
The video format most commonly used by DRM services, H.264, requires
@@ -191,12 +191,12 @@
\section1 HTML5 Geolocation
- Qt WebEngine supports JavaScript Geolocation API with \l {Qt Location} as a
+ \QWE supports JavaScript Geolocation API with \l {Qt Location} as a
backend. The application has to explicitly allow the feature by using
QWebEnginePage::Geolocation or \l{WebEngineView::Feature}
{WebEngineView.Feature}.
- If Qt Location has been built before Qt WebEngine then this feature can be
+ If Qt Location has been built before \QWE then this feature can be
tested by using \l{WebEngine Widgets Maps Example}{Maps} and allowing it to
find the current position of the user. Note that on Windows an external GPS
receiver must be connected to the application. For more information, see
@@ -206,7 +206,7 @@
\section1 HTTP/2 Protocol
- Qt WebEngine supports the Chromium implementation of the \l{HTTP/2}
+ \QWE supports the Chromium implementation of the \l{HTTP/2}
protocol.
This feature can be tested by opening an HTTP/2 demo, such as the
@@ -225,7 +225,7 @@
\li Displaying form validation messages
\endlist
- Qt WebEngine provides standard dialogs for these functions. In widget-based
+ \QWE provides standard dialogs for these functions. In widget-based
applications, the standard dialogs are based on QDialog, whereas in Qt Quick
applications, they can be based either on Qt Quick Controls 1 or Qt Quick
Controls 2 (since Qt 5.8). The latter are used only on \c eglfs platforms.
@@ -234,7 +234,7 @@
Controls 2, set the \c QTWEBENGINE_DIALOG_SET environment variable to either
\c{QtQuickControls1} or \c{QtQuickControls2}.
- Qt WebEngine Widgets dialogs can be customized by reimplementing the
+ \QWE Widgets dialogs can be customized by reimplementing the
QWebEnginePage::chooseFiles(), QWebEnginePage::javaScriptAlert(),
QWebEnginePage::javaScriptConfirm(), and QWebEnginePage::javaScriptPrompt()
functions.
@@ -249,7 +249,7 @@
\section1 Pepper Plugin API
- Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins if
+ \QWE supports loading Pepper Plugin API (PPAPI) plugins if
WebEngineSettings::pluginsEnabled or QWebEngineSettings::PluginsEnabled
is set.
@@ -321,7 +321,7 @@
\section1 Print to PDF
- Qt WebEngine supports printing a web page to a PDF file. For more
+ \QWE supports printing a web page to a PDF file. For more
information, see QWebEnginePage::printToPdf() and
\l{WebEngineView::printToPdf}{WebEngineView.printToPdf}.
@@ -332,7 +332,7 @@
\section1 Process Models
- Qt WebEngine uses multiple OS processes to isolate web sites from each other
+ \QWE uses multiple OS processes to isolate web sites from each other
and from the client application, improving security and robustness. The
following process models, or ways to divide web sites between OS processes,
are supported:
@@ -355,7 +355,7 @@
and \c{https://de.wikipedia.org/} would belong to the same site.
A site instance is a collection of web pages belonging to the same site.
- When the application explicitly loads a URL into Qt WebEngine (via \l
+ When the application explicitly loads a URL into \QWE (via \l
QWebEnginePage::setUrl, for example), a new site instance is created for the
page. However, when the user clicks same-site links on the page, the
existing site instance is merely extended with more pages.
@@ -388,7 +388,7 @@
\section1 Spellchecker
- Qt WebEngine supports integrating spellchecking support into HTML forms to
+ \QWE supports integrating spellchecking support into HTML forms to
enable users to submit spellchecked messages. When the user clicks on
an underlined misspelled word, the default context menu displays up to four
suggestions. Selecting one will replace the misspelled word.
@@ -408,7 +408,7 @@
These two files can be converted into the \c bdic format by using the
\c qwebengine_convert_dict tool that is shipped together with Qt.
- When the Qt WebEngine spellchecker initializes, it will try to load the
+ When the \QWE spellchecker initializes, it will try to load the
\c bdict dictionaries and to check them for consistency.
If \c QTWEBENGINE_DICTIONARIES_PATH is set, the spellchecker uses the
@@ -417,7 +417,7 @@
executable if it exists. If it does not exist, it will look in \c
QT_INSTALL_PREFIX/qtwebengine_dictionaries.
- On macOS, depending on how Qt WebEngine is configured at build time, there
+ On macOS, depending on how \QWE is configured at build time, there
are two possibilities how spellchecking data is found:
\list
@@ -427,7 +427,7 @@
means the results will depend on the installed OS dictionaries)
\endlist
- Thus, in the macOS Hunspell case, Qt WebEngine will look in the \e
+ Thus, in the macOS Hunspell case, \QWE will look in the \e
qtwebengine_dictionaries subdirectory located inside the application bundle
\c Resources directory, and also in the \c Resources directory located
inside the Qt framework bundle.
@@ -461,7 +461,7 @@
\section1 Touch
- Qt WebEngine supports touch devices for navigating and interacting with web pages.
+ \QWE supports touch devices for navigating and interacting with web pages.
Applications can prohibit the use of touch events in the following ways:
@@ -477,7 +477,7 @@
\section1 View Source
- Qt WebEngine supports viewing the HTML source of a web page.
+ \QWE supports viewing the HTML source of a web page.
This feature can be used from custom menus or assigned to custom events.
For more information, see WebEngineView::WebAction, and QWebEnginePage::WebAction.
diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc
index bd6cc9a32..f668cf87b 100644
--- a/src/webengine/doc/src/qtwebengine-index.qdoc
+++ b/src/webengine/doc/src/qtwebengine-index.qdoc
@@ -31,9 +31,9 @@
\brief Provides functionality for rendering regions of dynamic web content.
- \e {Qt WebEngine} provides functionality for rendering regions of dynamic web content.
+ \QWE provides functionality for rendering regions of dynamic web content.
- The functionality in Qt WebEngine is divided into the following modules:
+ The functionality in \QWE is divided into the following modules:
\annotatedlist qtwebengine-modules
diff --git a/src/webengine/doc/src/qtwebengine-module.qdoc b/src/webengine/doc/src/qtwebengine-module.qdoc
index 2d4d1b8da..5554bd519 100644
--- a/src/webengine/doc/src/qtwebengine-module.qdoc
+++ b/src/webengine/doc/src/qtwebengine-module.qdoc
@@ -31,7 +31,7 @@
\brief Exposes C++ functionality to Qt Quick.
\ingroup modules
- The Qt WebEngine module exposes C++ functionality to Qt Quick.
+ The \QWE module exposes C++ functionality to Qt Quick.
To include the definitions of the module's classes, use the
following directive:
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index 58c0708cc..6aa1af89e 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -29,10 +29,10 @@
\page qtwebengine-overview.html
\title Qt WebEngine Overview
- The Qt WebEngine module provides a web browser engine that makes it easy to embed content from
+ The \QWE module provides a web browser engine that makes it easy to embed content from
the World Wide Web into your Qt application on platforms that do not have a native web engine.
- Qt WebEngine provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents,
+ \QWE provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents,
styled using Cascading Style Sheets (CSS) and scripted with JavaScript. HTML documents can be
made fully editable by the user through the use of the \c{contenteditable} attribute on HTML
elements.
@@ -41,7 +41,7 @@
\image qtwebengine-architecture.png
- The functionality in Qt WebEngine is divided into the following modules:
+ The functionality in \QWE is divided into the following modules:
\list
\li \l{Qt WebEngine Widgets Module} for creating widget-based web applications
@@ -49,7 +49,7 @@
\li \l{Qt WebEngine Core Module} for interacting with Chromium
\endlist
- Page rendering and JavaScript execution are separated from the GUI process into the Qt WebEngine
+ Page rendering and JavaScript execution are separated from the GUI process into the \QWE
Process. It is a library that must be shipped with the application if the Qt libraries are
bundled into the application.
@@ -57,7 +57,7 @@
\image qtwebenginewidgets-model.png
- A \e {web engine view} is the main widget component of the Qt WebEngine module. It can be used
+ A \e {web engine view} is the main widget component of the \QWE module. It can be used
in various applications to load web content. Within a view, a \e {web engine page} holds a main
frame that is responsible for web content, the \e history of navigated links, and \e actions.
The view and page are quite similar, as they provide a set of common functions.
@@ -66,7 +66,7 @@
\e cookies. Profiles can be used to isolate pages from each other. A typical use case is a
dedicated profile for a \e {private browsing} mode, where no information is permanently saved.
- \note The Qt WebEngine Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph}
+ \note The \QWE Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph}
to compose the elements of a web page into one view. This means that the UI process
requires OpenGL ES 2.0 or OpenGL 2.0 for its rendering.
@@ -74,27 +74,27 @@
\image qtwebengine-model.png
- The Qt WebEngine QML implementation contains the same elements as the Qt WebEngine Widgets
+ The \QWE QML implementation contains the same elements as the \QWE Widgets
implementation, except that there is no separately accessible web engine page.
The supported page functionality is integrated into the web engine view.
\section2 Qt WebEngine Core Module
- The Qt WebEngine core is based on the \l {Chromium Project}. Chromium provides its own network
+ The \QWE core is based on the \l {Chromium Project}. Chromium provides its own network
and painting engines and is developed tightly together with its dependent modules.
- \note Qt WebEngine is based on Chromium, but does not contain or use any services
+ \note \QWE is based on Chromium, but does not contain or use any services
or add-ons that might be part of the Chrome browser that is built and delivered by Google.
You can find more detailed information about the differences between Chromium and Chrome in this
\l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview}
that is part of the documentation in the \l {Chromium Project} upstream source tree.
- This version of Qt WebEngine is based on Chromium version 69.0.3497.128, with
- additional security fixes from newer versions.
+ This version of \QWE is based on Chromium version 73.0.3683, with additional security
+ fixes from newer versions.
\section2 Qt WebEngine Process
- The Qt WebEngine Process is a separate executable that is used to render web pages and
+ The \QWE Process is a separate executable that is used to render web pages and
execute JavaScript. This mitigates security issues and isolates crashes caused by specific
content.
@@ -177,7 +177,7 @@
\section1 Script Injection
- Qt WebEngine does not allow direct access to the document object model (DOM) of a page.
+ \QWE does not allow direct access to the document object model (DOM) of a page.
However, the DOM can be inspected and adapted by injecting scripts.
The DOM of a page is constructed when the document is ready, typically
@@ -191,7 +191,7 @@
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.
- Since Qt 5.8, Qt WebEngine supports augmenting a script by using the
+ Since Qt 5.8, \QWE supports augmenting a script by using the
following \l{Metadata Block}{Greasemonkey-like attributes}:
\list
@@ -221,8 +221,8 @@
\section1 Managing Certificates
- Qt WebEngine uses its own network stack, and therefore QSslConfiguration is not used to
- open SSL connections. Instead, Qt WebEngine uses the root CA certificates from the operating
+ \QWE uses its own network stack, and therefore QSslConfiguration is not used to
+ open SSL connections. Instead, \QWE uses the root CA certificates from the operating
system to validate the peer's certificate.
The \l{WebEngineCertificateError::error} and \l{QWebEngineCertificateError::Error} enumerations
@@ -232,9 +232,9 @@
\section1 Proxy Support
- Qt WebEngine uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
- networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for Qt
- WebEngine. If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
+ \QWE uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
+ networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for \QWE.
+ If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
are automatically retrieved from the system. Settings from an installed QNetworkProxyFactory
will be ignored, though.
@@ -246,7 +246,7 @@
QWebEnginePage::proxyAuthenticationRequired is emitted.
For Qt Quick, a dialog is shown.
- Not all properties of QNetworkProxy are supported by Qt WebEngine. That is,
+ Not all properties of QNetworkProxy are supported by \QWE. That is,
QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into
account. All other proxy settings such as QNetworkProxy::rawHeader() are ignored.
@@ -254,7 +254,7 @@
To support High DPI devices, it is recommended that the application attribute
Qt::AA_EnableHighDpiScaling is set to enable automatic scaling based on the
- pixel density of the monitor. In Qt WebEngine applications, the scaling
+ pixel density of the monitor. In \QWE applications, the scaling
affects the default zooming factor and scrollbar size.
For example:
@@ -268,7 +268,7 @@
}
\endcode
- Qt WebEngine bundles images for normal and high-dpi resolutions into
+ \QWE bundles images for normal and high-dpi resolutions into
\e qtwebengine_resources_100p.pak and \e qtwebengine_resources_200p.pak
files. Depending on the target resolutions, one or both of these files need
to be deployed.
@@ -277,7 +277,7 @@
\section1 Using WebEngine Core
- Qt WebEngine Core provides an API shared by Qt WebEngine and Qt WebEngine Widgets for handling
+ \QWE Core provides an API shared by \QWE and \QWE Widgets for handling
URL requests issued for the networking stack of Chromium and for accessing its HTTP cookies.
Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on a
@@ -294,17 +294,17 @@
\section1 Platform Notes
- Qt WebEngine currently supports only Windows, Linux, and \macos. Due to Chromium build
+ \QWE currently supports only Windows, Linux, and \macos. Due to Chromium build
requirements it also often requires a newer compiler than the rest of Qt. See
\l{Qt WebEngine Platform Notes} for further details.
\section1 Related Modules
- Qt WebEngine supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
+ \QWE supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
module, which is based on the
WebKit project, but has not been actively synchronized with the upstream WebKit code since
- Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt WebKit widgets
- application to use Qt WebEngine widgets, see \l{Porting from Qt WebKit to Qt WebEngine}.
+ Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt \WebKit widgets
+ application to use \QWE widgets, see \l{Porting from Qt WebKit to Qt WebEngine}.
The \l{Qt WebView} module allows to use a native web browser on platforms where one is
available.
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
index 0b2aebfce..fefb47795 100644
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
@@ -29,9 +29,9 @@
\page qtwebengine-platform-notes.html
\title Qt WebEngine Platform Notes
- \brief Contains information about issues that are specific to the Qt WebEngine module.
+ \brief Contains information about issues that are specific to the \QWE module.
- \section1 Building Qt WebEngine from Source
+ \section1 Building \QWE from Source
Static builds are not supported.
@@ -53,7 +53,7 @@
\li \l {macOS}
\endlist
- The tests for skipping the Qt WebEngine build are located in the
+ The tests for skipping the \QWE build are located in the
\c qtwebengine repository, in the \c tools\qmake\mkspecs subdirectory.
They can be found by searching for \c skipBuild.
@@ -71,8 +71,8 @@
On Windows, Visual Studio 2017 and Windows 10 SDK are required.
- Qt WebEngine can only be built on 64-bit Windows, with a x64-bit toolchain.
- For building Qt WebEngine for x86 applications, you need to configure
+ \QWE can only be built on 64-bit Windows, with a x64-bit toolchain.
+ For building \QWE for x86 applications, you need to configure
and compile Qt with the Visual Studio 2017 x64 to x86 cross-compile
toolchain. This toolchain can be set up on the command line by running
\c{vcvarsall.bat amd64_x86}.
@@ -82,7 +82,7 @@
On Linux, Clang or GCC version 5 or later is required.
Supported configurations are \c linux-g++ and \c{linux-clang}.
- Qt WebEngine requires \c pkg-config to detect most of its dependencies. The
+ \QWE requires \c pkg-config to detect most of its dependencies. The
following \c pkg-config files are required:
\list
@@ -115,13 +115,13 @@
\li \macos 10.12 SDK or later
\endlist
- \note Qt WebEngine cannot be built for the 32-bit mode of \macos (using the
+ \note \QWE cannot be built for the 32-bit mode of \macos (using the
\c macx-clang-32 \c mkspec).
- \section1 Using Earlier Qt Versions to Build Qt WebEngine
+ \section1 Using Earlier Qt Versions to Build \QWE
- Building Qt WebEngine with earlier Qt versions (down to the last LTS
- version) is supported. It means that Qt WebEngine 5.11 can be built with
+ Building \QWE with earlier Qt versions (down to the last LTS
+ version) is supported. It means that \QWE 5.11 can be built with
Qt 5.9.x, Qt 5.10.x, and Qt 5.11.
To use an earlier Qt version to build Qt Webengine:
@@ -134,7 +134,7 @@
\section1 Mac App Store Compatibility
- Applications using Qt WebEngine are not compatible with the Mac App Store, because:
+ Applications using \QWE are not compatible with the Mac App Store, because:
\list
\li The Chromium part of the code uses several private API methods, which are prohibited by
@@ -150,7 +150,7 @@
\section1 macOS Airplay Support on MacBooks with Dual GPUs
- To make Qt WebEngine work correctly when streaming to an AppleTV from a MacBook that supports
+ To make \QWE work correctly when streaming to an AppleTV from a MacBook that supports
GPU switching, it is important to add the \c NSSupportsAutomaticGraphicsSwitching option to the
application Info.plist file, with the value set to \c YES. Otherwise rendering issues might
occur when creating new web engine view instances after Airplay is switched on or off.
@@ -167,9 +167,9 @@
\section1 Sandboxing Support
- Qt WebEngine provides out-of-the-box sandboxing support for Chromium render processes on Linux
+ \QWE provides out-of-the-box sandboxing support for Chromium render processes on Linux
and \macos. Sandboxing is currently not supported on Windows due to a limitation in how
- the sandbox is set up and how it interacts with the host process provided by the Qt WebEngine
+ the sandbox is set up and how it interacts with the host process provided by the \QWE
libraries.
On \macos, there are no special requirements for enabling sandbox support.
@@ -184,7 +184,7 @@
\section1 Accessibility and Performance
- Qt WebEngine enables accessibility support for web pages when the following conditions
+ \QWE enables accessibility support for web pages when the following conditions
are met:
\list
@@ -197,7 +197,7 @@
Due to some limitations, the Linux QPA plugin almost always reports that accessibility should
be activated. On big HTML pages, this can cause a significant slowdown in rendering speed.
- Because of that, from Qt 5.9 onwards, Qt WebEngine accessibility support is disabled by default
+ Because of that, from Qt 5.9 onwards, \QWE accessibility support is disabled by default
on Linux.
It can be re-enabled by setting the \c QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment
variable to a non-empty value.
diff --git a/src/webengine/doc/src/qwebengine-licensing.qdoc b/src/webengine/doc/src/qwebengine-licensing.qdoc
index fa5d656d0..8795ca44c 100644
--- a/src/webengine/doc/src/qwebengine-licensing.qdoc
+++ b/src/webengine/doc/src/qwebengine-licensing.qdoc
@@ -30,7 +30,7 @@
\group qtwebengine-licensing
\title Qt WebEngine Licensing
-The Qt specific parts of the Qt WebEngine module are dual-licensed
+The Qt specific parts of the \QWE module are dual-licensed
under Commercial and GNU Lesser General Public License (LGPLv3).
In addition, the module contains code licensed under LGPLv2.
diff --git a/src/webengine/doc/src/webengineview_lgpl.qdoc b/src/webengine/doc/src/webengineview_lgpl.qdoc
index 3b375c532..9095fac65 100644
--- a/src/webengine/doc/src/webengineview_lgpl.qdoc
+++ b/src/webengine/doc/src/webengineview_lgpl.qdoc
@@ -213,7 +213,7 @@
An internal URL for accessing the currently displayed web site icon,
also known as favicon or shortcut icon. The icon is already downloaded
- and stored by the Qt WebEngine's favicon manager.
+ and stored by the \QWE's favicon manager.
This read-only URL corresponds to the image used within a mobile browser
application to represent a bookmarked page on the device's home screen.
@@ -230,7 +230,7 @@
\endqml
Specifying the \c{sourceSize} property of the \c{Image} element informs
- the Qt WebEngine's favicon provider about the requested size. The
+ the \QWE's favicon provider about the requested size. The
favicon provider tries to find the best fit among the web page candidate
icons. If \c{sourceSize} property is not specified, the provider provides
the icon with the largest resolution.
@@ -629,7 +629,7 @@
\value WebEngineView.NoErrorDomain
\value WebEngineView.InternalErrorDomain
- Content fails to be interpreted by Qt WebEngine.
+ Content fails to be interpreted by \QWE.
\value WebEngineView.ConnectionErrorDomain
Error results from faulty network connection.
\value WebEngineView.CertificateErrorDomain
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 e756ee157..4d3a71a79 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -104,6 +104,13 @@ QRectF RenderWidgetHostViewQtDelegateQuick::viewGeometry() const
return QRectF(mapToGlobal(QPointF(0, 0)), size());
}
+QRect RenderWidgetHostViewQtDelegateQuick::windowGeometry() const
+{
+ if (!window())
+ return QRect();
+ return window()->frameGeometry();
+}
+
void RenderWidgetHostViewQtDelegateQuick::setKeyboardFocus()
{
setFocus(true);
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
index 4edf37cff..00158b3ac 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h
@@ -60,6 +60,7 @@ public:
void initAsPopup(const QRect&) override;
QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
void setKeyboardFocus() override;
bool hasKeyboardFocus() override;
void lockMouse() override;
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
index 3c6c743e0..91ef84960 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
@@ -67,6 +67,11 @@ QRectF RenderWidgetHostViewQtDelegateQuickWindow::viewGeometry() const
return m_realDelegate->viewGeometry();
}
+QRect RenderWidgetHostViewQtDelegateQuickWindow::windowGeometry() const
+{
+ return frameGeometry();
+}
+
void RenderWidgetHostViewQtDelegateQuickWindow::show()
{
QQuickWindow::show();
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
index 039f6102a..35a30d976 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
@@ -57,6 +57,7 @@ public:
void initAsPopup(const QRect&) override;
QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
void setKeyboardFocus() override {}
bool hasKeyboardFocus() override { return false; }
void lockMouse() override {}
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index cd4b8ed81..19274bedf 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -64,7 +64,7 @@
namespace QtWebEngineCore {
#define NO_SEPARATOR
-#if defined(Q_OS_WIN)
+#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
#define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \
case UIDelegatesManager::TYPE:\
return QString::fromLatin1(#TYPE ##".qml");
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index deb92bfd3..4575f2929 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -117,7 +117,7 @@ static inline QWebEngineDownloadItem::DownloadInterruptReason toDownloadInterrup
\l{QWebEngineProfile::downloadRequested}{downloadRequested} signal together
with a newly created QWebEngineDownloadItem. The application can then
examine this item and decide whether to accept it or not. A signal handler
- must explicitly call accept() on the item for Qt WebEngine to actually start
+ must explicitly call accept() on the item for \QWE to actually start
downloading and writing data to disk. If no signal handler calls accept(),
then the download request will be automatically rejected and nothing will be
written to disk.
@@ -147,7 +147,7 @@ static inline QWebEngineDownloadItem::DownloadInterruptReason toDownloadInterrup
\section2 Web Page Downloads
In addition to normal file downloads, which consist simply of retrieving
- some raw bytes from the network and writing them to disk, Qt WebEngine also
+ some raw bytes from the network and writing them to disk, \QWE also
supports saving complete web pages, which involves parsing the page's HTML,
downloading any dependent resources, and potentially packaging everything
into a special file format (\l savePageFormat). To check if a download is
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 9c6749f39..e1b9a8fe3 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -485,7 +485,7 @@ void QWebEnginePagePrivate::authenticationRequired(QSharedPointer<Authentication
void QWebEnginePagePrivate::releaseProfile()
{
- qDebug("Release of profile requested but WebEnginePage still not deleted. Expect troubles !");
+ qWarning("Release of profile requested but WebEnginePage still not deleted. Expect troubles !");
// this is not the way to go, but might avoid the crash if user code does not make any calls to page.
delete q_ptr->d_ptr.take();
}
@@ -715,6 +715,13 @@ void QWebEnginePagePrivate::bindPageAndView(QWebEnginePage *page, QWebEngineView
view->d_func()->pageChanged(oldPage, page);
if (oldWidget != widget)
view->d_func()->widgetChanged(oldWidget, widget);
+
+ // At this point m_ownsPage should still refer to oldPage,
+ // it is only set for the new page after binding.
+ if (view->d_func()->m_ownsPage) {
+ delete oldPage;
+ view->d_func()->m_ownsPage = false;
+ }
}
}
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 47b3f4363..237d68473 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -403,6 +403,8 @@ QString QWebEngineProfile::downloadPath() const
}
/*!
+ \since 5.13
+
Overrides the default path used for download location, setting it to \a path.
If set to the null string, the default path is restored.
@@ -832,8 +834,8 @@ void QWebEngineProfile::removeAllUrlSchemeHandlers()
Currently only affects Linux/NSS installations where it enables OCSP.
- As long as one profile has this option enabled, all other profiles will be
- able to use it for their certificate verification.
+ As long as one profile has \a enabled set to \c true, all other profiles
+ will be able to use it for their certificate verification.
\sa isUsedForGlobalCertificateVerification(), httpCacheType()
*/
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 91fc86cdf..6c08df343 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -126,6 +126,7 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje
QWebEngineViewPrivate::QWebEngineViewPrivate()
: page(0)
, m_dragEntered(false)
+ , m_ownsPage(false)
{
#ifndef QT_NO_ACCESSIBILITY
QAccessible::installFactory(&webAccessibleFactory);
@@ -176,6 +177,7 @@ QWebEnginePage* QWebEngineView::page() const
if (!d->page) {
QWebEngineView *that = const_cast<QWebEngineView*>(this);
that->setPage(new QWebEnginePage(that));
+ d->m_ownsPage = true;
}
return d->page;
}
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index 28fb883aa..7848e0cf3 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -77,6 +77,7 @@ public:
QWebEnginePage *page;
bool m_dragEntered;
+ mutable bool m_ownsPage;
};
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
index b6c5cb497..a9e0e69ea 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
@@ -28,13 +28,13 @@
/*!
\group webengine-widgetexamples
\title Qt WebEngine Widgets Examples
- \brief Examples demonstrating the Qt WebEngine Widgets usage.
+ \brief Examples demonstrating the \QWE Widgets usage.
\ingroup all-examples
Qt provides an integrated Web browser component based on Chromium, the popular
open source browser engine.
- These examples and demonstrations show a range of different uses for Qt WebEngine,
+ These examples and demonstrations show a range of different uses for \QWE,
from displaying Web pages within a Qt user interface to an implementation of
a basic function Web browser.
*/
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
index abfd17ce3..b93bc86f2 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
@@ -67,7 +67,7 @@
This is a snapshot of the integration of Chromium into Qt.
Qt Commercial Edition licensees that wish to distribute applications that
- use the Qt WebEngine module need to be aware of their obligations under the
+ use the \QWE module need to be aware of their obligations under the
GNU Library General Public License (LGPLv2).
Developers using the Open Source Edition can choose to redistribute
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
index 35fed802c..6f3eac5ad 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
@@ -33,7 +33,7 @@
\ingroup qtwebengine-modules
\qtvariable webenginewidgets
- The Qt WebEngineWidgets module provides a web browser engine as well as C++ classes to render
+ The \QWEWidgets module provides a web browser engine as well as C++ classes to render
and interact with web content.
To include the definitions of the module's classes, use the
diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
index 7bc7ff48d..e3fdc4ff1 100644
--- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
@@ -28,7 +28,7 @@
/*!
\page qtwebenginewidgets-qtwebkitportingguide.html
\title Porting from Qt WebKit to Qt WebEngine
- \brief Overview of the differences between the Qt WebKit and Qt WebEngine API.
+ \brief Overview of the differences between the Qt \WebKit and \QWE API.
The following sections contain information about porting an application that uses the
\l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
@@ -37,17 +37,17 @@
\section1 Architecture
- Chromium provides its own network and painting engines, which Qt WebEngine uses. This, among
- other things, allows Qt WebEngine to provide better and more reliable support for the latest
- HTML5 specification than Qt WebKit. However, Qt WebEngine is thus also heavier than Qt WebKit
+ Chromium provides its own network and painting engines, which \QWE uses. This, among
+ other things, allows \QWE to provide better and more reliable support for the latest
+ HTML5 specification than Qt \WebKit. However, \QWE is thus also heavier than Qt \WebKit
and does not provide direct access to the network stack and the HTML document through C++ APIs.
\section1 Class Names
- The Qt WebEngine equivalent of Qt WebKit C++ classes are prefixed by
+ The \QWE equivalent of Qt \WebKit C++ classes are prefixed by
"\e QWebEngine" instead of "\e QWeb".
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
#include <QWebHistory>
#include <QWebHistoryItem>
@@ -59,7 +59,7 @@
QWebPage
QWebView
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
#include <QWebEngineHistory>
#include <QWebEngineHistoryItem>
@@ -77,23 +77,23 @@
\section2 In qmake Project Files
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QT += webkitwidgets
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QT += webenginewidgets
\endcode
\section2 Including the Module in Source Files
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
#include <QtWebKit/QtWebKit>
#include <QtWebKitWidgets/QtWebKitWidgets> // With Qt >= 4.8
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
#include <QtWebEngineWidgets/QtWebEngineWidgets>
\endcode
@@ -104,22 +104,22 @@
HTML frames can be used to divide web pages into several areas where the content can be
represented individually.
- In Qt WebKit, QWebFrame represents a frame inside a web page. Each QWebPage object contains at
+ In Qt \WebKit, QWebFrame represents a frame inside a web page. Each QWebPage object contains at
least one frame, the main frame, obtained using QWebPage::mainFrame(). Additional frames will
be created for the HTML \c <frame> element, which defines the appearance and contents of a
single frame, or the \c <iframe> element, which inserts a frame within a block of text.
- In Qt WebEngine, frame handling has been merged into the QWebEnginePage class. All child frames
+ In \QWE, frame handling has been merged into the QWebEnginePage class. All child frames
are now considered part of the content, and only accessible through JavaScript. Methods of the
QWebFrame class, such as \c load() are now available directly through the QWebEnginePage itself.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage page;
connect(page.mainFrame(), SIGNAL(urlChanged(const QUrl&)), SLOT(mySlotName()));
page.mainFrame()->load(url);
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QWebEnginePage page;
connect(&page, SIGNAL(urlChanged(const QUrl&)), SLOT(mySlotName()));
@@ -129,12 +129,12 @@
\section1 Some Methods Now Return Their Result Asynchronously
- Because Qt WebEngine uses a multi-process architecture, calls to some methods from applications
+ Because \QWE uses a multi-process architecture, calls to some methods from applications
will return immediately, while the results should be received asynchronously via a callback
mechanism. A function pointer, a functor, or a lambda expression must be provided to handle the
results when they become available.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage *page = new QWebPage;
QTextEdit *textEdit = new QTextEdit;
@@ -142,7 +142,7 @@
textEdit->setPlainText(page->toHtml());
textEdit->setPlainText(page->toPlainText());
\endcode
- \b {Qt WebEngine (with a lambda function in C++11)}
+ \b {\QWE (with a lambda function in C++11)}
\code
QWebEnginePage *page = new QWebEnginePage;
QTextEdit *textEdit = new QTextEdit;
@@ -150,7 +150,7 @@
page->toHtml([textEdit](const QString &result){ textEdit->setPlainText(result); });
page->toPlainText([textEdit](const QString &result){ textEdit->setPlainText(result); });
\endcode
- \b {Qt WebEngine (with a functor template wrapping a member function)}
+ \b {\QWE (with a functor template wrapping a member function)}
\code
template<typename Arg, typename R, typename C>
struct InvokeWrapper {
@@ -174,7 +174,7 @@
page->toHtml(invoke(textEdit, &QTextEdit::setPlainText));
page->toPlainText(invoke(textEdit, &QTextEdit::setPlainText));
\endcode
- \b {Qt WebEngine (with a regular functor)}
+ \b {\QWE (with a regular functor)}
\code
struct SetPlainTextFunctor {
QTextEdit *textEdit;
@@ -192,29 +192,29 @@
\endcode
- \section1 Qt WebEngine Does Not Interact with QNetworkAccessManager
+ \section1 \QWE Does Not Interact with QNetworkAccessManager
Some classes of Qt Network such as QAuthenticator were reused for their interface
- but, unlike Qt WebKit, Qt WebEngine has its own HTTP implementation and cannot
+ but, unlike Qt \WebKit, \QWE has its own HTTP implementation and cannot
go through a QNetworkAccessManager.
The signals and methods of QNetworkAccessManager that are still supported were
moved to the QWebEnginePage class.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QNetworkAccessManager qnam;
QWebPage page;
page.setNetworkAccessManager(&qnam);
connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticate(QNetworkReply*,QAuthenticator*)));
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QWebEnginePage page;
connect(&page, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticate(QNetworkReply*,QAuthenticator*)));
\endcode
- \note In Qt WebEngine, the QAuthenticator must be explicitly set to null to
+ \note In \QWE, the QAuthenticator must be explicitly set to null to
cancel authentication:
\code
@@ -233,12 +233,12 @@
It is currently only possible to run JavaScript on the main frame of a page and the
result is returned asynchronously to the provided functor.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage *page = new QWebPage;
qDebug() << page->mainFrame()->evaluateJavaScript("'Java' + 'Script'");
\endcode
- \b {Qt WebEngine (with lambda expressions in C++11)}
+ \b {\QWE (with lambda expressions in C++11)}
\code
QWebEnginePage *page = new QWebEnginePage;
page->runJavaScript("'Java' + 'Script'", [](const QVariant &result){ qDebug() << result; });
@@ -255,12 +255,12 @@
the contentEditable attribute in the latest HTML standard. Therefore, QWebEnginePage::runJavaScript
is all that is needed.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage page;
page.setContentEditable(true);
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QWebEnginePage page;
page.runJavaScript("document.documentElement.contentEditable = true");
@@ -269,35 +269,35 @@
\section1 Unavailable Qt WebKit API
- The Qt WebKit classes and methods in this list will not be available in Qt WebEngine.
+ The Qt \WebKit classes and methods in this list will not be available in \QWE.
\table
\row
\li QGraphicsWebView
- \li Qt WebEngine is designed for being used with hardware acceleration. Because we could not
+ \li \QWE is designed for being used with hardware acceleration. Because we could not
support a web view class in a QGraphicsView unless it would be attached to a QGLWidget
viewport, this feature is out of scope.
\row
\li QWebElement
- \li Qt WebEngine uses a multi-process architecture and this means that
+ \li \QWE uses a multi-process architecture and this means that
any access to the internal structure of the page has to be done
asynchronously, any query result must be returned through callbacks.
The QWebElement API was designed for synchronous access and this
would require a complete redesign.
\row
\li QWebDatabase
- \li The Web SQL Database feature that this API was wrapping in Qt WebKit
+ \li The Web SQL Database feature that this API was wrapping in Qt \WebKit
was dropped from the HTML5 standard.
\row
\li QWebPluginDatabase, QWebPluginFactory, QWebPluginInfo, QWebPage::setPalette,
QWebView::setRenderHints
- \li Qt WebEngine renders web pages using Skia and is not using QPainter
+ \li \QWE renders web pages using Skia and is not using QPainter
or Qt for this purpose. The HTML5 standard also now offers much
better alternatives that were not available when native controls
- plugins were introduced in Qt WebKit.
+ plugins were introduced in Qt \WebKit.
\row
\li QWebHistoryInterface
- \li Visited links are persisted automatically by Qt WebEngine.
+ \li Visited links are persisted automatically by \QWE.
\row
\li QWebPage::setContentEditable
\li In the latest HTML standard, any document element can be made editable through the
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index f9ab710d1..c451344d2 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -440,7 +440,7 @@
/*!
\fn void QWebEnginePage::triggerAction(WebAction action, bool checked = false)
This function can be called to trigger the specified \a action.
- It is also called by Qt WebEngine if the user triggers the action, for example
+ It is also called by \QWE if the user triggers the action, for example
through a context menu item.
If \a action is a checkable action, then \a checked specifies whether the action
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 568e7a63a..fce1e8d8f 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -33,7 +33,7 @@
\inmodule QtWebEngineWidgets
- A \e {web view} is the main widget component of the Qt WebEngine web browsing module.
+ A \e {web view} is the main widget component of the \QWE web browsing module.
It can be used in various applications to display web content live from the
Internet.
@@ -129,7 +129,7 @@
The HTML document is loaded immediately, whereas external objects are loaded asynchronously.
- When using this method, Qt WebEngine assumes that external resources, such as
+ When using this method, \QWE assumes that external resources, such as
JavaScript programs or style sheets, are encoded in UTF-8 unless otherwise
specified. For example, the encoding of an external script can be specified
through the \c charset attribute of the HTML script tag. Alternatively, the
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 140314681..817d6e408 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -238,6 +238,13 @@ QRectF RenderWidgetHostViewQtDelegateWidget::viewGeometry() const
return QRectF(mapToGlobal(pos()), size());
}
+QRect RenderWidgetHostViewQtDelegateWidget::windowGeometry() const
+{
+ if (!window())
+ return QRect();
+ return window()->frameGeometry();
+}
+
void RenderWidgetHostViewQtDelegateWidget::setKeyboardFocus()
{
// The root item always has focus within the root focus scope:
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
index a736aa5cf..7746c4405 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
@@ -67,6 +67,7 @@ public:
void initAsPopup(const QRect&) override;
QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
void setKeyboardFocus() override;
bool hasKeyboardFocus() override;
void lockMouse() override;
diff --git a/tests/auto/quick/dialogs/WebView.qml b/tests/auto/quick/dialogs/WebView.qml
index 6509071b8..4f8b7a0ce 100644
--- a/tests/auto/quick/dialogs/WebView.qml
+++ b/tests/auto/quick/dialogs/WebView.qml
@@ -59,6 +59,8 @@ Window {
onLoadingChanged: function(reqeust) {
if (reqeust.status === WebEngineView.LoadSucceededStatus) {
handler.ready = true
+ } else {
+ console.log("Wooohooo loading page from qrc failed !")
}
}
diff --git a/tests/auto/quick/dialogs/tst_dialogs.cpp b/tests/auto/quick/dialogs/tst_dialogs.cpp
index 26a0fe034..eee6b2bb6 100644
--- a/tests/auto/quick/dialogs/tst_dialogs.cpp
+++ b/tests/auto/quick/dialogs/tst_dialogs.cpp
@@ -116,7 +116,7 @@ void tst_Dialogs::colorDialogRequested()
void tst_Dialogs::contextMenuRequested()
{
m_listner->load(QUrl("qrc:/index.html"));
- QTRY_VERIFY(m_listner->ready());
+ QTRY_COMPARE_WITH_TIMEOUT(m_listner->ready(), true, 20000);
QSignalSpy dialogSpy(m_listner, &TestHandler::requestChanged);
QTest::mouseClick(m_widnow, Qt::RightButton);
QTRY_COMPARE(dialogSpy.count(), 1);
@@ -226,6 +226,7 @@ void tst_Dialogs::javaScriptDialogRequested()
QCOMPARE(dialog->type(), type);
QCOMPARE(dialog->message(), message);
QCOMPARE(dialog->defaultText(), defaultText);
+ QTRY_VERIFY(m_listner->ready()); // make sure javascript executes no longer
}
#include "tst_dialogs.moc"
diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index dfafbaea4..957911c3b 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -4,15 +4,6 @@ osx
[WebViewGeopermission::test_geoPermissionRequest]
osx
-[WebEngineViewSingleFileUpload::test_acceptDirectory]
-*
-
-[WebEngineViewSingleFileUpload::test_acceptMultipleFilesSelection]
-*
-
-[WebEngineViewSingleFileUpload::test_acceptSingleFileSelection]
-*
-
[WebViewFindText::test_findTextInterruptedByLoad]
*
diff --git a/tests/auto/quick/qmltests/data/multifileupload.html b/tests/auto/quick/qmltests/data/multifileupload.html
index 1f788a377..d41ea15c0 100644
--- a/tests/auto/quick/qmltests/data/multifileupload.html
+++ b/tests/auto/quick/qmltests/data/multifileupload.html
@@ -1,7 +1,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<title> Mutli-file Upload </title>
+<title> Failed to Upload </title>
<script src = "./titleupdate.js">
</script>
</head>
diff --git a/tests/auto/quick/qmltests/data/singlefileupload.html b/tests/auto/quick/qmltests/data/singlefileupload.html
index 6cfef7ade..ac91c2c0d 100644
--- a/tests/auto/quick/qmltests/data/singlefileupload.html
+++ b/tests/auto/quick/qmltests/data/singlefileupload.html
@@ -1,7 +1,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<title> Single File Upload </title>
+<title> Failed to Upload </title>
<script src = "./titleupdate.js">
</script>
</head>
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 655789bb3..2f813b966 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -70,16 +70,61 @@ TestWebEngineView {
webEngineView.waitForLoadSucceeded()
}
- function test_acceptSingleFileSelection() {
- webEngineView.url = Qt.resolvedUrl("singlefileupload.html")
- verify(webEngineView.waitForLoadSucceeded())
+ function test_acceptSingleFileSelection_data() {
+ return [
+ { tag: "/test.txt)", input: "/test.txt", passDefaultDialog: false, passCustomDialog: true },
+ { tag: "/tést.txt", input: "/tést.txt", passDefaultDialog: false, passCustomDialog: true },
+ { tag: "file:///test.txt", input: "file:///test.txt", passDefaultDialog: true, passCustomDialog: false },
+ { tag: "file:///tést.txt", input: "file:///tést.txt", passDefaultDialog: true, passCustomDialog: false },
+ { tag: "file:///t%C3%A9st.txt", input: "file:///t%C3%A9st.txt", passDefaultDialog: true, passCustomDialog: false },
+ { tag: "file://test.txt", input: "file://test.txt", passDefaultDialog: false, passCustomDialog: false },
+ { tag: "file:/test.txt", input: "file:/test.txt", passDefaultDialog: true, passCustomDialog: false },
+ { tag: "file:test//test.txt", input: "file:test//test.txt", passDefaultDialog: false, passCustomDialog: false },
+ { tag: "http://test.txt", input: "http://test.txt", passDefaultDialog: false, passCustomDialog: false },
+ { tag: "qrc:/test.txt", input: "qrc:/test.txt", passDefaultDialog: false, passCustomDialog: false },
+ ];
+ }
- FilePickerParams.selectFiles = true
- FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test1.html"))
+ function test_acceptSingleFileSelection(row) {
+ var expectedFileName;
- keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true)
- tryCompare(webEngineView, "title", "test1.html")
+ // Default dialog (expects URL).
+ expectedFileName = "Failed to Upload";
+ if (row.passDefaultDialog)
+ expectedFileName = row.input.slice(row.input.lastIndexOf('/') + 1);
+
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl.push(row.input);
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryCompare(webEngineView, "title", decodeURIComponent(expectedFileName));
+
+
+ // Custom dialog (expects absolute path).
+ var finished = false;
+
+ expectedFileName = "Failed to Upload";
+ if (row.passCustomDialog)
+ expectedFileName = row.input.slice(row.input.lastIndexOf('/') + 1);
+
+ function acceptedFileHandler(request) {
+ request.accepted = true;
+ request.dialogAccept(row.input);
+ finished = true;
+ }
+
+ webEngineView.fileDialogRequested.connect(acceptedFileHandler);
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryVerify(function() { return finished; });
+ tryCompare(webEngineView, "title", expectedFileName);
+ webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
}
function test_acceptMultipleFilesSelection() {
@@ -102,9 +147,10 @@ TestWebEngineView {
FilePickerParams.selectFiles = true
FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data"))
- keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
+ keyClick(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
tryCompare(FilePickerParams, "filePickerOpened", true)
- tryCompare(webEngineView, "title", "data")
+ // Check that the title is a file list (eg. "test1.html,test2.html")
+ tryVerify(function() { return webEngineView.title.match("^([^,]+,)+[^,]+$"); })
}
function test_reject() {
@@ -116,5 +162,45 @@ TestWebEngineView {
wait(100)
compare(titleSpy.count, 0)
}
+
+ function test_acceptMultipleFilesWithCustomDialog_data() {
+ return [
+ { tag: "path", input: ["/test1.txt", "/test2.txt"], expectedValueForDefaultDialog: "Failed to Upload", expectedValueForCustomDialog: "test1.txt,test2.txt" },
+ { tag: "file", input: ["file:///test1.txt", "file:///test2.txt"], expectedValueForDefaultDialog: "test1.txt,test2.txt", expectedValueForCustomDialog: "Failed to Upload" },
+ { tag: "mixed", input: ["file:///test1.txt", "/test2.txt"], expectedValueForDefaultDialog: "test1.txt", expectedValueForCustomDialog: "test2.txt" },
+ ];
+ }
+
+ function test_acceptMultipleFilesWithCustomDialog(row) {
+ // Default dialog (expects URL).
+ webEngineView.url = Qt.resolvedUrl("multifileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl = row.input;
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryCompare(webEngineView, "title", row.expectedValueForDefaultDialog);
+
+
+ // Custom dialog (expects absolute path).
+ var finished = false;
+
+ function acceptedFileHandler(request) {
+ request.accepted = true;
+ request.dialogAccept(row.input);
+ finished = true;
+ }
+
+ webEngineView.fileDialogRequested.connect(acceptedFileHandler);
+ webEngineView.url = Qt.resolvedUrl("multifileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryVerify(function() { return finished; });
+ tryCompare(webEngineView, "title", row.expectedValueForCustomDialog);
+ webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
+ }
}
}
diff --git a/tests/auto/widgets/offscreen/test.html b/tests/auto/widgets/offscreen/test.html
new file mode 100644
index 000000000..55063539f
--- /dev/null
+++ b/tests/auto/widgets/offscreen/test.html
@@ -0,0 +1,7 @@
+<html>
+<head><title>TEST</title></head>
+<body>
+Eat me !
+</body>
+</html>
+
diff --git a/tests/auto/widgets/offscreen/tst_offscreen.cpp b/tests/auto/widgets/offscreen/tst_offscreen.cpp
index 98cbe55fe..7573b0537 100644
--- a/tests/auto/widgets/offscreen/tst_offscreen.cpp
+++ b/tests/auto/widgets/offscreen/tst_offscreen.cpp
@@ -49,10 +49,11 @@ void tst_OffScreen::offscreen()
QWebEngineView view;
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
view.setPage(&page);
- page.load(QUrl("http://qt.io"));
+ page.load(QUrl("qrc:/test.html"));
view.show();
QTRY_COMPARE(view.isVisible(), true);
QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count() > 0, true, 20000);
+ QCOMPARE(loadFinishedSpy.takeFirst().at(0).toBool(), true);
}
#include "tst_offscreen.moc"
diff --git a/tests/auto/widgets/offscreen/tst_offscreen.qrc b/tests/auto/widgets/offscreen/tst_offscreen.qrc
new file mode 100644
index 000000000..8a998fe85
--- /dev/null
+++ b/tests/auto/widgets/offscreen/tst_offscreen.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>test.html</file>
+</qresource>
+</RCC>
+
diff --git a/tests/auto/widgets/origins/tst_origins.cpp b/tests/auto/widgets/origins/tst_origins.cpp
index 61d16bc8a..c1307c5e6 100644
--- a/tests/auto/widgets/origins/tst_origins.cpp
+++ b/tests/auto/widgets/origins/tst_origins.cpp
@@ -172,6 +172,7 @@ private Q_SLOTS:
void cleanupTestCase();
void jsUrlCanon();
+ void jsUrlRelative();
void jsUrlOrigin();
void subdirWithAccess();
void subdirWithoutAccess();
@@ -281,6 +282,54 @@ void tst_Origins::jsUrlCanon()
QVariant(QSL("hostportanduserinformationsyntax://a:b@foo/bar")));
}
+// Test relative URL resolution.
+void tst_Origins::jsUrlRelative()
+{
+ QVERIFY(load(QSL("about:blank")));
+
+ // Schemes with hosts, like http, work as expected.
+ QCOMPARE(eval(QSL("new URL('bar', 'http://foo').href")), QVariant(QSL("http://foo/bar")));
+ QCOMPARE(eval(QSL("new URL('baz', 'http://foo/bar').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('/baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('./baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('../baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('../../baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('//baz', 'http://foo/bar/').href")), QVariant(QSL("http://baz/")));
+
+ // In the case of schemes without hosts, relative URLs only work if the URL
+ // starts with a single slash -- and canonicalization does not guarantee
+ // this. The following cases all fail with TypeErrors.
+ QCOMPARE(eval(QSL("new URL('bar', 'tst:foo').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('baz', 'tst:foo/bar').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('bar', 'tst://foo').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('bar', 'tst:///foo').href")), QVariant());
+
+ // However, registered custom schemes have been patched to allow relative
+ // URLs even without an initial slash.
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:foo').href")), QVariant(QSL("qrc:bar")));
+ QCOMPARE(eval(QSL("new URL('baz', 'qrc:foo/bar').href")), QVariant(QSL("qrc:foo/baz")));
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc://foo').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:///foo').href")), QVariant());
+
+ // With a slash it works the same as http except 'foo' is part of the path and not the host.
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:/foo').href")), QVariant(QSL("qrc:/bar")));
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:/foo/').href")), QVariant(QSL("qrc:/foo/bar")));
+ QCOMPARE(eval(QSL("new URL('baz', 'qrc:/foo/bar').href")), QVariant(QSL("qrc:/foo/baz")));
+ QCOMPARE(eval(QSL("new URL('baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('/baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
+ QCOMPARE(eval(QSL("new URL('./baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/baz")));
+ QCOMPARE(eval(QSL("new URL('../../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
+ QCOMPARE(eval(QSL("new URL('../../../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
+
+ // If the relative URL begins with >= 2 slashes, then the scheme is treated
+ // not as a Syntax::Path scheme but as a Syntax::HostPortAndUserInformation
+ // scheme.
+ QCOMPARE(eval(QSL("new URL('//baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc://baz/")));
+ QCOMPARE(eval(QSL("new URL('///baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc://baz/")));
+}
+
// Test origin serialization in Blink, implemented by blink::KURL and
// blink::SecurityOrigin as opposed to GURL and url::Origin.
void tst_Origins::jsUrlOrigin()
diff --git a/tests/auto/widgets/proxypac/proxypac.pro b/tests/auto/widgets/proxypac/proxypac.pro
index 1c2958d3a..4dbcd9365 100644
--- a/tests/auto/widgets/proxypac/proxypac.pro
+++ b/tests/auto/widgets/proxypac/proxypac.pro
@@ -4,7 +4,8 @@ HEADERS += proxyserver.h
SOURCES += proxyserver.cpp
proxy_pac.name = QTWEBENGINE_CHROMIUM_FLAGS
-proxy_pac.value = --proxy-pac-url="file://$$PWD/proxy.pac"
+boot2qt:proxy_pac.value = "--single-process --no-sandbox --proxy-pac-url=file://$$PWD/proxy.pac"
+else: proxy_pac.value = --proxy-pac-url="file://$$PWD/proxy.pac"
QT_TOOL_ENV += proxy_pac
diff --git a/tests/auto/widgets/qwebenginedownloaditem/BLACKLIST b/tests/auto/widgets/qwebenginedownloaditem/BLACKLIST
deleted file mode 100644
index a51117ae0..000000000
--- a/tests/auto/widgets/qwebenginedownloaditem/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[downloadToReadOnlyDir]
-windows
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
index 8669c8f94..3a38c115d 100644
--- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
+++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
@@ -73,7 +73,7 @@ private Q_SLOTS:
void downloadDeletedByProfile();
void downloadUniqueFilename_data();
void downloadUniqueFilename();
- void downloadUniqueFileNameWithTimeStamp();
+ void downloadUniqueFilenameWithTimestamp();
void downloadToDefaultLocation();
void downloadToNonExistentDir();
void downloadToReadOnlyDir();
@@ -917,11 +917,8 @@ void tst_QWebEngineDownloadItem::downloadUniqueFilename()
}
}
-void tst_QWebEngineDownloadItem::downloadUniqueFileNameWithTimeStamp()
+void tst_QWebEngineDownloadItem::downloadUniqueFilenameWithTimestamp()
{
-#ifdef Q_OS_WIN
- QSKIP("QTBUG-74764: The download completes after the test fails thus would ruin subsequent tests on Windows.");
-#endif
// Set up HTTP server
QString baseName("test(1.test)");
QString extension("txt");
@@ -988,8 +985,8 @@ void tst_QWebEngineDownloadItem::downloadUniqueFileNameWithTimeStamp()
QRegularExpressionMatch match = fileNameCheck.match(downloadedFilePath);
QVERIFY(match.hasMatch());
// ISO 8601 Date and time in UTC
- QRegExp timeStamp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])([.][0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$");
- QVERIFY(timeStamp.exactMatch(match.captured(1)));
+ QRegExp timestamp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9])([.][0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9])[0-5][0-9])?$");
+ QVERIFY(timestamp.exactMatch(match.captured(1)));
}
}
@@ -1062,6 +1059,9 @@ void tst_QWebEngineDownloadItem::downloadToNonExistentDir()
void tst_QWebEngineDownloadItem::downloadToReadOnlyDir()
{
+#ifdef Q_OS_WIN
+ QSKIP("Cannot change file permissions on Windows.");
+#endif
QString baseName("test(1.test)");
QString extension("txt");
QString fileName = QString("%1.%2").arg(baseName).arg(extension);
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 9ba242e68..19f9b6df1 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -200,6 +200,7 @@ private Q_SLOTS:
void notificationRequest_data();
void notificationRequest();
void sendNotification();
+ void contentsSize();
private:
static QPoint elementCenter(QWebEnginePage *page, const QString &id);
@@ -3357,6 +3358,34 @@ void tst_QWebEnginePage::sendNotification()
QTRY_VERIFY2(page.messages.contains("onclose"), page.messages.join("\n").toLatin1().constData());
}
+void tst_QWebEnginePage::contentsSize()
+{
+ m_view->resize(800, 600);
+ m_view->show();
+
+ QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
+ QSignalSpy contentsSizeChangedSpy(m_page, &QWebEnginePage::contentsSizeChanged);
+
+ m_view->setHtml(QString("<html><body style=\"width: 1600px; height: 1200px;\"><p>hi</p></body></html>"));
+
+ QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(contentsSizeChangedSpy.count(), 1);
+
+ // Verify the page's contents size is not limited by the view's size.
+ QCOMPARE(m_page->contentsSize().width(), 1608);
+ QCOMPARE(m_page->contentsSize().height(), 1216);
+
+ // Verify resizing the view does not affect the contents size.
+ m_view->resize(2400, 1800);
+ QCOMPARE(m_page->contentsSize().width(), 1608);
+ QCOMPARE(m_page->contentsSize().height(), 1216);
+
+ // Verify resizing the view does not affect the contents size.
+ m_view->resize(1600, 1200);
+ QCOMPARE(m_page->contentsSize().width(), 1608);
+ QCOMPARE(m_page->contentsSize().height(), 1216);
+}
+
static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
W_QTEST_MAIN(tst_QWebEnginePage, params)
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index ebd25e892..1822069be 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -213,9 +213,8 @@ public:
void requestStarted(QWebEngineUrlRequestJob *job)
{
- QBuffer *buffer = new QBuffer;
+ QBuffer *buffer = new QBuffer(job);
buffer->setData(job->requestUrl().toString().toUtf8());
- connect(buffer, &QIODevice::aboutToClose, buffer, &QObject::deleteLater);
m_buffers.append(buffer);
job->reply("text/plain;charset=utf-8", buffer);
}
@@ -634,14 +633,16 @@ void tst_QWebEngineProfile::initiator()
void tst_QWebEngineProfile::qtbug_71895()
{
QWebEngineView view;
+ QSignalSpy loadSpy(view.page(), SIGNAL(loadFinished(bool)));
view.setUrl(QUrl("https://www.qt.io"));
view.show();
- QSignalSpy loadSpy(view.page(), SIGNAL(loadFinished(bool)));
view.page()->profile()->clearHttpCache();
view.page()->profile()->setHttpCacheType(QWebEngineProfile::NoCache);
view.page()->profile()->cookieStore()->deleteAllCookies();
view.page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
+ bool gotSignal = loadSpy.count() || loadSpy.wait(20000);
+ if (!gotSignal)
+ QSKIP("Couldn't load page from network, skipping test.");
}
diff --git a/tests/auto/widgets/qwebenginescript/BLACKLIST b/tests/auto/widgets/qwebenginescript/BLACKLIST
deleted file mode 100644
index b641aaf04..000000000
--- a/tests/auto/widgets/qwebenginescript/BLACKLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-# FIXME post 72-merge
-[webChannelWithBadString]
-*
diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
index 0fe0ec6cf..9a2ee9311 100644
--- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
+++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
@@ -23,6 +23,7 @@
#include <qwebengineprofile.h>
#include <qwebenginescript.h>
#include <qwebenginescriptcollection.h>
+#include <qwebenginesettings.h>
#include <qwebengineview.h>
#include "../util.h"
#if QT_CONFIG(webengine_webchannel)
@@ -37,6 +38,8 @@ private Q_SLOTS:
void loadEvents();
void scriptWorld_data();
void scriptWorld();
+ void scriptDisabled();
+ void viewSource();
void scriptModifications();
#if QT_CONFIG(webengine_webchannel)
void webChannel_data();
@@ -218,6 +221,50 @@ void tst_QWebEngineScript::scriptWorld()
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "typeof(userScriptTest) != \"undefined\" && userScriptTest == 1;", worldId), QVariant::fromValue(true));
}
+// Based on QTBUG-74304
+void tst_QWebEngineScript::scriptDisabled()
+{
+ QWebEnginePage page;
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
+ QWebEngineScript script;
+ script.setInjectionPoint(QWebEngineScript::DocumentCreation);
+ script.setWorldId(QWebEngineScript::MainWorld);
+ script.setSourceCode("var foo = 42");
+ page.scripts().insert(script);
+ page.load(QUrl("about:blank"));
+ QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
+ QTRY_COMPARE(spy.count(), 1);
+ QCOMPARE(spy.takeFirst().value(0).toBool(), true);
+ // MainWorld scripts are disabled by the setting...
+ QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "foo", QWebEngineScript::MainWorld), QVariant());
+ QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "foo", QWebEngineScript::ApplicationWorld), QVariant());
+ script.setWorldId(QWebEngineScript::ApplicationWorld);
+ page.scripts().clear();
+ page.scripts().insert(script);
+ page.load(QUrl("about:blank"));
+ QTRY_COMPARE(spy.count(), 1);
+ QCOMPARE(spy.takeFirst().value(0).toBool(), true);
+ // ...but ApplicationWorld scripts should still work
+ QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "foo", QWebEngineScript::MainWorld), QVariant());
+ QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "foo", QWebEngineScript::ApplicationWorld), QVariant(42));
+}
+
+// Based on QTBUG-66011
+void tst_QWebEngineScript::viewSource()
+{
+ QWebEnginePage page;
+ QWebEngineScript script;
+ script.setInjectionPoint(QWebEngineScript::DocumentCreation);
+ script.setWorldId(QWebEngineScript::MainWorld);
+ script.setSourceCode("var foo = 42");
+ page.scripts().insert(script);
+ page.load(QUrl("view-source:about:blank"));
+ QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
+ QTRY_COMPARE(spy.count(), 1);
+ QCOMPARE(spy.takeFirst().value(0).toBool(), true);
+ QCOMPARE(evaluateJavaScriptSync(&page, "foo"), QVariant(42));
+}
+
void tst_QWebEngineScript::scriptModifications()
{
QWebEnginePage page;
@@ -499,7 +546,9 @@ void tst_QWebEngineScript::webChannelWithBadString()
page.setWebChannel(&channel);
page.setUrl(QStringLiteral("qrc:/resources/webChannelWithBadString.html"));
QVERIFY(hostSpy.wait(20000));
- QCOMPARE(host.text(), QString(QChar(QChar::ReplacementCharacter)));
+ // expect 0xD800 see https://chromium-review.googlesource.com/c/1282993
+ QChar data(0xd800);
+ QCOMPARE(host.text(), data);
}
#endif
QTEST_MAIN(tst_QWebEngineScript)
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 16a3d32b6..74adbaba9 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -196,6 +196,10 @@ private Q_SLOTS:
void deletePage();
void closeOpenerTab();
void switchPage();
+ void setPageDeletesImplicitPage();
+ void setViewDeletesImplicitPage();
+ void setPagePreservesExplicitPage();
+ void setViewPreservesExplicitPage();
};
// This will be called before the first test function is executed.
@@ -3197,5 +3201,47 @@ void tst_QWebEngineView::switchPage()
QTRY_COMPARE(webView.grab().toImage().pixelColor(QPoint(150,150)), Qt::black);
}
+void tst_QWebEngineView::setPageDeletesImplicitPage()
+{
+ QWebEngineView view;
+ QPointer<QWebEnginePage> implicitPage = view.page();
+ QWebEnginePage explicitPage;
+ view.setPage(&explicitPage);
+ QCOMPARE(view.page(), &explicitPage);
+ QVERIFY(!implicitPage); // should be deleted
+}
+
+void tst_QWebEngineView::setViewDeletesImplicitPage()
+{
+ QWebEngineView view;
+ QPointer<QWebEnginePage> implicitPage = view.page();
+ QWebEnginePage explicitPage;
+ explicitPage.setView(&view);
+ QCOMPARE(view.page(), &explicitPage);
+ QVERIFY(!implicitPage); // should be deleted
+}
+
+void tst_QWebEngineView::setPagePreservesExplicitPage()
+{
+ QWebEngineView view;
+ QPointer<QWebEnginePage> explicitPage1 = new QWebEnginePage(&view);
+ QPointer<QWebEnginePage> explicitPage2 = new QWebEnginePage(&view);
+ view.setPage(explicitPage1.data());
+ view.setPage(explicitPage2.data());
+ QCOMPARE(view.page(), explicitPage2.data());
+ QVERIFY(explicitPage1); // should not be deleted
+}
+
+void tst_QWebEngineView::setViewPreservesExplicitPage()
+{
+ QWebEngineView view;
+ QPointer<QWebEnginePage> explicitPage1 = new QWebEnginePage(&view);
+ QPointer<QWebEnginePage> explicitPage2 = new QWebEnginePage(&view);
+ explicitPage1->setView(&view);
+ explicitPage2->setView(&view);
+ QCOMPARE(view.page(), explicitPage2.data());
+ QVERIFY(explicitPage1); // should not be deleted
+}
+
QTEST_MAIN(tst_QWebEngineView)
#include "tst_qwebengineview.moc"
diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro
index c99640b4b..92159bf83 100644
--- a/tests/auto/widgets/widgets.pro
+++ b/tests/auto/widgets/widgets.pro
@@ -42,8 +42,6 @@ qtConfig(webengine-spellchecker):!cross_compile {
boot2qt: SUBDIRS -= accessibility defaultsurfaceformat devtools \
qwebenginepage \
qwebengineprofile \
- qwebengineview \
- qwebenginescript \
- proxypac offscreen
+ qwebengineview
win32: SUBDIRS -= offscreen
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py
index 6bce380e7..450671fa5 100644
--- a/tools/scripts/version_resolver.py
+++ b/tools/scripts/version_resolver.py
@@ -38,7 +38,7 @@ import json
import urllib2
import git_submodule as GitSubmodule
-chromium_version = '73.0.3683.64'
+chromium_version = '73.0.3683.105'
chromium_branch = '3683'
ninja_version = 'v1.9.0'