From 012b84d07bd58a4dbd8cc8a80fd4a636675fa88d Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 13 Dec 2022 12:18:03 +0000
Subject: [PATCH 001/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I74b162df346d99b87c4a0813b7dc32301cb9b0c4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 444f48dcf56..33360a34259 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a39dc2807c22c6819647bab1259ba8f7532e7f32
+    ref: fec2faa51d7420ee53fb4b0b20a9c9661ce2f651
     required: true
   ../qtpositioning:
-    ref: fb5deb7ca0ef88865674cdbfa096d8d510ca5717
+    ref: eb160fa1cf64f863669cd3f95c19e91a8a341255
     required: false
   ../qttools:
-    ref: f443f635e942fab8770a8eff6884bc60accb7e1d
+    ref: a0174a202c558ea8f539e88780941edba33e4a17
     required: false
   ../qtwebchannel:
-    ref: de6a637fd62c6635e49351837e7430f039dd2447
+    ref: 6e261cf66e4074409307eaec40d478ce09895a9b
     required: false

From 22b780041610d09b74a259169664ed7db01074b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 13 Dec 2022 01:02:30 +0100
Subject: [PATCH 002/681] Recreate response head objects on multiple redirect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The previous response head gets moved when redirecting, which lead to
dereferencing a null pointer on the next redirect.

Fixes: QTBUG-109357
Change-Id: Iaad1c46b8d4ca9720f1749980a9e06337ca0f3d8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c6b2b5d8038b3ec0de6233c1e21df60ade11c81b)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 .../net/proxying_url_loader_factory_qt.cpp    | 26 ++++++----
 .../CMakeLists.txt                            |  2 +
 .../resources/content3.html                   |  6 +++
 .../tst_qwebengineurlrequestinterceptor.cpp   | 47 +++++++++++++++++++
 4 files changed, 73 insertions(+), 8 deletions(-)
 create mode 100644 tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html

diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 49c76b84d27..2edf915c81b 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -30,6 +30,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+namespace {
+    network::mojom::URLResponseHeadPtr createResponse(const network::ResourceRequest &request) {
+        const bool disable_web_security = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebSecurity);
+        network::mojom::URLResponseHeadPtr response = network::mojom::URLResponseHead::New();
+        response->response_type = network::cors::CalculateResponseType(
+            request.mode, disable_web_security || (
+            request.request_initiator && request.request_initiator->IsSameOriginWith(url::Origin::Create(request.url))));
+
+        return response;
+    }
+}
+
 namespace QtWebEngineCore {
 
 ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, blink::mojom::ResourceType::kMainFrame)
@@ -188,11 +200,7 @@ InterceptedRequest::InterceptedRequest(ProfileAdapter *profile_adapter,
     , weak_factory_(this)
 {
     const bool disable_web_security = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebSecurity);
-    current_response_ = network::mojom::URLResponseHead::New();
-    current_response_->response_type = network::cors::CalculateResponseType(
-        request_.mode,
-        disable_web_security || (
-            request_.request_initiator && request_.request_initiator->IsSameOriginWith(url::Origin::Create(request_.url))));
+    current_response_ = createResponse(request_);
     // If there is a client error, clean up the request.
     target_client_.set_disconnect_handler(
             base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, base::Unretained(this)));
@@ -367,9 +375,6 @@ void InterceptedRequest::ContinueAfterIntercept()
                         first_party_url_policy, request_.referrer_policy, request_.referrer.spec(),
                         net::HTTP_TEMPORARY_REDIRECT, toGurl(info.url), absl::nullopt,
                         false /*insecure_scheme_was_upgraded*/);
-
-                // FIXME: Should probably create a new header.
-                current_response_->encoded_data_length = 0;
                 request_.method = redirectInfo.new_method;
                 request_.url = redirectInfo.new_url;
                 request_.site_for_cookies = redirectInfo.new_site_for_cookies;
@@ -377,6 +382,11 @@ void InterceptedRequest::ContinueAfterIntercept()
                 request_.referrer_policy = redirectInfo.new_referrer_policy;
                 if (request_.method == net::HttpRequestHeaders::kGetMethod)
                     request_.request_body = nullptr;
+                // In case of multiple sequential rediredts, current_response_ has previously been moved to target_client_
+                // so we create a new one using the redirect url.
+                if (!current_response_)
+                    current_response_ = createResponse(request_);
+                current_response_->encoded_data_length = 0;
                 target_client_->OnReceiveRedirect(redirectInfo, std::move(current_response_));
                 return;
             }
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt b/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt
index 60add456770..33cc7c150a7 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt
@@ -15,6 +15,8 @@ qt_internal_add_test(tst_qwebengineurlrequestinterceptor
 
 set(tst_qwebengineurlrequestinterceptor_resource_files
     "resources/content.html"
+    "resources/content2.html"
+    "resources/content3.html"
     "resources/favicon.html"
     "resources/firstparty.html"
     "resources/fontawesome.woff"
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html
new file mode 100644
index 00000000000..84bf550362a
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html
@@ -0,0 +1,6 @@
+<html>
+<head><link rel="icon" href="data:,"></head>
+<body>
+<a>Simple test page without favicon (meaning no separate request from http server)</a>
+</body>
+</html>
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index 79de46d4011..73185837a16 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -47,6 +47,7 @@ private Q_SLOTS:
     void replaceInterceptor_data();
     void replaceInterceptor();
     void replaceOnIntercept();
+    void multipleRedirects();
 };
 
 tst_QWebEngineUrlRequestInterceptor::tst_QWebEngineUrlRequestInterceptor()
@@ -181,6 +182,29 @@ class TestRequestInterceptor : public QWebEngineUrlRequestInterceptor
     }
 };
 
+class TestMultipleRedirectsInterceptor : public QWebEngineUrlRequestInterceptor {
+public:
+    QList<RequestInfo> requestInfos;
+    QMap<QUrl, QUrl> redirectPairs;
+    int redirectCount = 0;
+    void interceptRequest(QWebEngineUrlRequestInfo &info) override
+    {
+        QVERIFY(QThread::currentThread() == QCoreApplication::instance()->thread());
+        qCDebug(lc) << this << "Type:" << info.resourceType() << info.requestMethod() << "Navigation:" << info.navigationType()
+                    << info.requestUrl() << "Initiator:" << info.initiator();
+        auto redirectUrl = redirectPairs.constFind(info.requestUrl());
+        if (redirectUrl != redirectPairs.constEnd()) {
+          info.redirect(redirectUrl.value());
+          requestInfos.append(info);
+          redirectCount++;
+        }
+    }
+
+    TestMultipleRedirectsInterceptor()
+    {
+    }
+};
+
 class ConsolePage : public QWebEnginePage {
     Q_OBJECT
 public:
@@ -888,5 +912,28 @@ void tst_QWebEngineUrlRequestInterceptor::replaceOnIntercept()
     QCOMPARE(profileInterceptor.requestInfos.size(), pageInterceptor2.requestInfos.size());
 }
 
+void tst_QWebEngineUrlRequestInterceptor::multipleRedirects()
+{
+    HttpServer server;
+    server.setResourceDirs({ ":/resources" });
+    QVERIFY(server.start());
+
+    TestMultipleRedirectsInterceptor multiInterceptor;
+    multiInterceptor.redirectPairs.insert(QUrl(server.url("/content.html")), QUrl(server.url("/content2.html")));
+    multiInterceptor.redirectPairs.insert(QUrl(server.url("/content2.html")), QUrl(server.url("/content3.html")));
+
+    QWebEngineProfile profile;
+    profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+    profile.setUrlRequestInterceptor(&multiInterceptor);
+    QWebEnginePage page(&profile);
+    QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+
+    page.setUrl(server.url("/content.html"));
+
+    QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000);
+    QTRY_COMPARE(multiInterceptor.redirectCount, 2);
+    QTRY_COMPARE(multiInterceptor.requestInfos.size(), 2);
+}
+
 QTEST_MAIN(tst_QWebEngineUrlRequestInterceptor)
 #include "tst_qwebengineurlrequestinterceptor.moc"

From 6f822650631c97c123b4e3ecbd84f401f8a057a3 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 14 Dec 2022 20:15:21 +0000
Subject: [PATCH 003/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I996022cd2629026e7a75e6e5928ff396e272564b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 33360a34259..5aaf33b480d 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: fec2faa51d7420ee53fb4b0b20a9c9661ce2f651
+    ref: a94fd74ff60cc87e0a738b9ec2eecd6647f49923
     required: true
   ../qtpositioning:
-    ref: eb160fa1cf64f863669cd3f95c19e91a8a341255
+    ref: 58b54d07c9304bee4ccbda988cbe2276f69a8c41
     required: false
   ../qttools:
-    ref: a0174a202c558ea8f539e88780941edba33e4a17
+    ref: 746c185203b9192ad8b06f01e4c7f28844a184ed
     required: false
   ../qtwebchannel:
-    ref: 6e261cf66e4074409307eaec40d478ce09895a9b
+    ref: b9566f5c22604cdee073cc5b7669e7882df7c218
     required: false

From d605aaeda4842e03c65c29936bba96380ac86363 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 16 Dec 2022 14:44:12 +0000
Subject: [PATCH 004/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ic2530cfae50e44b765ac577c333349a343b81ab1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 5aaf33b480d..e6f025a5795 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a94fd74ff60cc87e0a738b9ec2eecd6647f49923
+    ref: c77e1d3bfb5a7160b99493fbc8bc13d3c782b141
     required: true
   ../qtpositioning:
-    ref: 58b54d07c9304bee4ccbda988cbe2276f69a8c41
+    ref: af881eeec605facf03bb9f9975a1cfcb1063e6be
     required: false
   ../qttools:
-    ref: 746c185203b9192ad8b06f01e4c7f28844a184ed
+    ref: 68be1fd5d03a31aaab9f28110072d030648e285d
     required: false
   ../qtwebchannel:
-    ref: b9566f5c22604cdee073cc5b7669e7882df7c218
+    ref: 955649ccdce31d78ed66476ceb9e774c6bdefa38
     required: false

From 67d028e3dcbdab5ccae00b912ddb9dda7892c81e Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 13 Dec 2022 11:10:43 +0100
Subject: [PATCH 005/681] Revert "Pump up temporally warning limit for qdoc"

A required dependency for qttools is merged.

This reverts commit f85b1381be8aeda4de7d364e4b51f09fc560c0c1.

Change-Id: If0f0a990a9f5ec2c8601057d803875f19893bf6a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ae2ca250efd331d4eb1d843a91735020cbb87be2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/qtwebengine.qdocconf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
index 0e94accf820..ed95ae0cad5 100644
--- a/src/core/doc/qtwebengine.qdocconf
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -93,4 +93,4 @@ navigation.qmltypespage = "Qt WebEngine QML Types"
 macro.QWE    = "Qt \\WebEngine"
 
 # Fail the documentation build if there are more warnings than the limit
-warninglimit = 4
+warninglimit = 0

From ccbe330d6bbf3c6049a57af809b648c2c4a2155e Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 9 Dec 2022 10:46:23 +0100
Subject: [PATCH 006/681] Fix qdoc warnings

As JavaScript parsing issue got fixed , the limit was
not changed, meaning there where 4 "unused" warnings
possibilities. In the meantime another change
e6a13d97898f3f4b19f61006d0716ca9e1b9f037
was merged which had 3 qdoc issues, which got therefore
unnoticed.

Fix those issues.

Do not use underscore in example name and rename push_notification
to push-notifications (like qtbase network-chat).

Change-Id: I2635424e24d3b9a0a02c2e6fe8ac383eec95c112
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit cbc622f158a94fea9c6af8d675a8743e98267109)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/CMakeLists.txt      |   2 +-
 .../doc/src/clientcertificate.qdoc            |   4 +--
 .../CMakeLists.txt                            |   0
 .../content/index.html                        |   0
 .../content/ping.js                           |   0
 .../content/style.css                         |   0
 .../content/worker.js                         |   0
 .../doc/images/notification.png               | Bin
 .../doc/images/permissions.png                | Bin
 .../doc/images/push-notifications.png}        | Bin
 .../doc/images/website.png                    | Bin
 .../doc/src/push-notifications.qdoc}          |  30 +++++++++---------
 .../doc/src/push-notifications.qmodel}        |   0
 .../server.js                                 |   0
 .../push_notifications/push_notifications.pro |   1 -
 .../webenginewidgets/webenginewidgets.pro     |   2 +-
 .../commands                                  |   0
 17 files changed, 19 insertions(+), 20 deletions(-)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/CMakeLists.txt (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/content/index.html (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/content/ping.js (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/content/style.css (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/content/worker.js (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/doc/images/notification.png (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/doc/images/permissions.png (100%)
 rename examples/webenginewidgets/{push_notifications/doc/images/push_notifications.png => push-notifications/doc/images/push-notifications.png} (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/doc/images/website.png (100%)
 rename examples/webenginewidgets/{push_notifications/doc/src/push_notifications.qdoc => push-notifications/doc/src/push-notifications.qdoc} (90%)
 rename examples/webenginewidgets/{push_notifications/doc/src/push_notifications.qmodel => push-notifications/doc/src/push-notifications.qmodel} (100%)
 rename examples/webenginewidgets/{push_notifications => push-notifications}/server.js (100%)
 delete mode 100644 examples/webenginewidgets/push_notifications/push_notifications.pro
 rename src/webenginewidgets/doc/snippets/{push_notifications => push-notifications}/commands (100%)

diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt
index c94f71fb43b..c3d4665584a 100644
--- a/examples/webenginewidgets/CMakeLists.txt
+++ b/examples/webenginewidgets/CMakeLists.txt
@@ -7,7 +7,7 @@ qt_internal_add_example(cookiebrowser)
 qt_internal_add_example(notifications)
 qt_internal_add_example(simplebrowser)
 qt_internal_add_example(stylesheetbrowser)
-qt_internal_add_example(push_notifications)
+qt_internal_add_example(push-notifications)
 qt_internal_add_example(videoplayer)
 qt_internal_add_example(webui)
 if(QT_FEATURE_webengine_geolocation)
diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index 5f4eeb848c6..b2b67b2e2cd 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -2,10 +2,10 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
 
 /*!
-    \example webenginewidgets/clientcertificatesi
+    \example webenginewidgets/clientcertificate
     \title WebEngine Widgets Client Certificate Example
     \ingroup webengine-widgetexamples
-    \brief A simple client certificate authentication scenario using \QWE and \l QSslServer
+    \brief A simple client certificate authentication scenario using \QWE and \l QSslServer.
 
     \image selection.png
 
diff --git a/examples/webenginewidgets/push_notifications/CMakeLists.txt b/examples/webenginewidgets/push-notifications/CMakeLists.txt
similarity index 100%
rename from examples/webenginewidgets/push_notifications/CMakeLists.txt
rename to examples/webenginewidgets/push-notifications/CMakeLists.txt
diff --git a/examples/webenginewidgets/push_notifications/content/index.html b/examples/webenginewidgets/push-notifications/content/index.html
similarity index 100%
rename from examples/webenginewidgets/push_notifications/content/index.html
rename to examples/webenginewidgets/push-notifications/content/index.html
diff --git a/examples/webenginewidgets/push_notifications/content/ping.js b/examples/webenginewidgets/push-notifications/content/ping.js
similarity index 100%
rename from examples/webenginewidgets/push_notifications/content/ping.js
rename to examples/webenginewidgets/push-notifications/content/ping.js
diff --git a/examples/webenginewidgets/push_notifications/content/style.css b/examples/webenginewidgets/push-notifications/content/style.css
similarity index 100%
rename from examples/webenginewidgets/push_notifications/content/style.css
rename to examples/webenginewidgets/push-notifications/content/style.css
diff --git a/examples/webenginewidgets/push_notifications/content/worker.js b/examples/webenginewidgets/push-notifications/content/worker.js
similarity index 100%
rename from examples/webenginewidgets/push_notifications/content/worker.js
rename to examples/webenginewidgets/push-notifications/content/worker.js
diff --git a/examples/webenginewidgets/push_notifications/doc/images/notification.png b/examples/webenginewidgets/push-notifications/doc/images/notification.png
similarity index 100%
rename from examples/webenginewidgets/push_notifications/doc/images/notification.png
rename to examples/webenginewidgets/push-notifications/doc/images/notification.png
diff --git a/examples/webenginewidgets/push_notifications/doc/images/permissions.png b/examples/webenginewidgets/push-notifications/doc/images/permissions.png
similarity index 100%
rename from examples/webenginewidgets/push_notifications/doc/images/permissions.png
rename to examples/webenginewidgets/push-notifications/doc/images/permissions.png
diff --git a/examples/webenginewidgets/push_notifications/doc/images/push_notifications.png b/examples/webenginewidgets/push-notifications/doc/images/push-notifications.png
similarity index 100%
rename from examples/webenginewidgets/push_notifications/doc/images/push_notifications.png
rename to examples/webenginewidgets/push-notifications/doc/images/push-notifications.png
diff --git a/examples/webenginewidgets/push_notifications/doc/images/website.png b/examples/webenginewidgets/push-notifications/doc/images/website.png
similarity index 100%
rename from examples/webenginewidgets/push_notifications/doc/images/website.png
rename to examples/webenginewidgets/push-notifications/doc/images/website.png
diff --git a/examples/webenginewidgets/push_notifications/doc/src/push_notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
similarity index 90%
rename from examples/webenginewidgets/push_notifications/doc/src/push_notifications.qdoc
rename to examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
index 1d12a9cc125..90b5212c8f5 100644
--- a/examples/webenginewidgets/push_notifications/doc/src/push_notifications.qdoc
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -36,7 +36,7 @@ implementation will deliver a push message. However, to show it, a service worke
 be registered. As the service worker runs in the background, it allows displaying notifications
 even if a website, which has installed it, is no longer opened.
 
-\image push_notifications.png
+\image push-notifications.png
 
 Let's go more into implementation details. We start with implementing our custom
 push service using NodeJS with two modules:
@@ -50,11 +50,11 @@ push service using NodeJS with two modules:
 Let's initialize a new project and install the required modules in the root directory of this
 example:
 
-\snippet /push_notifications/commands 0
+\snippet /push-notifications/commands 0
 
 These commands should create package.js, which defines the start command:
 
-\snippet /push_notifications/commands 1
+\snippet /push-notifications/commands 1
 
 Now let's move on to the push service back-end implementation in server.js.
 
@@ -64,7 +64,7 @@ subscription at a time. To do that we need to create \e VAPID keys which we are
 generate with \e web-push libs. The public key is going to be used by the front-end and authenticate
 to the service.
 
-\quotefromfile webenginewidgets/push_notifications/server.js
+\quotefromfile webenginewidgets/push-notifications/server.js
 \skipto const express
 \printto add subscribe route
 
@@ -73,7 +73,7 @@ to the service.
 To generate keys, we can use the tool shipped with \e web-push lib, that is installed by
 \c npm in our example's root directory.
 
-\snippet /push_notifications/commands 2
+\snippet /push-notifications/commands 2
 
 Now we add two \c routes to the push server. One to \c subscribe and one to \c unsubscribe,
 so that our front-end can send an HTTP POST request to handle the push subscription.
@@ -83,20 +83,20 @@ the user. We keep around the \c subscription to be able to send push notificatio
 As a confirmation, we send the 201 status code and schedule the first push notification based on
 the \c ping-time value. The \c unsubscribe request simply removes a subscription.
 
-\quotefromfile webenginewidgets/push_notifications/server.js
+\quotefromfile webenginewidgets/push-notifications/server.js
 \skipto add subscribe route
 \printto function sendNotification
 
 The \c sendNotication() function sends push messages using the web-push lib. We create the payload
 with the message we want to present to a user and schedule the next push message.
 
-\quotefromfile webenginewidgets/push_notifications/server.js
+\quotefromfile webenginewidgets/push-notifications/server.js
 \skipto function sendNotification
 \printto server.listen
 
 In the end we start the server to listen on the given port.
 
-\quotefromfile webenginewidgets/push_notifications/server.js
+\quotefromfile webenginewidgets/push-notifications/server.js
 \skipto server.listen
 \printline started
 
@@ -105,7 +105,7 @@ often they want to receive ping notification messages. We will have two buttons:
 \e {Ping Me} to subscribe for push notifications and \e Clear to unsubscribe.
 In the end we load ping.js, which we cover next.
 
-\quotefromfile webenginewidgets/push_notifications/content/index.html
+\quotefromfile webenginewidgets/push-notifications/content/index.html
 \skipto <body>
 \printuntil </body>
 
@@ -116,7 +116,7 @@ This way the user can leave the website and still get notified as the service wo
 in the background and handles incoming messages. To achieve that, we have to first register
 one with:
 
-\quotefromfile webenginewidgets/push_notifications/content/ping.js
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
 \skipto const register
 \printline worker.js
 
@@ -125,7 +125,7 @@ user. If the permission is granted, the push subscription is returned. It includ
 that allows sending notifications to the browser, where the registered service worker waits for
 push messages.
 
-\quotefromfile webenginewidgets/push_notifications/content/ping.js
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
 \skipto var subscription
 \printto console.log
 
@@ -133,14 +133,14 @@ As mentioned the subscription is created for FCM and should be now sent to our c
 with an HTTP POST request. In addition, we add to the post request the HTTP header with the
 \c ping-time the user entered on our website.
 
-\quotefromfile webenginewidgets/push_notifications/content/ping.js
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
 \skipto await fetch
 \printto console.log
 
 The function \c clear call unsubscribes first from our push server by sending an HTTP POST request
 and later from the 3rd-party push service (FCM).
 
-\quotefromfile webenginewidgets/push_notifications/content/ping.js
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
 \skipuntil async function clear()
 \skipuntil {
 \printto console.log
@@ -157,7 +157,7 @@ and call \c setup() or \c clear().
 As the last part of the front-end let's look inside a service worker script, where we simply
 register an event listener for \e push events.
 
-\quotefromfile webenginewidgets/push_notifications/content/worker.js
+\quotefromfile webenginewidgets/push-notifications/content/worker.js
 \skipto self
 \printuntil });
 \printuntil });
@@ -170,7 +170,7 @@ the look and feel of a notification message.
 Having the implementation in place, we can start the server on localhost at the port 5000.
 To do that, we can simply enter in the console in the project's root directory:
 
-\snippet /push_notifications/commands 3
+\snippet /push-notifications/commands 3
 
 Now we can fire up \e simplebrowser and enter \c http:\\localhost:5000 as a URL.
 
diff --git a/examples/webenginewidgets/push_notifications/doc/src/push_notifications.qmodel b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qmodel
similarity index 100%
rename from examples/webenginewidgets/push_notifications/doc/src/push_notifications.qmodel
rename to examples/webenginewidgets/push-notifications/doc/src/push-notifications.qmodel
diff --git a/examples/webenginewidgets/push_notifications/server.js b/examples/webenginewidgets/push-notifications/server.js
similarity index 100%
rename from examples/webenginewidgets/push_notifications/server.js
rename to examples/webenginewidgets/push-notifications/server.js
diff --git a/examples/webenginewidgets/push_notifications/push_notifications.pro b/examples/webenginewidgets/push_notifications/push_notifications.pro
deleted file mode 100644
index f88018da26d..00000000000
--- a/examples/webenginewidgets/push_notifications/push_notifications.pro
+++ /dev/null
@@ -1 +0,0 @@
-message("Please use simplebrowser example to see notificationsi.")
diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro
index c22df271d33..cfddfdaaed5 100644
--- a/examples/webenginewidgets/webenginewidgets.pro
+++ b/examples/webenginewidgets/webenginewidgets.pro
@@ -9,7 +9,7 @@ SUBDIRS += \
     notifications \
     simplebrowser \
     stylesheetbrowser \
-    push_notifications \
+    push-notifications \
     videoplayer \
     webui
 
diff --git a/src/webenginewidgets/doc/snippets/push_notifications/commands b/src/webenginewidgets/doc/snippets/push-notifications/commands
similarity index 100%
rename from src/webenginewidgets/doc/snippets/push_notifications/commands
rename to src/webenginewidgets/doc/snippets/push-notifications/commands

From b15488fb974dbb27f529517e5e1be3d506b63fa7 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 23 Sep 2022 08:34:40 +0200
Subject: [PATCH 007/681] Fix push service initialization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add missing perf store values.

Change-Id: Ic9b264c22e1d419e6c89ce4e0f9b5b843aded8cb
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 52f6d20d4701c869d73d6d697c6ecb42d0a93541)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/pref_service_adapter.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 7283ef23192..14fa31ce44b 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -129,6 +129,10 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
     registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);
     registry->RegisterDictionaryPref(prefs::kDevToolsEditedFiles);
 
+    registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, std::string());
+    registry->RegisterStringPref(prefs::kGaiaCookieLastListAccountsData, std::string());
+    registry->RegisterStringPref(prefs::kGCMProductCategoryForSubtypes, std::string());
+
     {
         base::ScopedAllowBlocking allowBlock;
         m_prefService = factory.Create(registry);

From 35fc01c927da037d64abf0ee491b4629349e0cc9 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Tue, 20 Dec 2022 14:13:36 +0100
Subject: [PATCH 008/681] QPdfDocument: make code locale-independent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The C toupper/tolower functions are locale-dependent. Given the right
locale (Türkiye, e.g.), tolower(I) is either

- ı (LATIN SMALL LETTER DOTLESS I; if representable in current charset)
- I (unchanged; if it isn't)

Both results are wrong for the present use-case, so use US-ASCII-only
QtMiscUtils::toAsciiLower() to side-step the issue.

Besides, feeding unfiltered char values into tolower() is UB. You'd
first have to cast to uchar:
https://en.cppreference.com/w/cpp/string/byte/tolower

Task-number: QTBUG-109235
Change-Id: I57887581ba2e548e978223337d681124b30bf754
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3172695838372b54c2a488975578eaedaf094e80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfdocument.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 9b8d20d3b92..a3e412c5c52 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -17,6 +17,8 @@
 #include <QMutex>
 #include <QVector2D>
 
+#include <QtCore/private/qtools_p.h>
+
 QT_BEGIN_NAMESPACE
 
 Q_GLOBAL_STATIC(QRecursiveMutex, pdfMutex)
@@ -39,7 +41,7 @@ class Q_PDF_EXPORT QPdfPageModel : public QAbstractListModel
         QMetaEnum rolesMetaEnum = doc->metaObject()->enumerator(doc->metaObject()->indexOfEnumerator("PageModelRole"));
         for (int r = Qt::UserRole; r < int(QPdfDocument::PageModelRole::NRoles); ++r) {
             auto name = QByteArray(rolesMetaEnum.valueToKey(r));
-            name[0] = tolower(name[0]);
+            name[0] = QtMiscUtils::toAsciiLower(name[0]);
             m_roleNames.insert(r, name);
         }
         connect(doc, &QPdfDocument::statusChanged, this, [this](QPdfDocument::Status s) {

From e5e0f83b0b16392bdeb4b9af744e26df6ff64fc2 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 19 Dec 2022 15:50:13 +0100
Subject: [PATCH 009/681] Update push example after setPushServiceEndpoint
 change

We have now extra call to enable push messaging, therefore
drop usage of simple browser in example and use
the same code as in Notification Example but add new settings
and fix profile to be not off-the-record.

Task-number: QTBUG-107442
Change-Id: I3069c4cf2b6a6ce864c1e4c578ab03adb67984e4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 9907b4cbadfb3104f5617724f10e19e910c61e2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../push-notifications/CMakeLists.txt         |  43 ++++++++-
 .../push-notifications/data/data.qrc          |   5 +
 .../push-notifications/data/icon.png          | Bin 0 -> 2252 bytes
 .../doc/src/push-notifications.qdoc           |  21 +++-
 .../push-notifications/main.cpp               |  41 ++++++++
 .../push-notifications/notificationpopup.h    |  91 ++++++++++++++++++
 .../push-notifications/push-notifications.pro |  10 ++
 7 files changed, 204 insertions(+), 7 deletions(-)
 create mode 100644 examples/webenginewidgets/push-notifications/data/data.qrc
 create mode 100644 examples/webenginewidgets/push-notifications/data/icon.png
 create mode 100644 examples/webenginewidgets/push-notifications/main.cpp
 create mode 100644 examples/webenginewidgets/push-notifications/notificationpopup.h
 create mode 100644 examples/webenginewidgets/push-notifications/push-notifications.pro

diff --git a/examples/webenginewidgets/push-notifications/CMakeLists.txt b/examples/webenginewidgets/push-notifications/CMakeLists.txt
index bbb585c9b0d..8ea2e25d148 100644
--- a/examples/webenginewidgets/push-notifications/CMakeLists.txt
+++ b/examples/webenginewidgets/push-notifications/CMakeLists.txt
@@ -2,6 +2,45 @@
 # SPDX-License-Identifier: BSD-3-Clause
 
 cmake_minimum_required(VERSION 3.16)
-project(simplebrowser LANGUAGES CXX)
+project(notifications LANGUAGES CXX)
 
-message("\nPlease use simplebrowser to see notifiactions.\n")
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+    set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/push-notifications")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(push-notifications
+    main.cpp
+    notificationpopup.h
+)
+
+set_target_properties(push-notifications PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(push-notifications PUBLIC
+    Qt::Core
+    Qt::Gui
+    Qt::WebEngineWidgets
+)
+
+qt_add_resources(push-notifications "data"
+    PREFIX
+        "/"
+    BASE
+        "data"
+    FILES
+        "data/icon.png"
+)
+
+install(TARGETS push-notifications
+    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/push-notifications/data/data.qrc b/examples/webenginewidgets/push-notifications/data/data.qrc
new file mode 100644
index 00000000000..619648d1bc6
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/data/data.qrc
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>icon.png</file>
+    </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/push-notifications/data/icon.png b/examples/webenginewidgets/push-notifications/data/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..4c3870c063045819489c1f79a84734c376e96aef
GIT binary patch
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
index 90b5212c8f5..2f234c1e052 100644
--- a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -172,12 +172,24 @@ To do that, we can simply enter in the console in the project's root directory:
 
 \snippet /push-notifications/commands 3
 
-Now we can fire up \e simplebrowser and enter \c http:\\localhost:5000 as a URL.
+Now we can look into the \e push-notification browser application, which is based on
+\l {WebEngine Notifications Example}:
 
-\image website.png
+\quotefromfile webenginewidgets/push-notifications/main.cpp
+\skipto main
+\printuntil app.exec
+\printuntil }
+
+This application simply opens the page at \c http:\\localhost:5000. We are not going into detail
+about how to open a notification as it is documented \l {WebEngine Notifications Example}{here}.
+However, you need to modify the application in two ways. First, \c QWebEngineProfile cannot be
+set to \e off-the-record because push messaging would be disabled. Therefore, as you can see
+above, \c  QWebEngineProfile is initialized with the name. Second, you need to enable push
+messaging with the call QWebEngineProfile::setPushServiceEnabled for the created \c profile.
 
-\note \c QWebEngineProfile cannot be set to \e off-the-record, because push messages would be
-disabled.
+When the application runs it displays:
+
+\image website.png
 
 After granting the permission we can send our ping request:
 
@@ -187,5 +199,4 @@ We should see the coming push notification:
 
 \image notification.png
 
-\note To troubleshoot errors, open \e {Developer Tools} from Tools menu.
 */
diff --git a/examples/webenginewidgets/push-notifications/main.cpp b/examples/webenginewidgets/push-notifications/main.cpp
new file mode 100644
index 00000000000..18a862182b9
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/main.cpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "notificationpopup.h"
+
+#include <QApplication>
+#include <QWebEngineProfile>
+#include <QWebEnginePage>
+#include <QWebEngineView>
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication::setOrganizationName("QtExamples");
+    QApplication app(argc, argv);
+
+    const QString name =
+            QString::fromLatin1("push-notifications.%1").arg(qWebEngineChromiumVersion());
+
+    QScopedPointer<QWebEngineProfile> profile(new QWebEngineProfile(name));
+    QWebEngineView view(profile.data());
+    auto popup = new NotificationPopup(&view);
+
+    QObject::connect(view.page(), &QWebEnginePage::featurePermissionRequested,
+                     [&](const QUrl &origin, QWebEnginePage::Feature feature) {
+                         if (feature != QWebEnginePage::Notifications)
+                             return;
+
+                         view.page()->setFeaturePermission(origin, feature,
+                                                           QWebEnginePage::PermissionGrantedByUser);
+                     });
+
+    profile->setPushServiceEnabled(true);
+    profile->setNotificationPresenter([&](std::unique_ptr<QWebEngineNotification> notification) {
+        popup->present(notification);
+    });
+
+    view.resize(640, 480);
+    view.setUrl(QUrl("http://localhost:5000"));
+    view.show();
+    return app.exec();
+}
diff --git a/examples/webenginewidgets/push-notifications/notificationpopup.h b/examples/webenginewidgets/push-notifications/notificationpopup.h
new file mode 100644
index 00000000000..cf53ded4534
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/notificationpopup.h
@@ -0,0 +1,91 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#pragma once
+
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QMouseEvent>
+#include <QPushButton>
+#include <QSpacerItem>
+#include <QTimer>
+#include <QVBoxLayout>
+#include <QWebEngineNotification>
+
+#include <memory>
+
+class NotificationPopup : public QWidget
+{
+    Q_OBJECT
+
+    QLabel m_icon, m_title, m_message;
+    std::unique_ptr<QWebEngineNotification> notification;
+
+public:
+    NotificationPopup(QWidget *parent) : QWidget(parent)
+    {
+        setWindowFlags(Qt::ToolTip);
+        auto rootLayout = new QHBoxLayout(this);
+
+        rootLayout->addWidget(&m_icon);
+
+        auto bodyLayout = new QVBoxLayout;
+        rootLayout->addLayout(bodyLayout);
+
+        auto titleLayout = new QHBoxLayout;
+        bodyLayout->addLayout(titleLayout);
+
+        titleLayout->addWidget(&m_title);
+        titleLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
+
+        auto close = new QPushButton(tr("Close"));
+        titleLayout->addWidget(close);
+        connect(close, &QPushButton::clicked, this, &NotificationPopup::onClosed);
+
+        bodyLayout->addWidget(&m_message);
+        adjustSize();
+    }
+
+    void present(std::unique_ptr<QWebEngineNotification> &newNotification)
+    {
+        if (notification) {
+            notification->close();
+            notification.reset();
+        }
+
+        notification.swap(newNotification);
+
+        m_title.setText("<b>" + notification->title() + "</b>");
+        m_message.setText(notification->message());
+        m_icon.setPixmap(QPixmap(":/icon.png").scaledToHeight(m_icon.height()));
+
+        show();
+        notification->show();
+
+        connect(notification.get(), &QWebEngineNotification::closed, this,
+                &NotificationPopup::onClosed);
+        QTimer::singleShot(10000, notification.get(), [&]() { onClosed(); });
+
+        // position our popup in the right corner of its parent widget
+        move(parentWidget()->mapToGlobal(parentWidget()->rect().bottomRight()
+                                         - QPoint(width() + 10, height() + 10)));
+    }
+
+protected slots:
+    void onClosed()
+    {
+        hide();
+        notification->close();
+        notification.reset();
+    }
+
+protected:
+    void mouseReleaseEvent(QMouseEvent *event) override
+    {
+        QWidget::mouseReleaseEvent(event);
+        if (notification && event->button() == Qt::LeftButton) {
+            notification->click();
+            onClosed();
+        }
+    }
+};
diff --git a/examples/webenginewidgets/push-notifications/push-notifications.pro b/examples/webenginewidgets/push-notifications/push-notifications.pro
new file mode 100644
index 00000000000..5ffb85fd7bb
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/push-notifications.pro
@@ -0,0 +1,10 @@
+QT += webenginewidgets
+
+HEADERS   = notificationpopup.h
+
+SOURCES   = main.cpp
+
+RESOURCES = data/data.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/push-notifications
+INSTALLS += target

From c1a5d0948d2a87182363b75d07e8f23e0d4f9fea Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 15 Dec 2022 15:21:25 +0100
Subject: [PATCH 010/681] Remove setPushServiceEndpoint from API
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use setPushServiceEnabled instead. Update also getter
and documentation.

Task-number: QTBUG-107442
Change-Id: I299ce88b06edef0f1a0088fb10f4a142056039be
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 4bedbe65c8af21e29e3ed274334ce1d32c8f9279)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineprofile.cpp            | 28 ++++++-------
 src/core/api/qwebengineprofile.h              |  4 +-
 src/core/profile_adapter.cpp                  |  9 +++--
 src/core/profile_adapter.h                    |  6 +--
 src/core/profile_qt.cpp                       |  7 +---
 src/core/profile_qt.h                         |  1 -
 .../api/qquickwebengineprofile.cpp            | 40 ++++++++-----------
 .../api/qquickwebengineprofile.h              |  8 ++--
 tests/auto/quick/publicapi/tst_publicapi.cpp  |  4 +-
 9 files changed, 45 insertions(+), 62 deletions(-)

diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
index 8c3dc8f3db0..fe783b75ef9 100644
--- a/src/core/api/qwebengineprofile.cpp
+++ b/src/core/api/qwebengineprofile.cpp
@@ -392,36 +392,32 @@ void QWebEngineProfile::setDownloadPath(const QString &path)
 /*!
     \since 6.5
 
-    The address used to create subscriptions for a push messaging service.
+    Returns \c true if the push messaging service is enabled.
+    \note By default the push messaging service is disabled.
 
-    \note By default, the endpoint is an empty URL and push messaging is disabled.
-
-    \sa setPushServiceEndpoint()
+    \sa setPushServiceEnabled()
 */
-QUrl QWebEngineProfile::pushServiceEndpoint() const
+bool QWebEngineProfile::isPushServiceEnabled() const
 {
     const Q_D(QWebEngineProfile);
-    return d->profileAdapter()->pushServiceEndpoint();
+    return d->profileAdapter()->pushServiceEnabled();
 }
 
 /*!
     \since 6.5
 
-    Enables push messaging feature by setting \a endpoint to a valid address used as a
-    push messaging service endpoint. Subscription requests for the push service will be
-    sent to the concatenation of \a endpoint and a subscription ID (which is provided
-    by the browser engine).
-
-    \note Default endpoint used by Google Chrome browser is \c {https://fcm.googleapis.com/fcm/send/}
+    Enables the push messaging service if \a enable is \c true, otherwise disables it.
 
-    If set back to the default empty URL, push messaging is disabled.
+    \note \QWE uses \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)}
+    as a browser push service. Therefore, all push messages will go through the
+    Google push service and its respective servers.
 
-    \sa pushServiceEndpoint()
+    \sa isPushServiceEnabled()
 */
-void QWebEngineProfile::setPushServiceEndpoint(const QUrl &endpoint)
+void QWebEngineProfile::setPushServiceEnabled(bool enable)
 {
     Q_D(QWebEngineProfile);
-    d->profileAdapter()->setPushServiceEndpoint(endpoint);
+    d->profileAdapter()->setPushServiceEnabled(enable);
 }
 
 /*!
diff --git a/src/core/api/qwebengineprofile.h b/src/core/api/qwebengineprofile.h
index cd711727b34..9fb4c8e74bf 100644
--- a/src/core/api/qwebengineprofile.h
+++ b/src/core/api/qwebengineprofile.h
@@ -98,8 +98,8 @@ class Q_WEBENGINECORE_EXPORT QWebEngineProfile : public QObject
     QString downloadPath() const;
     void setDownloadPath(const QString &path);
 
-    QUrl pushServiceEndpoint() const;
-    void setPushServiceEndpoint(const QUrl &endpoint);
+    bool isPushServiceEnabled() const;
+    void setPushServiceEnabled(bool enabled);
 
     void setNotificationPresenter(std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter);
 
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 36c756a7ec1..e9e9aaedaf1 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -63,6 +63,7 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
     , m_httpCacheType(DiskHttpCache)
     , m_persistentCookiesPolicy(AllowPersistentCookies)
     , m_visitedLinksPolicy(TrackVisitedLinksOnDisk)
+    , m_pushServiceEnabled(false)
     , m_httpCacheMaxSize(0)
 {
     WebEngineContext::current()->addProfileAdapter(this);
@@ -628,14 +629,14 @@ bool ProfileAdapter::isSpellCheckEnabled() const
 #endif
 }
 
-QUrl ProfileAdapter::pushServiceEndpoint() const
+bool ProfileAdapter::pushServiceEnabled() const
 {
-    return m_pushServiceEndpoint;
+  return m_pushServiceEnabled;
 }
 
-void ProfileAdapter::setPushServiceEndpoint(const QUrl &endpoint)
+void ProfileAdapter::setPushServiceEnabled(bool enabled)
 {
-    m_pushServiceEndpoint = endpoint;
+    m_pushServiceEnabled = enabled;
 }
 
 void ProfileAdapter::addWebContentsAdapterClient(WebContentsAdapterClient *client)
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index 90c5238b26b..ab4622a4bf6 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -101,8 +101,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
     void setSpellCheckEnabled(bool enabled);
     bool isSpellCheckEnabled() const;
 
-    QUrl pushServiceEndpoint() const;
-    void setPushServiceEndpoint(const QUrl &endpoint);
+    bool pushServiceEnabled() const;
+    void setPushServiceEnabled(bool enabled);
 
     void addWebContentsAdapterClient(WebContentsAdapterClient *client);
     void removeWebContentsAdapterClient(WebContentsAdapterClient *client);
@@ -216,7 +216,6 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
     QString m_httpUserAgent;
     HttpCacheType m_httpCacheType;
     QString m_httpAcceptLanguage;
-    QUrl m_pushServiceEndpoint;
     PersistentCookiesPolicy m_persistentCookiesPolicy;
     VisitedLinksPolicy m_visitedLinksPolicy;
     QHash<QByteArray, QPointer<QWebEngineUrlSchemeHandler>> m_customUrlSchemeHandlers;
@@ -225,6 +224,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
 
     QList<ProfileAdapterClient*> m_clients;
     QList<WebContentsAdapterClient *> m_webContentsAdapterClients;
+    bool m_pushServiceEnabled;
     int m_httpCacheMaxSize;
     QrcUrlSchemeHandler m_qrcHandler;
     std::unique_ptr<base::CancelableTaskTracker> m_cancelableTaskTracker;
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index b1db2a2ce85..410340fb804 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -159,14 +159,9 @@ storage::SpecialStoragePolicy *ProfileQt::GetSpecialStoragePolicy()
     return nullptr;
 }
 
-std::string ProfileQt::GetPushMessagingEndpoint() const
-{
-    return m_profileAdapter->pushServiceEndpoint().toString().toStdString();
-}
-
 content::PushMessagingService *ProfileQt::GetPushMessagingService()
 {
-    if (!m_profileAdapter->pushServiceEndpoint().isEmpty())
+    if (m_profileAdapter->pushServiceEnabled())
         return PushMessagingServiceFactory::GetForProfile(this);
     else
         return nullptr;
diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h
index 787c13148b9..9fb8cb444ed 100644
--- a/src/core/profile_qt.h
+++ b/src/core/profile_qt.h
@@ -56,7 +56,6 @@ class ProfileQt : public Profile
     content::PlatformNotificationService *GetPlatformNotificationService() override;
     std::string GetMediaDeviceIDSalt() override;
     content::FileSystemAccessPermissionContext *GetFileSystemAccessPermissionContext() override;
-    std::string GetPushMessagingEndpoint() const override;
     content::ReduceAcceptLanguageControllerDelegate *GetReduceAcceptLanguageControllerDelegate() override;
 
     // Profile implementation:
diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp
index 131e59ad012..1badd25becb 100644
--- a/src/webenginequick/api/qquickwebengineprofile.cpp
+++ b/src/webenginequick/api/qquickwebengineprofile.cpp
@@ -821,46 +821,38 @@ QString QQuickWebEngineProfile::downloadPath() const
 }
 
 /*!
-    \qmlproperty string WebEngineProfile::pushServiceEndpoint
+    \qmlproperty bool WebEngineProfile::isPushServiceEnabled
     \since  QtWebEngine 6.5
 
-    The address used to create subscriptions for a push messaging service.
-
-    Subscription requests for the push service will be sent to the concatenation
-    of \a endpoint and a subscription ID (which is provided by the browser engine).
-
-    \note Default endpoint used by Google Chrome browser is \c {https://fcm.googleapis.com/fcm/send/}
-
-    \note By default, the endpoint is an empty URL and push messaging is disabled.
+    Whether the push messaging service is enabled.
+    \note By default the push messaging service is disabled.
+    \note \QWE uses the \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)} as a browser push service.
+    Therefore, all push messages will go through the Google push service and its respective servers.
 */
 
 /*!
-    \property QQuickWebEngineProfile::pushServiceEndpoint
+    \property QQuickWebEngineProfile::isPushServiceEnabled
     \since QtWebEngine 6.5
 
-    The address used to create subscriptions for a push messaging service.
-
-    Subscription requests for the push service will be sent to the concatenation
-    of \a endpoint and a subscription ID (which is provided by the browser engine).
-
-    \note Default endpoint used by Google Chrome browser is \c {https://fcm.googleapis.com/fcm/send/}
-
-    \note By default, the endpoint is an empty URL and push messaging is disabled.
+    Whether the push messaging service is enabled.
+    \note By default the push messaging service is disabled.
+    \note \QWE uses the \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)} as a browser push service.
+    Therefore, all push messages will go through the Google push service and its respective servers.
 */
 
-QUrl QQuickWebEngineProfile::pushServiceEndpoint() const
+bool QQuickWebEngineProfile::isPushServiceEnabled() const
 {
     const Q_D(QQuickWebEngineProfile);
-    return d->profileAdapter()->pushServiceEndpoint();
+    return d->profileAdapter()->pushServiceEnabled();
 }
 
-void QQuickWebEngineProfile::setPushServiceEndpoint(const QUrl &endpoint)
+void QQuickWebEngineProfile::setPushServiceEnabled(bool enabled)
 {
     Q_D(QQuickWebEngineProfile);
-    if (pushServiceEndpoint() == endpoint)
+    if (isPushServiceEnabled() == enabled)
         return;
-    d->profileAdapter()->setPushServiceEndpoint(endpoint);
-    emit pushServiceEndpointChanged();
+    d->profileAdapter()->setPushServiceEnabled(enabled);
+    emit pushServiceEnabledChanged();
 }
 
 /*!
diff --git a/src/webenginequick/api/qquickwebengineprofile.h b/src/webenginequick/api/qquickwebengineprofile.h
index 36789acf063..29d6ee0b267 100644
--- a/src/webenginequick/api/qquickwebengineprofile.h
+++ b/src/webenginequick/api/qquickwebengineprofile.h
@@ -37,7 +37,7 @@ class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineProfile : public QObject {
     Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged FINAL REVISION(1,3))
     Q_PROPERTY(QQuickWebEngineScriptCollection *userScripts READ userScripts)
     Q_PROPERTY(QString downloadPath READ downloadPath WRITE setDownloadPath NOTIFY downloadPathChanged FINAL REVISION(1,5))
-    Q_PROPERTY(QUrl pushServiceEndpoint READ pushServiceEndpoint WRITE setPushServiceEndpoint NOTIFY pushServiceEndpointChanged FINAL REVISION(6,5))
+    Q_PROPERTY(bool isPushServiceEnabled READ isPushServiceEnabled WRITE setPushServiceEnabled NOTIFY pushServiceEnabledChanged FINAL REVISION(6,5))
     QML_NAMED_ELEMENT(WebEngineProfile)
     QML_ADDED_IN_VERSION(1, 1)
     QML_EXTRA_VERSION(2, 0)
@@ -109,8 +109,8 @@ class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineProfile : public QObject {
     QString downloadPath() const;
     void setDownloadPath(const QString &path);
 
-    QUrl pushServiceEndpoint() const;
-    void setPushServiceEndpoint(const QUrl &endpoint);
+    bool isPushServiceEnabled() const;
+    void setPushServiceEnabled(bool enable);
 
     QWebEngineClientCertificateStore *clientCertificateStore();
 
@@ -129,7 +129,7 @@ class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineProfile : public QObject {
     Q_REVISION(1,3) void spellCheckLanguagesChanged();
     Q_REVISION(1,3) void spellCheckEnabledChanged();
     Q_REVISION(1,5) void downloadPathChanged();
-    Q_REVISION(6,5) void pushServiceEndpointChanged();
+    Q_REVISION(6,5) void pushServiceEnabledChanged();
     void downloadRequested(QQuickWebEngineDownloadRequest *download);
     void downloadFinished(QQuickWebEngineDownloadRequest *download);
 
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 7e4acc97ce9..0cd03194012 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -363,8 +363,8 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineProfile.persistentCookiesPolicyChanged() --> void"
     << "QQuickWebEngineProfile.persistentStoragePath --> QString"
     << "QQuickWebEngineProfile.persistentStoragePathChanged() --> void"
-    << "QQuickWebEngineProfile.pushServiceEndpoint --> QUrl"
-    << "QQuickWebEngineProfile.pushServiceEndpointChanged() --> void"
+    << "QQuickWebEngineProfile.isPushServiceEnabled --> bool"
+    << "QQuickWebEngineProfile.pushServiceEnabledChanged() --> void"
     << "QQuickWebEngineProfile.spellCheckEnabled --> bool"
     << "QQuickWebEngineProfile.spellCheckEnabledChanged() --> void"
     << "QQuickWebEngineProfile.spellCheckLanguages --> QStringList"

From 153caa7cb7ddf6aac595302db1328cc9aa1f409b Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 23 Dec 2022 20:51:00 +0000
Subject: [PATCH 011/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I458d7235c4d255da1f67380e1f965ee6c51a02a0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index e6f025a5795..63ca9307446 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: c77e1d3bfb5a7160b99493fbc8bc13d3c782b141
+    ref: 4087ecf0cea2bbe2073798d955271f97c212d720
     required: true
   ../qtpositioning:
-    ref: af881eeec605facf03bb9f9975a1cfcb1063e6be
+    ref: f5c4873d92e007bb03c4c50e0b1b6acaf1a08d80
     required: false
   ../qttools:
-    ref: 68be1fd5d03a31aaab9f28110072d030648e285d
+    ref: 26cdd5e11d8a7aad5798a1f02463f5e1fe092662
     required: false
   ../qtwebchannel:
-    ref: 955649ccdce31d78ed66476ceb9e774c6bdefa38
+    ref: 6f07991589b1e3e46e9082a2ca17fd48d7992094
     required: false

From 339aa75989c04f1a6783e97ada47d8c2102db3c4 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 26 Dec 2022 14:46:44 +0000
Subject: [PATCH 012/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I01ae59f397bed0ab7191338b2bc15cf760fe2ce3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 63ca9307446..a8746f4e776 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4087ecf0cea2bbe2073798d955271f97c212d720
+    ref: e18021f452c2e966d75708f7e889bdcce87f52f6
     required: true
   ../qtpositioning:
-    ref: f5c4873d92e007bb03c4c50e0b1b6acaf1a08d80
+    ref: 92dc334ef9d10585674c18272d3ad31f00308a99
     required: false
   ../qttools:
-    ref: 26cdd5e11d8a7aad5798a1f02463f5e1fe092662
+    ref: 1b60a09b01e9abbb94799734e0206852a7950088
     required: false
   ../qtwebchannel:
-    ref: 6f07991589b1e3e46e9082a2ca17fd48d7992094
+    ref: ea6ba20439ac509298c78f350bd4c0a0d6e42706
     required: false

From fa52dbb5da98226fc7ddcf4627f52b9a7bb7b01b Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 28 Dec 2022 08:20:58 +0000
Subject: [PATCH 013/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Idd09c0da0dd68fc2b616d29519af56b7be34f86c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index a8746f4e776..0262687f323 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: e18021f452c2e966d75708f7e889bdcce87f52f6
+    ref: 960ca6f3bc34a2a2e9098acf768cc75ca39c0b6c
     required: true
   ../qtpositioning:
-    ref: 92dc334ef9d10585674c18272d3ad31f00308a99
+    ref: bbe4404bb8ec6d7bb05b2f190663772b05596598
     required: false
   ../qttools:
-    ref: 1b60a09b01e9abbb94799734e0206852a7950088
+    ref: edb3a66ae01dee0b34ecf84cfdbb847c37419421
     required: false
   ../qtwebchannel:
-    ref: ea6ba20439ac509298c78f350bd4c0a0d6e42706
+    ref: da6375002d6483e7ac5781caea22640772efd6f2
     required: false

From aed3a534778ada5df56e1978aafba5c3586fddf1 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 29 Dec 2022 07:36:30 +0000
Subject: [PATCH 014/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I42144eeb311e6c478983f3ee1b0d913309127cbe
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0262687f323..931b85368f0 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 960ca6f3bc34a2a2e9098acf768cc75ca39c0b6c
+    ref: 848b4d0faf0454d1232aa11059f862abd164d781
     required: true
   ../qtpositioning:
-    ref: bbe4404bb8ec6d7bb05b2f190663772b05596598
+    ref: 5b0c5929dec47e03ae22fba60c6bbc210cd01c0f
     required: false
   ../qttools:
-    ref: edb3a66ae01dee0b34ecf84cfdbb847c37419421
+    ref: de117ee21d1fc7a6a3f9066cc0114a6c7dc1c8dd
     required: false
   ../qtwebchannel:
-    ref: da6375002d6483e7ac5781caea22640772efd6f2
+    ref: 27270e6e21bccc7f4c57ddaf541bae26dbaf3d95
     required: false

From b591ef1f07f16cfcf274642be29f2e7ab008bb38 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 30 Dec 2022 09:07:09 +0000
Subject: [PATCH 015/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Icc421a6204302aa8d0077578d4f9d857a6d560fa
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 931b85368f0..33a06514851 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 848b4d0faf0454d1232aa11059f862abd164d781
+    ref: 21d230e42b8774b546b56643362ab6d1fc220790
     required: true
   ../qtpositioning:
-    ref: 5b0c5929dec47e03ae22fba60c6bbc210cd01c0f
+    ref: 698f77d9bc80e43fdeca5119a455b668bd509a0e
     required: false
   ../qttools:
-    ref: de117ee21d1fc7a6a3f9066cc0114a6c7dc1c8dd
+    ref: 74e803e6c2e99d7f10c857580b5bb334c4426153
     required: false
   ../qtwebchannel:
-    ref: 27270e6e21bccc7f4c57ddaf541bae26dbaf3d95
+    ref: 48352d07f833051280119f093956ded100b3474e
     required: false

From 3b16012f56388e7641b3cc02ca774e1f89250471 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 2 Jan 2023 10:15:16 +0100
Subject: [PATCH 016/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Pulls in following patches:

* 481d91afcf3  Fix initialization for FCM
* df46b0483d4  Force python to write with utf8 encoding
* 1051027a309  Remove custom push service endpoint support
* 702cba29bcc  FIXUP: Fixes for jumbo build
* fb8de43885e  FIXUP: Fixes for jumbo build

Change-Id: Ib0daa587953ff51c3857bad419886eae5c57ca36
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index bb174833724..481d91afcf3 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit bb174833724aa009b9b0fac37b2bb72916fa8e34
+Subproject commit 481d91afcf30a6491cdf27868025b2d2c242ef69

From fae6836a4d632f78aa6e5f24c50f05e4844d264b Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 2 Jan 2023 13:55:11 +0000
Subject: [PATCH 017/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I8d2f6a2f3685fcf873bcadadd8ac2a3bff8878cc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 33a06514851..43c9dc9eaa2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 21d230e42b8774b546b56643362ab6d1fc220790
+    ref: 2a47674174af7463a12e1971b01e8d65892f395f
     required: true
   ../qtpositioning:
-    ref: 698f77d9bc80e43fdeca5119a455b668bd509a0e
+    ref: e1cf164fcbade067660f1e803677a2eb90d17d37
     required: false
   ../qttools:
-    ref: 74e803e6c2e99d7f10c857580b5bb334c4426153
+    ref: b4f49558ec29ca69c9dfea6ceaf0727cbc373732
     required: false
   ../qtwebchannel:
-    ref: 48352d07f833051280119f093956ded100b3474e
+    ref: d1e9ec807f71f91686133e9a6ce665fb56ea9f21
     required: false

From 60f9c3dd38861deba0f09ca3c941d3ca03c2b4ef Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 5 Dec 2022 15:36:43 +0100
Subject: [PATCH 018/681] Fix creation of nssdb for certificate store unit test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In case there is no nssdb in system create empty database.
This got unnoticed as running webengine creates one, however when
doing test configuration on fresh system without one pk12utils fails.

Move 'nickname' to certificate otherwise clean job does not work.

Task-number: QTBUG-109179
Change-Id: I401ffab62dd13d7aa1459672b1170afcde3cde83
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit b3b4aef1d67096632c703adca6fdfb2b676bdc0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../CMakeLists.txt                            |  20 ++++++++++++------
 .../resources/client2.p12                     | Bin 2549 -> 2710 bytes
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt b/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt
index 1c4a4763624..8cee7f630b7 100644
--- a/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt
+++ b/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt
@@ -39,35 +39,41 @@ if(LINUX AND NOT CMAKE_CROSSCOMPILING)
     get_filename_component(homePath $ENV{HOME} ABSOLUTE)
 
     find_program(pk12util_EXECUTABLE NAMES pk12util)
+    find_program(certutil_EXECUTABLE NAMES certutil)
 
-    if(pk12util_EXECUTABLE)
+    if(pk12util_EXECUTABLE AND certutil_EXECUTABLE)
         add_custom_command(
             DEPENDS resources/client2.p12
-            COMMAND ${pk12util_EXECUTABLE}
-                -d sql:"${homePath}/.pki/nssdb"
-                -n qwebengineclientcertificatestore
+            COMMAND test -e "${homePath}/.pki/nssdb" || ${CMAKE_COMMAND} -E make_directory
+                "${homePath}/.pki/nssdb"
+            COMMAND test -e "${homePath}/.pki/nssdb/cert9.db" || ${certutil_EXECUTABLE}
+                -N --empty-password -d sql:${homePath}/.pki/nssdb
+            COMMAND test -e "${homePath}/.pki/nssdb/cert9.db" && ${pk12util_EXECUTABLE}
+                -d sql:${homePath}/.pki/nssdb
                 -i "${CMAKE_CURRENT_LIST_DIR}/resources/client2.p12"
-                -W \"\"
+                -W ""
             COMMAND ${CMAKE_COMMAND} -E touch pk12util.stamp
             OUTPUT pk12util.stamp
+            VERBATIM
+            USES_TERMINAL
         )
         add_custom_target(
             add-user-personal-certificate
             DEPENDS pk12util.stamp
     )
     qt_internal_extend_target(tst_qwebengineclientcertificatestore DEFINES TEST_NSS)
-    add_dependencies(tst_qwebengineclientcertificatestore  add-user-personal-certificate)
+    add_dependencies(tst_qwebengineclientcertificatestore add-user-personal-certificate)
     endif()
 
     find_program(certutil_EXECUTABLE NAMES certutil)
 
     if(certutil_EXECUTABLE)
         add_custom_target(remove-user-personal-certificate
+            COMMAND ${CMAKE_COMMAND} -E remove pk12util.stamp
             COMMAND ${certutil_EXECUTABLE}
                 -d sql:"${homePath}/.pki/nssdb"
                 -D
                 -n qwebengineclientcertificatestore
-            COMMAND ${CMAKE_COMMAND} -E remove pk12util.stamp
         )
     endif()
 endif()
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/client2.p12 b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.p12
index feccd77e1c974e1bc9ced607c5237cf4d688c724..81e7eb624d42fedeb33688f8bc56c353b1b46c8d 100644
GIT binary patch

From 8fc0dc0c154a06484f892b20fcfe1f0ae4580161 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 5 Jan 2023 10:28:08 +0000
Subject: [PATCH 019/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I88690f739fa02ccb2814c011e48cf01418cc19b1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 43c9dc9eaa2..0e16cb1c410 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 2a47674174af7463a12e1971b01e8d65892f395f
+    ref: f9372678279fb7579013c3e5230205fc4ec784da
     required: true
   ../qtpositioning:
-    ref: e1cf164fcbade067660f1e803677a2eb90d17d37
+    ref: 1cf68985ac70f250316d025d46db7c78edbe1069
     required: false
   ../qttools:
-    ref: b4f49558ec29ca69c9dfea6ceaf0727cbc373732
+    ref: bc8cd52f4558e44acbb45b422069c912dedca741
     required: false
   ../qtwebchannel:
-    ref: d1e9ec807f71f91686133e9a6ce665fb56ea9f21
+    ref: 991c6d28e41d293930387ef4fea51cb6cebcbbaa
     required: false

From 95a198ad9a7e3221d02a9a276949c147f35e706f Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 30 Nov 2022 11:41:51 +0100
Subject: [PATCH 020/681] Adaptations for 108-based

Fixes: QTBUG-105147
Change-Id: I0022964903f3443cc97843c62468ab9be8ae2ed8
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 5121effa745cf88b6d50630249570113941c2ca2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                              |  4 +-
 cmake/Functions.cmake                         |  4 +-
 src/core/CMakeLists.txt                       | 10 +++--
 src/core/accessibility_tree_formatter_qt.cpp  | 41 +++++++++----------
 src/core/autofill_client_qt.cpp               |  2 +-
 src/core/autofill_popup_controller.cpp        |  5 +--
 src/core/browser_accessibility_manager_qt.cpp | 14 ++++---
 src/core/browser_accessibility_manager_qt.h   |  4 +-
 src/core/browser_accessibility_qt.cpp         |  2 +
 src/core/client_hints.cpp                     |  9 ++++
 src/core/client_hints.h                       |  8 ++++
 .../compositor/vulkan_implementation_qt.cpp   |  7 ++--
 .../compositor/vulkan_implementation_qt.h     |  8 ++--
 src/core/configure/BUILD.root.gn.in           |  6 ++-
 src/core/content_browser_client_qt.cpp        |  3 +-
 src/core/content_browser_client_qt.h          |  3 +-
 src/core/content_client_qt.cpp                | 17 ++++----
 src/core/content_client_qt.h                  |  2 +-
 src/core/devtools_frontend_qt.cpp             |  2 +-
 ...omponent_extension_resource_manager_qt.cpp |  6 +--
 .../extensions_browser_client_qt.cpp          | 20 ++++++++-
 .../extensions/extensions_browser_client_qt.h |  3 ++
 src/core/extensions/messaging_delegate_qt.cpp |  4 +-
 src/core/extensions/messaging_delegate_qt.h   |  2 +-
 src/core/file_picker_controller.cpp           | 13 +++---
 ...le_system_access_permission_context_qt.cpp | 10 ++---
 ...file_system_access_permission_context_qt.h |  6 +--
 src/core/media_capture_devices_dispatcher.cpp |  1 +
 src/core/net/custom_url_loader_factory.cpp    |  4 +-
 .../net/proxying_url_loader_factory_qt.cpp    | 12 ++----
 src/core/net/webui_controller_factory_qt.cpp  |  2 +-
 src/core/ozone/gl_surface_qt.cpp              |  2 +-
 src/core/ozone/gl_surface_qt.h                |  2 +-
 src/core/ozone/ozone_platform_qt.cpp          |  1 -
 src/core/pref_service_adapter.cpp             |  4 +-
 .../pdf_web_contents_helper_client_qt.cpp     | 13 +++---
 .../pdf_web_contents_helper_client_qt.h       |  4 +-
 .../printing/print_view_manager_base_qt.cpp   |  6 +--
 .../renderer/content_renderer_client_qt.cpp   | 29 +++++++++----
 .../renderer/content_renderer_client_qt.h     |  3 ++
 .../extensions_renderer_client_qt.cpp         |  7 ++++
 .../extensions_renderer_client_qt.h           |  3 ++
 .../web_channel_ipc_transport_host.cpp        | 20 ++++-----
 src/core/sandbox_win.cpp                      |  4 +-
 src/core/select_file_dialog_factory_qt.cpp    |  6 ++-
 src/core/user_script.cpp                      |  2 +-
 src/core/web_contents_adapter.cpp             | 12 ++----
 src/core/web_contents_delegate_qt.cpp         |  6 +--
 src/core/web_contents_delegate_qt.h           |  2 +-
 src/core/web_contents_view_qt.cpp             |  3 +-
 src/core/web_contents_view_qt.h               |  2 +
 src/core/web_engine_context.cpp               |  2 +-
 src/pdf/configure/BUILD.root.gn.in            |  6 +++
 .../accessibility/tst_accessibility.cpp       |  2 +-
 .../qwebengineview/tst_qwebengineview.cpp     |  2 +-
 tools/scripts/version_resolver.py             |  4 +-
 56 files changed, 228 insertions(+), 153 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index df18c158c95..39bfa022150 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
-Based on Chromium version:                                      106.0.5249.207
-Patched with security patches up to Chromium version:           106.0.5249.207
+Based on Chromium version:                                      108.0.5359.109
+Patched with security patches up to Chromium version:           108.0.5359.109
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index e2ccdd9f1d7..bd892ee20af 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -459,7 +459,7 @@ function(add_linker_options target buildDir completeStatic)
     endif()
     if(WIN32)
         get_copy_of_response_file(objects_rsp ${target} objects)
-        target_link_options(${cmakeTarget} PRIVATE /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /DELAYLOAD:mfreadwrite.dll)
+        target_link_options(${cmakeTarget} PRIVATE /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /DELAYLOAD:mfreadwrite.dll /DELAYLOAD:winmm.dll)
         target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
         if(NOT completeStatic)
             get_copy_of_response_file(archives_rsp ${target} archives)
@@ -800,7 +800,7 @@ endmacro()
 
 macro(append_build_type_setup)
     list(APPEND gnArgArg
-        use_qt=true
+        is_qtwebengine=true
         init_stack_vars=false
         is_component_build=false
         is_shared=true
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index f5cb6e04d0f..c0522869d48 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -382,11 +382,16 @@ foreach(arch ${archs})
 
         if(LINUX)
             list(APPEND gnArgArg
+                use_gtk=false # GTK toolkit bindings
+                use_qt=false # Qt5 toolkit bindings
                 use_cups=false
                 use_gio=false
                 use_gnome_keyring=false
-                use_udev=true
                 use_bundled_fontconfig=false
+                use_glib=false
+                use_bluez=false
+                use_vaapi=false
+                use_udev=true
                 enable_session_service=false
                 is_cfi=false
                 use_ozone=true
@@ -395,9 +400,6 @@ foreach(arch ${archs})
                 ozone_platform_external=true
                 ozone_platform="qt"
                 ozone_extra_path="${CMAKE_CURRENT_LIST_DIR}/ozone/ozone_extra.gni"
-                use_glib=false
-                use_bluez=false
-                use_vaapi=false
             )
             set(systemLibs libjpeg libpng freetype harfbuzz libevent libwebp libxml
                 opus snappy libvpx icu ffmpeg re2 lcms2
diff --git a/src/core/accessibility_tree_formatter_qt.cpp b/src/core/accessibility_tree_formatter_qt.cpp
index c8560565433..021ef054667 100644
--- a/src/core/accessibility_tree_formatter_qt.cpp
+++ b/src/core/accessibility_tree_formatter_qt.cpp
@@ -24,16 +24,16 @@ class AccessibilityTreeFormatterQt : public ui::AXTreeFormatterBase {
     explicit AccessibilityTreeFormatterQt();
     ~AccessibilityTreeFormatterQt() override;
 
-   base::Value BuildTree(ui::AXPlatformNodeDelegate *start) const override;
-   base::Value BuildTreeForSelector(const AXTreeSelector &selector) const override
+   base::Value::Dict BuildTree(ui::AXPlatformNodeDelegate *start) const override;
+   base::Value::Dict BuildTreeForSelector(const AXTreeSelector &selector) const override
    {
-       return base::Value{};
+       return base::Value::Dict{};
    }
 
 private:
     void RecursiveBuildAccessibilityTree(const BrowserAccessibility &node, base::Value::Dict *dict) const;
     void AddProperties(const BrowserAccessibility &node, base::Value::Dict *dict) const;
-    std::string ProcessTreeForOutput(const base::DictionaryValue &node) const override;
+    std::string ProcessTreeForOutput(const base::Value::Dict &node) const override;
 };
 
 AccessibilityTreeFormatterQt::AccessibilityTreeFormatterQt()
@@ -44,13 +44,13 @@ AccessibilityTreeFormatterQt::~AccessibilityTreeFormatterQt()
 {
 }
 
-base::Value AccessibilityTreeFormatterQt::BuildTree(ui::AXPlatformNodeDelegate *start) const
+base::Value::Dict AccessibilityTreeFormatterQt::BuildTree(ui::AXPlatformNodeDelegate *start) const
 {
     BrowserAccessibility *root_internal =
         BrowserAccessibility::FromAXPlatformNodeDelegate(start);
     base::Value::Dict dict;
     RecursiveBuildAccessibilityTree(*root_internal, &dict);
-    return base::Value(std::move(dict));
+    return dict;
 }
 
 void AccessibilityTreeFormatterQt::RecursiveBuildAccessibilityTree(const BrowserAccessibility &node, base::Value::Dict *dict) const
@@ -135,36 +135,33 @@ void AccessibilityTreeFormatterQt::AddProperties(const BrowserAccessibility &nod
     dict->Set("description", iface->text(QAccessible::Description).toStdString());
 }
 
-std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::DictionaryValue &node) const
+std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::Value::Dict &node) const
 {
     std::string error_value;
-    if (node.GetString("error", &error_value))
-        return error_value;
+    if (auto error_value = node.FindString("error"))
+        return *error_value;
 
     std::string line;
     std::string role_value;
-    node.GetString("role", &role_value);
-    if (!role_value.empty())
-        WriteAttribute(true, base::StringPrintf("%s", role_value.c_str()), &line);
+    if (auto role_value = node.FindString("role"))
+        WriteAttribute(true, base::StringPrintf("%s", role_value->c_str()), &line);
 
-    const base::ListValue *states_value = nullptr;
-    if (node.GetList("states", &states_value)) {
-        for (const auto &state : states_value->GetList()) {
+    if (const auto states_value = node.FindList("states")) {
+        for (const auto &state : *states_value) {
             if (auto *state_value = state.GetIfString())
                 WriteAttribute(false, *state_value, &line);
         }
     }
 
-    std::string name_value;
-    if (node.GetString("name", &name_value))
-        WriteAttribute(true, base::StringPrintf("name='%s'", name_value.c_str()), &line);
+    if (auto name_value = node.FindString("name"))
+        WriteAttribute(true, base::StringPrintf("name='%s'", name_value->c_str()), &line);
 
-    std::string description_value;
-    if (node.GetString("description", &description_value))
-        WriteAttribute(false, base::StringPrintf("description='%s'", description_value.c_str()), &line);
+    if (auto description_value = node.FindString("description"))
+        WriteAttribute(false, base::StringPrintf("description='%s'", description_value->c_str()), &line);
 
     int id_value;
-    node.GetInteger("id", &id_value);
+    if (auto maybe_id = node.FindInt("id"))
+        id_value = *maybe_id;
     WriteAttribute(false, base::StringPrintf("id=%d", id_value), &line);
 
     return line + "\n";
diff --git a/src/core/autofill_client_qt.cpp b/src/core/autofill_client_qt.cpp
index 01b5be7681d..aaf775d60e0 100644
--- a/src/core/autofill_client_qt.cpp
+++ b/src/core/autofill_client_qt.cpp
@@ -39,7 +39,7 @@ autofill::AutocompleteHistoryManager *AutofillClientQt::GetAutocompleteHistoryMa
 
 PrefService *AutofillClientQt::GetPrefs()
 {
-    return const_cast<PrefService *>(base::as_const(*this).GetPrefs());
+    return const_cast<PrefService *>(std::as_const(*this).GetPrefs());
 }
 
 const PrefService *AutofillClientQt::GetPrefs() const
diff --git a/src/core/autofill_popup_controller.cpp b/src/core/autofill_popup_controller.cpp
index f13188a99b5..6e5890e470d 100644
--- a/src/core/autofill_popup_controller.cpp
+++ b/src/core/autofill_popup_controller.cpp
@@ -26,7 +26,7 @@ void AutofillPopupController::setCurrentIndex(const QModelIndex &index)
 
     if (m_currentIndex.isValid()) {
         const autofill::Suggestion &suggestion = d->suggestions[m_currentIndex.row()];
-        d->delegate->DidSelectSuggestion(suggestion.main_text.value, suggestion.frontend_id, suggestion.GetPayload<std::string>());
+        d->delegate->DidSelectSuggestion(suggestion.main_text.value, suggestion.frontend_id, autofill::Suggestion::BackendId());
     }
 
     Q_EMIT currentIndexChanged(index);
@@ -79,8 +79,7 @@ void AutofillPopupController::acceptSuggestion()
 
     const int index = m_currentIndex.row();
     const autofill::Suggestion &suggestion = d->suggestions[index];
-    d->delegate->DidAcceptSuggestion(suggestion.main_text.value, suggestion.frontend_id,
-                                     suggestion.payload, index);
+    d->delegate->DidAcceptSuggestion(suggestion, index);
 }
 
 void AutofillPopupController::notifyPopupShown()
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 7c16d54a0a2..205ca6edf9b 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -24,7 +24,7 @@ namespace content {
 // static
 BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
         const ui::AXTreeUpdate &initialTree,
-        BrowserAccessibilityDelegate *delegate)
+        WebAXPlatformTreeManagerDelegate *delegate)
 {
 #if QT_CONFIG(accessibility)
     Q_ASSERT(delegate);
@@ -49,7 +49,7 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
 
 // static
 BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
-        BrowserAccessibilityDelegate *delegate)
+        WebAXPlatformTreeManagerDelegate *delegate)
 {
 #if QT_CONFIG(accessibility)
     return BrowserAccessibilityManager::Create(BrowserAccessibilityManagerQt::GetEmptyDocument(), delegate);
@@ -62,7 +62,7 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
 BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
     QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
     const ui::AXTreeUpdate &initialTree,
-    BrowserAccessibilityDelegate* delegate)
+    WebAXPlatformTreeManagerDelegate* delegate)
       : BrowserAccessibilityManager(delegate)
       , m_webContentsAccessibility(webContentsAccessibility)
 {
@@ -148,9 +148,13 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
 }
 
 void BrowserAccessibilityManagerQt::FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
-                                                       BrowserAccessibility* node)
+                                                       const ui::AXNode *node)
 {
-    auto *iface = toQAccessibleInterface(node);
+    BrowserAccessibilityManager::FireGeneratedEvent(event_type, node);
+
+    BrowserAccessibility *wrapper = GetFromAXNode(node);
+    DCHECK(wrapper);
+    auto *iface = toQAccessibleInterface(wrapper);
 
     switch (event_type) {
     case ui::AXEventGenerator::Event::VALUE_IN_TEXT_FIELD_CHANGED:
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index 6cd3c84de49..839f6da20bd 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -24,13 +24,13 @@ class BrowserAccessibilityManagerQt : public BrowserAccessibilityManager
 public:
     BrowserAccessibilityManagerQt(QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
                                   const ui::AXTreeUpdate &initialTree,
-                                  BrowserAccessibilityDelegate *delegate);
+                                  WebAXPlatformTreeManagerDelegate *delegate);
     ~BrowserAccessibilityManagerQt() override;
     void FireBlinkEvent(ax::mojom::Event event_type,
                         BrowserAccessibility *node,
                         int action_request_id) override;
     void FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
-                            BrowserAccessibility* node) override;
+                            const ui::AXNode *node) override;
 
     QAccessibleInterface *rootParentAccessible();
     bool isValid() const { return m_valid; }
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index dd40eaf4927..7c9111c5618 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -357,6 +357,8 @@ QAccessible::Role BrowserAccessibilityInterface::role() const
     case ax::mojom::Role::kComboBoxMenuButton:
     case ax::mojom::Role::kTextFieldWithComboBox:
         return QAccessible::ComboBox;
+    case ax::mojom::Role::kComboBoxSelect:
+        return QAccessible::PopupMenu;
     case ax::mojom::Role::kComplementary:
         return QAccessible::ComplementaryContent;
     case ax::mojom::Role::kComment:
diff --git a/src/core/client_hints.cpp b/src/core/client_hints.cpp
index f80fa5797f6..2a30bb51b26 100644
--- a/src/core/client_hints.cpp
+++ b/src/core/client_hints.cpp
@@ -161,4 +161,13 @@ blink::UserAgentMetadata ClientHints::GetUserAgentMetadata()
     return embedder_support::GetUserAgentMetadata();
 }
 
+void ClientHints::SetMostRecentMainFrameViewportSize(
+    const gfx::Size& viewport_size) {
+  viewport_size_ = viewport_size;
+}
+
+gfx::Size
+ClientHints::GetMostRecentMainFrameViewportSize() {
+  return viewport_size_;
+}
 } // namespace
diff --git a/src/core/client_hints.h b/src/core/client_hints.h
index 841f41993c0..a80629fc9dc 100644
--- a/src/core/client_hints.h
+++ b/src/core/client_hints.h
@@ -70,6 +70,9 @@ class ClientHints : public KeyedService, public content::ClientHintsControllerDe
 
     void ClearAdditionalClientHints() override;
 
+    void SetMostRecentMainFrameViewportSize(const gfx::Size&) override;
+    gfx::Size GetMostRecentMainFrameViewportSize() override;
+
 private:
     SEQUENCE_CHECKER(sequence_checker_);
 
@@ -87,6 +90,11 @@ class ClientHints : public KeyedService, public content::ClientHintsControllerDe
 
     std::unique_ptr<network::NetworkQualityTracker> network_quality_tracker_
         GUARDED_BY_CONTEXT(sequence_checker_);
+
+    // This stores the viewport size of the most recent visible main frame tree
+    // node. This value is only used when the viewport size cannot be directly
+    // queried such as for prefetch requests and for tab restores.
+    gfx::Size viewport_size_;
 };
 
 } // namespace QtWebEngineCore
diff --git a/src/core/compositor/vulkan_implementation_qt.cpp b/src/core/compositor/vulkan_implementation_qt.cpp
index 3090a945a3d..f24ec334be8 100644
--- a/src/core/compositor/vulkan_implementation_qt.cpp
+++ b/src/core/compositor/vulkan_implementation_qt.cpp
@@ -142,10 +142,9 @@ bool VulkanImplementationQt::CanImportGpuMemoryBuffer(
     return false;
 }
 
-std::unique_ptr<VulkanImage>
-VulkanImplementationQt::CreateImageFromGpuMemoryHandle(VulkanDeviceQueue * /*device_queue*/,
-                                                       gfx::GpuMemoryBufferHandle /*gmb_handle*/,
-                                                       gfx::Size /*size*/, VkFormat /*vk_format*/)
+std::unique_ptr<VulkanImage> VulkanImplementationQt::CreateImageFromGpuMemoryHandle(VulkanDeviceQueue *, gfx::GpuMemoryBufferHandle,
+                                                                                    gfx::Size, VkFormat,
+                                                                                    const gfx::ColorSpace &)
 {
     NOTREACHED();
     return nullptr;
diff --git a/src/core/compositor/vulkan_implementation_qt.h b/src/core/compositor/vulkan_implementation_qt.h
index db48aceadcc..56a61e08651 100644
--- a/src/core/compositor/vulkan_implementation_qt.h
+++ b/src/core/compositor/vulkan_implementation_qt.h
@@ -34,10 +34,10 @@ class VulkanImplementationQt : public VulkanImplementation
     VkExternalMemoryHandleTypeFlagBits GetExternalImageHandleType() override;
     bool CanImportGpuMemoryBuffer(VulkanDeviceQueue* device_queue,
                                   gfx::GpuMemoryBufferType memory_buffer_type) override;
-    std::unique_ptr<VulkanImage>
-    CreateImageFromGpuMemoryHandle(VulkanDeviceQueue *device_queue,
-                                   gfx::GpuMemoryBufferHandle gmb_handle, gfx::Size size,
-                                   VkFormat vk_format) override;
+    std::unique_ptr<VulkanImage> CreateImageFromGpuMemoryHandle(VulkanDeviceQueue *device_queue,
+                                                                gfx::GpuMemoryBufferHandle gmb_handle,
+                                                                gfx::Size size, VkFormat vk_format,
+                                                                const gfx::ColorSpace &color_space) override;
 
 private:
     VulkanInstance vulkan_instance_;
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index bf04548634a..71e188a7627 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -368,7 +368,7 @@ source_set("qtwebengine_sources") {
       "//extensions/common/url_pattern.h",
     ]
   }
-  if (is_linux) {
+  if (is_linux || is_win) {
     sources += [
       "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.cc",
       "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h",
@@ -378,6 +378,8 @@ source_set("qtwebengine_sources") {
     sources += [
       "//chrome/browser/net/chrome_mojo_proxy_resolver_win.cc",
       "//chrome/browser/net/chrome_mojo_proxy_resolver_win.h",
+      "//chrome/browser/ui/webui/sandbox/sandbox_handler.cc",
+      "//chrome/browser/ui/webui/sandbox/sandbox_handler.h",
     ]
     deps += [ "//services/proxy_resolver_win",
               "//services/proxy_resolver_win/public/mojom",
@@ -508,6 +510,7 @@ repack("qtwebengine_repack_resources") {
     "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
     "$root_gen_dir/content/content_resources.pak",
     "$root_gen_dir/content/dev_ui_content_resources.pak",
+    "$root_gen_dir/content/indexed_db_resources.pak",
     "$root_gen_dir/content/quota_internals_resources.pak",
     "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
     "$root_gen_dir/net/net_resources.pak",
@@ -525,6 +528,7 @@ repack("qtwebengine_repack_resources") {
      "//content/browser/resources/media:resources",
      "//content/browser/tracing:resources",
      "//content:content_resources",
+     "//content/browser/resources/indexed_db:resources",
      "//content/browser/resources/quota:resources",
      "//content:dev_ui_content_resources_grit",
      "//mojo/public/js:resources",
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 075530bdd1a..553228ffcd5 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -1231,8 +1231,7 @@ bool ContentBrowserClientQt::WillCreateURLLoaderFactory(
 
 std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
 ContentBrowserClientQt::WillCreateURLLoaderRequestInterceptors(content::NavigationUIData* navigation_ui_data,
-                                       int frame_tree_node_id,
-                                       const scoped_refptr<network::SharedURLLoaderFactory>& network_loader_factory)
+                                       int frame_tree_node_id)
 {
     std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>> interceptors;
 #if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index cb0fbe46c6f..b81b96ce1ce 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -193,8 +193,7 @@ class ContentBrowserClientQt : public content::ContentBrowserClient
                                 const std::string &scheme) override;
     std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
     WillCreateURLLoaderRequestInterceptors(content::NavigationUIData *navigation_ui_data,
-                                           int frame_tree_node_id,
-                                           const scoped_refptr<network::SharedURLLoaderFactory> &network_loader_factory) override;
+                                           int frame_tree_node_id) override;
     bool WillCreateURLLoaderFactory(content::BrowserContext *browser_context,
                                     content::RenderFrameHost *frame,
                                     int render_process_id,
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 67faabde871..4a67dc029ec 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -50,8 +50,8 @@ const char kWidevineCdmFileName[] =
 #endif  // BUILDFLAG(ENABLE_LIBRARY_CDMS)
 
 #if QT_CONFIG(webengine_printing_and_pdf)
+#include "components/pdf/common/internal_plugin_helpers.h"
 #include "pdf/pdf.h"
-const char kPdfPluginMimeType[] = "application/x-google-chrome-pdf";
 const char kPdfPluginPath[] = "internal-pdf-viewer";
 #endif // QT_CONFIG(webengine_printing_and_pdf)
 
@@ -98,7 +98,7 @@ static QString getProgramFilesDir(bool x86Dir = false)
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE.Chromium file.
 
-#include "content/public/common/pepper_plugin_info.h"
+#include "content/public/common/content_plugin_info.h"
 #include "ppapi/shared_impl/ppapi_permissions.h"
 
 static QString ppapiPluginsPath()
@@ -114,16 +114,19 @@ static QString ppapiPluginsPath()
     return potentialPluginsPath;
 }
 
-void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins)
+void ComputeBuiltInPlugins(std::vector<content::ContentPluginInfo> *plugins)
 {
 #if QT_CONFIG(webengine_printing_and_pdf)
-    content::PepperPluginInfo pdf_info;
+    static constexpr char kPDFPluginExtension[] = "pdf";
+    static constexpr char kPDFPluginDescription[] = "Portable Document Format";
+    content::ContentPluginInfo pdf_info;
     pdf_info.is_internal = true;
     pdf_info.is_out_of_process = true;
     pdf_info.name = "Chromium PDF Viewer";
-    pdf_info.description = "Portable Document Format";
+    pdf_info.description = kPDFPluginDescription;
     pdf_info.path = base::FilePath::FromUTF8Unsafe(kPdfPluginPath);
-    content::WebPluginMimeType pdf_mime_type(kPdfPluginMimeType, "pdf", "Portable Document Format");
+    content::WebPluginMimeType pdf_mime_type(
+        pdf::kInternalPluginMimeType, kPDFPluginExtension, kPDFPluginDescription);
     pdf_info.mime_types.push_back(pdf_mime_type);
     plugins->push_back(pdf_info);
 #endif // QT_CONFIG(webengine_printing_and_pdf)
@@ -131,7 +134,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins)
 
 namespace QtWebEngineCore {
 
-void ContentClientQt::AddPepperPlugins(std::vector<content::PepperPluginInfo>* plugins)
+void ContentClientQt::AddPlugins(std::vector<content::ContentPluginInfo> *plugins)
 {
     ComputeBuiltInPlugins(plugins);
 }
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index f0afdcb5872..92d41b748ae 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -14,7 +14,7 @@ namespace QtWebEngineCore {
 class ContentClientQt : public content::ContentClient {
 public:
 #if QT_CONFIG(webengine_pepper_plugins)
-    void AddPepperPlugins(std::vector<content::PepperPluginInfo>* plugins) override;
+    void AddPlugins(std::vector<content::ContentPluginInfo> *plugins) override;
 #endif
     void AddContentDecryptionModules(std::vector<content::CdmInfo> *cdms,
                                      std::vector<media::CdmHostFilePath> *cdm_host_file_paths) override;
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index cda922ffa98..73698e26373 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -316,7 +316,7 @@ void DevToolsFrontendQt::WebContentsDestroyed()
 void DevToolsFrontendQt::SetPreference(const std::string &name, const std::string &value)
 {
     DCHECK(m_prefStore);
-    m_prefStore->SetValue(name, base::WrapUnique(new base::Value(value)), 0);
+    m_prefStore->SetValue(name, base::Value(value), 0);
 }
 
 void DevToolsFrontendQt::RemovePreference(const std::string &name)
diff --git a/src/core/extensions/component_extension_resource_manager_qt.cpp b/src/core/extensions/component_extension_resource_manager_qt.cpp
index b2cb7e356be..428f673d39d 100644
--- a/src/core/extensions/component_extension_resource_manager_qt.cpp
+++ b/src/core/extensions/component_extension_resource_manager_qt.cpp
@@ -37,12 +37,12 @@ ComponentExtensionResourceManagerQt::ComponentExtensionResourceManagerQt()
     AddComponentResourceEntries(kPdfResources, kPdfResourcesSize);
 #endif
 #if BUILDFLAG(ENABLE_PDF)
-    base::Value dict(base::Value::Type::DICTIONARY);
+    base::Value::Dict dict;
     pdf_extension_util::AddStrings(pdf_extension_util::PdfViewerContext::kPdfViewer, &dict);
-    pdf_extension_util::AddAdditionalData(&dict);
+    pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict);
 
     ui::TemplateReplacements pdf_viewer_replacements;
-    ui::TemplateReplacementsFromDictionaryValue(dict.GetDict(), &pdf_viewer_replacements);
+    ui::TemplateReplacementsFromDictionaryValue(dict, &pdf_viewer_replacements);
     template_replacements_[extension_misc::kPdfExtensionId] = std::move(pdf_viewer_replacements);
 #endif
 }
diff --git a/src/core/extensions/extensions_browser_client_qt.cpp b/src/core/extensions/extensions_browser_client_qt.cpp
index df720987aac..ab44c23ebbb 100644
--- a/src/core/extensions/extensions_browser_client_qt.cpp
+++ b/src/core/extensions/extensions_browser_client_qt.cpp
@@ -166,7 +166,7 @@ class ResourceBundleFileLoader : public network::mojom::URLLoader
         if (!head->mime_type.empty()) {
             head->headers->AddHeader(net::HttpRequestHeaders::kContentType, head->mime_type.c_str());
         }
-        client_->OnReceiveResponse(std::move(head), std::move(consumer_handle));
+        client_->OnReceiveResponse(std::move(head), std::move(consumer_handle), absl::nullopt);
 
         uint32_t write_size = data->size();
         MojoResult result = producer_handle->WriteData(data->front(), &write_size, MOJO_WRITE_DATA_FLAG_NONE);
@@ -291,6 +291,24 @@ BrowserContext *ExtensionsBrowserClientQt::GetOriginalContext(BrowserContext *co
     return context;
 }
 
+BrowserContext *ExtensionsBrowserClientQt::GetRedirectedContextInIncognito(BrowserContext *context, bool, bool)
+{
+    // like in ShellExtensionsBrowserClient:
+    return context;
+}
+
+BrowserContext *ExtensionsBrowserClientQt::GetContextForRegularAndIncognito(BrowserContext *context, bool, bool)
+{
+    // like in ShellExtensionsBrowserClient:
+    return context;
+}
+
+BrowserContext *ExtensionsBrowserClientQt::GetRegularProfile(BrowserContext *context, bool, bool)
+{
+    // like in ShellExtensionsBrowserClient:
+    return context;
+}
+
 bool ExtensionsBrowserClientQt::IsGuestSession(BrowserContext *context) const
 {
     return context->IsOffTheRecord();
diff --git a/src/core/extensions/extensions_browser_client_qt.h b/src/core/extensions/extensions_browser_client_qt.h
index a5a35175cdb..78b56d920f9 100644
--- a/src/core/extensions/extensions_browser_client_qt.h
+++ b/src/core/extensions/extensions_browser_client_qt.h
@@ -35,6 +35,9 @@ class ExtensionsBrowserClientQt : public ExtensionsBrowserClient
     bool HasOffTheRecordContext(content::BrowserContext *context) override;
     content::BrowserContext *GetOffTheRecordContext(content::BrowserContext *context) override;
     content::BrowserContext *GetOriginalContext(content::BrowserContext *context) override;
+    content::BrowserContext *GetRedirectedContextInIncognito(content::BrowserContext *context, bool, bool) override;
+    content::BrowserContext *GetContextForRegularAndIncognito(content::BrowserContext *context, bool, bool) override;
+    content::BrowserContext *GetRegularProfile(content::BrowserContext *context, bool, bool) override;
     bool IsGuestSession(content::BrowserContext *context) const override;
     bool IsExtensionIncognitoEnabled(const std::string &extension_id, content::BrowserContext *context) const override;
     bool CanExtensionCrossIncognito(const Extension *extension, content::BrowserContext *context) const override;
diff --git a/src/core/extensions/messaging_delegate_qt.cpp b/src/core/extensions/messaging_delegate_qt.cpp
index 791949cb522..b0089aea21c 100644
--- a/src/core/extensions/messaging_delegate_qt.cpp
+++ b/src/core/extensions/messaging_delegate_qt.cpp
@@ -11,10 +11,10 @@ MessagingDelegateQt::MessagingDelegateQt()
 {
 }
 
-std::unique_ptr<base::DictionaryValue> MessagingDelegateQt::MaybeGetTabInfo(content::WebContents *web_contents)
+absl::optional<base::Value::Dict> MessagingDelegateQt::MaybeGetTabInfo(content::WebContents *web_contents)
 {
     Q_UNUSED(web_contents);
-    return nullptr;
+    return absl::nullopt;
 }
 
 } // namespace extensions
diff --git a/src/core/extensions/messaging_delegate_qt.h b/src/core/extensions/messaging_delegate_qt.h
index f1d3125440d..c3c6244f51e 100644
--- a/src/core/extensions/messaging_delegate_qt.h
+++ b/src/core/extensions/messaging_delegate_qt.h
@@ -22,7 +22,7 @@ class MessagingDelegateQt : public MessagingDelegate
     MessagingDelegateQt();
 
     // MessagingDelegate implementation.
-    std::unique_ptr<base::DictionaryValue> MaybeGetTabInfo(content::WebContents *web_contents) override;
+    absl::optional<base::Value::Dict> MaybeGetTabInfo(content::WebContents *web_contents) override;
 };
 
 } // namespace extensions
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index f1b843e8ac1..e69db7553c0 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -179,11 +179,14 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
     if (d_ptr->fileDialogListener) {
         QStringList files(filesList);
         base::FilePath baseDir;
-        if (d_ptr->mode == UploadFolder && !filesList.isEmpty()
-            && QFileInfo(filesList.first()).isDir()) {
-            // Enumerate the directory
-            files = listRecursively(QDir(filesList.first()));
-            baseDir = toFilePath(filesList.first());
+        if (d_ptr->mode == UploadFolder && !filesList.isEmpty()) {
+            if (QFileInfo(filesList.first()).isDir()) {
+                // Enumerate the directory
+                files = listRecursively(QDir(filesList.first()));
+                baseDir = toFilePath(filesList.first());
+            } else {
+                baseDir = toFilePath(filesList.first()).DirName();
+            }
         }
 
         std::vector<blink::mojom::FileChooserFileInfoPtr> chooser_files;
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
index 6144aa9eadc..a8406c8aeb8 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.cpp
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
@@ -258,7 +258,7 @@ FileSystemAccessPermissionContextQt::GetWritePermissionGrant(const url::Origin &
 
 void FileSystemAccessPermissionContextQt::ConfirmSensitiveEntryAccess(
         const url::Origin &origin, PathType path_type, const base::FilePath &path,
-        HandleType handle_type, ui::SelectFileDialog::Type dialog_type,
+        HandleType handle_type, UserAction user_action,
         content::GlobalRenderFrameHostId frame_id,
         base::OnceCallback<void(SensitiveEntryResult)> callback)
 {
@@ -271,7 +271,7 @@ void FileSystemAccessPermissionContextQt::ConfirmSensitiveEntryAccess(
             FROM_HERE, { base::MayBlock(), base::TaskPriority::USER_VISIBLE },
             base::BindOnce(&ShouldBlockAccessToPath, path, handle_type),
             base::BindOnce(&FileSystemAccessPermissionContextQt::DidConfirmSensitiveDirectoryAccess,
-                           m_weakFactory.GetWeakPtr(), origin, path, handle_type, dialog_type, frame_id,
+                           m_weakFactory.GetWeakPtr(), origin, path, handle_type, user_action, frame_id,
                            std::move(callback)));
 }
 
@@ -322,7 +322,7 @@ FileSystemAccessPermissionContextQt::GetLastPickedDirectory(const url::Origin &o
 }
 
 base::FilePath FileSystemAccessPermissionContextQt::GetWellKnownDirectoryPath(
-        blink::mojom::WellKnownDirectory directory)
+        blink::mojom::WellKnownDirectory directory, const url::Origin &origin)
 {
     QStandardPaths::StandardLocation location = QStandardPaths::DocumentsLocation;
     switch (directory) {
@@ -378,14 +378,14 @@ void FileSystemAccessPermissionContextQt::NavigatedAwayFromOrigin(const url::Ori
 }
 
 void FileSystemAccessPermissionContextQt::DidConfirmSensitiveDirectoryAccess(
-        const url::Origin &origin, const base::FilePath &path, HandleType handle_type, ui::SelectFileDialog::Type dialog_type,
+        const url::Origin &origin, const base::FilePath &path, HandleType handle_type, UserAction user_action,
         content::GlobalRenderFrameHostId frame_id,
         base::OnceCallback<void(SensitiveEntryResult)> callback, bool should_block)
 {
     Q_UNUSED(origin);
     Q_UNUSED(path);
     Q_UNUSED(handle_type);
-    Q_UNUSED(dialog_type);
+    Q_UNUSED(user_action);
     Q_UNUSED(frame_id);
 
     if (should_block)
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.h b/src/core/file_system_access/file_system_access_permission_context_qt.h
index affe141bc2b..71323952514 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.h
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.h
@@ -38,7 +38,7 @@ class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPerm
                             HandleType handle_type, UserAction user_action) override;
     void ConfirmSensitiveEntryAccess(
             const url::Origin &origin, PathType path_type, const base::FilePath &path,
-            HandleType handle_type, ui::SelectFileDialog::Type dialog_type,
+            HandleType handle_type, UserAction user_action,
             content::GlobalRenderFrameHostId frame_id,
             base::OnceCallback<void(SensitiveEntryResult)> callback) override;
     void PerformAfterWriteChecks(std::unique_ptr<content::FileSystemAccessWriteItem> item,
@@ -50,7 +50,7 @@ class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPerm
                                 const base::FilePath &path, const PathType type) override;
     FileSystemAccessPermissionContextQt::PathInfo
     GetLastPickedDirectory(const url::Origin &origin, const std::string &id) override;
-    base::FilePath GetWellKnownDirectoryPath(blink::mojom::WellKnownDirectory directory) override;
+    base::FilePath GetWellKnownDirectoryPath(blink::mojom::WellKnownDirectory directory, const url::Origin &origin) override;
     std::u16string GetPickerTitle(const blink::mojom::FilePickerOptionsPtr &) override;
 
     void NavigatedAwayFromOrigin(const url::Origin &origin);
@@ -61,7 +61,7 @@ class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPerm
 
     void DidConfirmSensitiveDirectoryAccess(
             const url::Origin &origin, const base::FilePath &path, HandleType handle_type,
-            ui::SelectFileDialog::Type dialog_type, content::GlobalRenderFrameHostId frame_id,
+            UserAction user_action, content::GlobalRenderFrameHostId frame_id,
             base::OnceCallback<void(SensitiveEntryResult)> callback, bool should_block);
 
     content::BrowserContext *m_profile;
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index f8baf72a5df..a6ac070afe5 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -14,6 +14,7 @@
 
 #include "base/strings/strcat.h"
 #include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_context.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/desktop_media_id.h"
 #include "content/public/browser/desktop_streams_registry.h"
diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp
index e35f1afb595..19a1a884f80 100644
--- a/src/core/net/custom_url_loader_factory.cpp
+++ b/src/core/net/custom_url_loader_factory.cpp
@@ -285,7 +285,7 @@ class CustomURLLoader : public network::mojom::URLLoader
         m_head->mime_type = m_mimeType;
         m_head->charset = m_charset;
         m_headerBytesRead = m_head->headers->raw_headers().length();
-        m_client->OnReceiveResponse(std::move(m_head), std::move(m_pipeConsumerHandle));
+        m_client->OnReceiveResponse(std::move(m_head), std::move(m_pipeConsumerHandle), absl::nullopt);
         m_head = nullptr;
 
         m_watcher = std::make_unique<mojo::SimpleWatcher>(
@@ -335,7 +335,7 @@ class CustomURLLoader : public network::mojom::URLLoader
         m_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
         m_head->encoded_data_length = m_head->headers->raw_headers().length();
         m_head->content_length = m_head->encoded_body_length = -1;
-        m_client->OnReceiveResponse(std::move(m_head), mojo::ScopedDataPipeConsumerHandle());
+        m_client->OnReceiveResponse(std::move(m_head), mojo::ScopedDataPipeConsumerHandle(), absl::nullopt);
         CompleteWithFailure(net::Error(error));
     }
     void notifyReadyRead() override
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 2edf915c81b..70ec61b34e4 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -110,10 +110,9 @@ class InterceptedRequest : public network::mojom::URLLoader
     void Restart();
 
     // network::mojom::URLLoaderClient
-    void OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle) override;
+    void OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle, absl::optional<mojo_base::BigBuffer>) override;
     void OnReceiveRedirect(const net::RedirectInfo &redirect_info, network::mojom::URLResponseHeadPtr head) override;
     void OnUploadProgress(int64_t current_position, int64_t total_size, OnUploadProgressCallback callback) override;
-    void OnReceiveCachedMetadata(mojo_base::BigBuffer data) override;
     void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
     void OnComplete(const network::URLLoaderCompletionStatus &status) override;
     void OnReceiveEarlyHints(network::mojom::EarlyHintsPtr) override {}
@@ -403,11 +402,11 @@ void InterceptedRequest::ContinueAfterIntercept()
 
 // URLLoaderClient methods.
 
-void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle handle)
+void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle handle, absl::optional<mojo_base::BigBuffer> buffer)
 {
     current_response_ = head.Clone();
 
-    target_client_->OnReceiveResponse(std::move(head), std::move(handle));
+    target_client_->OnReceiveResponse(std::move(head), std::move(handle), std::move(buffer));
 }
 
 void InterceptedRequest::OnReceiveRedirect(const net::RedirectInfo &redirect_info, network::mojom::URLResponseHeadPtr head)
@@ -427,11 +426,6 @@ void InterceptedRequest::OnUploadProgress(int64_t current_position, int64_t tota
     target_client_->OnUploadProgress(current_position, total_size, std::move(callback));
 }
 
-void InterceptedRequest::OnReceiveCachedMetadata(mojo_base::BigBuffer data)
-{
-    target_client_->OnReceiveCachedMetadata(std::move(data));
-}
-
 void InterceptedRequest::OnTransferSizeUpdated(int32_t transfer_size_diff)
 {
     target_client_->OnTransferSizeUpdated(transfer_size_diff);
diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp
index 66491e0199d..0551d9be7a5 100644
--- a/src/core/net/webui_controller_factory_qt.cpp
+++ b/src/core/net/webui_controller_factory_qt.cpp
@@ -128,7 +128,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, co
     if (url.host_piece() == chrome::kChromeUIWebRtcLogsHost)
         return &NewWebUI<WebRtcLogsUI>;
 #endif
-#if BUILDFLAG(IS_LINUX) // Consider enabling for BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
     if (url.host_piece() == chrome::kChromeUISandboxHost)
         return &NewWebUI<SandboxInternalsUI>;
 #endif
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index 2e76110f9ea..fad3ccc1142 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -59,7 +59,7 @@ bool GLSurfaceQt::IsOffscreen()
     return true;
 }
 
-gfx::SwapResult GLSurfaceQt::SwapBuffers(PresentationCallback callback)
+gfx::SwapResult GLSurfaceQt::SwapBuffers(PresentationCallback callback, FrameData data)
 {
     LOG(ERROR) << "Attempted to call SwapBuffers on a pbuffer.";
     Q_UNREACHABLE();
diff --git a/src/core/ozone/gl_surface_qt.h b/src/core/ozone/gl_surface_qt.h
index f9d18a0aef0..0ef8fbbcae5 100644
--- a/src/core/ozone/gl_surface_qt.h
+++ b/src/core/ozone/gl_surface_qt.h
@@ -21,7 +21,7 @@ class GLSurfaceQt: public GLSurface {
     GLDisplay *GetGLDisplay() override;
     void *GetConfig() override;
     bool IsOffscreen() override;
-    gfx::SwapResult SwapBuffers(PresentationCallback callback) override;
+    gfx::SwapResult SwapBuffers(PresentationCallback callback, FrameData data) override;
     gfx::Size GetSize() override;
     GLSurfaceFormat GetFormat() override;
 
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp
index 4971ef8475c..c4929295e59 100644
--- a/src/core/ozone/ozone_platform_qt.cpp
+++ b/src/core/ozone/ozone_platform_qt.cpp
@@ -84,7 +84,6 @@ const ui::OzonePlatform::PlatformProperties &OzonePlatformQt::GetPlatformPropert
     static base::NoDestructor<ui::OzonePlatform::PlatformProperties> properties;
     static bool initialized = false;
     if (!initialized) {
-        properties->uses_external_vulkan_image_factory = true;
         properties->fetch_buffer_formats_for_gmb_on_gpu = true;
 
         initialized = true;
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 14fa31ce44b..34251880eae 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -122,8 +122,6 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
     registry->RegisterBooleanPref(autofill::prefs::kAutofillCreditCardEnabled, false);
     registry->RegisterBooleanPref(autofill::prefs::kAutofillCreditCardFidoAuthEnabled, false);
     registry->RegisterBooleanPref(autofill::prefs::kAutofillWalletImportEnabled, false);
-    registry->RegisterBooleanPref(autofill::prefs::kAutofillJapanCityFieldMigratedDeprecated,
-                                  false);
 
     // devtools
     registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);
@@ -190,7 +188,7 @@ QStringList PrefServiceAdapter::spellCheckLanguages() const
 {
     QStringList spellcheck_dictionaries;
     const auto &list = m_prefService->GetList(spellcheck::prefs::kSpellCheckDictionaries);
-    for (const auto &dictionary : list->GetList()) {
+    for (const auto &dictionary : list) {
         spellcheck_dictionaries.append(QString::fromStdString(dictionary.GetString()));
     }
 
diff --git a/src/core/printing/pdf_web_contents_helper_client_qt.cpp b/src/core/printing/pdf_web_contents_helper_client_qt.cpp
index cbeb7d112b5..4deb398c6ee 100644
--- a/src/core/printing/pdf_web_contents_helper_client_qt.cpp
+++ b/src/core/printing/pdf_web_contents_helper_client_qt.cpp
@@ -24,15 +24,14 @@ content::RenderFrameHost *FindPdfChildFrame(content::RenderFrameHost *rfh)
 
     content::RenderFrameHost *pdf_rfh = nullptr;
     rfh->ForEachRenderFrameHost(
-                base::BindRepeating(
-                    [](content::RenderFrameHost *&pdf_rfh, content::RenderFrameHost *rfh) {
+                    [&pdf_rfh](content::RenderFrameHost *rfh) {
                         if (!rfh->GetProcess()->IsPdf())
                             return;
 
                         DCHECK(IsPdfExtensionOrigin(rfh->GetParent()->GetLastCommittedOrigin()));
                         DCHECK(!pdf_rfh);
                         pdf_rfh = rfh;
-                    }, std::ref(pdf_rfh)));
+                    });
 
     return pdf_rfh;
 }
@@ -48,9 +47,13 @@ content::RenderFrameHost *PDFWebContentsHelperClientQt::FindPdfFrame(content::We
     return pdf_frame ? pdf_frame : main_frame;
 }
 
-void PDFWebContentsHelperClientQt::SetPluginCanSave(content::WebContents *contents, bool can_save)
+void PDFWebContentsHelperClientQt::SetPluginCanSave(content::RenderFrameHost *render_frame_host, bool can_save)
 {
-    auto *guest_view = extensions::MimeHandlerViewGuest::FromWebContents(contents);
+    auto *guest_view = extensions::MimeHandlerViewGuest::FromRenderFrameHost(render_frame_host);
     if (guest_view)
         guest_view->SetPluginCanSave(can_save);
 }
+
+void PDFWebContentsHelperClientQt::UpdateContentRestrictions(content::RenderFrameHost *, int)
+{
+}
diff --git a/src/core/printing/pdf_web_contents_helper_client_qt.h b/src/core/printing/pdf_web_contents_helper_client_qt.h
index ccc55298605..10df8a7468b 100644
--- a/src/core/printing/pdf_web_contents_helper_client_qt.h
+++ b/src/core/printing/pdf_web_contents_helper_client_qt.h
@@ -18,10 +18,10 @@ class PDFWebContentsHelperClientQt : public pdf::PDFWebContentsHelperClient
 private:
     // pdf::PDFWebContentsHelperClient:
     content::RenderFrameHost* FindPdfFrame(content::WebContents *contents) override;
-    void UpdateContentRestrictions(content::WebContents *contents, int content_restrictions) override {}
     void OnPDFHasUnsupportedFeature(content::WebContents *contents) override {}
     void OnSaveURL(content::WebContents *contents) override {}
-    void SetPluginCanSave(content::WebContents *contents, bool can_save) override;
+    void SetPluginCanSave(content::RenderFrameHost *render_frame_host, bool can_save) override;
+    void UpdateContentRestrictions(content::RenderFrameHost *, int) override;
 };
 
 #endif // PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index db557715acb..f071b59ad2f 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -188,9 +188,9 @@ void PrintViewManagerBaseQt::UpdatePrintingEnabled()
 #if QT_CONFIG(webengine_printing_and_pdf)
     enabled = true;
 #endif
-    web_contents()->ForEachRenderFrameHost(
-           base::BindRepeating(&PrintViewManagerBaseQt::SendPrintingEnabled,
-                               base::Unretained(this), enabled));
+    web_contents()->ForEachRenderFrameHost([this, enabled](content::RenderFrameHost *rfh) {
+        SendPrintingEnabled(enabled, rfh);
+    });
 }
 
 void PrintViewManagerBaseQt::NavigationStopped()
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 4c175768d53..80bbabf6304 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -14,7 +14,8 @@
 #include "components/autofill/content/renderer/autofill_assistant_agent.h"
 #include "components/autofill/content/renderer/password_autofill_agent.h"
 #include "components/autofill/content/renderer/password_generation_agent.h"
-#include "components/cdm/renderer/widevine_key_system_properties.h"
+#include "components/cdm/renderer/external_clear_key_key_system_info.h"
+#include "components/cdm/renderer/widevine_key_system_info.h"
 #include "components/error_page/common/error.h"
 #include "components/error_page/common/localized_error.h"
 #include "components/grit/components_resources.h"
@@ -25,7 +26,8 @@
 #include "content/public/common/url_constants.h"
 #include "content/public/renderer/render_thread.h"
 #include "extensions/buildflags/buildflags.h"
-#include "media/base/key_system_properties.h"
+#include "media/base/key_system_info.h"
+#include "media/cdm/cdm_capability.h"
 #include "media/media_buildflags.h"
 #include "mojo/public/cpp/bindings/binder_map.h"
 #include "net/base/net_errors.h"
@@ -71,13 +73,14 @@
 
 #if BUILDFLAG(ENABLE_LIBRARY_CDMS)
 #include "base/feature_list.h"
-#include "components/cdm/renderer/external_clear_key_key_system_properties.h"
 #include "content/public/renderer/key_system_support.h"
 #include "media/base/media_switches.h"
 #include "media/base/video_codecs.h"
 #include "third_party/widevine/cdm/buildflags.h"
+#if BUILDFLAG(ENABLE_WIDEVINE)
 #include "third_party/widevine/cdm/widevine_cdm_common.h"
 #endif
+#endif
 
 #if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
 #include "chrome/renderer/media/webrtc_logging_agent_impl.h"
@@ -204,6 +207,16 @@ void ContentRendererClientQt::RenderFrameCreated(content::RenderFrame *render_fr
                                 autofill_assistant_agent, associated_interfaces);
 }
 
+void ContentRendererClientQt::WebViewCreated(blink::WebView *web_view,
+                                             bool was_created_by_renderer,
+                                             const url::Origin *outermost_origin)
+{
+    Q_UNUSED(was_created_by_renderer);
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+    ExtensionsRendererClientQt::GetInstance()->WebViewCreated(web_view, outermost_origin);
+#endif
+}
+
 void ContentRendererClientQt::RunScriptsAtDocumentStart(content::RenderFrame *render_frame)
 {
 #if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -464,7 +477,7 @@ static const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"
 
 // External Clear Key (used for testing).
 static void AddExternalClearKey(const media::mojom::KeySystemCapabilityPtr &capability,
-                                media::KeySystemPropertiesVector *key_systems)
+                                media::KeySystemInfoVector *key_systems)
 {
     Q_UNUSED(capability);
     if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) {
@@ -590,7 +603,7 @@ static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& cap
 }
 
 static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
-                        media::KeySystemPropertiesVector *key_systems)
+                        media::KeySystemInfoVector *key_systems)
 {
     // Codecs and encryption schemes.
     media::SupportedCodecs codecs = media::EME_CODEC_NONE;
@@ -618,7 +631,7 @@ static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
     }
 
     // Robustness.
-    using Robustness = cdm::WidevineKeySystemProperties::Robustness;
+    using Robustness = cdm::WidevineKeySystemInfo::Robustness;
     auto max_audio_robustness = Robustness::SW_SECURE_CRYPTO;
     auto max_video_robustness = Robustness::SW_SECURE_DECODE;
 
@@ -631,7 +644,7 @@ static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
     auto persistent_state_support = media::EmeFeatureSupport::REQUESTABLE;
     auto distinctive_identifier_support = media::EmeFeatureSupport::NOT_SUPPORTED;
 
-    key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
+    key_systems->emplace_back(new cdm::WidevineKeySystemInfo(
                                   codecs, std::move(encryption_schemes), std::move(session_types),
                                   hw_secure_codecs, std::move(hw_secure_encryption_schemes),
                                   std::move(hw_secure_session_types),
@@ -645,7 +658,7 @@ static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
 void OnKeySystemSupportUpdated(media::GetSupportedKeySystemsCB cb,
                                content::KeySystemCapabilityPtrMap key_system_capabilities)
 {
-    media::KeySystemPropertiesVector key_systems;
+    media::KeySystemInfoVector key_systems;
     for (const auto &entry : key_system_capabilities) {
         const auto &key_system = entry.first;
         const auto &capability = entry.second;
diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h
index 2e16a0dc677..b2231f00acd 100644
--- a/src/core/renderer/content_renderer_client_qt.h
+++ b/src/core/renderer/content_renderer_client_qt.h
@@ -51,6 +51,9 @@ class ContentRendererClientQt
     void RenderThreadStarted() override;
     void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;
     void RenderFrameCreated(content::RenderFrame *render_frame) override;
+    void WebViewCreated(blink::WebView *web_view,
+                        bool was_created_by_renderer,
+                        const url::Origin *outermost_origin) override;
 
     void PrepareErrorPage(content::RenderFrame *render_frame,
                           const blink::WebURLError &error,
diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
index b29892b68e1..b36ed9e8b45 100644
--- a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
+++ b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
@@ -16,6 +16,7 @@
 #include "base/command_line.h"
 #include "base/lazy_instance.h"
 #include "base/stl_util.h"
+#include "base/types/optional_util.h"
 #include "content/public/common/content_constants.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/renderer/render_frame.h"
@@ -26,6 +27,7 @@
 #include "extensions/common/switches.h"
 #include "extensions/renderer/dispatcher.h"
 #include "extensions/renderer/extension_frame_helper.h"
+#include "extensions/renderer/extension_web_view_helper.h"
 #include "extensions/renderer/extensions_render_frame_observer.h"
 #include "extensions/renderer/renderer_extension_registry.h"
 #include "extensions/renderer/script_context.h"
@@ -114,6 +116,11 @@ void ExtensionsRendererClientQt::RenderThreadStarted()
     thread->AddObserver(extension_dispatcher_.get());
 }
 
+void ExtensionsRendererClientQt::WebViewCreated(blink::WebView *web_view, const url::Origin *outermost_origin)
+{
+    new extensions::ExtensionWebViewHelper(web_view, outermost_origin);
+}
+
 void ExtensionsRendererClientQt::RenderFrameCreated(content::RenderFrame *render_frame,
                                                     service_manager::BinderRegistry *registry)
 {
diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.h b/src/core/renderer/extensions/extensions_renderer_client_qt.h
index f9cac443c68..163819cbc63 100644
--- a/src/core/renderer/extensions/extensions_renderer_client_qt.h
+++ b/src/core/renderer/extensions/extensions_renderer_client_qt.h
@@ -16,6 +16,7 @@ namespace blink {
 class WebLocalFrame;
 struct WebPluginParams;
 class WebURL;
+class WebView;
 }
 
 namespace content {
@@ -55,6 +56,8 @@ class ExtensionsRendererClientQt : public extensions::ExtensionsRendererClient
 
     // Match ContentRendererClientQt's method names...
     void RenderThreadStarted();
+    void WebViewCreated(blink::WebView *web_view,
+                        const url::Origin *outermost_origin);
     void RenderFrameCreated(content::RenderFrame *, service_manager::BinderRegistry *);
     bool OverrideCreatePlugin(content::RenderFrame *render_frame,
                               const blink::WebPluginParams &params);
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.cpp b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
index 8fd59cbc22c..0824ed56d9d 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.cpp
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
@@ -30,10 +30,9 @@ WebChannelIPCTransportHost::WebChannelIPCTransportHost(content::WebContents *con
     , m_worldId(worldId)
     , m_receiver(contents, this)
 {
-    contents->ForEachRenderFrameHost(base::BindRepeating([](WebChannelIPCTransportHost *that, uint32_t worldId, content::RenderFrameHost *frame) {
-                                                   that->setWorldId(frame, worldId);
-                                               },
-                                               base::Unretained(this), worldId));
+    contents->ForEachRenderFrameHost([this, worldId](content::RenderFrameHost *frame) {
+                                         setWorldId(frame, worldId);
+                                     });
 }
 
 WebChannelIPCTransportHost::~WebChannelIPCTransportHost()
@@ -60,10 +59,9 @@ void WebChannelIPCTransportHost::setWorldId(uint32_t worldId)
 {
     if (m_worldId == worldId)
         return;
-    web_contents()->ForEachRenderFrameHost(base::BindRepeating([](WebChannelIPCTransportHost *that, uint32_t worldId, content::RenderFrameHost *frame) {
-                                                         that->setWorldId(frame, worldId);
-                                                     },
-                                                     base::Unretained(this), worldId));
+    web_contents()->ForEachRenderFrameHost([this, worldId](content::RenderFrameHost *frame) {
+                                               setWorldId(frame, worldId);
+                                           });
     m_worldId = worldId;
 }
 
@@ -77,11 +75,11 @@ void WebChannelIPCTransportHost::setWorldId(content::RenderFrameHost *frame, uin
 
 void WebChannelIPCTransportHost::resetWorldId()
 {
-    web_contents()->ForEachRenderFrameHost(base::BindRepeating([](WebChannelIPCTransportHost *that, content::RenderFrameHost *frame) {
+    web_contents()->ForEachRenderFrameHost([this] (content::RenderFrameHost *frame) {
         if (!frame->IsRenderFrameLive())
             return;
-        that->GetWebChannelIPCTransportRemote(frame)->ResetWorldId();
-    }, this));
+        GetWebChannelIPCTransportRemote(frame)->ResetWorldId();
+    });
 }
 
 void WebChannelIPCTransportHost::DispatchWebChannelMessage(const std::vector<uint8_t> &json)
diff --git a/src/core/sandbox_win.cpp b/src/core/sandbox_win.cpp
index 81fecc62ce4..bc70bced756 100644
--- a/src/core/sandbox_win.cpp
+++ b/src/core/sandbox_win.cpp
@@ -11,7 +11,7 @@
 #endif
 
 namespace QtWebEngineSandbox {
-// A duplicate of the function by same name in startup_helper_win.cc
+// A duplicate of the function by same name in sandbox_helper_win.cc
 static void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo *info)
 {
     info->broker_services = sandbox::SandboxFactory::GetBrokerServices();
@@ -19,7 +19,7 @@ static void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo *info)
         info->target_services = sandbox::SandboxFactory::GetTargetServices();
     } else {
         // Ensure the proper mitigations are enforced for the browser process.
-        sandbox::ApplyProcessMitigationsToCurrentProcess(
+        info->broker_services->RatchetDownSecurityMitigations(
             sandbox::MITIGATION_DEP | sandbox::MITIGATION_DEP_NO_ATL_THUNK |
             sandbox::MITIGATION_HARDEN_TOKEN_IL_POLICY);
         // Note: these mitigations are "post-startup".  Some mitigations that need
diff --git a/src/core/select_file_dialog_factory_qt.cpp b/src/core/select_file_dialog_factory_qt.cpp
index 1bf20918d22..9da27a4cf1c 100644
--- a/src/core/select_file_dialog_factory_qt.cpp
+++ b/src/core/select_file_dialog_factory_qt.cpp
@@ -65,7 +65,8 @@ class SelectFileDialogQt : public ui::SelectFileDialog
     void SelectFileImpl(Type type, const std::u16string &title, const base::FilePath &default_path,
                         const FileTypeInfo *file_types, int file_type_index,
                         const base::FilePath::StringType &default_extension,
-                        gfx::NativeWindow owning_window, void *params) override;
+                        gfx::NativeWindow owning_window, void *params, const GURL *) override;
+
     bool HasMultipleFileTypeChoicesImpl() override;
 
 private:
@@ -105,13 +106,14 @@ void SelectFileDialogQt::SelectFileImpl(Type type, const std::u16string &title,
                                         const base::FilePath &default_path,
                                         const FileTypeInfo *file_types, int file_type_index,
                                         const base::FilePath::StringType &default_extension,
-                                        gfx::NativeWindow owning_window, void *params)
+                                        gfx::NativeWindow owning_window, void *params, const GURL *caller)
 {
     Q_UNUSED(title);
     Q_UNUSED(file_type_index);
     Q_UNUSED(default_extension);
     Q_UNUSED(owning_window);
     Q_UNUSED(params);
+    Q_UNUSED(caller);
 
     QStringList acceptedSuffixes;
     if (file_types) {
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp
index 47c4fd528b2..c33fb908178 100644
--- a/src/core/user_script.cpp
+++ b/src/core/user_script.cpp
@@ -20,7 +20,7 @@ bool GetDeclarationValue(const base::StringPiece& line,
     std::string temp(line.data() + index + prefix.length(),
                      line.length() - index - prefix.length());
 
-    if (temp.empty() || !base::IsUnicodeWhitespace(temp[0]))
+    if (temp.empty() || !base::IsWhitespace(temp[0]))
         return false;
 
     base::TrimWhitespaceASCII(temp, base::TRIM_ALL, value);
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 1458c25ff2b..467266ee6af 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -153,14 +153,10 @@ static QVariant fromJSValue(const base::Value *result)
     }
     case base::Value::Type::DICTIONARY:
     {
-        const base::DictionaryValue *out;
-        if (result->GetAsDictionary(&out)) {
+        if (const auto dict = result->GetIfDict()) {
             QVariantMap map;
-            base::DictionaryValue::Iterator it(*out);
-            while (!it.IsAtEnd()) {
-                map.insert(toQt(it.key()), fromJSValue(&it.value()));
-                it.Advance();
-            }
+            for (const auto pair : *dict)
+                map.insert(toQt(pair.first), fromJSValue(&pair.second));
             ret.setValue(map);
         }
         break;
@@ -1026,7 +1022,7 @@ QAccessibleInterface *WebContentsAdapter::browserAccessible()
     content::BrowserAccessibilityManager *manager = rfh->GetOrCreateBrowserAccessibilityManager();
     if (!manager) // FIXME!
         return nullptr;
-    content::BrowserAccessibility *acc = manager->GetRoot();
+    content::BrowserAccessibility *acc = manager->GetFromAXNode(manager->GetRoot());
 
     return content::toQAccessibleInterface(acc);
 }
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 75ab0c6f9d5..21c3700986e 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -205,11 +205,11 @@ QUrl WebContentsDelegateQt::url(content::WebContents *source) const
     m_pendingUrlUpdate = false;
     return newUrl;
 }
-void WebContentsDelegateQt::AddNewContents(content::WebContents* source, std::unique_ptr<content::WebContents> new_contents, const GURL &target_url,
-                                           WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked)
+void WebContentsDelegateQt::AddNewContents(content::WebContents *source, std::unique_ptr<content::WebContents> new_contents, const GURL &target_url,
+                                           WindowOpenDisposition disposition, const blink::mojom::WindowFeatures &window_features, bool user_gesture, bool *was_blocked)
 {
     Q_UNUSED(source)
-    QSharedPointer<WebContentsAdapter> newAdapter = createWindow(std::move(new_contents), disposition, initial_pos, toQt(target_url), user_gesture);
+    QSharedPointer<WebContentsAdapter> newAdapter = createWindow(std::move(new_contents), disposition, window_features.bounds, toQt(target_url), user_gesture);
     // Chromium can forget to pass user-agent override settings to new windows (see QTBUG-61774 and QTBUG-76249),
     // so set it here. Note the actual value doesn't really matter here. Only the second value does, but we try
     // to give the correct user-agent anyway.
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 0840fbc450c..eda4e1e57d4 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -81,7 +81,7 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
     content::WebContents *OpenURLFromTab(content::WebContents *source, const content::OpenURLParams &params) override;
     void NavigationStateChanged(content::WebContents* source, content::InvalidateTypes changed_flags) override;
     void AddNewContents(content::WebContents *source, std::unique_ptr<content::WebContents> new_contents, const GURL &target_url,
-                        WindowOpenDisposition disposition, const gfx::Rect &initial_pos, bool user_gesture, bool *was_blocked) override;
+                        WindowOpenDisposition disposition, const blink::mojom::WindowFeatures &window_features, bool user_gesture, bool *was_blocked) override;
     void CloseContents(content::WebContents *source) override;
     void LoadProgressChanged(double progress) override;
     bool HandleKeyboardEvent(content::WebContents *source, const content::NativeWebKeyboardEvent &event) override;
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 286fc198c9c..023f9e99f29 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -230,8 +230,9 @@ void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
                                       blink::DragOperationsMask allowed_ops,
                                       const gfx::ImageSkia &image,
                                       const gfx::Vector2d &image_offset,
+                                      const gfx::Rect &drag_obj_rect,
                                       const blink::mojom::DragEventSourceInfo &event_info,
-                                      content::RenderWidgetHostImpl* source_rwh)
+                                      content::RenderWidgetHostImpl *source_rwh)
 {
 #if QT_CONFIG(draganddrop)
     Q_UNUSED(event_info);
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index 2e236f2b250..15528b41d16 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -72,6 +72,7 @@ class WebContentsViewQt
 
     void FocusThroughTabTraversal(bool reverse) override;
     void OnCapturerCountChanged() override { QT_NOT_YET_IMPLEMENTED }
+    void FullscreenStateChanged(bool) override { }
 
 #if BUILDFLAG(IS_MAC)
     bool CloseTabAfterEventTrackingIfNeeded() override { QT_NOT_YET_IMPLEMENTED return false; }
@@ -80,6 +81,7 @@ class WebContentsViewQt
     // content::RenderViewHostDelegateView overrides:
     void StartDragging(const content::DropData& drop_data, blink::DragOperationsMask allowed_ops,
                        const gfx::ImageSkia& image, const gfx::Vector2d& image_offset,
+                       const gfx::Rect& drag_obj_rect,
                        const blink::mojom::DragEventSourceInfo &event_info,
                        content::RenderWidgetHostImpl *source_rwh) override;
 
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 29189bc7255..390ac263856 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -900,7 +900,7 @@ const char *qWebEngineChromiumVersion() noexcept
 }
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "107.0.5304.88"; // FIXME: Remember to update
+    return "108.0.5359.109"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE
diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in
index 5420e8581b6..da41d80ccb5 100644
--- a/src/pdf/configure/BUILD.root.gn.in
+++ b/src/pdf/configure/BUILD.root.gn.in
@@ -59,4 +59,10 @@ static_library("QtPdf") {
   deps = [
     "//third_party/pdfium"
   ]
+  if (is_win) {
+    libs = [
+      "dloadhelper.lib",
+      "winmm.lib",
+    ]
+  }
 }
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp
index a420d041c10..68566c0827c 100644
--- a/tests/auto/widgets/accessibility/tst_accessibility.cpp
+++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp
@@ -475,7 +475,7 @@ void tst_Accessibility::roles_data()
     QTest::newRow("ax::mojom::Role::kNote") << QString("<div role='note'>a</div>") << 0 << QAccessible::Note;
     //QTest::newRow("ax::mojom::Role::kPane"); // No mapping to ARIA role
     QTest::newRow("ax::mojom::Role::kParagraph") << QString("<p>a</p>") << 0 << QAccessible::Paragraph;
-    QTest::newRow("ax::mojom::Role::kPopUpButton") << QString("<select><option>a</option></select>") << 1 << QAccessible::ComboBox;
+    QTest::newRow("ax::mojom::Role::kPopUpButton") << QString("<select><option>a</option></select>") << 1 << QAccessible::PopupMenu;
     QTest::newRow("ax::mojom::Role::kPre") << QString("<pre>a</pre>") << 0 << QAccessible::Section;
     //QTest::newRow("ax::mojom::Role::kPresentational") << QString("<div role='presentation'>a</div>") << 0 << QAccessible::NoRole; // FIXME: Aria role 'presentation' should work
     QTest::newRow("ax::mojom::Role::kProgressIndicator") << QString("<div role='progressbar' aria-valuenow='77' aria-valuemin='22' aria-valuemax='99'></div>") << 0 << QAccessible::ProgressBar;
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index a45799e70a8..15e22613943 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -3231,7 +3231,7 @@ void tst_QWebEngineView::webUIURLs_data()
     QTest::newRow("process-internals") << QUrl("chrome://process-internals") << true;
     QTest::newRow("quota-internals") << QUrl("chrome://quota-internals") << true;
     QTest::newRow("safe-browsing") << QUrl("chrome://safe-browsing") << false;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
     QTest::newRow("sandbox") << QUrl("chrome://sandbox") << true;
 #else
     QTest::newRow("sandbox") << QUrl("chrome://sandbox") << false;
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py
index dc80630c8ad..c8e37a6de82 100644
--- a/tools/scripts/version_resolver.py
+++ b/tools/scripts/version_resolver.py
@@ -12,8 +12,8 @@
 import urllib3
 import git_submodule as GitSubmodule
 
-chromium_version = '106.0.5249.207'
-chromium_branch = '5249'
+chromium_version = '108.0.5359.109'
+chromium_branch = '5359'
 ninja_version = 'v1.8.2'
 
 json_url = 'http://omahaproxy.appspot.com/all.json'

From b8dbc91b61323f7f2d179b0a386b477632a47e37 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 4 Jan 2023 10:36:05 +0100
Subject: [PATCH 021/681] Update Chromium to 108-based

Task-number: QTBUG-105147
Change-Id: I65ba9ab91fb55b51b20583a5dacc8b2d9634c42e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8e0c3ce2f7abcf999d4be9071f3ed2a692db0f71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 481d91afcf3..95eaac0c855 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 481d91afcf30a6491cdf27868025b2d2c242ef69
+Subproject commit 95eaac0c855f6d0ad5335a5c1adb3a14bf898da8

From dea45baae84af47c5e6737c2c7841c840a943fec Mon Sep 17 00:00:00 2001
From: Alexey Edelev <alexey.edelev@qt.io>
Date: Mon, 2 Jan 2023 13:32:20 +0100
Subject: [PATCH 022/681] Remove QT_USE_SYNCQT_CPP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Option has not effect anymore.

Change-Id: Ifa8dfd8ba39b80c79c796729c0cdd193c14c78e6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7dc48d4b7243d91d3ad2218aec334154c660d7b9)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
---
 .cmake.conf | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.cmake.conf b/.cmake.conf
index 01e3a744a8e..84051225e57 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,5 +1,3 @@
 set(QT_REPO_MODULE_VERSION "6.5.0")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")
-# Use cpp-based syncqt
-set(QT_USE_SYNCQT_CPP TRUE)

From dde9f229e3e78b78964130c8c63bd4f7ff670366 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 2 Jan 2023 15:44:41 +0100
Subject: [PATCH 023/681] Fix qdoc link failures
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I6b18382a376bf3067323e801f6f39bf4ec09e9dc
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit df4fee6fd3045884aee483c34c76c6718a10fe56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../clientcertificate/doc/src/clientcertificate.qdoc        | 6 +++---
 src/core/api/qwebenginenewwindowrequest.cpp                 | 2 +-
 src/core/doc/src/qtwebengine-features.qdoc                  | 2 +-
 src/core/doc/src/qtwebenginecore-index.qdoc                 | 3 ++-
 src/webenginequick/doc/src/webenginescript.qdoc             | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index b2b67b2e2cd..108d2db7beb 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -84,7 +84,7 @@
     \skipto QFile
     \printuntil QSslKey
 
-    Now we add the certificate and its private key to \l {QWebEngigneCretificateStore}.
+    Now we add the certificate and its private key to \l {QWebEngigneClientCertificateStore}.
 
     \printuntil clientCertificateStore
 
@@ -99,7 +99,7 @@
     \printuntil acceptCertificate
 
     The handling for \l QWebEnginePage::selectClientCertificate simply displays \l QDialog
-    with \l QWidgetList showing a list of client certificates to choose from.
+    with \l QListWidget showing a list of client certificates to choose from.
     The user selected certificate is then passed to the
     \l QWebEngineClientCertificateSelection::select call.
 
@@ -115,7 +115,7 @@
     For our embedded device we will develop a minimalistic HTTPS server. We can use \l QSslServer
     to handle incoming connections and to provide an \l QSslSocket instance. To do that,
     we create an instance of a \l QSslServer and, similarly to our client setup, we load a server
-    certificate and its private key. Next, we create \l QSslCertifcate and \l QSslKey objects
+    certificate and its private key. Next, we create \l QSslCertificate and \l QSslKey objects
     accordingly. Additionally, we need a CA certificate so the server can validate the certificate
     presented by the client. The CA and local certificate are set to \l QSslConfiguration and
     used later by the server.
diff --git a/src/core/api/qwebenginenewwindowrequest.cpp b/src/core/api/qwebenginenewwindowrequest.cpp
index 9517531362d..895033fd126 100644
--- a/src/core/api/qwebenginenewwindowrequest.cpp
+++ b/src/core/api/qwebenginenewwindowrequest.cpp
@@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE
 /*!
     \qmltype WebEngineNewWindowRequest
     \instantiates QWebEngineNewWindowRequest
-    \inqmlmodule QtWebEngineQuick
+    \inqmlmodule QtWebEngine
     \since QtWebEngine 1.12
 
     \brief A utility type for the WebEngineView::newWindowRequested signal.
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 6588a9d5faf..a564641a5a6 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -166,7 +166,7 @@
     \section1 Favicon
 
     \QWE supports the web site URL icon, \e favicon. Each icon is stored in the internal
-    database for each \l QWebEngieProfile and can be accessed using a \l QWebEnginePage::icon()
+    database for each \l QWebEngineProfile and can be accessed using a \l QWebEnginePage::icon()
     call or a \l {WebEngineView::icon}{WebEngineView.icon} property for the currently loaded content.
 
     Moreover \QWE provides API for accessing already stored icons in the internal profile's database.
diff --git a/src/core/doc/src/qtwebenginecore-index.qdoc b/src/core/doc/src/qtwebenginecore-index.qdoc
index cd6f2efe487..e6fc0b30766 100644
--- a/src/core/doc/src/qtwebenginecore-index.qdoc
+++ b/src/core/doc/src/qtwebenginecore-index.qdoc
@@ -7,7 +7,8 @@
 
     \brief Provides common API shared by \QWE Quick and \QWE Widgets.
 
-    \QWE Core provides API shared by \l {Qt WebEngine Quick} and \l {Qt WebEngine Widgets}.
+    \QWE Core provides API shared by \l {Qt WebEngine QML Types}{Qt WebEngine Quick} and
+    \l {Qt WebEngine Widgets C++ Classes}{Qt WebEngine Widgets}.
 
     \section1 Getting Started
 
diff --git a/src/webenginequick/doc/src/webenginescript.qdoc b/src/webenginequick/doc/src/webenginescript.qdoc
index 5919b29e305..9708ffbf814 100644
--- a/src/webenginequick/doc/src/webenginescript.qdoc
+++ b/src/webenginequick/doc/src/webenginescript.qdoc
@@ -32,7 +32,7 @@
     \l{WebEngineScriptCollection::find}{WebEngineScriptCollection.find} method.
 */
 
-*!
+/*!
     \qmlproperty url WebEngineScript::sourceUrl
 
     This property holds the remote source location of the user script (if any).

From 94e94dbbcc4921e738065c9755137252bc6f820d Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Wed, 4 Jan 2023 13:49:35 +0100
Subject: [PATCH 024/681] Fix translation of QPdfLink::toString()

Use the same message text as in QML and allow for changing languages
by removing the static string constant. Use 1 fractional digit for the
point.

Change-Id: Iac3b5374e32a9a97af157c6ba6833ad845b02750
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit acae09d86295ed711ce6c8eca28a399f71af8869)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdflink.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/pdf/qpdflink.cpp b/src/pdf/qpdflink.cpp
index d1f5bdfdc98..0c28670864c 100644
--- a/src/pdf/qpdflink.cpp
+++ b/src/pdf/qpdflink.cpp
@@ -152,12 +152,11 @@ QList<QRectF> QPdfLink::rectangles() const
 */
 QString QPdfLink::toString() const
 {
-    static const QString format = QPdfLinkModel::tr("page %1 location %2,%3 zoom %4");
-    return d->page > 0 ? format.arg(QString::number(d->page),
-                                    QString::number(d->location.x()),
-                                    QString::number(d->location.y()),
-                                    QString::number(d->zoom))
-                       : d->url.toString();
+    if (d->page <= 0)
+         return d->url.toString();
+    return QPdfLinkModel::tr("Page %1 location %2, %3 zoom %4")
+        .arg(d->page).arg(d->location.x(), 0, 'f', 1).arg(d->location.y(), 0, 'f', 1)
+        .arg(d->zoom, 0, 'f', 0);
 }
 
 /*!

From eea0161dbba22ba290d37f98db28a45d1114bf7c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 9 Jan 2023 20:25:58 +0000
Subject: [PATCH 025/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I3906e493e4cf5979fdddee47777609702124707a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0e16cb1c410..0852427be9a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f9372678279fb7579013c3e5230205fc4ec784da
+    ref: e55ea3e99a1b34e165bddbd7ce2259104e9ee8b4
     required: true
   ../qtpositioning:
-    ref: 1cf68985ac70f250316d025d46db7c78edbe1069
+    ref: 093fa799d81d417363fd70a94a5ab7054dee0833
     required: false
   ../qttools:
-    ref: bc8cd52f4558e44acbb45b422069c912dedca741
+    ref: a951ca2b128023b7d842055965fcc1be572f96ee
     required: false
   ../qtwebchannel:
-    ref: 991c6d28e41d293930387ef4fea51cb6cebcbbaa
+    ref: 245e15e8f196f2e6b19600e518d0dfc4edce2435
     required: false

From eaeb152b22e9c3dafbb0b3e651c8d5aeda5268a1 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Fri, 23 Dec 2022 13:18:28 +0100
Subject: [PATCH 026/681] Fix crash when /usr/share/X11/xkb is empty

Fallback to Stub implementation instead of crashing.

Task-number: QTBUG-105124
Change-Id: I7ad41daefe279b33bf924c74ee90e7d6a2375a63
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1da0407a3440b89a8a4500e3a5c568c949d563b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/ozone/ozone_platform_qt.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp
index c4929295e59..5b7e9b4d780 100644
--- a/src/core/ozone/ozone_platform_qt.cpp
+++ b/src/core/ozone/ozone_platform_qt.cpp
@@ -25,11 +25,13 @@
 #include "platform_window_qt.h"
 
 #if BUILDFLAG(USE_XKBCOMMON)
+#include "base/logging.h"
 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h"
 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
 
 #include <X11/XKBlib.h>
 #include <X11/extensions/XKBrules.h>
+#include <filesystem>
 
 extern void *GetQtXDisplay();
 #endif // BUILDFLAG(USE_XKBCOMMON)
@@ -181,8 +183,10 @@ static std::string getCurrentKeyboardLayout()
 bool OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &)
 {
 #if BUILDFLAG(USE_XKBCOMMON)
+    std::string xkb_path("/usr/share/X11/xkb");
     std::string layout = getCurrentKeyboardLayout();
-    if (layout.empty()) {
+    if (layout.empty() || !std::filesystem::exists(xkb_path) || std::filesystem::is_empty(xkb_path)) {
+        LOG(WARNING) << "Failed to load keymap file, falling back to StubKeyboardLayoutEngine";
         m_keyboardLayoutEngine = std::make_unique<StubKeyboardLayoutEngine>();
     } else {
         m_keyboardLayoutEngine = std::make_unique<XkbKeyboardLayoutEngine>(m_xkbEvdevCodeConverter);

From 5048c95893aee4977e2d7247af9291e23605ce09 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 6 Jan 2023 14:15:30 +0100
Subject: [PATCH 027/681] Remove unused properties from
 QQuickWebEngineViewPrivate

Change-Id: I368d53e250cd06908db2c2dfb12d6227f835f136
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 31347bd61ee67c1f680dbd1d5bcdf74861b7fae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage_p.h                  | 1 -
 src/webenginequick/api/qquickwebengineview.cpp   | 1 -
 src/webenginequick/api/qquickwebengineview_p_p.h | 2 --
 3 files changed, 4 deletions(-)

diff --git a/src/core/api/qwebenginepage_p.h b/src/core/api/qwebenginepage_p.h
index 800a8ab048e..bb33c7e984e 100644
--- a/src/core/api/qwebenginepage_p.h
+++ b/src/core/api/qwebenginepage_p.h
@@ -200,7 +200,6 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEnginePagePrivate : public QtWebEngineC
     QWebChannel *webChannel;
     unsigned int webChannelWorldId;
     QUrl iconUrl;
-    bool m_navigationActionTriggered;
     QPointer<QWebEnginePage> inspectedPage;
     QPointer<QWebEnginePage> devToolsPage;
     bool defaultAudioMuted;
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index 7a264104c26..94ddd45798e 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -173,7 +173,6 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
     , m_fullscreenMode(false)
     , isLoading(false)
     , m_activeFocusOnPress(true)
-    , devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio())
     , m_webChannel(nullptr)
     , m_webChannelWorld(0)
     , m_defaultAudioMuted(false)
diff --git a/src/webenginequick/api/qquickwebengineview_p_p.h b/src/webenginequick/api/qquickwebengineview_p_p.h
index 4be84844167..b696e021836 100644
--- a/src/webenginequick/api/qquickwebengineview_p_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p_p.h
@@ -157,8 +157,6 @@ class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public QtWebE
     bool m_fullscreenMode;
     bool isLoading;
     bool m_activeFocusOnPress;
-    bool m_navigationActionTriggered;
-    qreal devicePixelRatio;
     QMap<quint64, QJSValue> m_callbacks;
     QQmlWebChannel *m_webChannel;
     QPointer<QQuickWebEngineView> inspectedView;

From 25127f813398925abe030ac36a008bf37653a70d Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 9 Jan 2023 11:31:28 +0100
Subject: [PATCH 028/681] Fix build with -no-accessibility

Change-Id: I7128608467e4d0ce1b04efa9b82a98f78942d4db
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a4342183199ba9fbd6c86939cf9748e069a09f9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/CMakeLists.txt                      |  6 +++++-
 src/webenginequick/api/qquickwebengineview.cpp         |  7 ++++++-
 src/webenginequick/api/qquickwebengineview_p_p.h       |  1 -
 src/webenginequick/qquickwebengine_accessible.cpp      |  3 ---
 src/webenginequick/qquickwebengine_accessible.h        |  4 ----
 src/webenginewidgets/CMakeLists.txt                    |  6 +++++-
 src/webenginewidgets/api/qwebengineview.cpp            |  5 ++++-
 src/webenginewidgets/qwebengine_accessible.cpp         |  4 ----
 src/webenginewidgets/qwebengine_accessible.h           |  3 ---
 .../qquickwebengineview/tst_qquickwebengineview.cpp    | 10 +++++++++-
 10 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/webenginequick/CMakeLists.txt b/src/webenginequick/CMakeLists.txt
index fd40081e95f..0081edb7f4f 100644
--- a/src/webenginequick/CMakeLists.txt
+++ b/src/webenginequick/CMakeLists.txt
@@ -37,7 +37,6 @@ qt_internal_add_qml_module(WebEngineQuick
         api/qquickwebengineforeigntypes_p.h
         api/qtwebenginequickglobal.cpp api/qtwebenginequickglobal.h
         api/qtwebenginequickglobal_p.h
-        qquickwebengine_accessible.cpp qquickwebengine_accessible.h
         render_widget_host_view_qt_delegate_quickwindow.cpp render_widget_host_view_qt_delegate_quickwindow.h
         ui_delegates_manager.cpp ui_delegates_manager.h
     DEFINES
@@ -58,6 +57,11 @@ qt_internal_add_qml_module(WebEngineQuick
         Qt::WebEngineCore
 )
 
+qt_internal_extend_target(WebEngineQuick CONDITION QT_FEATURE_accessibility
+    SOURCES
+        qquickwebengine_accessible.cpp qquickwebengine_accessible.h
+)
+
 qt_internal_extend_target(qtwebenginequickplugin
     SOURCES
         plugin.cpp
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index 94ddd45798e..9eb8a1e2a83 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -24,7 +24,6 @@
 #include "file_picker_controller.h"
 #include "find_text_helper.h"
 #include "javascript_dialog_controller.h"
-#include "qquickwebengine_accessible.h"
 #include "render_widget_host_view_qt_delegate_item.h"
 #include "render_widget_host_view_qt_delegate_quickwindow.h"
 #include "touch_selection_menu_controller.h"
@@ -58,6 +57,12 @@
 #include <QtQml/qqmlengine.h>
 #include <QtQml/qqmlproperty.h>
 
+#if QT_CONFIG(accessibility)
+#include "qquickwebengine_accessible.h"
+
+#include <QtGui/qaccessible.h>
+#endif
+
 #if QT_CONFIG(webengine_printing_and_pdf)
 #include <QtCore/qmargins.h>
 #include <QtGui/qpagelayout.h>
diff --git a/src/webenginequick/api/qquickwebengineview_p_p.h b/src/webenginequick/api/qquickwebengineview_p_p.h
index b696e021836..aa67fd291c4 100644
--- a/src/webenginequick/api/qquickwebengineview_p_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p_p.h
@@ -27,7 +27,6 @@
 #include <QtCore/qscopedpointer.h>
 #include <QtCore/qsharedpointer.h>
 #include <QtCore/qstring.h>
-#include <QtGui/qaccessibleobject.h>
 
 namespace QtWebEngineCore {
 class RenderWidgetHostViewQtDelegateItem;
diff --git a/src/webenginequick/qquickwebengine_accessible.cpp b/src/webenginequick/qquickwebengine_accessible.cpp
index 80e2adbbdc1..2941f01b599 100644
--- a/src/webenginequick/qquickwebengine_accessible.cpp
+++ b/src/webenginequick/qquickwebengine_accessible.cpp
@@ -10,8 +10,6 @@
 #include "api/qquickwebengineview_p_p.h"
 #include "web_contents_adapter.h"
 
-
-#if QT_CONFIG(accessibility)
 QT_BEGIN_NAMESPACE
 QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o)
     : QAccessibleObject(o)
@@ -147,4 +145,3 @@ QQuickWebEngineViewAccessible *RenderWidgetHostViewQtDelegateQuickAccessible::vi
     return static_cast<QQuickWebEngineViewAccessible *>(QAccessible::queryAccessibleInterface(m_view));
 }
 } // namespace QtWebEngineCore
-#endif // QT_CONFIG(accessibility)
diff --git a/src/webenginequick/qquickwebengine_accessible.h b/src/webenginequick/qquickwebengine_accessible.h
index b1a4a34f507..479de978919 100644
--- a/src/webenginequick/qquickwebengine_accessible.h
+++ b/src/webenginequick/qquickwebengine_accessible.h
@@ -7,8 +7,6 @@
 #include <QtCore/qpointer.h>
 #include <QtGui/qaccessibleobject.h>
 
-#if QT_CONFIG(accessibility)
-
 QT_BEGIN_NAMESPACE
 class QQuickWebEngineView;
 
@@ -55,6 +53,4 @@ class RenderWidgetHostViewQtDelegateQuickAccessible : public QAccessibleObject
 };
 } // namespace QtWebEngineCore
 
-#endif // QT_CONFIG(accessibility)
-
 #endif // QQUICKWEBENGINE_ACCESSIBLE_H
diff --git a/src/webenginewidgets/CMakeLists.txt b/src/webenginewidgets/CMakeLists.txt
index f859a774a4d..f9365adc93e 100644
--- a/src/webenginewidgets/CMakeLists.txt
+++ b/src/webenginewidgets/CMakeLists.txt
@@ -11,7 +11,6 @@ qt_internal_add_module(WebEngineWidgets
         api/qtwebenginewidgetsglobal.h
         api/qwebenginenotificationpresenter.cpp api/qwebenginenotificationpresenter_p.h
         api/qwebengineview.cpp api/qwebengineview.h api/qwebengineview_p.h
-        qwebengine_accessible.cpp qwebengine_accessible.h
         ui/autofillpopupwidget.cpp ui/autofillpopupwidget_p.h
         ui/touchhandlewidget.cpp ui/touchhandlewidget_p.h
         ui/touchselectionmenuwidget.cpp ui/touchselectionmenuwidget_p.h
@@ -35,6 +34,11 @@ qt_internal_add_module(WebEngineWidgets
         Qt::WebEngineCore
 )
 
+qt_internal_extend_target(WebEngineWidgets CONDITION QT_FEATURE_accessibility
+    SOURCES
+        qwebengine_accessible.cpp qwebengine_accessible.h
+)
+
 qt_internal_extend_target(WebEngineWidgets CONDITION QT_FEATURE_webengine_printing_and_pdf
     PUBLIC_LIBRARIES
         Qt::PrintSupport
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index bf975c96f7f..fd74268f2c4 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -6,7 +6,6 @@
 #include "qwebengineview_p.h"
 #include "render_widget_host_view_qt_delegate_client.h"
 #include "render_widget_host_view_qt_delegate_item.h"
-#include "qwebengine_accessible.h"
 #include "ui/autofillpopupwidget_p.h"
 #include "touchhandlewidget_p.h"
 #include "touchselectionmenuwidget_p.h"
@@ -31,6 +30,10 @@
 #include <QGuiApplication>
 #include <QQuickWidget>
 
+#if QT_CONFIG(accessibility)
+#include "qwebengine_accessible.h"
+#endif
+
 #if QT_CONFIG(action)
 #include <QAction>
 #endif
diff --git a/src/webenginewidgets/qwebengine_accessible.cpp b/src/webenginewidgets/qwebengine_accessible.cpp
index 53a8126047b..6880a5a3ab6 100644
--- a/src/webenginewidgets/qwebengine_accessible.cpp
+++ b/src/webenginewidgets/qwebengine_accessible.cpp
@@ -8,8 +8,6 @@
 
 #include "web_contents_adapter.h"
 
-#if QT_CONFIG(accessibility)
-
 QT_BEGIN_NAMESPACE
 
 QWebEngineViewAccessible::QWebEngineViewAccessible(QWebEngineView *o) : QAccessibleWidget(o)
@@ -102,5 +100,3 @@ QWebEngineViewAccessible *RenderWidgetHostViewQtDelegateWidgetAccessible::viewAc
 }
 
 } // namespace QtWebEngineCore
-
-#endif // QT_CONFIG(accessibility)
diff --git a/src/webenginewidgets/qwebengine_accessible.h b/src/webenginewidgets/qwebengine_accessible.h
index c4871784c51..f47996cf785 100644
--- a/src/webenginewidgets/qwebengine_accessible.h
+++ b/src/webenginewidgets/qwebengine_accessible.h
@@ -7,8 +7,6 @@
 #include <QtCore/QPointer>
 #include <QtWidgets/QAccessibleWidget>
 
-#if QT_CONFIG(accessibility)
-
 QT_BEGIN_NAMESPACE
 class QWebEngineView;
 
@@ -47,6 +45,5 @@ class RenderWidgetHostViewQtDelegateWidgetAccessible : public QAccessibleWidget
     QPointer<QWebEngineView> m_view;
 };
 } // namespace QtWebEngineCore
-#endif // QT_CONFIG(accessibility)
 
 #endif // QWEBENGINE_ACCESSIBLE_H
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index 6e369b4c605..5ae032061f9 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -69,8 +69,10 @@ private Q_SLOTS:
     void javascriptClipboard_data();
     void javascriptClipboard();
     void setProfile();
-    void focusChild();
+#if QT_CONFIG(accessibility)
     void focusChild_data();
+    void focusChild();
+#endif
     void htmlSelectPopup();
 
 private:
@@ -1180,6 +1182,7 @@ void tst_QQuickWebEngineView::setProfile() {
     QTRY_COMPARE(webEngineView()->url() ,urlFromTestPath("html/basic_page2.html"));
 }
 
+#if QT_CONFIG(accessibility)
 void tst_QQuickWebEngineView::focusChild_data()
 {
     QTest::addColumn<QString>("interfaceName");
@@ -1242,6 +1245,7 @@ void tst_QQuickWebEngineView::focusChild()
     // <html> -> <body> -> <input>
     QCOMPARE(traverseToWebDocumentAccessibleInterface(iface)->child(0)->child(0), iface->focusChild());
 }
+#endif // QT_CONFIG(accessibility)
 
 void tst_QQuickWebEngineView::htmlSelectPopup()
 {
@@ -1270,8 +1274,12 @@ void tst_QQuickWebEngineView::htmlSelectPopup()
     QCOMPARE(evaluateJavaScriptSync(&view, "document.getElementById('select').value").toString(), QStringLiteral("O2"));
 }
 
+#if QT_CONFIG(accessibility)
 static QByteArrayList params = QByteArrayList()
     << "--force-renderer-accessibility";
+#else
+static QByteArrayList params;
+#endif
 
 W_QTEST_MAIN(tst_QQuickWebEngineView, params)
 #include "tst_qquickwebengineview.moc"

From 5220252dbecb70091766c86ccebe5127c6b8cbd2 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 10 Jan 2023 09:44:27 +0100
Subject: [PATCH 029/681] Avoid scaling mouse movement properties on High DPI
 screens

ui::TranslateAndScaleWebInputEvent() scales movementX/Y if the input
event is not raw.

It is not exactly clear what is the expected behavior and browsers
handle movementX/Y scaling differently. W3C states that
currentEvent.movementX = currentEvent.screenX - previousEvent.screenX
which is not true with scaling.

This is a workaround for https://crbug.com/907309

This fixes tst_QWebEnginePage::mouseMovementProperties auto test with
QT_SCALE_FACTOR=2.

Change-Id: I6d1fd591ec2bbeb22c448772c367b59509244491
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c69b00df8513237dc5a14f399eeb9b6d624d84f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt_delegate_client.cpp | 1 +
 src/core/web_event_factory.cpp                          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index 7078b82f8fb..1b30e995332 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -410,6 +410,7 @@ void RenderWidgetHostViewQtDelegateClient::handlePointerEvent(T *event)
 
     webEvent.movement_x = event->globalPosition().x() - m_previousMousePosition.x();
     webEvent.movement_y = event->globalPosition().y() - m_previousMousePosition.y();
+    webEvent.is_raw_movement_event = true;
 
     if (m_rwhv->IsMouseLocked())
         QCursor::setPos(m_previousMousePosition);
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 007492843c5..508a4b55743 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1444,6 +1444,7 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QHoverEvent *ev)
     webKitEvent.SetPositionInWidget(ev->position().x(), ev->position().y());
     webKitEvent.movement_x = ev->position().x() - ev->oldPos().x();
     webKitEvent.movement_y = ev->position().y() - ev->oldPos().y();
+    webKitEvent.is_raw_movement_event = true;
     webKitEvent.pointer_type = WebPointerProperties::PointerType::kMouse;
 
     return webKitEvent;

From ee50138bb0d66fec746ac81b1690c803c39899fa Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 13 Jan 2023 08:35:53 +0000
Subject: [PATCH 030/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I21fc68bbfaf638511de67c8f204dbeb2628884d2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0852427be9a..1dccabcdddf 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: e55ea3e99a1b34e165bddbd7ce2259104e9ee8b4
+    ref: d67dcb072ed38f3ca64bc4bcf1be6973466d7d93
     required: true
   ../qtpositioning:
-    ref: 093fa799d81d417363fd70a94a5ab7054dee0833
+    ref: 4649a16dc0fa59e69e252b188bffb25d35408ed3
     required: false
   ../qttools:
-    ref: a951ca2b128023b7d842055965fcc1be572f96ee
+    ref: 90d111d50c6aaa225f0c7be0a6bd5b360058fa38
     required: false
   ../qtwebchannel:
-    ref: 245e15e8f196f2e6b19600e518d0dfc4edce2435
+    ref: d35beff93d14ce5dfe0b7fcc57c96cd1cafa9562
     required: false

From 90fdb426eb19d7701de2f26bcebc43d6fdc88e16 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 12 Jan 2023 10:48:55 +0100
Subject: [PATCH 031/681] Update Chromium

Submodule src/3rdparty 95eaac0c8..d7abc8b24:
  > [Backport] Fix up guarding SharedImage factories using Vulkan
  > [Backport] Remove VkDevice parameter from SurfaceFactoryOzone::CreateNativePixmap()
  > [Backport] viz: Do IWYU in skia_output_surface_impl_on_gpu.cc and .h
  > FIXUP: Fixes for building with MSVC
  > FIXUP: Fix gn build windows issue
  > Update project's url for lighthouse
  > Fix initalization for FCM
  > Remove custom push servcie endpoint support

Change-Id: I1febdb78004cfca7076b0fd348a8aae2f5c563da
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b8913e003d7a20c5dfb664fac70d472440db7c37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 95eaac0c855..d7abc8b2437 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 95eaac0c855f6d0ad5335a5c1adb3a14bf898da8
+Subproject commit d7abc8b24375a9093d2daae39b292be7c7ce84b7

From 326271bb2196e95d18b00997b3c981d9fbdcc0b2 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 11 Jan 2023 17:01:56 +0100
Subject: [PATCH 032/681] Fix CMakeLists.txt dependency of moc files generated
 from headers

Change-Id: I582706448b7c238a7ff7002df8256e9ee47fa582
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 03e23a17da26ba59b2a6700ed3cededfd70d6e13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/configure/BUILD.root.gn.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 71e188a7627..d38e8497381 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -33,7 +33,7 @@ if (moc_source_h_files != []) {
     script = "@WEBENGINE_ROOT_SOURCE_DIR@/tools/scripts/gn_run_binary.py"
     sources =  moc_source_h_files
     outputs = [ "${target_gen_dir}/.moc/moc_{{source_name_part}}.cpp" ]
-    inputs = [ "@WEBENGINE_ROOT_SOURCE_DIR@/CMakeLists.txt" ]
+    inputs = [ "@WEBENGINE_ROOT_SOURCE_DIR@/src/core/CMakeLists.txt" ]
     args = [
       @GN_ARGS_MOC_BIN@,
       @GN_ARGS_DEFINES@,

From aaebb576000817a2d62b8e4c777f425c79aaf447 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 6 Jan 2023 09:40:24 +0100
Subject: [PATCH 033/681] Fix contentsSize and scrollPosition on High DPI
 screens

Provide the same values what are available from JavaScript.

Change-Id: I9e047d749279934d0c8ccd45710571e8c7745859
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit dcbcb44f0b5fb5c901594d9b0e6c4c5476709a10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt.cpp               | 11 ++++++++---
 tests/auto/quick/qmltests/data/tst_scrollPosition.qml |  7 +++----
 .../widgets/qwebenginepage/tst_qwebenginepage.cpp     |  7 ++++---
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 5d8f1532102..177e3c56e58 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1008,12 +1008,17 @@ void RenderWidgetHostViewQt::OnRenderFrameMetadataChangedAfterActivation(base::T
         m_touchSelectionControllerClient->UpdateClientSelectionBounds(m_selectionStart, m_selectionEnd);
     }
 
-    gfx::PointF scrollOffset = metadata.root_scroll_offset.value_or(gfx::PointF());
-    gfx::SizeF contentsSize = metadata.root_layer_size;
+    gfx::PointF scrollOffset = gfx::PointF();
+    if (metadata.root_scroll_offset.has_value())
+        scrollOffset = gfx::ScalePoint(metadata.root_scroll_offset.value(),
+                                       1 / metadata.device_scale_factor);
     std::swap(m_lastScrollOffset, scrollOffset);
-    std::swap(m_lastContentsSize, contentsSize);
     if (m_adapterClient && scrollOffset != m_lastScrollOffset)
         m_adapterClient->updateScrollPosition(toQt(m_lastScrollOffset));
+
+    gfx::SizeF contentsSize =
+            gfx::ScaleSize(metadata.root_layer_size, 1 / metadata.device_scale_factor);
+    std::swap(m_lastContentsSize, contentsSize);
     if (m_adapterClient && contentsSize != m_lastContentsSize)
         m_adapterClient->updateContentsSize(toQt(m_lastContentsSize));
 }
diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
index e9c72ab7dfb..cc7d15e4c77 100644
--- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
+++ b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
@@ -2,7 +2,6 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
 
 import QtQuick
-import QtQuick.Window
 import QtTest
 import QtWebEngine
 
@@ -36,7 +35,7 @@ TestWebEngineView {
 
             tryCompare(scrollPositionSpy, "count", 1);
             compare(webEngineView.scrollPosition.x, 0);
-            compare(webEngineView.scrollPosition.y, 600 * Screen.devicePixelRatio);
+            compare(webEngineView.scrollPosition.y, 600);
         }
 
         function test_scrollPositionAfterReload() {
@@ -49,13 +48,13 @@ TestWebEngineView {
             // Wait for proper scroll position change otherwise we cannot expect
             // the new y position after reload.
             tryCompare(webEngineView.scrollPosition, "x", 0);
-            tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio);
+            tryCompare(webEngineView.scrollPosition, "y", 600);
 
             webEngineView.reload();
             verify(webEngineView.waitForLoadSucceeded());
 
             tryCompare(webEngineView.scrollPosition, "x", 0);
-            tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio);
+            tryCompare(webEngineView.scrollPosition, "y", 600);
         }
     }
 }
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index d0496160816..39629bcb856 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -2482,7 +2482,8 @@ void tst_QWebEnginePage::baseUrl()
 void tst_QWebEnginePage::scrollPosition()
 {
     // enlarged image in a small viewport, to provoke the scrollbars to appear
-    QString html("<html><body><img src='qrc:/image.png' height=500 width=500/></body></html>");
+    QString html(
+            "<html><body><img src='qrc:/resources/image.png' height=500 width=500/></body></html>");
 
     QWebEngineView view;
     view.setFixedSize(200,200);
@@ -2496,8 +2497,8 @@ void tst_QWebEnginePage::scrollPosition()
 
     // try to set the scroll offset programmatically
     view.page()->runJavaScript("window.scrollTo(23, 29);");
-    QTRY_COMPARE(view.page()->scrollPosition().x(), 23 * view.windowHandle()->devicePixelRatio());
-    QCOMPARE(view.page()->scrollPosition().y(), 29 * view.windowHandle()->devicePixelRatio());
+    QTRY_COMPARE(view.page()->scrollPosition().x(), 23);
+    QCOMPARE(view.page()->scrollPosition().y(), 29);
 
     int x = evaluateJavaScriptSync(view.page(), "window.scrollX").toInt();
     int y = evaluateJavaScriptSync(view.page(), "window.scrollY").toInt();

From e1983fe0b9abf9bbf6afc9c042acb68456b9cf70 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 11 Jan 2023 15:55:11 +0100
Subject: [PATCH 034/681] Do not ignore the first file by gn_find_mocables.py

Amends 10d849f82e0408350d9235cafdf04cc654ac0046

The first argument was the directory in the old times.

Change-Id: I98c5f8c762c3f41124628e64a720a52203eeac40
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9ef040a6bef904cbbf9e39135135333cbbae80b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tools/scripts/gn_find_mocables.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/scripts/gn_find_mocables.py b/tools/scripts/gn_find_mocables.py
index 71ff831044e..68f648889c2 100644
--- a/tools/scripts/gn_find_mocables.py
+++ b/tools/scripts/gn_find_mocables.py
@@ -7,7 +7,7 @@
 
 mocables = set()
 includedMocs = set()
-files = sys.argv[2:]
+files = sys.argv[1:]
 
 for f in filter(os.path.isfile, files):
     inBlockComment = False

From d82928d79d85f14fcc89b567742ca0b86febd53c Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 13 Jan 2023 12:20:02 +0100
Subject: [PATCH 035/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty d7abc8b24..1ccfe20ad:
  > FIXUP: Jumbo builds
  > Merge remote-tracking branch 'origin/upstream-master' into 108-based

Change-Id: Ib11a7e5422415229c5ed109d63375c4953df97d2
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 59ef2aea9a35500a953aa43c2a4f4fb7acb2fc6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 4 ++--
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 39bfa022150..24999f47283 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
-Based on Chromium version:                                      108.0.5359.109
-Patched with security patches up to Chromium version:           108.0.5359.109
+Based on Chromium version:                                      108.0.5359.181
+Patched with security patches up to Chromium version:           108.0.5359.181
diff --git a/src/3rdparty b/src/3rdparty
index d7abc8b2437..1ccfe20ad92 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit d7abc8b24375a9093d2daae39b292be7c7ce84b7
+Subproject commit 1ccfe20ad92be86adf8e6bbb8b71b64dc1f9531a
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 390ac263856..71855c8c2b2 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -900,7 +900,7 @@ const char *qWebEngineChromiumVersion() noexcept
 }
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "108.0.5359.109"; // FIXME: Remember to update
+    return "108.0.5359.181"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 0b27106fd2a61a01647a0559dd3a6fa51245f4a7 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Mon, 19 Dec 2022 16:59:44 +0100
Subject: [PATCH 036/681] Fix crash in Quick when File System Access dialog
 accepted

The fileDialogListener was manually released (to avoid its fullscreen
blocking habit), but it doesn't exist if the file picker controller
was originated from the File System Access JS API. Move this operation
inside the proper condition to avoid crash.

Change-Id: Ife5a8451410f91350d280b41203523991f69774f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5734c78ba87b8a6e1070e6a65777b5def0da581d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/file_picker_controller.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index e69db7553c0..6ec7258b9d3 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -201,6 +201,10 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
             d_ptr->fileDialogListener->FileSelected(
                     std::move(chooser_files), baseDir,
                     static_cast<blink::mojom::FileChooserParams::Mode>(d_ptr->mode));
+
+        // release the fileSelectListener manually because it blocks fullscreen requests in chromium
+        // see QTBUG-106975
+        d_ptr->fileDialogListener.reset();
     } else if (d_ptr->fileSystemAccessDialogListener) {
         std::vector<base::FilePath> files;
         for (const auto &file : std::as_const(filesList)) {
@@ -212,10 +216,6 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
         else
             d_ptr->fileSystemAccessDialogListener->MultiFilesSelected(files, nullptr);
     }
-
-    // release the fileSelectListener manually because it blocks fullscreen requests in chromium
-    // see QTBUG-106975
-    d_ptr->fileDialogListener.reset();
 }
 
 QStringList FilePickerController::acceptedMimeTypes() const

From 2a7adf3dfdf90e9154a3ca5d4ad4d2592ebd8f60 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 20 Dec 2022 16:12:22 +0100
Subject: [PATCH 037/681] Quick: Fix file selection modes in the default UI
 delegate

Our implementation of QML file picker was outdated. Now directory picker
is a separate type of dialog and other file selection modes are set in
FileDialog.fileMode property.

Change-Id: Icc62369539c56666e596e5ee6f1b3068a43acd81
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 35d4b0b1d1c723e32d589b3dfddfe96eaa8e5568)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/ui/CMakeLists.txt          |  1 +
 src/webenginequick/ui/DirectoryPicker.qml     | 15 +++++++
 src/webenginequick/ui_delegates_manager.cpp   | 43 +++++++++++++++++--
 src/webenginequick/ui_delegates_manager.h     |  2 +
 .../quick/qmltests/data/tst_filePicker.qml    |  2 +-
 .../ControlsDelegates/DirectoryPicker.qml     | 18 ++++++++
 .../TestParams/FilePickerParams.qml           |  1 +
 7 files changed, 77 insertions(+), 5 deletions(-)
 create mode 100644 src/webenginequick/ui/DirectoryPicker.qml
 create mode 100644 tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml

diff --git a/src/webenginequick/ui/CMakeLists.txt b/src/webenginequick/ui/CMakeLists.txt
index dc9d14823c5..96dedf016eb 100644
--- a/src/webenginequick/ui/CMakeLists.txt
+++ b/src/webenginequick/ui/CMakeLists.txt
@@ -7,6 +7,7 @@ set(qml_files
     "AutofillPopup.qml"
     "ColorDialog.qml"
     "ConfirmDialog.qml"
+    "DirectoryPicker.qml"
     "FilePicker.qml"
     "Menu.qml"
     "MenuItem.qml"
diff --git a/src/webenginequick/ui/DirectoryPicker.qml b/src/webenginequick/ui/DirectoryPicker.qml
new file mode 100644
index 00000000000..a8a6d47c93d
--- /dev/null
+++ b/src/webenginequick/ui/DirectoryPicker.qml
@@ -0,0 +1,15 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick.Dialogs
+
+FolderDialog {
+    id: folderDialog
+    objectName: "folderDialog"
+
+    signal folderSelected(var folder)
+
+    onAccepted: {
+        folderSelected([selectedFolder])
+    }
+}
diff --git a/src/webenginequick/ui_delegates_manager.cpp b/src/webenginequick/ui_delegates_manager.cpp
index b63a822ca88..b4036c5ee51 100644
--- a/src/webenginequick/ui_delegates_manager.cpp
+++ b/src/webenginequick/ui_delegates_manager.cpp
@@ -350,6 +350,10 @@ void UIDelegatesManager::showDialog(QSharedPointer<AuthenticationDialogControlle
 
 void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> controller)
 {
+    if (controller->mode() == FilePickerController::UploadFolder) {
+        showDirectoryPicker(controller);
+        return;
+    }
 
     if (!ensureComponentLoaded(FilePicker))
         return;
@@ -361,19 +365,21 @@ void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> con
     filePicker->setParent(m_view);
     filePickerComponent->completeCreate();
 
+    static int fileModeIndex = filePicker->metaObject()->indexOfEnumerator("FileMode");
+    QMetaEnum fileModeEnum = filePicker->metaObject()->enumerator(fileModeIndex);
+
     // Fine-tune some properties depending on the mode.
     switch (controller->mode()) {
     case FilePickerController::Open:
+        filePicker->setProperty("fileMode", fileModeEnum.keyToValue("OpenFile"));
         break;
     case FilePickerController::Save:
-        filePicker->setProperty("selectExisting", false);
+        filePicker->setProperty("fileMode", fileModeEnum.keyToValue("SaveFile"));
         break;
     case FilePickerController::OpenMultiple:
-        filePicker->setProperty("selectMultiple", true);
+        filePicker->setProperty("fileMode", fileModeEnum.keyToValue("OpenFiles"));
         break;
     case FilePickerController::UploadFolder:
-        filePicker->setProperty("selectFolder", true);
-        break;
     default:
         Q_UNREACHABLE();
     }
@@ -397,6 +403,35 @@ void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> con
     QMetaObject::invokeMethod(filePicker, "open");
 }
 
+void UIDelegatesManager::showDirectoryPicker(QSharedPointer<FilePickerController> controller)
+{
+    if (!ensureComponentLoaded(DirectoryPicker))
+        return;
+
+    QQmlContext *context = qmlContext(m_view);
+    QObject *directoryPicker = directoryPickerComponent->beginCreate(context);
+    if (QQuickItem *item = qobject_cast<QQuickItem*>(directoryPicker))
+        item->setParentItem(m_view);
+    directoryPicker->setParent(m_view);
+    directoryPickerComponent->completeCreate();
+
+    QQmlProperty directoryPickedSignal(directoryPicker, QStringLiteral("onFolderSelected"));
+    CHECK_QML_SIGNAL_PROPERTY(directoryPickedSignal, directoryPickerComponent->url());
+    QQmlProperty rejectSignal(directoryPicker, QStringLiteral("onRejected"));
+    CHECK_QML_SIGNAL_PROPERTY(rejectSignal, directoryPickerComponent->url());
+    static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QVariant)");
+    QObject::connect(directoryPicker, directoryPickedSignal.method(), controller.data(), controller->metaObject()->method(acceptedIndex));
+    static int rejectedIndex = controller->metaObject()->indexOfSlot("rejected()");
+    QObject::connect(directoryPicker, rejectSignal.method(), controller.data(), controller->metaObject()->method(rejectedIndex));
+
+    // delete when done.
+    static int deleteLaterIndex = directoryPicker->metaObject()->indexOfSlot("deleteLater()");
+    QObject::connect(directoryPicker, directoryPickedSignal.method(), directoryPicker, directoryPicker->metaObject()->method(deleteLaterIndex));
+    QObject::connect(directoryPicker, rejectSignal.method(), directoryPicker, directoryPicker->metaObject()->method(deleteLaterIndex));
+
+    QMetaObject::invokeMethod(directoryPicker, "open");
+}
+
 class TemporaryCursorMove
 {
 public:
diff --git a/src/webenginequick/ui_delegates_manager.h b/src/webenginequick/ui_delegates_manager.h
index 70e5ba00d74..24dde656ca3 100644
--- a/src/webenginequick/ui_delegates_manager.h
+++ b/src/webenginequick/ui_delegates_manager.h
@@ -22,6 +22,7 @@
     F(ConfirmDialog, confirmDialog) SEPARATOR \
     F(PromptDialog, promptDialog) SEPARATOR \
     F(FilePicker, filePicker) SEPARATOR \
+    F(DirectoryPicker, directoryPicker) SEPARATOR \
     F(AuthenticationDialog, authenticationDialog) SEPARATOR \
     F(ToolTip, toolTip) SEPARATOR \
     F(TouchHandle, touchHandle) SEPARATOR \
@@ -80,6 +81,7 @@ class UIDelegatesManager
     void showDialog(QSharedPointer<JavaScriptDialogController>);
     void showDialog(QSharedPointer<AuthenticationDialogController>);
     void showFilePicker(QSharedPointer<FilePickerController>);
+    void showDirectoryPicker(QSharedPointer<FilePickerController>);
     virtual void showMenu(QObject *menu);
     void showToolTip(const QString &text);
     QQuickItem *createTouchHandle();
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 2404efd2de1..a557369edb3 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -146,7 +146,7 @@ TestWebEngineView {
             FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data"))
 
             keyClick(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
-            tryCompare(FilePickerParams, "filePickerOpened", true)
+            tryCompare(FilePickerParams, "directoryPickerOpened", true)
             // Check that the title is a file list (eg. "test1.html,test2.html")
             tryVerify(function() { return webEngineView.title.match("^([^,]+,)+[^,]+$"); })
 
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml
new file mode 100644
index 00000000000..71da28843fc
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml
@@ -0,0 +1,18 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import "../../TestParams"
+
+QtObject {
+    signal folderSelected(var folder)
+    signal rejected()
+
+    function open() {
+        FilePickerParams.directoryPickerOpened = true;
+        if (FilePickerParams.selectFiles)
+            folderSelected(FilePickerParams.selectedFilesUrl);
+        else
+            rejected();
+    }
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml b/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
index 4a1ffeb0275..67d67dc4039 100644
--- a/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
@@ -8,5 +8,6 @@ QtObject {
     property var selectedFilesUrl: [];
     property bool selectFiles: false;
     property bool filePickerOpened: false;
+    property bool directoryPickerOpened: false;
     property var nameFilters: [];
 }

From d248cd2d37c413f878c6d5effa70c4b917dfc5de Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 17 Jan 2023 10:08:26 +0100
Subject: [PATCH 038/681] Update Chromium

Pulls in following patches:

* 0b138dc30d0  FIXUP: Avoid using libdrm
* 006ab12dc35  [Backport] CVE-2023-0138: Heap buffer overflow in
  libphonenumber
* c49e5e48ff6  [Backport] CVE-2023-0141: Insufficient policy
  enforcement in CORS (2/2)
* 4f89844cf42  [Backport] CVE-2023-0141: Insufficient policy
  enforcement in CORS (1/2)
* 63077f1575b  [Backport] CVE-2023-0131: Inappropriate
  implementation in iframe Sandbox
* ee6f7906f9b  [Backport] CVE-2023-0132: Inappropriate
  implementation in Permission prompts
* 1f19a05eaa8  [Backport] CVE-2023-0129: Heap buffer overflow
  in Network Service
* d4b983b72ad  FIXUP: Remove VkDevice parameter from
  SurfaceFactoryOzone::CreateNativePixmap()

Fixes: QTBUG-110272
Pick-to: dev
Change-Id: I9fe5bd6c3643342b6f1b0f8a6c5daaec65e76944
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 1ccfe20ad92..0b138dc30d0 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 1ccfe20ad92be86adf8e6bbb8b71b64dc1f9531a
+Subproject commit 0b138dc30d0aec7930c76a2595065629948ad9f7

From d94c700b45b447a91b8967135799dc55307686b5 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 16 Jan 2023 10:59:13 +0100
Subject: [PATCH 039/681] Avoid -1 render-termination codes

Cover all the possible values in the translation.

Change-Id: Id5db3cceddd62f9f7c77ee8a2017e9c920f8b7d5
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 67f414d4b931e995605cace60abc475061edf273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_contents_adapter.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 467266ee6af..b8f9d3205c7 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1779,14 +1779,19 @@ WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) {
         status = WebContentsAdapterClient::NormalTerminationStatus;
         break;
     case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
+    case base::TERMINATION_STATUS_LAUNCH_FAILED:
         status = WebContentsAdapterClient::AbnormalTerminationStatus;
         break;
     case base::TERMINATION_STATUS_PROCESS_WAS_KILLED:
+    case base::TERMINATION_STATUS_OOM:
         status = WebContentsAdapterClient::KilledTerminationStatus;
         break;
     case base::TERMINATION_STATUS_PROCESS_CRASHED:
 #if BUILDFLAG(IS_ANDROID)
     case base::TERMINATION_STATUS_OOM_PROTECTED:
+#endif
+#if BUILDFLAG(IS_WIN)
+    case base::TERMINATION_STATUS_INTEGRITY_FAILURE:
 #endif
         status = WebContentsAdapterClient::CrashedTerminationStatus;
         break;

From b5e4fdb1aabe7ef2b423a04c5bb1f6fdc98dd270 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 16 Jan 2023 11:11:44 +0100
Subject: [PATCH 040/681] Log raw abnormal exit codes

We lose details in the translation to Qt exit codes.

Change-Id: I890242ac78bf82cc6ef38d3aa8c6a25677714071
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit bef75eeae176602a7a827388e089c46a0a4c9a07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_contents_delegate_qt.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 21c3700986e..fd445f88a22 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -272,6 +272,7 @@ void WebContentsDelegateQt::PrimaryMainFrameRenderProcessGone(base::TerminationS
         || status == base::TERMINATION_STATUS_STILL_RUNNING) {
         return;
     }
+    LOG(INFO) << "ProcessGone: " << int(status) << " (" << web_contents()->GetCrashedErrorCode() << ")";
 
     setLoadingState(LoadingState::Unloaded);
 }
@@ -745,7 +746,7 @@ bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost
         return m_viewClient->profileAdapter()->checkPermission(toQt(security_origin), ProfileAdapter::VideoCapturePermission);
     default:
         LOG(INFO) << "WebContentsDelegateQt::CheckMediaAccessPermission: "
-                  << "Unsupported media stream type checked" << type;
+                  << "Unsupported media stream type checked " << type;
         return false;
     }
 }

From a7eb036d48fff6f1940e2ea1c6225dad264b3bc9 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 16 Jan 2023 14:25:14 +0100
Subject: [PATCH 041/681] Remove blink::WebSecurityOrigin leftover

Leftover from Chromium 80 adaptations.

Change-Id: I644142e6552e6a45b0a5cc2a501b20dd951c9cea
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c879e7679db0d1359f3ee5cbc8b850efbbe164eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/renderer/content_settings_observer_qt.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/core/renderer/content_settings_observer_qt.h b/src/core/renderer/content_settings_observer_qt.h
index 898731cb4bd..415d0b6b739 100644
--- a/src/core/renderer/content_settings_observer_qt.h
+++ b/src/core/renderer/content_settings_observer_qt.h
@@ -14,10 +14,6 @@
 #include "third_party/blink/public/platform/web_content_settings_client.h"
 #include "url/gurl.h"
 
-namespace blink {
-class WebSecurityOrigin;
-}
-
 namespace QtWebEngineCore {
 
 // Handles blocking content per content settings for each RenderFrame.

From c74cbf3fd77465f7be7e9735e9a9ccbbe6b06932 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 13 Jan 2023 13:20:50 +0100
Subject: [PATCH 042/681] Skip favicon database QML tests on High DPI screens

The tests use the middle pixel's value of an image to check if a
certain icon is loaded. The images are scaled on High DPI screens and the
pixel values are changed due to interpolation. It cannot be expected to
have the same pixel values for different device-pixel-ratio settings,
thus rather skip the test than maintaining a list of pixel values for
different scales.

Change-Id: I8d142de0106167a5d16c540fa468003b36c95317
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 86da28c5658230a361cd94a514d500c3ad3a7de9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/quick/qmltests/data/tst_faviconDatabase.qml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml b/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml
index 774708af0f5..28439061920 100644
--- a/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml
+++ b/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml
@@ -85,6 +85,9 @@ TestWebEngineView {
 
         function test_iconDatabase(row)
         {
+            if (Screen.devicePixelRatio !== 1.0)
+                skip("This test is not supported on High DPI screens.");
+
             webEngineView.profile = row.profile;
             compare(iconChangedSpy.count, 0);
 
@@ -129,6 +132,9 @@ TestWebEngineView {
 
         function test_iconDatabaseMultiView()
         {
+            if (Screen.devicePixelRatio !== 1.0)
+                skip("This test is not supported on High DPI screens.");
+
             var pixel;
 
             var faviconImage = Qt.createQmlObject("

From 10b8d9340f10860d54ec96918f7278dfd6dd0d45 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 12 Jan 2023 10:07:42 +0100
Subject: [PATCH 043/681] Clean up accessibility

Build less when disabled.

Change-Id: I196073ce859216a041b3d13ea585fca749a52700
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit de98b250e8e24f590988ed510f28983c85dcbdc4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt                       |  8 +++--
 .../accessibility_activation_observer.cpp     |  4 ---
 src/core/accessibility_activation_observer.h  |  6 ----
 src/core/accessibility_tree_formatter_qt.cpp  | 19 +++++++----
 src/core/browser_accessibility_manager_qt.cpp | 22 ++++++++-----
 src/core/browser_accessibility_manager_qt.h   |  9 ++---
 src/core/browser_accessibility_qt.cpp         | 15 +++------
 src/core/browser_accessibility_qt.h           |  5 +--
 src/core/render_widget_host_view_qt.cpp       |  6 ----
 src/core/render_widget_host_view_qt.h         | 10 ++----
 ...nder_widget_host_view_qt_delegate_item.cpp | 12 ++++---
 src/core/web_contents_adapter.cpp             | 33 ++++++++++---------
 12 files changed, 70 insertions(+), 79 deletions(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index c0522869d48..fa8a7d18a37 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -76,13 +76,11 @@ foreach(arch ${archs})
             CXX_COMPILE_OPTIONS
                 ${gnCxxCompileOptions}
             SOURCES
-                accessibility_activation_observer.cpp accessibility_activation_observer.h
                 accessibility_tree_formatter_qt.cpp
                 authentication_dialog_controller.cpp authentication_dialog_controller.h authentication_dialog_controller_p.h
                 autofill_client_qt.cpp autofill_client_qt.h
                 autofill_popup_controller.cpp autofill_popup_controller.h autofill_popup_controller_p.h
                 browser_accessibility_manager_qt.cpp browser_accessibility_manager_qt.h
-                browser_accessibility_qt.cpp browser_accessibility_qt.h
                 browser_main_parts_qt.cpp browser_main_parts_qt.h
                 browser_message_filter_qt.cpp browser_message_filter_qt.h
                 browsing_data_remover_delegate_qt.cpp browsing_data_remover_delegate_qt.h
@@ -197,6 +195,12 @@ foreach(arch ${archs})
                 web_usb_detector_qt.cpp web_usb_detector_qt.h
         )
 
+        extend_gn_target(${buildGn} CONDITION QT_FEATURE_accessibility
+            SOURCES
+                accessibility_activation_observer.cpp accessibility_activation_observer.h
+                browser_accessibility_qt.cpp browser_accessibility_qt.h
+        )
+
         extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_ozone_x11
             SOURCES
                 ozone/gl_ozone_glx_qt.cpp ozone/gl_ozone_glx_qt.h
diff --git a/src/core/accessibility_activation_observer.cpp b/src/core/accessibility_activation_observer.cpp
index 53a5e87fdf5..179a780d068 100644
--- a/src/core/accessibility_activation_observer.cpp
+++ b/src/core/accessibility_activation_observer.cpp
@@ -3,8 +3,6 @@
 
 #include "accessibility_activation_observer.h"
 
-#if QT_CONFIG(accessibility)
-
 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
 
 namespace QtWebEngineCore {
@@ -49,5 +47,3 @@ void AccessibilityActivationObserver::accessibilityActiveChanged(bool active)
 }
 
 } // namespace QtWebEngineCore
-
-#endif // QT_CONFIG(accessibility)
diff --git a/src/core/accessibility_activation_observer.h b/src/core/accessibility_activation_observer.h
index 20063c577eb..81d8b843cea 100644
--- a/src/core/accessibility_activation_observer.h
+++ b/src/core/accessibility_activation_observer.h
@@ -6,12 +6,8 @@
 
 #include <QtGui/qaccessible.h>
 
-#if QT_CONFIG(accessibility)
-
 namespace QtWebEngineCore {
 
-class RenderWidgetHostViewQt;
-
 class AccessibilityActivationObserver : public QAccessible::ActivationObserver
 {
 public:
@@ -23,6 +19,4 @@ class AccessibilityActivationObserver : public QAccessible::ActivationObserver
 
 } // namespace QtWebEngineCore
 
-#endif // QT_CONFIG(accessibility)
-
 #endif // ACCESSIBILITY_ACTIVATION_OBSERVER_H
diff --git a/src/core/accessibility_tree_formatter_qt.cpp b/src/core/accessibility_tree_formatter_qt.cpp
index 021ef054667..3a3b30cb4a6 100644
--- a/src/core/accessibility_tree_formatter_qt.cpp
+++ b/src/core/accessibility_tree_formatter_qt.cpp
@@ -1,20 +1,27 @@
 // Copyright (C) 2018 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
-#include "ui/accessibility/platform/inspect/ax_tree_formatter_base.h"
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
+#include "content/public/browser/ax_inspect_factory.h"
+#include "ui/accessibility/platform/inspect/ax_event_recorder.h"
 
+#include <QtGui/qtguiglobal.h>
+
+#include <memory>
+#include <string>
 #include <utility>
 
+#if QT_CONFIG(accessibility)
+#include "browser_accessibility_qt.h"
+
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
-#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
 #include "content/browser/accessibility/browser_accessibility.h"
-#include "content/public/browser/ax_inspect_factory.h"
-#include "ui/accessibility/platform/inspect/ax_event_recorder.h"
-
-#include "browser_accessibility_qt.h"
+#include "ui/accessibility/platform/inspect/ax_tree_formatter_base.h"
 
 #include <QtGui/qaccessible.h>
+#endif
 
 namespace content {
 
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 205ca6edf9b..f891100364a 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -1,23 +1,26 @@
 // Copyright (C) 2016 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
+#include "qtwebenginecoreglobal.h"
+
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(accessibility)
+#include "browser_accessibility_qt.h"
 #include "browser_accessibility_manager_qt.h"
-#include "qtwebenginecoreglobal_p.h"
+#include "render_widget_host_view_qt.h" // WebContentsAccessibilityQt
 
 #include "content/browser/accessibility/browser_accessibility.h"
-#include "ui/accessibility/ax_enums.mojom.h"
-
 #if QT_CONFIG(webengine_extensions)
 #include "content/browser/renderer_host/render_frame_host_impl.h"
 #include "content/public/browser/web_contents.h"
 #endif // QT_CONFIG(webengine_extensions)
-
-#include "browser_accessibility_qt.h"
-#include "render_widget_host_view_qt.h"
+#include "ui/accessibility/ax_enums.mojom.h"
 
 #include <QtGui/qaccessible.h>
-
-using namespace blink;
+#endif // QT_CONFIG(accessibility)
 
 namespace content {
 
@@ -43,6 +46,8 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
 
     return new BrowserAccessibilityManagerQt(access, initialTree, delegate);
 #else
+    Q_UNUSED(initialTree);
+    Q_UNUSED(delegate);
     return nullptr;
 #endif // QT_CONFIG(accessibility)
 }
@@ -54,6 +59,7 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
 #if QT_CONFIG(accessibility)
     return BrowserAccessibilityManager::Create(BrowserAccessibilityManagerQt::GetEmptyDocument(), delegate);
 #else
+    Q_UNUSED(delegate);
     return nullptr;
 #endif
 }
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index 839f6da20bd..e36edd979b0 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -6,10 +6,8 @@
 
 #include "content/browser/accessibility/browser_accessibility_manager.h"
 
-#include <QtCore/qobject.h>
-#include <QtGui/qtgui-config.h>
-
-#if QT_CONFIG(accessibility)
+#include <QtCore/qtclasshelpermacros.h>
+#include <QtCore/qtconfigmacros.h>
 
 QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
 
@@ -43,5 +41,4 @@ class BrowserAccessibilityManagerQt : public BrowserAccessibilityManager
 
 }
 
-#endif // QT_CONFIG(accessibility)
-#endif
+#endif // BROWSER_ACCESSIBILITY_MANAGER_QT_H
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index 7c9111c5618..844d774925f 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -6,16 +6,13 @@
 // found in the LICENSE.Chromium file.
 
 #include "browser_accessibility_qt.h"
-
-#if QT_CONFIG(accessibility)
-
-#include "content/browser/accessibility/browser_accessibility.h"
-#include "ui/accessibility/ax_enums.mojom.h"
-
 #include "browser_accessibility_manager_qt.h"
 #include "qtwebenginecoreglobal_p.h"
 #include "type_conversion.h"
 
+#include "content/browser/accessibility/browser_accessibility.h"
+#include "ui/accessibility/ax_enums.mojom.h"
+
 #include <QtGui/qaccessible.h>
 
 namespace QtWebEngineCore {
@@ -802,7 +799,8 @@ void BrowserAccessibilityInterface::doAction(const QString &actionName)
         q->manager()->SetFocus(*q);
 }
 
-QStringList BrowserAccessibilityInterface::keyBindingsForAction(const QString &actionName) const
+QStringList
+BrowserAccessibilityInterface::keyBindingsForAction(const QString & /*actionName*/) const
 {
     QT_NOT_YET_IMPLEMENTED
     return QStringList();
@@ -1139,6 +1137,3 @@ const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *o
 }
 
 } // namespace content
-
-
-#endif // QT_CONFIG(accessibility)
diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index 478ce0f627b..45547824728 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -4,9 +4,8 @@
 #ifndef BROWSER_ACCESSIBILITY_QT_H
 #define BROWSER_ACCESSIBILITY_QT_H
 
-#include <QtGui/qtguiglobal.h>
+#include <QtCore/qtconfigmacros.h>
 
-#if QT_CONFIG(accessibility)
 QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
 
 namespace content {
@@ -17,6 +16,4 @@ const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *o
 
 } // namespace content
 
-#endif // QT_CONFIG(accessibility)
-
 #endif // BROWSER_ACCESSIBILITY_QT_H
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 177e3c56e58..19b9f462ceb 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -3,7 +3,6 @@
 
 #include "render_widget_host_view_qt.h"
 
-#include "browser_accessibility_manager_qt.h"
 #include "qtwebenginecoreglobal_p.h"
 #include "render_widget_host_view_qt_delegate.h"
 #include "render_widget_host_view_qt_delegate_client.h"
@@ -289,11 +288,6 @@ gfx::NativeView RenderWidgetHostViewQt::GetNativeView()
     return gfx::NativeView();
 }
 
-gfx::NativeViewAccessible RenderWidgetHostViewQt::GetNativeViewAccessible()
-{
-    return 0;
-}
-
 content::WebContentsAccessibility *RenderWidgetHostViewQt::GetWebContentsAccessibility()
 {
     if (!m_webContentsAccessibility)
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index a1addd1b6f4..aebf59ddbd8 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -12,15 +12,12 @@
 #include "components/viz/common/resources/transferable_resource.h"
 #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
 #include "components/viz/host/host_frame_sink_client.h"
-#include "content/browser/accessibility/browser_accessibility_manager.h"
 #include "content/browser/accessibility/web_contents_accessibility.h"
 #include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
 #include "content/browser/renderer_host/render_widget_host_view_base.h"
 #include "content/browser/renderer_host/text_input_manager.h"
 #include "ui/events/gesture_detection/filtered_gesture_provider.h"
 
-QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
-
 namespace content {
 class RenderFrameHost;
 class RenderWidgetHostImpl;
@@ -56,12 +53,13 @@ class RenderWidgetHostViewQt
     RenderWidgetHostViewQtDelegateClient *delegateClient() const { return m_delegateClient.get(); }
     void addGuest(content::RenderWidgetHost *);
 
+    // Overridden from RenderWidgetHostView:
     void InitAsChild(gfx::NativeView) override;
     void InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect&, const gfx::Rect&) override;
     void SetSize(const gfx::Size& size) override;
     void SetBounds(const gfx::Rect&) override;
     gfx::NativeView GetNativeView() override;
-    gfx::NativeViewAccessible GetNativeViewAccessible() override;
+    gfx::NativeViewAccessible GetNativeViewAccessible() override { return nullptr; }
     void Focus() override;
     bool HasFocus() override;
     bool IsMouseLocked() override;
@@ -119,6 +117,7 @@ class RenderWidgetHostViewQt
     ui::Compositor *GetCompositor() override;
     absl::optional<content::DisplayFeature> GetDisplayFeature() override;
     void SetDisplayFeatureForTesting(const content::DisplayFeature*) override;
+    content::WebContentsAccessibility *GetWebContentsAccessibility() override;
 #if BUILDFLAG(IS_MAC)
     void ShowSharePicker(
         const std::string &title,
@@ -144,9 +143,6 @@ class RenderWidgetHostViewQt
     void OnSelectionBoundsChanged(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view) override;
     void OnTextSelectionChanged(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view) override;
 
-    // Overridden from content::BrowserAccessibilityDelegate
-    content::WebContentsAccessibility *GetWebContentsAccessibility() override;
-
     // Overridden from content::RenderFrameMetadataProvider::Observer
     void OnRenderFrameMetadataChangedAfterActivation(base::TimeTicks activation_time) override;
     void OnRenderFrameMetadataChangedBeforeActivation(const cc::RenderFrameMetadata &) override {}
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index f90a201b6d6..dd498ea0685 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -5,10 +5,14 @@
 
 #include "render_widget_host_view_qt_delegate_client.h"
 
-#include <QGuiApplication>
-#include <QMouseEvent>
-#include <QSGImageNode>
-#include <QWindow>
+#include <QtGui/qevent.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qwindow.h>
+#include <QtQuick/qsgimagenode.h>
+
+#if QT_CONFIG(accessibility)
+#include <QtGui/qaccessible.h>
+#endif
 
 namespace QtWebEngineCore {
 
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index b8f9d3205c7..081505d7fac 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -62,6 +62,23 @@
 #include "ui/gfx/font_render_params.h"
 #include "qtwebengine/browser/qtwebenginepage.mojom.h"
 
+#include <QtCore/QVariant>
+#include <QtCore/QElapsedTimer>
+#include <QtCore/QMimeData>
+#include <QtCore/QTemporaryDir>
+#include <QtGui/QDrag>
+#include <QtGui/QDragEnterEvent>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QPageLayout>
+#include <QtGui/QPixmap>
+#include <QtGui/QStyleHints>
+
+#if QT_CONFIG(accessibility)
+#include "browser_accessibility_qt.h"
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include <QtGui/qaccessible.h>
+#endif
+
 #if QT_CONFIG(webengine_printing_and_pdf)
 #include "components/pdf/browser/pdf_web_contents_helper.h"
 #include "printing/pdf_web_contents_helper_client_qt.h"
@@ -77,22 +94,6 @@
 #include "extensions/extension_web_contents_observer_qt.h"
 #endif
 
-#include <QtCore/QVariant>
-#include <QtCore/QElapsedTimer>
-#include <QtCore/QMimeData>
-#include <QtCore/QTemporaryDir>
-#include <QtGui/QDrag>
-#include <QtGui/QDragEnterEvent>
-#include <QtGui/QGuiApplication>
-#include <QtGui/QPageLayout>
-#include <QtGui/QPixmap>
-#include <QtGui/QStyleHints>
-
-// Can't include headers as qaccessible.h conflicts with Chromium headers.
-namespace content {
-extern QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *acc);
-}
-
 namespace QtWebEngineCore {
 
 #define CHECK_INITIALIZED(return_value)         \

From ba5aadda6f3c502d9a5476d49ded0da312ebd181 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 18 Jan 2023 12:52:06 +0100
Subject: [PATCH 044/681] Fix deprecation of Quota Permission Request API

Add reason string and version for deprecation. Also mark the
constructor of QWebEngineQuotaRequest class deprecated.

Amends 8fd7140082e3a752ca80882a29128ffc12d12fa4

Task-number: QTBUG-109580
Task-number: QTBUG-56354
Change-Id: Ifa15bb5eaccabd62acbeb05df071c4bdc9584c95
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 474426afa4cf52e057d321498f78bb0fbd626022)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.h                  | 3 ++-
 src/core/api/qwebenginequotarequest.h          | 5 +++--
 src/webenginequick/api/qquickwebengineview_p.h | 3 ++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
index 04272e7fa53..c60feb3ab6c 100644
--- a/src/core/api/qwebenginepage.h
+++ b/src/core/api/qwebenginepage.h
@@ -310,7 +310,8 @@ class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
     void featurePermissionRequestCanceled(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
     void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
 #if QT_DEPRECATED_SINCE(6, 5)
-    QT_DEPRECATED void quotaRequested(QWebEngineQuotaRequest quotaRequest);
+    QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.")
+    void quotaRequested(QWebEngineQuotaRequest quotaRequest);
 #endif
     void registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request);
     void fileSystemAccessRequested(QWebEngineFileSystemAccessRequest request);
diff --git a/src/core/api/qwebenginequotarequest.h b/src/core/api/qwebenginequotarequest.h
index 846a751528e..f542f5576e5 100644
--- a/src/core/api/qwebenginequotarequest.h
+++ b/src/core/api/qwebenginequotarequest.h
@@ -18,13 +18,14 @@ class Q_WEBENGINECORE_EXPORT QWebEngineQuotaRequest
     Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
     Q_PROPERTY(qint64 requestedSize READ requestedSize CONSTANT FINAL)
 public:
+    QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.")
     QWebEngineQuotaRequest() {}
     Q_INVOKABLE void accept();
     Q_INVOKABLE void reject();
     QUrl origin() const;
     qint64 requestedSize() const;
-    bool operator==(const QWebEngineQuotaRequest &) const { return false; }
-    bool operator!=(const QWebEngineQuotaRequest &) const { return true; }
+    bool operator==(const QWebEngineQuotaRequest &) const { Q_UNREACHABLE(); }
+    bool operator!=(const QWebEngineQuotaRequest &) const { Q_UNREACHABLE(); }
 };
 
 QT_END_NAMESPACE
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index 4c61680d77c..906e7c3fde7 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -517,7 +517,8 @@ private Q_SLOTS:
     Q_REVISION(1,4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request);
     Q_REVISION(1,5) void pdfPrintingFinished(const QString &filePath, bool success);
 #if QT_DEPRECATED_SINCE(6, 5)
-    Q_REVISION(1,7) QT_DEPRECATED void quotaRequested(const QWebEngineQuotaRequest &request);
+    QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.")
+    Q_REVISION(1, 7) void quotaRequested(const QWebEngineQuotaRequest &request);
 #endif
     Q_REVISION(1,7) void geometryChangeRequested(const QRect &geometry, const QRect &frameGeometry);
     Q_REVISION(1,7) void inspectedViewChanged();

From 7ff442bc67a8e602e4261548e250f2be03da502d Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 17 Jan 2023 13:21:21 +0100
Subject: [PATCH 045/681] Disable WebEngineContext dump by default

Keep it enabled for simplebrowser and quicknanobrowser examples. Also
add documentation how to enable it.

[ChangeLog][WebEngineCore] Disabled WebEngineContext dump by default.

Fixes: QTBUG-109040
Change-Id: I4bd3c0e9eb532771f9b455863324e9dacaae884a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 876f11854eddbe95132692b3b0853470563ff54a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginequick/quicknanobrowser/main.cpp  |  2 +
 .../webenginewidgets/simplebrowser/main.cpp   |  2 +
 src/core/doc/src/qtwebengine-debugging.qdoc   | 11 +++++-
 src/core/web_engine_context.cpp               | 37 ++++++++++---------
 4 files changed, 33 insertions(+), 19 deletions(-)

diff --git a/examples/webenginequick/quicknanobrowser/main.cpp b/examples/webenginequick/quicknanobrowser/main.cpp
index 519cfd089f9..850b8c443fb 100644
--- a/examples/webenginequick/quicknanobrowser/main.cpp
+++ b/examples/webenginequick/quicknanobrowser/main.cpp
@@ -12,6 +12,7 @@
 
 #include <QtCore/QCommandLineParser>
 #include <QtCore/QCommandLineOption>
+#include <QtCore/QLoggingCategory>
 
 static QUrl startupUrl(const QCommandLineParser &parser)
 {
@@ -31,6 +32,7 @@ int main(int argc, char **argv)
     QtWebEngineQuick::initialize();
 
     QGuiApplication app(argc, argv);
+    QLoggingCategory::setFilterRules(QStringLiteral("qt.webenginecontext.debug=true"));
 
     QCommandLineParser parser;
     parser.addHelpOption();
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index 477a8171bfe..b945ef27e53 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -5,6 +5,7 @@
 #include "browserwindow.h"
 #include "tabwidget.h"
 #include <QApplication>
+#include <QLoggingCategory>
 #include <QWebEngineProfile>
 #include <QWebEngineSettings>
 
@@ -24,6 +25,7 @@ int main(int argc, char **argv)
 
     QApplication app(argc, argv);
     app.setWindowIcon(QIcon(QStringLiteral(":AppLogoColor.png")));
+    QLoggingCategory::setFilterRules(QStringLiteral("qt.webenginecontext.debug=true"));
 
     QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
     QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
diff --git a/src/core/doc/src/qtwebengine-debugging.qdoc b/src/core/doc/src/qtwebengine-debugging.qdoc
index 3599ec55e96..3bb6a702996 100644
--- a/src/core/doc/src/qtwebengine-debugging.qdoc
+++ b/src/core/doc/src/qtwebengine-debugging.qdoc
@@ -92,6 +92,15 @@
     QTWEBENGINE_CHROMIUM_FLAGS="--disable-logging" mybrowser
     \endcode
 
-    QTWEBENGINE_CHROMIUM_FLAGS can also be set using {qputenv} from within the
+    QTWEBENGINE_CHROMIUM_FLAGS can also be set using \c qputenv from within the
     application if called before QtWebEngineQuick::initialize().
+
+    \section1 Dump WebEngineContext Information
+
+    For dumping the WebEngineContext information, you can set the \c QT_LOGGING_RULES
+    environment variable to \c "qt.webenginecontext.debug=true".
+
+    The output contains information about the graphical backend, and the way how \QWE
+    is initialized for the application. This is particularly useful for reproducing
+    issues.
 */
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 71855c8c2b2..ee90a58104a 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -119,6 +119,8 @@ QT_END_NAMESPACE
 
 namespace QtWebEngineCore {
 
+Q_LOGGING_CATEGORY(webEngineContextLog, "qt.webenginecontext")
+
 #if QT_CONFIG(opengl)
 
 static bool usingSupportedSGBackend()
@@ -235,8 +237,7 @@ void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
 
 static void logContext(const char *glType, base::CommandLine *cmd)
 {
-    QLoggingCategory webEngineContextLog("qt.webenginecontext");
-    if (webEngineContextLog.isInfoEnabled()) {
+    if (Q_UNLIKELY(webEngineContextLog().isDebugEnabled())) {
 #if QT_CONFIG(opengl)
         const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format();
         const auto profile = QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
@@ -248,23 +249,23 @@ static void logContext(const char *glType, base::CommandLine *cmd)
         for (const auto &pair : switch_map)
             params << " * " << toQt(pair.first)
                    << toQt(pair.second) << "\n";
-        qCInfo(webEngineContextLog,
-               "\n\nGL Type: %s\n"
-               "Surface Type: %s\n"
-               "Surface Profile: %s\n"
-               "Surface Version: %d.%d\n"
-               "QSG RHI Backend: %s\n"
-               "Using Supported QSG Backend: %s\n"
-               "Using Software Dynamic GL: %s\n"
-               "Using Multithreaded OpenGL: %s\n\n"
-               "Init Parameters:\n %s",
-               glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
-               qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
-               usingSupportedSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
-               !WebEngineContext::isGpuServiceOnUIThread() ? "yes" : "no",
-               qPrintable(params.join(" ")));
+        qCDebug(webEngineContextLog,
+                "\n\nGL Type: %s\n"
+                "Surface Type: %s\n"
+                "Surface Profile: %s\n"
+                "Surface Version: %d.%d\n"
+                "QSG RHI Backend: %s\n"
+                "Using Supported QSG Backend: %s\n"
+                "Using Software Dynamic GL: %s\n"
+                "Using Multithreaded OpenGL: %s\n\n"
+                "Init Parameters:\n %s",
+                glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
+                qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
+                usingSupportedSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
+                !WebEngineContext::isGpuServiceOnUIThread() ? "yes" : "no",
+                qPrintable(params.join(" ")));
 #else
-        qCInfo(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
+        qCDebug(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
 #endif //QT_CONFIG(opengl)
     }
 }

From 6e40352b7a10058c4549fb02266d86284487638c Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 17 Jan 2023 14:21:04 +0100
Subject: [PATCH 046/681] Doc: Fix warning and minor clean-up

- Fix typo in link
- Qt Location is no longer linked in Qt WebEngine Features
- Replace Qt Location with Qt Positioning module

Change-Id: Ia736fee8f0775fd6067c6f1e7a670b3bd7d8acb5
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit e8137c729afbbb5c1549cad863ecbfd8c95b94a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../clientcertificate/doc/src/clientcertificate.qdoc            | 2 +-
 examples/webenginewidgets/maps/doc/src/maps.qdoc                | 2 +-
 src/core/doc/qtwebengine.qdocconf                               | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index 108d2db7beb..427e5052c51 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -84,7 +84,7 @@
     \skipto QFile
     \printuntil QSslKey
 
-    Now we add the certificate and its private key to \l {QWebEngigneClientCertificateStore}.
+    Now we add the certificate and its private key to \l {QWebEngineClientCertificateStore}.
 
     \printuntil clientCertificateStore
 
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index 43728d08101..547572750e9 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -15,7 +15,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 \QWE relies on the
-    \e {Qt Location} module to power this API, a viable location backend is
+    \e {Qt Positioning} module to power this API, a viable location backend is
     needed for the target platform.
 
     To avoid accidentally sending location information to third parties
diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
index ed95ae0cad5..5cbe9e5007f 100644
--- a/src/core/doc/qtwebengine.qdocconf
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -45,7 +45,6 @@ depends += qtcore \
            qtcore5compat \
            qtdesigner \
            qtgui \
-           qtlocation \
            qtnetwork \
            qtprintsupport \
            qtpositioning \

From 81e97579055b6bb21c94ef164addea5fa9616e5b Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Mon, 19 Dec 2022 16:36:29 +0100
Subject: [PATCH 047/681] Fix opening files with File System Access API

Chrome interprets accepting file picker dialog as a user consent and
grants access permission to the selected files automatically. We have
to do the same since we don't get any permission request in this case
anymore.

This issue did not affect directory picker and file saver modes.

Also add AncestorHasActivePermission() check, it seems to be effective
to not request permission again for the same file if the parent dir
was already pulled in by this API.

Change-Id: Id73d8fc6e9bd518692362133f3dafa472f0e97a1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 01728421d641ffac98a85b408167db478b253458)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 ...le_system_access_permission_context_qt.cpp | 62 +++++++++++++++++--
 ...file_system_access_permission_context_qt.h |  3 +
 2 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
index a8406c8aeb8..bc88f7898a6 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.cpp
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
@@ -204,8 +204,6 @@ FileSystemAccessPermissionContextQt::GetReadPermissionGrant(const url::Origin &o
                                                             HandleType handle_type,
                                                             UserAction user_action)
 {
-    Q_UNUSED(user_action);
-
     auto &origin_state = m_origins[origin];
     auto *&existing_grant = origin_state.read_grants[path];
     scoped_refptr<FileSystemAccessPermissionGrantQt> new_grant;
@@ -224,6 +222,27 @@ FileSystemAccessPermissionContextQt::GetReadPermissionGrant(const url::Origin &o
         existing_grant = new_grant.get();
     }
 
+    // If a parent directory is already readable this new grant should also be readable.
+    if (new_grant && AncestorHasActivePermission(origin, path, GrantType::kRead)) {
+        existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+        return existing_grant;
+    }
+
+    switch (user_action) {
+    case UserAction::kOpen:
+    case UserAction::kSave:
+        // Open and Save dialog only grant read access for individual files.
+        if (handle_type == HandleType::kDirectory)
+            break;
+        Q_FALLTHROUGH();
+    case UserAction::kDragAndDrop:
+        // Drag&drop grants read access for all handles.
+        existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+        break;
+    case UserAction::kLoadFromStorage:
+        break;
+    }
+
     return existing_grant;
 }
 
@@ -233,8 +252,6 @@ FileSystemAccessPermissionContextQt::GetWritePermissionGrant(const url::Origin &
                                                              HandleType handle_type,
                                                              UserAction user_action)
 {
-    Q_UNUSED(user_action);
-
     auto &origin_state = m_origins[origin];
     auto *&existing_grant = origin_state.write_grants[path];
     scoped_refptr<FileSystemAccessPermissionGrantQt> new_grant;
@@ -253,6 +270,23 @@ FileSystemAccessPermissionContextQt::GetWritePermissionGrant(const url::Origin &
         existing_grant = new_grant.get();
     }
 
+    // If a parent directory is already writable this new grant should also be writable.
+    if (new_grant && AncestorHasActivePermission(origin, path, GrantType::kWrite)) {
+        existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+        return existing_grant;
+    }
+
+    switch (user_action) {
+    case UserAction::kSave:
+        // Only automatically grant write access for save dialogs.
+        existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+        break;
+    case UserAction::kOpen:
+    case UserAction::kDragAndDrop:
+    case UserAction::kLoadFromStorage:
+        break;
+    }
+
     return existing_grant;
 }
 
@@ -394,6 +428,26 @@ void FileSystemAccessPermissionContextQt::DidConfirmSensitiveDirectoryAccess(
         std::move(callback).Run(SensitiveEntryResult::kAllowed);
 }
 
+bool FileSystemAccessPermissionContextQt::AncestorHasActivePermission(
+    const url::Origin &origin, const base::FilePath &path, GrantType grant_type) const
+{
+    auto it = m_origins.find(origin);
+    if (it == m_origins.end())
+        return false;
+
+    const auto &relevant_grants = grant_type == GrantType::kWrite ? it->second.write_grants : it->second.read_grants;
+    if (relevant_grants.empty())
+        return false;
+
+    // Permissions are inherited from the closest ancestor.
+    for (base::FilePath parent = path.DirName(); parent != parent.DirName(); parent = parent.DirName()) {
+        auto i = relevant_grants.find(parent);
+        if (i != relevant_grants.end() && i->second && i->second->GetStatus() == blink::mojom::PermissionStatus::GRANTED)
+            return true;
+    }
+    return false;
+}
+
 std::u16string FileSystemAccessPermissionContextQt::GetPickerTitle(const blink::mojom::FilePickerOptionsPtr &)
 {
     return {};
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.h b/src/core/file_system_access/file_system_access_permission_context_qt.h
index 71323952514..29fefee24af 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.h
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.h
@@ -63,6 +63,9 @@ class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPerm
             const url::Origin &origin, const base::FilePath &path, HandleType handle_type,
             UserAction user_action, content::GlobalRenderFrameHostId frame_id,
             base::OnceCallback<void(SensitiveEntryResult)> callback, bool should_block);
+    bool AncestorHasActivePermission(const url::Origin &origin,
+                                     const base::FilePath &path,
+                                     GrantType grant_type) const;
 
     content::BrowserContext *m_profile;
 

From 2e9bd519a29da0a38fa326a597c3ffda8771483f Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 18 Jan 2023 13:38:00 +0100
Subject: [PATCH 048/681] Improve error handling of argument parsing

As a corner case, QCoreApplication::arguments() might be empty. For
example, the embedder sets argc=0. It is invalid but doesn't crash
or warn.

base::CommandLine expects program name to be set and Chromium code might
use it. It is not possible to set program name if argv is not passed to
QCoreApplication.

This change does not handle this corner case but detects it, and warns
the user to not expect proper behavior.

Task-number: QTBUG-110157
Change-Id: Ibf14b11bbf8b8c72d8a1d8419377a25b311b9ebe
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 614d6639b875f53b21eaabd2d5928b84b59af707)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_context.cpp | 62 +++++++++++++++++++--------------
 1 file changed, 35 insertions(+), 27 deletions(-)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index ee90a58104a..67d015e48c4 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -842,44 +842,52 @@ gpu::SyncPointManager *WebEngineContext::syncPointManager()
 base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
                                                      bool &enableGLSoftwareRendering)
 {
-    if (base::CommandLine::CreateEmpty()) {
-        base::CommandLine* parsedCommandLine = base::CommandLine::ForCurrentProcess();
-        QStringList appArgs = QCoreApplication::arguments();
-        if (qEnvironmentVariableIsSet(kChromiumFlagsEnv)) {
-            appArgs = appArgs.mid(0, 1); // Take application name and drop the rest
-            appArgs.append(parseEnvCommandLine(qEnvironmentVariable(kChromiumFlagsEnv)));
+    if (!base::CommandLine::CreateEmpty())
+        qFatal("base::CommandLine has been initialized unexpectedly.");
+
+    base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
+    QStringList appArgs = QCoreApplication::arguments();
+    if (qEnvironmentVariableIsSet(kChromiumFlagsEnv)) {
+        appArgs = appArgs.mid(0, 1); // Take application name and drop the rest
+        appArgs.append(parseEnvCommandLine(qEnvironmentVariable(kChromiumFlagsEnv)));
+    } else {
+        int index = appArgs.indexOf(QLatin1String("--webEngineArgs"));
+        if (index > -1) {
+            appArgs.erase(appArgs.begin() + 1, appArgs.begin() + index + 1);
         } else {
-            int index = appArgs.indexOf(QLatin1String("--webEngineArgs"));
-            if (index > -1) {
-                appArgs.erase(appArgs.begin() + 1, appArgs.begin() + index + 1);
-            } else {
-                appArgs = appArgs.mid(0, 1);
-            }
+            appArgs = appArgs.mid(0, 1);
         }
+    }
 #if defined(QTWEBENGINE_EMBEDDED_SWITCHES)
-        useEmbeddedSwitches = !appArgs.contains(QStringLiteral("--disable-embedded-switches"));
+    useEmbeddedSwitches = !appArgs.contains(QStringLiteral("--disable-embedded-switches"));
 #else
-        useEmbeddedSwitches = appArgs.contains(QStringLiteral("--enable-embedded-switches"));
+    useEmbeddedSwitches = appArgs.contains(QStringLiteral("--enable-embedded-switches"));
 #endif
-        enableGLSoftwareRendering =
+    enableGLSoftwareRendering =
             appArgs.removeAll(QStringLiteral("--enable-webgl-software-rendering"));
-        appArgs.removeAll(QStringLiteral("--disable-embedded-switches"));
-        appArgs.removeAll(QStringLiteral("--enable-embedded-switches"));
+    appArgs.removeAll(QStringLiteral("--disable-embedded-switches"));
+    appArgs.removeAll(QStringLiteral("--enable-embedded-switches"));
 
-        base::CommandLine::StringVector argv;
-        argv.resize(appArgs.size());
+    base::CommandLine::StringVector argv;
+    argv.resize(appArgs.size());
 #if defined(Q_OS_WIN)
-        for (int i = 0; i < appArgs.size(); ++i)
-            argv[i] = appArgs[i].toStdWString();
+    for (int i = 0; i < appArgs.size(); ++i)
+        argv[i] = appArgs[i].toStdWString();
 #else
-        for (int i = 0; i < appArgs.size(); ++i)
-            argv[i] = appArgs[i].toStdString();
+    for (int i = 0; i < appArgs.size(); ++i)
+        argv[i] = appArgs[i].toStdString();
 #endif
-        parsedCommandLine->InitFromArgv(argv);
-        return parsedCommandLine;
-    } else {
-        return base::CommandLine::ForCurrentProcess();
+    parsedCommandLine->InitFromArgv(argv);
+
+    if (QCoreApplication::arguments().empty()) {
+        // TODO: Replace this qWarning with a qFatal at the beginning of the function
+        // when the corresponding Active Qt issue gets fixed: QTBUG-110158.
+        qWarning("Argument list is empty, the program name is not passed to QCoreApplication. "
+                 "Command line arguments might be ignored. Unexpected behavior may occur.");
+        Q_ASSERT(false);
     }
+
+    return parsedCommandLine;
 }
 
 bool WebEngineContext::closingDown()

From 0729d4da7b6be49a55dbe388e740abe176c8aff5 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 23 Jan 2023 10:25:55 +0000
Subject: [PATCH 049/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I67ca991b7027f67f60afd407279565b00dc2af3d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 1dccabcdddf..be74ee527f2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d67dcb072ed38f3ca64bc4bcf1be6973466d7d93
+    ref: 0fac060a184db8bff13fe1c65f901a3f60eff624
     required: true
   ../qtpositioning:
-    ref: 4649a16dc0fa59e69e252b188bffb25d35408ed3
+    ref: 760ea4b36409bab965003695d775a0152f5c8487
     required: false
   ../qttools:
-    ref: 90d111d50c6aaa225f0c7be0a6bd5b360058fa38
+    ref: 56db4ceb20867caa85499434bba4313d81860076
     required: false
   ../qtwebchannel:
-    ref: d35beff93d14ce5dfe0b7fcc57c96cd1cafa9562
+    ref: 0dab00f7c854d74702390eabf2b21b1cc4ac2912
     required: false

From 913e998c3ad3cd7a8a9f3222e03d0b7830caaefa Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 27 Jan 2023 18:27:20 +0000
Subject: [PATCH 050/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I72e48bcda817ad9eb2d7f316010098df1c3261d4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index be74ee527f2..858dda94e91 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 0fac060a184db8bff13fe1c65f901a3f60eff624
+    ref: 99606d9eca4c4784960d03dbd95deb71fd43243c
     required: true
   ../qtpositioning:
-    ref: 760ea4b36409bab965003695d775a0152f5c8487
+    ref: b79de5e8220e2f7993339fb45e54573f7437d92c
     required: false
   ../qttools:
-    ref: 56db4ceb20867caa85499434bba4313d81860076
+    ref: 1457c684742909271edb1bad9f27a06c6796ddd1
     required: false
   ../qtwebchannel:
-    ref: 0dab00f7c854d74702390eabf2b21b1cc4ac2912
+    ref: 68a079b016dbd6dad8a38cf4fd4ec8161c4f004e
     required: false

From e74d8b157a582ceef89b4a0397ceba66eadcccf8 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 30 Jan 2023 09:59:22 +0100
Subject: [PATCH 051/681] Yield fatal error for empty command-line arguments

Resolving TODO, the corresponding Active Qt issue has been fixed.

This amends commit 614d6639b875f53b21eaabd2d5928b84b59af707

Change-Id: If0144af83cd1d512b151ce82a38e47b4811fbfa8
Taks-number: QTBUG-110157
Taks-number: QTBUG-110158
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit c38b9e66e01b7f50948c20f32823f5cbff929ac6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_context.cpp | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 67d015e48c4..50dcde63694 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -845,8 +845,13 @@ base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
     if (!base::CommandLine::CreateEmpty())
         qFatal("base::CommandLine has been initialized unexpectedly.");
 
-    base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
     QStringList appArgs = QCoreApplication::arguments();
+    if (appArgs.empty()) {
+        qFatal("Argument list is empty, the program name is not passed to QCoreApplication. "
+               "base::CommandLine cannot be properly initialized.");
+    }
+
+    base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
     if (qEnvironmentVariableIsSet(kChromiumFlagsEnv)) {
         appArgs = appArgs.mid(0, 1); // Take application name and drop the rest
         appArgs.append(parseEnvCommandLine(qEnvironmentVariable(kChromiumFlagsEnv)));
@@ -879,14 +884,6 @@ base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
 #endif
     parsedCommandLine->InitFromArgv(argv);
 
-    if (QCoreApplication::arguments().empty()) {
-        // TODO: Replace this qWarning with a qFatal at the beginning of the function
-        // when the corresponding Active Qt issue gets fixed: QTBUG-110158.
-        qWarning("Argument list is empty, the program name is not passed to QCoreApplication. "
-                 "Command line arguments might be ignored. Unexpected behavior may occur.");
-        Q_ASSERT(false);
-    }
-
     return parsedCommandLine;
 }
 

From 10ab1018a55addaab7274da8ab4e25b44ba9960b Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 14 Dec 2022 10:37:23 +0100
Subject: [PATCH 052/681] Add InputEventObserver to child frames

RenderWidgetHostViewChildFrame does not Ack mouse wheel events.
RenderWidgetHostViewQt::handleWheelEvent expects Ack on every event.

Origin-Agent-Cluster is a HTTP response header that instructs
the browser to prevent synchronous scripting between same-site
cross-origin pages. Chromium also uses this header as a hint
that an origin should get its own separate resources, such as a
dedicated process. That's where child frames are created.
This feature is implemented in chromium 88.

Add observer to child frames that responds to wheel events.
Add test for wheel/scroll events on child frames.

Fixes: QTBUG-109348
Change-Id: I20439a9068c5c2f8416a350891a6cf8830e1a5d6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e70f53df4d189fa832e3cd6bb729a00c5b6d52ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../extension_web_contents_observer_qt.cpp    |  13 +--
 src/core/render_widget_host_view_qt.cpp       |  54 +++++----
 src/core/render_widget_host_view_qt.h         |  14 ++-
 src/core/web_contents_delegate_qt.cpp         |   4 +
 .../qwebenginepage/tst_qwebenginepage.cpp     | 108 ++++++++++++++++++
 5 files changed, 154 insertions(+), 39 deletions(-)

diff --git a/src/core/extensions/extension_web_contents_observer_qt.cpp b/src/core/extensions/extension_web_contents_observer_qt.cpp
index 22092be3003..a33954a20dc 100644
--- a/src/core/extensions/extension_web_contents_observer_qt.cpp
+++ b/src/core/extensions/extension_web_contents_observer_qt.cpp
@@ -41,17 +41,8 @@ void ExtensionWebContentsObserverQt::CreateForWebContents(content::WebContents *
 void ExtensionWebContentsObserverQt::RenderFrameCreated(content::RenderFrameHost *render_frame_host)
 {
     ExtensionWebContentsObserver::RenderFrameCreated(render_frame_host);
-
-    if (web_contents()->IsInnerWebContentsForGuest() && static_cast<content::RenderFrameHostImpl *>(render_frame_host)->is_local_root_subframe()) {
-        content::WebContents *parent = web_contents()->GetOutermostWebContents();
-        QtWebEngineCore::RenderWidgetHostViewQt *main_rwhv = static_cast<QtWebEngineCore::RenderWidgetHostViewQt *>(parent->GetRenderWidgetHostView());
-        // Main frame of guest WebContents
-        content::RenderWidgetHost *guest_render_widget_host = web_contents()->GetRenderViewHost()->GetWidget();
-        main_rwhv->addGuest(guest_render_widget_host);
-        // The frame which holds the actual PDF content inside the guest
-        content::RenderWidgetHost *pdf_render_widget_host = render_frame_host->GetRenderWidgetHost();
-        main_rwhv->addGuest(pdf_render_widget_host);
-    }
+    QtWebEngineCore::RenderWidgetHostViewQt::registerInputEventObserver(web_contents(),
+                                                                        render_frame_host);
 
     const Extension *extension = GetExtensionFromFrame(render_frame_host, false);
     if (!extension)
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 19b9f462ceb..3d4e5bbc2cd 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -18,6 +18,7 @@
 #include "components/viz/common/surfaces/frame_sink_id_allocator.h"
 #include "components/viz/host/host_frame_sink_manager.h"
 #include "content/browser/compositor/image_transport_factory.h"
+#include "content/browser/renderer_host/render_frame_host_impl.h"
 #include "content/browser/renderer_host/frame_tree.h"
 #include "content/browser/renderer_host/frame_tree_node.h"
 #include "content/browser/renderer_host/cursor_manager.h"
@@ -29,6 +30,7 @@
 #include "content/browser/renderer_host/ui_events_helper.h"
 #include "content/common/content_switches_internal.h"
 #include "content/common/cursors/webcursor.h"
+#include "content/public/browser/web_contents.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/base/cursor/cursor.h"
 #include "ui/base/resource/resource_bundle.h"
@@ -141,33 +143,10 @@ class FlingingCompositor : public ui::Compositor
     }
 };
 
-class GuestInputEventObserverQt : public content::RenderWidgetHost::InputEventObserver
-{
-public:
-    GuestInputEventObserverQt(RenderWidgetHostViewQt *rwhv)
-        : m_rwhv(rwhv)
-    {
-    }
-    ~GuestInputEventObserverQt() {}
-
-    void OnInputEvent(const blink::WebInputEvent&) override {}
-    void OnInputEventAck(blink::mojom::InputEventResultSource,
-                         blink::mojom::InputEventResultState state,
-                         const blink::WebInputEvent &event) override
-    {
-        if (event.GetType() == blink::WebInputEvent::Type::kMouseWheel)
-            m_rwhv->WheelEventAck(static_cast<const blink::WebMouseWheelEvent &>(event), state);
-    }
-
-private:
-    RenderWidgetHostViewQt *m_rwhv;
-};
-
 RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget)
     : content::RenderWidgetHostViewBase::RenderWidgetHostViewBase(widget)
     , m_taskRunner(base::ThreadTaskRunnerHandle::Get())
     , m_gestureProvider(QtGestureProviderConfig(), this)
-    , m_guestInputEventObserver(new GuestInputEventObserverQt(this))
     , m_frameSinkId(host()->GetFrameSinkId())
     , m_delegateClient(new RenderWidgetHostViewQtDelegateClient(this))
 {
@@ -247,9 +226,34 @@ void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterC
                                                             m_adapterClient = nullptr; });
 }
 
-void RenderWidgetHostViewQt::addGuest(content::RenderWidgetHost *rwh)
+void RenderWidgetHostViewQt::OnInputEventAck(blink::mojom::InputEventResultSource,
+                                             blink::mojom::InputEventResultState state,
+                                             const blink::WebInputEvent &event)
 {
-    rwh->AddInputEventObserver(m_guestInputEventObserver.get());
+    if (event.GetType() == blink::WebInputEvent::Type::kMouseWheel)
+        WheelEventAck(static_cast<const blink::WebMouseWheelEvent &>(event), state);
+}
+
+// static
+// Called when new child/guest renderframes created.
+void RenderWidgetHostViewQt::registerInputEventObserver(content::WebContents *webContents,
+                                                        content::RenderFrameHost *rfh)
+{
+    if (static_cast<content::RenderFrameHostImpl *>(rfh)->is_local_root_subframe()) {
+        content::WebContents *parent = webContents->GetOutermostWebContents();
+        QtWebEngineCore::RenderWidgetHostViewQt *mainRwhv =
+                static_cast<QtWebEngineCore::RenderWidgetHostViewQt *>(
+                        parent->GetRenderWidgetHostView());
+        // Child (originAgentCluster) or guest (pdf) frame that is embedded into the main frame
+        content::RenderWidgetHost *childFrame = rfh->GetRenderWidgetHost();
+        childFrame->AddInputEventObserver(mainRwhv);
+
+        if (webContents->IsInnerWebContentsForGuest()) {
+            // The frame which holds the actual PDF content inside the guest
+            content::RenderWidgetHost *guestFrame = webContents->GetRenderViewHost()->GetWidget();
+            guestFrame->AddInputEventObserver(mainRwhv);
+        }
+    }
 }
 
 void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView)
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index aebf59ddbd8..25fd201157d 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -21,6 +21,7 @@
 namespace content {
 class RenderFrameHost;
 class RenderWidgetHostImpl;
+class WebContents;
 }
 
 namespace ui {
@@ -30,7 +31,7 @@ class TouchSelectionController;
 namespace QtWebEngineCore {
 
 class RenderWidgetHostViewQtDelegateClient;
-class GuestInputEventObserverQt;
+class InputEventObserverQt;
 class TouchSelectionControllerClientQt;
 class WebContentsAccessibilityQt;
 class WebContentsAdapterClient;
@@ -41,6 +42,7 @@ class RenderWidgetHostViewQt
     , public base::SupportsWeakPtr<RenderWidgetHostViewQt>
     , public content::TextInputManager::Observer
     , public content::RenderFrameMetadataProvider::Observer
+    , public content::RenderWidgetHost::InputEventObserver
 {
 public:
     RenderWidgetHostViewQt(content::RenderWidgetHost* widget);
@@ -51,7 +53,6 @@ class RenderWidgetHostViewQt
     WebContentsAdapterClient *adapterClient() { return m_adapterClient; }
     void setAdapterClient(WebContentsAdapterClient *adapterClient);
     RenderWidgetHostViewQtDelegateClient *delegateClient() const { return m_delegateClient.get(); }
-    void addGuest(content::RenderWidgetHost *);
 
     // Overridden from RenderWidgetHostView:
     void InitAsChild(gfx::NativeView) override;
@@ -149,6 +150,14 @@ class RenderWidgetHostViewQt
     void OnRenderFrameSubmission() override {}
     void OnLocalSurfaceIdChanged(const cc::RenderFrameMetadata &) override {}
 
+    // Overridden from content::RenderWidgetHost::InputEventObserver
+    void OnInputEvent(const blink::WebInputEvent &) override { }
+    void OnInputEventAck(blink::mojom::InputEventResultSource,
+                         blink::mojom::InputEventResultState state,
+                         const blink::WebInputEvent &event) override;
+
+    static void registerInputEventObserver(content::WebContents *, content::RenderFrameHost *);
+
     // Called from RenderWidgetHostViewQtDelegateClient.
     Compositor::Id compositorId();
     void notifyShown();
@@ -185,7 +194,6 @@ class RenderWidgetHostViewQt
     std::unique_ptr<content::CursorManager> m_cursorManager;
 
     ui::FilteredGestureProvider m_gestureProvider;
-    std::unique_ptr<GuestInputEventObserverQt> m_guestInputEventObserver;
 
     viz::FrameSinkId m_frameSinkId;
     std::unique_ptr<RenderWidgetHostViewQtDelegateClient> m_delegateClient;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index fd445f88a22..b58b5650001 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -255,6 +255,10 @@ void WebContentsDelegateQt::RenderFrameCreated(content::RenderFrameHost *render_
 {
     content::FrameTreeNode *node = static_cast<content::RenderFrameHostImpl *>(render_frame_host)->frame_tree_node();
     m_frameFocusedObserver.addNode(node);
+
+    // If it's a child frame (render_widget_host_view_child_frame) install an InputEventObserver on
+    // it. Note that it is only needed for WheelEventAck.
+    RenderWidgetHostViewQt::registerInputEventObserver(web_contents(), render_frame_host);
 }
 
 void WebContentsDelegateQt::PrimaryMainFrameRenderProcessGone(base::TerminationStatus status)
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 39629bcb856..34646cfedf1 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -36,6 +36,7 @@
 #include <QPaintEngine>
 #include <QPushButton>
 #include <QScreen>
+#include <QWheelEvent>
 #if defined(QT_STATEMACHINE_LIB)
 #    include <QStateMachine>
 #endif
@@ -265,6 +266,7 @@ private Q_SLOTS:
 
     void localToRemoteNavigation();
     void clientHints();
+    void childFrameInput();
 
 private:
     static QPoint elementCenter(QWebEnginePage *page, const QString &id);
@@ -292,6 +294,13 @@ private Q_SLOTS:
             QTest::touchEvent(window, s_touchDevice.get()).release(1, p);
         }
     };
+
+    void makeScroll(QWidget *target, QPointF pos, QPoint globalPos, QPoint angleDelta)
+    {
+        QWheelEvent ev(pos, globalPos, QPoint(0, 0), angleDelta, Qt::NoButton, Qt::NoModifier,
+                       Qt::NoScrollPhase, false);
+        QGuiApplication::sendEvent(target, &ev);
+    }
 };
 
 tst_QWebEnginePage::tst_QWebEnginePage()
@@ -5147,6 +5156,105 @@ void tst_QWebEnginePage::clientHints()
 
 }
 
+void tst_QWebEnginePage::childFrameInput()
+{
+    HttpServer server;
+    server.setHostDomain("localhost");
+
+    // The cross-origin policy blocks scripting this frame with QWebEnginePage::runJavaScript.
+    // Use console messages to validate events.
+    QString innerHtml(
+            "<html><head><style>body{height:1200px;width:1200px;}</style></head><body>test<script>"
+            "  let lastX, lastY = 0;"
+            "  document.onscroll = (e) => {"
+            "    if (window.scrollY > lastY) console.log(\"Down\");"
+            "    if (window.scrollY < lastY) console.log(\"Up\");"
+            "    if (window.scrollX > lastX) console.log(\"Right\");"
+            "    if (window.scrollX < lastX) console.log(\"Left\");"
+            "    lastX = window.scrollX;"
+            "    lastY = window.scrollY;"
+            "  };"
+            "  window.onload = () => {console.log('loaded');};"
+            "</script></body></html>");
+
+    QVERIFY(server.start());
+    connect(&server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+        if (rr->requestPath() == "/main.html") {
+            // the Origin-Agent-Cluster header enables dedicated processes for origins
+            rr->setResponseHeader("Origin-Agent-Cluster", "?1");
+            // the same-site-cross-origin page forces to create the frame in a different process
+            server.setHostDomain("sub.localhost");
+            rr->setResponseBody(("<html><body>"
+                                 "<iframe id=\"iframe\" width=90% height=90% src=\""
+                                 + server.url().toString().toUtf8()
+                                 + "inner.html\"></iframe>"
+                                   "</body></html>"));
+        }
+        if (rr->requestPath() == "/inner.html")
+            rr->setResponseBody(innerHtml.toUtf8());
+        rr->sendResponse();
+    });
+
+    QWebEngineView view;
+    ConsolePage page;
+    view.setPage(&page);
+    view.resize(640, 480);
+    QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+    page.load(server.url("/main.html"));
+    QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+
+    view.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
+    QTRY_VERIFY(evaluateJavaScriptSync(&page, "window.originAgentCluster").toBool());
+
+    // make sure the frame is loaded
+    QTRY_COMPARE(page.messages.size(), 1);
+    QTRY_COMPARE(page.messages[0], QString("loaded"));
+
+    // focus
+    evaluateJavaScriptSync(&page, "document.getElementById('iframe').contentWindow.focus()");
+    QTRY_COMPARE(evaluateJavaScriptSync(&page, "document.activeElement.id").toString(),
+                 QStringLiteral("iframe"));
+
+    QPoint globalPos = view.windowHandle()->position();
+    QPoint p = elementCenter(&page, QString("iframe"));
+
+    // Even if the document is loaded, it is not necessarily drawn.
+    // Hit-testing (in Viz) for pointer events will be flacky in this scenario.
+    // Send keyClick events first so the target frame will be cached for wheel events.
+    QTest::keyClick(view.focusProxy(), Qt::Key_Down);
+    QTRY_COMPARE(page.messages.size(), 2);
+    QTRY_COMPARE(page.messages[1], QString("Down"));
+
+    QTest::keyClick(view.focusProxy(), Qt::Key_Up);
+    QTRY_COMPARE(page.messages.size(), 3);
+    QTRY_COMPARE(page.messages[2], QString("Up"));
+
+    QTest::keyClick(view.focusProxy(), Qt::Key_Right);
+    QTRY_COMPARE(page.messages.size(), 4);
+    QTRY_COMPARE(page.messages[3], QString("Right"));
+
+    QTest::keyClick(view.focusProxy(), Qt::Key_Left);
+    QTRY_COMPARE(page.messages.size(), 5);
+    QTRY_COMPARE(page.messages[4], QString("Left"));
+
+    makeScroll(view.focusProxy(), p, globalPos, QPoint(0, -120));
+    QTRY_COMPARE(page.messages.size(), 6);
+    QTRY_COMPARE(page.messages[5], QString("Down"));
+
+    makeScroll(view.focusProxy(), p, globalPos, QPoint(0, 120));
+    QTRY_COMPARE(page.messages.size(), 7);
+    QTRY_COMPARE(page.messages[6], QString("Up"));
+
+    makeScroll(view.focusProxy(), p, globalPos, QPoint(-120, 0));
+    QTRY_COMPARE(page.messages.size(), 8);
+    QTRY_COMPARE(page.messages[7], QString("Right"));
+
+    makeScroll(view.focusProxy(), p, globalPos, QPoint(120, 0));
+    QTRY_COMPARE(page.messages.size(), 9);
+    QTRY_COMPARE(page.messages[8], QString("Left"));
+}
+
 static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
 W_QTEST_MAIN(tst_QWebEnginePage, params)
 

From b0da4e0aaba8ec0a00808396cd3218175bdddd67 Mon Sep 17 00:00:00 2001
From: Amir Masoud Abdol <amir.abdol@qt.io>
Date: Tue, 24 Jan 2023 16:20:27 +0100
Subject: [PATCH 053/681] Suppress the QTP0001 policy warning

Change-Id: If10e6c259d73dd1e09c4ddac0b297b856fb13502
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4b07704613e3a53002e66a573a6e098d1846cbd2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/quicknanobrowser/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/webenginequick/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
index a9ec7d90fd1..ac41569aacf 100644
--- a/examples/webenginequick/quicknanobrowser/CMakeLists.txt
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -35,6 +35,7 @@ target_link_libraries(quicknanobrowser PUBLIC
 qt_add_qml_module(quicknanobrowser
     URI BrowserUtils
     VERSION 1.0
+    RESOURCE_PREFIX /
 )
 
 # Resources:

From cfc189bf61e791ebaeea70afdd1d88e0578a23e1 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 1 Feb 2023 09:39:14 +0100
Subject: [PATCH 054/681] Replace uses of deprecated _qs with _s

Task-number: QTBUG-101408
Change-Id: Ie8a7944c3ded5662953bed00f022905f5805275e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b4cf9c2e0520ec39ef064955ec025f5941e4c04a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../pdfquick/multipageview/tst_multipageview.cpp | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index 48cec928f77..764a6995987 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -12,6 +12,8 @@
 #include <QtPdfQuick/private/qquickpdfpageimage_p.h>
 #include "../shared/util.h"
 
+using namespace Qt::StringLiterals;
+
 Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests")
 
 class tst_MultiPageView : public QQuickDataTest
@@ -257,7 +259,7 @@ void tst_MultiPageView::password()
     // actual QPdfDocument::pageCountChanged(int), for comparison with the illusory QQuickPdfDocument::pageCountChanged
     QVERIFY(extPageCountChangedSpy.isValid());
 
-    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_qs));
+    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s));
 
     QTRY_COMPARE(passwordRequiredSpy.size(), 1);
     qCDebug(lcTests) << "error while awaiting password" << doc->error()
@@ -268,7 +270,7 @@ void tst_MultiPageView::password()
     QCOMPARE(extPageCountChangedSpy.size(), 0);
     QCOMPARE(statusChangedSpy.size(), 2); // Loading and then Error
     statusChangedSpy.clear();
-    QVERIFY(doc->setProperty("password", u"Qt"_qs));
+    QVERIFY(doc->setProperty("password", u"Qt"_s));
     QCOMPARE(passwordChangedSpy.size(), 1);
     QTRY_COMPARE(doc->property("status").toInt(), int(QPdfDocument::Status::Ready));
     qCDebug(lcTests) << "after setPassword" << doc->error()
@@ -288,8 +290,8 @@ void tst_MultiPageView::selectionAndClipboard()
     QVERIFY(pdfView);
     QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
     QVERIFY(doc);
-    QVERIFY(doc->setProperty("password", u"Qt"_qs));
-    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_qs));
+    QVERIFY(doc->setProperty("password", u"Qt"_s));
+    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s));
     QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
 
     QVERIFY(QMetaObject::invokeMethod(pdfView, "selectAll"));
@@ -316,8 +318,8 @@ void tst_MultiPageView::search()
     QTRY_COMPARE(pdfView->width(), 200);
     QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
     QVERIFY(doc);
-    QVERIFY(doc->setProperty("password", u"Qt"_qs));
-    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_qs));
+    QVERIFY(doc->setProperty("password", u"Qt"_s));
+    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s));
     QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
     QPdfSearchModel *searchModel = pdfView->property("searchModel").value<QPdfSearchModel*>();
     QVERIFY(searchModel);
@@ -328,7 +330,7 @@ void tst_MultiPageView::search()
     QObject *multiline = findFirstChild(firstPage, "QQuickPathMultiline");
     QVERIFY(multiline);
 
-    pdfView->setProperty("searchString", u"PDF"_qs);
+    pdfView->setProperty("searchString", u"PDF"_s);
     QTRY_COMPARE(searchModel->rowCount(QModelIndex()), 7); // occurrences of the word "PDF" in this file
     const int count = searchModel->rowCount(QModelIndex());
     QList<QList<QPointF>> resultOutlines = multiline->property("paths").value<QList<QList<QPointF>>>();

From 05d6e2a0031e6ea36609df1edc88f8714d73063c Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 30 Jan 2023 10:49:23 +0100
Subject: [PATCH 055/681] QuickNanoBrowser: Remove deprecated Qt.labs.settings

Fixes deprecation warning:

qrc:/BrowserWindow.qml:35:5: QML Settings: The Settings type from
Qt.labs.settings is deprecated and will be removed in a future release.
Please use the one from QtCore instead.

Change-Id: Ie027b243a312f148f72adfd6e68ce0f8d6e6d62c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit cd5603ca6f659e5abb3675ac48fef4f9b84be1b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/quicknanobrowser/BrowserWindow.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
index ef4af5d4f97..99d9785b0ce 100644
--- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -1,7 +1,7 @@
 // Copyright (C) 2022 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
-import Qt.labs.settings
+import QtCore
 import QtQml
 import QtQuick
 import QtQuick.Controls

From d10db74a97bea7e63182b64094e584308b191b57 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 31 Jan 2023 09:17:19 +0100
Subject: [PATCH 056/681] Remove quicktestbrowser

It is not maintained for a while and most probably also not used because
it is not working since Qt6.

QuickNanoBrowser example should be used instead, because it implements
most of the quicktestbrowser features.

Change-Id: I330e1c6e0f4bf81c0bce0e6d70d47a513f63d8c7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 756b8d63ac1710dc3661c1900a0a90ae3b0db926)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/quicktestbrowser/ApplicationRoot.qml    |  43 --
 tests/quicktestbrowser/BrowserDialog.qml      |  19 -
 tests/quicktestbrowser/BrowserWindow.qml      | 507 ------------------
 tests/quicktestbrowser/ButtonWithMenu.qml     |  33 --
 tests/quicktestbrowser/DownloadView.qml       | 128 -----
 .../quicktestbrowser/FeaturePermissionBar.qml |  67 ---
 .../FullScreenNotification.qml                |  62 ---
 tests/quicktestbrowser/ZoomController.qml     |  65 ---
 tests/quicktestbrowser/main.cpp               |  71 ---
 tests/quicktestbrowser/quicktestbrowser.pro   |  26 -
 tests/quicktestbrowser/resources.qrc          |  19 -
 tests/quicktestbrowser/utils.h                |  29 -
 12 files changed, 1069 deletions(-)
 delete mode 100644 tests/quicktestbrowser/ApplicationRoot.qml
 delete mode 100644 tests/quicktestbrowser/BrowserDialog.qml
 delete mode 100644 tests/quicktestbrowser/BrowserWindow.qml
 delete mode 100644 tests/quicktestbrowser/ButtonWithMenu.qml
 delete mode 100644 tests/quicktestbrowser/DownloadView.qml
 delete mode 100644 tests/quicktestbrowser/FeaturePermissionBar.qml
 delete mode 100644 tests/quicktestbrowser/FullScreenNotification.qml
 delete mode 100644 tests/quicktestbrowser/ZoomController.qml
 delete mode 100644 tests/quicktestbrowser/main.cpp
 delete mode 100644 tests/quicktestbrowser/quicktestbrowser.pro
 delete mode 100644 tests/quicktestbrowser/resources.qrc
 delete mode 100644 tests/quicktestbrowser/utils.h

diff --git a/tests/quicktestbrowser/ApplicationRoot.qml b/tests/quicktestbrowser/ApplicationRoot.qml
deleted file mode 100644
index 74e913ba5cf..00000000000
--- a/tests/quicktestbrowser/ApplicationRoot.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.1
-import QtWebEngine 1.1
-
-QtObject {
-    id: root
-
-    property bool thirdPartyCookiesEnabled: true
-
-    property QtObject testProfile: WebEngineProfile {
-        storageName: "Test"
-    }
-
-    property QtObject otrProfile: WebEngineProfile {
-        offTheRecord: true
-    }
-
-    property Component browserWindowComponent: BrowserWindow {
-        applicationRoot: root
-        onClosing: destroy()
-    }
-    property Component browserDialogComponent: BrowserDialog {
-        onClosing: destroy()
-    }
-    function createWindow(profile) {
-        var newWindow = browserWindowComponent.createObject(root)
-        newWindow.currentWebView.profile = profile
-        profile.downloadRequested.connect(newWindow.onDownloadRequested)
-        profile.presentNotification.connect(newWindow.onPresentNotification)
-        return newWindow
-    }
-    function createDialog(profile) {
-        var newDialog = browserDialogComponent.createObject(root)
-        newDialog.currentWebView.profile = profile
-        return newDialog
-    }
-    function load(url) {
-        var browserWindow = createWindow(testProfile)
-        browserWindow.currentWebView.url = url
-    }
-}
diff --git a/tests/quicktestbrowser/BrowserDialog.qml b/tests/quicktestbrowser/BrowserDialog.qml
deleted file mode 100644
index a896223dce4..00000000000
--- a/tests/quicktestbrowser/BrowserDialog.qml
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.1
-import QtQuick.Window 2.2
-import QtWebEngine 1.1
-
-Window {
-    property alias currentWebView: webView
-    flags: Qt.Dialog
-    width: 800
-    height: 600
-    visible: true
-    onClosing: destroy()
-    WebEngineView {
-        id: webView
-        anchors.fill: parent
-    }
-}
diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml
deleted file mode 100644
index 699e877a9ff..00000000000
--- a/tests/quicktestbrowser/BrowserWindow.qml
+++ /dev/null
@@ -1,507 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.1
-import QtWebEngine 1.2
-
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtQuick.Layouts 1.0
-import QtQuick.Window 2.1
-import QtQuick.Controls.Private 1.0
-import Qt.labs.settings 1.0
-import QtQuick.Dialogs 1.2
-
-ApplicationWindow {
-    id: browserWindow
-    property QtObject applicationRoot
-    property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item.webView : null
-    property int previousVisibility: Window.Windowed
-
-    property bool isFullScreen: visibility == Window.FullScreen
-    onIsFullScreenChanged: {
-        // This is for the case where the system forces us to leave fullscreen.
-        if (currentWebView && !isFullScreen) {
-            currentWebView.state = ""
-            if (currentWebView.isFullScreen) {
-                currentWebView.fullScreenCancelled()
-                fullScreenNotification.hide()
-            }
-        }
-    }
-
-    height: 600
-    width: 800
-    visible: true
-    title: currentWebView && currentWebView.title
-
-    Settings {
-        id : appSettings
-        property alias autoLoadImages: loadImages.checked;
-        property alias javaScriptEnabled: javaScriptEnabled.checked;
-        property alias errorPageEnabled: errorPageEnabled.checked;
-        property alias pluginsEnabled: pluginsEnabled.checked;
-        property alias thirdPartyCookiesEnabled: thirdPartyCookiesEnabled.checked;
-    }
-
-    // Make sure the Qt.WindowFullscreenButtonHint is set on OS X.
-    Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint
-
-    // Create a styleItem to determine the platform.
-    // When using style "mac", ToolButtons are not supposed to accept focus.
-    StyleItem { id: styleItem }
-    property bool platformIsMac: styleItem.style == "mac"
-
-    Action {
-        shortcut: "Ctrl+D"
-        onTriggered: {
-            downloadView.visible = !downloadView.visible
-        }
-    }
-
-    Action {
-        id: focus
-        shortcut: "Ctrl+L"
-        onTriggered: {
-            addressBar.forceActiveFocus();
-            addressBar.selectAll();
-        }
-    }
-    Action {
-        shortcut: "Ctrl+R"
-        onTriggered: {
-            if (currentWebView)
-                currentWebView.reload()
-        }
-    }
-    Action {
-        shortcut: "Ctrl+T"
-        onTriggered: {
-            tabs.createEmptyTab(currentWebView.profile)
-            tabs.currentIndex = tabs.count - 1
-            addressBar.forceActiveFocus();
-            addressBar.selectAll();
-        }
-    }
-    Action {
-        shortcut: "Ctrl+W"
-        onTriggered: {
-            if (tabs.count == 1)
-                browserWindow.close()
-            else
-                tabs.removeTab(tabs.currentIndex)
-        }
-    }
-
-    Action {
-        shortcut: "Escape"
-        onTriggered: {
-            if (browserWindow.isFullScreen)
-                browserWindow.visibility = browserWindow.previousVisibility
-        }
-    }
-    Action {
-        shortcut: "Ctrl+0"
-        onTriggered: zoomController.reset()
-    }
-    Action {
-        shortcut: "Ctrl+-"
-        onTriggered: zoomController.zoomOut()
-    }
-    Action {
-        shortcut: "Ctrl+="
-        onTriggered: zoomController.zoomIn()
-    }
-
-    Menu {
-        id: backHistoryMenu
-
-        Instantiator {
-            model: currentWebView && currentWebView.history.backItems
-            MenuItem {
-                text: model.title
-                onTriggered: currentWebView.goBackOrForward(model.offset)
-            }
-
-            onObjectAdded: backHistoryMenu.insertItem(index, object)
-            onObjectRemoved: backHistoryMenu.removeItem(object)
-        }
-    }
-
-    Menu {
-        id: forwardHistoryMenu
-
-        Instantiator {
-            model: currentWebView && currentWebView.history.forwardItems
-            MenuItem {
-                text: model.title
-                onTriggered: currentWebView.goBackOrForward(model.offset)
-            }
-
-            onObjectAdded: forwardHistoryMenu.insertItem(index, object)
-            onObjectRemoved: forwardHistoryMenu.removeItem(object)
-        }
-    }
-
-    toolBar: ToolBar {
-        id: navigationBar
-            RowLayout {
-                anchors.fill: parent;
-                ButtonWithMenu {
-                    id: backButton
-                    iconSource: "icons/go-previous.png"
-                    enabled: currentWebView && currentWebView.canGoBack
-                    activeFocusOnTab: !browserWindow.platformIsMac
-                    onClicked: currentWebView.goBack()
-                    longPressMenu: backHistoryMenu
-                }
-                ButtonWithMenu {
-                    id: forwardButton
-                    iconSource: "icons/go-next.png"
-                    enabled: currentWebView && currentWebView.canGoForward
-                    activeFocusOnTab: !browserWindow.platformIsMac
-                    onClicked: currentWebView.goForward()
-                    longPressMenu: forwardHistoryMenu
-                }
-                ToolButton {
-                    id: reloadButton
-                    iconSource: currentWebView && currentWebView.loading ? "icons/process-stop.png" : "icons/view-refresh.png"
-                    onClicked: currentWebView && currentWebView.loading ? currentWebView.stop() : currentWebView.reload()
-                    activeFocusOnTab: !browserWindow.platformIsMac
-                }
-                TextField {
-                    id: addressBar
-                    Image {
-                        anchors.verticalCenter: addressBar.verticalCenter;
-                        x: 5
-                        z: 2
-                        id: faviconImage
-                        width: 16; height: 16
-                        source: currentWebView && currentWebView.icon
-                    }
-                    style: TextFieldStyle {
-                        padding {
-                            left: 26;
-                        }
-                    }
-                    focus: true
-                    Layout.fillWidth: true
-                    text: currentWebView && currentWebView.url
-                    onAccepted: currentWebView.url = utils.fromUserInput(text)
-                }
-                ToolButton {
-                    id: settingsMenuButton
-                    menu: Menu {
-                        MenuItem {
-                            id: loadImages
-                            text: "Autoload images"
-                            checkable: true
-                            checked: true
-                        }
-                        MenuItem {
-                            id: javaScriptEnabled
-                            text: "JavaScript On"
-                            checkable: true
-                            checked: true
-                        }
-                        MenuItem {
-                            id: errorPageEnabled
-                            text: "ErrorPage On"
-                            checkable: true
-                            checked: true
-                        }
-                        MenuItem {
-                            id: pluginsEnabled
-                            text: "Plugins On"
-                            checkable: true
-                            checked: true
-                        }
-                        MenuItem {
-                            id: thirdPartyCookiesEnabled
-                            text: "Third party cookies enabled"
-                            checkable: true
-                            checked: true
-                            onToggled: applicationRoot.thirdPartyCookiesEnabled = checked
-                        }
-                        MenuItem {
-                            id: offTheRecordEnabled
-                            text: "Off The Record"
-                            checkable: true
-                            checked: currentWebView.profile.offTheRecord
-                            onToggled: currentWebView.profile = checked ? otrProfile : testProfile;
-                        }
-                        MenuItem {
-                            id: httpDiskCacheEnabled
-                            text: "HTTP Disk Cache"
-                            checkable: !currentWebView.profile.offTheRecord
-                            checked: (currentWebView.profile.httpCacheType == WebEngineProfile.DiskHttpCache)
-                            onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
-                        }
-                    }
-                }
-            }
-            ProgressBar {
-                id: progressBar
-                height: 3
-                anchors {
-                    left: parent.left
-                    top: parent.bottom
-                    right: parent.right
-                    leftMargin: -parent.leftMargin
-                    rightMargin: -parent.rightMargin
-                }
-                style: ProgressBarStyle {
-                    background: Item {}
-                }
-                z: -2;
-                minimumValue: 0
-                maximumValue: 100
-                value: (currentWebView && currentWebView.loadProgress < 100) ? currentWebView.loadProgress : 0
-            }
-    }
-
-    TabView {
-        id: tabs
-        function createEmptyTab(profile) {
-            var tab = addTab("", tabComponent)
-            // We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately.
-            tab.active = true
-            tab.title = Qt.binding(function() { return tab.item.title })
-            tab.item.webView.profile = profile
-            return tab
-        }
-
-        anchors.fill: parent
-        Component.onCompleted: createEmptyTab(testProfile)
-
-        Component {
-            id: tabComponent
-            Item {
-                property alias webView: webEngineView
-                property alias title: webEngineView.title
-                Action {
-                    shortcut: "Ctrl+F"
-                    onTriggered: {
-                        findBar.visible = !findBar.visible
-                        if (findBar.visible) {
-                            findTextField.forceActiveFocus()
-                        }
-                    }
-                }
-                FeaturePermissionBar {
-                    id: permBar
-                    view: webEngineView
-                    anchors {
-                        left: parent.left
-                        right: parent.right
-                        top: parent.top
-                    }
-                    z: 3
-                }
-
-                WebEngineView {
-                    id: webEngineView
-
-                    anchors {
-                        fill: parent
-                        top: permBar.bottom
-                    }
-
-                    focus: true
-
-                    states: [
-                        State {
-                            name: "FullScreen"
-                            PropertyChanges {
-                                target: tabs
-                                frameVisible: false
-                                tabsVisible: false
-                            }
-                            PropertyChanges {
-                                target: navigationBar
-                                visible: false
-                            }
-                        }
-                    ]
-                    settings.autoLoadImages: appSettings.autoLoadImages
-                    settings.javascriptEnabled: appSettings.javaScriptEnabled
-                    settings.errorPageEnabled: appSettings.errorPageEnabled
-                    settings.pluginsEnabled: appSettings.pluginsEnabled
-
-                    onCertificateError: {
-                        if (!acceptedCertificates.shouldAutoAccept(error)){
-                            error.defer()
-                            sslDialog.enqueue(error)
-                        } else{
-                            error.ignoreCertificateError()
-                        }
-                    }
-
-                    onNewWindowRequested: {
-                        if (!request.userInitiated)
-                            print("Warning: Blocked a popup window.")
-                        else if (request.destination == WebEngineView.NewViewInTab) {
-                            var tab = tabs.createEmptyTab(currentWebView.profile)
-                            tabs.currentIndex = tabs.count - 1
-                            request.openIn(tab.item.webView)
-                        } else if (request.destination == WebEngineView.NewViewInBackgroundTab) {
-                            var tab = tabs.createEmptyTab(currentWebView.profile)
-                            request.openIn(tab.item.webView)
-                        } else if (request.destination == WebEngineView.NewViewInDialog) {
-                            var dialog = applicationRoot.createDialog(currentWebView.profile)
-                            request.openIn(dialog.currentWebView)
-                        } else {
-                            var window = applicationRoot.createWindow(currentWebView.profile)
-                            request.openIn(window.currentWebView)
-                        }
-                    }
-
-                    onFullScreenRequested: {
-                        if (request.toggleOn) {
-                            webEngineView.state = "FullScreen"
-                            browserWindow.previousVisibility = browserWindow.visibility
-                            browserWindow.showFullScreen()
-                            fullScreenNotification.show()
-                        } else {
-                            webEngineView.state = ""
-                            browserWindow.visibility = browserWindow.previousVisibility
-                            fullScreenNotification.hide()
-                        }
-                        request.accept()
-                    }
-
-                    onFeaturePermissionRequested: {
-                        permBar.securityOrigin = securityOrigin;
-                        permBar.requestedFeature = feature;
-                        permBar.visible = true;
-                    }
-                }
-
-                Rectangle {
-                    id: findBar
-                    anchors.top: webEngineView.top
-                    anchors.right: webEngineView.right
-                    width: 240
-                    height: 35
-                    border.color: "lightgray"
-                    border.width: 1
-                    radius: 5
-                    visible: false
-                    color: browserWindow.color
-
-                    RowLayout {
-                        anchors.centerIn: findBar
-                        TextField {
-                            id: findTextField
-                            onAccepted: {
-                                webEngineView.findText(text)
-                            }
-                        }
-                        ToolButton {
-                            id: findBackwardButton
-                            iconSource: "icons/go-previous.png"
-                            onClicked: webEngineView.findText(findTextField.text, WebEngineView.FindBackward)
-                        }
-                        ToolButton {
-                            id: findForwardButton
-                            iconSource: "icons/go-next.png"
-                            onClicked: webEngineView.findText(findTextField.text)
-                        }
-                        ToolButton {
-                            id: findCancelButton
-                            iconSource: "icons/process-stop.png"
-                            onClicked: findBar.visible = false
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    QtObject{
-        id:acceptedCertificates
-
-        property var acceptedUrls : []
-
-        function shouldAutoAccept(certificateError){
-            var domain = utils.domainFromString(certificateError.url)
-            return acceptedUrls.indexOf(domain) >= 0
-        }
-    }
-
-    MessageDialog {
-        id: sslDialog
-
-        property var certErrors: []
-        icon: StandardIcon.Warning
-        standardButtons: StandardButton.No | StandardButton.Yes
-        title: "Server's certificate not trusted"
-        text: "Do you wish to continue?"
-        detailedText: "If you wish so, you may continue with an unverified certificate. " +
-                      "Accepting an unverified certificate means " +
-                      "you may not be connected with the host you tried to connect to.\n" +
-                      "Do you wish to override the security check and continue?"
-        onYes: {
-            var cert = certErrors.shift()
-            var domain = utils.domainFromString(cert.url)
-            acceptedCertificates.acceptedUrls.push(domain)
-            cert.ignoreCertificateError()
-            presentError()
-        }
-        onNo: reject()
-        onRejected: reject()
-
-        function reject(){
-            certErrors.shift().rejectCertificate()
-            presentError()
-        }
-        function enqueue(error){
-            certErrors.push(error)
-            presentError()
-        }
-        function presentError(){
-            visible = certErrors.length > 0
-        }
-    }
-
-    FullScreenNotification {
-        id: fullScreenNotification
-    }
-
-    DownloadView {
-        id: downloadView
-        visible: false
-        anchors.fill: parent
-    }
-
-    function onDownloadRequested(download) {
-        downloadView.visible = true
-        downloadView.append(download)
-        download.accept()
-    }
-
-    MessageDialog {
-        id: notificationDialog
-        width: 200
-        standardButtons: StandardButton.Ok
-    }
-
-    function onPresentNotification(notification) {
-        notificationDialog.title = notification.title
-        notificationDialog.text = notification.origin.toString() + '\n' + notification.message
-        notificationDialog.open()
-    }
-
-    ZoomController {
-      id: zoomController
-      y: parent.mapFromItem(currentWebView, 0 , 0).y - 4
-      anchors.right: parent.right
-      width: (parent.width > 800) ? parent.width * 0.25 : 220
-      anchors.rightMargin: (parent.width > 400) ? 100 : 0
-    }
-    Binding {
-        target: currentWebView
-        property: "zoomFactor"
-        value: zoomController.zoomFactor
-    }
-}
diff --git a/tests/quicktestbrowser/ButtonWithMenu.qml b/tests/quicktestbrowser/ButtonWithMenu.qml
deleted file mode 100644
index 56a4d3533ad..00000000000
--- a/tests/quicktestbrowser/ButtonWithMenu.qml
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-
-// The QtQuick controls guys are slackers, so we need to make our own stuff
-
-ToolButton {
-    id: root
-    property Menu longPressMenu
-    function showMenu() {
-        longPressMenu.__popup(Qt.rect(0, root.height, 0, 0), 0)
-    }
-
-    Binding {
-        target: longPressMenu
-        property: "__visualItem"
-        value: root
-    }
-
-    MouseArea {
-        anchors.fill: parent
-        acceptedButtons: Qt.LeftButton | Qt.RightButton
-        onClicked: {
-            if (mouse.button == Qt.RightButton)
-                showMenu()
-            else
-                root.clicked()
-        }
-        onPressAndHold: showMenu()
-    }
-}
diff --git a/tests/quicktestbrowser/DownloadView.qml b/tests/quicktestbrowser/DownloadView.qml
deleted file mode 100644
index f4834edadec..00000000000
--- a/tests/quicktestbrowser/DownloadView.qml
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.1
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtWebEngine 1.0
-import QtQuick.Layouts 1.0
-
-Rectangle {
-    id: downloadView
-    color: "lightgray"
-
-    ListModel {
-        id: downloadModel
-        property var downloads: []
-    }
-
-    function append(download) {
-        downloadModel.append(download)
-        downloadModel.downloads.push(download)
-    }
-
-    Component {
-        id: downloadItemDelegate
-
-        Rectangle {
-            width: listView.width
-            height: childrenRect.height
-            anchors.margins: 10
-            radius: 3
-            color: "transparent"
-            border.color: "black"
-            Rectangle {
-                id: progressBar
-
-                property real progress: downloadModel.downloads[index]
-                                       ? downloadModel.downloads[index].receivedBytes / downloadModel.downloads[index].totalBytes : 0
-
-                radius: 3
-                color: width == listView.width ? "green" : "#2b74c7"
-                width: listView.width * progress
-                height: cancelButton.height
-
-                Behavior on width {
-                    SmoothedAnimation { duration: 100 }
-                }
-            }
-            Rectangle {
-                anchors {
-                    left: parent.left
-                    right: parent.right
-                    leftMargin: 20
-                }
-                Label {
-                    id: label
-                    text: path
-                    anchors {
-                        verticalCenter: cancelButton.verticalCenter
-                        left: parent.left
-                        right: cancelButton.left
-                    }
-                }
-                Button {
-                    id: cancelButton
-                    anchors.right: parent.right
-                    iconSource: "icons/process-stop.png"
-                    onClicked: {
-                        var download = downloadModel.downloads[index]
-
-                        download.cancel()
-
-                        downloadModel.downloads = downloadModel.downloads.filter(function (el) {
-                            return el.id !== download.id;
-                        });
-                        downloadModel.remove(index)
-                    }
-                }
-            }
-        }
-
-    }
-    ListView {
-        id: listView
-        anchors {
-            topMargin: 10
-            top: parent.top
-            bottom: parent.bottom
-            horizontalCenter: parent.horizontalCenter
-        }
-        width: parent.width - 20
-        spacing: 5
-
-        model: downloadModel
-        delegate: downloadItemDelegate
-
-        Text {
-            visible: !listView.count
-            horizontalAlignment: Text.AlignHCenter
-            height: 30
-            anchors {
-                top: parent.top
-                left: parent.left
-                right: parent.right
-            }
-            font.pixelSize: 20
-            text: "No active downloads."
-        }
-
-        Rectangle {
-            color: "gray"
-            anchors {
-                bottom: parent.bottom
-                left: parent.left
-                right: parent.right
-            }
-            height: 30
-            Button {
-                id: okButton
-                text: "OK"
-                anchors.centerIn: parent
-                onClicked: {
-                    downloadView.visible = false
-                }
-            }
-        }
-    }
-}
diff --git a/tests/quicktestbrowser/FeaturePermissionBar.qml b/tests/quicktestbrowser/FeaturePermissionBar.qml
deleted file mode 100644
index ca75875f527..00000000000
--- a/tests/quicktestbrowser/FeaturePermissionBar.qml
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.1
-import QtQuick.Controls 1.0
-import QtWebEngine 1.1
-import QtQuick.Layouts 1.0
-
-Rectangle {
-    property var requestedFeature;
-    property url securityOrigin;
-    property WebEngineView view;
-
-    id: permissionBar
-    visible: false
-    height: acceptButton.height + 4
-
-
-    function textForFeature(feature) {
-        switch (feature) {
-            case WebEngineView.Geolocation:              return 'Allow %1 to access your location information?'
-            case WebEngineView.MediaAudioCapture:        return 'Allow %1 to access your microphone?'
-            case WebEngineView.MediaVideoCapture:        return 'Allow %1 to access your webcam?'
-            case WebEngineView.MediaAudioVideoCapture:   return 'Allow %1 to access your microphone and webcam?'
-            case WebEngineView.DesktopVideoCapture:      return 'Allow %1 to capture video of your desktop?'
-            case WebEngineView.DesktopAudioVideoCapture: return 'Allow %1 to capture audio and video of your desktop?'
-            case WebEngineView.Notifications:            return 'Allow %1 to show notification on your desktop?'
-            default: break
-        }
-        return 'Grant permission for %1 to unknown or unsupported feature [' + feature + ']?'
-    }
-
-    onRequestedFeatureChanged: {
-        message.text = textForFeature(requestedFeature).arg(securityOrigin);
-    }
-
-    RowLayout {
-        anchors {
-            fill: permissionBar
-            leftMargin: 5
-            rightMargin: 5
-        }
-        Label {
-            id: message
-            Layout.fillWidth: true
-        }
-
-        Button {
-            id: acceptButton
-            text: "Accept"
-            Layout.alignment: Qt.AlignRight
-            onClicked: {
-                view.grantFeaturePermission(securityOrigin, requestedFeature, true);
-                permissionBar.visible = false;
-            }
-        }
-
-        Button {
-            text: "Deny"
-            Layout.alignment: Qt.AlignRight
-            onClicked: {
-                view.grantFeaturePermission(securityOrigin, requestedFeature, false);
-                permissionBar.visible = false
-            }
-        }
-    }
-}
diff --git a/tests/quicktestbrowser/FullScreenNotification.qml b/tests/quicktestbrowser/FullScreenNotification.qml
deleted file mode 100644
index e48d6c646a0..00000000000
--- a/tests/quicktestbrowser/FullScreenNotification.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.5
-
-Rectangle {
-    id: fullScreenNotification
-    width: 500
-    height: 40
-    color: "white"
-    radius: 7
-
-    visible: false
-    opacity: 0
-
-    function show() {
-        visible = true
-        opacity = 1
-        reset.start()
-    }
-
-    function hide() {
-        reset.stop()
-        opacity = 0
-    }
-
-    Behavior on opacity {
-        NumberAnimation {
-            duration: 750
-            onStopped: {
-                if (opacity == 0)
-                    visible = false
-            }
-        }
-    }
-
-    Timer {
-        id: reset
-        interval: 5000
-        onTriggered: hide()
-    }
-
-    anchors.horizontalCenter: parent.horizontalCenter
-    y: 125
-
-    Text {
-        id: message
-        width: parent.width
-
-        anchors.horizontalCenter: parent.horizontalCenter
-        anchors.verticalCenter: parent.verticalCenter
-
-        horizontalAlignment: Text.AlignHCenter
-        verticalAlignment: Text.AlignVCenter
-
-        wrapMode: Text.WordWrap
-        elide: Text.ElideNone
-        clip: true
-
-        text: qsTr("You are now in fullscreen mode. Press ESC to quit!")
-    }
-}
diff --git a/tests/quicktestbrowser/ZoomController.qml b/tests/quicktestbrowser/ZoomController.qml
deleted file mode 100644
index 2122c436595..00000000000
--- a/tests/quicktestbrowser/ZoomController.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.1
-
-Rectangle {
-    property alias zoomFactor: slider.value ;
-    function zoomIn() {
-        visible = true
-        visibilityTimer.restart()
-        zoomFactor = zoomFactor + 0.25;
-    }
-    function zoomOut() {
-        visible = true
-        visibilityTimer.restart()
-        zoomFactor = zoomFactor - 0.25;
-    }
-    function reset() { zoomFactor = 1.0 }
-
-    width: 220
-    height: 30
-    color: palette.window
-    visible: false
-    radius: 4
-
-    SystemPalette {
-        id: palette
-    }
-    Timer {
-        id: visibilityTimer
-        interval: 3000
-        repeat: false
-        onTriggered: zoomController.visible = false
-    }
-
-    RowLayout {
-        anchors.margins: 4
-        anchors.fill: parent
-        ToolButton {
-            id: plusButton
-            text: '+'
-            onClicked: zoomIn()
-        }
-        ToolButton {
-            text: '\u2014'
-            id: minusButton
-            onClicked: zoomOut()
-        }
-        Slider {
-            id: slider
-            maximumValue: 5.0
-            minimumValue: 0.25
-            Layout.fillWidth: true;
-            stepSize: 0.05
-            value: 1
-            onValueChanged: visibilityTimer.restart()
-        }
-        Button {
-            text: "Reset"
-            onClicked: reset()
-        }
-    }
-}
diff --git a/tests/quicktestbrowser/main.cpp b/tests/quicktestbrowser/main.cpp
deleted file mode 100644
index c41eb2f56ab..00000000000
--- a/tests/quicktestbrowser/main.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#include "utils.h"
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-typedef QApplication Application;
-#else
-#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtQml/QQmlComponent>
-#include <QtWebEngineQuick/qtwebenginequickglobal.h>
-#include <QtWebEngineQuick/QQuickWebEngineProfile>
-#include <QtWebEngineCore/qwebenginecookiestore.h>
-
-static QUrl startupUrl()
-{
-    QUrl ret;
-    QStringList args(qApp->arguments());
-    args.takeFirst();
-    for (const QString &arg : std::as_const(args)) {
-        if (arg.startsWith(QLatin1Char('-')))
-             continue;
-        ret = Utils::fromUserInput(arg);
-        if (ret.isValid())
-            return ret;
-    }
-    return QUrl(QStringLiteral("http://qt.io/"));
-}
-
-int main(int argc, char **argv)
-{
-    Application app(argc, argv);
-
-    // Enable dev tools by default for the test browser
-    if (qgetenv("QTWEBENGINE_REMOTE_DEBUGGING").isNull())
-        qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "1337");
-    QtWebEngineQuick::initialize();
-
-    QQmlApplicationEngine appEngine;
-    Utils utils;
-    appEngine.rootContext()->setContextProperty("utils", &utils);
-    appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
-
-    QObject *rootObject = appEngine.rootObjects().first();
-
-    QQuickWebEngineProfile *profile = new QQuickWebEngineProfile(rootObject);
-
-    const QMetaObject *rootMeta = rootObject->metaObject();
-    int index = rootMeta->indexOfProperty("thirdPartyCookiesEnabled");
-    Q_ASSERT(index != -1);
-    QMetaProperty thirdPartyCookiesProperty = rootMeta->property(index);
-    profile->cookieStore()->setCookieFilter(
-            [rootObject,&thirdPartyCookiesProperty](const QWebEngineCookieStore::FilterRequest &request)
-            {
-                return !request.thirdParty || thirdPartyCookiesProperty.read(rootObject).toBool();
-            });
-
-    index = rootMeta->indexOfProperty("testProfile");
-    Q_ASSERT(index != -1);
-    QMetaProperty profileProperty = rootMeta->property(index);
-    profileProperty.write(rootObject, QVariant::fromValue(profile));
-
-    QMetaObject::invokeMethod(rootObject, "load", Q_ARG(QVariant, startupUrl()));
-
-    return app.exec();
-}
diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro
deleted file mode 100644
index 3041358363f..00000000000
--- a/tests/quicktestbrowser/quicktestbrowser.pro
+++ /dev/null
@@ -1,26 +0,0 @@
-requires(qtConfig(accessibility))
-
-TEMPLATE = app
-TARGET = quicktestbrowser
-
-macx: CONFIG -= app_bundle
-
-HEADERS = utils.h
-SOURCES = main.cpp
-
-OTHER_FILES += ApplicationRoot.qml \
-               BrowserDialog.qml \
-               BrowserWindow.qml \
-               ButtonWithMenu.qml \
-               ContextMenuExtras.qml \
-               DownloadView.qml \
-               FeaturePermissionBar.qml \
-               FullScreenNotification.qml
-
-RESOURCES += resources.qrc
-
-QT += qml quick webenginequick
-
-qtHaveModule(widgets) {
-    QT += widgets # QApplication is required to get native styling with QtQuickControls
-}
diff --git a/tests/quicktestbrowser/resources.qrc b/tests/quicktestbrowser/resources.qrc
deleted file mode 100644
index 8fbe286fbf2..00000000000
--- a/tests/quicktestbrowser/resources.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-    <qresource prefix="/">
-        <file>ApplicationRoot.qml</file>
-        <file>BrowserDialog.qml</file>
-        <file>BrowserWindow.qml</file>
-        <file>FeaturePermissionBar.qml</file>
-        <file>FullScreenNotification.qml</file>
-        <file>ButtonWithMenu.qml</file>
-        <file>DownloadView.qml</file>
-        <file>ZoomController.qml</file>
-    </qresource>
-    <qresource prefix="icons">
-        <!-- To the risk of this breaking more often, do not duplicate the resources since this application won't be deployed -->
-        <file alias="go-next.png">../../examples/webenginequick/quicknanobrowser/icons/3rdparty/go-next.png</file>
-        <file alias="go-previous.png">../../examples/webenginequick/quicknanobrowser/icons/3rdparty/go-previous.png</file>
-        <file alias="process-stop.png">../../examples/webenginequick/quicknanobrowser/icons/3rdparty/process-stop.png</file>
-        <file alias="view-refresh.png">../../examples/webenginequick/quicknanobrowser/icons/3rdparty/view-refresh.png</file>
-    </qresource>
-</RCC>
diff --git a/tests/quicktestbrowser/utils.h b/tests/quicktestbrowser/utils.h
deleted file mode 100644
index 8521e9bf56d..00000000000
--- a/tests/quicktestbrowser/utils.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <QtCore/QFileInfo>
-#include <QtCore/QUrl>
-
-class Utils : public QObject {
-    Q_OBJECT
-public:
-    Q_INVOKABLE static QUrl fromUserInput(const QString& userInput);
-    Q_INVOKABLE static QString domainFromString(const QString& urlString);
-};
-
-inline QUrl Utils::fromUserInput(const QString& userInput)
-{
-    QFileInfo fileInfo(userInput);
-    if (fileInfo.exists())
-        return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
-    return QUrl::fromUserInput(userInput);
-}
-
-inline QString Utils::domainFromString(const QString& urlString)
-{
-    return QUrl::fromUserInput(urlString).host();
-}
-
-#endif // UTILS_H

From 31b7415f35e3501e7abd2af19a75d99aa6814901 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 31 Jan 2023 09:12:12 +0100
Subject: [PATCH 057/681] QuickNanoBrowser: Add feature permission request
 handling

Change-Id: Ia0d8bffa419174234e78e1359871e0dfa36b1636
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c9852591cb8ccedfcdf0469db04be59671a912e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../quicknanobrowser/BrowserWindow.qml        | 79 +++++++++++++++++--
 .../doc/src/quicknanobrowser.qdoc             | 25 ++++++
 2 files changed, 98 insertions(+), 6 deletions(-)

diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
index 99d9785b0ce..9df7488c004 100644
--- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -610,6 +610,12 @@ ApplicationWindow {
                         findBar.reset();
                 }
 
+                onFeaturePermissionRequested: function(securityOrigin, feature) {
+                    featurePermissionDialog.securityOrigin = securityOrigin;
+                    featurePermissionDialog.feature = feature;
+                    featurePermissionDialog.visible = true;
+                }
+
                 Timer {
                     id: reloadTimer
                     interval: 0
@@ -648,22 +654,21 @@ ApplicationWindow {
     Dialog {
         id: sslDialog
         anchors.centerIn: parent
-        contentWidth: Math.max(mainText.width, detailedText.width)
-        contentHeight: mainText.height + detailedText.height
+        contentWidth: Math.max(mainTextForSSLDialog.width, detailedTextForSSLDialog.width)
+        contentHeight: mainTextForSSLDialog.height + detailedTextForSSLDialog.height
         property var certErrors: []
         // fixme: icon!
         // icon: StandardIcon.Warning
         standardButtons: Dialog.No | Dialog.Yes
         title: "Server's certificate not trusted"
         contentItem: Item {
-            id: textContentItem
             Label {
-                id: mainText
+                id: mainTextForSSLDialog
                 text: "Do you wish to continue?"
             }
             Text {
-                id: detailedText
-                anchors.top: mainText.bottom
+                id: detailedTextForSSLDialog
+                anchors.top: mainTextForSSLDialog.bottom
                 text: "If you wish so, you may continue with an unverified certificate.\n" +
                       "Accepting an unverified certificate means\n" +
                       "you may not be connected with the host you tried to connect to.\n" +
@@ -689,6 +694,68 @@ ApplicationWindow {
             visible = certErrors.length > 0
         }
     }
+    Dialog {
+        id: featurePermissionDialog
+        anchors.centerIn: parent
+        width: Math.min(browserWindow.width, browserWindow.height) / 3 * 2
+        contentWidth: mainTextForPermissionDialog.width
+        contentHeight: mainTextForPermissionDialog.height
+        standardButtons: Dialog.No | Dialog.Yes
+        title: "Permission Request"
+
+        property var feature;
+        property url securityOrigin;
+
+        contentItem: Item {
+            Label {
+                id: mainTextForPermissionDialog
+                text: featurePermissionDialog.questionForFeature()
+            }
+        }
+
+        onAccepted: currentWebView && currentWebView.grantFeaturePermission(securityOrigin, feature, true)
+        onRejected: currentWebView && currentWebView.grantFeaturePermission(securityOrigin, feature, false)
+        onVisibleChanged: {
+            if (visible)
+                width = contentWidth + 20;
+        }
+
+        function questionForFeature() {
+            var question = "Allow " + securityOrigin + " to "
+
+            switch (feature) {
+            case WebEngineView.Geolocation:
+                question += "access your location information?";
+                break;
+            case WebEngineView.MediaAudioCapture:
+                question += "access your microphone?";
+                break;
+            case WebEngineView.MediaVideoCapture:
+                question += "access your webcam?";
+                break;
+            case WebEngineView.MediaVideoCapture:
+                question += "access your microphone and webcam?";
+                break;
+            case WebEngineView.MouseLock:
+                question += "lock your mouse cursor?";
+                break;
+            case WebEngineView.DesktopVideoCapture:
+                question += "capture video of your desktop?";
+                break;
+            case WebEngineView.DesktopAudioVideoCapture:
+                question += "capture audio and video of your desktop?";
+                break;
+            case WebEngineView.Notifications:
+                question += "show notification on your desktop?";
+                break;
+            default:
+                question += "access unknown or unsupported feature [" + feature + "] ?";
+                break;
+            }
+
+            return question;
+        }
+    }
 
     FullScreenNotification {
         id: fullScreenNotification
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index b1910df953e..ee94e0fd72f 100644
--- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -91,6 +91,31 @@
     \skipto Dialog {
     \printuntil /^\ {4}\}/
 
+    \section1 Handling Feature Permission Requests
+
+    We use the \c onFeaturePermissionRequested() signal handler to handle requests for
+    accessing a certain feature or device. The \c securityOrigin parameter identifies the
+    requester web site, and the \c feature parameter is the requested feature. We use these
+    to construct the message of the dialog:
+
+    \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+    \skipto onFeaturePermissionRequested
+    \printuntil }
+
+    We show a dialog where the user is asked to grant or deny access. The custom
+    \c questionForFeature() JavaScript function generates a human-readable question about
+    the request.
+    If users select \uicontrol Yes, we call the \l{WebEngineView::}{grantFeaturePermission()}
+    method with a third \c true parameter to grant the \c securityOrigin web site the permission
+    to access the \c feature.
+    If users select \uicontrol No, we call the same method but with the \c false parameter to
+    deny access:
+
+    \skipto id: sslDialog
+    \skipto Dialog {
+    \printuntil /^\ {4}\}/
+
+
     \section1 Entering and Leaving Fullscreen Mode
 
     We create a menu item for allowing fullscreen mode in a settings menu that we place on the tool

From 1c34210c54676eb8152101b0dafc5e18b3f60023 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 30 Jan 2023 14:51:39 +0100
Subject: [PATCH 058/681] QuickNanoBrowser: Remove usage of Quota Permission
 Request API

This amends commit 8fd7140082e3a752ca80882a29128ffc12d12fa4

Task-number: QTBUG-56354
Change-Id: I82803cf9bfab1ed5a07494ecce86722b634c204c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4f1bd9dbd41aaf6555604626f15a1923fd82267a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/quicknanobrowser/BrowserWindow.qml | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
index 9df7488c004..a517c5a5113 100644
--- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -559,13 +559,6 @@ ApplicationWindow {
                     request.accept();
                 }
 
-                onQuotaRequested: function(request) {
-                    if (request.requestedSize <= 5 * 1024 * 1024)
-                        request.accept();
-                    else
-                        request.reject();
-                }
-
                 onRegisterProtocolHandlerRequested: function(request) {
                     console.log("accepting registerProtocolHandler request for "
                                 + request.scheme + " from " + request.origin);

From 1f121f558c30483552fe78a3989f4c096d404922 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Thu, 7 Apr 2022 16:55:44 +0200
Subject: [PATCH 059/681] Fix navigation error for incomplete URLs in
 webenginequick examples

Use QUrl::fromUserInput in lifecycle and webengineaction examples.

Task-number: QTBUG-96010
Change-Id: I69cbcb1db31b0766d05f751b4aede11092d078d5
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 7f5f2d4f75f594a70d1be7ea4559e5c2ac1f560e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginequick/lifecycle/CMakeLists.txt   |  1 +
 examples/webenginequick/lifecycle/WebTab.qml  |  2 +-
 .../lifecycle/doc/src/lifecycle.qdoc          |  3 +++
 .../webenginequick/lifecycle/lifecycle.pro    |  1 +
 examples/webenginequick/lifecycle/main.cpp    |  6 ++++-
 examples/webenginequick/lifecycle/utils.h     | 25 +++++++++++++++++++
 .../webengineaction/CMakeLists.txt            |  1 +
 .../doc/src/webengineaction.qdoc              |  3 +++
 .../webenginequick/webengineaction/main.cpp   |  6 +++++
 .../webenginequick/webengineaction/main.qml   |  2 +-
 .../webenginequick/webengineaction/utils.h    | 25 +++++++++++++++++++
 .../webengineaction/webengineaction.pro       |  1 +
 12 files changed, 73 insertions(+), 3 deletions(-)
 create mode 100644 examples/webenginequick/lifecycle/utils.h
 create mode 100644 examples/webenginequick/webengineaction/utils.h

diff --git a/examples/webenginequick/lifecycle/CMakeLists.txt b/examples/webenginequick/lifecycle/CMakeLists.txt
index 1aea57c73c1..d0a378c13cf 100644
--- a/examples/webenginequick/lifecycle/CMakeLists.txt
+++ b/examples/webenginequick/lifecycle/CMakeLists.txt
@@ -16,6 +16,7 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui QuickControls2 WebEngineQuick)
 
 qt_add_executable(lifecycle
     main.cpp
+    utils.h
 )
 
 set_target_properties(lifecycle PROPERTIES
diff --git a/examples/webenginequick/lifecycle/WebTab.qml b/examples/webenginequick/lifecycle/WebTab.qml
index d805628ad06..6fb6cb38620 100644
--- a/examples/webenginequick/lifecycle/WebTab.qml
+++ b/examples/webenginequick/lifecycle/WebTab.qml
@@ -132,7 +132,7 @@ ColumnLayout {
                 text: view.url == "about:blank" ? "" : view.url
                 selectByMouse: true
 
-                onAccepted: { view.url = text }
+                onAccepted: { view.url = utils.fromUserInput(text) }
             }
             WebToolButton {
                 text: "⋮"
diff --git a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
index b28e3e2729c..4d997b1c407 100644
--- a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
+++ b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
@@ -31,6 +31,9 @@
     window also has a \l {Drawer} for changing settings. The drawer can be
     opened by clicking the "⋮" button on the tool bar.
 
+    \note Note that \c {WebTab.qml} uses \l {QUrl::}
+    {fromUserInput} to handle incomplete URLs.
+
     \section1 Lifecycle States in the Example
 
     The example implements two ways of changing the lifecycle state: manual and
diff --git a/examples/webenginequick/lifecycle/lifecycle.pro b/examples/webenginequick/lifecycle/lifecycle.pro
index ccbe801f315..044d025d7cd 100644
--- a/examples/webenginequick/lifecycle/lifecycle.pro
+++ b/examples/webenginequick/lifecycle/lifecycle.pro
@@ -2,6 +2,7 @@ TEMPLATE = app
 
 QT += quickcontrols2 webenginequick
 
+HEADERS += utils.h
 SOURCES += main.cpp
 
 RESOURCES += resources.qrc
diff --git a/examples/webenginequick/lifecycle/main.cpp b/examples/webenginequick/lifecycle/main.cpp
index 3601bdf5ce2..1f45ad0ee03 100644
--- a/examples/webenginequick/lifecycle/main.cpp
+++ b/examples/webenginequick/lifecycle/main.cpp
@@ -1,6 +1,8 @@
-// Copyright (C) 2019 The Qt Company Ltd.
+// Copyright (C) 2022 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
+#include "utils.h"
+
 #include <QGuiApplication>
 #include <QQmlApplicationEngine>
 #include <QQmlContext>
@@ -12,6 +14,8 @@ int main(int argc, char *argv[])
     QtWebEngineQuick::initialize();
     QGuiApplication app(argc, argv);
     QQmlApplicationEngine engine;
+    Utils utils;
+    engine.rootContext()->setContextProperty("utils", &utils);
     engine.load(QUrl(QStringLiteral("qrc:/WebBrowser.qml")));
     return app.exec();
 }
diff --git a/examples/webenginequick/lifecycle/utils.h b/examples/webenginequick/lifecycle/utils.h
new file mode 100644
index 00000000000..d9a80390763
--- /dev/null
+++ b/examples/webenginequick/lifecycle/utils.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QUrl>
+
+class Utils : public QObject
+{
+    Q_OBJECT
+public:
+    Q_INVOKABLE static QUrl fromUserInput(const QString &userInput);
+};
+
+inline QUrl Utils::fromUserInput(const QString &userInput)
+{
+    QFileInfo fileInfo(userInput);
+    if (fileInfo.exists())
+        return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
+    return QUrl::fromUserInput(userInput);
+}
+
+#endif // UTILS_H
diff --git a/examples/webenginequick/webengineaction/CMakeLists.txt b/examples/webenginequick/webengineaction/CMakeLists.txt
index e019bccf03e..94f03a14337 100644
--- a/examples/webenginequick/webengineaction/CMakeLists.txt
+++ b/examples/webenginequick/webengineaction/CMakeLists.txt
@@ -16,6 +16,7 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
 
 qt_add_executable(webengineaction
     main.cpp
+    utils.h
 )
 
 set_target_properties(webengineaction PROPERTIES
diff --git a/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc b/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
index 24394ad0416..272853aefef 100644
--- a/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
+++ b/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
@@ -41,4 +41,7 @@
     Assigning a \l{WebEngineAction} to multiple UI elements will keep them in sync.
     As it can be seen in the picture above, if the browser engine disables a
     navigation action, both corresponding menu items will be disabled.
+
+    \note Note that incomplete URLs in the navigation bar are handled by
+    \l {QUrl::} {fromUserInput}.
 */
diff --git a/examples/webenginequick/webengineaction/main.cpp b/examples/webenginequick/webengineaction/main.cpp
index e685a715cef..a7bfaaf366b 100644
--- a/examples/webenginequick/webengineaction/main.cpp
+++ b/examples/webenginequick/webengineaction/main.cpp
@@ -1,8 +1,11 @@
 // Copyright (C) 2018 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
+#include "utils.h"
+
 #include <QGuiApplication>
 #include <QQmlApplicationEngine>
+#include <QQmlContext>
 #include <QtWebEngineQuick/qtwebenginequickglobal.h>
 
 int main(int argc, char *argv[])
@@ -13,6 +16,9 @@ int main(int argc, char *argv[])
     QGuiApplication app(argc, argv);
 
     QQmlApplicationEngine engine;
+    Utils utils;
+
+    engine.rootContext()->setContextProperty("utils", &utils);
     engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
 
     return app.exec();
diff --git a/examples/webenginequick/webengineaction/main.qml b/examples/webenginequick/webengineaction/main.qml
index 149484340bf..a1483b126f1 100644
--- a/examples/webenginequick/webengineaction/main.qml
+++ b/examples/webenginequick/webengineaction/main.qml
@@ -50,7 +50,7 @@ ApplicationWindow {
 
                 text: webEngineView.url
                 selectByMouse: true
-                onEditingFinished: webEngineView.url = text
+                onEditingFinished: webEngineView.url = utils.fromUserInput(text)
             }
 
             ToolButton {
diff --git a/examples/webenginequick/webengineaction/utils.h b/examples/webenginequick/webengineaction/utils.h
new file mode 100644
index 00000000000..d9a80390763
--- /dev/null
+++ b/examples/webenginequick/webengineaction/utils.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QUrl>
+
+class Utils : public QObject
+{
+    Q_OBJECT
+public:
+    Q_INVOKABLE static QUrl fromUserInput(const QString &userInput);
+};
+
+inline QUrl Utils::fromUserInput(const QString &userInput)
+{
+    QFileInfo fileInfo(userInput);
+    if (fileInfo.exists())
+        return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
+    return QUrl::fromUserInput(userInput);
+}
+
+#endif // UTILS_H
diff --git a/examples/webenginequick/webengineaction/webengineaction.pro b/examples/webenginequick/webengineaction/webengineaction.pro
index 7ef0a8bcf39..223109eb9a2 100644
--- a/examples/webenginequick/webengineaction/webengineaction.pro
+++ b/examples/webenginequick/webengineaction/webengineaction.pro
@@ -2,6 +2,7 @@ TEMPLATE = app
 
 QT += webenginequick
 
+HEADERS += utils.h
 SOURCES += main.cpp
 
 RESOURCES += qml.qrc

From e39779e9116a410672acf508727fa8a3369656b4 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 2 Feb 2023 04:40:00 +0000
Subject: [PATCH 060/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I2329bddbc810dd8ac3f4762a893ac60f3997c585
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 858dda94e91..34a92543b26 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 99606d9eca4c4784960d03dbd95deb71fd43243c
+    ref: 67322c08fd1363f8b57d168f25301c9a2b53586d
     required: true
   ../qtpositioning:
-    ref: b79de5e8220e2f7993339fb45e54573f7437d92c
+    ref: 6f84cf50a0d25feb80cfe83e0bea8c45bf4eca6d
     required: false
   ../qttools:
-    ref: 1457c684742909271edb1bad9f27a06c6796ddd1
+    ref: 8314a480003dcdfebb2111a98d497cbf0ce41b02
     required: false
   ../qtwebchannel:
-    ref: 68a079b016dbd6dad8a38cf4fd4ec8161c4f004e
+    ref: f53e841d36296242664bb4e2f82db9e42e0824af
     required: false

From b03bf98e11bf4a515da49f2314056e0005f60db8 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 23 Jan 2023 11:22:49 +0100
Subject: [PATCH 061/681] Replace QtWebEngineCore::initialize() with
 QtWebEngineQuick::initialize() in error messages

Also fix typos.

Change-Id: I6e505102dc2241e4e00b181d0c4a097af4a40d35
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a4cebe374b59f2e30074deac625529820d475130)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/ozone/gl_context_qt.cpp       | 3 ++-
 src/core/ozone/gl_share_context_qt.cpp | 6 +++---
 src/core/web_engine_context.cpp        | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 75f8e842265..08d626063be 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -27,7 +27,8 @@ inline void *resourceForContext(const QByteArray &resource)
 #if QT_CONFIG(opengl)
     QOpenGLContext *shareContext = qt_gl_global_share_context();
     if (!shareContext) {
-        qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngineCore::initialize() in your main() function.");
+        qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to "
+               "call QtWebEngineQuick::initialize() in your main() function.");
     }
     return qApp->platformNativeInterface()->nativeResourceForContext(resource, shareContext);
 #else
diff --git a/src/core/ozone/gl_share_context_qt.cpp b/src/core/ozone/gl_share_context_qt.cpp
index 1ed5a48e49a..086317b4640 100644
--- a/src/core/ozone/gl_share_context_qt.cpp
+++ b/src/core/ozone/gl_share_context_qt.cpp
@@ -42,7 +42,7 @@ QtShareGLContext::QtShareGLContext(QOpenGLContext *context)
         m_handle = (void *)egl_ctx->nativeContext();
 #endif
     if (!m_handle)
-        qFatal("Could not get handle for shared contex");
+        qFatal("Could not get handle for shared context.");
 #endif // QT_CONFIG(opengl)
 }
 
@@ -65,8 +65,8 @@ void ShareGroupQt::AboutToAddFirstContext()
     QOpenGLContext *shareContext = QOpenGLContext::globalShareContext();
     if (!shareContext) {
         qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to "
-               "call QtWebEngineCore::initialize() in your main() function before QCoreApplication is "
-               "created.");
+               "call QtWebEngineQuick::initialize() in your main() function before "
+               "QCoreApplication is created.");
     }
     m_shareContextQt = new QtShareGLContext(shareContext);
 #endif
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 50dcde63694..57be8b2f10f 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -187,7 +187,7 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
         return glType;
 
     if (!qt_gl_global_share_context() || !qt_gl_global_share_context()->isValid()) {
-        qWarning("WebEngineContext used before QtWebEngineCore::initialize() or OpenGL context "
+        qWarning("WebEngineContext is used before QtWebEngineQuick::initialize() or OpenGL context "
                  "creation failed.");
         return glType;
     }

From a186d29d96592fb00966599aaecd5c9d98445d96 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 2 Feb 2023 11:45:16 +0100
Subject: [PATCH 062/681] Update Chromium

Pulls in following patches:

* a99ba129737  [Backport] CVE-2023-0474: Use after free in GuestView
* 05ea098dd34  [Backport] CVE-2023-0473: Type Confusion in ServiceWorker
  API
* 163ca80e46f  [Backport] CVE-2023-0472: Use after free in WebRTC
* c033e30b908  [Backport] CVE-2023-0471: Use after free in WebTransport
* 23b96f58c5e  [Backport] Security bug 1406115
* c67083d788a  [Backport] Security bug 1404811
* 1c46e13f96b  Adapt DevToolsUIBindings for WebEngine
* 9e1092cefd7  FIXUP: Fixes for jumbo build
* f088c97075a  Do not override getaddrinfo in libc_interceptor
* be1ee6225d0  Drop dependency on content/public/browser in content gpu

Change-Id: I0af3a1f12a315fc4756d9463d3837de87db888b0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f385f8107667d2c59358b32b0251bad07b5fce9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 0b138dc30d0..a99ba129737 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 0b138dc30d0aec7930c76a2595065629948ad9f7
+Subproject commit a99ba1297376043364ce9677c86017b99e124419

From c74159dc5ce1b42435202c79d21e1d7506f42266 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 24 Jan 2023 17:50:13 +0100
Subject: [PATCH 063/681] Move out GetInProcessGpuShareGroup form content
 browser client

Keeping the GetInProcessGpuShareGroup in content browser client
creates dependency from gpu_child_thread to content browser,
however gn build tree asserts when content/public/gpu depends on
content/public/browser as it breaks intended components dependency.
This worked so far as required headers in content browser client
got generated on time despite of missing dependency.

Fix the dependency tree and move the problematic function into
the content gpu client.

Change-Id: Iedcbc8c3c7d1754d1937e6b2c2a470c0e489a597
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9739cc64c90e3852216f38fb15f04ba4477d0c39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/compositor/content_gpu_client_qt.cpp |  9 ++++++++-
 src/core/compositor/content_gpu_client_qt.h   |  9 +++++++++
 src/core/content_browser_client_qt.cpp        | 18 ------------------
 src/core/content_browser_client_qt.h          |  7 -------
 4 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp
index 4c022dc7f0b..9f3b00bb861 100644
--- a/src/core/compositor/content_gpu_client_qt.cpp
+++ b/src/core/compositor/content_gpu_client_qt.cpp
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
 #include "content_gpu_client_qt.h"
-
+#include "ozone/gl_share_context_qt.h"
 #include "web_engine_context.h"
 
 namespace QtWebEngineCore {
@@ -20,4 +20,11 @@ gpu::SyncPointManager *ContentGpuClientQt::GetSyncPointManager()
     return WebEngineContext::syncPointManager();
 }
 
+gl::GLShareGroup *ContentGpuClientQt::GetInProcessGpuShareGroup()
+{
+    if (!m_shareGroupQt.get())
+        m_shareGroupQt = new ShareGroupQt;
+    return m_shareGroupQt.get();
+}
+
 } // namespace
diff --git a/src/core/compositor/content_gpu_client_qt.h b/src/core/compositor/content_gpu_client_qt.h
index 75d9d68be5a..150c257ae82 100644
--- a/src/core/compositor/content_gpu_client_qt.h
+++ b/src/core/compositor/content_gpu_client_qt.h
@@ -5,7 +5,12 @@
 
 #include "content/public/gpu/content_gpu_client.h"
 
+namespace gl {
+class GLShareGroup;
+}
+
 namespace QtWebEngineCore {
+class ShareGroupQt;
 
 class ContentGpuClientQt : public content::ContentGpuClient {
 public:
@@ -14,6 +19,10 @@ class ContentGpuClientQt : public content::ContentGpuClient {
 
     // content::ContentGpuClient implementation.
     gpu::SyncPointManager *GetSyncPointManager() override;
+    gl::GLShareGroup *GetInProcessGpuShareGroup() override;
+
+private:
+    scoped_refptr<ShareGroupQt> m_shareGroupQt;
 };
 
 }
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 553228ffcd5..77e23486423 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -70,7 +70,6 @@
 #include "net/proxying_restricted_cookie_manager_qt.h"
 #include "net/proxying_url_loader_factory_qt.h"
 #include "net/system_network_context_manager.h"
-#include "ozone/gl_share_context_qt.h"
 #include "platform_notification_service_qt.h"
 #include "profile_qt.h"
 #include "profile_io_data_qt.h"
@@ -88,11 +87,6 @@
 #include "api/qwebenginecookiestore_p.h"
 #include "api/qwebengineurlrequestinfo_p.h"
 
-#if QT_CONFIG(opengl)
-#include <QOpenGLContext>
-#include <QOpenGLExtraFunctions>
-#endif
-
 #if QT_CONFIG(webengine_geolocation)
 #include "base/memory/ptr_util.h"
 #include "location_provider_qt.h"
@@ -160,11 +154,6 @@
 
 #include <QGuiApplication>
 #include <QStandardPaths>
-#include <qpa/qplatformnativeinterface.h>
-
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-QT_END_NAMESPACE
 
 // Implement IsHandledProtocol as declared in //url/url_util_qt.h.
 namespace url {
@@ -260,13 +249,6 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost
     renderer_configuration->SetInitialConfiguration(is_incognito_process);
 }
 
-gl::GLShareGroup *ContentBrowserClientQt::GetInProcessGpuShareGroup()
-{
-    if (!m_shareGroupQt.get())
-        m_shareGroupQt = new ShareGroupQt;
-    return m_shareGroupQt.get();
-}
-
 content::MediaObserver *ContentBrowserClientQt::GetMediaObserver()
 {
     return MediaCaptureDevicesDispatcher::GetInstance();
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index b81b96ce1ce..87e48db5a2e 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -28,14 +28,9 @@ namespace device {
 class GeolocationManager;
 } // namespace device
 
-namespace gl {
-class GLShareGroup;
-}
-
 namespace QtWebEngineCore {
 
 class BrowserMainPartsQt;
-class ShareGroupQt;
 
 class ContentBrowserClientQt : public content::ContentBrowserClient
 {
@@ -44,7 +39,6 @@ class ContentBrowserClientQt : public content::ContentBrowserClient
     ~ContentBrowserClientQt();
     std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(bool is_integration_test) override;
     void RenderProcessWillLaunch(content::RenderProcessHost *host) override;
-    gl::GLShareGroup* GetInProcessGpuShareGroup() override;
     content::MediaObserver* GetMediaObserver() override;
     void OverrideWebkitPrefs(content::WebContents *web_contents,
                              blink::web_pref::WebPreferences *prefs) override;
@@ -240,7 +234,6 @@ class ContentBrowserClientQt : public content::ContentBrowserClient
     std::string GetProduct() override;
 
 private:
-    scoped_refptr<ShareGroupQt> m_shareGroupQt;
     BrowserMainPartsQt *m_browserMainParts = nullptr;
 };
 

From 2b26a369ac9e31b2e06829997341d1e5f7fc00af Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 3 Feb 2023 10:04:36 +0100
Subject: [PATCH 064/681] Blacklist tests blocking integrations

Task-number: QTBUG-110578
Change-Id: Ic063d08246351709d02642abc0747b5fbe9e2ef7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 585cf7cc793bb25158c2cf72fe61e7894ef9de11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/widgets/qwebenginepage/BLACKLIST | 3 +++
 tests/auto/widgets/qwebengineview/BLACKLIST | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST
index 7eb97b3bba7..66c5de42c7e 100644
--- a/tests/auto/widgets/qwebenginepage/BLACKLIST
+++ b/tests/auto/widgets/qwebenginepage/BLACKLIST
@@ -13,3 +13,6 @@ macos
 
 [comboBoxPopupPositionAfterChildMove]
 macos
+
+[backgroundColor]
+macos
diff --git a/tests/auto/widgets/qwebengineview/BLACKLIST b/tests/auto/widgets/qwebengineview/BLACKLIST
index 5d9cc038a35..356f9c9b0c2 100644
--- a/tests/auto/widgets/qwebengineview/BLACKLIST
+++ b/tests/auto/widgets/qwebengineview/BLACKLIST
@@ -9,3 +9,5 @@ windows
 
 [horizontalScrollbarTest]
 b2qt # different scrollbar
+macos
+rhel # flaky

From a09ebdd1a722643384b40bdc177a60ee74a30390 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 8 Feb 2023 11:10:59 +0100
Subject: [PATCH 065/681] Add check for system ffmpeg compatibility

Chromium uses the 'first_dts' field from AVStream that has
been moved out from public api in ffmpeg 5.0.
Although some packagers patch their ffmpeg to be compatible
with chromium.
Add compile time check to test compatibility.

Task-number: QTBUG-110749
Change-Id: I7658b9b12cb5122b6485f063edc3280f31fe9273
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7e46ff40ab66cd480b3eb9d82594f402dd8b563e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index 8e1499f2676..2119e01954a 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -49,7 +49,7 @@ if(PkgConfig_FOUND)
     pkg_check_modules(LCMS2 lcms2)
     pkg_check_modules(FREETYPE freetype2 IMPORTED_TARGET)
     pkg_check_modules(LIBXML2 libxml-2.0 libxslt IMPORTED_TARGET)
-    pkg_check_modules(FFMPEG libavcodec libavformat libavutil)
+    pkg_check_modules(FFMPEG libavcodec libavformat libavutil IMPORTED_TARGET)
     pkg_check_modules(OPUS opus>=1.3.1)
     pkg_check_modules(VPX vpx>=1.10.0 IMPORTED_TARGET)
     pkg_check_modules(LIBPCI libpci)
@@ -205,6 +205,25 @@ int main(void){
 }"
 )
 
+qt_config_compile_test(libavformat
+    LABEL "libavformat"
+    LIBRARIES
+        PkgConfig::FFMPEG
+    CODE
+"
+#include \"libavformat/version.h\"
+extern \"C\" {
+#include \"libavformat/avformat.h\"
+}
+int main(void) {
+#if LIBAVFORMAT_VERSION_MAJOR >= 59
+    AVStream stream;
+    auto first_dts = av_stream_get_first_dts(&stream);
+#endif
+    return 0;
+}"
+)
+
 #### Features
 
 qt_feature("qtwebengine-build" PUBLIC
@@ -525,6 +544,11 @@ add_check_for_support(
    CONDITION NOT LINUX OR DBUS_FOUND
    MESSAGE "Build requires dbus."
 )
+add_check_for_support(
+    MODULES QtWebEngine
+    CONDITION NOT LINUX OR NOT QT_FEATURE_webengine_system_ffmpeg OR TEST_libavformat
+    MESSAGE "Unmodified ffmpeg >= 5.0 is not supported."
+)
 # FIXME: This prevents non XCB Linux builds from building:
 set(xcbSupport X11 LIBDRM XCOMPOSITE XCURSOR XRANDR XI XPROTO XSHMFENCE XTST)
 foreach(xs ${xcbSupport})

From c5dfe4c9413cf0bb348ce0f86148404aa195419f Mon Sep 17 00:00:00 2001
From: Amir Masoud Abdol <amirmasoudabdol@icloud.com>
Date: Wed, 11 Jan 2023 18:53:09 +0100
Subject: [PATCH 066/681] Retire the qt_parse_all_arguments

To do so, we need to deal with the macros a bit differently, so here, I
replaced the macros with available utility functions, and added one for
the QTWEBENGINEPROCESS_NAME.

Fixes: QTBUG-110873
Task-number: QTBUG-99238
Change-Id: I29b41ffb8059511d2d93bfc01d40308aedaa8ad4
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 1f4fdb06b13f0a9400f16313aad9296f019d2fc9)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
---
 cmake/Functions.cmake                         | 35 +++++++++++++------
 src/core/CMakeLists.txt                       |  6 ++--
 src/core/api/qtwebenginecoreglobal.h          |  1 +
 src/core/content_browser_client_qt.cpp        |  4 ++-
 src/core/web_engine_context.cpp               | 13 +++++--
 src/core/web_engine_library_info.cpp          | 13 +++----
 src/pdf/CMakeLists.txt                        |  2 +-
 .../pdfquick/multipageview/CMakeLists.txt     |  4 +--
 8 files changed, 52 insertions(+), 26 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index bd892ee20af..04f32d2c6bd 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -2,9 +2,11 @@
 # SPDX-License-Identifier: BSD-3-Clause
 
 function(assertTargets)
-    qt_parse_all_arguments(arg "add_check_for_support"
-        "" "" "MODULES;TARGETS" "${ARGN}"
+    cmake_parse_arguments(PARSE_ARGV 0 arg
+        "" "" "MODULES;TARGETS"
     )
+    _qt_internal_validate_all_args_are_parsed(arg)
+
     foreach(module ${arg_MODULES})
         if(NOT DEFINED ${module}_SUPPORT)
             set(${module}_SUPPORT ON PARENT_SCOPE)
@@ -36,9 +38,11 @@ endfunction()
 
 # TODO: this should be idealy in qtbase
 function(add_check_for_support)
-    qt_parse_all_arguments(arg "add_check_for_support"
-        "" "" "MODULES;MESSAGE;CONDITION" "${ARGN}"
+    cmake_parse_arguments(PARSE_ARGV 0 arg
+        "" "" "MODULES;MESSAGE;CONDITION"
     )
+    _qt_internal_validate_all_args_are_parsed(arg)
+
     foreach(module ${arg_MODULES})
         if(NOT DEFINED ${module}_SUPPORT)
             set(${module}_SUPPORT ON PARENT_SCOPE)
@@ -181,7 +185,9 @@ endmacro()
 
 function(extend_gn_target target)
     get_target_property(elements ${target} ELEMENTS)
-    qt_parse_all_arguments(GN "extend_gn_target" "" "" "CONDITION;${elements}" "${ARGN}")
+    cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "CONDITION;${elements}")
+    _qt_internal_validate_all_args_are_parsed(GN)
+
     if("x${GN_CONDITION}" STREQUAL x)
         set(GN_CONDITION ON)
     endif()
@@ -193,7 +199,9 @@ function(extend_gn_target target)
 endfunction()
 
 function(extend_gn_list outList)
-    qt_parse_all_arguments(GN "extend_gn_list" "" "" "ARGS;CONDITION" "${ARGN}")
+    cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARGS;CONDITION")
+    _qt_internal_validate_all_args_are_parsed(GN)
+
     if("x${GN_CONDITION}" STREQUAL x)
         set(GN_CONDITION ON)
     endif()
@@ -741,7 +749,9 @@ function(extract_cflag result cflag)
 endfunction()
 
 function(extend_gn_list_cflag outList)
-    qt_parse_all_arguments(GN "extend_gn_list_cflag" "" "" "ARG;CFLAG" "${ARGN}")
+    cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARG;CFLAG")
+    _qt_internal_validate_all_args_are_parsed(GN)
+
     extract_cflag(cflag "${GN_CFLAG}")
     if(cflag)
         set(${outList} "${${outList}}" "${GN_ARG}=\"${cflag}\"" PARENT_SCOPE)
@@ -1040,9 +1050,11 @@ macro(append_pkg_config_setup)
 endmacro()
 
 function(add_ninja_command)
-    qt_parse_all_arguments(arg "add_ninja_command"
-        "" "TARGET;OUTPUT;BUILDDIR;MODULE" "BYPRODUCTS" "${ARGN}"
+    cmake_parse_arguments(PARSE_ARGV 0 arg
+        "" "TARGET;OUTPUT;BUILDDIR;MODULE" "BYPRODUCTS"
     )
+    _qt_internal_validate_all_args_are_parsed(arg)
+
     string(REPLACE " " ";" NINJAFLAGS "$ENV{NINJAFLAGS}")
     list(TRANSFORM arg_BYPRODUCTS PREPEND "${arg_BUILDDIR}/")
     add_custom_command(
@@ -1141,9 +1153,10 @@ function(get_config_filenames c_config cxx_config static_config target_config)
 endfunction()
 
 function(add_gn_command)
-    qt_parse_all_arguments(arg "add_gn_command"
-        "" "CMAKE_TARGET;GN_TARGET;MODULE;BUILDDIR" "NINJA_TARGETS;GN_ARGS" "${ARGN}"
+    cmake_parse_arguments(PARSE_ARGV 0 arg
+        "" "CMAKE_TARGET;GN_TARGET;MODULE;BUILDDIR" "NINJA_TARGETS;GN_ARGS"
     )
+    _qt_internal_validate_all_args_are_parsed(arg)
 
     get_config_filenames(cConfigFileName cxxConfigFileName staticConfigFileName targetConfigFileName)
     set(gnArgArgFile ${arg_BUILDDIR}/args.gn)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index fa8a7d18a37..3b5d941486e 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -69,8 +69,8 @@ foreach(arch ${archs})
             DEFINES
                 QT_NO_KEYWORDS
                 QT_USE_QSTRINGBUILDER
-                QTWEBENGINECORE_VERSION_STR=\\\\\\\\\"${QT_REPO_MODULE_VERSION}\\\\\\\\\"
-                QTWEBENGINEPROCESS_NAME=\\\\\\\\\"${qtWebEngineProcessName}\\\\\\\\\"
+                QTWEBENGINECORE_VERSION_STR=${QT_REPO_MODULE_VERSION}
+                QTWEBENGINEPROCESS_NAME=${qtWebEngineProcessName}
                 BUILDING_CHROMIUM
                 "${forwardDeclarationMacro}"
             CXX_COMPILE_OPTIONS
@@ -503,7 +503,7 @@ foreach(arch ${archs})
             CMAKE_TARGET WebEngineCore
             NINJA_TARGETS QtWebEngineCore convert_dict
             GN_TARGET ${buildGn}
-            GN_ARGS "${gnArgArg}"
+            GN_ARGS ${gnArgArg}
             BUILDDIR ${buildDir}/${config}/${arch}
             MODULE core
         )
diff --git a/src/core/api/qtwebenginecoreglobal.h b/src/core/api/qtwebenginecoreglobal.h
index 305040808f6..3583e084850 100644
--- a/src/core/api/qtwebenginecoreglobal.h
+++ b/src/core/api/qtwebenginecoreglobal.h
@@ -18,6 +18,7 @@ QT_BEGIN_NAMESPACE
 #define ASSERT_ENUMS_MATCH(A, B) Q_STATIC_ASSERT_X(static_cast<int>(A) == static_cast<int>(B), "The enum values must match");
 
 Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineVersion() noexcept;
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineProcessName() noexcept;
 Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumVersion() noexcept;
 Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumSecurityPatchVersion() noexcept;
 
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 77e23486423..bf39ebe2f2e 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -960,7 +960,9 @@ void ContentBrowserClientQt::OverrideURLLoaderFactoryParams(content::BrowserCont
 std::string ContentBrowserClientQt::getUserAgent()
 {
     // Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
-    return content::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION);
+    return content::BuildUserAgentFromProduct("QtWebEngine/" + std::string(qWebEngineVersion())
+                                              + " Chrome/"
+                                              + std::string(qWebEngineChromiumVersion()));
 }
 
 blink::UserAgentMetadata ContentBrowserClientQt::getUserAgentMetadata()
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 57be8b2f10f..80cdc9165a6 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -117,6 +117,9 @@ Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
 QT_END_NAMESPACE
 #endif
 
+#define STRINGIFY_LITERAL(x) #x
+#define STRINGIFY_EXPANDED(x) STRINGIFY_LITERAL(x)
+
 namespace QtWebEngineCore {
 
 Q_LOGGING_CATEGORY(webEngineContextLog, "qt.webenginecontext")
@@ -897,13 +900,19 @@ bool WebEngineContext::closingDown()
 QT_BEGIN_NAMESPACE
 const char *qWebEngineVersion() noexcept
 {
-    return QTWEBENGINECORE_VERSION_STR;
+    return STRINGIFY_EXPANDED(QTWEBENGINECORE_VERSION_STR);
+}
+
+const char *qWebEngineProcessName() noexcept
+{
+    return STRINGIFY_EXPANDED(QTWEBENGINEPROCESS_NAME);
 }
 
 const char *qWebEngineChromiumVersion() noexcept
 {
-    return CHROMIUM_VERSION;
+    return STRINGIFY_EXPANDED(CHROMIUM_VERSION);
 }
+
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
     return "108.0.5359.181"; // FIXME: Remember to update
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 588af5cc648..277317f6f41 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -57,7 +57,7 @@ static QString getBundlePath(CFBundleRef frameworkBundle)
     // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
     // We use it for the other OS X versions as well to make sure it works and because
     // the directory structure should be the same.
-    if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+    if (qApp->applicationName() == QLatin1String(qWebEngineProcessName())) {
         path = QDir::cleanPath(qApp->applicationDirPath() % QLatin1String("/../../../.."));
     } else if (frameworkBundle) {
         CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle);
@@ -75,7 +75,7 @@ static QString getResourcesPath(CFBundleRef frameworkBundle)
     // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
     // We use it for the other OS X versions as well to make sure it works and because
     // the directory structure should be the same.
-    if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+    if (qApp->applicationName() == QLatin1String(qWebEngineProcessName())) {
         path = getBundlePath(frameworkBundle) % QLatin1String("/Resources");
     } else if (frameworkBundle) {
         CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle);
@@ -121,9 +121,9 @@ QString subProcessPath()
     static QString processPath;
     if (processPath.isEmpty()) {
 #if defined(Q_OS_WIN)
-        const QString processBinary = QLatin1String(QTWEBENGINEPROCESS_NAME) % QLatin1String(".exe");
+        const QString processBinary = QLatin1String(qWebEngineProcessName()) % QLatin1String(".exe");
 #else
-        const QString processBinary = QLatin1String(QTWEBENGINEPROCESS_NAME);
+        const QString processBinary = QLatin1String(qWebEngineProcessName());
 #endif
 
         QStringList candidatePaths;
@@ -133,8 +133,9 @@ QString subProcessPath()
             candidatePaths << fromEnv;
         } else {
 #if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
-            candidatePaths << getBundlePath(frameworkBundle())
-                              % QStringLiteral("/Helpers/" QTWEBENGINEPROCESS_NAME ".app/Contents/MacOS/" QTWEBENGINEPROCESS_NAME);
+            candidatePaths << getBundlePath(frameworkBundle()) % QStringLiteral("/Helpers/")
+                            % qWebEngineProcessName() % QStringLiteral(".app/Contents/MacOS/")
+                            % qWebEngineProcessName();
 #else
             candidatePaths << QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)
                               % QLatin1Char('/') % processBinary;
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index de0d42a9486..5f082e9186a 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -189,7 +189,7 @@ foreach(arch ${archs})
             CMAKE_TARGET Pdf
             NINJA_TARGETS QtPdf
             GN_TARGET ${buildGn}
-            GN_ARGS "${gnArgArg}"
+            GN_ARGS ${gnArgArg}
             BUILDDIR ${buildDir}/${config}/${arch}
             MODULE pdf
         )
diff --git a/tests/auto/pdfquick/multipageview/CMakeLists.txt b/tests/auto/pdfquick/multipageview/CMakeLists.txt
index 283bebc7975..50f7d7d8f51 100644
--- a/tests/auto/pdfquick/multipageview/CMakeLists.txt
+++ b/tests/auto/pdfquick/multipageview/CMakeLists.txt
@@ -20,11 +20,11 @@ qt_internal_add_test(tst_multipageview
 
 qt_internal_extend_target(tst_multipageview CONDITION ANDROID OR IOS
     DEFINES
-        QT_QMLTEST_DATADIR=\\\":/data\\\"
+        QT_QMLTEST_DATADIR=":/data"
 )
 
 qt_internal_extend_target(tst_multipageview CONDITION NOT ANDROID AND NOT IOS
     DEFINES
-        QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
+        QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
 )
 

From c7d31776430aa31987da321f198ef5152dbaf49c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 10 Feb 2023 18:55:51 +0000
Subject: [PATCH 067/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I9ea3e8609c6bb090f7014bca05a9b20b293c623d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 34a92543b26..10794db174c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 67322c08fd1363f8b57d168f25301c9a2b53586d
+    ref: 5de1b78adde32c4830dad03e9056c02f975a7946
     required: true
   ../qtpositioning:
-    ref: 6f84cf50a0d25feb80cfe83e0bea8c45bf4eca6d
+    ref: 03c5064bc43e869af937eec27472d971e7287a45
     required: false
   ../qttools:
-    ref: 8314a480003dcdfebb2111a98d497cbf0ce41b02
+    ref: 47b2e3107e56440a9e0f57dc2f341aae38334cca
     required: false
   ../qtwebchannel:
-    ref: f53e841d36296242664bb4e2f82db9e42e0824af
+    ref: c608b8d85f7a02163adacce3eb46c999366d7358
     required: false

From 2489a43676466f9ffde2ecdcca15009b336b22e3 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 7 Feb 2023 12:15:04 +0100
Subject: [PATCH 068/681] Fix external ozone

Writing it like in chromium saving us a patch there

Change-Id: I98a769844871b6ed661519380f24068c1c0c25d9
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 5358dd0dca2f19e3b4d20fa98878c9d0038cf4ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/ozone/ozone_extra.gni | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/core/ozone/ozone_extra.gni b/src/core/ozone/ozone_extra.gni
index a832f741acb..191bb3787e5 100644
--- a/src/core/ozone/ozone_extra.gni
+++ b/src/core/ozone/ozone_extra.gni
@@ -17,3 +17,17 @@ ozone_external_platform_deps = []
 # so that they get included into ozone_unittests.
 # ozone_external_platform_test_deps = [ "platform/foo1:foo1_unitests", ... ]
 ozone_external_platform_test_deps = []
+
+# If a platform has integration tests, the corresponding source_set can be
+# listed here so that they get included into ozone_integration_tests.
+ozone_external_platform_integration_test_deps = []
+
+# If a platform has test support files for ui, the corresponding source_set can
+# be listed here so that they get included into ui_test_support.
+# ozone_external_platform_ui_test_support_deps = [ "platform/foo1:ui_test_support", ... ]
+ozone_external_platform_ui_test_support_deps = []
+
+# If a platform has a test support for interactive_ui_tests, the corresponding
+# source_set can be listed here so that they can included into
+# interactive_ui_tests.
+ozone_external_interactive_ui_tests_deps = []

From 6d2ed7646d91fca2f285f7998bc6fb84f071aa6a Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 13 Feb 2023 14:19:08 +0100
Subject: [PATCH 069/681] Add option to build using system OpenJPEG 2

Adds a check on Unix system for the presence of a system OpenJPEG 2
library and builds against it if present.

Task-number: QTBUG-63889
Change-Id: I9fd90c96d733154b912acf4e9c7f06c17a39b244
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 34337238826471f2229453320645d3124d8a51e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake         | 6 ++++++
 src/core/CMakeLists.txt | 2 +-
 src/pdf/CMakeLists.txt  | 4 ++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index 2119e01954a..7fcbbc04496 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -53,6 +53,7 @@ if(PkgConfig_FOUND)
     pkg_check_modules(OPUS opus>=1.3.1)
     pkg_check_modules(VPX vpx>=1.10.0 IMPORTED_TARGET)
     pkg_check_modules(LIBPCI libpci)
+    pkg_check_modules(LIBOPENJP2 libopenjp2)
 endif()
 
 if(Python3_EXECUTABLE)
@@ -328,6 +329,10 @@ qt_feature("webengine-system-libwebp" PRIVATE
     LABEL "libwebp, libwebpmux and libwebpdemux"
     CONDITION UNIX AND WEBP_FOUND
 )
+qt_feature("webengine-system-libopenjpeg2" PRIVATE
+    LABEL "libopenjpeg2"
+    CONDITION UNIX AND LIBOPENJP2_FOUND
+)
 qt_feature("webengine-system-opus" PRIVATE
     LABEL "opus"
     CONDITION UNIX AND OPUS_FOUND
@@ -636,6 +641,7 @@ if(UNIX)
     qt_configure_add_summary_entry(ARGS "webengine-system-lcms2")
     qt_configure_add_summary_entry(ARGS "webengine-system-libpng")
     qt_configure_add_summary_entry(ARGS "webengine-system-libjpeg")
+    qt_configure_add_summary_entry(ARGS "webengine-system-libopenjpeg2")
     qt_configure_add_summary_entry(ARGS "webengine-system-harfbuzz")
     qt_configure_add_summary_entry(ARGS "webengine-system-freetype")
     qt_configure_add_summary_entry(ARGS "webengine-system-libpci")
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 3b5d941486e..ddc870b2e7c 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -406,7 +406,7 @@ foreach(arch ${archs})
                 ozone_extra_path="${CMAKE_CURRENT_LIST_DIR}/ozone/ozone_extra.gni"
             )
             set(systemLibs libjpeg libpng freetype harfbuzz libevent libwebp libxml
-                opus snappy libvpx icu ffmpeg re2 lcms2
+                opus snappy libvpx icu ffmpeg re2 lcms2 libopenjpeg2
             )
             foreach(slib ${systemLibs})
                 extend_gn_list(gnArgArg
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 5f082e9186a..1d42ee7272c 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -123,6 +123,10 @@ foreach(arch ${archs})
                 ARGS use_system_icu
                 CONDITION QT_FEATURE_webengine_system_icu
             )
+            extend_gn_list(gnArgArg
+                ARGS use_system_libopenjpeg2
+                CONDITION QT_FEATURE_webengine_system_libopenjpeg2
+            )
         endif()
         if(MACOS)
             list(APPEND gnArgArg angle_enable_vulkan=false)

From c5fa577e80df69ab73f95820378c6ec3abede48d Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 14 Feb 2023 10:26:26 +0100
Subject: [PATCH 070/681] Update Chromium

Submodule src/3rdparty 8c839a298..331447653:
  > FIXUP: Adapt DevToolsUIBindings for WebEngine
  > FIXUP: Remove linking with libatomic
  > Fix build with enable_vulkan=false
  > FIXUP: Workaround debug iterator issues with MSVC

Change-Id: I95d7bc540aeb4f62354e0a547f3fe9dc08b72051
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 901a6b98b1c2eaf79a0b0e4082ac0703e28794e2)
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index a99ba129737..331447653d3 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit a99ba1297376043364ce9677c86017b99e124419
+Subproject commit 331447653d3031155df65822d856503d98fb8666

From 64d7668e8aa8a04066ed868efba39cc349a5e49e Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 13 Jan 2023 10:56:48 +0100
Subject: [PATCH 071/681] Set enable_vulkan=false for Chromium build if Vulkan
 is disabled

Change-Id: I98bce5dcf7f2c35b5ed3382be2e49340b134e355
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c008999211d1afa028cc3ab83b9418e4bffa8313)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index ddc870b2e7c..792ad7e1688 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -364,6 +364,10 @@ foreach(arch ${archs})
             ARGS enable_extensions
             CONDITION QT_FEATURE_webengine_extensions
         )
+        extend_gn_list(gnArgArg
+            ARGS enable_vulkan
+            CONDITION QT_FEATURE_webengine_vulkan
+        )
         extend_gn_list(gnArgArg
             ARGS use_kerberos
             CONDITION QT_FEATURE_webengine_kerberos

From c8e239992ddb112cb9a498a9f87d103a20d756fe Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 14 Feb 2023 10:28:13 +0100
Subject: [PATCH 072/681] Update Chromium

Submodule src/3rdparty 331447653..7e5ee9d6a:
  > Fix vaapi support for QtWebEngine
  > FIXUP: Qt GN integration
  > [Revert] Remove dependency on libgbm
  > [Revert] Avoid using libdrm
  > FIXUP: Fix building with system ffmpeg
  > FIXUP: Fix building with system ffmpeg 4.4 or 5.1
  > FIXUP: Fixes for jumbo build
  > FIXUP: Stop using C++20 initialization

Change-Id: I98fed6e23e55133946dcf3673ef74039d270f263
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit c727f23b7bc277a182258803bea9e6c0ce2462eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 331447653d3..7e5ee9d6aee 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 331447653d3031155df65822d856503d98fb8666
+Subproject commit 7e5ee9d6aee9eacedff4860f4c5965214df59538

From 9a8e2bcba472b4745f1035eb342343039fb9fdc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 7 Feb 2023 11:16:20 +0100
Subject: [PATCH 073/681] Update Chromium security backports version
 information

Change-Id: If905393d73892256175ac5059503a9fc4a6a32f6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b385e76b1fc60ce1f48d2b805a4a2d2a2b23d1bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 24999f47283..6eafcaa259d 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           108.0.5359.181
+Patched with security patches up to Chromium version:           109.0.5414.119
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 80cdc9165a6..bdf29e74aeb 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -915,7 +915,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "108.0.5359.181"; // FIXME: Remember to update
+    return "109.0.5414.119"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From bee8ab44cb3489fe27a9fb3d304b4c3cae9611d6 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Mon, 13 Feb 2023 16:49:24 +0100
Subject: [PATCH 074/681] Remove extra quotes from CHROMIUM_VERSION

This change unifies version macros and fixes
invalid 'ContentBrowserClientQt::getUserAgent' after
1f4fdb06b13f0a9400f16313aad9296f019d2fc9

Change-Id: I9df963a45f6d66c6b30c23d603afb335b6f25cce
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit c53fd87cf50e51e338d2f8e54f494a8dbab8d712)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/configure/BUILD.root.gn.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index d38e8497381..ebd35a996a2 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -109,7 +109,7 @@ shared_library("QtWebEngineCore") {
     "//third_party/boringssl/src/include",
     "//third_party/skia/include/core"
   ]
-  defines = [ "CHROMIUM_VERSION=\"" + chromium_version[0] + "\"" ]
+  defines = [ "CHROMIUM_VERSION=" + chromium_version[0] ]
   deps = [
     "//base",
     "//components/autofill/content/browser",

From ce18222f27e0507e6045e2d8f993a73614b5fae7 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 15 Feb 2023 16:36:11 +0100
Subject: [PATCH 075/681] Force to disable IPC logging

It is enabled by default in Chromium for debug build.
See //ipc/features.gni.

Disable it for debug build too because it adds and extra
SetIPCLoggingEnabled mojo message (see
//content/common/child_process.mojom) and it results different mojo
message ids for the debug and release binaries. This is undesirable
when setting QTWEBENGINEPROCESS_PATH environment variable to use release
QtWebEngineProcess with debug browser process or the other way around.

The messages and the corresponding ids can be listed by executing the
following command in the QtWebEngine build directory:
find . -name "*-message-ids.h" | xargs grep -h "constexpr uint32_t"

Task-number: QTBUG-110504
Change-Id: I80f24117ae20d02fb53ea482d04bea7a9dcb38c1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 114c6d0543e1ebe4ec12693b0d462ec05037e3a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 792ad7e1688..b1e99987eeb 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -300,6 +300,7 @@ foreach(arch ${archs})
             enable_background_contents=false
             enable_background_mode=false
             enable_ipc_fuzzer=false
+            enable_ipc_logging=false
             enable_js_type_check=false
             enable_media_remoting=false
             enable_message_center=false

From ef68a145b7cf2c515b0983bf4119b7b80723be5e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 17 Feb 2023 09:50:23 +0000
Subject: [PATCH 076/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Id3dd0ce4c6b99e0960996c8218efa7bb0b54195f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 10794db174c..07046a40148 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 5de1b78adde32c4830dad03e9056c02f975a7946
+    ref: 11a481301d2fb9fa59ade784a13691eec5daaf47
     required: true
   ../qtpositioning:
-    ref: 03c5064bc43e869af937eec27472d971e7287a45
+    ref: 077324f59ef5eb2ca7354b554c57b297b36ab924
     required: false
   ../qttools:
-    ref: 47b2e3107e56440a9e0f57dc2f341aae38334cca
+    ref: b37f3b41a4372c33908f7f1f1c72ea017385a253
     required: false
   ../qtwebchannel:
-    ref: c608b8d85f7a02163adacce3eb46c999366d7358
+    ref: 2eae52d2e45eee9e70bb6223420390a52b93f58a
     required: false

From 3494efe5d440f6c09ba70e1a46307465ce8e35b8 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 12 Jan 2023 13:06:11 +0100
Subject: [PATCH 077/681] Add missing foregin type for
 QWebEngineFileSystemAccessRequest

Add foregin type so it can be use within qml.

Change-Id: I8104874f2e898b170c8091a8fdeca450e59ae2a6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit cc30b803650102b19f0748b07d82f2929b53ebf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineforeigntypes_p.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index d8351c85599..5ea27850a8e 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -30,6 +30,7 @@
 #include <QtWebEngineCore/qwebenginefullscreenrequest.h>
 #include <QtWebEngineCore/qwebenginecontextmenurequest.h>
 #include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h>
+#include <QtWebEngineCore/qwebenginefilesystemaccessrequest.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -180,6 +181,15 @@ struct ForeignWebEngineFindTextResult
     QML_UNCREATABLE("")
 };
 
+struct ForeginWebEngineFileSystemAccessRequest
+{
+    Q_GADGET
+    QML_FOREIGN(QWebEngineFileSystemAccessRequest)
+    QML_NAMED_ELEMENT(WebEngineFileSystemAccessRequest)
+    QML_ADDED_IN_VERSION(6, 4)
+    QML_UNCREATABLE("")
+};
+
 QT_END_NAMESPACE
 
 #endif // QQUICKWEBENGINEFOREIGNTYPES_H

From 012dfa9d0dfe031510156c68ac572880ff7aaa95 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 21 Feb 2023 18:06:39 +0100
Subject: [PATCH 078/681] Fix uniqueId() for accessible events

QAccessibleEvent::uniqueId() expects child index to be set if the event
object is set. If the index is not explicitly set the event interprets the
unique ID as a child index what is invalid.

This change fixes warnings like:
 qt.accessibility.core: Invalid child in QAccessibleEvent:
 QObject(0x1cc9ec25d60, name = "search") child: -2147483017

In case of an invalid child, uniqueId() returns 0 and this causes assert
on macOS.

Task-number: QTBUG-105988
Change-Id: If068ab648226284bb3bd6502fc0381f4229d19e2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 442e347f592d389ff664f3b1cae466c3e2506d78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_manager_qt.cpp      | 14 ++++++++++++++
 .../render_widget_host_view_qt_delegate_item.cpp   |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index f891100364a..8aa245e6826 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -103,6 +103,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
     switch (event_type) {
     case ax::mojom::Event::kFocus: {
         QAccessibleEvent event(iface, QAccessible::Focus);
+        if (event.object())
+            event.setChild(-1);
         QAccessible::updateAccessibility(&event);
         break;
     }
@@ -110,6 +112,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
         QAccessible::State change;
         change.checked = true;
         QAccessibleStateChangeEvent event(iface, change);
+        if (event.object())
+            event.setChild(-1);
         QAccessible::updateAccessibility(&event);
         break;
     }
@@ -118,6 +122,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
         if (QAccessibleValueInterface *valueIface = iface->valueInterface())
             value = valueIface->currentValue();
         QAccessibleValueChangeEvent event(iface, value);
+        if (event.object())
+            event.setChild(-1);
         QAccessible::updateAccessibility(&event);
         break;
     }
@@ -129,6 +135,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
         break;
     case ax::mojom::Event::kTextChanged: {
         QAccessibleTextUpdateEvent event(iface, -1, QString(), QString());
+        if (event.object())
+            event.setChild(-1);
         QAccessible::updateAccessibility(&event);
         break;
     }
@@ -140,9 +148,13 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
             textIface->selection(0, &start, &end);
             if (start == end) {
                 QAccessibleTextCursorEvent event(iface, start);
+                if (event.object())
+                    event.setChild(-1);
                 QAccessible::updateAccessibility(&event);
             } else {
                 QAccessibleTextSelectionEvent event(iface, start, end);
+                if (event.object())
+                    event.setChild(-1);
                 QAccessible::updateAccessibility(&event);
             }
         }
@@ -166,6 +178,8 @@ void BrowserAccessibilityManagerQt::FireGeneratedEvent(ui::AXEventGenerator::Eve
     case ui::AXEventGenerator::Event::VALUE_IN_TEXT_FIELD_CHANGED:
         if (iface->role() == QAccessible::EditableText) {
             QAccessibleTextUpdateEvent event(iface, -1, QString(), QString());
+            if (event.object())
+                event.setChild(-1);
             QAccessible::updateAccessibility(&event);
         }
         break;
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index dd498ea0685..ae24450dbc4 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -204,6 +204,8 @@ void RenderWidgetHostViewQtDelegateItem::focusInEvent(QFocusEvent *event)
     if (QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(this)) {
         if (auto *focusChild = iface->focusChild()) {
             QAccessibleEvent focusEvent(focusChild, QAccessible::Focus);
+            if (focusEvent.object())
+                focusEvent.setChild(-1);
             QAccessible::updateAccessibility(&focusEvent);
         }
     }

From e3313f9b333beca991cb1b533733242dd59c8af5 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 28 Sep 2022 14:54:59 +0200
Subject: [PATCH 079/681] Refactor devtools frontend

Use chrome's UIBindings and message dispatcher.

Change-Id: I580b551153de8a0d34b70199c17a50df67237e73
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 73acb3b3e8e74b087409f856746c3454c717dfa7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/configure/BUILD.root.gn.in |  33 +-
 src/core/devtools_frontend_qt.cpp   | 680 +++-------------------------
 src/core/devtools_frontend_qt.h     | 111 ++---
 src/core/pref_service_adapter.cpp   |   9 +
 4 files changed, 130 insertions(+), 703 deletions(-)

diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index ebd35a996a2..af649d950ea 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -216,6 +216,32 @@ source_set("qtwebengine_spellcheck_sources") {
   }
 }
 
+source_set("devtools_sources") {
+  configs += [ ":cpp17_config" ]
+  deps = [
+    "//components/zoom",
+    "//third_party/blink/public/mojom:mojom_platform",
+    ]
+  sources = [
+     "//chrome/browser/devtools/devtools_eye_dropper.cc",
+     "//chrome/browser/devtools/devtools_eye_dropper.h",
+     "//chrome/browser/devtools/devtools_file_helper.cc",
+     "//chrome/browser/devtools/devtools_file_helper.h",
+     "//chrome/browser/devtools/devtools_file_system_indexer.cc",
+     "//chrome/browser/devtools/devtools_file_system_indexer.h",
+     "//chrome/browser/devtools/devtools_file_watcher.cc",
+     "//chrome/browser/devtools/devtools_file_watcher.h",
+     "//chrome/browser/devtools/url_constants.cc",
+     "//chrome/browser/devtools/url_constants.h",
+     "//chrome/browser/devtools/devtools_ui_bindings.cc",
+     "//chrome/browser/devtools/devtools_ui_bindings.h",
+     "//chrome/browser/devtools/devtools_settings.cc",
+     "//chrome/browser/devtools/devtools_settings.h",
+     "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
+     "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h",
+  ]
+}
+
 source_set("qtwebengine_sources") {
   configs += [
     ":cpp17_config",
@@ -223,6 +249,7 @@ source_set("qtwebengine_sources") {
     "//third_party/boringssl:external_config",
   ]
   deps = [
+    ":devtools_sources",
     "//build:branding_buildflags",
     "//build/config/chromebox_for_meetings:buildflags",
     "//chrome/browser:dev_ui_browser_resources_grit",
@@ -246,12 +273,6 @@ source_set("qtwebengine_sources") {
   sources = [
     "//chrome/browser/accessibility/accessibility_ui.cc",
     "//chrome/browser/accessibility/accessibility_ui.h",
-    "//chrome/browser/devtools/devtools_eye_dropper.cc",
-    "//chrome/browser/devtools/devtools_eye_dropper.h",
-    "//chrome/browser/devtools/devtools_file_helper.cc",
-    "//chrome/browser/devtools/devtools_file_helper.h",
-    "//chrome/browser/devtools/devtools_file_watcher.cc",
-    "//chrome/browser/devtools/devtools_file_watcher.h",
     "//chrome/browser/gcm/gcm_product_util.cc",
     "//chrome/browser/gcm/gcm_product_util.h",
     "//chrome/browser/gcm/gcm_profile_service_factory.cc",
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 73698e26373..8ac834c9ddf 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -8,171 +8,42 @@
 
 #include "devtools_frontend_qt.h"
 
-#include "profile_adapter.h"
 #include "profile_qt.h"
+#include "profile_adapter.h"
 #include "web_contents_adapter.h"
+#include "web_contents_delegate_qt.h"
 
-#include "base/base64.h"
-#include "base/json/json_reader.h"
-#include "base/json/json_writer.h"
-#include "base/json/string_escape.h"
-#include "base/memory/ptr_util.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
 #include "chrome/browser/devtools/devtools_eye_dropper.h"
-#include "chrome/browser/devtools/devtools_file_helper.h"
-#include "chrome/common/url_constants.h"
-#include "components/prefs/in_memory_pref_store.h"
-#include "components/prefs/json_pref_store.h"
+#include "chrome/browser/devtools/devtools_ui_bindings.h"
 #include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/devtools_frontend_host.h"
-#include "content/public/browser/file_url_loader.h"
+#include "content/public/browser/devtools_agent_host.h"
 #include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_handle.h"
-#include "content/public/browser/render_frame_host.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/shared_cors_origin_access_list.h"
-#include "content/public/browser/storage_partition.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/content_client.h"
-#include "content/public/common/url_constants.h"
-#include "content/public/common/url_utils.h"
-#include "ipc/ipc_channel.h"
-#include "net/http/http_response_headers.h"
-#include "net/traffic_annotation/network_traffic_annotation.h"
-#include "services/network/public/cpp/simple_url_loader.h"
-#include "services/network/public/cpp/simple_url_loader_stream_consumer.h"
+#include "content/public/browser/page_navigator.h"
+#include "content/public/browser/site_instance.h"
+#include "url/gurl.h"
 
 using namespace QtWebEngineCore;
 
 namespace {
 
-constexpr char kScreencastEnabled[] = "screencastEnabled";
-
-base::DictionaryValue CreateFileSystemValue(DevToolsFileHelper::FileSystem fileSystem)
-{
-    base::DictionaryValue fileSystemValue;
-    fileSystemValue.SetStringKey("type", fileSystem.type);
-    fileSystemValue.SetStringKey("fileSystemName", fileSystem.file_system_name);
-    fileSystemValue.SetStringKey("rootURL", fileSystem.root_url);
-    fileSystemValue.SetStringKey("fileSystemPath", fileSystem.file_system_path);
-    return fileSystemValue;
-}
-
-base::DictionaryValue BuildObjectForResponse(const net::HttpResponseHeaders *rh, bool success,
-                                             int netError)
-{
-    base::DictionaryValue response;
-    int responseCode = 200;
-    if (rh) {
-        responseCode = rh->response_code();
-    } else if (!success) {
-        // In case of no headers, assume file:// URL and failed to load
-        responseCode = 404;
-    }
-    response.SetInteger("statusCode", responseCode);
-    response.SetInteger("netError", netError);
-    response.SetString("netErrorName", net::ErrorToString(netError));
-
-    auto headers = std::make_unique<base::DictionaryValue>();
-    size_t iterator = 0;
-    std::string name;
-    std::string value;
-    // TODO(caseq): this probably needs to handle duplicate header names
-    // correctly by folding them.
-    while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value))
-        headers->SetString(name, value);
-
-    response.Set("headers", std::move(headers));
-    return response;
-}
-
 static std::string GetFrontendURL()
 {
     return "devtools://devtools/bundled/inspector.html";
 }
-
-}  // namespace
+} // namespace
 
 namespace QtWebEngineCore {
 
-class DevToolsFrontendQt::NetworkResourceLoader
-        : public network::SimpleURLLoaderStreamConsumer {
-public:
-    NetworkResourceLoader(int stream_id,
-                          int request_id,
-                          DevToolsFrontendQt *bindings,
-                          std::unique_ptr<network::SimpleURLLoader> loader,
-                          network::mojom::URLLoaderFactory *url_loader_factory)
-        : stream_id_(stream_id),
-          request_id_(request_id),
-          bindings_(bindings),
-          loader_(std::move(loader))
-    {
-        loader_->SetOnResponseStartedCallback(base::BindOnce(
-                                                  &NetworkResourceLoader::OnResponseStarted, base::Unretained(this)));
-        loader_->DownloadAsStream(url_loader_factory, this);
-    }
-
-private:
-    void OnResponseStarted(const GURL &final_url,
-                           const network::mojom::URLResponseHead &response_head)
-    {
-        response_headers_ = response_head.headers;
-    }
-
-    void OnDataReceived(base::StringPiece chunk, base::OnceClosure resume) override
-    {
-        base::Value chunkValue;
-
-        bool encoded = !base::IsStringUTF8(chunk);
-        if (encoded) {
-            std::string encoded_string;
-            base::Base64Encode(chunk, &encoded_string);
-            chunkValue = base::Value(std::move(encoded_string));
-        } else {
-            chunkValue = base::Value(chunk);
-        }
-        base::Value id(stream_id_);
-        base::Value encodedValue(encoded);
-
-        bindings_->CallClientFunction("DevToolsAPI", "streamWrite", std::move(id), std::move(chunkValue), std::move(encodedValue));
-        std::move(resume).Run();
-    }
-
-    void OnComplete(bool success) override
-    {
-        auto response = BuildObjectForResponse(response_headers_.get(), success, loader_->NetError());
-        bindings_->SendMessageAck(request_id_, std::move(response));
-        bindings_->m_loaders.erase(bindings_->m_loaders.find(this));
-    }
-
-    void OnRetry(base::OnceClosure start_retry) override { NOTREACHED(); }
-
-    const int stream_id_;
-    const int request_id_;
-    DevToolsFrontendQt *const bindings_;
-    std::unique_ptr<network::SimpleURLLoader> loader_;
-    scoped_refptr<net::HttpResponseHeaders> response_headers_;
-};
-
-// This constant should be in sync with
-// the constant at devtools_ui_bindings.cc.
-const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
-
 // static
-DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter> frontendAdapter, content::WebContents *inspectedContents)
+DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter> frontendAdapter,
+                                             content::WebContents *inspectedContents)
 {
     DCHECK(frontendAdapter);
     DCHECK(inspectedContents);
 
     if (!frontendAdapter->isInitialized()) {
-        scoped_refptr<content::SiteInstance> site =
-            content::SiteInstance::CreateForURL(frontendAdapter->profile(), GURL(GetFrontendURL()));
+        scoped_refptr<content::SiteInstance> site = content::SiteInstance::CreateForURL(
+                frontendAdapter->profile(), GURL(GetFrontendURL()));
         frontendAdapter->initialize(site.get());
     }
 
@@ -184,13 +55,15 @@ DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter>
         return nullptr;
     }
 
-    DevToolsFrontendQt *devtoolsFrontend = new DevToolsFrontendQt(frontendAdapter, inspectedContents);
+    DevToolsFrontendQt *devtoolsFrontend =
+            new DevToolsFrontendQt(frontendAdapter, inspectedContents);
 
     if (contents->GetURL() == GURL(GetFrontendURL())) {
         contents->GetController().Reload(content::ReloadType::ORIGINAL_REQUEST_URL, false);
-    }  else {
+    } else {
         content::NavigationController::LoadURLParams loadParams((GURL(GetFrontendURL())));
-        loadParams.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_TOPLEVEL | ui::PAGE_TRANSITION_FROM_API);
+        loadParams.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_TOPLEVEL
+                                                               | ui::PAGE_TRANSITION_FROM_API);
         contents->GetController().LoadURLWithParams(loadParams);
     }
 
@@ -201,25 +74,12 @@ DevToolsFrontendQt::DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webCon
                                        content::WebContents *inspectedContents)
     : content::WebContentsObserver(webContentsAdapter->webContents())
     , m_frontendAdapter(webContentsAdapter)
-    , m_inspectedAdapter(static_cast<WebContentsDelegateQt *>(inspectedContents->GetDelegate())
-                                 ->webContentsAdapter())
     , m_inspectedContents(inspectedContents)
-    , m_inspect_element_at_x(-1)
-    , m_inspect_element_at_y(-1)
-    , m_prefStore(nullptr)
-    , m_weakFactory(this)
+    , m_bindings(new DevToolsUIBindings(webContentsAdapter->webContents()))
 {
-    // We use a separate prefstore than one in ProfileQt, because that one is in-memory only, and this
-    // needs to be stored or it will show introduction text on every load.
-    if (webContentsAdapter->profileAdapter()->isOffTheRecord())
-        m_prefStore = scoped_refptr<PersistentPrefStore>(new InMemoryPrefStore());
-    else
-        CreateJsonPreferences(false);
-
-    m_frontendDelegate = static_cast<WebContentsDelegateQt *>(webContentsAdapter->webContents()->GetDelegate());
-    m_fileHelper = std::make_unique<DevToolsFileHelper>(
-            webContentsAdapter->webContents(),
-            static_cast<Profile *>(webContentsAdapter->webContents()->GetBrowserContext()), this);
+    // bindings take ownership over devtools
+    m_bindings->SetDelegate(this);
+    m_bindings->AttachTo(content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents));
 }
 
 DevToolsFrontendQt::~DevToolsFrontendQt()
@@ -230,7 +90,7 @@ DevToolsFrontendQt::~DevToolsFrontendQt()
 
 void DevToolsFrontendQt::Activate()
 {
-    m_frontendDelegate->ActivateContents(web_contents());
+    web_contents()->GetDelegate()->ActivateContents(web_contents());
 }
 
 void DevToolsFrontendQt::Focus()
@@ -240,12 +100,11 @@ void DevToolsFrontendQt::Focus()
 
 void DevToolsFrontendQt::InspectElementAt(int x, int y)
 {
-    if (m_agentHost)
-        m_agentHost->InspectElement(m_inspectedContents->GetFocusedFrame(), x, y);
-    else {
-        m_inspect_element_at_x = x;
-        m_inspect_element_at_y = y;
-    }
+    if (!m_inspectedContents)
+        return;
+    scoped_refptr<content::DevToolsAgentHost> agent(
+            content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents));
+    agent->InspectElement(m_inspectedContents->GetFocusedFrame(), x, y);
 }
 
 void DevToolsFrontendQt::Close()
@@ -256,314 +115,54 @@ void DevToolsFrontendQt::Close()
 
 void DevToolsFrontendQt::DisconnectFromTarget()
 {
-    if (!m_agentHost)
-        return;
-    m_agentHost->DetachClient(this);
-    m_agentHost = nullptr;
+    m_bindings->Detach();
 }
 
-void DevToolsFrontendQt::ReadyToCommitNavigation(content::NavigationHandle *navigationHandle)
+WebContentsDelegateQt *DevToolsFrontendQt::frontendDelegate() const
 {
-    // ShellDevToolsFrontend does this in RenderViewCreated,
-    // but that doesn't work for us for some reason.
-    content::RenderFrameHost *frame = navigationHandle->GetRenderFrameHost();
-    if (navigationHandle->IsInMainFrame()) {
-        // If the frontend for some reason goes to some place other than devtools, stop the bindings
-        if (navigationHandle->GetURL() != GetFrontendURL())
-            m_frontendHost.reset(nullptr);
-        else if (!m_frontendHost)
-            m_frontendHost = content::DevToolsFrontendHost::Create(
-                        frame,
-                        base::BindRepeating(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend,
-                                            base::Unretained(this)));
-    }
+    return static_cast<WebContentsDelegateQt *>(web_contents()->GetDelegate());
 }
 
-void DevToolsFrontendQt::DocumentOnLoadCompletedInPrimaryMainFrame()
+void DevToolsFrontendQt::ColorPickedInEyeDropper(int r, int g, int b, int a)
 {
-    if (!m_inspectedContents)
-        return;
-    // Don't call AttachClient multiple times for the same DevToolsAgentHost.
-    // Otherwise it will call AgentHostClosed which closes the DevTools window.
-    // This may happen in cases where the DevTools content fails to load.
-    scoped_refptr<content::DevToolsAgentHost> agent_host =
-            content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents);
-    if (agent_host != m_agentHost) {
-        if (m_agentHost)
-            m_agentHost->DetachClient(this);
-        m_agentHost = agent_host;
-        m_agentHost->AttachClient(this);
-        if (m_inspect_element_at_x != -1) {
-            m_agentHost->InspectElement(m_inspectedContents->GetFocusedFrame(), m_inspect_element_at_x, m_inspect_element_at_y);
-            m_inspect_element_at_x = -1;
-            m_inspect_element_at_y = -1;
-        }
-    }
+    base::DictionaryValue color;
+    color.SetInteger("r", r);
+    color.SetInteger("g", g);
+    color.SetInteger("b", b);
+    color.SetInteger("a", a);
+    m_bindings->CallClientMethod("DevToolsAPI", "eyeDropperPickedColor", std::move(color));
 }
 
+// content::WebContentsObserver implementation
 void DevToolsFrontendQt::WebContentsDestroyed()
 {
-    if (m_inspectedAdapter)
-        m_inspectedAdapter->devToolsFrontendDestroyed(this);
-
-    if (m_agentHost) {
-        m_agentHost->DetachClient(this);
-        m_agentHost = nullptr;
-    }
-    delete this;
-}
-
-void DevToolsFrontendQt::SetPreference(const std::string &name, const std::string &value)
-{
-    DCHECK(m_prefStore);
-    m_prefStore->SetValue(name, base::Value(value), 0);
-}
+    WebContentsAdapter *inspectedAdapter =
+            static_cast<WebContentsDelegateQt *>(m_inspectedContents->GetDelegate())
+                    ->webContentsAdapter();
+    if (inspectedAdapter)
+        inspectedAdapter->devToolsFrontendDestroyed(this);
 
-void DevToolsFrontendQt::RemovePreference(const std::string &name)
-{
-    DCHECK(m_prefStore);
-    m_prefStore->RemoveValue(name, 0);
+    delete m_bindings; // it will call ~DevToolsFrontendQt()
 }
 
-void DevToolsFrontendQt::ClearPreferences()
+// DevToolsUIBindings::Delegate implementation
+void DevToolsFrontendQt::ActivateWindow()
 {
-    ProfileQt *profile = static_cast<ProfileQt *>(web_contents()->GetBrowserContext());
-    if (profile->IsOffTheRecord() || profile->profileAdapter()->storageName().isEmpty())
-        m_prefStore = scoped_refptr<PersistentPrefStore>(new InMemoryPrefStore());
-    else
-        CreateJsonPreferences(true);
+    web_contents()->Focus();
 }
 
-void DevToolsFrontendQt::CreateJsonPreferences(bool clear)
+void DevToolsFrontendQt::InspectElementCompleted()
 {
-    content::BrowserContext *browserContext = web_contents()->GetBrowserContext();
-    DCHECK(!browserContext->IsOffTheRecord());
-    JsonPrefStore *jsonPrefStore = new JsonPrefStore(
-                browserContext->GetPath().Append(FILE_PATH_LITERAL("devtoolsprefs.json")));
-    // We effectively clear the preferences by not calling ReadPrefs
-    base::ScopedAllowBlockingForTesting allowBlocking;
-    if (!clear)
-        jsonPrefStore->ReadPrefs();
-
-    m_prefStore = scoped_refptr<PersistentPrefStore>(jsonPrefStore);
+    m_bindings->CallClientMethod("DevToolsAPI", "setUseSoftMenu", base::Value(true));
 }
 
-void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(base::Value::Dict message)
+void DevToolsFrontendQt::OpenInNewTab(const std::string &url)
 {
-    const base::Value *method_ptr = nullptr;
-    base::Value *params_value = nullptr;
-    method_ptr = message.Find("method");
-    params_value = message.Find("params");
-    if (!method_ptr || !method_ptr->is_string() || (params_value && !params_value->is_list())) {
-        LOG(ERROR) << "Invalid message was sent to embedder: " << message;
-        return;
-    }
-    base::Value empty_params(base::Value::Type::LIST);
-    if (!params_value)
-        params_value = &empty_params;
-
-    int request_id = message.Find("id")->GetIfInt().value_or(0);
-    const std::string &method = *method_ptr->GetIfString();
-    base::Value::List *paramsPtr;
-    if (params_value)
-        paramsPtr = params_value->GetIfList();
-    base::Value::List &params = *paramsPtr;
-
-    if (method == "dispatchProtocolMessage" && params.size() == 1) {
-        const std::string *protocol_message = params[0].GetIfString();
-        if (!protocol_message)
-            return;
-        if (m_agentHost)
-            m_agentHost->DispatchProtocolMessage(this, base::as_bytes(base::make_span(*protocol_message)));
-    } else if (method == "loadCompleted") {
-        web_contents()->GetPrimaryMainFrame()->ExecuteJavaScript(u"DevToolsAPI.setUseSoftMenu(true);",
-                                                          base::NullCallback());
-    } else if (method == "loadNetworkResource" && params.size() == 3) {
-        // TODO(pfeldman): handle some of the embedder messages in content.
-        const std::string *url = params[0].GetIfString();
-        const std::string *headers = params[1].GetIfString();
-        absl::optional<int> stream_id = params[2].GetIfInt();
-        if (!url || !headers || !stream_id.has_value()) {
-            return;
-        }
-
-        GURL gurl(*url);
-        if (!gurl.is_valid()) {
-            base::DictionaryValue response;
-            response.SetInteger("statusCode", 404);
-            response.SetBoolean("urlValid", false);
-            SendMessageAck(request_id, std::move(response));
-            return;
-        }
-
-        net::NetworkTrafficAnnotationTag traffic_annotation =
-            net::DefineNetworkTrafficAnnotation(
-                "devtools_handle_front_end_messages", R"(
-                semantics {
-                  sender: "Developer Tools"
-                  description:
-                    "When user opens Developer Tools, the browser may fetch "
-                    "additional resources from the network to enrich the debugging "
-                    "experience (e.g. source map resources)."
-                  trigger: "User opens Developer Tools to debug a web page."
-                  data: "Any resources requested by Developer Tools."
-                  destination: OTHER
-                }
-                policy {
-                  cookies_allowed: YES
-                  cookies_store: "user"
-                  setting:
-                    "It's not possible to disable this feature from settings."
-                  chrome_policy {
-                    DeveloperToolsAvailability {
-                      policy_options {mode: MANDATORY}
-                      DeveloperToolsAvailability: 2
-                    }
-                  }
-                })");
-        auto resource_request = std::make_unique<network::ResourceRequest>();
-        resource_request->url = gurl;
-        // TODO(caseq): this preserves behavior of URLFetcher-based implementation.
-        // We really need to pass proper first party origin from the front-end.
-        resource_request->site_for_cookies = net::SiteForCookies::FromUrl(gurl);
-        resource_request->headers.AddHeadersFromString(*headers);
-
-        mojo::Remote<network::mojom::URLLoaderFactory> file_url_loader_factory;
-        scoped_refptr<network::SharedURLLoaderFactory> network_url_loader_factory;
-        network::mojom::URLLoaderFactory *url_loader_factory;
-        if (gurl.SchemeIsFile()) {
-            file_url_loader_factory.Bind(content::CreateFileURLLoaderFactory(base::FilePath(), nullptr));
-            url_loader_factory = file_url_loader_factory.get();
-        } else if (content::HasWebUIScheme(gurl)) {
-            base::DictionaryValue response;
-            response.SetInteger("statusCode", 403);
-            SendMessageAck(request_id, std::move(response));
-            return;
-        } else {
-            auto *partition = web_contents()->GetBrowserContext()->GetStoragePartitionForUrl(gurl);
-            network_url_loader_factory = partition->GetURLLoaderFactoryForBrowserProcess();
-            url_loader_factory = network_url_loader_factory.get();
-        }
-        auto simple_url_loader = network::SimpleURLLoader::Create(
-                    std::move(resource_request), traffic_annotation);
-        auto resource_loader = std::make_unique<NetworkResourceLoader>(
-                    *stream_id, request_id, this, std::move(simple_url_loader),
-                    url_loader_factory);
-        m_loaders.insert(std::move(resource_loader));
-        return;
-    } else if (method == "getPreferences") {
-        // Screencast is enabled by default if it's not present in the preference store.
-        if (!m_prefStore->GetValue(kScreencastEnabled, NULL))
-            SetPreference(kScreencastEnabled, "false");
-
-        m_preferences = std::move(m_prefStore->GetValues());
-        SendMessageAck(request_id, base::Value(m_preferences.Clone()));
-        return;
-    } else if (method == "setPreference" && params.size() >= 2) {
-        const std::string *name = params[0].GetIfString();
-        const std::string *value = params[1].GetIfString();
-        if (!name || !value)
-            return;
-        SetPreference(*name, *value);
-    } else if (method == "removePreference" && params.size() >= 1) {
-        const std::string *name = params[0].GetIfString();
-        if (!name)
-            return;
-        RemovePreference(*name);
-    } else if (method == "clearPreferences") {
-        ClearPreferences();
-    } else if (method == "requestFileSystems") {
-        base::ListValue fileSystemsValue;
-        for (auto const &fileSystem : m_fileHelper->GetFileSystems())
-            fileSystemsValue.Append(CreateFileSystemValue(fileSystem));
-        CallClientFunction("DevToolsAPI", "fileSystemsLoaded", std::move(fileSystemsValue));
-    } else if (method == "reattach") {
-        if (!m_agentHost)
-            return;
-        m_agentHost->DetachClient(this);
-        m_agentHost->AttachClient(this);
-    } else if (method == "inspectedURLChanged" && params.size() >= 1) {
-        const std::string *url = params[0].GetIfString();
-        if (!url)
-            return;
-        const std::string kHttpPrefix = "http://";
-        const std::string kHttpsPrefix = "https://";
-        const std::string simplified_url =
-            base::StartsWith(*url, kHttpsPrefix, base::CompareCase::SENSITIVE)
-                ? url->substr(kHttpsPrefix.length())
-                : base::StartsWith(*url, kHttpPrefix, base::CompareCase::SENSITIVE)
-                      ? url->substr(kHttpPrefix.length())
-                      : *url;
-        // DevTools UI is not localized.
-        web_contents()->UpdateTitleForEntry(web_contents()->GetController().GetActiveEntry(),
-                                            base::UTF8ToUTF16(
-                                                base::StringPrintf("DevTools - %s", simplified_url.c_str())));
-    } else if (method == "openInNewTab" && params.size() >= 1) {
-        const std::string *urlString = params[0].GetIfString();
-        if (!urlString)
-            return;
-        GURL url(*urlString);
-        if (!url.is_valid())
-            return;
-        content::OpenURLParams openParams(GURL(url),
-                                          content::Referrer(),
-                                          WindowOpenDisposition::NEW_FOREGROUND_TAB,
-                                          ui::PAGE_TRANSITION_LINK,
-                                          false);
-        // OpenURL will (via WebContentsDelegateQt::OpenURLFromTab) call
-        // application code, which may decide to close this devtools view (see
-        // quicknanobrowser for example).
-        //
-        // Chromium always calls SendMessageAck through a callback bound to a
-        // WeakPtr, we do the same here, except without the callback.
-        base::WeakPtr<DevToolsFrontendQt> weakThis = m_weakFactory.GetWeakPtr();
-        web_contents()->OpenURL(openParams);
-        if (!weakThis)
-            return;
-    } else if (method == "bringToFront") {
-        Activate();
-    } else if (method == "closeWindow") {
-        web_contents()->Close();
-    } else if (method == "setEyeDropperActive" && params.size() == 1) {
-        absl::optional<bool> active = params[0].GetIfBool();
-        if (!active)
-            return;
-        SetEyeDropperActive(*active);
-    } else if (method == "save" && params.size() == 3) {
-        const std::string *url = params[0].GetIfString();
-        const std::string *content = params[1].GetIfString();
-        absl::optional<bool> saveAs = params[2].GetIfBool();
-        if (!url || !content || !saveAs)
-            return;
-        SaveToFile(*url, *content, *saveAs);
-    } else if (method == "append" && params.size() == 2) {
-        const std::string *url = params[0].GetIfString();
-        const std::string *content = params[1].GetIfString();
-        if (!url || !content)
-            return;
-        AppendToFile(*url, *content);
-    } else if (method == "addFileSystem" && params.size() == 1) {
-        const std::string *type = params[0].GetIfString();
-        if (!type)
-            return;
-        AddFileSystem(*type);
-    } else if (method == "removeFileSystem" && params.size() == 1) {
-        const std::string *fileSystemPath = params[0].GetIfString();
-        if (!fileSystemPath)
-            return;
-        RemoveFileSystem(*fileSystemPath);
-    } else if (method == "upgradeDraggedFileSystemPermissions" && params.size() == 1) {
-        const std::string *fileSystemUrl = params[0].GetIfString();
-        if (!fileSystemUrl)
-            return;
-        UpgradeDraggedFileSystemPermissions(*fileSystemUrl);
-    } else {
-        VLOG(1) << "Unimplemented devtools method: " << message;
-        return;
-    }
+    content::OpenURLParams params(GURL(url), content::Referrer(),
+                                  WindowOpenDisposition::NEW_FOREGROUND_TAB,
+                                  ui::PAGE_TRANSITION_LINK, false);
 
-    if (request_id)
-        SendMessageAck(request_id, base::Value());
+    m_inspectedContents->OpenURL(params);
 }
 
 void DevToolsFrontendQt::SetEyeDropperActive(bool active)
@@ -572,67 +171,14 @@ void DevToolsFrontendQt::SetEyeDropperActive(bool active)
         return;
     if (active) {
         m_eyeDropper.reset(new DevToolsEyeDropper(
-                               m_inspectedContents,
-                               base::BindRepeating(&DevToolsFrontendQt::ColorPickedInEyeDropper,
-                                                   base::Unretained(this))));
+                m_inspectedContents,
+                base::BindRepeating(&DevToolsFrontendQt::ColorPickedInEyeDropper,
+                                    base::Unretained(this))));
     } else {
         m_eyeDropper.reset();
     }
 }
 
-void DevToolsFrontendQt::ColorPickedInEyeDropper(int r, int g, int b, int a)
-{
-    base::DictionaryValue color;
-    color.SetInteger("r", r);
-    color.SetInteger("g", g);
-    color.SetInteger("b", b);
-    color.SetInteger("a", a);
-    CallClientFunction("DevToolsAPI", "eyeDropperPickedColor", std::move(color));
-}
-
-void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *agentHost, base::span<const uint8_t> message)
-{
-    Q_UNUSED(agentHost);
-    base::StringPiece str_message(reinterpret_cast<const char*>(message.data()), message.size());
-
-    if (str_message.length() < kMaxMessageChunkSize) {
-        CallClientFunction("DevToolsAPI", "dispatchMessage",
-                           base::Value(std::string(str_message)));
-    } else {
-        size_t total_size = str_message.length();
-        for (size_t pos = 0; pos < str_message.length(); pos += kMaxMessageChunkSize) {
-            base::StringPiece str_message_chunk = str_message.substr(pos, kMaxMessageChunkSize);
-
-            CallClientFunction("DevToolsAPI", "dispatchMessageChunk",
-                               base::Value(std::string(str_message_chunk)),
-                               base::Value(base::NumberToString(pos ? 0 : total_size)));
-        }
-    }
-}
-
-void DevToolsFrontendQt::CallClientFunction(const std::string &object_name,
-                                            const std::string &method_name,
-                                            base::Value arg1, base::Value arg2, base::Value arg3,
-                                            base::OnceCallback<void(base::Value)> cb)
-
-{
-    base::Value::List arguments;
-    if (!arg1.is_none()) {
-        arguments.Append(std::move(arg1));
-        if (!arg2.is_none()) {
-            arguments.Append(std::move(arg2));
-            if (!arg3.is_none()) {
-                arguments.Append(std::move(arg3));
-            }
-        }
-    }
-    web_contents()->GetPrimaryMainFrame()->ExecuteJavaScriptMethod(base::ASCIIToUTF16(object_name),
-                                                            base::ASCIIToUTF16(method_name),
-                                                            std::move(arguments),
-                                                            std::move(cb));
-
-}
-
 // static
 bool DevToolsFrontendQt::IsValidFrontendURL(const GURL &url)
 {
@@ -642,117 +188,9 @@ bool DevToolsFrontendQt::IsValidFrontendURL(const GURL &url)
     return url.spec() == GetFrontendURL();
 }
 
-void DevToolsFrontendQt::SendMessageAck(int request_id, base::Value arg)
-{
-    base::Value id_value(request_id);
-    CallClientFunction("DevToolsAPI", "embedderMessageAck", std::move(id_value), std::move(arg));
-}
-
-void DevToolsFrontendQt::AgentHostClosed(content::DevToolsAgentHost *agentHost)
-{
-    DCHECK(agentHost == m_agentHost.get());
-    m_agentHost = nullptr;
-    m_inspectedContents = nullptr;
-    m_inspectedAdapter = nullptr;
-    Close();
-}
-
-void DevToolsFrontendQt::SaveToFile(const std::string &url, const std::string &content, bool saveAs)
-{
-    m_fileHelper->Save(
-            url, content, saveAs,
-            base::BindOnce(&DevToolsFrontendQt::FileSavedAs, m_weakFactory.GetWeakPtr(), url),
-            base::BindOnce(&DevToolsFrontendQt::CanceledFileSaveAs, m_weakFactory.GetWeakPtr(),
-                           url));
-}
-
-void DevToolsFrontendQt::FileSavedAs(const std::string &url, const std::string &fileSystemPath)
-{
-    CallClientFunction("DevToolsAPI", "savedURL", base::Value(url), base::Value(fileSystemPath));
-}
-
-void DevToolsFrontendQt::CanceledFileSaveAs(const std::string &url)
-{
-    CallClientFunction("DevToolsAPI", "canceledSaveURL", base::Value(url));
-}
-
-void DevToolsFrontendQt::AppendToFile(const std::string &url, const std::string &content)
-{
-    m_fileHelper->Append(
-            url, content,
-            base::BindOnce(&DevToolsFrontendQt::AppendedTo, m_weakFactory.GetWeakPtr(), url));
-}
-
-void DevToolsFrontendQt::AppendedTo(const std::string &url)
-{
-    CallClientFunction("DevToolsAPI", "appendedToURL", base::Value(url));
-}
-
-void DevToolsFrontendQt::AddFileSystem(const std::string &type)
-{
-    CHECK(IsValidFrontendURL(web_contents()->GetLastCommittedURL()) && m_frontendHost);
-    m_fileHelper->AddFileSystem(type, base::NullCallback());
-}
-
-void DevToolsFrontendQt::UpgradeDraggedFileSystemPermissions(const std::string &fileSystemUrl)
-{
-    CHECK(IsValidFrontendURL(web_contents()->GetLastCommittedURL()) && m_frontendHost);
-    m_fileHelper->UpgradeDraggedFileSystemPermissions(fileSystemUrl, base::NullCallback());
-}
-
-void DevToolsFrontendQt::RemoveFileSystem(const std::string &fileSystemPath)
-{
-    CHECK(IsValidFrontendURL(web_contents()->GetLastCommittedURL()) && m_frontendHost);
-    m_fileHelper->RemoveFileSystem(fileSystemPath);
-}
-
-// DevToolsFileHelper::Delegate implementation
-// based on chrome/browser/devtools/devtools_ui_bindings.cc
-void DevToolsFrontendQt::FileSystemAdded(const std::string &error,
-                                         const DevToolsFileHelper::FileSystem *file_system)
-{
-    if (file_system) {
-        CallClientFunction("DevToolsAPI", "fileSystemAdded", base::Value(error),
-                           CreateFileSystemValue(*file_system));
-    } else {
-        CallClientFunction("DevToolsAPI", "fileSystemAdded", base::Value(error));
-    }
-}
-
-void DevToolsFrontendQt::FileSystemRemoved(const std::string &file_system_path)
+void DevToolsFrontendQt::InspectedContentsClosing()
 {
-    CallClientFunction("DevToolsAPI", "fileSystemRemoved", base::Value(file_system_path));
-}
-
-void DevToolsFrontendQt::FilePathsChanged(const std::vector<std::string> &changed_paths,
-                                          const std::vector<std::string> &added_paths,
-                                          const std::vector<std::string> &removed_paths)
-{
-    const int kMaxPathsPerMessage = 1000;
-    size_t changed_index = 0;
-    size_t added_index = 0;
-    size_t removed_index = 0;
-    // Dispatch limited amount of file paths in a time to avoid
-    // IPC max message size limit. See https://crbug.com/797817.
-    while (changed_index < changed_paths.size() || added_index < added_paths.size()
-           || removed_index < removed_paths.size()) {
-        int budget = kMaxPathsPerMessage;
-        base::ListValue changed, added, removed;
-        while (budget > 0 && changed_index < changed_paths.size()) {
-            changed.Append(changed_paths[changed_index++]);
-            --budget;
-        }
-        while (budget > 0 && added_index < added_paths.size()) {
-            added.Append(added_paths[added_index++]);
-            --budget;
-        }
-        while (budget > 0 && removed_index < removed_paths.size()) {
-            removed.Append(removed_paths[removed_index++]);
-            --budget;
-        }
-        CallClientFunction("DevToolsAPI", "fileSystemFilesChangedAddedRemoved", std::move(changed),
-                           std::move(added), std::move(removed));
-    }
+    web_contents()->ClosePage();
 }
 
 } // namespace QtWebEngineCore
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index 5c1237bbcc9..3b722c9ade3 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -11,31 +11,24 @@
 
 #include "base/containers/unique_ptr_adapters.h"
 #include "base/memory/weak_ptr.h"
-#include "chrome/browser/devtools/devtools_file_helper.h"
-#include "content/public/browser/devtools_agent_host.h"
+#include "chrome/browser/devtools/devtools_ui_bindings.h"
 #include "content/public/browser/web_contents_observer.h"
 
-namespace base {
-class Value;
-}
+class DevToolsEyeDropper;
 
 namespace content {
-class DevToolsFrontendHost;
-class NavigationHandle;
+class DevToolsAgentHost;
 class WebContents;
-}  // namespace content
-
-class DevToolsEyeDropper;
-class PersistentPrefStore;
+} // namespace content
 
 namespace QtWebEngineCore {
+class WebContentsAdapter;
 
-class DevToolsFrontendQt : public content::WebContentsObserver,
-                           public content::DevToolsAgentHostClient,
-                           public DevToolsFileHelper::Delegate
+class DevToolsFrontendQt : public DevToolsUIBindings::Delegate, public content::WebContentsObserver
 {
 public:
-    static DevToolsFrontendQt *Show(QSharedPointer<WebContentsAdapter> frontendAdapter, content::WebContents *inspectedContents);
+    static DevToolsFrontendQt *Show(QSharedPointer<WebContentsAdapter> frontendAdapter,
+                                    content::WebContents *inspectedContents);
 
     void Activate();
     void Focus();
@@ -44,82 +37,48 @@ class DevToolsFrontendQt : public content::WebContentsObserver,
 
     void DisconnectFromTarget();
 
-    void CallClientFunction(const std::string &object_name,
-                            const std::string &method_name,
-                            base::Value arg1 = {},
-                            base::Value arg2 = {},
-                            base::Value arg3 = {},
-                            base::OnceCallback<void(base::Value)> cb = base::NullCallback());
-
-    WebContentsDelegateQt *frontendDelegate() const
-    {
-        return m_frontendDelegate;
-    }
+    WebContentsDelegateQt *frontendDelegate() const;
 
     static bool IsValidFrontendURL(const GURL &url);
 
 protected:
-    DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webContentsAdapter, content::WebContents *inspectedContents);
+    DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webContentsAdapter,
+                       content::WebContents *inspectedContents);
     ~DevToolsFrontendQt() override;
 
-    // content::DevToolsAgentHostClient implementation.
-    void AgentHostClosed(content::DevToolsAgentHost* agent_host) override;
-    void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, base::span<const uint8_t> message) override;
-
-    void SetPreferences(const std::string& json);
-    void HandleMessageFromDevToolsFrontend(base::Value::Dict message);
-
 private:
-    // WebContentsObserver overrides
-    void ReadyToCommitNavigation(content::NavigationHandle* navigation_handle) override;
-    void DocumentOnLoadCompletedInPrimaryMainFrame() override;
-    void WebContentsDestroyed() override;
-
-    // DevToolsFileHelper::Delegate overrides.
-    void FileSystemAdded(const std::string &error,
-                         const DevToolsFileHelper::FileSystem *file_system) override;
-    void FileSystemRemoved(const std::string &file_system_path) override;
-    void FilePathsChanged(const std::vector<std::string> &changed_paths,
-                          const std::vector<std::string> &added_paths,
-                          const std::vector<std::string> &removed_paths) override;
-
-    void SendMessageAck(int request_id, base::Value arg1);
-    void SetPreference(const std::string &name, const std::string &value);
-    void RemovePreference(const std::string &name);
-    void ClearPreferences();
-    void CreateJsonPreferences(bool clear);
-    void SetEyeDropperActive(bool active);
     void ColorPickedInEyeDropper(int r, int g, int b, int a);
 
-    void SaveToFile(const std::string &url, const std::string &content, bool saveAs);
-    void FileSavedAs(const std::string &url, const std::string &fileSystemPath);
-    void CanceledFileSaveAs(const std::string &url);
-    void AppendToFile(const std::string &url, const std::string &content);
-    void AppendedTo(const std::string &url);
-    void AddFileSystem(const std::string &type);
-    void UpgradeDraggedFileSystemPermissions(const std::string &fileSystem);
-    void RemoveFileSystem(const std::string &fileSystemPath);
+    // content::WebContentsObserver overrides
+    void WebContentsDestroyed() override;
+
+    // DevToolsUIBindings::Delegate overrides
+    void ActivateWindow() override;
+    void InspectElementCompleted() override;
+    void SetEyeDropperActive(bool active) override;
+    void OpenInNewTab(const std::string &url) override;
+    void InspectedContentsClosing() override;
+
+    void CloseWindow() override{};
+    void Inspect(scoped_refptr<content::DevToolsAgentHost>) override{};
+    void SetInspectedPageBounds(const gfx::Rect &) override{};
+    void SetIsDocked(bool) override{};
+    void SetWhitelistedShortcuts(const std::string &) override{};
+    void OpenNodeFrontend() override{};
+    void OnLoadCompleted() override{};
+    void ReadyForTest() override{};
+    void ConnectionReady() override{};
+    void SetOpenNewWindowForPopups(bool) override{};
+    void RenderProcessGone(bool) override{};
+    void ShowCertificateViewer(const std::string &) override{};
 
     // We shouldn't be keeping it alive
     QWeakPointer<WebContentsAdapter> m_frontendAdapter;
-    WebContentsAdapter *m_inspectedAdapter;
-    WebContentsDelegateQt *m_frontendDelegate;
     content::WebContents *m_inspectedContents;
-    scoped_refptr<content::DevToolsAgentHost> m_agentHost;
-    int m_inspect_element_at_x;
-    int m_inspect_element_at_y;
-    std::unique_ptr<content::DevToolsFrontendHost> m_frontendHost;
     std::unique_ptr<DevToolsEyeDropper> m_eyeDropper;
-    std::unique_ptr<DevToolsFileHelper> m_fileHelper;
-
-    class NetworkResourceLoader;
-    std::set<std::unique_ptr<NetworkResourceLoader>, base::UniquePtrComparator> m_loaders;
-
-    base::Value::Dict m_preferences;
-    scoped_refptr<PersistentPrefStore> m_prefStore;
-    base::WeakPtrFactory<DevToolsFrontendQt> m_weakFactory;
+    DevToolsUIBindings *m_bindings;
 };
 
 } // namespace QtWebEngineCore
 
-#endif  // DEVTOOLS_FRONTEND_QT_H
+#endif // DEVTOOLS_FRONTEND_QT_H
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 34251880eae..b6cfc27145f 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -26,6 +26,9 @@
 #include "extensions/buildflags/buildflags.h"
 #include "content/public/browser/browser_context.h"
 
+#include "components/pref_registry/pref_registry_syncable.h"
+#include "chrome/browser/devtools/devtools_settings.h"
+
 #if QT_CONFIG(webengine_spellchecker)
 #include "chrome/browser/spellchecker/spellcheck_service.h"
 #include "components/spellcheck/browser/pref_names.h"
@@ -126,6 +129,12 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
     // devtools
     registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);
     registry->RegisterDictionaryPref(prefs::kDevToolsEditedFiles);
+    registry->RegisterDictionaryPref(prefs::kDevToolsPreferences);
+    registry->RegisterBooleanPref(prefs::kDevToolsSyncPreferences, false);
+    // even if kDevToolsSyncPreferences is disabled, the js frontend tries to access
+    // these two. E.g.: 'clearPreferences', that is overridden by devtools_compatibility.js
+    registry->RegisterDictionaryPref(prefs::kDevToolsSyncedPreferencesSyncDisabled);
+    registry->RegisterDictionaryPref(prefs::kDevToolsSyncedPreferencesSyncEnabled);
 
     registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, std::string());
     registry->RegisterStringPref(prefs::kGaiaCookieLastListAccountsData, std::string());

From e200ab2b7c5e615797e6970e9c33418dc51705df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 21 Feb 2023 12:55:28 +0100
Subject: [PATCH 080/681] Update Chromium

Submodule src/3rdparty 7e5ee9d6..10e54a07:
  * FIXUP: Fixes for building with MSVC
  * Fixup for [Backport] CVE-2023-0705: Integer overflow in Core (2/2)
  * Fix android on mac support
  * Add android config support
  * Merge branch 'upstream-master' into HEAD
  * Add android required resources for chromium repo
  * [Backport] CVE-2023-0696: Type Confusion in V8
  * [Backport] Security bug 829317 (2/2)
  * [Backport] Security bug 829317 (1/2)
  * [Backport] CVE-2023-0705: Integer overflow in Core (2/2)
  * [Backport] CVE-2023-0705: Integer overflow in Core (1/2)
  * [Backport] Security bug 1400809
  * [Backport] Security bug 1325096
  * [Backport] CVE-2023-0701: Heap buffer overflow in WebUI.
  * [Backport] CVE-2023-0702: Type Confusion in Data Transfer
  * [Backport] CVE-2023-0699: Use after free in GPU (2/2)
  * [Backport] CVE-2023-0699: Use after free in GPU (1/2)
  * [Backport] CVE-2023-0703: Type Confusion in DevTools
  * [Backport] CVE-2023-0698: Out of bounds read in WebRTC (2/2)
  * [Backport] CVE-2023-0698: Out of bounds read in WebRTC (1/2)
  * Merge branch 'upstream-master' into 108-based
  * BASELINE: Update Chromium to 108.0.5359.220

Task-number: QTBUG-111363
Task-number: QTBUG-83459
Change-Id: Id67893339f68e382e10ae10bbfddeffc8b60ae88
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 53162b8a1c2b02bb572e0e7d93c9d1493c74287e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 6eafcaa259d..c87bec9a9db 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           109.0.5414.119
+Patched with security patches up to Chromium version:           110.0.5481.104
diff --git a/src/3rdparty b/src/3rdparty
index 7e5ee9d6aee..10e54a075e0 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 7e5ee9d6aee9eacedff4860f4c5965214df59538
+Subproject commit 10e54a075e08cac2267d43dcd0e092019f91c83f
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index bdf29e74aeb..b341ad99807 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -915,7 +915,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "109.0.5414.119"; // FIXME: Remember to update
+    return "110.0.5481.104"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 256313c6454f74e8f3f7524954ef274d85d0df29 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 6 Feb 2023 14:33:16 +0100
Subject: [PATCH 081/681] Add Origin Trial Policy support

This makes SharedArrayBuffer available for earth.google.com

For enabling certain experimental feature for a web page, the
page provides a token in a meta tag for the browser. The token
is requested by the web developer and generated by Google. The
verification of the token happens without any server calls or
network access. See,
 * http://googlechrome.github.io/OriginTrials/developer-guide.html#23-how-are-tokens-verified
 * blink::TrialToken::Parse() and blink::TrialTokenValidator
   implementation (//third_party/blink/common/origin_trials)

Change-Id: I6f102af8efcd12b6b267dceb9de59d685fd22f9e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 595e8b6a73e69c57ac7f331f0610f4b8e2c448ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/configure/BUILD.root.gn.in |  1 +
 src/core/content_client_qt.cpp      | 15 +++++++++++++++
 src/core/content_client_qt.h        | 11 +++++++++++
 3 files changed, 27 insertions(+)

diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index af649d950ea..bb4455fb773 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -117,6 +117,7 @@ shared_library("QtWebEngineCore") {
     "//components/autofill/core/browser",
     "//components/autofill/core/browser:buildflags",
     "//components/cdm/renderer",
+    "//components/embedder_support/origin_trials",
     "//components/error_page/common",
     "//components/favicon/content",
     "//components/gcm_driver",
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 4a67dc029ec..fab8a5abb0a 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -420,4 +420,19 @@ std::u16string ContentClientQt::GetLocalizedString(int message_id)
     return l10n_util::GetStringUTF16(message_id);
 }
 
+// This method is a copy from chrome/common/chrome_content_client.cc:
+// Copyright 2012 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+blink::OriginTrialPolicy *ContentClientQt::GetOriginTrialPolicy()
+{
+    // Prevent initialization race (see crbug.com/721144). There may be a
+    // race when the policy is needed for worker startup (which happens on a
+    // separate worker thread).
+    base::AutoLock auto_lock(origin_trial_policy_lock_);
+    if (!origin_trial_policy_)
+        origin_trial_policy_ = std::make_unique<embedder_support::OriginTrialPolicyImpl>();
+    return origin_trial_policy_.get();
+}
+
 } // namespace QtWebEngineCore
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index 92d41b748ae..f58e17f9649 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -5,10 +5,15 @@
 #define CONTENT_CLIENT_QT_H
 
 #include "qtwebenginecoreglobal_p.h"
+
 #include "base/strings/string_piece.h"
+#include "base/synchronization/lock.h"
+#include "components/embedder_support/origin_trials/origin_trial_policy_impl.h"
 #include "content/public/common/content_client.h"
 #include "ui/base/layout.h"
 
+#include <memory>
+
 namespace QtWebEngineCore {
 
 class ContentClientQt : public content::ContentClient {
@@ -24,6 +29,12 @@ class ContentClientQt : public content::ContentClient {
     base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
     gfx::Image &GetNativeImageNamed(int resource_id) override;
     std::u16string GetLocalizedString(int message_id) override;
+    blink::OriginTrialPolicy *GetOriginTrialPolicy() override;
+
+private:
+    // Used to lock when |origin_trial_policy_| is initialized.
+    base::Lock origin_trial_policy_lock_;
+    std::unique_ptr<embedder_support::OriginTrialPolicyImpl> origin_trial_policy_;
 };
 
 } // namespace QtWebEngineCore

From 13b6e61a71e8ff6fc24f94120451b2bf04e93810 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 23 Feb 2023 17:59:53 +0000
Subject: [PATCH 082/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I9a10b27e1274f11a0510ef383d6911042999b643
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 07046a40148..b816a6847e9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 11a481301d2fb9fa59ade784a13691eec5daaf47
+    ref: 3a6dbd5913779a84787ff1380313a312d7bcd5b4
     required: true
   ../qtpositioning:
-    ref: 077324f59ef5eb2ca7354b554c57b297b36ab924
+    ref: 2267f53c191be60d271cf78cdad3f3773c70cffb
     required: false
   ../qttools:
-    ref: b37f3b41a4372c33908f7f1f1c72ea017385a253
+    ref: 53a25dbdb7ac4031510b02171b8a30a59805f9ab
     required: false
   ../qtwebchannel:
-    ref: 2eae52d2e45eee9e70bb6223420390a52b93f58a
+    ref: db926e01a77050ee56d06254a28872284711e283
     required: false

From 198b892f1d893a8d6be8cd83d6e89e7a027e4be8 Mon Sep 17 00:00:00 2001
From: Axel Spoerl <axel.spoerl@qt.io>
Date: Thu, 9 Feb 2023 14:33:54 +0100
Subject: [PATCH 083/681] Define an enum for FPDF rotation int values

FPDF uses int values defined in fpdfview.h:955ff, representing page
rotation. Respecting coding style, this patch adds an enum in
QPdfDocumentPrivate to introduce meaningful names instead of int
values.

Change-Id: I54cefe336de3670026cfc4d7f4436e5898e43b54
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 21c11e817478f440e32a82f20b964b285339e939)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
---
 src/pdf/qpdfdocument.cpp | 17 +----------------
 src/pdf/qpdfdocument_p.h | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index a3e412c5c52..268389f4a3c 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -824,22 +824,6 @@ QImage QPdfDocument::render(int page, QSize imageSize, QPdfDocumentRenderOptions
     result.fill(Qt::transparent);
     FPDF_BITMAP bitmap = FPDFBitmap_CreateEx(result.width(), result.height(), FPDFBitmap_BGRA, result.bits(), result.bytesPerLine());
 
-    int rotation = 0;
-    switch (renderOptions.rotation()) {
-    case QPdfDocumentRenderOptions::Rotation::None:
-        rotation = 0;
-        break;
-    case QPdfDocumentRenderOptions::Rotation::Clockwise90:
-        rotation = 1;
-        break;
-    case QPdfDocumentRenderOptions::Rotation::Clockwise180:
-        rotation = 2;
-        break;
-    case QPdfDocumentRenderOptions::Rotation::Clockwise270:
-        rotation = 3;
-        break;
-    }
-
     const QPdfDocumentRenderOptions::RenderFlags renderFlags = renderOptions.renderFlags();
     int flags = 0;
     if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::Annotations)
@@ -885,6 +869,7 @@ QImage QPdfDocument::render(int page, QSize imageSize, QPdfDocumentRenderOptions
         qCDebug(qLcDoc) << "page" << page << "region" << renderOptions.scaledClipRect()
                         << "size" << imageSize << "took" << timer.elapsed() << "ms";
     } else {
+        const auto rotation = QPdfDocumentPrivate::toFPDFRotation(renderOptions.rotation());
         FPDF_RenderPageBitmap(bitmap, pdfPage, 0, 0, result.width(), result.height(), rotation, flags);
         qCDebug(qLcDoc) << "page" << page << "size" << imageSize << "took" << timer.elapsed() << "ms";
     }
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
index 973dc1d4aa0..d52aabe4bb1 100644
--- a/src/pdf/qpdfdocument_p.h
+++ b/src/pdf/qpdfdocument_p.h
@@ -81,6 +81,31 @@ class Q_PDF_PRIVATE_EXPORT QPdfDocumentPrivate: public FPDF_FILEACCESS, public F
     QPointF getCharPosition(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
     QRectF getCharBox(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
 
+    // FPDF takes the rotation parameter as an int.
+    // This enum is mapping the int values defined in fpdfview.h:956.
+    // (not using enum class to ensure int convertability)
+    enum QFPDFRotation {
+        Normal = 0,
+        ClockWise90 = 1,
+        ClockWise180 = 2,
+        CounterClockWise90 = 3
+    };
+
+    static constexpr QFPDFRotation toFPDFRotation(QPdfDocumentRenderOptions::Rotation rotation)
+    {
+        switch (rotation) {
+        case QPdfDocumentRenderOptions::Rotation::None:
+            return QFPDFRotation::Normal;
+        case QPdfDocumentRenderOptions::Rotation::Clockwise90:
+            return QFPDFRotation::ClockWise90;
+        case QPdfDocumentRenderOptions::Rotation::Clockwise180:
+            return QFPDFRotation::ClockWise180;
+        case QPdfDocumentRenderOptions::Rotation::Clockwise270:
+            return QFPDFRotation::CounterClockWise90;
+        }
+        Q_UNREACHABLE();
+    }
+
     struct TextPosition {
         QPointF position;
         qreal height = 0;

From 262ae1056984d248ae91bfdcb556fe709117f47a Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eb@emlix.com>
Date: Thu, 23 Feb 2023 07:51:30 +0100
Subject: [PATCH 084/681] CMake: check for vpx_codec_vp9_cx() presence in
 libvpx

This function is present in the headers even if the vp9 encoder is
disabled during build. It is actually used later, which leads to a
linker error when not present.

Change-Id: I77247c76b29c132386c4d77861c0f63418321871
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit df9a9c357f3ce2298846839d24878d519903ca9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.cmake b/configure.cmake
index 7fcbbc04496..f1b971080eb 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -103,6 +103,7 @@ int main() {
     pkt.data.frame.height[0] = 0u;
     auto a = CONSTRAINED_FROM_ABOVE_DROP;
     auto b = VPX_IMG_FMT_NV12;
+    auto v9 = vpx_codec_vp9_cx();
 }"
 )
 

From ff42b8087b4831b4893ff9ed4853acd8bcbd83ec Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 13 Jan 2023 16:00:48 +0100
Subject: [PATCH 085/681] Fix use after free in permission grant
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The permission grant can become dangling pointer in
origin state struct, fix it.

Change-Id: If16b604a8c3c05d09ea923251dabcae73192dd7d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 16d3701b1dd4887cc4affb0447ee3b9b7729e7fb)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 ...ile_system_access_permission_context_qt.cpp | 18 ++++++++++++++++++
 .../file_system_access_permission_context_qt.h |  4 +++-
 .../file_system_access_permission_grant_qt.cpp |  6 +++++-
 .../file_system_access_permission_grant_qt.h   |  3 +++
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
index bc88f7898a6..2fd710ad693 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.cpp
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
@@ -453,4 +453,22 @@ std::u16string FileSystemAccessPermissionContextQt::GetPickerTitle(const blink::
     return {};
 }
 
+void FileSystemAccessPermissionContextQt::PermissionGrantDestroyed(
+        FileSystemAccessPermissionGrantQt *grant)
+{
+    auto it = m_origins.find(grant->origin());
+    if (it == m_origins.end())
+        return;
+
+    auto &grants =
+            grant->type() == GrantType::kRead ? it->second.read_grants : it->second.write_grants;
+    auto grant_it = grants.find(grant->path());
+
+    if (grant_it == grants.end()) {
+        return;
+    }
+    if (grant_it->second == grant)
+        grants.erase(grant_it);
+}
+
 } // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.h b/src/core/file_system_access/file_system_access_permission_context_qt.h
index 29fefee24af..09e890038b0 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.h
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.h
@@ -19,7 +19,7 @@ class BrowserContext;
 }
 
 namespace QtWebEngineCore {
-
+class FileSystemAccessPermissionGrantQt;
 class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPermissionContext,
                                             public KeyedService
 {
@@ -56,6 +56,8 @@ class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPerm
     void NavigatedAwayFromOrigin(const url::Origin &origin);
     content::BrowserContext *profile() const { return m_profile; }
 
+    void PermissionGrantDestroyed(FileSystemAccessPermissionGrantQt *);
+
 private:
     class PermissionGrantImpl;
 
diff --git a/src/core/file_system_access/file_system_access_permission_grant_qt.cpp b/src/core/file_system_access/file_system_access_permission_grant_qt.cpp
index 8999bf8508b..67fa1c8cfbb 100644
--- a/src/core/file_system_access/file_system_access_permission_grant_qt.cpp
+++ b/src/core/file_system_access/file_system_access_permission_grant_qt.cpp
@@ -22,7 +22,11 @@ FileSystemAccessPermissionGrantQt::FileSystemAccessPermissionGrantQt(
     : m_context(context), m_origin(origin), m_path(path), m_handleType(handle_type), m_type(type)
 {
 }
-
+FileSystemAccessPermissionGrantQt::~FileSystemAccessPermissionGrantQt()
+{
+    if (m_context)
+        m_context->PermissionGrantDestroyed(this);
+}
 void FileSystemAccessPermissionGrantQt::RequestPermission(
         content::GlobalRenderFrameHostId frame_id, UserActivationState user_activation_state,
         base::OnceCallback<void(PermissionRequestOutcome)> callback)
diff --git a/src/core/file_system_access/file_system_access_permission_grant_qt.h b/src/core/file_system_access/file_system_access_permission_grant_qt.h
index 1984b8f2cad..829d2b88912 100644
--- a/src/core/file_system_access/file_system_access_permission_grant_qt.h
+++ b/src/core/file_system_access/file_system_access_permission_grant_qt.h
@@ -36,6 +36,9 @@ class FileSystemAccessPermissionGrantQt : public content::FileSystemAccessPermis
 
     void SetStatus(blink::mojom::PermissionStatus status);
 
+protected:
+    ~FileSystemAccessPermissionGrantQt() override;
+
 private:
     void OnPermissionRequestResult(base::OnceCallback<void(PermissionRequestOutcome)> callback,
                                    permissions::PermissionAction result);

From 1612b76aa214462cc004b285c80e5c9e3dff0686 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 24 Feb 2023 11:35:13 +0100
Subject: [PATCH 086/681] Fix file url in webengine filesystem request
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We should return filesystem url, not just string converted
to url.

Change-Id: I883e4dd092396e918115cb609ed040c92a871737
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 576f0ea80537ba257f9fa78dcd3b52e6c9ee7272)
---
 .../file_system_access_permission_request_controller_impl.cpp   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp b/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp
index 7dc5f52113e..f77c974d0b6 100644
--- a/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp
+++ b/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp
@@ -23,7 +23,7 @@ FileSystemAccessPermissionRequestControllerImpl::FileSystemAccessPermissionReque
         const FileSystemAccessPermissionRequestManagerQt::RequestData &request,
         base::OnceCallback<void(permissions::PermissionAction result)> callback)
     : FileSystemAccessPermissionRequestController(
-            toQt(request.origin.GetURL()), toQt(request.path.value()),
+            toQt(request.origin.GetURL()), QUrl::fromLocalFile(toQt(request.path.value())),
             (HandleType)request.handle_type, AccessFlags((int)request.access))
     , m_callback(std::move(callback))
 {

From 5b7a99588778d3fbc32141af75e9db0f3440054e Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 24 Feb 2023 11:29:50 +0100
Subject: [PATCH 087/681] Fix filesystem request qml namespace
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Unfortunately in 3494efe5d440 we register request
incorrectly which does not work as intended with qml.
Fix it and add namespace to qml registry.

Change-Id: I6965dd0a9b65021cd9c290aaecef9fb9fd82735a
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit f6c5dea639ee5f84af627df3b127d8133f4c4ac6)
---
 src/webenginequick/api/qquickwebengineforeigntypes_p.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index 5ea27850a8e..1591e596f8c 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -185,11 +185,19 @@ struct ForeginWebEngineFileSystemAccessRequest
 {
     Q_GADGET
     QML_FOREIGN(QWebEngineFileSystemAccessRequest)
-    QML_NAMED_ELEMENT(WebEngineFileSystemAccessRequest)
+    QML_NAMED_ELEMENT(webEngineFileSystemAccessRequest)
     QML_ADDED_IN_VERSION(6, 4)
     QML_UNCREATABLE("")
 };
 
+namespace ForeginWebEngineFileSystemAccessRequestNamespace
+{
+    Q_NAMESPACE
+    QML_FOREIGN_NAMESPACE(QWebEngineFileSystemAccessRequest)
+    QML_NAMED_ELEMENT(WebEngineFileSystemAccessRequest)
+    QML_ADDED_IN_VERSION(6, 4)
+};
+
 QT_END_NAMESPACE
 
 #endif // QQUICKWEBENGINEFOREIGNTYPES_H

From 200c64fbaa5a7c7689e8360b23b76407131d95df Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 16 Jan 2023 12:23:59 +0100
Subject: [PATCH 088/681] Add qml filesystem api tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There are three functions we use within file systems API, which
trigger dialogs:

  * window.showSaveFilePicker
  * window.showOpenFilePicker
  * window.showDirectoryPicker

Only first one was tested with widgets, therefore add tests which cover
use of api, and also test cover the found issues in previous commits.

Note we have separate test to cover file system dialogs coming from
<input> html tags in tst_filePicker

Change-Id: I4616efa84688ed471fb8c4566e49262bce945638
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 1a291c5579122e520af1a2cec263ebd12dcd2407)
---
 tests/auto/quick/qmltests/CMakeLists.txt      |   1 +
 .../quick/qmltests/data/filesystemapi.html    |  66 ++++++++++
 .../quick/qmltests/data/tst_filesystem.qml    | 124 ++++++++++++++++++
 tests/auto/quick/qmltests/tst_qmltests.cpp    |   9 ++
 4 files changed, 200 insertions(+)
 create mode 100644 tests/auto/quick/qmltests/data/filesystemapi.html
 create mode 100644 tests/auto/quick/qmltests/data/tst_filesystem.qml

diff --git a/tests/auto/quick/qmltests/CMakeLists.txt b/tests/auto/quick/qmltests/CMakeLists.txt
index 6f41b3e6d8f..542e44706d6 100644
--- a/tests/auto/quick/qmltests/CMakeLists.txt
+++ b/tests/auto/quick/qmltests/CMakeLists.txt
@@ -28,6 +28,7 @@ set(testList
     tst_favicon.qml
     tst_faviconDatabase.qml
     tst_filePicker.qml
+    tst_filesystem.qml
     tst_findText.qml
     tst_focusOnNavigation.qml
     tst_fullScreenRequest.qml
diff --git a/tests/auto/quick/qmltests/data/filesystemapi.html b/tests/auto/quick/qmltests/data/filesystemapi.html
new file mode 100644
index 00000000000..ab1a33e4d60
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/filesystemapi.html
@@ -0,0 +1,66 @@
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<title> Failed to Upload </title>
+</script>
+</head>
+
+<body>
+<button>Request File Picker</button>
+<script>
+ async function handleDirectoryEntry( dirHandle, out ) {
+     for await (const entry of dirHandle.values()) {
+         if (entry.kind === "file"){
+             const file = await entry.getFile();
+             out[ file.name ] = file;
+         }
+         if (entry.kind === "directory") {
+             const newHandle = await dirHandle.getDirectoryHandle( entry.name, { create: false } );
+             const newOut = out[ entry.name ] = {};
+             await handleDirectoryEntry( newHandle, newOut );
+         }
+     }
+ }
+    const button = document.querySelector('button');
+    button.addEventListener('click', async function() {
+    switch(window.dialogType) {
+        case "savePicker":
+           const saveFileHandle = await window.showSaveFilePicker();
+           const writable = await saveFileHandle.createWritable();
+           await writable.write(new Blob(['TEST_CONTENT']));
+           await writable.close();
+           console.log("TEST:DONE")
+           break;
+       case "filePicker":
+            let [openFileHandle] = await window.showOpenFilePicker();
+            const options = {};
+            options.mode = 'readwrite'
+            await openFileHandle.requestPermission(options)
+            const file = await openFileHandle.getFile();
+            const contents = await file.text();
+            console.log("TEST:" + contents)
+            console.log("TEST:DONE")
+            break;
+       case "directoryPicker":
+            console.log("start")
+            const dirHandle = await window.showDirectoryPicker();
+            for await (const entry of dirHandle.values()) {
+                if (entry.kind === "file"){
+                    continue
+                }
+                if (entry.kind === "directory") {
+                    console.log("TEST:" + entry.name)
+                }
+            }
+            console.log("TEST:DONE")
+            break;
+       default:
+    }
+    });
+    window.onload = function() {
+    window.dialogType = window.location.href.split('=')[1];
+    document.querySelector('button').focus()
+    }
+</script>
+</body>
+</html>
diff --git a/tests/auto/quick/qmltests/data/tst_filesystem.qml b/tests/auto/quick/qmltests/data/tst_filesystem.qml
new file mode 100644
index 00000000000..fa0da4457b9
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_filesystem.qml
@@ -0,0 +1,124 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+import "../../qmltests/data"
+import "../mock-delegates/TestParams"
+
+
+TestWebEngineView {
+    id: webEngineView
+    width: 400
+    height: 300
+    property var logs: []
+    property bool accessRequested: false
+    property url file: tempDir.pathUrl('file.txt')
+
+    onJavaScriptConsoleMessage: function(level, message, lineNumber, source) {
+        var pair = message.split(':');
+        if (pair.length == 2 && pair[0] == "TEST")
+            logs.push(pair[1]);
+    }
+
+    TempDir { id: tempDir }
+
+    TestCase {
+        id: testCase
+        name: "FileSystemAPI"
+        when: windowShown
+
+        function init() {
+            clearLog()
+            FilePickerParams.filePickerOpened = false
+            FilePickerParams.selectFiles = false
+            FilePickerParams.selectedFilesUrl = []
+            FilePickerParams.nameFilters = []
+            accessRequested = false;
+        }
+
+        function cleanup() {
+            clearLog()
+        }
+
+        function clearLog() {
+            logs = []
+        }
+
+        function logContainsDoneMarker() {
+            if (logs.indexOf("DONE") > -1)
+                return true
+            else
+                return false
+        }
+
+        function result() {
+            return logs[0]
+        }
+
+        function fileAccessRequest(request) {
+            testCase.verify(!accessRequested)
+            accessRequested = true
+            testCase.verify(request.filePath == file)
+            testCase.verify(request.accessFlags == WebEngineFileSystemAccessRequest.Write | WebEngineFileSystemAccessRequest.Read)
+            request.accept()
+        }
+
+        function directoryAccessRequest(request) {
+            testCase.verify(!accessRequested)
+            accessRequested = true
+            testCase.verify(request.filePath == tempDir.pathUrl())
+            testCase.verify(request.accessFlags == WebEngineFileSystemAccessRequest.Read)
+            request.accept()
+        }
+
+        function test_saveFile() {
+            webEngineView.fileSystemAccessRequested.connect(fileAccessRequest);
+            webEngineView.url = Qt.resolvedUrl("filesystemapi.html?dialog=savePicker");
+            verify(webEngineView.waitForLoadSucceeded());
+            FilePickerParams.selectFiles = true;
+            FilePickerParams.selectedFilesUrl.push(file);
+            keyClick(Qt.Key_Enter); // Open SaveDialog.
+            tryCompare(FilePickerParams, "filePickerOpened", true);
+            tryVerify(logContainsDoneMarker,2000)
+            // write access for save dialogs is automatically granted
+            verify(!accessRequested)
+            webEngineView.fileSystemAccessRequested.disconnect(fileAccessRequest);
+        }
+
+        function test_openFile() {
+            // first save the file before open
+            test_saveFile()
+            init()
+            webEngineView.fileSystemAccessRequested.connect(fileAccessRequest);
+            webEngineView.url = Qt.resolvedUrl("filesystemapi.html?dialog=filePicker");
+            verify(webEngineView.waitForLoadSucceeded());
+            FilePickerParams.selectFiles = true;
+            FilePickerParams.selectedFilesUrl.push(file);
+            keyClick(Qt.Key_Enter); // Open FileDialog.
+            tryCompare(FilePickerParams, "filePickerOpened", true);
+            tryVerify(logContainsDoneMarker,2000)
+            verify(logs.indexOf("TEST_CONTENT") > -1)
+            verify(accessRequested)
+            webEngineView.fileSystemAccessRequested.disconnect(fileAccessRequest);
+        }
+
+        function test_selectDirectory() {
+            tempDir.createDirectory("TEST_DIR")
+            webEngineView.fileSystemAccessRequested.connect(directoryAccessRequest);
+            webEngineView.url = Qt.resolvedUrl("filesystemapi.html?dialog=directoryPicker");
+            verify(webEngineView.waitForLoadSucceeded())
+            FilePickerParams.selectFiles = true;
+            FilePickerParams.selectedFilesUrl.push(tempDir.pathUrl());
+            keyClick(Qt.Key_Enter); // Open showDirectoryDialog.
+            tryCompare(FilePickerParams, "directoryPickerOpened", true);
+            tryVerify(logContainsDoneMarker,2000)
+            verify(logs.indexOf("TEST_DIR") > -1)
+            verify(accessRequested)
+            webEngineView.fileSystemAccessRequested.disconnect(directoryAccessRequest);
+        }
+
+    }
+}
diff --git a/tests/auto/quick/qmltests/tst_qmltests.cpp b/tests/auto/quick/qmltests/tst_qmltests.cpp
index 0d9e12cd684..9e928157e9f 100644
--- a/tests/auto/quick/qmltests/tst_qmltests.cpp
+++ b/tests/auto/quick/qmltests/tst_qmltests.cpp
@@ -105,6 +105,13 @@ class TempDir : public QObject {
         return tempDir.isValid() ? tempDir.path() : QString();
     }
 
+    Q_INVOKABLE QUrl pathUrl(const QString &filename = QString())
+    {
+        Q_ASSERT(tempDir.isValid());
+        return filename.isEmpty() ? QUrl::fromLocalFile(tempDir.path())
+                                  : QUrl::fromLocalFile(tempDir.filePath(filename));
+    }
+
     Q_INVOKABLE void removeRecursive(const QString dirname)
     {
         QDir dir(dirname);
@@ -118,6 +125,8 @@ class TempDir : public QObject {
         QDir().rmdir(dirname);
     }
 
+    Q_INVOKABLE void createDirectory(const QString dirname) { QDir(tempDir.path()).mkdir(dirname); }
+
 private:
     QTemporaryDir tempDir;
 };

From b7b85263c19e84c00aba322484f5986a880fb43e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 27 Feb 2023 13:44:54 +0100
Subject: [PATCH 089/681] Update Chromium

Submodule src/3rdparty 10e54a07..bdb22d05:
  * [Backport] CVE-2023-0931: Use after free in Video (2/2)
  * [Backport] CVE-2023-0931: Use after free in Video (1/2)
  * [Backport] Security bug 1414224
  * [Backport] CVE-2023-0928: Use after free in SwiftShader
  * [Backport] CVE-2023-0933: Integer overflow in PDF
  * [Backport] CVE-2023-0932: Use after free in WebRTC
  * [Backport] CVE-2023-0929: Use after free in Vulkan
  * [Backport] CVE-2023-0941: Use after free in Prompts
  * Add checksum to mailbox name in Release build too

Task-number: QTBUG-111363
Change-Id: I54ca00ef411d21eb02780f1096117d762472d5d1
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 52728ddf8840c1e786da6fc8d8a8918834d79a32)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 10e54a075e0..bdb22d05808 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 10e54a075e08cac2267d43dcd0e092019f91c83f
+Subproject commit bdb22d058087fee90a0609a86fc73a2a66a4db4d

From a75051ee7b4dd9ffe86e146d98c7d6412c756621 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 28 Feb 2023 15:31:20 +0100
Subject: [PATCH 090/681] Fix cross-compilation with system ffmpeg

We were using QT_FEATURE_system_ffmpeg which is not defined.
Use QT_FEATURE_webengine_system_ffmpeg instead.

Pick-to: dev
Change-Id: Ic7b6d4ea91dc8b29f344118c28932fa80a7a8d10
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 src/core/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index b1e99987eeb..e1e551a3ea4 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -468,7 +468,7 @@ foreach(arch ${archs})
 
             if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
                 check_thumb(armThumb)
-                if(NOT armThumb AND NOT QT_FEATURE_system_ffmpeg)
+                if(NOT armThumb AND NOT QT_FEATURE_webengine_system_ffmpeg)
                     list(APPEND gnArgArg media_use_ffmpeg=false use_webaudio_ffmpeg=false)
                 endif()
             endif()

From a21742ef6064c1e84ebc43468d253dd14d86bf02 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Thu, 16 Feb 2023 09:44:56 +0100
Subject: [PATCH 091/681] Pass system library paths to cmake

Generate a new rsp file for each cmake target
containing '-L' flags and pass them to cmake.

Pick-to: dev
Task-number: QTBUG-105053
Task-number: QTBUG-111225
Change-Id: Ib25c009795b776bc5f0f6e07fb89b932ef30b484
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 cmake/Functions.cmake               | 26 ++++++++++++++++++++++++--
 src/core/configure/BUILD.root.gn.in |  4 ++--
 src/pdf/configure/BUILD.root.gn.in  |  2 +-
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 04f32d2c6bd..538e2ffb484 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -453,9 +453,31 @@ function(add_linker_options target buildDir completeStatic)
                  "$<1:-Wl,--start-group $<$<CONFIG:${config}>:@${archives_rsp}> -Wl,--end-group>"
              )
          endif()
+
+         # we need only the '-L' flags from lflags.rsp, filter them
+         set(lflags_rsp "${buildDir}/${ninjaTarget}_lflags.rsp")
+         set(lflags_filtered_rsp "${buildDir}/${ninjaTarget}_lflags_filtered.rsp")
+         set(lflags_filter_script "${buildDir}/${ninjaTarget}_lflags_filter.cmake")
+         file(GENERATE OUTPUT ${lflags_filter_script}
+              CONTENT "file(STRINGS ${lflags_rsp} lflags)
+                       string(REGEX MATCHALL \"-L.*\" lflags_filtered \${lflags})
+                       file(WRITE ${lflags_filtered_rsp} \${lflags_filtered})"
+              FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+         )
+         add_custom_command(
+            OUTPUT ${lflags_filtered_rsp}
+            COMMAND ${CMAKE_COMMAND} -P ${lflags_filter_script}
+            DEPENDS ${lflags_filter_script} ${lflags_rsp}
+         )
+         add_custom_target(
+            run_${cmakeTarget}_${config}_lflags_filter
+            DEPENDS ${lflags_filtered_rsp}
+         )
+         add_dependencies(${cmakeTarget} run_${cmakeTarget}_${config}_lflags_filter)
+
          # linker here options are just to prevent processing it by cmake
          target_link_libraries(${cmakeTarget} PRIVATE
-             "$<1:-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings>"
+             "$<1:-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${lflags_filtered_rsp}> $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings>"
          )
     endif()
     if(MACOS)
@@ -1165,7 +1187,7 @@ function(add_gn_command)
     file(WRITE ${gnArgArgFile} ${arg_GN_ARGS})
 
     foreach(ninjaTarget ${arg_NINJA_TARGETS})
-        list(APPEND output ${ninjaTarget}_objects.rsp ${ninjaTarget}_archives.rsp ${ninjaTarget}_libs.rsp)
+        list(APPEND output ${ninjaTarget}_objects.rsp ${ninjaTarget}_archives.rsp ${ninjaTarget}_libs.rsp ${ninjaTarget}_lflags.rsp)
     endforeach()
     list(TRANSFORM output PREPEND "${arg_BUILDDIR}/")
 
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index bb4455fb773..01bf84b7015 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -97,7 +97,7 @@ config("cpp17_config") {
 }
 
 shared_library("QtWebEngineCore") {
-  rsp_types = [ "objects", "archives", "libs" ]
+  rsp_types = [ "objects", "archives", "libs", "lflags"]
   configs += [
     ":cpp17_config",
     ":QtWebEngineCore_config",
@@ -691,7 +691,7 @@ if (enable_extensions) {
 
 if (enable_spellcheck) {
   shared_library("convert_dict") {
-    rsp_types = [ "objects", "archives", "libs" ]
+    rsp_types = [ "objects", "archives", "libs", "lflags" ]
     configs += [ "//build/config/compiler:wexit_time_destructors" ]
     deps = [
       "//chrome/tools/convert_dict:lib",
diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in
index da41d80ccb5..3918c1e9f3e 100644
--- a/src/pdf/configure/BUILD.root.gn.in
+++ b/src/pdf/configure/BUILD.root.gn.in
@@ -51,7 +51,7 @@ config("cpp17_config") {
 
 static_library("QtPdf") {
   complete_static_lib = true
-  rsp_types = [ "objects", "archives", "libs" ]
+  rsp_types = [ "objects", "archives", "libs", "lflags" ]
   configs += [
     ":cpp17_config",
     ":QtPdf_config"

From 337b0f8311fb429b70e2375a32524fb405cd57c6 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 1 Mar 2023 10:42:44 +0000
Subject: [PATCH 092/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Idee2dda5e7506758ad4fe3d66fb99e665a276439
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b816a6847e9..37a88d6517b 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3a6dbd5913779a84787ff1380313a312d7bcd5b4
+    ref: e255074950130e7a5c763b4c8663acbb24190da5
     required: true
   ../qtpositioning:
-    ref: 2267f53c191be60d271cf78cdad3f3773c70cffb
+    ref: d6509cbfdef9706961be87c47b3fa7bb1eb54b71
     required: false
   ../qttools:
-    ref: 53a25dbdb7ac4031510b02171b8a30a59805f9ab
+    ref: 216b560023c23b85e906350e1acfae6985b043fd
     required: false
   ../qtwebchannel:
-    ref: db926e01a77050ee56d06254a28872284711e283
+    ref: 9dafbf95857a745f64dd53b350498ba65dd93c57
     required: false

From 098330a02d9bade9c8efa51d3e2649aaf4e219d6 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 2 Mar 2023 10:33:51 +0000
Subject: [PATCH 093/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I6bb2c8504364056598eb75f19eae4b95e8a33cb7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 37a88d6517b..b9859a161dd 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: e255074950130e7a5c763b4c8663acbb24190da5
+    ref: f66e7e755b68aeab5208310d250bb797954fc083
     required: true
   ../qtpositioning:
-    ref: d6509cbfdef9706961be87c47b3fa7bb1eb54b71
+    ref: ec09a99d3b81ee13d99773717f7dfdbcc999a894
     required: false
   ../qttools:
-    ref: 216b560023c23b85e906350e1acfae6985b043fd
+    ref: c6badf0210f853c31936db3406255534b26e5c2c
     required: false
   ../qtwebchannel:
-    ref: 9dafbf95857a745f64dd53b350498ba65dd93c57
+    ref: b023bd37e757e72a0ac0b96d873dd377d546dbcd
     required: false

From c7b02340eb95c1f1d725f577ff74118717cf17f9 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 3 Mar 2023 10:58:10 +0000
Subject: [PATCH 094/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ib781e697ffed3fad623f5cbf44b40a671919753d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b9859a161dd..1a7f14ec53a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f66e7e755b68aeab5208310d250bb797954fc083
+    ref: a4758ff6465d566ff340d1f2aec51979f03b1d3b
     required: true
   ../qtpositioning:
-    ref: ec09a99d3b81ee13d99773717f7dfdbcc999a894
+    ref: 2a7f7dc5d9be314f6657ea7b691313671df6c379
     required: false
   ../qttools:
-    ref: c6badf0210f853c31936db3406255534b26e5c2c
+    ref: 1d753bcb0a8a7cd983dcef8ca664fe82074a6237
     required: false
   ../qtwebchannel:
-    ref: b023bd37e757e72a0ac0b96d873dd377d546dbcd
+    ref: 7093393e51ea278b776e88694f65d7b0eb7e7b53
     required: false

From 6f6274359fd3de0464d0613aad2f9e74d7dacee1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 3 Mar 2023 14:10:19 +0100
Subject: [PATCH 095/681] Update Chromium

Submodule src/3rdparty bdb22d05..0dc29a1e:
  * Revert "Remove unused ProduceRGBEmulationGLTexture calls with its usage."

Fixes: QTBUG-111585
Change-Id: I2dabfbc1f79e4d61ff42273b001808c7237ab8cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 28a2cfe4116f7218b33df811b79536c0593ddda6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index bdb22d05808..0dc29a1eb2b 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit bdb22d058087fee90a0609a86fc73a2a66a4db4d
+Subproject commit 0dc29a1eb2b6ced3654cb781ee54fe3fee744f55

From e77bd5f84c0e15536f3d4acf65c2583f99dcc721 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 24 Feb 2023 14:57:52 +0100
Subject: [PATCH 096/681] Fix initialization of
 QWebEngineDownloadRequest::totalBytes for Widgets

QQuickWebEngineProfile already initializes totalBytes.

Also clean up QWebEngineDownloadRequestPrivate and fix typo in
documentation.

Fixes: QTBUG-104869
Change-Id: I8c4b79c076ddc63180960e22a9488b45ff6c4402
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 496647f7647571ca3cdf81b10ba418de0f06f34d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginedownloadrequest.cpp    | 19 +++---------
 src/core/api/qwebenginedownloadrequest_p.h    | 29 ++++++++++---------
 src/core/api/qwebengineprofile.cpp            |  5 +++-
 src/core/download_manager_delegate_qt.cpp     |  2 +-
 .../api/qquickwebengineprofile.cpp            |  4 ++-
 .../tst_qwebenginedownloadrequest.cpp         |  4 +--
 6 files changed, 30 insertions(+), 33 deletions(-)

diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp
index 97f6051b41d..e51fe7c0fd2 100644
--- a/src/core/api/qwebenginedownloadrequest.cpp
+++ b/src/core/api/qwebenginedownloadrequest.cpp
@@ -123,20 +123,9 @@ static inline QWebEngineDownloadRequest::DownloadInterruptReason toDownloadInter
     QWebEnginePage::download, QWebEnginePage::save
 */
 
-QWebEngineDownloadRequestPrivate::QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter, const QUrl &url)
-    : downloadFinished(false)
-    , downloadId(-1)
-    , downloadState(QWebEngineDownloadRequest::DownloadCancelled)
-    , savePageFormat(QWebEngineDownloadRequest::MimeHtmlSaveFormat)
-    , interruptReason(QWebEngineDownloadRequest::NoReason)
-    , downloadUrl(url)
-    , downloadPaused(false)
-    , isCustomFileName(false)
-    , totalBytes(-1)
-    , receivedBytes(0)
-    , isSavePageDownload(false)
-    , profileAdapter(adapter)
-    , adapterClient(nullptr)
+QWebEngineDownloadRequestPrivate::QWebEngineDownloadRequestPrivate(
+        QtWebEngineCore::ProfileAdapter *adapter)
+    : profileAdapter(adapter)
 {
 }
 
@@ -391,7 +380,7 @@ QWebEngineDownloadRequest::DownloadState QWebEngineDownloadRequest::state() cons
 }
 
 /*!
-    Returns the the total amount of data to download in bytes.
+    Returns the total amount of data to download in bytes.
 
     \c -1 means the size is unknown.
 */
diff --git a/src/core/api/qwebenginedownloadrequest_p.h b/src/core/api/qwebenginedownloadrequest_p.h
index 814af59cb0c..26afbc4adfd 100644
--- a/src/core/api/qwebenginedownloadrequest_p.h
+++ b/src/core/api/qwebenginedownloadrequest_p.h
@@ -31,32 +31,35 @@ QT_BEGIN_NAMESPACE
 class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineDownloadRequestPrivate
 {
 public:
-    QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter, const QUrl &url);
+    QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter);
     ~QWebEngineDownloadRequestPrivate();
 
     void update(const QtWebEngineCore::ProfileAdapterClient::DownloadItemInfo &info);
     void setFinished();
 
-    bool downloadFinished;
-    quint32 downloadId;
+    bool downloadFinished = false;
+    quint32 downloadId = -1;
     qint64 startTime;
-    QWebEngineDownloadRequest::DownloadState downloadState;
-    QWebEngineDownloadRequest::SavePageFormat savePageFormat;
-    QWebEngineDownloadRequest::DownloadInterruptReason interruptReason;
+    QWebEngineDownloadRequest::DownloadState downloadState =
+            QWebEngineDownloadRequest::DownloadCancelled;
+    QWebEngineDownloadRequest::SavePageFormat savePageFormat =
+            QWebEngineDownloadRequest::MimeHtmlSaveFormat;
+    QWebEngineDownloadRequest::DownloadInterruptReason interruptReason =
+            QWebEngineDownloadRequest::NoReason;
     QString downloadPath;
-    const QUrl downloadUrl;
+    QUrl downloadUrl;
     QString mimeType;
-    bool downloadPaused;
+    bool downloadPaused = false;
     QString suggestedFileName;
     QString downloadDirectory;
     QString downloadFileName;
-    bool isCustomFileName;
-    qint64 totalBytes;
-    qint64 receivedBytes;
-    bool isSavePageDownload;
+    bool isCustomFileName = false;
+    qint64 totalBytes = -1;
+    qint64 receivedBytes = 0;
+    bool isSavePageDownload = false;
     QWebEngineDownloadRequest *q_ptr;
     QPointer<QtWebEngineCore::ProfileAdapter> profileAdapter;
-    QtWebEngineCore::WebContentsAdapterClient *adapterClient;
+    QtWebEngineCore::WebContentsAdapterClient *adapterClient = nullptr;
     Q_DECLARE_PUBLIC(QWebEngineDownloadRequest)
 };
 
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
index fe783b75ef9..ab873e345ee 100644
--- a/src/core/api/qwebengineprofile.cpp
+++ b/src/core/api/qwebengineprofile.cpp
@@ -186,11 +186,14 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
     Q_Q(QWebEngineProfile);
 
     Q_ASSERT(!m_ongoingDownloads.contains(info.id));
-    QWebEngineDownloadRequestPrivate *itemPrivate = new QWebEngineDownloadRequestPrivate(m_profileAdapter, info.url);
+    QWebEngineDownloadRequestPrivate *itemPrivate =
+            new QWebEngineDownloadRequestPrivate(m_profileAdapter);
     itemPrivate->downloadId = info.id;
     itemPrivate->downloadState = info.accepted ? QWebEngineDownloadRequest::DownloadInProgress
                                                : QWebEngineDownloadRequest::DownloadRequested;
     itemPrivate->startTime = info.startTime;
+    itemPrivate->downloadUrl = info.url;
+    itemPrivate->totalBytes = info.totalBytes;
     itemPrivate->downloadDirectory = QFileInfo(info.path).path();
     itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
     itemPrivate->suggestedFileName = info.suggestedFileName;
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 3823268fb53..2838b59ff23 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -254,7 +254,7 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
         ++m_currentId,
         toQt(web_contents->GetURL()),
         download::DownloadItem::IN_PROGRESS,
-        0, /* totalBytes */
+        -1, /* totalBytes */
         0, /* receivedBytes */
         QStringLiteral("application/x-mimearchive"),
         suggestedFilePath,
diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp
index 1badd25becb..8292da894bc 100644
--- a/src/webenginequick/api/qquickwebengineprofile.cpp
+++ b/src/webenginequick/api/qquickwebengineprofile.cpp
@@ -209,10 +209,12 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
     Q_Q(QQuickWebEngineProfile);
 
     Q_ASSERT(!m_ongoingDownloads.contains(info.id));
-    QWebEngineDownloadRequestPrivate *itemPrivate = new QWebEngineDownloadRequestPrivate(m_profileAdapter, info.url);
+    QWebEngineDownloadRequestPrivate *itemPrivate =
+            new QWebEngineDownloadRequestPrivate(m_profileAdapter);
     itemPrivate->downloadId = info.id;
     itemPrivate->downloadState = QWebEngineDownloadRequest::DownloadRequested;
     itemPrivate->startTime = info.startTime;
+    itemPrivate->downloadUrl = info.url;
     itemPrivate->totalBytes = info.totalBytes;
     itemPrivate->mimeType = info.mimeType;
     itemPrivate->downloadDirectory = QFileInfo(info.path).path();
diff --git a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
index 1c2268b311d..c81a27b3aaf 100644
--- a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
+++ b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
@@ -415,7 +415,7 @@ void tst_QWebEngineDownloadRequest::downloadLink()
     ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
         QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
         QCOMPARE(item->isFinished(), false);
-        QCOMPARE(item->totalBytes(), -1);
+        QCOMPARE(item->totalBytes(), fileContents.size());
         QCOMPARE(item->receivedBytes(), 0);
         QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
         QCOMPARE(item->isSavePageDownload(), false);
@@ -526,7 +526,7 @@ void tst_QWebEngineDownloadRequest::downloadTwoLinks()
     ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
         QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
         QCOMPARE(item->isFinished(), false);
-        QCOMPARE(item->totalBytes(), -1);
+        QCOMPARE(item->totalBytes(), 5); // strlen("fileN")
         QCOMPARE(item->receivedBytes(), 0);
         QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
         QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat);

From a814e703c3c60580528f80c63fa55a2af73e402e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 8 Mar 2023 13:47:08 +0000
Subject: [PATCH 097/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I5798c5042f19f3d37e9f8411486a5e9e62b2c69d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 1a7f14ec53a..60c09af7bc1 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a4758ff6465d566ff340d1f2aec51979f03b1d3b
+    ref: 4309a8fb349bd9adfee77fe7a6fb6491a59f68fe
     required: true
   ../qtpositioning:
-    ref: 2a7f7dc5d9be314f6657ea7b691313671df6c379
+    ref: d723336c4a5fd382f0fcbdacec59f45401b597f2
     required: false
   ../qttools:
-    ref: 1d753bcb0a8a7cd983dcef8ca664fe82074a6237
+    ref: e65b83771a86bc5010e0f09b9c8b4553f26ba719
     required: false
   ../qtwebchannel:
-    ref: 7093393e51ea278b776e88694f65d7b0eb7e7b53
+    ref: 7979636487362aa2704327928b889d353903dc0b
     required: false

From 2eceff159d71d12bdae677958754422abbf42a38 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sat, 11 Mar 2023 07:46:50 +0000
Subject: [PATCH 098/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I941d00e60fb719830cc5cbb4a6ded9814c6a9a29
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 60c09af7bc1..536306c3fba 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4309a8fb349bd9adfee77fe7a6fb6491a59f68fe
+    ref: a96026a317c5fc4313a174d66f58fed3aea1a076
     required: true
   ../qtpositioning:
-    ref: d723336c4a5fd382f0fcbdacec59f45401b597f2
+    ref: f43183c2a2240a3013029ff7d2f4a38aef989b85
     required: false
   ../qttools:
-    ref: e65b83771a86bc5010e0f09b9c8b4553f26ba719
+    ref: e7efd30f68bc26356031d2686f69a437b53ae1bc
     required: false
   ../qtwebchannel:
-    ref: 7979636487362aa2704327928b889d353903dc0b
+    ref: ec5dd38152a3e1b980d6613c7dbe34f1eb26e3da
     required: false

From aa3579d3838e60ffc0e912c84c1d787c405c42e8 Mon Sep 17 00:00:00 2001
From: Andreas Eliasson <andreas.eliasson@qt.io>
Date: Wed, 1 Mar 2023 12:24:16 +0100
Subject: [PATCH 099/681] Doc: Fix wrong WebEngineCertificateError property
 name

The correct property name should be type, not error.

Fixes: QTBUG-111574
Change-Id: I276823f5bc664a99153b31e5bba36ae34608a9b9
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 1d60666419773ee91638c5666650a4fb62f22468)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-overview.qdoc                  | 2 +-
 src/webenginequick/doc/src/webengine_certificate_error.qdoc | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/doc/src/qtwebengine-overview.qdoc b/src/core/doc/src/qtwebengine-overview.qdoc
index 193116b3ea0..2e127240436 100644
--- a/src/core/doc/src/qtwebengine-overview.qdoc
+++ b/src/core/doc/src/qtwebengine-overview.qdoc
@@ -216,7 +216,7 @@
     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::Type} enumerations
+    The \l{WebEngineCertificateError::type} and \l{QWebEngineCertificateError::Type} enumerations
     provide information about the types of certificate errors that might occur. The errors can be
     handled by using the WebEngineView::certificateError QML method or by connecting to the
     QWebEnginePage::certificateError signal.
diff --git a/src/webenginequick/doc/src/webengine_certificate_error.qdoc b/src/webenginequick/doc/src/webengine_certificate_error.qdoc
index aec8e2d42cd..93bad9fb113 100644
--- a/src/webenginequick/doc/src/webengine_certificate_error.qdoc
+++ b/src/webenginequick/doc/src/webengine_certificate_error.qdoc
@@ -9,7 +9,7 @@
 
     \brief A utility type for ignoring certificate errors or rejecting erroneous certificates.
 
-    This QML type contains information about a certificate error that occurred. The \l error
+    This QML type contains information about a certificate error that occurred. The \l type
     property holds the reason that the error occurred and the \l description property holds a
     short localized description of the error. The \l url property holds the URL that triggered
     the error.
@@ -49,7 +49,7 @@
     The URL that triggered the error.
  */
 /*!
-    \qmlproperty enumeration WebEngineCertificateError::error
+    \qmlproperty enumeration WebEngineCertificateError::type
     \readonly
 
     The type of the error.

From 50e191818f4a0c23e830ea903307acc9ea6e8d3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Sat, 11 Mar 2023 20:58:54 +0100
Subject: [PATCH 100/681] Update Chromium

Submodule src/3rdparty 0dc29a1e..fdcde546:

  * Revert "DrawingBuffer: Remove RGB emulation support"
  * Fixup: "Revert "Remove unused ProduceRGBEmulationGLTexture calls with its usage.""
  * FIXUP: Workaround debug iterator issues with MSVC

Fixes: QTBUG-111585
Fixes: QTBUG-111784
Change-Id: I2493eb6f0defdba6460128e15b1f810398bab3ca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8fd4e9fc616c71d84ab578808e89bbb5dd28c836)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 0dc29a1eb2b..fdcde546b2a 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 0dc29a1eb2b6ced3654cb781ee54fe3fee744f55
+Subproject commit fdcde546b2af3d996e26c1ca99dbcd1f525a9d41

From 819b85b38900347e35948218fc1ee6ddf17335c7 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 6 Mar 2023 13:23:28 +0100
Subject: [PATCH 101/681] Replace Q_OS_WIN guards with BUILDFLAG(IS_WIN)

vulkan_implementation_qt.cpp doesn't include any Qt header and Q_OS_WIN
remains undefined on Windows.

Also include vulkan/vulkan.h for the WIN32 vulkan macros.

Change-Id: I66b9f134194526c055309bb72bd3a452e2b9a2b2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7b11561d8f63d521d4bc0e6fb005182cdfe93f82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../compositor/vulkan_implementation_qt.cpp     | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/core/compositor/vulkan_implementation_qt.cpp b/src/core/compositor/vulkan_implementation_qt.cpp
index f24ec334be8..3cf764b21ee 100644
--- a/src/core/compositor/vulkan_implementation_qt.cpp
+++ b/src/core/compositor/vulkan_implementation_qt.cpp
@@ -10,6 +10,8 @@
 #include "gpu/vulkan/vulkan_util.h"
 #include "ui/gfx/gpu_fence.h"
 
+#include <vulkan/vulkan.h>
+
 namespace gpu {
 
 VulkanImplementationQt::VulkanImplementationQt() : VulkanImplementation(false) { }
@@ -25,12 +27,13 @@ bool VulkanImplementationQt::InitializeVulkanInstance(bool /*using_surface*/)
 
     auto env = base::Environment::Create();
     std::string vulkan_path;
-    if (!env->GetVar("QT_VULKAN_LIB", &vulkan_path))
-#ifdef Q_OS_WIN
+    if (!env->GetVar("QT_VULKAN_LIB", &vulkan_path)) {
+#if BUILDFLAG(IS_WIN)
         vulkan_path = "vulkan-1.dll";
 #else
         vulkan_path = "libvulkan.so.1";
 #endif
+    }
 
     if (!vulkan_instance_.Initialize(base::FilePath::FromUTF8Unsafe(vulkan_path),
                                      required_extensions, {})) {
@@ -66,7 +69,7 @@ std::vector<const char *> VulkanImplementationQt::GetRequiredDeviceExtensions()
 {
     return {
         VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME,
-#ifdef Q_OS_WIN
+#if BUILDFLAG(IS_WIN)
         VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
 #else
         VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
@@ -78,7 +81,7 @@ std::vector<const char *> VulkanImplementationQt::GetOptionalDeviceExtensions()
 {
     return {
         VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
-#ifdef Q_OS_WIN
+#if BUILDFLAG(IS_WIN)
         VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME,
 #else
         VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
@@ -102,7 +105,7 @@ VulkanImplementationQt::ExportVkFenceToGpuFence(VkDevice /*vk_device*/, VkFence
 VkSemaphore VulkanImplementationQt::CreateExternalSemaphore(VkDevice vk_device)
 {
     return CreateExternalVkSemaphore(
-#ifdef Q_OS_WIN
+#if BUILDFLAG(IS_WIN)
             vk_device, VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT);
 #else
             vk_device, VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
@@ -119,7 +122,7 @@ SemaphoreHandle VulkanImplementationQt::GetSemaphoreHandle(VkDevice vk_device,
                                                            VkSemaphore vk_semaphore)
 {
     return GetVkSemaphoreHandle(vk_device, vk_semaphore,
-#ifdef Q_OS_WIN
+#if BUILDFLAG(IS_WIN)
                                 VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT);
 #else
                                 VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
@@ -128,7 +131,7 @@ SemaphoreHandle VulkanImplementationQt::GetSemaphoreHandle(VkDevice vk_device,
 
 VkExternalMemoryHandleTypeFlagBits VulkanImplementationQt::GetExternalImageHandleType()
 {
-#ifdef Q_OS_WIN
+#ifdef BUILDFLAG(IS_WIN)
     return VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT;
 #else
     return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;

From 03dd75a372f6b649f089c8d2e6c9e119c8e66875 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Fri, 17 Mar 2023 20:12:11 +0000
Subject: [PATCH 102/681] Doc: Use the new \attribution command in licensing
 documentation

Since Qt 6.5, marking a \page as an attribution page is done with
a separate command, \attribution. Update the Chromium licensing
template and the Qt WebEngine licensing page to use the new command.

Fixes: QTBUG-112007
Change-Id: I1eac67bee72c078782d9334a604002011e1c3c86
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
(cherry picked from commit 81939a5cf76981ee67c7d2d7e73388d75475a0f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/about_credits_entry.tmpl      | 3 ++-
 src/core/doc/src/qwebengine-licensing.qdoc | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/core/doc/about_credits_entry.tmpl b/src/core/doc/about_credits_entry.tmpl
index 2bb9cff4e55..aa94f2945d1 100644
--- a/src/core/doc/about_credits_entry.tmpl
+++ b/src/core/doc/about_credits_entry.tmpl
@@ -1,5 +1,6 @@
 /*!
-\page qtwebengine-3rdparty-{{name-sanitized}}.html attribution
+\page qtwebengine-3rdparty-{{name-sanitized}}.html
+\attribution
 \ingroup qtwebengine-licensing
 \brief {{license-type}}
 \title {{name}}
diff --git a/src/core/doc/src/qwebengine-licensing.qdoc b/src/core/doc/src/qwebengine-licensing.qdoc
index 2b1bd284572..d498500220a 100644
--- a/src/core/doc/src/qwebengine-licensing.qdoc
+++ b/src/core/doc/src/qwebengine-licensing.qdoc
@@ -18,7 +18,8 @@ Third party licenses included in the sources are:
 */
 
 /*!
-\page qtwebengine-3rdparty-chromium-global.html attribution
+\page qtwebengine-3rdparty-chromium-global.html
+\attribution
 \ingroup qtwebengine-licensing
 \title Chromium License
 \brief BSD

From 7f2646d635576b0260b3de5153708cfac6c11ba1 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 15 Mar 2023 19:41:56 +0100
Subject: [PATCH 103/681] QtPDF multipage example: open the search results tab
 during search

It's unfortunate that we need to use a numeric index; but it will be ok
as long as we don't rearrange tabs any more.

Fixes: QTBUG-106359
Change-Id: I036c45a6de7690e9ed122c74448a89da343f10d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 76b01c4aeab77c4ab4e052d31141e010b9a73111)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/pdf/multipage/viewer.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index fcf326869f4..d0b0a726354 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -412,7 +412,7 @@ ApplicationWindow {
                 Layout.bottomMargin: 3
                 onAccepted: {
                     sidebar.open()
-                    sidebarTabs.setCurrentIndex(0)
+                    sidebarTabs.setCurrentIndex(1)
                 }
                 Image {
                     visible: searchField.text !== ""

From a2f5f880358b1d5fe0af1b7c7595ac8649a8a3ad Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 20 Mar 2023 06:07:28 +0000
Subject: [PATCH 104/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ia5d8a3f39798ae48c06262a09a3b01594b4de33d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 536306c3fba..e6363445137 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a96026a317c5fc4313a174d66f58fed3aea1a076
+    ref: 9aac0e66f5378af875beb43670d95613fe04accd
     required: true
   ../qtpositioning:
-    ref: f43183c2a2240a3013029ff7d2f4a38aef989b85
+    ref: 5cab7c63d25957fb4c6b8c00bcb2a72d2068a621
     required: false
   ../qttools:
-    ref: e7efd30f68bc26356031d2686f69a437b53ae1bc
+    ref: 6d79c13de6d408075fd1bf0d704f92e3c51a7f20
     required: false
   ../qtwebchannel:
-    ref: ec5dd38152a3e1b980d6613c7dbe34f1eb26e3da
+    ref: 779ca5d7f009b5b8d4e9666a08333a13d4468ea4
     required: false

From 27034b86753805e2b560347be4c7e0af8e74fb10 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 20 Feb 2023 10:21:54 +0100
Subject: [PATCH 105/681] Blacklist mulipageview tests on android

Password test does not pass on emulator, the same issue
exists already on windows.

Navigation uses hardcoded values for event which ends with
"Mouse event at 465, 65 occurs outside target window (320x616)"
due to smaller screen of android emulator.

Blacklist tests for now.

Task-number: QTBUG-83459
Task-number: QTBUG-106072
Task-number: QTBUG-111306
Change-Id: Iacc4c7711d58b0ffb6cdda3474b4d59b628ca5f7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3a1d4eac6f1c2ce38b66c2a1ca3525ee34e2cf4a)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 tests/auto/pdfquick/multipageview/BLACKLIST | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/auto/pdfquick/multipageview/BLACKLIST b/tests/auto/pdfquick/multipageview/BLACKLIST
index b608bef1cca..cfdd7e2e519 100644
--- a/tests/auto/pdfquick/multipageview/BLACKLIST
+++ b/tests/auto/pdfquick/multipageview/BLACKLIST
@@ -1,3 +1,12 @@
 # QTBUG-106072
 [password]
 windows
+android
+
+# QTBUG-111306
+[navigation:click links and go back, twice]
+android
+
+# QTBUG-111306
+[navigation:click two links in series and then go back]
+android

From f576588c85f4f635d38f56a1db087a50c19add42 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 15 Mar 2023 17:06:23 +0100
Subject: [PATCH 106/681] Increase timeout in proxy pac test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

According to ci this test would succeed in 13000ms on qemu.

Fixes: QTBUG-111939
Pick-to: dev
Change-Id: I21911920961a885eee38dcd3261e46b497a1c251
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 tests/auto/widgets/proxypac/tst_proxypac.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/widgets/proxypac/tst_proxypac.cpp b/tests/auto/widgets/proxypac/tst_proxypac.cpp
index afdccdea8af..43ccbf028a3 100644
--- a/tests/auto/widgets/proxypac/tst_proxypac.cpp
+++ b/tests/auto/widgets/proxypac/tst_proxypac.cpp
@@ -50,7 +50,7 @@ void tst_ProxyPac::proxypac()
     QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
     page.load(QUrl("https://contribute.qt-project.org"));
 
-    QTRY_VERIFY_WITH_TIMEOUT(!spyFinished.isEmpty(), 100000);
+    QTRY_VERIFY_WITH_TIMEOUT(!spyFinished.isEmpty(), 200000);
 
 }
 

From 89f45970055568a7468b696423778b659bbc1cf5 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 20 Feb 2023 10:19:45 +0100
Subject: [PATCH 107/681] Add TESTDATA to qtpdf tests and fix data url
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Make cmake aware of test data, this will make data
deployable on android.

Task-number: QTBUG-83459
Change-Id: Id4271f54f8351e955a6ee57c3a36656d69a2a682
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 404edc4e655701b21bb52835536a0fadf8269ce7)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt         | 3 +++
 tests/auto/pdf/qpdfdocument/CMakeLists.txt              | 4 ++++
 tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt          | 2 ++
 tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt           | 2 ++
 tests/auto/pdfquick/multipageview/tst_multipageview.cpp | 8 ++++----
 5 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt b/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt
index d0dc966f073..729bc91382c 100644
--- a/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt
+++ b/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt
@@ -8,5 +8,8 @@ qt_internal_add_test(tst_qpdfbookmarkmodel
         Qt::Gui
         Qt::Network
         Qt::Pdf
+    TESTDATA
+        pdf-sample.bookmarks.pdf
+        pdf-sample.bookmarks_pages.pdf
 )
 
diff --git a/tests/auto/pdf/qpdfdocument/CMakeLists.txt b/tests/auto/pdf/qpdfdocument/CMakeLists.txt
index 0d49bc6f1c1..aadc192b384 100644
--- a/tests/auto/pdf/qpdfdocument/CMakeLists.txt
+++ b/tests/auto/pdf/qpdfdocument/CMakeLists.txt
@@ -9,4 +9,8 @@ qt_internal_add_test(tst_qpdfdocument
         Qt::Network
         Qt::PrintSupport
         Qt::Pdf
+    TESTDATA
+        pdf-sample.protected.pdf
+        pdf-sample.metadata.pdf
+        test.pdf
 )
diff --git a/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt b/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt
index 02956307181..53a68fe5918 100644
--- a/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt
+++ b/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt
@@ -8,5 +8,7 @@ qt_internal_add_test(tst_qpdfpagerenderer
         Qt::Gui
         Qt::Network
         Qt::Pdf
+    TESTDATA
+        pdf-sample.pagerenderer.pdf
 )
 
diff --git a/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt b/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt
index 15fecd21b23..3a0486be529 100644
--- a/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt
+++ b/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt
@@ -8,4 +8,6 @@ qt_internal_add_test(tst_qpdfsearchmodel
         Qt::Gui
         Qt::Network
         Qt::Pdf
+    TESTDATA
+        test.pdf
 )
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index 764a6995987..9cd8e3e2d8b 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -75,7 +75,7 @@ void tst_MultiPageView::internalLink()
     QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
     QQuickItem *pdfView = window.rootObject();
     QVERIFY(pdfView);
-    pdfView->setProperty("source", "bookmarksAndLinks.pdf");
+    pdfView->setProperty("source", testFileUrl("bookmarksAndLinks.pdf"));
     QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
 
     QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
@@ -259,7 +259,7 @@ void tst_MultiPageView::password()
     // actual QPdfDocument::pageCountChanged(int), for comparison with the illusory QQuickPdfDocument::pageCountChanged
     QVERIFY(extPageCountChangedSpy.isValid());
 
-    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s));
+    QVERIFY(pdfView->setProperty("source", testFileUrl(u"pdf-sample.protected.pdf"_s)));
 
     QTRY_COMPARE(passwordRequiredSpy.size(), 1);
     qCDebug(lcTests) << "error while awaiting password" << doc->error()
@@ -291,7 +291,7 @@ void tst_MultiPageView::selectionAndClipboard()
     QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
     QVERIFY(doc);
     QVERIFY(doc->setProperty("password", u"Qt"_s));
-    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s));
+    QVERIFY(pdfView->setProperty("source", testFileUrl((u"pdf-sample.protected.pdf"_s))));
     QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
 
     QVERIFY(QMetaObject::invokeMethod(pdfView, "selectAll"));
@@ -319,7 +319,7 @@ void tst_MultiPageView::search()
     QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
     QVERIFY(doc);
     QVERIFY(doc->setProperty("password", u"Qt"_s));
-    QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s));
+    QVERIFY(pdfView->setProperty("source", testFileUrl(u"pdf-sample.protected.pdf"_s)));
     QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
     QPdfSearchModel *searchModel = pdfView->property("searchModel").value<QPdfSearchModel*>();
     QVERIFY(searchModel);

From 0b08ead4f881e403fbf2f3ac54c1c1acb784bc69 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 31 Jan 2022 08:22:40 +0100
Subject: [PATCH 108/681] Add QtPdf android support

Task-number: QTBUG-83459
Change-Id: I39915206859f031dd78798eeb7b2b49f4f148452
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4717812788df2927818e671056642b58363d4b89)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 cmake/Functions.cmake  | 13 ++++++++++++-
 configure.cmake        |  7 ++++---
 src/pdf/CMakeLists.txt |  6 ++++--
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 538e2ffb484..d3f8862ce31 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -440,7 +440,7 @@ function(add_linker_options target buildDir completeStatic)
     set(archives_rsp "${buildDir}/${ninjaTarget}_archives.rsp")
     set(libs_rsp "${buildDir}/${ninjaTarget}_libs.rsp")
     set_target_properties(${cmakeTarget} PROPERTIES STATIC_LIBRARY_OPTIONS "@${objects_rsp}")
-    if(LINUX)
+    if(LINUX OR ANDROID)
          get_gn_arch(cpu ${TEST_architecture_arch})
          if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm" AND ${config} STREQUAL "Debug")
              target_link_options(${cmakeTarget} PRIVATE "LINKER:--long-plt")
@@ -946,6 +946,14 @@ macro(append_compiler_linker_sdk_setup)
                 CONDITION QT_FEATURE_stdlib_libcpp
             )
         endif()
+        if(ANDROID)
+            list(APPEND gnArgArg
+                android_ndk_root="${CMAKE_ANDROID_NDK}"
+                android_ndk_version="${CMAKE_ANDROID_NDK_VERSION}"
+                clang_use_default_sample_profile=false
+                #android_ndk_major_version=22
+            )
+        endif()
     else()
         if(QT_FEATURE_use_lld_linker)
             get_filename_component(clangBasePath ${CMAKE_LINKER} DIRECTORY)
@@ -1059,6 +1067,9 @@ macro(append_toolchain_setup)
             list(APPEND gnArgArg target_sysroot="${sysroot}" target_os="ios")
         endif()
     endif()
+    if(ANDROID)
+        list(APPEND gnArgArg target_os="android")
+    endif()
 endmacro()
 
 
diff --git a/configure.cmake b/configure.cmake
index f1b971080eb..a9ac87543d1 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -474,8 +474,8 @@ add_check_for_support(
 )
 add_check_for_support(
    MODULES QtPdf
-   CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS
-   MESSAGE "Build can be done only on Linux, Windows, macOS or iOS."
+   CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS OR ANDROID
+   MESSAGE "Build can be done only on Linux, Windows, macO, iOS and Android."
 )
 if(LINUX AND CMAKE_CROSSCOMPILING)
    get_gn_arch(testArch ${TEST_architecture_arch})
@@ -584,7 +584,8 @@ add_check_for_support(
        (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND
           CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) OR
        (MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR
-       (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
+       (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR
+       (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
    MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )
 
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 1d42ee7272c..7ca252e29dd 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -114,11 +114,13 @@ foreach(arch ${archs})
           strip_absolute_paths_from_debug_symbols=false
         )
 
-        if(LINUX)
+        if(LINUX OR ANDROID)
             list(APPEND gnArgArg
                 is_cfi=false
                 ozone_auto_platforms=false
-                use_gnome_keyring=false)
+                use_gnome_keyring=false
+                enable_vr=false
+            )
             extend_gn_list(gnArgArg
                 ARGS use_system_icu
                 CONDITION QT_FEATURE_webengine_system_icu

From c41c62d91a118cbb64a6033f1b42f768c24abacd Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 20 Feb 2023 23:19:39 +0100
Subject: [PATCH 109/681] Disable android build on windows
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Windows android builds are currently not supported
as upstream officially only supports android cross
compilation on linux. Moreover qt ci requires mingw
host build for android builds.

Task-number: QTBUG-83459
Task-number: QTBUG-111362
Change-Id: Icfa90d05002ab1af2a6173d965193062d4cd5526
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 42cab4680cf5d344ee99dd5851a66d25fe491d5b)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 configure.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index a9ac87543d1..0b216a830c7 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -474,8 +474,8 @@ add_check_for_support(
 )
 add_check_for_support(
    MODULES QtPdf
-   CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS OR ANDROID
-   MESSAGE "Build can be done only on Linux, Windows, macO, iOS and Android."
+   CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS OR (ANDROID AND NOT CMAKE_HOST_WIN32)
+   MESSAGE "Build can be done only on Linux, Windows, macO, iOS and Android(on non-Windows hosts only)."
 )
 if(LINUX AND CMAKE_CROSSCOMPILING)
    get_gn_arch(testArch ${TEST_architecture_arch})

From c9a9c55dcc51f0333258acd0e4d5bc04d7c77933 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 24 Feb 2023 13:08:21 +0100
Subject: [PATCH 110/681] Fix not working password test for QPdfQuick

In qml url can have different schemas like 'qrc'
'file' 'assets'. Make correct conversion so
file can be loaded.

Note check isLocalFile() is not true for qrc scheme.

Fixes: QTBUG-106072
Change-Id: I4dcc969e4c6d9b3f58ea5d81d20d8e81b55edfde
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit efbb12954cf6e581b6b29bed2fa2bb26e1cfab71)
---
 src/pdfquick/qquickpdfdocument.cpp          | 7 ++++---
 tests/auto/pdfquick/multipageview/BLACKLIST | 5 -----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index 368725a8e76..5564a74748a 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -8,6 +8,7 @@
 #include <QtQml/qqmlcontext.h>
 #include <QtQml/qqmlengine.h>
 #include <QtQuick/qquickitem.h>
+#include <QtQml/qqmlfile.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -41,9 +42,9 @@ void QQuickPdfDocument::classBegin()
 {
     m_doc = static_cast<QPdfDocument *>(qmlExtendedObject(this));
     Q_ASSERT(m_doc);
-    connect(m_doc, &QPdfDocument::passwordChanged, this, [this]() {
-        if (resolvedSource().isValid() && resolvedSource().isLocalFile())
-            m_doc->load(resolvedSource().path());
+    connect(m_doc, &QPdfDocument::passwordChanged, this, [this]() -> void {
+        if (resolvedSource().isValid())
+            m_doc->load(QQmlFile::urlToLocalFileOrQrc(resolvedSource()));
     });
     connect(m_doc, &QPdfDocument::statusChanged, this, [this] (QPdfDocument::Status status) {
         emit errorChanged();
diff --git a/tests/auto/pdfquick/multipageview/BLACKLIST b/tests/auto/pdfquick/multipageview/BLACKLIST
index cfdd7e2e519..9012902f6cb 100644
--- a/tests/auto/pdfquick/multipageview/BLACKLIST
+++ b/tests/auto/pdfquick/multipageview/BLACKLIST
@@ -1,8 +1,3 @@
-# QTBUG-106072
-[password]
-windows
-android
-
 # QTBUG-111306
 [navigation:click links and go back, twice]
 android

From 8d30a94e6315602119c22d5d21d571e98fe7e254 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 15 Mar 2023 16:12:43 +0100
Subject: [PATCH 111/681] QtPdf: Support more schemas when loading documents
 with qml

This is follow up after efbb12954cf6e58, use same handling as for
reloading on password change.

Fixes: QTBUG-87275
Change-Id: I1046f57f61346a2cbc03f50ca453209a855ea561
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 33fac9305d4a542b389d0d06ec07f05fd9699db2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfquick/qquickpdfdocument.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index 5564a74748a..492c320d6ac 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -74,10 +74,8 @@ void QQuickPdfDocument::setSource(QUrl source)
     emit sourceChanged();
     const QQmlContext *context = qmlContext(this);
     m_resolvedSource = context ? context->resolvedUrl(source) : source;
-    if (source.scheme() == QLatin1String("qrc"))
-        m_doc->load(QLatin1Char(':') + m_resolvedSource.path());
-    else
-        m_doc->load(m_resolvedSource.toLocalFile());
+    if (m_resolvedSource.isValid())
+        m_doc->load(QQmlFile::urlToLocalFileOrQrc(m_resolvedSource));
 }
 
 /*!

From 26bcddfbd1220548eaeb8d86059dc29eb124c94f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 22 Mar 2023 11:10:50 +0000
Subject: [PATCH 112/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ic4e53e37ade848b0a175d38cb35e6a0af7309b89
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index e6363445137..32e9ac471b8 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 9aac0e66f5378af875beb43670d95613fe04accd
+    ref: 6fea78bca76e50b4eb8a0d8f6a43430d4f52f24a
     required: true
   ../qtpositioning:
-    ref: 5cab7c63d25957fb4c6b8c00bcb2a72d2068a621
+    ref: 91c13402de87797674bf2db034bcd0b63b877b69
     required: false
   ../qttools:
-    ref: 6d79c13de6d408075fd1bf0d704f92e3c51a7f20
+    ref: 96babe3674632c3ffe1aebe49a5772d3c073a976
     required: false
   ../qtwebchannel:
-    ref: 779ca5d7f009b5b8d4e9666a08333a13d4468ea4
+    ref: b5aae6fd460c0777753044b8f832efadf0bc779e
     required: false

From 733581bbbd03def6fc3c825854586004ddeae4ce Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 17 Mar 2023 08:45:13 +0100
Subject: [PATCH 113/681] Move widgets minimal example to manual tests

Task-number: QTBUG-108751
Change-Id: I6e237b04d1f6a19f64516cd45aabe4d28099abd5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 34ebe8be93ab10766d034e5a3943a12c8de3a58e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/CMakeLists.txt      |   1 -
 .../webenginewidgets/minimal/CMakeLists.txt   |  36 ------------
 .../minimal/doc/images/minimal-example.png    | Bin 89294 -> 0 bytes
 .../minimal/doc/src/minimal.qdoc              |  55 ------------------
 .../webenginewidgets/webenginewidgets.pro     |   1 -
 .../doc/snippets/simple/main.cpp              |  11 ++--
 .../doc/src/qtwebenginewidgets-module.qdoc    |   5 ++
 tests/manual/CMakeLists.txt                   |   1 +
 tests/manual/examples/CMakeLists.txt          |   1 +
 tests/manual/examples/widgets/CMakeLists.txt  |   1 +
 .../examples/widgets/minimal/CMakeLists.txt   |  24 ++++++++
 .../manual/examples/widgets}/minimal/main.cpp |   0
 .../examples/widgets}/minimal/minimal.pro     |   0
 13 files changed, 38 insertions(+), 98 deletions(-)
 delete mode 100644 examples/webenginewidgets/minimal/CMakeLists.txt
 delete mode 100644 examples/webenginewidgets/minimal/doc/images/minimal-example.png
 delete mode 100644 examples/webenginewidgets/minimal/doc/src/minimal.qdoc
 create mode 100644 tests/manual/examples/CMakeLists.txt
 create mode 100644 tests/manual/examples/widgets/CMakeLists.txt
 create mode 100644 tests/manual/examples/widgets/minimal/CMakeLists.txt
 rename {examples/webenginewidgets => tests/manual/examples/widgets}/minimal/main.cpp (100%)
 rename {examples/webenginewidgets => tests/manual/examples/widgets}/minimal/minimal.pro (100%)

diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt
index c3d4665584a..0b5757e35a8 100644
--- a/examples/webenginewidgets/CMakeLists.txt
+++ b/examples/webenginewidgets/CMakeLists.txt
@@ -1,7 +1,6 @@
 # Copyright (C) 2022 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
-qt_internal_add_example(minimal)
 qt_internal_add_example(contentmanipulation)
 qt_internal_add_example(cookiebrowser)
 qt_internal_add_example(notifications)
diff --git a/examples/webenginewidgets/minimal/CMakeLists.txt b/examples/webenginewidgets/minimal/CMakeLists.txt
deleted file mode 100644
index 68642c6381c..00000000000
--- a/examples/webenginewidgets/minimal/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(minimal LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/minimal-widgets")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
-
-qt_add_executable(minimal-widgets
-    main.cpp
-)
-
-set_target_properties(minimal-widgets PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(minimal-widgets PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebEngineWidgets
-)
-
-install(TARGETS minimal-widgets
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginewidgets/minimal/doc/images/minimal-example.png b/examples/webenginewidgets/minimal/doc/images/minimal-example.png
deleted file mode 100644
index 18ac9b17723f2adf8ed56678b3a84db897205415..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
deleted file mode 100644
index 5fb5f8be321..00000000000
--- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginewidgets/minimal
-    \title WebEngine Widgets Minimal Example
-    \ingroup webengine-widgetexamples
-    \brief Displays a web page using \QWE Widgets.
-
-    \image minimal-example.png
-
-    \e {WebEngine Widgets Minimal Example} demonstrates how to use
-    \l{QWebEngineView} to render a web page. It shows the minimum amount of code
-    needed to load and display an HTML page, and can be used as a basis for
-    further experimentation.
-
-    \include examples-run.qdocinc
-
-    \section1 The Code
-
-    We first define a \c commandLineUrlArgument function that returns the URL to open.
-    This is either the first positional argument given on the command line, or
-    \c https://www.qt.io as a fallback.
-
-    \quotefromfile webenginewidgets/minimal/main.cpp
-    \skipto #include
-
-    \printto int main
-
-    In the \c main function we first set the
-    \l{QCoreApplication::organizationName} property. This affects the locations
-    where \QWE stores persistent and cached data (see also
-    \l{QWebEngineProfile::cachePath} and
-    \l{QWebEngineProfile::persistentStoragePath}).
-
-    Next, we instantiate a QApplication and a QWebEngineView. The URL
-    to load is taken from \c commandLineUrlArgument and
-    loaded by calling \l QWebEngineView::setUrl. The view widget is
-    given a reasonable default size, and shown.
-    Finally, QApplication::exec() launches the main event loop.
-
-    \printuntil }
-
-    \section1 Requirements
-
-    The example requires a working internet connection to render
-    the \l{Qt Homepage}.
-    An optional system proxy should be picked up automatically.
-    However, for proxies that require a username or password,
-    you need to connect to
-    QWebEnginePage::proxyAuthenticationRequired.
-
-    \l{Qt WebEngine Widgets} uses the \l{Qt Quick Scene Graph} to compose the
-    page. Therefore, OpenGL support is required.
-*/
diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro
index cfddfdaaed5..119f6e1b17f 100644
--- a/examples/webenginewidgets/webenginewidgets.pro
+++ b/examples/webenginewidgets/webenginewidgets.pro
@@ -3,7 +3,6 @@ QT_FOR_CONFIG += webenginecore webenginecore-private network-private
 TEMPLATE=subdirs
 
 SUBDIRS += \
-    minimal \
     contentmanipulation \
     cookiebrowser \
     notifications \
diff --git a/src/webenginewidgets/doc/snippets/simple/main.cpp b/src/webenginewidgets/doc/snippets/simple/main.cpp
index f887aabaa43..08613906b9a 100644
--- a/src/webenginewidgets/doc/snippets/simple/main.cpp
+++ b/src/webenginewidgets/doc/snippets/simple/main.cpp
@@ -1,18 +1,19 @@
 // Copyright (C) 2016 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
+//! [Minimal Example]
 #include <QApplication>
-#include <QUrl>
 #include <QWebEngineView>
 
 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
-    QWidget *parent = nullptr;
 //! [Using QWebEngineView]
-    QWebEngineView *view = new QWebEngineView(parent);
-    view->load(QUrl("http://qt-project.org/"));
-    view->show();
+    QWebEngineView view;
+    view.load(QUrl("https://qt-project.org/"));
+    view.resize(1024, 750);
+    view.show();
 //! [Using QWebEngineView]
     return app.exec();
 }
+//! [Minimal Example]
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
index df06909df74..ef5a1c4b51d 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
@@ -24,4 +24,9 @@
 
     \snippet qtwebenginewidgets_build_snippet.qdoc 2
     \endif
+
+    The minimum amount of code needed to load and display an HTML page requires just
+    implementing the \c QWebEngineView class.
+
+    \snippet simple/main.cpp Minimal Example
 */
diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt
index c6d3e6e50b8..4bb14e72db7 100644
--- a/tests/manual/CMakeLists.txt
+++ b/tests/manual/CMakeLists.txt
@@ -1,2 +1,3 @@
+add_subdirectory(examples)
 add_subdirectory(quick)
 add_subdirectory(widgets)
diff --git a/tests/manual/examples/CMakeLists.txt b/tests/manual/examples/CMakeLists.txt
new file mode 100644
index 00000000000..6e0b301ada2
--- /dev/null
+++ b/tests/manual/examples/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(widgets)
diff --git a/tests/manual/examples/widgets/CMakeLists.txt b/tests/manual/examples/widgets/CMakeLists.txt
new file mode 100644
index 00000000000..d853ba6343d
--- /dev/null
+++ b/tests/manual/examples/widgets/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(minimal)
diff --git a/tests/manual/examples/widgets/minimal/CMakeLists.txt b/tests/manual/examples/widgets/minimal/CMakeLists.txt
new file mode 100644
index 00000000000..6351aaa906e
--- /dev/null
+++ b/tests/manual/examples/widgets/minimal/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+     cmake_minimum_required(VERSION 3.16)
+     project(minimal LANGUAGES CXX)
+     find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+ endif()
+
+qt_internal_add_manual_test(minimal-widgets
+    SOURCES
+        main.cpp
+)
+
+set_target_properties(minimal-widgets PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(minimal-widgets PUBLIC
+    Qt::Core
+    Qt::Gui
+    Qt::WebEngineWidgets
+)
diff --git a/examples/webenginewidgets/minimal/main.cpp b/tests/manual/examples/widgets/minimal/main.cpp
similarity index 100%
rename from examples/webenginewidgets/minimal/main.cpp
rename to tests/manual/examples/widgets/minimal/main.cpp
diff --git a/examples/webenginewidgets/minimal/minimal.pro b/tests/manual/examples/widgets/minimal/minimal.pro
similarity index 100%
rename from examples/webenginewidgets/minimal/minimal.pro
rename to tests/manual/examples/widgets/minimal/minimal.pro

From 3e9bc2cbbcb38970dddca7e6bf1ae5e05e72da2c Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 17 Mar 2023 10:34:53 +0100
Subject: [PATCH 114/681] Move quick minimal example to manual tests

Task-number: QTBUG-108751
Change-Id: I0998c46f051908855e0406e5fc7c0a422dc3eef0
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ed76eef004dbac15f4740d33d06d2b271bf770d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/CMakeLists.txt        |  1 -
 .../webenginequick/minimal/CMakeLists.txt     | 48 --------------
 .../minimal/doc/src/minimal.qdoc              | 63 -------------------
 examples/webenginequick/webenginequick.pro    |  1 -
 src/core/doc/src/qtwebengine-overview.qdoc    |  2 +-
 .../doc/snippets/minimal/main.cpp             | 18 ++++++
 .../doc/snippets/minimal/main.qml             | 18 ++++++
 .../doc/src/qtwebengine-qmlmodule.qdoc        |  9 +++
 .../doc/src/webengineview_lgpl.qdoc           |  4 +-
 tests/manual/examples/CMakeLists.txt          |  1 +
 tests/manual/examples/quick/CMakeLists.txt    |  1 +
 .../examples/quick/minimal/CMakeLists.txt     | 36 +++++++++++
 .../manual/examples/quick}/minimal/main.cpp   |  1 -
 .../manual/examples/quick}/minimal/main.qml   |  0
 .../examples/quick}/minimal/minimal.pro       |  0
 .../manual/examples/quick}/minimal/qml.qrc    |  0
 16 files changed, 86 insertions(+), 117 deletions(-)
 delete mode 100644 examples/webenginequick/minimal/CMakeLists.txt
 delete mode 100644 examples/webenginequick/minimal/doc/src/minimal.qdoc
 create mode 100644 src/webenginequick/doc/snippets/minimal/main.cpp
 create mode 100644 src/webenginequick/doc/snippets/minimal/main.qml
 create mode 100644 tests/manual/examples/quick/CMakeLists.txt
 create mode 100644 tests/manual/examples/quick/minimal/CMakeLists.txt
 rename {examples/webenginequick => tests/manual/examples/quick}/minimal/main.cpp (99%)
 rename {examples/webenginequick => tests/manual/examples/quick}/minimal/main.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/minimal/minimal.pro (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/minimal/qml.qrc (100%)

diff --git a/examples/webenginequick/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
index 14d2f5b5198..4b64c2926eb 100644
--- a/examples/webenginequick/CMakeLists.txt
+++ b/examples/webenginequick/CMakeLists.txt
@@ -4,7 +4,6 @@
 qt_internal_add_example(customdialogs)
 qt_internal_add_example(customtouchhandle)
 qt_internal_add_example(lifecycle)
-qt_internal_add_example(minimal)
 qt_internal_add_example(quicknanobrowser)
 qt_internal_add_example(webengineaction)
 if(TARGET Qt::QuickControls2)
diff --git a/examples/webenginequick/minimal/CMakeLists.txt b/examples/webenginequick/minimal/CMakeLists.txt
deleted file mode 100644
index f4715bb9747..00000000000
--- a/examples/webenginequick/minimal/CMakeLists.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(minimal LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/minimal-qml")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
-
-qt_add_executable(webengine-minimal-qml
-    main.cpp
-)
-
-set_target_properties(webengine-minimal-qml PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(webengine-minimal-qml PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebEngineQuick
-)
-
-# Resources:
-set(qml_resource_files
-    "main.qml"
-)
-
-qt_add_resources(webengine-minimal-qml "qml"
-    PREFIX
-        "/"
-    FILES
-        ${qml_resource_files}
-)
-
-install(TARGETS webengine-minimal-qml
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginequick/minimal/doc/src/minimal.qdoc b/examples/webenginequick/minimal/doc/src/minimal.qdoc
deleted file mode 100644
index aed74a7f5b1..00000000000
--- a/examples/webenginequick/minimal/doc/src/minimal.qdoc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginequick/minimal
-    \title WebEngine Qt Quick Minimal Example
-    \ingroup webengine-examples
-    \brief Displays a web page using the Qt Quick integration of \QWE.
-
-    \image minimal-example.png
-
-    \e {WebEngine Qt Quick Minimal Example} demonstrates how to use the
-    \l{WebEngineView} item to render a web page. It shows the minimum amount of
-    code needed to load and display an HTML page, and can be used as a basis for
-    further experimentation.
-
-    \include examples-run.qdocinc
-
-    \section1 C++ Code
-
-    In \c main.cpp we use only the QGuiApplication and QQmlApplicationEngine
-    classes. We also include \c qtwebengineglobal.h to be able to use
-    \l{QtWebEngineQuick::initialize}.
-
-    \quotefromfile webenginequick/minimal/main.cpp
-    \skipto #include
-    \printto main
-
-    In the \c main function we first set the
-    \l{QCoreApplication::organizationName} property. This affects the locations
-    where \QWE stores persistent and cached data (see also
-    \l{WebEngineProfile::cachePath} and
-    \l{WebEngineProfile::persistentStoragePath}).
-
-    Next, we call \l{QtWebEngineQuick::initialize}, which makes sure that OpenGL
-    contexts can be shared between the main process and the dedicated renderer
-    process (\c QtWebEngineProcess). This method needs to be called before
-    any OpenGL context is created.
-
-    Then we create a QQmlApplicationEngine, and tell it to load \c main.qml
-    from the \l{The Qt Resource System}{Qt Resource System}.
-
-    Finally, QGuiApplication::exec() launches the main event loop.
-
-    \printuntil }
-
-    \section1 QML Code
-
-    In \c main.qml we create the top level window, set a sensible default size
-    and make it visible. The window will be filled by a WebEngineView item
-    loading the \l{Qt Homepage}.
-
-    \quotefromfile webenginequick/minimal/main.qml
-    \skipto import
-    \printuntil }
-    \printline }
-
-    \section1 Requirements
-
-    The example requires a working internet connection to render the
-    \l{Qt Homepage}.
-    An optional system proxy should be picked up automatically.
-*/
diff --git a/examples/webenginequick/webenginequick.pro b/examples/webenginequick/webenginequick.pro
index edf4315a038..6a0a858d619 100644
--- a/examples/webenginequick/webenginequick.pro
+++ b/examples/webenginequick/webenginequick.pro
@@ -3,7 +3,6 @@ TEMPLATE=subdirs
 SUBDIRS += \
     customdialogs \
     customtouchhandle \
-    minimal \
     quicknanobrowser \
     webengineaction
 
diff --git a/src/core/doc/src/qtwebengine-overview.qdoc b/src/core/doc/src/qtwebengine-overview.qdoc
index 2e127240436..b1e8ee3da6c 100644
--- a/src/core/doc/src/qtwebengine-overview.qdoc
+++ b/src/core/doc/src/qtwebengine-overview.qdoc
@@ -162,7 +162,7 @@
     The following sample QML application loads a web page using the \l{WebEngineView::}{url}
     property:
 
-    \quotefromfile webenginequick/minimal/main.qml
+    \quotefromfile minimal/main.qml
     \skipto import
     \printuntil /^\}/
 
diff --git a/src/webenginequick/doc/snippets/minimal/main.cpp b/src/webenginequick/doc/snippets/minimal/main.cpp
new file mode 100644
index 00000000000..e17493a3681
--- /dev/null
+++ b/src/webenginequick/doc/snippets/minimal/main.cpp
@@ -0,0 +1,18 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [Minimal Example]
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+    QtWebEngineQuick::initialize();
+    QGuiApplication app(argc, argv);
+    QQmlApplicationEngine engine;
+    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+    return app.exec();
+}
+//! [Minimal Example]
diff --git a/src/webenginequick/doc/snippets/minimal/main.qml b/src/webenginequick/doc/snippets/minimal/main.qml
new file mode 100644
index 00000000000..87a8757dff8
--- /dev/null
+++ b/src/webenginequick/doc/snippets/minimal/main.qml
@@ -0,0 +1,18 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [Minimal Example]
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+
+Window {
+    width: 1024
+    height: 750
+    visible: true
+    WebEngineView {
+        anchors.fill: parent
+        url: "https://www.qt.io"
+    }
+}
+//! [Minimal Example]
diff --git a/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc b/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc
index 19348508c60..ecf3a4a6edc 100644
--- a/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc
+++ b/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc
@@ -17,4 +17,13 @@
     in the Qt6 package and \c target_link_libraries() to link against the module:
 
     \snippet qtwebengine_build_snippet.qdoc 2
+
+    The minimal amount of code needed to load and display an HTML page using the QML engine
+    requires a proper initialization:
+
+    \snippet minimal/main.cpp Minimal Example
+
+    Where the content of main.qml is simply:
+
+    \snippet minimal/main.qml Minimal Example
 */
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 8848b03e873..5413d70fb9a 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -24,7 +24,7 @@
     \l QtWebEngineQuick::initialize in the application main source file, as illustrated by the
     following code snippet:
 
-    \quotefromfile webenginequick/minimal/main.cpp
+    \quotefromfile minimal/main.cpp
     \skipto main
     \printuntil }
 
@@ -39,7 +39,7 @@
 
     The following sample QML application loads a web page using the \c url property:
 
-    \quotefromfile webenginequick/minimal/main.qml
+    \quotefromfile minimal/main.qml
     \skipto import
     \printuntil /^\}/
 
diff --git a/tests/manual/examples/CMakeLists.txt b/tests/manual/examples/CMakeLists.txt
index 6e0b301ada2..6c9b56c43d0 100644
--- a/tests/manual/examples/CMakeLists.txt
+++ b/tests/manual/examples/CMakeLists.txt
@@ -1 +1,2 @@
 add_subdirectory(widgets)
+add_subdirectory(quick)
diff --git a/tests/manual/examples/quick/CMakeLists.txt b/tests/manual/examples/quick/CMakeLists.txt
new file mode 100644
index 00000000000..d853ba6343d
--- /dev/null
+++ b/tests/manual/examples/quick/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(minimal)
diff --git a/tests/manual/examples/quick/minimal/CMakeLists.txt b/tests/manual/examples/quick/minimal/CMakeLists.txt
new file mode 100644
index 00000000000..39aaa1ea3cf
--- /dev/null
+++ b/tests/manual/examples/quick/minimal/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+     cmake_minimum_required(VERSION 3.16)
+     project(minimal LANGUAGES CXX)
+     find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
+endif()
+
+qt_internal_add_manual_test(webengine-minimal-qml
+    SOURCES
+        main.cpp
+)
+
+set_target_properties(webengine-minimal-qml PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(webengine-minimal-qml PUBLIC
+    Qt::Core
+    Qt::Gui
+    Qt::WebEngineQuick
+)
+
+# Resources:
+set(qml_resource_files
+    "main.qml"
+)
+
+qt_add_resources(webengine-minimal-qml "qml"
+    PREFIX
+        "/"
+    FILES
+        ${qml_resource_files}
+)
diff --git a/examples/webenginequick/minimal/main.cpp b/tests/manual/examples/quick/minimal/main.cpp
similarity index 99%
rename from examples/webenginequick/minimal/main.cpp
rename to tests/manual/examples/quick/minimal/main.cpp
index 47b3e146a41..16466ae06b0 100644
--- a/examples/webenginequick/minimal/main.cpp
+++ b/tests/manual/examples/quick/minimal/main.cpp
@@ -17,4 +17,3 @@ int main(int argc, char *argv[])
 
     return app.exec();
 }
-
diff --git a/examples/webenginequick/minimal/main.qml b/tests/manual/examples/quick/minimal/main.qml
similarity index 100%
rename from examples/webenginequick/minimal/main.qml
rename to tests/manual/examples/quick/minimal/main.qml
diff --git a/examples/webenginequick/minimal/minimal.pro b/tests/manual/examples/quick/minimal/minimal.pro
similarity index 100%
rename from examples/webenginequick/minimal/minimal.pro
rename to tests/manual/examples/quick/minimal/minimal.pro
diff --git a/examples/webenginequick/minimal/qml.qrc b/tests/manual/examples/quick/minimal/qml.qrc
similarity index 100%
rename from examples/webenginequick/minimal/qml.qrc
rename to tests/manual/examples/quick/minimal/qml.qrc

From 0d7899b61459d34a6f82962a1c2fce6f039273b8 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 20 Mar 2023 08:46:13 +0100
Subject: [PATCH 115/681] Move custom dialogs example to manual tests

This example shows how to use dialogs, however documentation
already provides snippets for that added in 3cbe59e29a.
The only missing one was tooltip, therefore add missing snippet
and move example to manual tests.

Task-number: QTBUG-108751
Change-Id: I84eda805455fb0276046ed1089389d605a8af672
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 6bf30525ee49d270dae6a6440bc607513f21237c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/CMakeLists.txt        |   1 -
 .../doc/images/customdialogs-auth1.png        | Bin 18549 -> 0 bytes
 .../doc/images/customdialogs-auth2.png        | Bin 5064 -> 0 bytes
 .../doc/images/customdialogs-color1.png       | Bin 9729 -> 0 bytes
 .../doc/images/customdialogs-color2.png       | Bin 3952 -> 0 bytes
 .../doc/images/customdialogs-file1.png        | Bin 18540 -> 0 bytes
 .../doc/images/customdialogs-file2.png        | Bin 6773 -> 0 bytes
 .../doc/images/customdialogs-menu.png         | Bin 5484 -> 0 bytes
 .../doc/images/customdialogs-prompt1.png      | Bin 14845 -> 0 bytes
 .../doc/images/customdialogs-prompt2.png      | Bin 4764 -> 0 bytes
 .../doc/images/customdialogs-tooltip.png      | Bin 1617 -> 0 bytes
 .../doc/images/customdialogs.png              | Bin 9093 -> 0 bytes
 .../customdialogs/doc/src/customdialogs.qdoc  | 309 ------------------
 examples/webenginequick/webenginequick.pro    |   1 -
 src/core/doc/src/qtwebengine-features.qdoc    |   1 -
 .../api/qquickwebenginedialogrequests.cpp     |  29 ++
 tests/manual/examples/quick/CMakeLists.txt    |   1 +
 .../quick}/customdialogs/CMakeLists.txt       |  32 +-
 .../quick}/customdialogs/MessageRectangle.qml |   0
 .../quick}/customdialogs/SwitchButton.qml     |   0
 .../examples/quick}/customdialogs/WebView.qml |   0
 .../quick}/customdialogs/customdialogs.pro    |   0
 .../quick}/customdialogs/customdialogs.qrc    |   0
 .../customdialogs/forms/Authentication.qml    |   0
 .../forms/AuthenticationForm.ui.qml           |   0
 .../quick}/customdialogs/forms/ColorCell.qml  |   0
 .../customdialogs/forms/ColorPicker.qml       |   0
 .../forms/ColorPickerForm.ui.qml              |   0
 .../customdialogs/forms/CustomButton.qml      |   0
 .../quick}/customdialogs/forms/FilePicker.qml |   0
 .../customdialogs/forms/FilePickerForm.ui.qml |   0
 .../quick}/customdialogs/forms/FileRow.qml    |   0
 .../quick}/customdialogs/forms/JavaScript.qml |   0
 .../customdialogs/forms/JavaScriptForm.ui.qml |   0
 .../quick}/customdialogs/forms/Menu.qml       |   0
 .../customdialogs/forms/MenuForm.ui.qml       |   0
 .../forms/TouchSelectionMenu.qml              |   0
 .../forms/TouchSelectionMenuForm.ui.qml       |   0
 .../customdialogs/forms/forms.qmlproject      |   0
 .../examples/quick}/customdialogs/icon.svg    |   0
 .../examples/quick}/customdialogs/index.html  |   0
 .../examples/quick}/customdialogs/main.cpp    |   0
 .../examples/quick}/customdialogs/main.qml    |   0
 .../examples/quick}/customdialogs/server.cpp  |   0
 .../examples/quick}/customdialogs/server.h    |   0
 .../examples/quick}/customdialogs/style.css   |   0
 46 files changed, 36 insertions(+), 338 deletions(-)
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-auth1.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-auth2.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-color1.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-color2.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-file1.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-file2.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-menu.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-prompt1.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-prompt2.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs-tooltip.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/images/customdialogs.png
 delete mode 100644 examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/CMakeLists.txt (60%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/MessageRectangle.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/SwitchButton.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/WebView.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/customdialogs.pro (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/customdialogs.qrc (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/Authentication.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/AuthenticationForm.ui.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/ColorCell.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/ColorPicker.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/ColorPickerForm.ui.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/CustomButton.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/FilePicker.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/FilePickerForm.ui.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/FileRow.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/JavaScript.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/JavaScriptForm.ui.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/Menu.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/MenuForm.ui.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/TouchSelectionMenu.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/TouchSelectionMenuForm.ui.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/forms/forms.qmlproject (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/icon.svg (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/index.html (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/main.cpp (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/main.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/server.cpp (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/server.h (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customdialogs/style.css (100%)

diff --git a/examples/webenginequick/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
index 4b64c2926eb..30ecb98080c 100644
--- a/examples/webenginequick/CMakeLists.txt
+++ b/examples/webenginequick/CMakeLists.txt
@@ -1,7 +1,6 @@
 # Copyright (C) 2022 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
-qt_internal_add_example(customdialogs)
 qt_internal_add_example(customtouchhandle)
 qt_internal_add_example(lifecycle)
 qt_internal_add_example(quicknanobrowser)
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-auth1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-auth1.png
deleted file mode 100644
index 042712f5c9c7f4b1eba466df0aa8ba82b5baf926..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-auth2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-auth2.png
deleted file mode 100644
index 41828d36d259ee0280d1997d2ff6db44ca67924f..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-color1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-color1.png
deleted file mode 100644
index 7f0492f87ec9a84a3ace0c87eef9e93a58ffe483..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-color2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-color2.png
deleted file mode 100644
index 9087fdf14d041cedcacf4cc02ea3f5566dfd91bc..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-file1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-file1.png
deleted file mode 100644
index 5023ced6fd09ec0df9c1d23a67656cbe585ba681..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-file2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-file2.png
deleted file mode 100644
index aa25579d789bef4069959ca4fb8d37bc187e9053..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-menu.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-menu.png
deleted file mode 100644
index 3409c951c6545e7ad4c2fe45ea4465539f91de14..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt1.png
deleted file mode 100644
index c34080b4d7b747478211f1451709f43b3cf34139..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt2.png
deleted file mode 100644
index 2c8d926490ce24eb3d67e101efa0942a6805fd7a..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-tooltip.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-tooltip.png
deleted file mode 100644
index 498de9595631d23d58761953090e19540b50f6f3..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs.png b/examples/webenginequick/customdialogs/doc/images/customdialogs.png
deleted file mode 100644
index c42114a16b968279f60fe6c9a4294676f88f24ab..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc b/examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc
deleted file mode 100644
index d89d76f7147..00000000000
--- a/examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginequick/customdialogs
-    \title WebEngine Qt Quick Custom Dialogs Example
-    \ingroup webengine-examples
-    \brief Customizes UI elements of \QWE's dialogs.
-
-    \image customdialogs.png
-
-    A web page might request dialogs for various purposes, such as
-    authentication, picking colors, choosing files, and responding to JavaScript
-    alerts, confirmation requests, and prompts.
-
-    \e {Custom Dialogs} demonstrates how to use WebEngine dialog request objects
-    to implement custom dialogs for use instead of the default dialogs.
-
-    \include examples-run.qdocinc
-
-    \section1 UI Elements of WebEngineView
-
-    In this example, we create a simple \c index.html page that contains buttons
-    and text fields for triggering a context menu and the following dialogs:
-
-    \list
-        \li HTTP Authentication Dialog
-        \li Proxy Authentication Dialog
-        \li JavaScript Alert, Confirm, and Prompt Dialogs
-        \li Color Picker Dialog
-        \li File Picker Dialog
-    \endlist
-
-    \section1 Triggering Dialogs
-
-    As mentioned, the \c index.html file is responsible for triggering the
-    dialogs from the side of HTML and JavaScript. Additionally, the example
-    program starts a localhost TCP server returning the mocked HTTP responses
-    needed to trigger proxy and HTTP authentication dialogs.
-
-    \section1 Custom Dialogs
-
-    The custom dialogs are just \e {Qt Quick Designer UI Forms} without any
-    business logic. The point here is to present the glue code that is required
-    to display the custom dialog for a particular web engine dialog or a menu
-    request.
-
-    \section1 Creating the Main Window
-
-    In \c main.cpp, we initialize the WebEngine the same way as in the
-    \l {WebEngine Qt Quick Minimal Example}:
-
-    \quotefromfile webenginequick/customdialogs/main.cpp
-    \skipto main
-    \printuntil }
-
-    In addition, we set up a proxy and a TCP server to be able to simulate proxy
-    and HTTP authetication requests.
-
-    In \c main.qml, we create a top level window, which contains a StackView
-    with a SwitchButton and a WebView:
-
-    \quotefromfile webenginequick/customdialogs/main.qml
-    \skipto Window
-    \printuntil Component
-    \printuntil }
-    \printline }
-
-    \section1 Handling Web Engine Requests
-
-    In this example, we implement the handling of the following web engine
-    requests:
-
-    \list
-        \li ContextMenuRequest
-        \li AuthenticationDialogRequest
-        \li JavaScriptDialogRequest
-        \li ColorDialogRequest
-        \li FileDialogRequest
-    \endlist
-
-    \section2 Context Menu Requests
-
-    \l [QML]{ContextMenuRequest} is a request object that is passed as a
-    parameter of the WebEngineView::contextMenuRequested signal. We use the
-    \c onContextMenuRequested signal handler to handle requests for
-    \c #openMenu URL links:
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto WebEngineView
-    \printuntil {
-    \dots 4
-    \skipto onContextMenuRequested
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \dots 4
-    \skipuntil onFileDialogRequested
-    \skipuntil }});
-    \skipuntil }
-    \skipto }
-    \printline }
-
-    The first text field from the top on our page triggers the request. Next,
-    we check whether we should use the default menu. If not, we accept the
-    request and switch the view to show the \c MenuForm:
-
-     \image customdialogs-menu.png
-
-    \quotefromfile webenginequick/customdialogs/forms/Menu.qml
-    \skipto MenuForm
-    \printuntil }
-    \printuntil }
-
-    To keep things simple, we do not provide any logic on component completion,
-    and we simply close the form on any action.
-
-    \section2 Tooltip Requests
-
-    \l [QML]{TooltipRequest} is a request object that is passed as a
-    parameter of the WebEngineView::tooltipRequested signal. We use the
-    \c onTooltipRequested signal handler to handle requests for
-    custom tooltip menus at specific positions:
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto WebEngineView
-    \printuntil {
-    \dots 4
-    \skipto onTooltipRequested
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \dots 4
-    \skipuntil onFileDialogRequested
-    \skipuntil }});
-    \skipuntil }
-    \skipto }
-    \printline }
-
-    The second text field from the top on our page triggers the request. Next,
-    we check whether we should use the default menu. If not, we accept the
-    request and show a custom QML element as tooltip:
-
-    \image customdialogs-tooltip.png
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto Rectangle
-    \printuntil }
-
-    \section2  Authentication Dialog Requests
-
-    \image customdialogs-auth1.png
-
-    \l [QML]{AuthenticationDialogRequest} is a request object that is passed
-    as a parameter of the WebEngineView::authenticationDialogRequested signal:
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto WebEngineView
-    \printuntil {
-    \dots 4
-    \skipto onAuthenticationDialogRequested
-    \printuntil }
-    \printuntil }
-    \dots 4
-    \skipuntil onFileDialogRequested
-    \skipuntil }});
-    \skipuntil }
-    \skipto }
-    \printline }
-
-    We use the \c onAuthenticationDialogRequested signal handler to check
-    whether we should use the default authentication dialog. If not, we accept
-    the request and switch the view to show the \c AuthenticationForm:
-
-    \image customdialogs-auth2.png
-
-    \quotefromfile webenginequick/customdialogs/forms/Authentication.qml
-    \skipto AuthenticationForm
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-
-    On component completion, we log the request type. The user can fill in the
-    credentials and click \uicontrol Login. We provide \c onClicked handlers to
-    accept or reject the authentication dialog. The TCP server on localhost does
-    not handle real authentication, and therefore we call \c rejectDialog()
-    instead of \c acceptDialog() also for the login button \c clicked signal.
-
-    \section2  JavaScript Dialog Requests
-
-    \image customdialogs-prompt1.png
-
-    \l [QML]{JavaScriptDialogRequest} is a request object that is passed as a
-    parameter of the WebEngineView::javaScriptDialogRequested signal:
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto WebEngineView
-    \printuntil {
-    \dots 4
-    \skipto onJavaScriptDialogRequested
-    \printuntil }
-    \printuntil }
-    \dots 4
-    \skipuntil onFileDialogRequested
-    \skipuntil }});
-    \skipuntil }
-    \skipto }
-    \printline }
-
-    We use the \c onJavaScriptDialogRequested signal handler to check
-    whether we should use the default JavaScript dialog. If not, we accept the
-    request and switch the view to show the \c JavaScriptForm:
-
-    \image customdialogs-prompt2.png
-
-    \quotefromfile webenginequick/customdialogs/forms/JavaScript.qml
-    \skipto JavaScriptForm
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-
-    On component completion, we customize the form based on the request type.
-    For a JavaScript prompt dialog we use \c dialogAccept() with the
-    \c prompt.text argument.
-
-    \section2  Color Dialog Requests
-
-    \image customdialogs-color1.png
-
-    \l [QML]{ColorDialogRequest} is a request object that is passed as a
-    parameter of the WebEngineView::colorDialogRequested signal:
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto WebEngineView
-    \printuntil {
-    \dots 4
-    \skipto onColorDialogRequested
-    \printuntil }
-    \printuntil }
-    \dots 4
-    \skipuntil onFileDialogRequested
-    \skipuntil }});
-    \skipuntil }
-    \skipto }
-    \printline }
-
-    We use the \c onColorDialogRequested signal handler to check whether
-    we should use the default color picker dialog. If not, we accept the request
-    and switch the view to show the \c ColorPickerForm:
-
-    \image customdialogs-color2.png
-
-    \quotefromfile webenginequick/customdialogs/forms/ColorPicker.qml
-    \skipto ColorPickerForm
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-
-    On component completion, we create callbacks for all the color cells. When
-    the user selects the color and clicks \c OK, we pass the selected color to
-    the \c dialogAccept() method.
-
-    \section2  File Dialog Requests
-
-    \image customdialogs-file1.png
-
-    \l [QML]{FileDialogRequest} is a request object that is passed as a
-    parameter of the WebEngineView::fileDialogRequested signal:
-
-    \quotefromfile webenginequick/customdialogs/WebView.qml
-    \skipto WebEngineView
-    \printuntil {
-    \dots 4
-    \skipto onFileDialogRequested
-    \printuntil }
-    \printuntil }
-    \printuntil }
-
-    We use the \c onFileDialogRequested signal handler to check whether
-    we should use the default file picker dialog. If not, we accept the request
-    and switch the view to show the \c FilePickerForm:
-
-    \image customdialogs-file2.png
-
-    \quotefromfile webenginequick/customdialogs/forms/FilePicker.qml
-    \skipto FilePickerForm
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-    \printuntil }
-
-    On component completion, we create callbacks for selecting files. When the user selects a
-    file and clicks \c OK, we pass the selected file to the \c dialogAccept
-    method.
-
-*/
diff --git a/examples/webenginequick/webenginequick.pro b/examples/webenginequick/webenginequick.pro
index 6a0a858d619..8c7343017a8 100644
--- a/examples/webenginequick/webenginequick.pro
+++ b/examples/webenginequick/webenginequick.pro
@@ -1,7 +1,6 @@
 TEMPLATE=subdirs
 
 SUBDIRS += \
-    customdialogs \
     customtouchhandle \
     quicknanobrowser \
     webengineaction
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index a564641a5a6..9242c257f4a 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -383,7 +383,6 @@
     WebEngineView::colorDialogRequested(),
     WebEngineView::fileDialogRequested(), and
     WebEngineView::formValidationMessageRequested() signals. For an example,
-    see \l{WebEngine Qt Quick Custom Dialogs Example}.
 
     \section1 Pepper Plugin API
 
diff --git a/src/webenginequick/api/qquickwebenginedialogrequests.cpp b/src/webenginequick/api/qquickwebenginedialogrequests.cpp
index 3c9f8a9a7bc..d49f173976c 100644
--- a/src/webenginequick/api/qquickwebenginedialogrequests.cpp
+++ b/src/webenginequick/api/qquickwebenginedialogrequests.cpp
@@ -685,6 +685,35 @@ void QQuickWebEngineFileDialogRequest::dialogReject()
     \since QtWebEngine 1.10
 
     \brief A request for showing a tooltip to the user.
+
+    A TooltipRequest is a request object that is passed as a
+    parameter of the WebEngineView::tooltipRequested signal. Use the
+    \c onTooltipRequested signal handler to handle requests for
+    custom tooltip menus at specific positions.
+
+    The \l accepted property of the request indicates whether the request
+    is handled by the user code or the default tooltip should
+    be displayed.
+
+    The following code uses a custom tooltip to handle the request:
+
+    \code
+    WebEngineView {
+        // ...
+        onTooltipRequested: function(request) {
+            if (request.type == TooltipRequest.Show) {
+                tooltip.visible = true;
+                tooltip.x = request.x;
+                tooltip.y = request.y;
+                tooltip.text = request.text;
+            } else {
+                tooltip.visible = false;
+            }
+            request.accepted = true;
+        }
+        // ...
+    }
+    \endcode
 */
 
 QQuickWebEngineTooltipRequest::QQuickWebEngineTooltipRequest(
diff --git a/tests/manual/examples/quick/CMakeLists.txt b/tests/manual/examples/quick/CMakeLists.txt
index d853ba6343d..72b86d1851b 100644
--- a/tests/manual/examples/quick/CMakeLists.txt
+++ b/tests/manual/examples/quick/CMakeLists.txt
@@ -1 +1,2 @@
 add_subdirectory(minimal)
+add_subdirectory(customdialogs)
diff --git a/examples/webenginequick/customdialogs/CMakeLists.txt b/tests/manual/examples/quick/customdialogs/CMakeLists.txt
similarity index 60%
rename from examples/webenginequick/customdialogs/CMakeLists.txt
rename to tests/manual/examples/quick/customdialogs/CMakeLists.txt
index 7908bec628c..f0cdd54fa2d 100644
--- a/examples/webenginequick/customdialogs/CMakeLists.txt
+++ b/tests/manual/examples/quick/customdialogs/CMakeLists.txt
@@ -1,23 +1,14 @@
 # Copyright (C) 2022 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
-cmake_minimum_required(VERSION 3.16)
-project(customdialogs LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+    cmake_minimum_required(VERSION 3.16)
+    project(customdialogs LANGUAGES CXX)
+    find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
 endif()
 
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/customdialogs")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
-
-qt_add_executable(customdialogs
-    main.cpp
-    server.cpp server.h
+qt_internal_add_manual_test(customdialogs
+    SOURCES main.cpp server.cpp server.h
 )
 
 set_target_properties(customdialogs PROPERTIES
@@ -63,14 +54,3 @@ qt_add_resources(customdialogs "customdialogs"
         ${customdialogs_resource_files}
 )
 
-if(TARGET Qt::Widgets)
-    target_link_libraries(customdialogs PUBLIC
-        Qt::Widgets
-    )
-endif()
-
-install(TARGETS customdialogs
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginequick/customdialogs/MessageRectangle.qml b/tests/manual/examples/quick/customdialogs/MessageRectangle.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/MessageRectangle.qml
rename to tests/manual/examples/quick/customdialogs/MessageRectangle.qml
diff --git a/examples/webenginequick/customdialogs/SwitchButton.qml b/tests/manual/examples/quick/customdialogs/SwitchButton.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/SwitchButton.qml
rename to tests/manual/examples/quick/customdialogs/SwitchButton.qml
diff --git a/examples/webenginequick/customdialogs/WebView.qml b/tests/manual/examples/quick/customdialogs/WebView.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/WebView.qml
rename to tests/manual/examples/quick/customdialogs/WebView.qml
diff --git a/examples/webenginequick/customdialogs/customdialogs.pro b/tests/manual/examples/quick/customdialogs/customdialogs.pro
similarity index 100%
rename from examples/webenginequick/customdialogs/customdialogs.pro
rename to tests/manual/examples/quick/customdialogs/customdialogs.pro
diff --git a/examples/webenginequick/customdialogs/customdialogs.qrc b/tests/manual/examples/quick/customdialogs/customdialogs.qrc
similarity index 100%
rename from examples/webenginequick/customdialogs/customdialogs.qrc
rename to tests/manual/examples/quick/customdialogs/customdialogs.qrc
diff --git a/examples/webenginequick/customdialogs/forms/Authentication.qml b/tests/manual/examples/quick/customdialogs/forms/Authentication.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/Authentication.qml
rename to tests/manual/examples/quick/customdialogs/forms/Authentication.qml
diff --git a/examples/webenginequick/customdialogs/forms/AuthenticationForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/AuthenticationForm.ui.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/AuthenticationForm.ui.qml
rename to tests/manual/examples/quick/customdialogs/forms/AuthenticationForm.ui.qml
diff --git a/examples/webenginequick/customdialogs/forms/ColorCell.qml b/tests/manual/examples/quick/customdialogs/forms/ColorCell.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/ColorCell.qml
rename to tests/manual/examples/quick/customdialogs/forms/ColorCell.qml
diff --git a/examples/webenginequick/customdialogs/forms/ColorPicker.qml b/tests/manual/examples/quick/customdialogs/forms/ColorPicker.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/ColorPicker.qml
rename to tests/manual/examples/quick/customdialogs/forms/ColorPicker.qml
diff --git a/examples/webenginequick/customdialogs/forms/ColorPickerForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/ColorPickerForm.ui.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/ColorPickerForm.ui.qml
rename to tests/manual/examples/quick/customdialogs/forms/ColorPickerForm.ui.qml
diff --git a/examples/webenginequick/customdialogs/forms/CustomButton.qml b/tests/manual/examples/quick/customdialogs/forms/CustomButton.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/CustomButton.qml
rename to tests/manual/examples/quick/customdialogs/forms/CustomButton.qml
diff --git a/examples/webenginequick/customdialogs/forms/FilePicker.qml b/tests/manual/examples/quick/customdialogs/forms/FilePicker.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/FilePicker.qml
rename to tests/manual/examples/quick/customdialogs/forms/FilePicker.qml
diff --git a/examples/webenginequick/customdialogs/forms/FilePickerForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/FilePickerForm.ui.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/FilePickerForm.ui.qml
rename to tests/manual/examples/quick/customdialogs/forms/FilePickerForm.ui.qml
diff --git a/examples/webenginequick/customdialogs/forms/FileRow.qml b/tests/manual/examples/quick/customdialogs/forms/FileRow.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/FileRow.qml
rename to tests/manual/examples/quick/customdialogs/forms/FileRow.qml
diff --git a/examples/webenginequick/customdialogs/forms/JavaScript.qml b/tests/manual/examples/quick/customdialogs/forms/JavaScript.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/JavaScript.qml
rename to tests/manual/examples/quick/customdialogs/forms/JavaScript.qml
diff --git a/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/JavaScriptForm.ui.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml
rename to tests/manual/examples/quick/customdialogs/forms/JavaScriptForm.ui.qml
diff --git a/examples/webenginequick/customdialogs/forms/Menu.qml b/tests/manual/examples/quick/customdialogs/forms/Menu.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/Menu.qml
rename to tests/manual/examples/quick/customdialogs/forms/Menu.qml
diff --git a/examples/webenginequick/customdialogs/forms/MenuForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/MenuForm.ui.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/MenuForm.ui.qml
rename to tests/manual/examples/quick/customdialogs/forms/MenuForm.ui.qml
diff --git a/examples/webenginequick/customdialogs/forms/TouchSelectionMenu.qml b/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenu.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/TouchSelectionMenu.qml
rename to tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenu.qml
diff --git a/examples/webenginequick/customdialogs/forms/TouchSelectionMenuForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
rename to tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
diff --git a/examples/webenginequick/customdialogs/forms/forms.qmlproject b/tests/manual/examples/quick/customdialogs/forms/forms.qmlproject
similarity index 100%
rename from examples/webenginequick/customdialogs/forms/forms.qmlproject
rename to tests/manual/examples/quick/customdialogs/forms/forms.qmlproject
diff --git a/examples/webenginequick/customdialogs/icon.svg b/tests/manual/examples/quick/customdialogs/icon.svg
similarity index 100%
rename from examples/webenginequick/customdialogs/icon.svg
rename to tests/manual/examples/quick/customdialogs/icon.svg
diff --git a/examples/webenginequick/customdialogs/index.html b/tests/manual/examples/quick/customdialogs/index.html
similarity index 100%
rename from examples/webenginequick/customdialogs/index.html
rename to tests/manual/examples/quick/customdialogs/index.html
diff --git a/examples/webenginequick/customdialogs/main.cpp b/tests/manual/examples/quick/customdialogs/main.cpp
similarity index 100%
rename from examples/webenginequick/customdialogs/main.cpp
rename to tests/manual/examples/quick/customdialogs/main.cpp
diff --git a/examples/webenginequick/customdialogs/main.qml b/tests/manual/examples/quick/customdialogs/main.qml
similarity index 100%
rename from examples/webenginequick/customdialogs/main.qml
rename to tests/manual/examples/quick/customdialogs/main.qml
diff --git a/examples/webenginequick/customdialogs/server.cpp b/tests/manual/examples/quick/customdialogs/server.cpp
similarity index 100%
rename from examples/webenginequick/customdialogs/server.cpp
rename to tests/manual/examples/quick/customdialogs/server.cpp
diff --git a/examples/webenginequick/customdialogs/server.h b/tests/manual/examples/quick/customdialogs/server.h
similarity index 100%
rename from examples/webenginequick/customdialogs/server.h
rename to tests/manual/examples/quick/customdialogs/server.h
diff --git a/examples/webenginequick/customdialogs/style.css b/tests/manual/examples/quick/customdialogs/style.css
similarity index 100%
rename from examples/webenginequick/customdialogs/style.css
rename to tests/manual/examples/quick/customdialogs/style.css

From 268bd4e5e9f2bd5c056d00b224022151822fc8b6 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 20 Mar 2023 08:46:55 +0100
Subject: [PATCH 116/681] Move custom touch handles example to manual tests

Move and add missing parts as snippet.

Task-number: QTBUG-108751
Change-Id: I25849941700337626ca46e399fdb52264bc4659a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Yigit Akcay <yigit.akcay@qt.io>
(cherry picked from commit 55f9fc348278b2aa8985ec9c1e7e092f88f68f83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/CMakeLists.txt        |   1 -
 .../customtouchhandle/CMakeLists.txt          |  48 ------------------
 .../doc/images/customtouchhandle.jpg          | Bin 47646 -> 0 bytes
 .../doc/src/customtouchhandle.qdoc            |  42 ---------------
 examples/webenginequick/webenginequick.pro    |   1 -
 .../doc/src/webengineview_lgpl.qdoc           |  21 ++++++++
 tests/manual/examples/quick/CMakeLists.txt    |   1 +
 .../quick/customtouchhandle/CMakeLists.txt    |  36 +++++++++++++
 .../customtouchhandle/customtouchhandle.pro   |   0
 .../quick}/customtouchhandle/main.cpp         |   0
 .../quick}/customtouchhandle/main.qml         |   0
 .../examples/quick}/customtouchhandle/qml.qrc |   0
 12 files changed, 58 insertions(+), 92 deletions(-)
 delete mode 100644 examples/webenginequick/customtouchhandle/CMakeLists.txt
 delete mode 100644 examples/webenginequick/customtouchhandle/doc/images/customtouchhandle.jpg
 delete mode 100644 examples/webenginequick/customtouchhandle/doc/src/customtouchhandle.qdoc
 create mode 100644 tests/manual/examples/quick/customtouchhandle/CMakeLists.txt
 rename {examples/webenginequick => tests/manual/examples/quick}/customtouchhandle/customtouchhandle.pro (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customtouchhandle/main.cpp (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customtouchhandle/main.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/customtouchhandle/qml.qrc (100%)

diff --git a/examples/webenginequick/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
index 30ecb98080c..ef140ee72fa 100644
--- a/examples/webenginequick/CMakeLists.txt
+++ b/examples/webenginequick/CMakeLists.txt
@@ -1,7 +1,6 @@
 # Copyright (C) 2022 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
-qt_internal_add_example(customtouchhandle)
 qt_internal_add_example(lifecycle)
 qt_internal_add_example(quicknanobrowser)
 qt_internal_add_example(webengineaction)
diff --git a/examples/webenginequick/customtouchhandle/CMakeLists.txt b/examples/webenginequick/customtouchhandle/CMakeLists.txt
deleted file mode 100644
index e84e9752461..00000000000
--- a/examples/webenginequick/customtouchhandle/CMakeLists.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(customtouchhandle LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/customtouchhandle")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
-
-qt_add_executable(customtouchhandle
-    main.cpp
-)
-
-set_target_properties(customtouchhandle PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(customtouchhandle PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebEngineQuick
-)
-
-# Resources:
-set(qml_resource_files
-    "main.qml"
-)
-
-qt6_add_resources(customtouchhandle "qml"
-    PREFIX
-        "/"
-    FILES
-        ${qml_resource_files}
-)
-
-install(TARGETS customtouchhandle
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginequick/customtouchhandle/doc/images/customtouchhandle.jpg b/examples/webenginequick/customtouchhandle/doc/images/customtouchhandle.jpg
deleted file mode 100644
index bd65c083d53442e3e7c8e4ca1d6f28c95fab0eea..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/customtouchhandle/doc/src/customtouchhandle.qdoc b/examples/webenginequick/customtouchhandle/doc/src/customtouchhandle.qdoc
deleted file mode 100644
index 742f65b6bf4..00000000000
--- a/examples/webenginequick/customtouchhandle/doc/src/customtouchhandle.qdoc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginequick/customtouchhandle
-    \title WebEngine Qt Quick Custom Touch Handle Example
-    \ingroup webengine-examples
-    \brief Shows custom touch handles upon touch selection events.
-
-    \image customtouchhandle.jpg
-
-    \e {WebEngine Qt Quick Touch Handle Example} demonstrates how to use
-    custom touch handles when a touch selection event happens. It shows the
-    minimum amount of code needed to use custom touch handle delegates, and
-    can be used as a basis for further experimentation.
-
-    \section1 Custom Touch Handle
-
-    In \c main.qml we create the custom touch handle delegate.
-
-    \quotefromfile webenginequick/customtouchhandle/main.qml
-    \skipto WebEngineView
-    \printuntil /^\ {4}\}/
-
-    \section1 QML Code
-
-    In \c main.qml we create the top level window filled by a
-    \l{WebEngineView} item loading the \l{Qt Homepage}.
-    To display custom touch handles, a QML item should be delegated to
-    \l{WebEngineView::touchHandleDelegate}.
-
-    The touch handle's position, opacity, and visibility is automatically updated.
-
-    \note If no delegate is provided, Chromium's default touch handles will appear.
-
-    \section1 Requirements
-
-    The example requires a working internet connection to render the
-    \l{Qt Homepage} and a touch-enabled input device to trigger touch
-    events.
-    An optional system proxy should be picked up automatically.
-*/
diff --git a/examples/webenginequick/webenginequick.pro b/examples/webenginequick/webenginequick.pro
index 8c7343017a8..9711ccb3aa5 100644
--- a/examples/webenginequick/webenginequick.pro
+++ b/examples/webenginequick/webenginequick.pro
@@ -1,7 +1,6 @@
 TEMPLATE=subdirs
 
 SUBDIRS += \
-    customtouchhandle \
     quicknanobrowser \
     webengineaction
 
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 5413d70fb9a..6390c0c025c 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -1501,6 +1501,27 @@
         // ...
     }
     \endcode
+
+    The touch handles can be also switched dynamically:
+
+    \code
+     Component {
+        id: circleTouchHandle
+        Rectangle {
+            color: "blue"
+            radius: 50
+        }
+    }
+    function showDefaultHandle(isDefault) {
+        if (isDefault)
+            webEngineView.touchHandleDelegate = circleTouchHandle
+        else
+            webEngineView.touchHandleDelegate = null
+    }
+    \endcode
+
+    \note If no delegate is provided, Chromium's default touch handles will appear.
+
 */
 
     \sa {WebEngine Qt Quick Custom Touch Handle Example}
diff --git a/tests/manual/examples/quick/CMakeLists.txt b/tests/manual/examples/quick/CMakeLists.txt
index 72b86d1851b..d5f960480f3 100644
--- a/tests/manual/examples/quick/CMakeLists.txt
+++ b/tests/manual/examples/quick/CMakeLists.txt
@@ -1,2 +1,3 @@
 add_subdirectory(minimal)
 add_subdirectory(customdialogs)
+add_subdirectory(customtouchhandle)
diff --git a/tests/manual/examples/quick/customtouchhandle/CMakeLists.txt b/tests/manual/examples/quick/customtouchhandle/CMakeLists.txt
new file mode 100644
index 00000000000..5d790a9e3b8
--- /dev/null
+++ b/tests/manual/examples/quick/customtouchhandle/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+    cmake_minimum_required(VERSION 3.16)
+    project(customtouchhandle LANGUAGES CXX)
+    find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
+endif()
+
+qt_internal_add_manual_test(customtouchhandle
+    SOURCES main.cpp
+)
+
+set_target_properties(customtouchhandle PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(customtouchhandle PUBLIC
+    Qt::Core
+    Qt::Gui
+    Qt::WebEngineQuick
+)
+
+# Resources:
+set(qml_resource_files
+    "main.qml"
+)
+
+qt6_add_resources(customtouchhandle "qml"
+    PREFIX
+        "/"
+    FILES
+        ${qml_resource_files}
+)
+
diff --git a/examples/webenginequick/customtouchhandle/customtouchhandle.pro b/tests/manual/examples/quick/customtouchhandle/customtouchhandle.pro
similarity index 100%
rename from examples/webenginequick/customtouchhandle/customtouchhandle.pro
rename to tests/manual/examples/quick/customtouchhandle/customtouchhandle.pro
diff --git a/examples/webenginequick/customtouchhandle/main.cpp b/tests/manual/examples/quick/customtouchhandle/main.cpp
similarity index 100%
rename from examples/webenginequick/customtouchhandle/main.cpp
rename to tests/manual/examples/quick/customtouchhandle/main.cpp
diff --git a/examples/webenginequick/customtouchhandle/main.qml b/tests/manual/examples/quick/customtouchhandle/main.qml
similarity index 100%
rename from examples/webenginequick/customtouchhandle/main.qml
rename to tests/manual/examples/quick/customtouchhandle/main.qml
diff --git a/examples/webenginequick/customtouchhandle/qml.qrc b/tests/manual/examples/quick/customtouchhandle/qml.qrc
similarity index 100%
rename from examples/webenginequick/customtouchhandle/qml.qrc
rename to tests/manual/examples/quick/customtouchhandle/qml.qrc

From 9f27fab486808ed149ab001d49b877575c654ed4 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 17 Mar 2023 09:47:55 +0100
Subject: [PATCH 117/681] Remove webui example

Doesn't demonstrate anything complicated, the code isn't even worth
quoting as snippets. We could consider introducing a help browser to
replace it with more functionality.

Task-number: QTBUG-108751
Change-Id: I3b796388796a78d017836a10bee18032b2cd4905
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit e4051de7db7b7f0905770280f9a06e133d453cf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/CMakeLists.txt      |   1 -
 .../webenginewidgets/webenginewidgets.pro     |   3 +-
 .../webenginewidgets/webui/CMakeLists.txt     |  49 ------
 examples/webenginewidgets/webui/about.html    | 129 ----------------
 .../webui/doc/images/webui-example.png        | Bin 28862 -> 0 bytes
 .../webenginewidgets/webui/doc/src/webui.qdoc | 141 ------------------
 examples/webenginewidgets/webui/main.cpp      |  33 ----
 examples/webenginewidgets/webui/webui.pro     |  16 --
 examples/webenginewidgets/webui/webui.qrc     |   5 -
 .../webenginewidgets/webui/webuihandler.cpp   |  51 -------
 .../webenginewidgets/webui/webuihandler.h     |  23 ---
 src/core/api/qwebengineurlschemehandler.cpp   |  19 ++-
 12 files changed, 17 insertions(+), 453 deletions(-)
 delete mode 100644 examples/webenginewidgets/webui/CMakeLists.txt
 delete mode 100644 examples/webenginewidgets/webui/about.html
 delete mode 100644 examples/webenginewidgets/webui/doc/images/webui-example.png
 delete mode 100644 examples/webenginewidgets/webui/doc/src/webui.qdoc
 delete mode 100644 examples/webenginewidgets/webui/main.cpp
 delete mode 100644 examples/webenginewidgets/webui/webui.pro
 delete mode 100644 examples/webenginewidgets/webui/webui.qrc
 delete mode 100644 examples/webenginewidgets/webui/webuihandler.cpp
 delete mode 100644 examples/webenginewidgets/webui/webuihandler.h

diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt
index 0b5757e35a8..c1508942030 100644
--- a/examples/webenginewidgets/CMakeLists.txt
+++ b/examples/webenginewidgets/CMakeLists.txt
@@ -8,7 +8,6 @@ qt_internal_add_example(simplebrowser)
 qt_internal_add_example(stylesheetbrowser)
 qt_internal_add_example(push-notifications)
 qt_internal_add_example(videoplayer)
-qt_internal_add_example(webui)
 if(QT_FEATURE_webengine_geolocation)
     qt_internal_add_example(maps)
 endif()
diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro
index 119f6e1b17f..aedd2cc627b 100644
--- a/examples/webenginewidgets/webenginewidgets.pro
+++ b/examples/webenginewidgets/webenginewidgets.pro
@@ -9,8 +9,7 @@ SUBDIRS += \
     simplebrowser \
     stylesheetbrowser \
     push-notifications \
-    videoplayer \
-    webui
+    videoplayer
 
 qtConfig(webengine-geolocation): SUBDIRS += maps
 qtConfig(webengine-webchannel): SUBDIRS += markdowneditor
diff --git a/examples/webenginewidgets/webui/CMakeLists.txt b/examples/webenginewidgets/webui/CMakeLists.txt
deleted file mode 100644
index 8f6e95045af..00000000000
--- a/examples/webenginewidgets/webui/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(webui LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/webui")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
-
-qt_add_executable(webui
-    main.cpp
-    webuihandler.cpp webuihandler.h
-)
-
-set_target_properties(webui PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(webui PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebEngineWidgets
-)
-
-# Resources:
-set(webui_resource_files
-    "about.html"
-)
-
-qt_add_resources(webui "webui"
-    PREFIX
-        "/"
-    FILES
-        ${webui_resource_files}
-)
-
-install(TARGETS webui
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginewidgets/webui/about.html b/examples/webenginewidgets/webui/about.html
deleted file mode 100644
index 7b5a5896997..00000000000
--- a/examples/webenginewidgets/webui/about.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <title>Qt WebEngine WebUI Example</title>
-        <style>
-         html {
-             background: #f0f0f0;
-             color: #303030;
-             font: 16px system-ui;
-             height: 100%;
-         }
-
-         body {
-             margin: 0;
-             padding: 0;
-             height: 100%;
-             display: flex;
-             flex-direction: column;
-             align-items: stretch;
-         }
-
-         body > * {
-             padding-left: 20px;
-             padding-right: 20px;
-         }
-
-         header {
-             flex: none;
-             display: flex;
-             align-items: center;
-             background: #f0fff0;
-             border-bottom: 1px solid #e0e0e0;
-             padding-top: 20px;
-             padding-bottom: 20px;
-         }
-
-         header > h1 {
-             font: bold 20px system-ui;
-             margin-left: 18px;
-         }
-
-         main {
-             flex: auto;
-         }
-
-         footer {
-             flex: none;
-             display: flex;
-             justify-content: center;
-             padding-bottom: 20px;
-         }
-
-         button {
-             background: #41cd52;
-             color: #f0f0f0;
-             font: 16px system-ui;
-             border: 0;
-             box-shadow: 0px 1px 3px rgb(0,0,0,0.5);
-             cursor: pointer;
-             margin: 0 0 1px;
-             padding: 10px 24px;
-         }
-
-         button:hover {
-             background: #50dc61;
-         }
-
-         button:active {
-             background: #50dc61;
-             box-shadow: 0px 1px 2px rgb(0,0,0,0.5);
-             margin: 1px 0 0;
-         }
-
-         button:focus {
-             outline: 0;
-         }
-
-        </style>
-    </head>
-    <body>
-        <header>
-            <img width="48px" height="48px"
-                 src="qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png">
-            <h1>WebEngine Widgets<br>WebUI Example</h1>
-        </header>
-        <main>
-            <p>
-                Aside from the built-in schemes, such as <code>http</code> and
-                <code>qrc</code>, Qt WebEngine may be extended with <em>custom
-                schemes</em> by creating <em>custom scheme handlers</em>.
-            </p>
-
-            <p>
-                This is a simple HTML page loaded from a custom scheme and
-                displayed by a <code>QWebEngineView</code>. Even the Quit button
-                below is a standard HTML <code>&lt;button&gt;</code> element.
-            </p>
-
-            <p>
-                Read the documentation to find out
-            </p>
-            <ul>
-                <li>
-                    <p>
-                        How to create a custom scheme handler which serves HTML
-                        and handles HTML form submissions.
-                    </p>
-                </li>
-                <li>
-                    <p>
-                        How to prevent ordinary web content from accessing the
-                        custom scheme.
-                    </p>
-                </li>
-                <li>
-                    <p>
-                        How to prevent any other scheme from submitting HTML
-                        form data.
-                    </p>
-                </li>
-            </ul>
-        </main>
-        <footer>
-            <form action="" method="post">
-                <button name="quit">Quit</button>
-            </form>
-        </footer>
-    </body>
-</html>
diff --git a/examples/webenginewidgets/webui/doc/images/webui-example.png b/examples/webenginewidgets/webui/doc/images/webui-example.png
deleted file mode 100644
index 84e2c7fc32fa600f4df768455519b7341d439f5f..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginewidgets/webui/doc/src/webui.qdoc b/examples/webenginewidgets/webui/doc/src/webui.qdoc
deleted file mode 100644
index c8ab43ea8d4..00000000000
--- a/examples/webenginewidgets/webui/doc/src/webui.qdoc
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginewidgets/webui
-    \title WebEngine Widgets WebUI Example
-    \ingroup webengine-widgetexamples
-    \brief Displays HTML over a custom scheme.
-
-    \image webui-example.png
-
-    \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},
-    \QWE may be extended with \e {custom schemes} by creating \e {custom
-    scheme handlers}. This example shows:
-
-    \list
-        \li How to create a custom scheme handler which serves HTML and handles
-            HTML form submissions.
-        \li How to prevent ordinary web content from accessing the custom scheme.
-        \li How to prevent any other scheme from submitting HTML form data.
-    \endlist
-
-    \include examples-run.qdocinc
-
-    \section1 Overview
-
-    The example program consists of a single \l {QWebEngineView} showing a
-    simple HTML page loaded from the URL \c {webui:about}, over our custom
-    scheme. Pressing the button at the bottom of the page will trigger an HTML
-    form submission via POST to the same URL, at which point our custom scheme
-    handler will cause the application to exit.
-
-    The program is divided into two parts, the \c {main} function for setting
-    everything up, and the \c {WebUiHandler} class for implementing our custom
-    scheme handler. The \c {main} function is quite short:
-
-    \quotefromfile webenginewidgets/webui/main.cpp
-    \skipto int main
-    \printuntil /^\}/
-
-    Aside from the relatively standard setup of widgets, two points are
-    noteworthy. First, we call the static method \c
-    {WebUiHandler::registerUrlScheme()} to register our custom scheme with the
-    web engine. Second, we create and install our custom scheme handler \c
-    {WebUiHandler} using \l
-    {QWebEngineProfile::installUrlSchemeHandler()}{installUrlSchemeHandler()}.
-    The following sections describe these aspects in more detail.
-
-    \section1 Registering the Scheme
-
-    As custom schemes are integrated directly into the web engine, they do not
-    necessarily need to follow the standard security rules which apply to
-    ordinary web content. Depending on the chosen configuration, content served
-    over a custom scheme may be given access to local resources, be set to
-    ignore Content-Security-Policy rules, or conversely, be denied access to any
-    other content entirely.
-
-    In order to take advantage of these possibilities, the custom scheme must
-    first be registered. This means creating and configuring a \l
-    {QWebEngineUrlScheme} object and then handing it over to \l
-    {QWebEngineUrlScheme::registerScheme()}. The example program does exactly this in
-    the static method \c {WebUiHandler::registerUrlScheme()}:
-
-    \quotefromfile webenginewidgets/webui/webuihandler.cpp
-    \skipto void WebUiHandler::registerUrlScheme
-    \printuntil /^\}/
-
-    A custom scheme needs a name, which can be set by passing it to
-    the constructor of \c {QWebEngineUrlScheme} or by calling \l
-    {QWebEngineUrlScheme::setName}. In the above, the name \c {webui} is set
-    through the constructor. Additionally, we activate the flags \l
-    {QWebEngineUrlScheme::SecureScheme}{SecureScheme}, \l
-    {QWebEngineUrlScheme::LocalScheme}{LocalScheme} and \l
-    {QWebEngineUrlScheme::LocalAccessAllowed}{LocalAccessAllowed}. Since our
-    custom scheme handler will not deliver resources received from insecure
-    network connections, we can safely mark it as a \c {SecureScheme}. The \c {LocalScheme}
-    flag prevents content from non-local schemes (such as \c {http}) from
-    interacting with our custom scheme. Without this flag it would be possible,
-    for example, to embed the \c {webui:about} page in an \c <iframe> element on
-    a remotely loaded HTML page, perhaps to attempt a phishing attack. We also
-    need the \c {LocalAccessAllowed} flag without which we would not be able to
-    access the \c {webui} scheme from our \c {webui:about} page.
-
-    Earlier we saw that the call to \c {WebUiHandler::registerUrlScheme()} is
-    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 \QWE classes are instantiated by the application.
-
-    \section1 Handling Requests
-
-    A custom scheme handler is, broadly speaking, similar to a web application
-    served over HTTP. However, because custom schemes are integrated directly
-    into the web engine, they have the advantage in terms of efficiency: there's
-    no need for generating and parsing HTTP messages or for transferring data
-    over sockets.
-
-    Implementing a handler means creating a subclass of \l
-    {QWebEngineUrlSchemeHandler}, which is just what is done by the \c
-    {WebUiHandler} class of the example program:
-
-    \quotefromfile webenginewidgets/webui/webuihandler.h
-    \skipto class WebUiHandler
-    \printuntil /^\}/
-
-    For each request to a \c {webui} URL, the \c
-    {WebUiHandler::requestStarted()} method will be called:
-
-    \quotefromfile webenginewidgets/webui/webuihandler.cpp
-    \skipto void WebUiHandler::requestStarted
-    \printuntil /^\}/
-
-    The \l {QWebEngineUrlRequestJob} object \c {job} contains the request's
-    attributes and provides methods for replying to the request with a response.
-    Responses are generated asynchronously by reading them from the \l
-    {QIODevice} that the application passes to \l
-    {QWebEngineUrlRequestJob::reply()}{reply()}.
-
-    \warning The \c requestStarted() method is not called from the main thread,
-    but from the web engine's IO thread. Care must be taken to synchronize
-    access to any resources on the main thread.
-
-    Aside from the usual fare of \l
-    {QWebEngineUrlRequestJob::requestMethod()}{requestMethod} and \l
-    {QWebEngineUrlRequestJob::requestUrl()}{requestUrl}, there is also the \l
-    {QWebEngineUrlRequestJob::initiator()}{initiator}, holding the origin of the
-    content which initiated the request. An empty \c initiator means the request
-    was initiated directly by the application (via \l
-    {QWebEnginePage::setUrl()}, for example). The special value \c "null"
-    corresponds to an opaque origin (a sandboxed \c {<iframe>} element, for
-    example). Otherwise, the \c initiator will contain the URL scheme, hostname,
-    and port of the content which initiated the request.
-
-    In this example, the \c initiator is used to ensure that \c {POST} requests
-    to \c {webui:about} will only trigger the application's exit if they
-    originate from the \c {webui} scheme. This prevents content loaded over
-    other schemes from triggering the application's exit.
-
-*/
diff --git a/examples/webenginewidgets/webui/main.cpp b/examples/webenginewidgets/webui/main.cpp
deleted file mode 100644
index cbbb9ad25fe..00000000000
--- a/examples/webenginewidgets/webui/main.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "webuihandler.h"
-
-#include <QApplication>
-#include <QWebEnginePage>
-#include <QWebEngineProfile>
-#include <QWebEngineView>
-
-int main(int argc, char *argv[])
-{
-    QCoreApplication::setOrganizationName("QtExamples");
-
-    WebUiHandler::registerUrlScheme();
-
-    QApplication app(argc, argv);
-
-    QWebEngineProfile profile;
-
-    WebUiHandler handler;
-    profile.installUrlSchemeHandler(WebUiHandler::schemeName, &handler);
-
-    QWebEnginePage page(&profile);
-    QWebEngineView view;
-    view.setPage(&page);
-    page.load(WebUiHandler::aboutUrl);
-    view.setContextMenuPolicy(Qt::NoContextMenu);
-    view.resize(500, 600);
-    view.show();
-
-    return app.exec();
-}
diff --git a/examples/webenginewidgets/webui/webui.pro b/examples/webenginewidgets/webui/webui.pro
deleted file mode 100644
index 71483358792..00000000000
--- a/examples/webenginewidgets/webui/webui.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-
-QT += webenginewidgets
-
-HEADERS += \
-    webuihandler.h
-
-SOURCES += \
-    main.cpp \
-    webuihandler.cpp
-
-RESOURCES += \
-    webui.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/webui
-INSTALLS += target
diff --git a/examples/webenginewidgets/webui/webui.qrc b/examples/webenginewidgets/webui/webui.qrc
deleted file mode 100644
index 6ddf01fa206..00000000000
--- a/examples/webenginewidgets/webui/webui.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file>about.html</file>
-    </qresource>
-</RCC>
diff --git a/examples/webenginewidgets/webui/webuihandler.cpp b/examples/webenginewidgets/webui/webuihandler.cpp
deleted file mode 100644
index 932d622e5d1..00000000000
--- a/examples/webenginewidgets/webui/webuihandler.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "webuihandler.h"
-
-#include <QApplication>
-#include <QFile>
-#include <QWebEngineUrlRequestJob>
-#include <QWebEngineUrlScheme>
-
-#define SCHEMENAME "webui"
-
-const QByteArray WebUiHandler::schemeName = QByteArrayLiteral(SCHEMENAME);
-const QUrl WebUiHandler::aboutUrl = QUrl(QStringLiteral(SCHEMENAME ":about"));
-
-WebUiHandler::WebUiHandler(QObject *parent)
-    : QWebEngineUrlSchemeHandler(parent)
-{
-}
-
-void WebUiHandler::requestStarted(QWebEngineUrlRequestJob *job)
-{
-    static const QUrl webUiOrigin(QStringLiteral(SCHEMENAME ":"));
-    static const QByteArray GET(QByteArrayLiteral("GET"));
-    static const QByteArray POST(QByteArrayLiteral("POST"));
-
-    QByteArray method = job->requestMethod();
-    QUrl url = job->requestUrl();
-    QUrl initiator = job->initiator();
-
-    if (method == GET && url == aboutUrl) {
-        QFile *file = new QFile(QStringLiteral(":/about.html"), job);
-        file->open(QIODevice::ReadOnly);
-        job->reply(QByteArrayLiteral("text/html"), file);
-    } else if (method == POST && url == aboutUrl && initiator == webUiOrigin) {
-        job->fail(QWebEngineUrlRequestJob::RequestAborted);
-        QApplication::exit();
-    } else {
-        job->fail(QWebEngineUrlRequestJob::UrlNotFound);
-    }
-}
-
-// static
-void WebUiHandler::registerUrlScheme()
-{
-    QWebEngineUrlScheme webUiScheme(schemeName);
-    webUiScheme.setFlags(QWebEngineUrlScheme::SecureScheme |
-                         QWebEngineUrlScheme::LocalScheme |
-                         QWebEngineUrlScheme::LocalAccessAllowed);
-    QWebEngineUrlScheme::registerScheme(webUiScheme);
-}
diff --git a/examples/webenginewidgets/webui/webuihandler.h b/examples/webenginewidgets/webui/webuihandler.h
deleted file mode 100644
index 072c0809c98..00000000000
--- a/examples/webenginewidgets/webui/webuihandler.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef WEBUIHANDLER_H
-#define WEBUIHANDLER_H
-
-#include <QWebEngineUrlSchemeHandler>
-
-class WebUiHandler : public QWebEngineUrlSchemeHandler
-{
-    Q_OBJECT
-public:
-    explicit WebUiHandler(QObject *parent = nullptr);
-
-    void requestStarted(QWebEngineUrlRequestJob *job) override;
-
-    static void registerUrlScheme();
-
-    const static QByteArray schemeName;
-    const static QUrl aboutUrl;
-};
-
-#endif // !WEBUIHANDLER_H
diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp
index e78a206d657..9e5b95ef48e 100644
--- a/src/core/api/qwebengineurlschemehandler.cpp
+++ b/src/core/api/qwebengineurlschemehandler.cpp
@@ -30,10 +30,23 @@ QT_BEGIN_NAMESPACE
     {
     public:
         MySchemeHandler(QObject *parent = nullptr);
-        void requestStarted(QWebEngineUrlRequestJob *request)
+        void requestStarted(QWebEngineUrlRequestJob *job)
         {
-            // ....
+            const QByteArray method = job->requestMethod();
+            const QUrl url = job->requestUrl();
+
+            if (isValidUrl(url)) {
+                if (method == QByteArrayLiteral("GET")) {
+                    job->reply(QByteArrayLiteral("text/html"), makeReply(url));
+                else // Unsupported method
+                    job->fail(QWebEngineUrlRequestJob::RequestDenied);
+            } else {
+                // Invalid URL
+                job->fail(QWebEngineUrlRequestJob::UrlNotFound);
+            }
         }
+        bool isValidUrl(const QUrl &url) const // ....
+        QIODevice *makeReply(const QUrl &url) // ....
     };
 
     int main(int argc, char **argv)
@@ -56,7 +69,7 @@ QT_BEGIN_NAMESPACE
 
     \inmodule QtWebEngineCore
 
-    \sa {QWebEngineUrlScheme}, {WebEngine Widgets WebUI Example}
+    \sa {QWebEngineUrlScheme}
 */
 
 /*!

From 8787ce2760bd589c8b6d55e464d215a7c60155d1 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 21 Mar 2023 09:24:51 +0100
Subject: [PATCH 118/681] Add quotes from removed example to documentation

Task-number: QTBUG-108751
Change-Id: I5560c2104e28cb5ca753f5db3579feabf4723980
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit fb2b93818c7ecd5c025b999b2521801da9f4fbc9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineurlschemehandler.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp
index 9e5b95ef48e..e01ecef4942 100644
--- a/src/core/api/qwebengineurlschemehandler.cpp
+++ b/src/core/api/qwebengineurlschemehandler.cpp
@@ -12,9 +12,23 @@ QT_BEGIN_NAMESPACE
     \brief The QWebEngineUrlSchemeHandler class is a base class for handling custom URL schemes.
     \since 5.6
 
+    A custom scheme handler is, broadly speaking, similar to a web application
+    served over HTTP. However, because custom schemes are integrated directly
+    into the web engine, they have the advantage in terms of efficiency and security:
+    There is no need for generating and parsing HTTP messages or for transferring data
+    over sockets, nor any way to intercept or monitor the traffic.
+
     To implement a custom URL scheme for QtWebEngine, you first have to create an instance of
     QWebEngineUrlScheme and register it using QWebEngineUrlScheme::registerScheme().
 
+    As custom schemes are integrated directly into the web engine, they do not
+    necessarily need to follow the standard security rules which apply to
+    ordinary web content. Depending on the chosen configuration, content served
+    over a custom scheme may be given access to local resources, be set to
+    ignore Content-Security-Policy rules, or conversely, be denied access to any
+    other content entirely. If it is to be accessed by normal content, ensure cross-origin
+    access is enabled, and if accessed from HTTPS that it is marked as secure.
+
     \note Make sure that you create and register the scheme object \e before the QGuiApplication
     or QApplication object is instantiated.
 

From 30636655eb8b3d16c919ee27ecd4fc3f7da4626d Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 24 Mar 2023 21:39:19 +0000
Subject: [PATCH 119/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I584e7756af9092eaefb4b98c16e7641db37798ec
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 32e9ac471b8..b795f98ac44 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 6fea78bca76e50b4eb8a0d8f6a43430d4f52f24a
+    ref: d589cb66fb1beeb2f543a47af543a9030520cd89
     required: true
   ../qtpositioning:
-    ref: 91c13402de87797674bf2db034bcd0b63b877b69
+    ref: 0511942d1e16da3bdc886f2ab0185b6d3414cbe0
     required: false
   ../qttools:
-    ref: 96babe3674632c3ffe1aebe49a5772d3c073a976
+    ref: 476cbad5b079abc50ca1b4e4171967cd942c3ee1
     required: false
   ../qtwebchannel:
-    ref: b5aae6fd460c0777753044b8f832efadf0bc779e
+    ref: eb0dbc92fb327d8783c9c5c30919870f1883dce7
     required: false

From 8755a5cfa23256de9e6a0b6ffd8bec0998ddf5b8 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 24 Mar 2023 11:40:47 +0100
Subject: [PATCH 120/681] Use docs target for chromium code attributions

The target docs_WebEngieCore, which in the end calls
generate_docs_WebEngineCore, is not a dependency for
any other target in generated ninja file.

Change-Id: Ic2f1c93fed8fbb1a44e2f99365b15b7ec3e636f2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b2f56c87d74324594ec86047c2a039aae9da7293)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index 0ee286031fa..d4125b47621 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -93,7 +93,7 @@ add_custom_command(
     USES_TERMINAL
 )
 add_custom_target(generate_chromium_attributions DEPENDS chromium_attributions.qdoc)
-add_dependencies(generate_docs_WebEngineCore generate_chromium_attributions)
+add_dependencies(docs generate_chromium_attributions)
 
 ##
 #  WEBENGINECORE RESOURCES

From c9f7dddeb6bee8c5eb1337adf8c9cb166e98cf9a Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 17 Mar 2023 12:06:19 +0100
Subject: [PATCH 121/681] Minor. Fix namespace issues of inputmethods manul
 test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: Ic0f318aa63cab901b979d76a34e329b2ab8359cf
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit cec2d7602709dae40a172b4adcf1c76bcf258f9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/manual/widgets/inputmethods/colorpicker.h | 2 ++
 tests/manual/widgets/inputmethods/controlview.h | 5 ++++-
 tests/manual/widgets/inputmethods/testview.h    | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/manual/widgets/inputmethods/colorpicker.h b/tests/manual/widgets/inputmethods/colorpicker.h
index 171c0186b6b..0b6b3257a5c 100644
--- a/tests/manual/widgets/inputmethods/colorpicker.h
+++ b/tests/manual/widgets/inputmethods/colorpicker.h
@@ -7,8 +7,10 @@
 #include <QColor>
 #include <QWidget>
 
+QT_BEGIN_NAMESPACE
 class QLineEdit;
 class QPushButton;
+QT_END_NAMESPACE
 
 class ColorPicker : public QWidget
 {
diff --git a/tests/manual/widgets/inputmethods/controlview.h b/tests/manual/widgets/inputmethods/controlview.h
index f6b3e7fe6e5..caa08593ffd 100644
--- a/tests/manual/widgets/inputmethods/controlview.h
+++ b/tests/manual/widgets/inputmethods/controlview.h
@@ -8,12 +8,15 @@
 #include <QTextCharFormat>
 #include <QWidget>
 
-class ColorPicker;
+QT_BEGIN_NAMESPACE
 class QComboBox;
 class QLabel;
 class QLineEdit;
 class QPushButton;
 class QSpinBox;
+QT_END_NAMESPACE
+
+class ColorPicker;
 
 class ControlView : public QWidget
 {
diff --git a/tests/manual/widgets/inputmethods/testview.h b/tests/manual/widgets/inputmethods/testview.h
index feb512cdeb8..b99e60d75f3 100644
--- a/tests/manual/widgets/inputmethods/testview.h
+++ b/tests/manual/widgets/inputmethods/testview.h
@@ -7,8 +7,10 @@
 #include <QTextCharFormat>
 #include <QWidget>
 
+QT_BEGIN_NAMESPACE
 class QPushButton;
 class QTableView;
+QT_END_NAMESPACE
 
 class TestView : public QWidget
 {

From fd940eae4924abcce8ab5dcbd5dce2b5114e52cc Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 24 Mar 2023 15:13:29 +0100
Subject: [PATCH 122/681] Update initialization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add missing calls to match RunBrowser() logic.

Change-Id: Ia4a14acb279cc43cc8ab4930f1f5432b03a8cbed
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 7e19bc1897696270cf5469a8a640c545e4976da2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_context.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index b341ad99807..658c1bf291e 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -21,6 +21,7 @@
 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h"
 #endif
 #include "chrome/common/chrome_switches.h"
+#include "content/common/process_visibility_tracker.h"
 #include "content/gpu/gpu_child_thread.h"
 #include "content/browser/compositor/surface_utils.h"
 #include "content/browser/compositor/viz_process_transport_factory.h"
@@ -30,6 +31,7 @@
 #endif
 #include "components/discardable_memory/service/discardable_shared_memory_manager.h"
 #include "components/download/public/common/download_task_runner.h"
+#include "components/power_scheduler/power_mode_arbiter.h"
 #include "components/viz/common/features.h"
 #include "components/web_cache/browser/web_cache_manager.h"
 #include "content/app/mojo_ipc_support.h"
@@ -762,8 +764,10 @@ WebEngineContext::WebEngineContext()
     content::StartBrowserThreadPool();
     content::BrowserTaskExecutor::PostFeatureListSetup();
     tracing::InitTracingPostThreadPoolStartAndFeatureList(false);
-    m_discardableSharedMemoryManager = std::make_unique<discardable_memory::DiscardableSharedMemoryManager>();
     base::PowerMonitor::Initialize(std::make_unique<base::PowerMonitorDeviceSource>());
+    content::ProcessVisibilityTracker::GetInstance();
+    m_discardableSharedMemoryManager = std::make_unique<discardable_memory::DiscardableSharedMemoryManager>();
+    power_scheduler::PowerModeArbiter::GetInstance()->OnThreadPoolAvailable();
 
     m_mojoIpcSupport = std::make_unique<content::MojoIpcSupport>(content::BrowserTaskExecutor::CreateIOThread());
     download::SetIOTaskRunner(m_mojoIpcSupport->io_thread()->task_runner());

From 8f3ecf8fe19ac9e78331ce13749bdf05b51d6483 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Tue, 28 Mar 2023 15:50:42 +0200
Subject: [PATCH 123/681] Simple browser example: Use modern string literals

Change-Id: I14ed5efed1bf228239f95a8a4addce5d19a9f220
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit de96e684275be9548252f874cbc515b81cd51cd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginewidgets/simplebrowser/browser.cpp     |  6 ++++--
 .../simplebrowser/browserwindow.cpp                | 14 ++++++++------
 .../simplebrowser/downloadwidget.cpp               |  6 ++++--
 examples/webenginewidgets/simplebrowser/main.cpp   | 10 ++++++----
 .../webenginewidgets/simplebrowser/tabwidget.cpp   |  6 ++++--
 .../webenginewidgets/simplebrowser/webview.cpp     |  8 +++++---
 6 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/examples/webenginewidgets/simplebrowser/browser.cpp b/examples/webenginewidgets/simplebrowser/browser.cpp
index f1ed6873908..83e273d079d 100644
--- a/examples/webenginewidgets/simplebrowser/browser.cpp
+++ b/examples/webenginewidgets/simplebrowser/browser.cpp
@@ -6,6 +6,8 @@
 
 #include <QWebEngineSettings>
 
+using namespace Qt::StringLiterals;
+
 Browser::Browser()
 {
     // Quit application if the download manager window is the only remaining window
@@ -19,8 +21,8 @@ Browser::Browser()
 BrowserWindow *Browser::createHiddenWindow(bool offTheRecord)
 {
     if (!offTheRecord && !m_profile) {
-        m_profile.reset(new QWebEngineProfile(
-                QString::fromLatin1("simplebrowser.%1").arg(qWebEngineChromiumVersion())));
+        const QString name = u"simplebrowser."_s + QLatin1StringView(qWebEngineChromiumVersion());
+        m_profile.reset(new QWebEngineProfile(name));
         m_profile->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
         m_profile->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
         m_profile->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index 6fc9f9d1dd4..de8658196f9 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -21,6 +21,8 @@
 #include <QWebEngineFindTextResult>
 #include <QWebEngineProfile>
 
+using namespace Qt::StringLiterals;
+
 BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool forDevTools)
     : m_browser(browser)
     , m_profile(profile)
@@ -58,7 +60,7 @@ BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool
 
         m_progressBar->setMaximumHeight(1);
         m_progressBar->setTextVisible(false);
-        m_progressBar->setStyleSheet(QStringLiteral("QProgressBar {border: 0px} QProgressBar::chunk {background-color: #da4453}"));
+        m_progressBar->setStyleSheet(u"QProgressBar {border: 0px} QProgressBar::chunk {background-color: #da4453}"_s);
 
         layout->addWidget(m_progressBar);
     }
@@ -319,7 +321,7 @@ QToolBar *BrowserWindow::createToolBar()
     backShortcuts.append(QKeySequence(Qt::Key_Back));
     m_historyBackAction->setShortcuts(backShortcuts);
     m_historyBackAction->setIconVisibleInMenu(false);
-    m_historyBackAction->setIcon(QIcon(QStringLiteral(":go-previous.png")));
+    m_historyBackAction->setIcon(QIcon(u":go-previous.png"_s));
     m_historyBackAction->setToolTip(tr("Go back in history"));
     connect(m_historyBackAction, &QAction::triggered, [this]() {
         m_tabWidget->triggerWebPageAction(QWebEnginePage::Back);
@@ -337,7 +339,7 @@ QToolBar *BrowserWindow::createToolBar()
     fwdShortcuts.append(QKeySequence(Qt::Key_Forward));
     m_historyForwardAction->setShortcuts(fwdShortcuts);
     m_historyForwardAction->setIconVisibleInMenu(false);
-    m_historyForwardAction->setIcon(QIcon(QStringLiteral(":go-next.png")));
+    m_historyForwardAction->setIcon(QIcon(u":go-next.png"_s));
     m_historyForwardAction->setToolTip(tr("Go forward in history"));
     connect(m_historyForwardAction, &QAction::triggered, [this]() {
         m_tabWidget->triggerWebPageAction(QWebEnginePage::Forward);
@@ -357,7 +359,7 @@ QToolBar *BrowserWindow::createToolBar()
     navigationBar->addWidget(m_urlLineEdit);
 
     auto downloadsAction = new QAction(this);
-    downloadsAction->setIcon(QIcon(QStringLiteral(":go-bottom.png")));
+    downloadsAction->setIcon(QIcon(u":go-bottom.png"_s));
     downloadsAction->setToolTip(tr("Show downloads"));
     navigationBar->addAction(downloadsAction);
     connect(downloadsAction, &QAction::triggered, [this]() {
@@ -462,8 +464,8 @@ WebView *BrowserWindow::currentTab() const
 
 void BrowserWindow::handleWebViewLoadProgress(int progress)
 {
-    static QIcon stopIcon(QStringLiteral(":process-stop.png"));
-    static QIcon reloadIcon(QStringLiteral(":view-refresh.png"));
+    static QIcon stopIcon(u":process-stop.png"_s);
+    static QIcon reloadIcon(u":view-refresh.png"_s);
 
     if (0 < progress && progress < 100) {
         m_stopReloadAction->setData(QWebEnginePage::Stop);
diff --git a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
index d4998853eb0..8f73f9f37eb 100644
--- a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
@@ -7,6 +7,8 @@
 #include <QUrl>
 #include <QWebEngineDownloadRequest>
 
+using namespace Qt::StringLiterals;
+
 DownloadWidget::DownloadWidget(QWebEngineDownloadRequest *download, QWidget *parent)
     : QFrame(parent)
     , m_download(download)
@@ -101,11 +103,11 @@ void DownloadWidget::updateWidget()
     }
 
     if (state == QWebEngineDownloadRequest::DownloadInProgress) {
-        static QIcon cancelIcon(QStringLiteral(":process-stop.png"));
+        static QIcon cancelIcon(u":process-stop.png"_s);
         m_cancelButton->setIcon(cancelIcon);
         m_cancelButton->setToolTip(tr("Stop downloading"));
     } else {
-        static QIcon removeIcon(QStringLiteral(":edit-clear.png"));
+        static QIcon removeIcon(u":edit-clear.png"_s);
         m_cancelButton->setIcon(removeIcon);
         m_cancelButton->setToolTip(tr("Remove from list"));
     }
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index b945ef27e53..d5d9e78abbc 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -9,14 +9,16 @@
 #include <QWebEngineProfile>
 #include <QWebEngineSettings>
 
+using namespace Qt::StringLiterals;
+
 QUrl commandLineUrlArgument()
 {
     const QStringList args = QCoreApplication::arguments();
     for (const QString &arg : args.mid(1)) {
-        if (!arg.startsWith(QLatin1Char('-')))
+        if (!arg.startsWith(u'-'))
             return QUrl::fromUserInput(arg);
     }
-    return QUrl(QStringLiteral("https://www.qt.io"));
+    return QUrl(u"https://www.qt.io"_s);
 }
 
 int main(int argc, char **argv)
@@ -24,8 +26,8 @@ int main(int argc, char **argv)
     QCoreApplication::setOrganizationName("QtExamples");
 
     QApplication app(argc, argv);
-    app.setWindowIcon(QIcon(QStringLiteral(":AppLogoColor.png")));
-    QLoggingCategory::setFilterRules(QStringLiteral("qt.webenginecontext.debug=true"));
+    app.setWindowIcon(QIcon(u":AppLogoColor.png"_s));
+    QLoggingCategory::setFilterRules(u"qt.webenginecontext.debug=true"_s);
 
     QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
     QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.cpp b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
index 9e19cf78231..f9037a8e1c4 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
@@ -9,6 +9,8 @@
 #include <QTabBar>
 #include <QWebEngineProfile>
 
+using namespace Qt::StringLiterals;
+
 TabWidget::TabWidget(QWebEngineProfile *profile, QWidget *parent)
     : QTabWidget(parent)
     , m_profile(profile)
@@ -32,9 +34,9 @@ TabWidget::TabWidget(QWebEngineProfile *profile, QWidget *parent)
 
     if (profile->isOffTheRecord()) {
         QLabel *icon = new QLabel(this);
-        QPixmap pixmap(QStringLiteral(":ninja.png"));
+        QPixmap pixmap(u":ninja.png"_s);
         icon->setPixmap(pixmap.scaledToHeight(tabBar->height()));
-        setStyleSheet(QStringLiteral("QTabWidget::tab-bar { left: %1px; }").
+        setStyleSheet(u"QTabWidget::tab-bar { left: %1px; }"_s.
                       arg(icon->pixmap().width()));
     }
 }
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index 16a58ce6cd5..c8dccdf140f 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -17,6 +17,8 @@
 #include <QTimer>
 #include <QStyle>
 
+using namespace Qt::StringLiterals;
+
 WebView::WebView(QWidget *parent)
     : QWebEngineView(parent)
     , m_loadProgress(100)
@@ -147,13 +149,13 @@ QIcon WebView::favIcon() const
         return favIcon;
 
     if (m_loadProgress < 0) {
-        static QIcon errorIcon(QStringLiteral(":dialog-error.png"));
+        static QIcon errorIcon(u":dialog-error.png"_s);
         return errorIcon;
     } else if (m_loadProgress < 100) {
-        static QIcon loadingIcon(QStringLiteral(":view-refresh.png"));
+        static QIcon loadingIcon(u":view-refresh.png"_s);
         return loadingIcon;
     } else {
-        static QIcon defaultIcon(QStringLiteral(":text-html.png"));
+        static QIcon defaultIcon(u":text-html.png"_s);
         return defaultIcon;
     }
 }

From 96e7053a5fd80fcb1893244d8c9ae5eb212b84cd Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Tue, 28 Mar 2023 15:55:25 +0200
Subject: [PATCH 124/681] Simple browser example: Use member initialization

As a drive-by, make constructors explicit.

Change-Id: I5c8e3d8049504afa4aa5a0d7c1a85bb59eb3cd38
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 11e598d7153ec209bb208fafa0dcef9cab7c324b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../simplebrowser/browserwindow.cpp           |  8 --------
 .../simplebrowser/browserwindow.h             | 19 ++++++++++---------
 .../simplebrowser/downloadmanagerwidget.cpp   |  1 -
 .../simplebrowser/downloadmanagerwidget.h     |  2 +-
 .../simplebrowser/tabwidget.h                 |  2 +-
 .../webenginewidgets/simplebrowser/webpage.h  |  2 +-
 .../simplebrowser/webpopupwindow.h            |  2 +-
 .../simplebrowser/webview.cpp                 |  1 -
 .../webenginewidgets/simplebrowser/webview.h  |  4 ++--
 9 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index de8658196f9..6de4868bdaf 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -27,14 +27,6 @@ BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool
     : m_browser(browser)
     , m_profile(profile)
     , m_tabWidget(new TabWidget(profile, this))
-    , m_progressBar(nullptr)
-    , m_historyBackAction(nullptr)
-    , m_historyForwardAction(nullptr)
-    , m_stopAction(nullptr)
-    , m_reloadAction(nullptr)
-    , m_stopReloadAction(nullptr)
-    , m_urlLineEdit(nullptr)
-    , m_favAction(nullptr)
 {
     setAttribute(Qt::WA_DeleteOnClose, true);
     setFocusPolicy(Qt::ClickFocus);
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.h b/examples/webenginewidgets/simplebrowser/browserwindow.h
index 47fdf631411..55eeb46c2c0 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.h
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.h
@@ -22,7 +22,8 @@ class BrowserWindow : public QMainWindow
     Q_OBJECT
 
 public:
-    BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool forDevTools = false);
+    explicit BrowserWindow(Browser *browser, QWebEngineProfile *profile,
+                           bool forDevTools = false);
     QSize sizeHint() const override;
     TabWidget *tabWidget() const;
     WebView *currentTab() const;
@@ -55,14 +56,14 @@ private slots:
     Browser *m_browser;
     QWebEngineProfile *m_profile;
     TabWidget *m_tabWidget;
-    QProgressBar *m_progressBar;
-    QAction *m_historyBackAction;
-    QAction *m_historyForwardAction;
-    QAction *m_stopAction;
-    QAction *m_reloadAction;
-    QAction *m_stopReloadAction;
-    QLineEdit *m_urlLineEdit;
-    QAction *m_favAction;
+    QProgressBar *m_progressBar = nullptr;
+    QAction *m_historyBackAction = nullptr;
+    QAction *m_historyForwardAction = nullptr;
+    QAction *m_stopAction = nullptr;
+    QAction *m_reloadAction = nullptr;
+    QAction *m_stopReloadAction = nullptr;
+    QLineEdit *m_urlLineEdit = nullptr;
+    QAction *m_favAction = nullptr;
     QString m_lastSearch;
 };
 
diff --git a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
index bfb857cd870..fdddc4fb041 100644
--- a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
@@ -13,7 +13,6 @@
 
 DownloadManagerWidget::DownloadManagerWidget(QWidget *parent)
     : QWidget(parent)
-    , m_numDownloads(0)
 {
     setupUi(this);
 }
diff --git a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h
index b9d5e9bd75c..67df492b969 100644
--- a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h
+++ b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h
@@ -30,7 +30,7 @@ class DownloadManagerWidget final : public QWidget, public Ui::DownloadManagerWi
     void add(DownloadWidget *downloadWidget);
     void remove(DownloadWidget *downloadWidget);
 
-    int m_numDownloads;
+    int m_numDownloads = 0;
 };
 
 #endif // DOWNLOADMANAGERWIDGET_H
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.h b/examples/webenginewidgets/simplebrowser/tabwidget.h
index 08caab52c7c..a1a893b62b8 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.h
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.h
@@ -19,7 +19,7 @@ class TabWidget : public QTabWidget
     Q_OBJECT
 
 public:
-    TabWidget(QWebEngineProfile *profile, QWidget *parent = nullptr);
+    explicit TabWidget(QWebEngineProfile *profile, QWidget *parent = nullptr);
 
     WebView *currentWebView() const;
 
diff --git a/examples/webenginewidgets/simplebrowser/webpage.h b/examples/webenginewidgets/simplebrowser/webpage.h
index 7fa2be335e5..83a4e833f35 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.h
+++ b/examples/webenginewidgets/simplebrowser/webpage.h
@@ -13,7 +13,7 @@ class WebPage : public QWebEnginePage
     Q_OBJECT
 
 public:
-    WebPage(QWebEngineProfile *profile, QObject *parent = nullptr);
+    explicit WebPage(QWebEngineProfile *profile, QObject *parent = nullptr);
 
 signals:
     void createCertificateErrorDialog(QWebEngineCertificateError error);
diff --git a/examples/webenginewidgets/simplebrowser/webpopupwindow.h b/examples/webenginewidgets/simplebrowser/webpopupwindow.h
index d13f5f1831c..0726bf0c2f1 100644
--- a/examples/webenginewidgets/simplebrowser/webpopupwindow.h
+++ b/examples/webenginewidgets/simplebrowser/webpopupwindow.h
@@ -19,7 +19,7 @@ class WebPopupWindow : public QWidget
     Q_OBJECT
 
 public:
-    WebPopupWindow(QWebEngineProfile *profile);
+    explicit WebPopupWindow(QWebEngineProfile *profile);
     WebView *view() const;
 
 private slots:
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index c8dccdf140f..4e4f8aa3c41 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -21,7 +21,6 @@ using namespace Qt::StringLiterals;
 
 WebView::WebView(QWidget *parent)
     : QWebEngineView(parent)
-    , m_loadProgress(100)
 {
     connect(this, &QWebEngineView::loadStarted, [this]() {
         m_loadProgress = 0;
diff --git a/examples/webenginewidgets/simplebrowser/webview.h b/examples/webenginewidgets/simplebrowser/webview.h
index 63f82c3c9be..41bc04ac08b 100644
--- a/examples/webenginewidgets/simplebrowser/webview.h
+++ b/examples/webenginewidgets/simplebrowser/webview.h
@@ -20,7 +20,7 @@ class WebView : public QWebEngineView
     Q_OBJECT
 
 public:
-    WebView(QWidget *parent = nullptr);
+    explicit WebView(QWidget *parent = nullptr);
     void setPage(WebPage *page);
 
     int loadProgress() const;
@@ -51,7 +51,7 @@ private slots:
     void createWebActionTrigger(QWebEnginePage *page, QWebEnginePage::WebAction);
 
 private:
-    int m_loadProgress;
+    int m_loadProgress = 100;
 };
 
 #endif

From 239cef0bb84c6f0f9ebd176071ee60f738713ca4 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 24 Mar 2023 14:15:08 +0100
Subject: [PATCH 125/681] Get rid of our sync point manager
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We haven't needed our own since we got rid of the graphics node
integration.

Change-Id: I20b0fdb440c07e451d0e0152e8012ddf59e159cf
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit a3901dfc1f05e21cacded220188112a15df81f43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/compositor/content_gpu_client_qt.cpp |  5 -----
 src/core/compositor/content_gpu_client_qt.h   |  1 -
 src/core/web_engine_context.cpp               | 15 ---------------
 src/core/web_engine_context.h                 |  4 ----
 4 files changed, 25 deletions(-)

diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp
index 9f3b00bb861..d12074d2e9b 100644
--- a/src/core/compositor/content_gpu_client_qt.cpp
+++ b/src/core/compositor/content_gpu_client_qt.cpp
@@ -15,11 +15,6 @@ ContentGpuClientQt::~ContentGpuClientQt()
 {
 }
 
-gpu::SyncPointManager *ContentGpuClientQt::GetSyncPointManager()
-{
-    return WebEngineContext::syncPointManager();
-}
-
 gl::GLShareGroup *ContentGpuClientQt::GetInProcessGpuShareGroup()
 {
     if (!m_shareGroupQt.get())
diff --git a/src/core/compositor/content_gpu_client_qt.h b/src/core/compositor/content_gpu_client_qt.h
index 150c257ae82..33314e0bbe6 100644
--- a/src/core/compositor/content_gpu_client_qt.h
+++ b/src/core/compositor/content_gpu_client_qt.h
@@ -18,7 +18,6 @@ class ContentGpuClientQt : public content::ContentGpuClient {
     ~ContentGpuClientQt() override;
 
     // content::ContentGpuClient implementation.
-    gpu::SyncPointManager *GetSyncPointManager() override;
     gl::GLShareGroup *GetInProcessGpuShareGroup() override;
 
 private:
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 658c1bf291e..095b0ed50e8 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -55,7 +55,6 @@
 #include "content/public/common/main_function_params.h"
 #include "content/public/common/network_service_util.h"
 #include "gpu/command_buffer/service/gpu_switches.h"
-#include "gpu/command_buffer/service/sync_point_manager.h"
 #include "gpu/config/gpu_finch_features.h"
 #include "media/audio/audio_manager.h"
 #include "media/base/media_switches.h"
@@ -475,7 +474,6 @@ WebEngineContext::~WebEngineContext()
     Q_ASSERT(!m_devtoolsServer);
     Q_ASSERT(!m_browserRunner);
     Q_ASSERT(m_profileAdapters.isEmpty());
-    delete s_syncPointManager.fetchAndStoreRelaxed(nullptr);
 }
 
 WebEngineContext *WebEngineContext::current()
@@ -833,19 +831,6 @@ WebRtcLogUploader *WebEngineContext::webRtcLogUploader()
 #endif
 
 
-static QMutex s_spmMutex;
-QAtomicPointer<gpu::SyncPointManager> WebEngineContext::s_syncPointManager;
-
-gpu::SyncPointManager *WebEngineContext::syncPointManager()
-{
-    if (gpu::SyncPointManager *spm = s_syncPointManager.loadAcquire())
-        return spm;
-    QMutexLocker lock(&s_spmMutex);
-    if (!s_syncPointManager)
-        s_syncPointManager.storeRelaxed(new gpu::SyncPointManager());
-    return s_syncPointManager.loadRelaxed();
-}
-
 base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
                                                      bool &enableGLSoftwareRendering)
 {
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index 6819d06f0a3..5a2fd4c3e91 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -32,7 +32,6 @@ class DiscardableSharedMemoryManager;
 
 namespace gpu {
 struct GpuPreferences;
-class SyncPointManager;
 }
 
 #if QT_CONFIG(webengine_printing_and_pdf)
@@ -85,8 +84,6 @@ class WebEngineContext : public base::RefCounted<WebEngineContext> {
     static base::CommandLine *initCommandLine(bool &useEmbeddedSwitches,
                                               bool &enableGLSoftwareRendering);
 
-    static gpu::SyncPointManager *syncPointManager();
-
     static bool isGpuServiceOnUIThread();
 
 private:
@@ -121,7 +118,6 @@ class WebEngineContext : public base::RefCounted<WebEngineContext> {
     static scoped_refptr<QtWebEngineCore::WebEngineContext> m_handle;
     static bool m_destroyed;
     static bool m_closingDown;
-    static QAtomicPointer<gpu::SyncPointManager> s_syncPointManager;
 };
 
 } // namespace

From e30817a0544311b043fc5b40f0652c4b7dd4e2d3 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 28 Mar 2023 10:46:05 +0200
Subject: [PATCH 126/681] Add gn target to code attributions generator

Use gn_target for code attributions generation.

Task-number: QTBUG-88482
Change-Id: I4e5d063dec2347c10eb715a467bdd376e39e60af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 51fa03ce5936d5461e99cc6b3e9c6ea641c54f40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake       | 25 +++++++++++++++++++++++++
 src/core/api/CMakeLists.txt | 25 ++++++++++++-------------
 2 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index d3f8862ce31..8c666a7ac67 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1325,3 +1325,28 @@ function(add_build feature value)
     set(depTracker "${depTracker}" ${feature})
     set_property(GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER "${depTracker}")
 endfunction()
+
+function(add_code_attributions_target)
+    cmake_parse_arguments(PARSE_ARGV 0 arg ""
+        "TARGET;OUTPUT;GN_TARGET;FILE_TEMPLATE;ENTRY_TEMPLATE;BUILDDIR" ""
+    )
+    _qt_internal_validate_all_args_are_parsed(arg)
+    get_filename_component(fileTemplate ${arg_FILE_TEMPLATE} ABSOLUTE)
+    get_filename_component(entryTemplate ${arg_ENTRY_TEMPLATE} ABSOLUTE)
+    add_custom_command(
+        OUTPUT ${arg_OUTPUT}
+        COMMAND ${Python3_EXECUTABLE} ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
+           --file-template ${fileTemplate}
+           --entry-template ${entryTemplate}
+           --gn-binary ${Gn_EXECUTABLE}
+           --gn-target ${arg_GN_TARGET} --gn-out-dir ${arg_BUILDDIR}
+           credits ${arg_OUTPUT}
+        WORKING_DIRECTORY ${arg_BUILDDIR}
+        DEPENDS
+           ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
+           ${arg_FILE_TEMPLATE}
+           ${arg_ENTRY_TEMPLATE}
+        USES_TERMINAL
+     )
+     add_custom_target(${arg_TARGET} DEPENDS ${arg_OUTPUT})
+endfunction()
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index d4125b47621..f452656d306 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -74,6 +74,10 @@ qt_internal_extend_target(WebEngineCore CONDITION QT_FEATURE_webengine_geolocati
         Qt::Positioning
 )
 
+get_install_config(config)
+get_architectures(archs)
+list(GET archs 0 arch)
+
 ##
 #  DOCS
 ##
@@ -82,17 +86,14 @@ qt_internal_add_docs(WebEngineCore
     ../doc/qtwebengine.qdocconf
 )
 
-add_custom_command(
-    OUTPUT chromium_attributions.qdoc
-    COMMAND ${Python3_EXECUTABLE} chromium/tools/licenses.py
-        --file-template ../core/doc/about_credits.tmpl
-        --entry-template ../core/doc/about_credits_entry.tmpl
-        credits ${CMAKE_CURRENT_BINARY_DIR}/chromium_attributions.qdoc
-    DEPENDS ../doc/about_credits.tmpl ../doc/about_credits_entry.tmpl
-    WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
-    USES_TERMINAL
+add_code_attributions_target(
+    TARGET generate_chromium_attributions
+    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chromium_attributions.qdoc
+    GN_TARGET :QtWebEngineCore
+    FILE_TEMPLATE ../doc/about_credits.tmpl
+    ENTRY_TEMPLATE ../doc/about_credits_entry.tmpl
+    BUILDDIR ${buildDir}/${config}/${arch}
 )
-add_custom_target(generate_chromium_attributions DEPENDS chromium_attributions.qdoc)
 add_dependencies(docs generate_chromium_attributions)
 
 ##
@@ -109,9 +110,7 @@ set(resourceList qtwebengine_resources.pak
     qtwebengine_resources_200p.pak
     qtwebengine_devtools_resources.pak)
 
-get_install_config(config)
-get_architectures(archs)
-list(GET archs 0 arch)
+
 
 foreach(loc ${localeList})
     get_filename_component(locSourcePath ${buildDir}/${config}/${arch}/qtwebengine_locales/${loc}.pak REALPATH)

From e914660d2665f02a2e63ccdcf5cabd1d5ea216dc Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Wed, 29 Mar 2023 12:26:06 +0200
Subject: [PATCH 127/681] Simple browser example: Fix clazy warnings

- else after return
- Use multiarg version of QString::arg(QString)

Change-Id: Iceff3ee8877b866b5b9187cd85da54864ab17834
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 3d5ee5e333e4257d2d243ba250b2f45e732cdb1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../simplebrowser/downloadwidget.cpp          | 21 +++++++------------
 .../simplebrowser/webview.cpp                 |  9 ++++----
 2 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
index 8f73f9f37eb..83784b62870 100644
--- a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
@@ -40,12 +40,11 @@ inline QString DownloadWidget::withUnit(qreal bytes)
 {
     if (bytes < (1 << 10))
         return tr("%L1 B").arg(bytes);
-    else if (bytes < (1 << 20))
+    if (bytes < (1 << 20))
         return tr("%L1 KiB").arg(bytes / (1 << 10), 0, 'f', 2);
-    else if (bytes < (1 << 30))
+    if (bytes < (1 << 30))
         return tr("%L1 MiB").arg(bytes / (1 << 20), 0, 'f', 2);
-    else
-        return tr("%L1 GiB").arg(bytes / (1 << 30), 0, 'f', 2);
+    return tr("%L1 GiB").arg(bytes / (1 << 30), 0, 'f', 2);
 }
 
 void DownloadWidget::updateWidget()
@@ -65,16 +64,14 @@ void DownloadWidget::updateWidget()
             m_progressBar->setDisabled(false);
             m_progressBar->setFormat(
                 tr("%p% - %1 of %2 downloaded - %3/s")
-                .arg(withUnit(receivedBytes))
-                .arg(withUnit(totalBytes))
-                .arg(withUnit(bytesPerSecond)));
+                .arg(withUnit(receivedBytes), withUnit(totalBytes),
+                     withUnit(bytesPerSecond)));
         } else {
             m_progressBar->setValue(0);
             m_progressBar->setDisabled(false);
             m_progressBar->setFormat(
                 tr("unknown size - %1 downloaded - %2/s")
-                .arg(withUnit(receivedBytes))
-                .arg(withUnit(bytesPerSecond)));
+                .arg(withUnit(receivedBytes), withUnit(bytesPerSecond)));
         }
         break;
     case QWebEngineDownloadRequest::DownloadCompleted:
@@ -82,16 +79,14 @@ void DownloadWidget::updateWidget()
         m_progressBar->setDisabled(true);
         m_progressBar->setFormat(
             tr("completed - %1 downloaded - %2/s")
-            .arg(withUnit(receivedBytes))
-            .arg(withUnit(bytesPerSecond)));
+            .arg(withUnit(receivedBytes), withUnit(bytesPerSecond)));
         break;
     case QWebEngineDownloadRequest::DownloadCancelled:
         m_progressBar->setValue(0);
         m_progressBar->setDisabled(true);
         m_progressBar->setFormat(
             tr("cancelled - %1 downloaded - %2/s")
-            .arg(withUnit(receivedBytes))
-            .arg(withUnit(bytesPerSecond)));
+            .arg(withUnit(receivedBytes), withUnit(bytesPerSecond)));
         break;
     case QWebEngineDownloadRequest::DownloadInterrupted:
         m_progressBar->setValue(0);
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index 4e4f8aa3c41..dd6dbb14933 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -150,13 +150,14 @@ QIcon WebView::favIcon() const
     if (m_loadProgress < 0) {
         static QIcon errorIcon(u":dialog-error.png"_s);
         return errorIcon;
-    } else if (m_loadProgress < 100) {
+    }
+    if (m_loadProgress < 100) {
         static QIcon loadingIcon(u":view-refresh.png"_s);
         return loadingIcon;
-    } else {
-        static QIcon defaultIcon(u":text-html.png"_s);
-        return defaultIcon;
     }
+
+    static QIcon defaultIcon(u":text-html.png"_s);
+    return defaultIcon;
 }
 
 QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)

From bc69158535ac28bc8233c28da6b1808de2da0f66 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Wed, 29 Mar 2023 15:36:45 +0200
Subject: [PATCH 128/681] Simple browser example: Add helper function to remove
 key backspace

It otherwise looks like a bit like an oversight or bug.

Change-Id: If11fe034fa91022eb70c99b8a916fb35ac86f75d
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 24a11562f89016079f62b51ca5ad40938b74761c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../simplebrowser/browserwindow.cpp           | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index 6de4868bdaf..7a72b4a6f64 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -294,6 +294,20 @@ QMenu *BrowserWindow::createHelpMenu()
     return helpMenu;
 }
 
+static bool isBackspace(const QKeySequence &k)
+{
+    return (k[0].key() & Qt::Key_unknown) == Qt::Key_Backspace;
+}
+
+// Chromium already handles navigate on backspace when appropriate.
+static QList<QKeySequence> removeBackspace(QList<QKeySequence> keys)
+{
+    const auto it = std::find_if(keys.begin(), keys.end(), isBackspace);
+    if (it != keys.end())
+        keys.erase(it);
+    return keys;
+}
+
 QToolBar *BrowserWindow::createToolBar()
 {
     QToolBar *navigationBar = new QToolBar(tr("Navigation"));
@@ -301,14 +315,7 @@ QToolBar *BrowserWindow::createToolBar()
     navigationBar->toggleViewAction()->setEnabled(false);
 
     m_historyBackAction = new QAction(this);
-    QList<QKeySequence> backShortcuts = QKeySequence::keyBindings(QKeySequence::Back);
-    for (auto it = backShortcuts.begin(); it != backShortcuts.end();) {
-        // Chromium already handles navigate on backspace when appropriate.
-        if ((*it)[0].key() == Qt::Key_Backspace)
-            it = backShortcuts.erase(it);
-        else
-            ++it;
-    }
+    auto backShortcuts = removeBackspace(QKeySequence::keyBindings(QKeySequence::Back));
     // For some reason Qt doesn't bind the dedicated Back key to Back.
     backShortcuts.append(QKeySequence(Qt::Key_Back));
     m_historyBackAction->setShortcuts(backShortcuts);
@@ -321,13 +328,7 @@ QToolBar *BrowserWindow::createToolBar()
     navigationBar->addAction(m_historyBackAction);
 
     m_historyForwardAction = new QAction(this);
-    QList<QKeySequence> fwdShortcuts = QKeySequence::keyBindings(QKeySequence::Forward);
-    for (auto it = fwdShortcuts.begin(); it != fwdShortcuts.end();) {
-        if (((*it)[0].key() & Qt::Key_unknown) == Qt::Key_Backspace)
-            it = fwdShortcuts.erase(it);
-        else
-            ++it;
-    }
+    auto fwdShortcuts = removeBackspace(QKeySequence::keyBindings(QKeySequence::Forward));
     fwdShortcuts.append(QKeySequence(Qt::Key_Forward));
     m_historyForwardAction->setShortcuts(fwdShortcuts);
     m_historyForwardAction->setIconVisibleInMenu(false);

From 17e98fe5197ae64a97b6e1b95dfea0a21e4dd65d Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Thu, 10 Feb 2022 16:54:32 +0100
Subject: [PATCH 129/681] doc: Provide a screenshot of the PDF Viewer widget
 example; rename page

Let's be clear in the title that this is a widget-based example, as
opposed to the Qt Quick example in the docs.

The screenshot is from macOS 13.2.1.

The 6.6 example has more features, so this screenshot looks a bit
incomplete compared to that.

Task-number: QTBUG-81560
Change-Id: I28b50d608756f10967f1bf5f7ac72ec9a83d9417
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 9937cbb4a0f43a799400f4057e8c695f88d1aa9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../pdfviewer/doc/src/pdfviewer.qdoc           |   6 ++----
 src/pdf/doc/images/pdfviewer.png               | Bin 0 -> 264348 bytes
 2 files changed, 2 insertions(+), 4 deletions(-)
 create mode 100644 src/pdf/doc/images/pdfviewer.png

diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index 8a60e06d677..e585a84ef71 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -6,12 +6,10 @@
     \meta installpath pdfwidgets
     \ingroup qtpdf-examples
 
-    \title PDF Viewer Example
+    \title PDF Viewer Widget Example
     \brief A widget-based PDF viewer that allows scrolling through the pages.
 
-    \omit
-    //! TODO add thumbnail \image pdfviewer.png
-    \endomit
+    \image pdfviewer.png
 
     \e {PDF Viewer} demonstrates how to use the QPdfView class to render
     PDF documents and the QPdfPageNavigator class to navigate them.
diff --git a/src/pdf/doc/images/pdfviewer.png b/src/pdf/doc/images/pdfviewer.png
new file mode 100644
index 0000000000000000000000000000000000000000..ac8a31ac00fab1211c2cde7ff3e83caaa7c77c55
GIT binary patch

From f45c9d5291d9c864c7b734f868734a5595ddc459 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 29 Mar 2023 19:13:07 +0200
Subject: [PATCH 130/681] Update Chromium

Pulls in following patches:

* e41707d576a  Add support for custom gn binary to license generator
* 8b8de6420db  FIXUP: Jumbo build
* 17d1d44b890  [Backport] Security bug 1401571
* 9de0d8a90d9  Fixes for building with GCC-13
* 4d558a69453  Opus needs perl for optimatizations

Change-Id: I939daf2c2dcbcd7890bc24de591650f1a4eedd7b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 60d386ba9410f2d64dd816ce28fdaf7f1f7dfa49)
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index fdcde546b2a..e41707d576a 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit fdcde546b2af3d996e26c1ca99dbcd1f525a9d41
+Subproject commit e41707d576a21b3d9049073604b7546eca2f1390

From a49c3d7caba5e3bd6494490878cb864ce1977f2e Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 16 Mar 2023 09:20:26 +0100
Subject: [PATCH 131/681] Drop perl dependency for third party opus

Opus needs perl to do some optimizations, in case there is no
perl print the warning and drop the perl requirement.

Fixes: QTBUG-111958
Change-Id: I63a66e71fdaeae61d5c9dbcfe41f03bfb717bb75
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
(cherry picked from commit a38a3aee68e796266ef6478d87d133ce1a5102c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake         | 8 ++++++++
 src/core/CMakeLists.txt | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/configure.cmake b/configure.cmake
index 0b216a830c7..c5e561b1227 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -18,6 +18,7 @@ else()
     find_package(GPerf)
     find_package(BISON)
     find_package(FLEX)
+    find_package(Perl)
     find_package(PkgConfig)
     find_package(Snappy)
     find_package(Nodejs 12.0)
@@ -686,3 +687,10 @@ if(PRINT_BFD_LINKER_WARNING)
         MESSAGE "Using bfd linker requires at least 4096 open files limit"
     )
 endif()
+if(NOT FEATURE_webengine_opus_system AND NOT Perl_FOUND)
+    qt_configure_add_report_entry(
+        TYPE WARNING
+        MESSAGE "No perl found, compiling opus without some optimizations."
+    )
+endif()
+
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index e1e551a3ea4..9ae5f42144b 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.19)
 
 find_package(Ninja 1.7.2 REQUIRED)
 find_package(Nodejs 12 REQUIRED)
+find_package(Perl)
 find_package(PkgConfig)
 if(PkgConfig_FOUND)
     create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
@@ -419,6 +420,12 @@ foreach(arch ${archs})
                     CONDITION QT_FEATURE_webengine_system_${slib}
                 )
             endforeach()
+            if(NOT QT_FEATURE_webengine_system_opus)
+                extend_gn_list(gnArgArg
+                   ARGS has_perl
+                   CONDITION Perl_FOUND
+            )
+            endif()
             extend_gn_list(gnArgArg
                 ARGS use_system_libxslt
                 CONDITION QT_FEATURE_webengine_system_libxml

From 715b829f342e0ea9c32c926d6bd0959bb215d0c5 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 3 Apr 2023 22:08:15 +0000
Subject: [PATCH 132/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I2261f90b3164025274a29653c65284e6fdeb5cd0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b795f98ac44..3743ec632a2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d589cb66fb1beeb2f543a47af543a9030520cd89
+    ref: b8c8041aaaec0b8e68b2d3f7cf4eaff4f5b13533
     required: true
   ../qtpositioning:
-    ref: 0511942d1e16da3bdc886f2ab0185b6d3414cbe0
+    ref: 54e12f9a457573263111cf29ca295db0e04e441e
     required: false
   ../qttools:
-    ref: 476cbad5b079abc50ca1b4e4171967cd942c3ee1
+    ref: ba59722484f8e4765fdec00fed2583aa29db063e
     required: false
   ../qtwebchannel:
-    ref: eb0dbc92fb327d8783c9c5c30919870f1883dce7
+    ref: c37968ae50a009588bf4e02972d47cda47da9bc9
     required: false

From 0a1414ef8d557cd52988fa2128d8a1a55e7bf3ff Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Mon, 3 Apr 2023 12:23:08 +0300
Subject: [PATCH 133/681] Bump version to 6.5.1

Change-Id: I1b6c4f83f13742b7bdabb5bc7a1991cbe0e5f53a
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index 84051225e57..b71b9d93918 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,3 +1,3 @@
-set(QT_REPO_MODULE_VERSION "6.5.0")
+set(QT_REPO_MODULE_VERSION "6.5.1")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")

From f91179bfa8148af6c6808722eb8af379d368f88f Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 29 Mar 2023 18:57:21 +0200
Subject: [PATCH 134/681] Fix gn<->ninja dependencies for qtpdf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We try to build qtpdf after qtwebengine is done.
However "ninja docs" now depends on gn run and
should not trigger module compilation. Therefore
sync on NinjaReady target so GnReady for QtPdf
can run just after gn binary is compiled and
does not trigger whole qtwebenigne module build.

Task-number: QTBUG-88482
Change-Id: Iaf7f8ec631414c636915d53532bc85e84c5534a5
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 30f934b70f41ead670a66772a020ae77d966d5f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 771446eceb4..a62252783ad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -76,13 +76,13 @@ if(QT_FEATURE_qtpdf_build)
    add_subdirectory(pdf)
    # keep log order, pdf build after webengine
    if(QT_FEATURE_qtwebengine_core_build)
-       add_dependencies(run_pdf_GnReady WebEngineCore)
+       add_dependencies(run_pdf_NinjaReady WebEngineCore)
    endif()
    if(QT_FEATURE_qtwebengine_widgets_build)
-       add_dependencies(run_pdf_GnReady WebEngineWidgets)
+       add_dependencies(run_pdf_NinjaReady WebEngineWidgets)
    endif()
    if(QT_FEATURE_qtwebengine_quick_build)
-       add_dependencies(run_pdf_GnReady WebEngineQuick)
+       add_dependencies(run_pdf_NinjaReady WebEngineQuick)
    endif()
    if(QT_FEATURE_qtpdf_widgets_build)
        add_subdirectory(pdfwidgets)

From b443b7632afbde6be4657359e60d95b33d1093cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 17 Mar 2023 17:26:39 +0100
Subject: [PATCH 135/681] Replace WebEngineAction example with a snippet
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Also moves the example to the manual tests directory.

Task-number: QTBUG-108751
Change-Id: Ie3fa492cfcaf61ee26ed65fa22954bb6a6532d6e
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 23d1131577e1780de0552211a84357bcb1f63de5)
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 examples/webenginequick/CMakeLists.txt        |   1 -
 .../webengineaction/CMakeLists.txt            |  49 -------
 .../doc/images/webengineaction-example.png    | Bin 100266 -> 0 bytes
 .../doc/src/webengineaction.qdoc              |  47 -------
 examples/webenginequick/webenginequick.pro    |   3 +-
 .../api/qquickwebengineaction.cpp             |  10 +-
 .../snippets/qtwebengine_webengineaction.qml  | 123 ++++++++++++++++++
 tests/manual/examples/quick/CMakeLists.txt    |   1 +
 .../quick/webengineaction/CMakeLists.txt      |  37 ++++++
 .../examples/quick}/webengineaction/main.cpp  |   0
 .../examples/quick}/webengineaction/main.qml  |   0
 .../examples/quick}/webengineaction/qml.qrc   |   0
 .../examples/quick}/webengineaction/utils.h   |   0
 .../webengineaction/webengineaction.pro       |   3 -
 14 files changed, 171 insertions(+), 103 deletions(-)
 delete mode 100644 examples/webenginequick/webengineaction/CMakeLists.txt
 delete mode 100644 examples/webenginequick/webengineaction/doc/images/webengineaction-example.png
 delete mode 100644 examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
 create mode 100644 src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml
 create mode 100644 tests/manual/examples/quick/webengineaction/CMakeLists.txt
 rename {examples/webenginequick => tests/manual/examples/quick}/webengineaction/main.cpp (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/webengineaction/main.qml (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/webengineaction/qml.qrc (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/webengineaction/utils.h (100%)
 rename {examples/webenginequick => tests/manual/examples/quick}/webengineaction/webengineaction.pro (52%)

diff --git a/examples/webenginequick/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
index ef140ee72fa..ff291fdcf7b 100644
--- a/examples/webenginequick/CMakeLists.txt
+++ b/examples/webenginequick/CMakeLists.txt
@@ -3,7 +3,6 @@
 
 qt_internal_add_example(lifecycle)
 qt_internal_add_example(quicknanobrowser)
-qt_internal_add_example(webengineaction)
 if(TARGET Qt::QuickControls2)
     qt_internal_add_example(recipebrowser)
 endif()
diff --git a/examples/webenginequick/webengineaction/CMakeLists.txt b/examples/webenginequick/webengineaction/CMakeLists.txt
deleted file mode 100644
index 94f03a14337..00000000000
--- a/examples/webenginequick/webengineaction/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(webengineaction LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/webengineaction")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
-
-qt_add_executable(webengineaction
-    main.cpp
-    utils.h
-)
-
-set_target_properties(webengineaction PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(webengineaction PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebEngineQuick
-)
-
-# Resources:
-set(qml_resource_files
-    "main.qml"
-)
-
-qt_add_resources(webengineaction "qml"
-    PREFIX
-        "/"
-    FILES
-        ${qml_resource_files}
-)
-
-install(TARGETS webengineaction
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginequick/webengineaction/doc/images/webengineaction-example.png b/examples/webenginequick/webengineaction/doc/images/webengineaction-example.png
deleted file mode 100644
index 2e34bbf63ffbe0f277fa7464a5be26f20ee416d2..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc b/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
deleted file mode 100644
index 272853aefef..00000000000
--- a/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginequick/webengineaction
-    \title WebEngine Action Example
-    \ingroup webengine-examples
-    \brief A simple browser implemented using WebEngineActions.
-
-    \image webengineaction-example.png
-
-    \e {WebEngine Action Example} demonstrates how to perform actions on a web page
-    using the \l{WebEngineAction} type. It shows the minimum amount of code needed
-    to bind browser functionalities to input elements and build up a custom context
-    menu.
-
-    \include examples-run.qdocinc
-
-    \section1 Working With Web Engine Actions
-
-    An intended use of \l{WebEngineAction} is building a connection between UI
-    elements and browser commands. It can be added to menus and toolbars via
-    assigning its properties to the corresponding ones of the element.
-
-    The \l{ToolButton} relies on the properties provided by a
-    \l{WebEngineAction}. Clicking the button triggers backwards navigation on the
-    originating \l{WebEngineView} of the action.
-
-    \quotefromfile webenginequick/webengineaction/main.qml
-    \skipto ToolButton {
-    \printuntil }
-
-    The simplest way to create custom context menus is enumerating the required
-    \l{WebEngineAction} types in a data model and instantiating \l{MenuItem} types
-    for them, for example using a \l{Repeater}.
-
-    \quotefromfile webenginequick/webengineaction/main.qml
-    \skipto property Menu contextMenu: Menu {
-    \printuntil /^ {8}\}/
-
-    Assigning a \l{WebEngineAction} to multiple UI elements will keep them in sync.
-    As it can be seen in the picture above, if the browser engine disables a
-    navigation action, both corresponding menu items will be disabled.
-
-    \note Note that incomplete URLs in the navigation bar are handled by
-    \l {QUrl::} {fromUserInput}.
-*/
diff --git a/examples/webenginequick/webenginequick.pro b/examples/webenginequick/webenginequick.pro
index 9711ccb3aa5..acf6127d670 100644
--- a/examples/webenginequick/webenginequick.pro
+++ b/examples/webenginequick/webenginequick.pro
@@ -1,8 +1,7 @@
 TEMPLATE=subdirs
 
 SUBDIRS += \
-    quicknanobrowser \
-    webengineaction
+    quicknanobrowser
 
 qtHaveModule(quickcontrols2) {
     SUBDIRS += \
diff --git a/src/webenginequick/api/qquickwebengineaction.cpp b/src/webenginequick/api/qquickwebengineaction.cpp
index 70205f88316..006715c701f 100644
--- a/src/webenginequick/api/qquickwebengineaction.cpp
+++ b/src/webenginequick/api/qquickwebengineaction.cpp
@@ -20,7 +20,7 @@ QT_BEGIN_NAMESPACE
     method. It provides information about the action, such as
     whether it is \l enabled.
 
-    The following code uses the \l WebEngineView::action() method to check if the
+    The following code uses the \l WebEngineView::action() method to check if
     the copy action is enabled:
 
     \code
@@ -30,6 +30,14 @@ QT_BEGIN_NAMESPACE
     else
         console.log("Copy is disabled.");
     \endcode
+
+    A \l ToolButton can be connected to a WebEngineAction as follows:
+
+    \snippet qtwebengine_webengineaction.qml 0
+
+    A context menu could be implemented like this:
+
+    \snippet qtwebengine_webengineaction.qml 1
 */
 
 QQuickWebEngineActionPrivate::QQuickWebEngineActionPrivate(const QVariant &data, const QString &text, const QString &iconName, bool enabled)
diff --git a/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml b/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml
new file mode 100644
index 00000000000..2fd5f490b7f
--- /dev/null
+++ b/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml
@@ -0,0 +1,123 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ApplicationWindow {
+    id: window
+    visible: true
+    width: 800
+    height: 600
+    title: qsTr("WebEngineAction Example")
+
+    header: ToolBar {
+        RowLayout {
+            anchors.fill: parent
+//! [0]
+            ToolButton {
+                property int itemAction: WebEngineView.Back
+                text: webEngineView.action(itemAction).text
+                enabled: webEngineView.action(itemAction).enabled
+                onClicked: webEngineView.action(itemAction).trigger()
+                icon.name: webEngineView.action(itemAction).iconName
+                display: AbstractButton.TextUnderIcon
+            }
+//! [0]
+            ToolButton {
+                property int itemAction: WebEngineView.Forward
+                text: webEngineView.action(itemAction).text
+                enabled: webEngineView.action(itemAction).enabled
+                onClicked: webEngineView.action(itemAction).trigger()
+                icon.name: webEngineView.action(itemAction).iconName
+                display: AbstractButton.TextUnderIcon
+            }
+
+            ToolButton {
+                property int itemAction: webEngineView.loading ? WebEngineView.Stop : WebEngineView.Reload
+                text: webEngineView.action(itemAction).text
+                enabled: webEngineView.action(itemAction).enabled
+                onClicked: webEngineView.action(itemAction).trigger()
+                icon.name: webEngineView.action(itemAction).iconName
+                display: AbstractButton.TextUnderIcon
+            }
+
+            TextField {
+                Layout.fillWidth: true
+
+                text: webEngineView.url
+                selectByMouse: true
+                onEditingFinished: webEngineView.url = utils.fromUserInput(text)
+            }
+
+            ToolButton {
+                id: settingsButton
+                text: "Settings"
+                icon.name: "settings-configure"
+                display: AbstractButton.TextUnderIcon
+                onClicked: settingsMenu.open()
+                checked: settingsMenu.visible
+
+                Menu {
+                    id: settingsMenu
+                    y: settingsButton.height
+
+                    MenuItem {
+                        id: customContextMenuOption
+                        checkable: true
+                        checked: true
+
+                        text: "Custom context menu"
+                    }
+                }
+            }
+        }
+    }
+
+    WebEngineView {
+        id: webEngineView
+        url: "https://qt.io"
+        anchors.fill: parent
+
+        Component.onCompleted: {
+            profile.downloadRequested.connect(function(download){
+                download.accept();
+            })
+        }
+
+//! [1]
+        property Menu contextMenu: Menu {
+            Repeater {
+                model: [
+                    WebEngineView.Back,
+                    WebEngineView.Forward,
+                    WebEngineView.Reload,
+                    WebEngineView.SavePage,
+                    WebEngineView.Copy,
+                    WebEngineView.Paste,
+                    WebEngineView.Cut,
+                    WebEngineView.ChangeTextDirectionLTR,
+                    WebEngineView.ChangeTextDirectionRTL,
+                ]
+                MenuItem {
+                    text: webEngineView.action(modelData).text
+                    enabled: webEngineView.action(modelData).enabled
+                    onClicked: webEngineView.action(modelData).trigger()
+                    icon.name: webEngineView.action(modelData).iconName
+                    display: MenuItem.TextBesideIcon
+                }
+            }
+        }
+
+        onContextMenuRequested: function(request) {
+            if (customContextMenuOption.checked) {
+                request.accepted = true;
+                contextMenu.popup();
+            }
+        }
+//! [1]
+    }
+}
diff --git a/tests/manual/examples/quick/CMakeLists.txt b/tests/manual/examples/quick/CMakeLists.txt
index d5f960480f3..c461f2dbb1a 100644
--- a/tests/manual/examples/quick/CMakeLists.txt
+++ b/tests/manual/examples/quick/CMakeLists.txt
@@ -1,3 +1,4 @@
 add_subdirectory(minimal)
 add_subdirectory(customdialogs)
 add_subdirectory(customtouchhandle)
+add_subdirectory(webengineaction)
diff --git a/tests/manual/examples/quick/webengineaction/CMakeLists.txt b/tests/manual/examples/quick/webengineaction/CMakeLists.txt
new file mode 100644
index 00000000000..563e3c9dfac
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+     cmake_minimum_required(VERSION 3.16)
+     project(webengineaction LANGUAGES CXX)
+     find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick)
+endif()
+
+qt_internal_add_manual_test(webengineaction
+    SOURCES
+        main.cpp
+        utils.h
+)
+
+set_target_properties(webengineaction PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(webengineaction PUBLIC
+    Qt::Core
+    Qt::Gui
+    Qt::WebEngineQuick
+)
+
+# Resources:
+set(qml_resource_files
+    "main.qml"
+)
+
+qt_add_resources(webengineaction "qml"
+    PREFIX
+        "/"
+    FILES
+        ${qml_resource_files}
+)
diff --git a/examples/webenginequick/webengineaction/main.cpp b/tests/manual/examples/quick/webengineaction/main.cpp
similarity index 100%
rename from examples/webenginequick/webengineaction/main.cpp
rename to tests/manual/examples/quick/webengineaction/main.cpp
diff --git a/examples/webenginequick/webengineaction/main.qml b/tests/manual/examples/quick/webengineaction/main.qml
similarity index 100%
rename from examples/webenginequick/webengineaction/main.qml
rename to tests/manual/examples/quick/webengineaction/main.qml
diff --git a/examples/webenginequick/webengineaction/qml.qrc b/tests/manual/examples/quick/webengineaction/qml.qrc
similarity index 100%
rename from examples/webenginequick/webengineaction/qml.qrc
rename to tests/manual/examples/quick/webengineaction/qml.qrc
diff --git a/examples/webenginequick/webengineaction/utils.h b/tests/manual/examples/quick/webengineaction/utils.h
similarity index 100%
rename from examples/webenginequick/webengineaction/utils.h
rename to tests/manual/examples/quick/webengineaction/utils.h
diff --git a/examples/webenginequick/webengineaction/webengineaction.pro b/tests/manual/examples/quick/webengineaction/webengineaction.pro
similarity index 52%
rename from examples/webenginequick/webengineaction/webengineaction.pro
rename to tests/manual/examples/quick/webengineaction/webengineaction.pro
index 223109eb9a2..9286604a12e 100644
--- a/examples/webenginequick/webengineaction/webengineaction.pro
+++ b/tests/manual/examples/quick/webengineaction/webengineaction.pro
@@ -6,6 +6,3 @@ HEADERS += utils.h
 SOURCES += main.cpp
 
 RESOURCES += qml.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/webengineaction
-INSTALLS += target

From 7c280452dee4efc3367d85721680f888d37f46fc Mon Sep 17 00:00:00 2001
From: Yigit Akcay <yigit.akcay@qt.io>
Date: Mon, 27 Mar 2023 16:32:42 +0200
Subject: [PATCH 136/681] Add Windows 11 related note for Geolocation settings

There are 3 OS settings under Windows 11 that need to be enabled for
the HTML5 Geolocation in QtWebEngine to work properly. This isn't
very straightforward to a user, therefore this patch adds a note to
the documentation.

Change-Id: Id36a4726a182178c5a15fce039e464fd6bb7517e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c3b2393e7a532a18d4971a878740b2a9b5830028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/maps/doc/src/maps.qdoc | 6 ++++++
 src/core/doc/src/qtwebengine-features.qdoc       | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index 547572750e9..ad727e1652e 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -22,6 +22,12 @@
     geolocation requests are denied by default. This example demonstrates the
     steps an application must take in order to start accepting these requests.
 
+    \note On Windows 11, enable settings to grant the application access to
+    Windows location services. In the Settings App under
+    \uicontrol {Privacy & Security} > \uicontrol {Location}, enable \uicontrol
+    {Location services}, \uicontrol {Let apps access your location} and \uicontrol
+    {Let desktop apps access your location}.
+
     \include examples-run.qdocinc
 
     \section1 The Code
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 9242c257f4a..3d6d0fea8c7 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -298,6 +298,12 @@
     tested by using \l{WebEngine Widgets Maps Example}{Maps} and allowing it to
     find the current position of the user.
 
+    \note On Windows 11, enable settings to grant the maps example access to
+    Windows location services. In the Settings App under
+    \uicontrol {Privacy & Security} > \uicontrol {Location}, enable \uicontrol
+    {Location services}, \uicontrol {Let apps access your location} and \uicontrol
+    {Let desktop apps access your location}.
+
     See \l{Qt Positioning} for a possible backend setup like the GPS or IP based positioning.
 
     Support for this feature was added in Qt 5.5.0.

From f7e37c7189c50d32e89d2a445ab9b2bc9ab4a24d Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 15 Mar 2023 17:43:14 +0100
Subject: [PATCH 137/681] doc: Add the QtPDF Licenses and Attributions section

Fixes: QTBUG-88482
Change-Id: If58a8443afb38f372ca3dc7372472db888586dba
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit fd13a951a75913bac18f7aeba89dfff56258beb0)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/pdf/CMakeLists.txt               | 13 +++++++++++++
 src/pdf/doc/about_credits.tmpl       |  1 +
 src/pdf/doc/about_credits_entry.tmpl | 13 +++++++++++++
 src/pdf/doc/src/qtpdf-index.qdoc     |  8 ++++++++
 src/pdf/doc/src/qtpdf-licensing.qdoc | 18 ++++++++++++++++++
 5 files changed, 53 insertions(+)
 create mode 100644 src/pdf/doc/about_credits.tmpl
 create mode 100644 src/pdf/doc/about_credits_entry.tmpl
 create mode 100644 src/pdf/doc/src/qtpdf-licensing.qdoc

diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 7ca252e29dd..d7aea23cd43 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -43,6 +43,10 @@ qt_internal_add_module(Pdf
 
 add_subdirectory(plugins/imageformats/pdf)
 
+get_install_config(config)
+get_architectures(archs)
+list(GET archs 0 arch)
+
 ##
 #  PDF DOCS
 ##
@@ -51,6 +55,15 @@ qt_internal_add_docs(Pdf
     doc/qtpdf.qdocconf
 )
 
+add_code_attributions_target(
+    TARGET generate_pdf_attributions
+    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pdf_attributions.qdoc
+    GN_TARGET :QtPdf
+    FILE_TEMPLATE doc/about_credits.tmpl
+    ENTRY_TEMPLATE doc/about_credits_entry.tmpl
+    BUILDDIR ${buildDir}/${config}/${arch}
+)
+add_dependencies(docs generate_pdf_attributions)
 
 ##
 #   TOOLCHAIN SETUP
diff --git a/src/pdf/doc/about_credits.tmpl b/src/pdf/doc/about_credits.tmpl
new file mode 100644
index 00000000000..57fae9e78d3
--- /dev/null
+++ b/src/pdf/doc/about_credits.tmpl
@@ -0,0 +1 @@
+{{entries}}
diff --git a/src/pdf/doc/about_credits_entry.tmpl b/src/pdf/doc/about_credits_entry.tmpl
new file mode 100644
index 00000000000..29419870901
--- /dev/null
+++ b/src/pdf/doc/about_credits_entry.tmpl
@@ -0,0 +1,13 @@
+/*!
+\page qtpdf-3rdparty-{{name-sanitized}}.html
+\attribution
+\ingroup qtpdf-licensing
+\brief {{license-type}}
+\title {{name}}
+
+\l{{{url}}}{Project Homepage}
+
+\badcode
+{{license}}
+\endcode
+*/
diff --git a/src/pdf/doc/src/qtpdf-index.qdoc b/src/pdf/doc/src/qtpdf-index.qdoc
index 07c151f4798..fb44eb5fadb 100644
--- a/src/pdf/doc/src/qtpdf-index.qdoc
+++ b/src/pdf/doc/src/qtpdf-index.qdoc
@@ -64,4 +64,12 @@
         \li \l{Qt PDF C++ Classes}
         \li \l{Qt Quick PDF QML Types}
     \endlist
+
+    \section1 Licenses and Attributions
+
+    Qt PDF is available under commercial licenses from \l{The Qt Company}.
+    In addition, it is available under the
+    \l{GNU Lesser General Public License, version 3}, or
+    the \l{GNU General Public License, version 2}.
+    See \l{Qt PDF Licensing} for further details about this module.
 */
diff --git a/src/pdf/doc/src/qtpdf-licensing.qdoc b/src/pdf/doc/src/qtpdf-licensing.qdoc
new file mode 100644
index 00000000000..190ee83315a
--- /dev/null
+++ b/src/pdf/doc/src/qtpdf-licensing.qdoc
@@ -0,0 +1,18 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+    \group qtpdf-licensing
+    \title Qt PDF Licensing
+
+    Qt PDF is available under commercial licenses from \l{The Qt Company}.
+    In addition, it is available under the
+    \l{GNU Lesser General Public License, version 3}, or
+    the \l{GNU General Public License, version 2}.
+    See \l{Qt Licensing} for further details.
+
+    The module includes a snapshot of PDFium.  As such, users need to respect
+    the licenses of PDFium and third-party code included in it.
+
+    Third party licenses included in the sources are:
+*/

From 4c9f9e4d305cd9a8e4e123d25cc6d8ecbc0990ad Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 29 Mar 2023 14:20:33 +0200
Subject: [PATCH 138/681] Require gn for generating docs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Make sure gn is build before doc target, otherwise
parallel top level build might not succeed.
As configure runs the gn binary is not compiled
so use scripting mode to execute gn call during
build time.

Task-number: QTBUG-88482
Fixes: QTBUG-112644
Change-Id: I7e851de90e2a3ec52f5259d51f677b23d8245bcb
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit e368689df5566462ceea28c06803f9a0abf91cc5)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 cmake/Functions.cmake       | 24 ++++++++++++---------
 cmake/License.cmake         | 42 +++++++++++++++++++++++++++++++++++++
 src/core/api/CMakeLists.txt |  1 +
 src/pdf/CMakeLists.txt      |  1 +
 4 files changed, 58 insertions(+), 10 deletions(-)
 create mode 100644 cmake/License.cmake

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 8c666a7ac67..7562bffb660 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1335,17 +1335,21 @@ function(add_code_attributions_target)
     get_filename_component(entryTemplate ${arg_ENTRY_TEMPLATE} ABSOLUTE)
     add_custom_command(
         OUTPUT ${arg_OUTPUT}
-        COMMAND ${Python3_EXECUTABLE} ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
-           --file-template ${fileTemplate}
-           --entry-template ${entryTemplate}
-           --gn-binary ${Gn_EXECUTABLE}
-           --gn-target ${arg_GN_TARGET} --gn-out-dir ${arg_BUILDDIR}
-           credits ${arg_OUTPUT}
-        WORKING_DIRECTORY ${arg_BUILDDIR}
+        COMMAND ${CMAKE_COMMAND}
+            -DLICENSE_SCRIPT=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
+            -DFILE_TEMPLATE=${fileTemplate}
+            -DENTRY_TEMPLATE=${entryTemplate}
+            -DGN_TARGET=${arg_GN_TARGET}
+            -DBUILDDIR=${arg_BUILDDIR}
+            -DOUTPUT=${arg_OUTPUT}
+            -DPython3_EXECUTABLE=${Python3_EXECUTABLE}
+            -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/License.cmake
+        WORKING_DIRECTORY ${WEBENGINE_ROOT_BUILD_DIR}
         DEPENDS
-           ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
-           ${arg_FILE_TEMPLATE}
-           ${arg_ENTRY_TEMPLATE}
+            ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
+            ${arg_FILE_TEMPLATE}
+            ${arg_ENTRY_TEMPLATE}
+            ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/License.cmake
         USES_TERMINAL
      )
      add_custom_target(${arg_TARGET} DEPENDS ${arg_OUTPUT})
diff --git a/cmake/License.cmake b/cmake/License.cmake
new file mode 100644
index 00000000000..dc1e286f184
--- /dev/null
+++ b/cmake/License.cmake
@@ -0,0 +1,42 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT CMAKE_SCRIPT_MODE_FILE)
+    message("This files should run only in script mode")
+    return()
+endif()
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
+if(NOT Python3_EXECUTABLE)
+    find_package(Python3 3.6 REQUIRED)
+endif()
+
+execute_process(
+    COMMAND ${Python3_EXECUTABLE} ${LICENSE_SCRIPT}
+        --file-template ${FILE_TEMPLATE}
+        --entry-template ${ENTRY_TEMPLATE}
+        --gn-binary ${Gn_EXECUTABLE}
+        --gn-target ${GN_TARGET}
+        --gn-out-dir ${BUILDDIR}
+        credits ${OUTPUT}
+    WORKING_DIRECTORY ${BUILDDIR}
+    RESULT_VARIABLE gnResult
+    OUTPUT_VARIABLE gnOutput
+    ERROR_VARIABLE gnError
+    TIMEOUT 600
+)
+
+if(NOT gnResult EQUAL 0)
+    message(FATAL_ERROR "\n-- License FAILED\n${gnOutput}\n${gnError}\n${gnResult}\n")
+else()
+    string(REGEX REPLACE "\n$" "" gnOutput "${gnOutput}")
+    message("-- License ${gnOutput}")
+endif()
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index f452656d306..922adfd8c8f 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -94,6 +94,7 @@ add_code_attributions_target(
     ENTRY_TEMPLATE ../doc/about_credits_entry.tmpl
     BUILDDIR ${buildDir}/${config}/${arch}
 )
+add_dependencies(generate_chromium_attributions run_core_GnDone)
 add_dependencies(docs generate_chromium_attributions)
 
 ##
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index d7aea23cd43..0a039cdd141 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -63,6 +63,7 @@ add_code_attributions_target(
     ENTRY_TEMPLATE doc/about_credits_entry.tmpl
     BUILDDIR ${buildDir}/${config}/${arch}
 )
+add_dependencies(generate_pdf_attributions run_pdf_GnDone)
 add_dependencies(docs generate_pdf_attributions)
 
 ##

From f353c92cc326cfd93d8ecc54d52524c1a9079443 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Wed, 5 Apr 2023 09:27:08 +0200
Subject: [PATCH 139/681] Simple browser example: Fix up the code

- Remove duplicated unused helper questionForFeature()
- Replace lambdas by slots where possible
- Fix clang warning about using multiple arguments to QString::arg()
- Remove dead code in WebView::contextMenuEvent() which checks on
  inspectElement == actions.cend(), but is within an "if" checking
  the same condition.

Change-Id: Ie85a3811f4f5a8c3fa9550d4eb2ca5bf79e39084
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 88ef502099d535823156c31e77251dd2a723ad1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../simplebrowser/browserwindow.cpp           |  5 ++--
 .../simplebrowser/webpage.cpp                 | 23 -------------------
 .../simplebrowser/webview.cpp                 | 12 ++++------
 3 files changed, 6 insertions(+), 34 deletions(-)

diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index 7a72b4a6f64..7f30d2e9252 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -355,9 +355,8 @@ QToolBar *BrowserWindow::createToolBar()
     downloadsAction->setIcon(QIcon(u":go-bottom.png"_s));
     downloadsAction->setToolTip(tr("Show downloads"));
     navigationBar->addAction(downloadsAction);
-    connect(downloadsAction, &QAction::triggered, [this]() {
-        m_browser->downloadManagerWidget().show();
-    });
+    connect(downloadsAction, &QAction::triggered,
+            &m_browser->downloadManagerWidget(), &QWidget::show);
 
     return navigationBar;
 }
diff --git a/examples/webenginewidgets/simplebrowser/webpage.cpp b/examples/webenginewidgets/simplebrowser/webpage.cpp
index 66de5d6d94f..699e3d2ed66 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpage.cpp
@@ -22,29 +22,6 @@ void WebPage::handleCertificateError(QWebEngineCertificateError error)
                        [this, error]() mutable { emit createCertificateErrorDialog(error); });
 }
 
-inline QString questionForFeature(QWebEnginePage::Feature feature)
-{
-    switch (feature) {
-    case QWebEnginePage::Geolocation:
-        return WebPage::tr("Allow %1 to access your location information?");
-    case QWebEnginePage::MediaAudioCapture:
-        return WebPage::tr("Allow %1 to access your microphone?");
-    case QWebEnginePage::MediaVideoCapture:
-        return WebPage::tr("Allow %1 to access your webcam?");
-    case QWebEnginePage::MediaAudioVideoCapture:
-        return WebPage::tr("Allow %1 to access your microphone and webcam?");
-    case QWebEnginePage::MouseLock:
-        return WebPage::tr("Allow %1 to lock your mouse cursor?");
-    case QWebEnginePage::DesktopVideoCapture:
-        return WebPage::tr("Allow %1 to capture video of your desktop?");
-    case QWebEnginePage::DesktopAudioVideoCapture:
-        return WebPage::tr("Allow %1 to capture audio and video of your desktop?");
-    case QWebEnginePage::Notifications:
-        return WebPage::tr("Allow %1 to show notification on your desktop?");
-    }
-    return QString();
-}
-
 void WebPage::handleSelectClientCertificate(QWebEngineClientCertificateSelection selection)
 {
     // Just select one.
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index dd6dbb14933..e024f9126fe 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -58,7 +58,7 @@ WebView::WebView(QWidget *parent)
                                                    tr("Render process exited with code: %1\n"
                                                       "Do you want to reload the page ?").arg(statusCode));
         if (btn == QMessageBox::Yes)
-            QTimer::singleShot(0, [this] { reload(); });
+            QTimer::singleShot(0, this, &WebView::reload);
     });
 }
 
@@ -195,12 +195,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
         if (viewSource == actions.cend())
             menu->addSeparator();
 
-        QAction *action = new QAction(menu);
-        action->setText("Open inspector in new window");
+        QAction *action = menu->addAction("Open inspector in new window");
         connect(action, &QAction::triggered, [this]() { emit devToolsRequested(page()); });
-
-        QAction *before(inspectElement == actions.cend() ? nullptr : *inspectElement);
-        menu->insertAction(before, action);
     } else {
         (*inspectElement)->setText(tr("Inspect element"));
     }
@@ -241,8 +237,8 @@ void WebView::handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticato
     passwordDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
 
     QString introMessage(tr("Enter username and password for \"%1\" at %2")
-                                 .arg(auth->realm())
-                                 .arg(requestUrl.toString().toHtmlEscaped()));
+                                 .arg(auth->realm(),
+                                      requestUrl.toString().toHtmlEscaped()));
     passwordDialog.m_infoLabel->setText(introMessage);
     passwordDialog.m_infoLabel->setWordWrap(true);
 

From 12692ca2fb011831fe473256cc7e0f111aa06746 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 22 Mar 2023 14:22:54 +0100
Subject: [PATCH 140/681] Fix building on Windows and macOS with chromium EGL

Change-Id: I6c7b37d7c53ff9ed872f5f95660c6cf7520e6bda
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit caf5f383ac53401dc2749f43ce46a208fe8738c9)
---
 .../compositor/vulkan_implementation_qt.cpp   |  2 +-
 src/core/ozone/gl_context_qt.cpp              | 11 +---
 src/core/ozone/gl_surface_egl_qt.cpp          | 16 ++---
 src/core/ozone/gl_surface_qt.cpp              | 64 ++++++++-----------
 4 files changed, 35 insertions(+), 58 deletions(-)

diff --git a/src/core/compositor/vulkan_implementation_qt.cpp b/src/core/compositor/vulkan_implementation_qt.cpp
index 3cf764b21ee..cdc68d3d486 100644
--- a/src/core/compositor/vulkan_implementation_qt.cpp
+++ b/src/core/compositor/vulkan_implementation_qt.cpp
@@ -131,7 +131,7 @@ SemaphoreHandle VulkanImplementationQt::GetSemaphoreHandle(VkDevice vk_device,
 
 VkExternalMemoryHandleTypeFlagBits VulkanImplementationQt::GetExternalImageHandleType()
 {
-#ifdef BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_WIN)
     return VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT;
 #else
     return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 08d626063be..40fa92b9924 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -174,20 +174,15 @@ scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group,
                                          GLSurface* compatible_surface,
                                          const GLContextAttribs& attribs)
 {
-    scoped_refptr<GLContext> context;
     if (GetGLImplementation() == kGLImplementationDesktopGL) {
-        context = new GLContextWGL(share_group);
+        scoped_refptr<GLContext> context = new GLContextWGL(share_group);
         if (!context->Initialize(compatible_surface, attribs))
             return nullptr;
         return context;
-    } else {
-        context = new GLContextEGL(share_group);
     }
 
-    if (!GLContextHelper::initializeContext(context.get(), compatible_surface, attribs))
-        return nullptr;
-
-    return context;
+    return InitializeGLContext(new GLContextEGL(share_group),
+                               compatible_surface, attribs);
 }
 
 }  // namespace init
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 7f00ea6ed33..32e6db4e842 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -15,12 +15,7 @@
 #include "ui/gl/gl_surface_egl.h"
 #include "ui/gl/init/gl_factory.h"
 
-#if !BUILDFLAG(IS_MAC)
-// From ANGLE's egl/eglext.h.
-#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
-#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
-#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
-#endif
+#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
 
 using ui::GetLastEGLErrorString;
 
@@ -260,12 +255,7 @@ void* GLSurfacelessQtEGL::GetShareHandle()
     return NULL;
 }
 
-} // namespace gl
-#endif // !BUILDFLAG(IS_MAC)
-
-namespace gl {
-
-std::string DisplayExtensionsEGL::GetPlatformExtensions(void*)
+std::string DisplayExtensionsEGL::GetPlatformExtensions(EGLDisplay)
 {
     EGLDisplay display = GLContextHelper::getEGLDisplay();
     if (display == EGL_NO_DISPLAY)
@@ -274,4 +264,6 @@ std::string DisplayExtensionsEGL::GetPlatformExtensions(void*)
     const char* str = eglQueryString(display, EGL_EXTENSIONS);
     return str ? std::string(str) : "";
 }
+
 } // namespace gl
+#endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index fad3ccc1142..b6242b427a0 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
@@ -19,8 +19,11 @@
 #include "ozone/gl_surface_egl_qt.h"
 
 #include "gpu/ipc/service/image_transport_surface.h"
+#include "ui/gl/direct_composition_support.h"
+#include "ui/gl/gl_display.h"
 #include "ui/gl/gl_implementation.h"
-#include "ui/gl/direct_composition_surface_win.h"
+#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/gl_utils.h"
 #include "ui/gl/vsync_provider_win.h"
 #endif
 
@@ -93,13 +96,26 @@ gl::GLDisplay *InitializeGLOneOffPlatform(uint64_t system_device_id)
 {
     VSyncProviderWin::InitializeOneOff();
 
-    if (GetGLImplementation() == kGLImplementationEGLGLES2 || GetGLImplementation() == kGLImplementationEGLANGLE)
-        return GLSurfaceEGLQt::InitializeOneOff(system_device_id);
-
     if (GetGLImplementation() == kGLImplementationDesktopGL || GetGLImplementation() == kGLImplementationDesktopGLCoreProfile)
         return GLSurfaceWGLQt::InitializeOneOff(system_device_id);
 
-    return nullptr;
+    GLDisplayEGL *display = GetDisplayEGL(system_device_id);
+    switch (GetGLImplementation()) {
+    case kGLImplementationEGLANGLE:
+    case kGLImplementationEGLGLES2:
+        if (!display->Initialize(EGLDisplayPlatform(GetDC(nullptr)))) {
+            LOG(ERROR) << "GLDisplayEGL::Initialize failed.";
+            return nullptr;
+        }
+        InitializeDirectComposition(display);
+        break;
+    case kGLImplementationMockGL:
+    case kGLImplementationStubGL:
+        break;
+    default:
+        NOTREACHED();
+    }
+    return display;
 }
 
 bool usingSoftwareDynamicGL()
@@ -125,21 +141,10 @@ CreateOffscreenGLSurfaceWithFormat(GLDisplay *display, const gfx::Size& size, GL
     }
     case kGLImplementationEGLANGLE:
     case kGLImplementationEGLGLES2: {
-        surface = new GLSurfaceEGLQt(static_cast<gl::GLDisplayEGL*>(display), size);
-        if (surface->Initialize(format))
-            return surface;
-
-        // Surfaceless context will be used ONLY if pseudo surfaceless context
-        // is not available since some implementations of surfaceless context
-        // have problems. (e.g. QTBUG-57290)
-        if (GLSurfaceEGLQt::g_egl_surfaceless_context_supported) {
-            surface = new GLSurfacelessQtEGL(static_cast<gl::GLDisplayEGL*>(display), size);
-            if (surface->Initialize(format))
-                return surface;
-        }
-        LOG(ERROR) << "eglCreatePbufferSurface failed and surfaceless context not available";
-        LOG(WARNING) << "Failed to create offscreen GL surface";
-        break;
+        GLDisplayEGL *display_egl = display->GetAs<gl::GLDisplayEGL>();
+        if (display_egl->IsEGLSurfacelessContextSupported() && size.width() == 0 && size.height() == 0)
+            return InitializeGLSurfaceWithFormat(new SurfacelessEGL(display_egl, size), format);
+        return InitializeGLSurfaceWithFormat(new PbufferGLSurfaceEGL(display_egl, size), format);
     }
     default:
         break;
@@ -150,9 +155,8 @@ CreateOffscreenGLSurfaceWithFormat(GLDisplay *display, const gfx::Size& size, GL
 }
 
 scoped_refptr<GLSurface>
-CreateViewGLSurface(gfx::AcceleratedWidget window)
+CreateViewGLSurface(GLDisplay *display, gfx::AcceleratedWidget window)
 {
-    QT_NOT_USED
     return nullptr;
 }
 
@@ -160,18 +164,4 @@ CreateViewGLSurface(gfx::AcceleratedWidget window)
 #endif  // BUILDFLAG(IS_WIN)
 } // namespace gl
 
-#if BUILDFLAG(IS_WIN)
-namespace gpu {
-class GpuCommandBufferStub;
-class GpuChannelManager;
-scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(gl::GLDisplay *,
-                                                                        base::WeakPtr<ImageTransportSurfaceDelegate>,
-                                                                        SurfaceHandle, gl::GLSurfaceFormat)
-{
-    QT_NOT_USED
-    return scoped_refptr<gl::GLSurface>();
-}
-} // namespace gpu
-#endif // BUILDFLAG(IS_WIN)
-
 #endif // !defined(Q_OS_MACOS)

From 2fc4f081ac6603ddee9611f5284d28073a7b6cb1 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 3 Apr 2023 12:22:08 +0200
Subject: [PATCH 141/681] Update Chromium

Pulls in graphics integration cleanup and must be staged with patches
that adapt to that.

Change-Id: Icb6f485e201fd4edd7381965a5b007d866f8e5f6
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit fb64f8720e291d3c56778fafd8cc6d7fe3fb15ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index e41707d576a..22fec96c830 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit e41707d576a21b3d9049073604b7546eca2f1390
+Subproject commit 22fec96c83014753f8d4d709dad25902cafa1a75

From 78ebfe3284955737deb7328e3fc059cedc5cfaff Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 2 Mar 2023 13:05:26 +0100
Subject: [PATCH 142/681] Adapt to painting cleanup

Pass through alphaChannel requirement correctly, instead of having a
nonfunctional hasAlphaChannel().

Change-Id: I99adb17aa38fd91ea8fd93b86a352bc476690837
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 356f65b87c508c44bf31bc3134eaebfd6f39c6ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/compositor/compositor.h              |  8 +-----
 src/core/compositor/display_overrides.cpp     | 27 +++----------------
 .../compositor/display_skia_output_device.cpp |  9 ++++---
 .../compositor/display_skia_output_device.h   |  4 ++-
 .../display_software_output_surface.cpp       | 19 +++++++------
 .../display_software_output_surface.h         |  2 +-
 ...nder_widget_host_view_qt_delegate_item.cpp |  8 ++++--
 7 files changed, 31 insertions(+), 46 deletions(-)

diff --git a/src/core/compositor/compositor.h b/src/core/compositor/compositor.h
index 7c6590134fc..21263150bd2 100644
--- a/src/core/compositor/compositor.h
+++ b/src/core/compositor/compositor.h
@@ -124,13 +124,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT Compositor
     virtual QSize size() = 0;
 
     // Whether frame needs an alpha channel.
-    //
-    // In software mode, the image format can be either
-    //   QImage::Format_ARGB32_Premultiplied or
-    //   QImage::Format_RGBA8888_Premultiplied
-    //
-    // In OpenGL mode, the texture format is either GL_RGBA or GL_RGB.
-    virtual bool hasAlphaChannel() = 0;
+    virtual bool requiresAlphaChannel() = 0;
 
     // (Software) QImage of the frame.
     //
diff --git a/src/core/compositor/display_overrides.cpp b/src/core/compositor/display_overrides.cpp
index aa86861d21b..3b33f5dccdb 100644
--- a/src/core/compositor/display_overrides.cpp
+++ b/src/core/compositor/display_overrides.cpp
@@ -10,9 +10,9 @@
 #include <qtgui-config.h>
 
 std::unique_ptr<viz::OutputSurface>
-viz::OutputSurfaceProviderImpl::CreateSoftwareOutputSurface()
+viz::OutputSurfaceProviderImpl::CreateSoftwareOutputSurface(const RendererSettings &renderer_settings)
 {
-    return std::make_unique<QtWebEngineCore::DisplaySoftwareOutputSurface>();
+    return std::make_unique<QtWebEngineCore::DisplaySoftwareOutputSurface>(renderer_settings.requires_alpha_channel);
 }
 
 std::unique_ptr<viz::SkiaOutputDevice>
@@ -21,6 +21,7 @@ viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
 #if QT_CONFIG(opengl)
     return std::make_unique<QtWebEngineCore::DisplaySkiaOutputDevice>(
             context_state_,
+            renderer_settings_.requires_alpha_channel,
             shared_gpu_deps_->memory_tracker(),
             GetDidSwapBuffersCompleteCallback());
 #else
@@ -28,25 +29,3 @@ viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
 #endif // QT_CONFIG(opengl)
 }
 
-void gpu::InProcessCommandBuffer::GetTextureQt(
-        unsigned int client_id,
-        GetTextureCallback callback,
-        const std::vector<SyncToken>& sync_token_fences)
-{
-    ScheduleGpuTask(base::BindOnce(&InProcessCommandBuffer::GetTextureQtOnGpuThread,
-                                   gpu_thread_weak_ptr_factory_.GetWeakPtr(),
-                                   client_id,
-                                   std::move(callback)),
-                    sync_token_fences);
-}
-
-void gpu::InProcessCommandBuffer::GetTextureQtOnGpuThread(
-        unsigned int client_id, GetTextureCallback callback)
-{
-    if (!MakeCurrent()) {
-        LOG(ERROR) << "MakeCurrent failed for GetTextureQt";
-        return;
-    }
-    gpu::TextureBase *texture = decoder_->GetTextureBase(client_id);
-    std::move(callback).Run(texture ? texture->service_id() : 0, gl::GLFence::Create());
-}
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index 7f42d61dec5..d2cce14d088 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -255,12 +255,15 @@ class DisplaySkiaOutputDevice::Buffer
 };
 
 DisplaySkiaOutputDevice::DisplaySkiaOutputDevice(
-        scoped_refptr<gpu::SharedContextState> contextState, gpu::MemoryTracker *memoryTracker,
+        scoped_refptr<gpu::SharedContextState> contextState,
+        bool requiresAlpha,
+        gpu::MemoryTracker *memoryTracker,
         DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
     : SkiaOutputDevice(contextState->gr_context(), memoryTracker, didSwapBufferCompleteCallback)
     , Compositor(contextState->GrContextIsVulkan() ? Compositor::Type::Vulkan
                                                    : Compositor::Type::OpenGL)
     , m_contextState(contextState)
+    , m_requiresAlpha(requiresAlpha)
 {
     capabilities_.uses_default_gl_framebuffer = false;
     capabilities_.supports_surfaceless = true;
@@ -369,9 +372,9 @@ QSize DisplaySkiaOutputDevice::size()
     return m_frontBuffer ? toQt(m_frontBuffer->shape().characterization.dimensions()) : QSize();
 }
 
-bool DisplaySkiaOutputDevice::hasAlphaChannel()
+bool DisplaySkiaOutputDevice::requiresAlphaChannel()
 {
-    return true;
+    return m_requiresAlpha;
 }
 
 float DisplaySkiaOutputDevice::devicePixelRatio()
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index e2818d6042c..648784f5288 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -23,6 +23,7 @@ class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compo
 {
 public:
     DisplaySkiaOutputDevice(scoped_refptr<gpu::SharedContextState> contextState,
+                            bool requiresAlpha,
                             gpu::MemoryTracker *memoryTracker,
                             DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
     ~DisplaySkiaOutputDevice() override;
@@ -45,7 +46,7 @@ class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compo
     void waitForTexture() override;
     int textureId() override;
     QSize size() override;
-    bool hasAlphaChannel() override;
+    bool requiresAlphaChannel() override;
     float devicePixelRatio() override;
 #if QT_CONFIG(webengine_vulkan)
     VkImage vkImage(QQuickWindow *win) override;
@@ -81,6 +82,7 @@ class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compo
     std::unique_ptr<Buffer> m_backBuffer;
     viz::OutputSurfaceFrame m_frame;
     bool m_readyToUpdate = false;
+    bool m_requiresAlpha;
     scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
 
 #if QT_CONFIG(webengine_vulkan)
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index 2277dfea323..10872da27c5 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -20,7 +20,7 @@ class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDev
                                                    public Compositor
 {
 public:
-    Device();
+    Device(bool requiresAlpha);
 
     // Overridden from viz::SoftwareOutputDevice.
     void Resize(const gfx::Size &sizeInPixels, float devicePixelRatio) override;
@@ -31,20 +31,23 @@ class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDev
     QImage image() override;
     float devicePixelRatio() override;
     QSize size() override;
-    bool hasAlphaChannel() override;
+    bool requiresAlphaChannel() override;
 
 private:
     mutable QMutex m_mutex;
     float m_devicePixelRatio = 1.0;
+    bool m_requiresAlpha;
     scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
     SwapBuffersCallback m_swapCompletionCallback;
     QImage m_image;
     float m_imageDevicePixelRatio = 1.0;
 };
 
-DisplaySoftwareOutputSurface::Device::Device()
+DisplaySoftwareOutputSurface::Device::Device(bool requiresAlpha)
     : Compositor(Type::Software)
-{}
+    , m_requiresAlpha(requiresAlpha)
+{
+}
 
 void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels, float devicePixelRatio)
 {
@@ -122,13 +125,13 @@ QSize DisplaySoftwareOutputSurface::Device::size()
     return m_image.size();
 }
 
-bool DisplaySoftwareOutputSurface::Device::hasAlphaChannel()
+bool DisplaySoftwareOutputSurface::Device::requiresAlphaChannel()
 {
-    return m_image.format() == QImage::Format_ARGB32_Premultiplied;
+    return m_requiresAlpha;
 }
 
-DisplaySoftwareOutputSurface::DisplaySoftwareOutputSurface()
-    : SoftwareOutputSurface(std::make_unique<Device>())
+DisplaySoftwareOutputSurface::DisplaySoftwareOutputSurface(bool requiresAlpha)
+    : SoftwareOutputSurface(std::make_unique<Device>(requiresAlpha))
 {}
 
 DisplaySoftwareOutputSurface::~DisplaySoftwareOutputSurface() {}
diff --git a/src/core/compositor/display_software_output_surface.h b/src/core/compositor/display_software_output_surface.h
index 5bb4e77c310..d23664d56e8 100644
--- a/src/core/compositor/display_software_output_surface.h
+++ b/src/core/compositor/display_software_output_surface.h
@@ -11,7 +11,7 @@ namespace QtWebEngineCore {
 class DisplaySoftwareOutputSurface final : public viz::SoftwareOutputSurface
 {
 public:
-    DisplaySoftwareOutputSurface();
+    DisplaySoftwareOutputSurface(bool requiresAlpha);
     ~DisplaySoftwareOutputSurface() override;
 
     // Overridden from viz::OutputSurface.
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index ae24450dbc4..c805589cc1b 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -369,8 +369,10 @@ QSGNode *RenderWidgetHostViewQtDelegateItem::updatePaintNode(QSGNode *oldNode, U
 #if QT_CONFIG(opengl)
     } else if (comp->type() == Compositor::Type::OpenGL) {
         QQuickWindow::CreateTextureOptions texOpts;
-        if (comp->hasAlphaChannel())
+        if (comp->requiresAlphaChannel() || m_clearColor.alpha() < 255)
             texOpts.setFlag(QQuickWindow::TextureHasAlphaChannel);
+        else
+            texOpts.setFlag(QQuickWindow::TextureIsOpaque);
         int texId = comp->textureId();
         node->setTexture(QNativeInterface::QSGOpenGLTexture::fromNative(texId, win, texSize, texOpts));
         node->setTextureCoordinatesTransform(QSGImageNode::MirrorVertically);
@@ -378,8 +380,10 @@ QSGNode *RenderWidgetHostViewQtDelegateItem::updatePaintNode(QSGNode *oldNode, U
 #if QT_CONFIG(webengine_vulkan)
     } else if (comp->type() == Compositor::Type::Vulkan) {
         QQuickWindow::CreateTextureOptions texOpts;
-        if (comp->hasAlphaChannel())
+        if (comp->requiresAlphaChannel() || m_clearColor.alpha() < 255)
             texOpts.setFlag(QQuickWindow::TextureHasAlphaChannel);
+        else
+            texOpts.setFlag(QQuickWindow::TextureIsOpaque);
 
         VkImage image = comp->vkImage(win);
         VkImageLayout layout = comp->vkImageLayout();

From a64c4bb59a6fb1f8b4e319d9aab32e8343b8486f Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Mon, 12 Dec 2022 17:54:09 +0100
Subject: [PATCH 143/681] Better handling of interrupted PDF printing

- Document the fact Stop WebAction can interrupt the in-progress PDF
generation.

- Update PrintViewManagerQt::PrintPreviewDone(): Normally
IsPrintRenderFrameConnected() implies IsRenderFrameLive(), but we have
to check both to avoid crash when render process exits. (Like Chrome
does.)

- Update PrintViewManagerQt::RequestPrintPreview(): Handle that case when
print preview params were sent between processes at the beginning, but it
was interrupted before RequestPrintPreview() could start PDF generation.

- Add a simple auto test to catch crashes

Task-number: QTBUG-108154
Change-Id: I8a4f9cc97ddcf9a165d66a5981d93a023858fbc1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c3ed0e176ccda503c968626010ca36f1f3961fce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.cpp              |  5 +++++
 src/core/printing/print_view_manager_qt.cpp  |  6 +++++-
 src/webenginewidgets/api/qwebengineview.cpp  |  3 +++
 tests/auto/widgets/printing/tst_printing.cpp | 14 ++++++++++++++
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index ac44fad10b3..99edc724648 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -2248,6 +2248,9 @@ QSizeF QWebEnginePage::contentsSize() const
     To be informed about the result of the request, connect to the signal
     pdfPrintingFinished().
 
+    \note The \l QWebEnginePage::Stop web action can be used to interrupt
+    this asynchronous operation.
+
     If a file already exists at the provided file path, it will be overwritten.
     \sa pdfPrintingFinished()
 */
@@ -2273,6 +2276,8 @@ void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &layo
     The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array
     will contain the PDF data, otherwise, the byte array will be empty.
 
+    \note The \l QWebEnginePage::Stop web action can be used to interrupt this operation.
+
     \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
     during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
     value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index d8b6f1c1ff8..7d8a796f773 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -277,7 +277,7 @@ void PrintViewManagerQt::resetPdfState()
 
 void PrintViewManagerQt::PrintPreviewDone()
 {
-    if (IsPrintRenderFrameConnected(m_printPreviewRfh))
+    if (m_printPreviewRfh->IsRenderFrameLive() && IsPrintRenderFrameConnected(m_printPreviewRfh))
         GetPrintRenderFrame(m_printPreviewRfh)->OnPrintPreviewDialogClosed();
     m_printPreviewRfh = nullptr;
 }
@@ -338,6 +338,10 @@ void PrintViewManagerQt::ShowScriptedPrintPreview(bool /*source_is_modifiable*/)
 
 void PrintViewManagerQt::RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr /*params*/)
 {
+    if (m_printSettings.empty()) {
+        PrintPreviewDone();
+        return;
+    }
     mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> printRenderFrame;
     m_printPreviewRfh->GetRemoteAssociatedInterfaces()->GetInterface(&printRenderFrame);
     printRenderFrame->PrintPreview(m_printSettings.Clone());
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index fd74268f2c4..35fb9813879 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -1408,6 +1408,9 @@ void QWebEngineView::printToPdf(const std::function<void(const QByteArray&)> &re
 
     \note Printing runs on the browser process, which is by default not sandboxed.
 
+    \note The data generation step of printing can be interrupted for a short period of time using
+    the \l QWebEnginePage::Stop web action.
+
     \note This function rasterizes the result when rendering onto \a printer. Please consider raising
     the default resolution of \a printer to at least 300 DPI or using printToPdf() to produce
     PDF file output more effectively.
diff --git a/tests/auto/widgets/printing/tst_printing.cpp b/tests/auto/widgets/printing/tst_printing.cpp
index 1c1e0615e1d..1f9b5059c58 100644
--- a/tests/auto/widgets/printing/tst_printing.cpp
+++ b/tests/auto/widgets/printing/tst_printing.cpp
@@ -23,6 +23,7 @@ private slots:
 #if QT_CONFIG(webengine_system_poppler)
     void printToPdfPoppler();
 #endif
+    void interruptPrinting();
 };
 
 void tst_Printing::printToPdfBasic()
@@ -117,6 +118,19 @@ void tst_Printing::printToPdfPoppler()
 }
 #endif
 
+void tst_Printing::interruptPrinting()
+{
+    QWebEngineView view;
+    QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+    view.load(QUrl("qrc:///resources/basic_printing_page.html"));
+    QTRY_VERIFY(spy.size() == 1);
+
+    QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");
+    QVERIFY(tempDir.isValid());
+    view.page()->printToPdf(tempDir.path() + "/file.pdf");
+    // Navigation stop interrupts print job, preferably do this without crash/assert
+    view.page()->triggerAction(QWebEnginePage::Stop);
+}
 
 QTEST_MAIN(tst_Printing)
 #include "tst_printing.moc"

From 9dcc31a1a780e39a6b66d0698bee0f0db6f3ac87 Mon Sep 17 00:00:00 2001
From: Yigit Akcay <yigit.akcay@qt.io>
Date: Thu, 23 Mar 2023 16:12:06 +0100
Subject: [PATCH 144/681] Merge recipe browser, stylesheet browser and markdown
 editor examples

This patch merges the qtwebengine examples recipe browser, stylesheet
browser and markdown editor into one single example.

Task-number: QTBUG-108751
Change-Id: I338707d7d3275b03bf2a2d7b65064ac91e562d7f
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit fe9d72d931f40eafca97c1012c03e24561c973ff)
---
 examples/webenginequick/CMakeLists.txt        |    3 -
 .../recipebrowser/CMakeLists.txt              |  158 --
 .../doc/images/recipebrowser-demo.jpg         |  Bin 33398 -> 0 bytes
 .../recipebrowser/doc/src/recipebrowser.qdoc  |  209 ---
 .../webenginequick/recipebrowser/main.cpp     |   30 -
 .../recipebrowser/recipebrowser.pro           |   21 -
 .../pages/assets/3rdparty/qt_attribution.json |   34 -
 .../resources/pages/assets/custom.js          |   20 -
 .../resources/qml/RecipeList.qml              |  125 --
 .../recipebrowser/resources/qml/main.qml      |  121 --
 .../recipebrowser/resources/resources.qrc     |   27 -
 examples/webenginequick/webenginequick.pro    |    3 +-
 examples/webenginewidgets/CMakeLists.txt      |    3 +-
 .../markdowneditor/CMakeLists.txt             |   58 -
 .../doc/images/markdowneditor-example.png     |  Bin 41883 -> 0 bytes
 .../doc/src/markdowneditor.qdoc               |  159 --
 .../markdowneditor/document.cpp               |   12 -
 .../markdowneditor/document.h                 |   26 -
 .../webenginewidgets/markdowneditor/main.cpp  |   19 -
 .../markdowneditor/mainwindow.cpp             |  147 --
 .../markdowneditor/mainwindow.h               |   45 -
 .../markdowneditor/mainwindow.ui              |  115 --
 .../markdowneditor/markdowneditor.pro         |   32 -
 .../markdowneditor/previewpage.cpp            |   17 -
 .../markdowneditor/previewpage.h              |   19 -
 .../resources/3rdparty/MARKDOWN-LICENSE.txt   |   16 -
 .../resources/3rdparty/MARKED-LICENSE.txt     |   19 -
 .../resources/3rdparty/markdown.css           |  260 ---
 .../resources/3rdparty/marked.js              | 1514 -----------------
 .../resources/3rdparty/qt_attribution.json    |   34 -
 .../markdowneditor/resources/default.md       |   12 -
 .../markdowneditor/resources/index.html       |   32 -
 .../resources/markdowneditor.qrc              |    8 -
 .../recipebrowser/CMakeLists.txt              |   71 +
 .../assets/3rdparty/MARKDOWN-LICENSE.txt      |    0
 .../assets/3rdparty/MARKED-LICENSE.txt        |    0
 .../assets/3rdparty/markdown.css              |    0
 .../recipebrowser}/assets/3rdparty/marked.js  |    0
 .../assets/3rdparty/qt_attribution.json       |   34 +
 .../recipebrowser}/assets/custom.css          |    2 +-
 .../recipebrowser/assets/custom.js            |   13 +
 .../recipebrowser/assets}/pages/burger.html   |   27 +-
 .../recipebrowser/assets}/pages/cupcakes.html |   28 +-
 .../assets}/pages/images/burger.jpg           |  Bin
 .../assets}/pages/images/cupcakes.jpg         |  Bin
 .../assets}/pages/images/pasta.jpg            |  Bin
 .../assets}/pages/images/pizza.jpg            |  Bin
 .../assets}/pages/images/skewers.jpg          |  Bin
 .../assets}/pages/images/soup.jpg             |  Bin
 .../assets}/pages/images/steak.jpg            |  Bin
 .../recipebrowser/assets}/pages/pasta.html    |   28 +-
 .../recipebrowser/assets}/pages/pizza.html    |   28 +-
 .../recipebrowser/assets}/pages/skewers.html  |   27 +-
 .../recipebrowser/assets}/pages/soup.html     |   28 +-
 .../recipebrowser/assets}/pages/steak.html    |   27 +-
 .../doc/images/recipebrowser.webp             |  Bin 0 -> 34058 bytes
 .../recipebrowser/doc/src/recipebrowser.qdoc  |  197 +++
 .../recipebrowser/document.cpp                |   48 +
 .../webenginewidgets/recipebrowser/document.h |   36 +
 .../main.cpp                                  |    4 +-
 .../recipebrowser/mainwindow.cpp              |  153 ++
 .../mainwindow.h                              |   14 +-
 .../recipebrowser/mainwindow.ui               |  106 ++
 .../recipebrowser.pro}                        |   12 +-
 .../recipebrowser/recipebrowser.qrc           |   15 +
 .../stylesheetdialog.cpp                      |   23 +-
 .../stylesheetdialog.h                        |    2 +-
 .../stylesheetdialog.ui                       |    0
 .../stylesheetbrowser/3rdparty/COPYING        |    1 -
 .../3rdparty/qt_attribution.json              |   24 -
 .../3rdparty/view-refresh.png                 |  Bin 1364 -> 0 bytes
 .../stylesheetbrowser/CMakeLists.txt          |   53 -
 .../doc/images/stylesheetbrowser.png          |  Bin 45161 -> 0 bytes
 .../doc/src/stylesheetbrowser.qdoc            |   44 -
 .../stylesheetbrowser/mainwindow.cpp          |  122 --
 .../stylesheetbrowser/mainwindow.ui           |  133 --
 .../stylesheetbrowser/stylesheetbrowser.qrc   |    5 -
 .../webenginewidgets/webenginewidgets.pro     |    3 +-
 .../doc/src/qwebengineview_lgpl.qdoc          |    2 +-
 79 files changed, 873 insertions(+), 3735 deletions(-)
 delete mode 100644 examples/webenginequick/recipebrowser/CMakeLists.txt
 delete mode 100644 examples/webenginequick/recipebrowser/doc/images/recipebrowser-demo.jpg
 delete mode 100644 examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
 delete mode 100644 examples/webenginequick/recipebrowser/main.cpp
 delete mode 100644 examples/webenginequick/recipebrowser/recipebrowser.pro
 delete mode 100644 examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
 delete mode 100644 examples/webenginequick/recipebrowser/resources/pages/assets/custom.js
 delete mode 100644 examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml
 delete mode 100644 examples/webenginequick/recipebrowser/resources/qml/main.qml
 delete mode 100644 examples/webenginequick/recipebrowser/resources/resources.qrc
 delete mode 100644 examples/webenginewidgets/markdowneditor/CMakeLists.txt
 delete mode 100644 examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.png
 delete mode 100644 examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
 delete mode 100644 examples/webenginewidgets/markdowneditor/document.cpp
 delete mode 100644 examples/webenginewidgets/markdowneditor/document.h
 delete mode 100644 examples/webenginewidgets/markdowneditor/main.cpp
 delete mode 100644 examples/webenginewidgets/markdowneditor/mainwindow.cpp
 delete mode 100644 examples/webenginewidgets/markdowneditor/mainwindow.h
 delete mode 100644 examples/webenginewidgets/markdowneditor/mainwindow.ui
 delete mode 100644 examples/webenginewidgets/markdowneditor/markdowneditor.pro
 delete mode 100644 examples/webenginewidgets/markdowneditor/previewpage.cpp
 delete mode 100644 examples/webenginewidgets/markdowneditor/previewpage.h
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/default.md
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/index.html
 delete mode 100644 examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc
 create mode 100644 examples/webenginewidgets/recipebrowser/CMakeLists.txt
 rename examples/{webenginequick/recipebrowser/resources/pages => webenginewidgets/recipebrowser}/assets/3rdparty/MARKDOWN-LICENSE.txt (100%)
 rename examples/{webenginequick/recipebrowser/resources/pages => webenginewidgets/recipebrowser}/assets/3rdparty/MARKED-LICENSE.txt (100%)
 rename examples/{webenginequick/recipebrowser/resources/pages => webenginewidgets/recipebrowser}/assets/3rdparty/markdown.css (100%)
 rename examples/{webenginequick/recipebrowser/resources/pages => webenginewidgets/recipebrowser}/assets/3rdparty/marked.js (100%)
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json
 rename examples/{webenginequick/recipebrowser/resources/pages => webenginewidgets/recipebrowser}/assets/custom.css (87%)
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/custom.js
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/burger.html (79%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/cupcakes.html (70%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/burger.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/cupcakes.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/pasta.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/pizza.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/skewers.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/soup.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/images/steak.jpg (100%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/pasta.html (73%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/pizza.html (63%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/skewers.html (75%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/soup.html (53%)
 rename examples/{webenginequick/recipebrowser/resources => webenginewidgets/recipebrowser/assets}/pages/steak.html (75%)
 create mode 100644 examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp
 create mode 100644 examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
 create mode 100644 examples/webenginewidgets/recipebrowser/document.cpp
 create mode 100644 examples/webenginewidgets/recipebrowser/document.h
 rename examples/webenginewidgets/{stylesheetbrowser => recipebrowser}/main.cpp (82%)
 create mode 100644 examples/webenginewidgets/recipebrowser/mainwindow.cpp
 rename examples/webenginewidgets/{stylesheetbrowser => recipebrowser}/mainwindow.h (74%)
 create mode 100644 examples/webenginewidgets/recipebrowser/mainwindow.ui
 rename examples/webenginewidgets/{stylesheetbrowser/stylesheetbrowser.pro => recipebrowser/recipebrowser.pro} (50%)
 create mode 100644 examples/webenginewidgets/recipebrowser/recipebrowser.qrc
 rename examples/webenginewidgets/{stylesheetbrowser => recipebrowser}/stylesheetdialog.cpp (86%)
 rename examples/webenginewidgets/{stylesheetbrowser => recipebrowser}/stylesheetdialog.h (95%)
 rename examples/webenginewidgets/{stylesheetbrowser => recipebrowser}/stylesheetdialog.ui (100%)
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.png
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.png
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
 delete mode 100644 examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc

diff --git a/examples/webenginequick/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
index ff291fdcf7b..52ba7cb0b81 100644
--- a/examples/webenginequick/CMakeLists.txt
+++ b/examples/webenginequick/CMakeLists.txt
@@ -3,6 +3,3 @@
 
 qt_internal_add_example(lifecycle)
 qt_internal_add_example(quicknanobrowser)
-if(TARGET Qt::QuickControls2)
-    qt_internal_add_example(recipebrowser)
-endif()
diff --git a/examples/webenginequick/recipebrowser/CMakeLists.txt b/examples/webenginequick/recipebrowser/CMakeLists.txt
deleted file mode 100644
index 12aa7c1d38b..00000000000
--- a/examples/webenginequick/recipebrowser/CMakeLists.txt
+++ /dev/null
@@ -1,158 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(recipebrowser LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/recipebrowser")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2 WebEngineQuick)
-
-qt_add_executable(recipebrowser
-    main.cpp
-)
-
-set_target_properties(recipebrowser PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(recipebrowser PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::Qml
-    Qt::Quick
-    Qt::QuickControls2
-    Qt::WebEngineQuick
-)
-
-# Resources:
-set_source_files_properties("resources/pages/assets/3rdparty/markdown.css"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/assets/3rdparty/marked.js"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/assets/custom.css"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/assets/custom.js"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/burger.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/cupcakes.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/burger.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/cupcakes.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/pasta.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/pizza.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/skewers.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/soup.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/images/steak.jpg"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/pasta.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/pizza.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/skewers.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/soup.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/pages/steak.html"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/qml/RecipeList.qml"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set_source_files_properties("resources/qml/main.qml"
-    PROPERTIES QT_SKIP_QUICKCOMPILER 1
-)
-
-set(resources_resource_files
-    "resources/pages/assets/3rdparty/markdown.css"
-    "resources/pages/assets/3rdparty/marked.js"
-    "resources/pages/assets/custom.css"
-    "resources/pages/assets/custom.js"
-    "resources/pages/burger.html"
-    "resources/pages/cupcakes.html"
-    "resources/pages/images/burger.jpg"
-    "resources/pages/images/cupcakes.jpg"
-    "resources/pages/images/pasta.jpg"
-    "resources/pages/images/pizza.jpg"
-    "resources/pages/images/skewers.jpg"
-    "resources/pages/images/soup.jpg"
-    "resources/pages/images/steak.jpg"
-    "resources/pages/pasta.html"
-    "resources/pages/pizza.html"
-    "resources/pages/skewers.html"
-    "resources/pages/soup.html"
-    "resources/pages/steak.html"
-    "resources/qml/main.qml"
-    "resources/qml/RecipeList.qml"
-)
-
-qt_add_resources(recipebrowser "resources"
-    PREFIX
-        "/"
-    BASE
-        "resources"
-    FILES
-        ${resources_resource_files}
-)
-
-if(CMAKE_CROSSCOMPILING AND (LINUX OR QNX OR posix))
-    target_compile_definitions(recipebrowser PUBLIC
-        QTWEBENGINE_RECIPE_BROWSER_EMBEDDED
-    )
-endif()
-
-install(TARGETS recipebrowser
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginequick/recipebrowser/doc/images/recipebrowser-demo.jpg b/examples/webenginequick/recipebrowser/doc/images/recipebrowser-demo.jpg
deleted file mode 100644
index 761ad357619615cd3f5dabd22bcf51e75480fca9..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
deleted file mode 100644
index d2de5780c08..00000000000
--- a/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginequick/recipebrowser
-    \title WebEngine Recipe Browser
-    \ingroup webengine-examples
-    \brief A small hybrid application based on the WebEngineView QML type and Qt Quick Controls 2.
-
-    \image recipebrowser-demo.jpg
-
-    \e {Recipe Browser} demonstrates how to use the \l{WebEngineView} item, \l{Qt Quick} items, and
-    \l{Qt Quick Controls 2} items to develop a small hybrid web browser application.
-    A \l{ListView}-based item is used to display a list of recipe names. Clicking on
-    a name causes the web view to load the respective recipe page. The overall appearance
-    of the application is provided by the \l{Qt Quick Controls 2} items, which have their active
-    style set to the \l{Material Style}{Material} style. The web content is a mix of HTML and
-    Markdown source compiled to HTML, along with CSS and JavaScript.
-
-    \include examples-run.qdocinc
-
-    \section1 C++ Code
-
-    In \c main.cpp, we use the \l{QGuiApplication} and \l{QQmlApplicationEngine}
-    classes to set up and load the main QML file. We call \l{QtWebEngineQuick::initialize} so we can use
-    \l{WebEngineView} in our QML code. We set the default Qt Quick Controls 2 style
-    to the Material style, so we do not have to specify it for each new item we add. Finally, we use
-    a C++ define to check whether the application is compiled for an embedded platform.
-    The value will be used in the main QML code to determine the window size.
-
-    \quotefromfile webenginequick/recipebrowser/main.cpp
-    \skipto #include
-    \printuntil }
-
-    \section1 QML Code
-
-    In the \c main.qml file, we first create a top-level window and set a title for it. We also set
-    up the size of the window depending on its primary orientation as well as the platform, so that
-    the application is usable on both desktop and embedded platforms. On desktop, the size
-    is constrained by a minimum of 320x480 pixels up to the maximum size that the screen supports.
-    The default window size is 1024 pixels wide and 768 pixels high in landscape orientation.
-    On embedded devices, the window will occupy the whole screen.
-
-    \quotefromfile webenginequick/recipebrowser/resources/qml/main.qml
-    \skipto ApplicationWindow
-    \printuntil minimumHeight
-
-    Next, we add a \l{RowLayout} item so we can divide the window into two parts: one being a
-    custom \c RecipeList item containing the recipe titles, and the other being the
-    \l{WebEngineView}, which shows the recipe details. The spacing is set to zero so the items are
-    positioned directly next to each other.
-
-    \printuntil RecipeList
-    \dots 16
-    \skipuntil webView.showRecipe
-    \printline }
-    \printuntil WebEngineView
-    \dots 16
-    \skipuntil busy.running = true
-    \skipline }
-    \skipline }
-    \printline }
-    \printline }
-
-    The \c RecipeList item has a few \l{Layout}{attached Layout properties}, in order to scale the
-    item to a maximum of one third of the layout width. We give the item focus, so that the keyboard
-    can be used to navigate the recipes, in addition to using mouse and touch. We also add a handler
-    for the custom \c recipeSelected signal, to tell the WebEngineView to load the URL of the
-    selected recipe.
-
-    \quotefromfile webenginequick/recipebrowser/resources/qml/main.qml
-    \skipto RecipeList
-    \printuntil }
-
-    The WebEngineView has similar layout properties, to make it occupy two thirds of the layout
-    width.
-
-    \skipto WebEngineView
-    \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
-    item every time its URL is changed. This allows the user to continue navigating through the
-    recipes using the keyboard. We also disable the default context menu by accepting the
-    ContextMenuRequest.
-
-    \skipto focusOnNavigationEnabled
-    \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.
-
-    \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.
-
-    \quotefromfile webenginequick/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
-    focus. We also declare a custom \c recipeSelected signal, which will be emitted when the current
-    item of the ListView changes.
-
-    \quotefromfile webenginequick/recipebrowser/resources/qml/RecipeList.qml
-    \skipto FocusScope
-    \printuntil recipeSelected
-
-    A ColumnLayout holds a header \l{Label} above the ListView, and the ListView itself.
-    Again, we set the spacing to zero and make sure the layout occupies the whole space of
-    the parent item.
-
-    \skipto ColumnLayout
-    \printuntil anchors.fill
-
-    Inside the layout there is a styled \l{ToolBar} item, with a \l{Label} inside of it serving as
-    the ListView header.
-
-    \skipto ToolBar
-    \printuntil Label
-    \printuntil }
-    \printuntil }
-
-    The second item inside the layout is a \l{ListView}, whose contents will fill the remaining
-    space in the layout. We set \l{Item::}{clip} to true, so that the delegates that are scrolled
-    up are not seen under the ToolBar item. We set \l{Item::}{focus} to true, so the ListView gains
-    focus when the FocusScope does. We add a vertical scroll bar, so the user can scroll through the
-    recipes if the window size is small. We also specify the recipe model to be used by the
-    ListView as described later in this topic.
-
-    \skipto ListView
-    \printuntil model
-
-    We have an \l{ItemDelegate} set as the ListView delegate, which displays the
-    recipe title. The contentItem is a \l{Text} item, customized with a few properties to adjust the
-    visual appearance and position of the text. We create a binding to the current delegate's model
-    URL, so we can access the respective URL outside the delegate itself. We set the
-    \l{ItemDelegate::}{highlighted} property to \c true whenever the item is the current one in the
-    ListView to provide visual feedback. And we set the focus on the ListView whenever a delegate
-    is clicked, so that keyboard navigation works in case the focus was previously in the
-    WebEngineView.
-
-    \skipto delegate
-    \printuntil onClicked
-    \printuntil }
-    \printuntil }
-
-    A handler is defined for the \c currentItemChanged signal to emit our own \c recipeSelected
-    signal with the URL that the WebEngineView should load.
-
-    \skipto onCurrentItemChanged
-    \printuntil }
-
-    We use a \l{ListModel} with seven \l{ListElement}s, each of which contains a recipe
-    title and the URL to an HTML page contained in a resource file. The model is used to populate
-    the ListView with the recipes and to show the recipe details in the WebEngineView.
-
-    \skipto ListModel
-    \printuntil Cupcakes
-    \printuntil }
-    \printuntil }
-
-    We use a \l{ToolTip} item that is displayed on application startup to inform the users
-    how they can navigate and view the details of each recipe. The ToolTip is shown using the
-    \c showHelp method, which is invoked by the \l{Timer} in the main.qml file.
-
-    \skipto ToolTip
-    \printuntil help.open()
-    \printuntil }
-    \printuntil }
-
-    An example of a recipe page can be seen below. The page uses two stylesheets and
-    two JavaScript files:
-    \list
-        \li \l{https://bitbucket.org/kevinburke/markdowncss/src/master/}{markdown.css} is
-            a markdown-friendly stylesheet created by Kevin Burke
-        \li \l{https://github.com/chjj/marked}{marked.min.js} is a markdown parser and
-            compiler designed for speed written by Christopher Jeffrey
-        \li custom.css makes some small styling adjustments to the final recipe page
-        \li custom.js is used to invoke the conversion of the recipe content (which is written in
-            markdown syntax) into HTML
-    \endlist
-
-    The images on the pages are loaded from the compiled resource file.
-
-    \quotefromfile webenginequick/recipebrowser/resources/pages/soup.html
-    \printuntil </html>
-
-    \section1 Files and Attributions
-
-    The example bundles the following code with third-party licenses:
-
-    \table
-    \row
-        \li \l{recipebrowser-marked}{Marked}
-        \li MIT License
-    \row
-        \li \l{recipebrowser-markdowncss}{Markdown.css}
-        \li Apache License 2.0
-    \endtable
-*/
diff --git a/examples/webenginequick/recipebrowser/main.cpp b/examples/webenginequick/recipebrowser/main.cpp
deleted file mode 100644
index 076a3be9a2a..00000000000
--- a/examples/webenginequick/recipebrowser/main.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <QQmlContext>
-#include <QQuickStyle>
-#include <QtWebEngineQuick/qtwebenginequickglobal.h>
-
-int main(int argc, char *argv[])
-{
-    QCoreApplication::setOrganizationName("QtExamples");
-    QtWebEngineQuick::initialize();
-
-    QGuiApplication app(argc, argv);
-
-    QQuickStyle::setStyle(QStringLiteral("Material"));
-
-    QQmlApplicationEngine engine;
-
-    bool isEmbedded = false;
-#ifdef QTWEBENGINE_RECIPE_BROWSER_EMBEDDED
-    isEmbedded = true;
-#endif
-    engine.rootContext()->setContextProperty(QStringLiteral("isEmbedded"), isEmbedded);
-
-    engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
-
-    return app.exec();
-}
diff --git a/examples/webenginequick/recipebrowser/recipebrowser.pro b/examples/webenginequick/recipebrowser/recipebrowser.pro
deleted file mode 100644
index e358d00a344..00000000000
--- a/examples/webenginequick/recipebrowser/recipebrowser.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-TEMPLATE = app
-
-QT += quick qml quickcontrols2 webenginequick
-
-cross_compile {
-  posix|qnx|linux: DEFINES += QTWEBENGINE_RECIPE_BROWSER_EMBEDDED
-}
-
-SOURCES += main.cpp
-
-RESOURCES += resources/resources.qrc
-
-# Make sure Qt Quick compiler does not remove the source code of the .js files.
-QTQUICK_COMPILER_SKIPPED_RESOURCES = resources/resources.qrc
-
-DISTFILES += \
-    resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt \
-    resources/pages/assets/3rdparty/MARKED-LICENSE.txt
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/recipebrowser
-INSTALLS += target
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
deleted file mode 100644
index 4dafa1acd0b..00000000000
--- a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,34 +0,0 @@
-[
-    {
-        "Id": "recipebrowser-marked",
-        "Name": "Marked (WebEngine RecipeBrowser example)",
-        "QDocModule": "qtwebengine",
-        "QtUsage": "Marked is used in the WebEngine RecipeBrowser example",
-        "QtParts": [ "examples" ],
-        "Files": "marked.js",
-        "Description": "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.",
-        "Homepage": "https://github.com/chjj/marked",
-        "Version": "0.4.0",
-        "DownloadLocation": "https://github.com/markedjs/marked/blob/0.4.0/lib/marked.js",
-        "Copyright": "Copyright (c) 2011-2018, Christopher Jeffrey",
-        "License": "MIT License",
-        "LicenseId": "MIT",
-        "LicenseFile": "MARKED-LICENSE.txt"
-    },
-    {
-        "Id": "recipebrowser-markdowncss",
-        "Name": "Markdown.css (WebEngine RecipeBrowser example)",
-        "QDocModule": "qtwebengine",
-        "QtUsage": "markdown.css is used in the WebEngine RecipeBrowser example",
-        "QtParts": [ "examples" ],
-        "Files": "markdown.css",
-        "Description": "Markdown.css is better default styling for your Markdown files.",
-        "Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
-        "DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
-        "Copyright": "Copyright 2011 Kevin Burke
-    Copyright Twitter Inc.",
-        "License": "Apache License 2.0",
-        "LicenseId": "Apache-2.0",
-        "LicenseFile": "MARKDOWN-LICENSE.txt"
-    }
-]
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/custom.js b/examples/webenginequick/recipebrowser/resources/pages/assets/custom.js
deleted file mode 100644
index 2be2cf1ec9f..00000000000
--- a/examples/webenginequick/recipebrowser/resources/pages/assets/custom.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-marked.setOptions({
-  renderer: new marked.Renderer(),
-  gfm: true,
-  tables: true,
-  breaks: false,
-  pedantic: false,
-  sanitize: false,
-  smartLists: true,
-  smartypants: false
-});
-
-// Poor man document.ready();
-(function() {
-  var placeholder = document.getElementById('placeholder');
-  var content = document.getElementById('content');
-  placeholder.innerHTML = marked(content.innerHTML);
-})();
diff --git a/examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml b/examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml
deleted file mode 100644
index bfaf59112c9..00000000000
--- a/examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-import QtQuick
-import QtQuick.Controls
-import QtQuick.Controls.Material
-import QtQuick.Layouts
-
-FocusScope {
-    id: root
-    signal recipeSelected(url url)
-
-    ColumnLayout {
-        spacing: 0
-        anchors.fill: parent
-
-        ToolBar {
-            id: headerBackground
-            Layout.fillWidth: true
-            implicitHeight: headerText.height + 20
-
-            Label {
-                id: headerText
-                width: parent.width
-                text: qsTr("Favorite recipes")
-                padding: 10
-                anchors.centerIn: parent
-            }
-        }
-
-        ListView {
-            id: listView
-            Layout.fillWidth: true
-            Layout.fillHeight: true
-            keyNavigationWraps: true
-            clip: true
-            focus: true
-            ScrollBar.vertical: ScrollBar { }
-
-            model: recipeModel
-
-            delegate: ItemDelegate {
-                width: parent.width
-                text: model.name
-                contentItem: Text {
-                    text: parent.text
-                    font: parent.font
-                    color: parent.enabled ? parent.Material.primaryTextColor
-                                          : parent.Material.hintTextColor
-                    elide: Text.ElideRight
-                    horizontalAlignment: Text.AlignLeft
-                    verticalAlignment: Text.AlignVCenter
-                    wrapMode: Text.Wrap
-                }
-
-                property url url: model.url
-                highlighted: ListView.isCurrentItem
-
-                onClicked: {
-                    listView.forceActiveFocus()
-                    listView.currentIndex = model.index
-                }
-            }
-
-            onCurrentItemChanged: {
-                root.recipeSelected(currentItem.url)
-            }
-
-            ListModel {
-                id: recipeModel
-
-                ListElement {
-                    name: "Pizza Diavola"
-                    url: "qrc:///pages/pizza.html"
-                }
-                ListElement {
-                    name: "Steak"
-                    url: "qrc:///pages/steak.html"
-                }
-                ListElement {
-                    name: "Burger"
-                    url: "qrc:///pages/burger.html"
-                }
-                ListElement {
-                    name: "Soup"
-                    url: "qrc:///pages/soup.html"
-                }
-                ListElement {
-                    name: "Pasta"
-                    url: "qrc:///pages/pasta.html"
-                }
-                ListElement {
-                    name: "Grilled Skewers"
-                    url: "qrc:///pages/skewers.html"
-                }
-                ListElement {
-                    name: "Cupcakes"
-                    url: "qrc:///pages/cupcakes.html"
-                }
-            }
-
-            ToolTip {
-                id: help
-                implicitWidth: root.width - padding * 3
-                y: root.y + root.height
-                delay: 1000
-                timeout: 5000
-                text: qsTr("Use keyboard, mouse, or touch controls to navigate through the\
-                            recipes.")
-
-                contentItem: Text {
-                    text: help.text
-                    font: help.font
-                    color: help.Material.primaryTextColor
-                    wrapMode: Text.Wrap
-                }
-            }
-        }
-    }
-
-    function showHelp() {
-        help.open()
-    }
-}
-
diff --git a/examples/webenginequick/recipebrowser/resources/qml/main.qml b/examples/webenginequick/recipebrowser/resources/qml/main.qml
deleted file mode 100644
index 7db43c871a8..00000000000
--- a/examples/webenginequick/recipebrowser/resources/qml/main.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-import QtQml
-import QtQuick
-import QtQuick.Controls
-import QtQuick.Controls.Material
-import QtQuick.Layouts
-import QtQuick.Window
-import QtWebEngine
-
-ApplicationWindow {
-    id: appWindow
-    title: qsTr("Recipe Browser")
-    visible: true
-
-    property int shorterDesktop: 768
-    property int longerDesktop: 1024
-    property int shorterMin: 360
-    property int longerMin: 480
-    property bool isPortrait: Screen.primaryOrientation === Qt.PortraitOrientation
-    width: {
-        if (isEmbedded)
-            return Screen.width
-        var potentialWidth = shorterDesktop
-        if (!isPortrait)
-            potentialWidth = longerDesktop
-        return potentialWidth > Screen.width ? Screen.width : potentialWidth
-    }
-    height: {
-        if (isEmbedded)
-            return Screen.height
-        var potentialHeight = longerDesktop
-        if (!isPortrait)
-            potentialHeight = shorterDesktop
-        return potentialHeight > Screen.height ? Screen.height : potentialHeight
-    }
-    minimumWidth: isPortrait ? shorterMin : longerMin
-    minimumHeight: isPortrait ? longerMin : shorterMin
-
-    RowLayout {
-        id: container
-        anchors.fill: parent
-        spacing: 0
-
-        RecipeList {
-            id: recipeList
-            Layout.minimumWidth: 124
-            Layout.preferredWidth: parent.width / 3
-            Layout.maximumWidth: 300
-            Layout.fillWidth: true
-            Layout.fillHeight: true
-            focus: true
-            activeFocusOnTab: true
-            onRecipeSelected: function(url) {
-                webView.showRecipe(url)
-            }
-        }
-
-        WebEngineView {
-            id: webView
-            Layout.preferredWidth: 2 * parent.width / 3
-            Layout.fillWidth: true
-            Layout.fillHeight: true
-            // Make sure focus is not taken by the web view, so user can continue navigating
-            // recipes with the keyboard.
-            settings.focusOnNavigationEnabled: false
-
-            onContextMenuRequested: function(request) {
-                request.accepted = true
-            }
-
-            property bool firstLoadComplete: false
-            onLoadingChanged: function(loadRequest) {
-                if (loadRequest.status === WebEngineView.LoadSucceededStatus
-                    && !firstLoadComplete) {
-                    // Debounce the showing of the web content, so images are more likely
-                    // to have loaded completely.
-                    showTimer.start()
-                }
-            }
-
-            Timer {
-                id: showTimer
-                interval: 500
-                repeat: false
-                onTriggered: {
-                    webView.show(true)
-                    webView.firstLoadComplete = true
-                    recipeList.showHelp()
-                }
-            }
-
-            Rectangle {
-                id: webViewPlaceholder
-                anchors.fill: parent
-                z: 1
-                color: "white"
-
-                BusyIndicator {
-                    id: busy
-                    anchors.centerIn: parent
-                }
-            }
-
-            function showRecipe(url) {
-                webView.url = url
-            }
-
-            function show(show) {
-                if (show === true) {
-                    busy.running = false
-                    webViewPlaceholder.visible = false
-                } else {
-                    webViewPlaceholder.visible = true
-                    busy.running = true
-                }
-            }
-        }
-    }
-}
diff --git a/examples/webenginequick/recipebrowser/resources/resources.qrc b/examples/webenginequick/recipebrowser/resources/resources.qrc
deleted file mode 100644
index bd13dcfae2c..00000000000
--- a/examples/webenginequick/recipebrowser/resources/resources.qrc
+++ /dev/null
@@ -1,27 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file>qml/main.qml</file>
-        <file>qml/RecipeList.qml</file>
-
-        <file>pages/pizza.html</file>
-        <file>pages/burger.html</file>
-        <file>pages/steak.html</file>
-        <file>pages/soup.html</file>
-        <file>pages/pasta.html</file>
-        <file>pages/skewers.html</file>
-        <file>pages/cupcakes.html</file>
-
-        <file>pages/assets/3rdparty/marked.js</file>
-        <file>pages/assets/3rdparty/markdown.css</file>
-        <file>pages/assets/custom.css</file>
-        <file>pages/assets/custom.js</file>
-
-        <file>pages/images/burger.jpg</file>
-        <file>pages/images/pizza.jpg</file>
-        <file>pages/images/steak.jpg</file>
-        <file>pages/images/soup.jpg</file>
-        <file>pages/images/pasta.jpg</file>
-        <file>pages/images/skewers.jpg</file>
-        <file>pages/images/cupcakes.jpg</file>
-    </qresource>
-</RCC>
diff --git a/examples/webenginequick/webenginequick.pro b/examples/webenginequick/webenginequick.pro
index acf6127d670..fb44f2c5496 100644
--- a/examples/webenginequick/webenginequick.pro
+++ b/examples/webenginequick/webenginequick.pro
@@ -5,6 +5,5 @@ SUBDIRS += \
 
 qtHaveModule(quickcontrols2) {
     SUBDIRS += \
-        lifecycle \
-        recipebrowser
+        lifecycle
 }
diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt
index c1508942030..cc4a4d6c030 100644
--- a/examples/webenginewidgets/CMakeLists.txt
+++ b/examples/webenginewidgets/CMakeLists.txt
@@ -5,14 +5,13 @@ qt_internal_add_example(contentmanipulation)
 qt_internal_add_example(cookiebrowser)
 qt_internal_add_example(notifications)
 qt_internal_add_example(simplebrowser)
-qt_internal_add_example(stylesheetbrowser)
 qt_internal_add_example(push-notifications)
 qt_internal_add_example(videoplayer)
 if(QT_FEATURE_webengine_geolocation)
     qt_internal_add_example(maps)
 endif()
 if(QT_FEATURE_webengine_webchannel)
-    qt_internal_add_example(markdowneditor)
+    qt_internal_add_example(recipebrowser)
 endif()
 if(QT_FEATURE_webengine_printing_and_pdf)
     qt_internal_add_example(printme)
diff --git a/examples/webenginewidgets/markdowneditor/CMakeLists.txt b/examples/webenginewidgets/markdowneditor/CMakeLists.txt
deleted file mode 100644
index 808c695219b..00000000000
--- a/examples/webenginewidgets/markdowneditor/CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(markdowneditor LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/markdowneditor")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebChannel WebEngineWidgets)
-
-qt_add_executable(markdowneditor
-    document.cpp document.h
-    main.cpp
-    mainwindow.cpp mainwindow.h mainwindow.ui
-    previewpage.cpp previewpage.h
-)
-
-set_target_properties(markdowneditor PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(markdowneditor PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebChannel
-    Qt::WebEngineWidgets
-)
-
-# Resources:
-set(markdowneditor_resource_files
-    "resources/3rdparty/markdown.css"
-    "resources/3rdparty/marked.js"
-    "resources/default.md"
-    "resources/index.html"
-)
-
-qt_add_resources(markdowneditor "markdowneditor"
-    PREFIX
-        "/"
-    BASE
-        "resources"
-    FILES
-        ${markdowneditor_resource_files}
-)
-
-install(TARGETS markdowneditor
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.png b/examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.png
deleted file mode 100644
index 9f456c4db2dd9a948fbca9e832cb1c80af8a2fb3..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc b/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
deleted file mode 100644
index f8c67fd638b..00000000000
--- a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginewidgets/markdowneditor
-    \title WebEngine Markdown Editor Example
-    \ingroup webengine-widgetexamples
-    \brief Demonstrates how to integrate a web engine in a hybrid desktop
-    application.
-
-    \image markdowneditor-example.png
-
-    \e {Markdown Editor} demonstrates how to use QWebChannel and JavaScript
-    libraries to provide a rich text preview tool for a custom markup language.
-
-    \l{http://daringfireball.net/projects/markdown/}{Markdown} is a lightweight
-    markup language with a plain text formatting syntax.
-    Some services, such as \l{http://github.com}{github}, acknowledge the
-    format, and render the content as rich text when viewed in a browser.
-
-    The Markdown Editor main window is split into an editor and a preview area.
-    The editor supports the Markdown syntax and is implemented by using
-    QPlainTextEdit. The document is rendered as rich text in the preview area,
-    which is implemented by using QWebEngineView. To render the text, the
-    Markdown text is converted to HTML format with the help of a JavaScript
-    library inside the web engine. The preview is updated from the editor
-    through QWebChannel.
-
-    \include examples-run.qdocinc
-
-    \section1 Exposing Document Text
-
-    Because we expose the current Markdown text to be rendered to the web engine
-    through QWebChannel, we need to somehow make the current text available
-    through the Qt metatype system. This is done by using a dedicated
-    \c Document class that exposes the document text as a \c{Q_PROPERTY}:
-
-    \quotefromfile webenginewidgets/markdowneditor/document.h
-    \skipto class Document
-    \printto #endif
-
-    The \c Document class wraps a QString to be set on the C++ side with
-    the \c setText() method and exposes it at runtime as a \c text property
-    with a \c textChanged signal.
-
-    We define the \c setText method as follows:
-
-    \quotefromfile webenginewidgets/markdowneditor/document.cpp
-    \skipto Document::setText
-    \printuntil
-
-    \section1 Previewing Text
-
-    We implement our own \c PreviewPage class that publicly inherits from
-    \c QWebEnginePage:
-
-    \quotefromfile webenginewidgets/markdowneditor/previewpage.h
-    \skipto class PreviewPage
-    \printto #endif
-
-    We reimplement the virtual \c acceptNavigationRequest method to
-    stop the page from navigating away from the current document. Instead,
-    we redirect external links to the system browser:
-
-    \quotefromfile webenginewidgets/markdowneditor/previewpage.cpp
-    \skipto acceptNavigationRequest
-    \printuntil
-
-    \section1 Creating the Main Window
-
-    The \c MainWindow class inherits the QMainWindow class:
-
-    \quotefromfile webenginewidgets/markdowneditor/mainwindow.h
-    \skipto class MainWindow :
-    \printto endif
-
-    The class declares private slots that match the actions in the menu,
-    as well as the \c isModified() helper method.
-
-    The actual layout of the main window is specified in a \c .ui file.
-    The widgets and actions are available at runtime in the \c ui member
-    variable.
-
-    \c m_filePath holds the file path to the currently loaded document.
-    \c m_content is an instance of the \c Document class.
-
-    The actual setup of the different objects is done in the \c MainWindow
-    constructor:
-
-    \quotefromfile webenginewidgets/markdowneditor/mainwindow.cpp
-    \skipto MainWindow::MainWindow
-    \printto PreviewPage
-
-    The constructor first calls \c setupUi to construct the widgets and menu
-    actions according to the UI file. The text editor font is set to one
-    with a fixed character width, and the QWebEngineView widget is told not
-    to show a context menu.
-
-    \printto connect
-
-    Here the constructor makes sure our custom
-    \c PreviewPage is used by the QWebEngineView instance in \c{ui->preview}.
-
-    \printto ui->preview
-
-    Here the \c textChanged signal of the editor is connected to a lambda that
-    updates the text in \c m_content. This object is then exposed to the JS side
-    by \c QWebChannel under the name \c{content}.
-
-    \printto connect
-
-    Now we can actually load the \e index.html file from the
-    resources. For more information about the file, see
-    \l{Creating an Index File}.
-
-    \printto defaultTextFile
-
-    The menu items are connected to the corresponding member slots. The
-    \uicontrol Save item is activated or deactivated depending on whether
-    the user has edited the content.
-
-    \printuntil }
-
-    Finally, we load a default document \e default.md from the resources.
-
-    \section1 Creating an Index File
-
-    \quotefile webenginewidgets/markdowneditor/resources/index.html
-
-    In the \e index.html, we load a custom stylesheet and two JavaScript
-    libraries. \l{https://bitbucket.org/kevinburke/markdowncss/src/master/}{markdown.css} is
-    a markdown-friendly stylesheet created by Kevin Burke.
-    \l{https://github.com/chjj/marked}{marked.js} is a markdown parser and
-    compiler designed for speed written by Christopher Jeffrey and
-    \e qwebchannel.js is part of the \l{QWebChannel} module.
-
-    In the \c <body> element we first define a \c placeholder element, and
-    make it available as a JavaScript variable. We then define the \c updateText
-    helper method that updates the content of \c placeholder with the HTML
-    that the JavaScript method \c marked() returns.
-
-    Finally, we set up the web channel to access the \c content proxy object
-    and make sure that \c updateText() is called whenever \c content.text
-    changes.
-
-    \section1 Files and Attributions
-
-    The example bundles the following code with third-party licenses:
-
-    \table
-    \row
-        \li \l{markdowneditor-marked}{Marked}
-        \li MIT License
-    \row
-        \li \l{markdowneditor-markdowncss}{Markdown.css}
-        \li Apache License 2.0
-    \endtable
-*/
-
diff --git a/examples/webenginewidgets/markdowneditor/document.cpp b/examples/webenginewidgets/markdowneditor/document.cpp
deleted file mode 100644
index 8ece7650912..00000000000
--- a/examples/webenginewidgets/markdowneditor/document.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "document.h"
-
-void Document::setText(const QString &text)
-{
-    if (text == m_text)
-        return;
-    m_text = text;
-    emit textChanged(m_text);
-}
diff --git a/examples/webenginewidgets/markdowneditor/document.h b/examples/webenginewidgets/markdowneditor/document.h
deleted file mode 100644
index f4eabbdaaac..00000000000
--- a/examples/webenginewidgets/markdowneditor/document.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef DOCUMENT_H
-#define DOCUMENT_H
-
-#include <QObject>
-#include <QString>
-
-class Document : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL)
-public:
-    explicit Document(QObject *parent = nullptr) : QObject(parent) {}
-
-    void setText(const QString &text);
-
-signals:
-    void textChanged(const QString &text);
-
-private:
-    QString m_text;
-};
-
-#endif // DOCUMENT_H
diff --git a/examples/webenginewidgets/markdowneditor/main.cpp b/examples/webenginewidgets/markdowneditor/main.cpp
deleted file mode 100644
index 98e76bfbab4..00000000000
--- a/examples/webenginewidgets/markdowneditor/main.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "document.h"
-#include "mainwindow.h"
-
-#include <QApplication>
-#include <QFile>
-
-int main(int argc, char *argv[])
-{
-    QCoreApplication::setOrganizationName("QtExamples");
-    QApplication a(argc, argv);
-
-    MainWindow window;
-    window.show();
-
-    return a.exec();
-}
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.cpp b/examples/webenginewidgets/markdowneditor/mainwindow.cpp
deleted file mode 100644
index a4ef50a315d..00000000000
--- a/examples/webenginewidgets/markdowneditor/mainwindow.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "mainwindow.h"
-#include "previewpage.h"
-#include "ui_mainwindow.h"
-
-#include <QFile>
-#include <QFileDialog>
-#include <QFontDatabase>
-#include <QMessageBox>
-#include <QStatusBar>
-#include <QTextStream>
-#include <QWebChannel>
-
-MainWindow::MainWindow(QWidget *parent) :
-    QMainWindow(parent),
-    ui(new Ui::MainWindow)
-{
-    ui->setupUi(this);
-    ui->editor->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
-    ui->preview->setContextMenuPolicy(Qt::NoContextMenu);
-
-    PreviewPage *page = new PreviewPage(this);
-    ui->preview->setPage(page);
-
-    connect(ui->editor, &QPlainTextEdit::textChanged,
-            [this]() { m_content.setText(ui->editor->toPlainText()); });
-
-    QWebChannel *channel = new QWebChannel(this);
-    channel->registerObject(QStringLiteral("content"), &m_content);
-    page->setWebChannel(channel);
-
-    ui->preview->setUrl(QUrl("qrc:/index.html"));
-
-    connect(ui->actionNew, &QAction::triggered, this, &MainWindow::onFileNew);
-    connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::onFileOpen);
-    connect(ui->actionSave, &QAction::triggered, this, &MainWindow::onFileSave);
-    connect(ui->actionSaveAs, &QAction::triggered, this, &MainWindow::onFileSaveAs);
-    connect(ui->actionExit, &QAction::triggered, this, &QWidget::close);
-
-    connect(ui->editor->document(), &QTextDocument::modificationChanged,
-            ui->actionSave, &QAction::setEnabled);
-
-    QFile defaultTextFile(":/default.md");
-    defaultTextFile.open(QIODevice::ReadOnly);
-    ui->editor->setPlainText(defaultTextFile.readAll());
-}
-
-MainWindow::~MainWindow()
-{
-    delete ui;
-}
-
-void MainWindow::openFile(const QString &path)
-{
-    QFile f(path);
-    if (!f.open(QIODevice::ReadOnly)) {
-        QMessageBox::warning(this, windowTitle(),
-                             tr("Could not open file %1: %2").arg(
-                                 QDir::toNativeSeparators(path), f.errorString()));
-        return;
-    }
-    m_filePath = path;
-    ui->editor->setPlainText(f.readAll());
-    statusBar()->showMessage(tr("Opened %1").arg(QDir::toNativeSeparators(path)));
-}
-
-bool MainWindow::isModified() const
-{
-    return ui->editor->document()->isModified();
-}
-
-void MainWindow::onFileNew()
-{
-    if (isModified()) {
-        QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(),
-                             tr("You have unsaved changes. Do you want to create a new document anyway?"));
-        if (button != QMessageBox::Yes)
-            return;
-    }
-
-    m_filePath.clear();
-    ui->editor->setPlainText(tr("## New document"));
-    ui->editor->document()->setModified(false);
-}
-
-void MainWindow::onFileOpen()
-{
-    if (isModified()) {
-        QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(),
-                             tr("You have unsaved changes. Do you want to open a new document anyway?"));
-        if (button != QMessageBox::Yes)
-            return;
-    }
-
-    QFileDialog dialog(this, tr("Open MarkDown File"));
-    dialog.setMimeTypeFilters({"text/markdown"});
-    dialog.setAcceptMode(QFileDialog::AcceptOpen);
-    if (dialog.exec() == QDialog::Accepted)
-        openFile(dialog.selectedFiles().constFirst());
-}
-
-void MainWindow::onFileSave()
-{
-    if (m_filePath.isEmpty()) {
-        onFileSaveAs();
-        return;
-    }
-
-    QFile f(m_filePath);
-    if (!f.open(QIODevice::WriteOnly | QIODevice::Text))  {
-        QMessageBox::warning(this, windowTitle(),
-                             tr("Could not write to file %1: %2").arg(
-                                 QDir::toNativeSeparators(m_filePath), f.errorString()));
-        return;
-    }
-    QTextStream str(&f);
-    str << ui->editor->toPlainText();
-
-    ui->editor->document()->setModified(false);
-
-    statusBar()->showMessage(tr("Wrote %1").arg(QDir::toNativeSeparators(m_filePath)));
-}
-
-void MainWindow::onFileSaveAs()
-{
-    QFileDialog dialog(this, tr("Save MarkDown File"));
-    dialog.setMimeTypeFilters({"text/markdown"});
-    dialog.setAcceptMode(QFileDialog::AcceptSave);
-    dialog.setDefaultSuffix("md");
-    if (dialog.exec() != QDialog::Accepted)
-        return;
-
-    m_filePath = dialog.selectedFiles().constFirst();
-    onFileSave();
-}
-
-void MainWindow::closeEvent(QCloseEvent *e)
-{
-    if (isModified()) {
-        QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(),
-                             tr("You have unsaved changes. Do you want to exit anyway?"));
-        if (button != QMessageBox::Yes)
-            e->ignore();
-    }
-}
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.h b/examples/webenginewidgets/markdowneditor/mainwindow.h
deleted file mode 100644
index 271664852f1..00000000000
--- a/examples/webenginewidgets/markdowneditor/mainwindow.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include "document.h"
-
-#include <QMainWindow>
-#include <QString>
-
-QT_BEGIN_NAMESPACE
-namespace Ui {
-class MainWindow;
-}
-QT_END_NAMESPACE
-
-class MainWindow : public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    explicit MainWindow(QWidget *parent = nullptr);
-    ~MainWindow();
-
-    void openFile(const QString &path);
-
-protected:
-    void closeEvent(QCloseEvent *e) override;
-
-private slots:
-    void onFileNew();
-    void onFileOpen();
-    void onFileSave();
-    void onFileSaveAs();
-
-private:
-    bool isModified() const;
-
-    Ui::MainWindow *ui;
-    QString m_filePath;
-    Document m_content;
-};
-
-#endif // MAINWINDOW_H
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.ui b/examples/webenginewidgets/markdowneditor/mainwindow.ui
deleted file mode 100644
index 36ab352b7a5..00000000000
--- a/examples/webenginewidgets/markdowneditor/mainwindow.ui
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>800</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>MarkDown Editor</string>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <layout class="QHBoxLayout" name="horizontalLayout">
-    <item>
-     <widget class="QSplitter" name="splitter">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <widget class="QPlainTextEdit" name="editor"/>
-      <widget class="QWebEngineView" name="preview" native="true"/>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>800</width>
-     <height>26</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menu_File">
-    <property name="title">
-     <string>&amp;File</string>
-    </property>
-    <addaction name="actionNew"/>
-    <addaction name="actionOpen"/>
-    <addaction name="actionSave"/>
-    <addaction name="actionSaveAs"/>
-    <addaction name="separator"/>
-    <addaction name="actionExit"/>
-   </widget>
-   <addaction name="menu_File"/>
-  </widget>
-  <widget class="QStatusBar" name="statusbar"/>
-  <action name="actionOpen">
-   <property name="text">
-    <string>&amp;Open...</string>
-   </property>
-   <property name="toolTip">
-    <string>Open document</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+O</string>
-   </property>
-  </action>
-  <action name="actionSave">
-   <property name="text">
-    <string>&amp;Save</string>
-   </property>
-   <property name="toolTip">
-    <string>Save current document</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+S</string>
-   </property>
-  </action>
-  <action name="actionExit">
-   <property name="text">
-    <string>E&amp;xit</string>
-   </property>
-   <property name="toolTip">
-    <string>Exit editor</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Q</string>
-   </property>
-  </action>
-  <action name="actionSaveAs">
-   <property name="text">
-    <string>Save &amp;As...</string>
-   </property>
-   <property name="toolTip">
-    <string>Save document under different name</string>
-   </property>
-  </action>
-  <action name="actionNew">
-   <property name="text">
-    <string>&amp;New</string>
-   </property>
-   <property name="toolTip">
-    <string>Create new document</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+N</string>
-   </property>
-  </action>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QWebEngineView</class>
-   <extends>QWidget</extends>
-   <header>qwebengineview.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/examples/webenginewidgets/markdowneditor/markdowneditor.pro b/examples/webenginewidgets/markdowneditor/markdowneditor.pro
deleted file mode 100644
index 099edf4b518..00000000000
--- a/examples/webenginewidgets/markdowneditor/markdowneditor.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-TEMPLATE = app
-
-QT += webenginewidgets webchannel
-
-HEADERS += \
-    mainwindow.h \
-    previewpage.h \
-    document.h
-
-SOURCES = \
-    main.cpp \
-    mainwindow.cpp \
-    previewpage.cpp \
-    document.cpp
-
-RESOURCES = \
-    resources/markdowneditor.qrc
-
-# Disable Qt Quick compiler because the example doesn't use QML, but more importantly so that
-# the source code of the .js files is not removed from the embedded qrc file.
-CONFIG -= qtquickcompiler
-
-FORMS += \
-    mainwindow.ui
-
-DISTFILES += \
-    resources/3rdparty/MARKDOWN-LICENSE.txt \
-    resources/3rdparty/MARKED-LICENSE.txt
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/markdowneditor
-INSTALLS += target
diff --git a/examples/webenginewidgets/markdowneditor/previewpage.cpp b/examples/webenginewidgets/markdowneditor/previewpage.cpp
deleted file mode 100644
index 17249fdb0f3..00000000000
--- a/examples/webenginewidgets/markdowneditor/previewpage.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "previewpage.h"
-
-#include <QDesktopServices>
-
-bool PreviewPage::acceptNavigationRequest(const QUrl &url,
-                                          QWebEnginePage::NavigationType /*type*/,
-                                          bool /*isMainFrame*/)
-{
-    // Only allow qrc:/index.html.
-    if (url.scheme() == QString("qrc"))
-        return true;
-    QDesktopServices::openUrl(url);
-    return false;
-}
diff --git a/examples/webenginewidgets/markdowneditor/previewpage.h b/examples/webenginewidgets/markdowneditor/previewpage.h
deleted file mode 100644
index 4a5d98c7c9f..00000000000
--- a/examples/webenginewidgets/markdowneditor/previewpage.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef PREVIEWPAGE_H
-#define PREVIEWPAGE_H
-
-#include <QWebEnginePage>
-
-class PreviewPage : public QWebEnginePage
-{
-    Q_OBJECT
-public:
-    using QWebEnginePage::QWebEnginePage;
-
-protected:
-    bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override;
-};
-
-#endif // PREVIEWPAGE_H
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt b/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt
deleted file mode 100644
index 23c52cc4311..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Copyright 2011 Kevin Burke unless otherwise noted.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Some content is copyrighted by Twitter, Inc., and also released under an
-Apache License; these sections are noted in the source.
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt b/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt
deleted file mode 100644
index 8e3ba0e0a76..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css b/examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css
deleted file mode 100644
index 24fc2ffe2fb..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css
+++ /dev/null
@@ -1,260 +0,0 @@
-body{
-    margin: 0 auto;
-    font-family: Georgia, Palatino, serif;
-    color: #444444;
-    line-height: 1;
-    max-width: 960px;
-    padding: 30px;
-}
-h1, h2, h3, h4 {
-    color: #111111;
-    font-weight: 400;
-}
-h1, h2, h3, h4, h5, p {
-    margin-bottom: 24px;
-    padding: 0;
-}
-h1 {
-    font-size: 48px;
-}
-h2 {
-    font-size: 36px;
-    /* The bottom margin is small. It's designed to be used with gray meta text
-     * below a post title. */
-    margin: 24px 0 6px;
-}
-h3 {
-    font-size: 24px;
-}
-h4 {
-    font-size: 21px;
-}
-h5 {
-    font-size: 18px;
-}
-a {
-    color: #0099ff;
-    margin: 0;
-    padding: 0;
-    vertical-align: baseline;
-}
-a:hover {
-    text-decoration: none;
-    color: #ff6600;
-}
-a:visited {
-    color: purple;
-}
-ul, ol {
-    padding: 0;
-    margin: 0;
-}
-li {
-    line-height: 24px;
-}
-li ul, li ul {
-    margin-left: 24px;
-}
-p, ul, ol {
-    font-size: 16px;
-    line-height: 24px;
-    max-width: 540px;
-}
-pre {
-    padding: 0px 24px;
-    max-width: 800px;
-    white-space: pre-wrap;
-}
-code {
-    font-family: Consolas, Monaco, Andale Mono, monospace;
-    line-height: 1.5;
-    font-size: 13px;
-}
-aside {
-    display: block;
-    float: right;
-    width: 390px;
-}
-blockquote {
-    border-left:.5em solid #eee;
-    padding: 0 2em;
-    margin-left:0;
-    max-width: 476px;
-}
-blockquote  cite {
-    font-size:14px;
-    line-height:20px;
-    color:#bfbfbf;
-}
-blockquote cite:before {
-    content: '\2014 \00A0';
-}
-
-blockquote p {
-    color: #666;
-    max-width: 460px;
-}
-hr {
-    width: 540px;
-    text-align: left;
-    margin: 0 auto 0 0;
-    color: #999;
-}
-
-/* Code below this line is copyright Twitter Inc. */
-
-button,
-input,
-select,
-textarea {
-  font-size: 100%;
-  margin: 0;
-  vertical-align: baseline;
-  *vertical-align: middle;
-}
-button, input {
-  line-height: normal;
-  *overflow: visible;
-}
-button::-moz-focus-inner, input::-moz-focus-inner {
-  border: 0;
-  padding: 0;
-}
-button,
-input[type="button"],
-input[type="reset"],
-input[type="submit"] {
-  cursor: pointer;
-  -webkit-appearance: button;
-}
-input[type=checkbox], input[type=radio] {
-  cursor: pointer;
-}
-/* override default chrome & firefox settings */
-input:not([type="image"]), textarea {
-  -webkit-box-sizing: content-box;
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-
-input[type="search"] {
-  -webkit-appearance: textfield;
-  -webkit-box-sizing: content-box;
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-input[type="search"]::-webkit-search-decoration {
-  -webkit-appearance: none;
-}
-label,
-input,
-select,
-textarea {
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  font-weight: normal;
-  line-height: normal;
-  margin-bottom: 18px;
-}
-input[type=checkbox], input[type=radio] {
-  cursor: pointer;
-  margin-bottom: 0;
-}
-input[type=text],
-input[type=password],
-textarea,
-select {
-  display: inline-block;
-  width: 210px;
-  padding: 4px;
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 18px;
-  height: 18px;
-  color: #808080;
-  border: 1px solid #ccc;
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-}
-select, input[type=file] {
-  height: 27px;
-  line-height: 27px;
-}
-textarea {
-  height: auto;
-}
-
-/* grey out placeholders */
-:-moz-placeholder {
-  color: #bfbfbf;
-}
-::-webkit-input-placeholder {
-  color: #bfbfbf;
-}
-
-input[type=text],
-input[type=password],
-select,
-textarea {
-  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-  -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-  transition: border linear 0.2s, box-shadow linear 0.2s;
-  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-}
-input[type=text]:focus, input[type=password]:focus, textarea:focus {
-  outline: none;
-  border-color: rgba(82, 168, 236, 0.8);
-  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
-  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
-  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
-}
-
-/* buttons */
-button {
-  display: inline-block;
-  padding: 4px 14px;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  line-height: 18px;
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-  background-color: #0064cd;
-  background-repeat: repeat-x;
-  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
-  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
-  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
-  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
-  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
-  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
-  background-image: linear-gradient(top, #049cdb, #0064cd);
-  color: #fff;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-  border: 1px solid #004b9a;
-  border-bottom-color: #003f81;
-  -webkit-transition: 0.1s linear all;
-  -moz-transition: 0.1s linear all;
-  transition: 0.1s linear all;
-  border-color: #0064cd #0064cd #003f81;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-}
-button:hover {
-  color: #fff;
-  background-position: 0 -15px;
-  text-decoration: none;
-}
-button:active {
-  -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-  -moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-button::-moz-focus-inner {
-  padding: 0;
-  border: 0;
-}
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js b/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js
deleted file mode 100644
index 33c02d9cf41..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js
+++ /dev/null
@@ -1,1514 +0,0 @@
-/**
- * marked - a markdown parser
- * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
- * https://github.com/markedjs/marked
- */
-
-;(function(root) {
-'use strict';
-
-/**
- * Block-Level Grammar
- */
-
-var block = {
-  newline: /^\n+/,
-  code: /^( {4}[^\n]+\n*)+/,
-  fences: noop,
-  hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
-  heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
-  nptable: noop,
-  blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
-  list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
-  html: '^ {0,3}(?:' // optional indentation
-    + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
-    + '|comment[^\\n]*(\\n+|$)' // (2)
-    + '|<\\?[\\s\\S]*?\\?>\\n*' // (3)
-    + '|<![A-Z][\\s\\S]*?>\\n*' // (4)
-    + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*' // (5)
-    + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
-    + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
-    + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
-    + ')',
-  def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
-  table: noop,
-  lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
-  paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,
-  text: /^[^\n]+/
-};
-
-block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
-block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
-block.def = edit(block.def)
-  .replace('label', block._label)
-  .replace('title', block._title)
-  .getRegex();
-
-block.bullet = /(?:[*+-]|\d+\.)/;
-block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
-block.item = edit(block.item, 'gm')
-  .replace(/bull/g, block.bullet)
-  .getRegex();
-
-block.list = edit(block.list)
-  .replace(/bull/g, block.bullet)
-  .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
-  .replace('def', '\\n+(?=' + block.def.source + ')')
-  .getRegex();
-
-block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
-  + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
-  + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
-  + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
-  + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
-  + '|track|ul';
-block._comment = /<!--(?!-?>)[\s\S]*?-->/;
-block.html = edit(block.html, 'i')
-  .replace('comment', block._comment)
-  .replace('tag', block._tag)
-  .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
-  .getRegex();
-
-block.paragraph = edit(block.paragraph)
-  .replace('hr', block.hr)
-  .replace('heading', block.heading)
-  .replace('lheading', block.lheading)
-  .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
-  .getRegex();
-
-block.blockquote = edit(block.blockquote)
-  .replace('paragraph', block.paragraph)
-  .getRegex();
-
-/**
- * Normal Block Grammar
- */
-
-block.normal = merge({}, block);
-
-/**
- * GFM Block Grammar
- */
-
-block.gfm = merge({}, block.normal, {
-  fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,
-  paragraph: /^/,
-  heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
-});
-
-block.gfm.paragraph = edit(block.paragraph)
-  .replace('(?!', '(?!'
-    + block.gfm.fences.source.replace('\\1', '\\2') + '|'
-    + block.list.source.replace('\\1', '\\3') + '|')
-  .getRegex();
-
-/**
- * GFM + Tables Block Grammar
- */
-
-block.tables = merge({}, block.gfm, {
-  nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,
-  table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
-});
-
-/**
- * Pedantic grammar
- */
-
-block.pedantic = merge({}, block.normal, {
-  html: edit(
-    '^ *(?:comment *(?:\\n|\\s*$)'
-    + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
-    + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
-    .replace('comment', block._comment)
-    .replace(/tag/g, '(?!(?:'
-      + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
-      + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
-      + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
-    .getRegex(),
-  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/
-});
-
-/**
- * Block Lexer
- */
-
-function Lexer(options) {
-  this.tokens = [];
-  this.tokens.links = {};
-  this.options = options || marked.defaults;
-  this.rules = block.normal;
-
-  if (this.options.pedantic) {
-    this.rules = block.pedantic;
-  } else if (this.options.gfm) {
-    if (this.options.tables) {
-      this.rules = block.tables;
-    } else {
-      this.rules = block.gfm;
-    }
-  }
-}
-
-/**
- * Expose Block Rules
- */
-
-Lexer.rules = block;
-
-/**
- * Static Lex Method
- */
-
-Lexer.lex = function(src, options) {
-  var lexer = new Lexer(options);
-  return lexer.lex(src);
-};
-
-/**
- * Preprocessing
- */
-
-Lexer.prototype.lex = function(src) {
-  src = src
-    .replace(/\r\n|\r/g, '\n')
-    .replace(/\t/g, '    ')
-    .replace(/\u00a0/g, ' ')
-    .replace(/\u2424/g, '\n');
-
-  return this.token(src, true);
-};
-
-/**
- * Lexing
- */
-
-Lexer.prototype.token = function(src, top) {
-  src = src.replace(/^ +$/gm, '');
-  var next,
-      loose,
-      cap,
-      bull,
-      b,
-      item,
-      space,
-      i,
-      tag,
-      l,
-      isordered,
-      istask,
-      ischecked;
-
-  while (src) {
-    // newline
-    if (cap = this.rules.newline.exec(src)) {
-      src = src.substring(cap[0].length);
-      if (cap[0].length > 1) {
-        this.tokens.push({
-          type: 'space'
-        });
-      }
-    }
-
-    // code
-    if (cap = this.rules.code.exec(src)) {
-      src = src.substring(cap[0].length);
-      cap = cap[0].replace(/^ {4}/gm, '');
-      this.tokens.push({
-        type: 'code',
-        text: !this.options.pedantic
-          ? cap.replace(/\n+$/, '')
-          : cap
-      });
-      continue;
-    }
-
-    // fences (gfm)
-    if (cap = this.rules.fences.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'code',
-        lang: cap[2],
-        text: cap[3] || ''
-      });
-      continue;
-    }
-
-    // heading
-    if (cap = this.rules.heading.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'heading',
-        depth: cap[1].length,
-        text: cap[2]
-      });
-      continue;
-    }
-
-    // table no leading pipe (gfm)
-    if (top && (cap = this.rules.nptable.exec(src))) {
-      item = {
-        type: 'table',
-        header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
-        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
-        cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
-      };
-
-      if (item.header.length === item.align.length) {
-        src = src.substring(cap[0].length);
-
-        for (i = 0; i < item.align.length; i++) {
-          if (/^ *-+: *$/.test(item.align[i])) {
-            item.align[i] = 'right';
-          } else if (/^ *:-+: *$/.test(item.align[i])) {
-            item.align[i] = 'center';
-          } else if (/^ *:-+ *$/.test(item.align[i])) {
-            item.align[i] = 'left';
-          } else {
-            item.align[i] = null;
-          }
-        }
-
-        for (i = 0; i < item.cells.length; i++) {
-          item.cells[i] = splitCells(item.cells[i], item.header.length);
-        }
-
-        this.tokens.push(item);
-
-        continue;
-      }
-    }
-
-    // hr
-    if (cap = this.rules.hr.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'hr'
-      });
-      continue;
-    }
-
-    // blockquote
-    if (cap = this.rules.blockquote.exec(src)) {
-      src = src.substring(cap[0].length);
-
-      this.tokens.push({
-        type: 'blockquote_start'
-      });
-
-      cap = cap[0].replace(/^ *> ?/gm, '');
-
-      // Pass `top` to keep the current
-      // "toplevel" state. This is exactly
-      // how markdown.pl works.
-      this.token(cap, top);
-
-      this.tokens.push({
-        type: 'blockquote_end'
-      });
-
-      continue;
-    }
-
-    // list
-    if (cap = this.rules.list.exec(src)) {
-      src = src.substring(cap[0].length);
-      bull = cap[2];
-      isordered = bull.length > 1;
-
-      this.tokens.push({
-        type: 'list_start',
-        ordered: isordered,
-        start: isordered ? +bull : ''
-      });
-
-      // Get each top-level item.
-      cap = cap[0].match(this.rules.item);
-
-      next = false;
-      l = cap.length;
-      i = 0;
-
-      for (; i < l; i++) {
-        item = cap[i];
-
-        // Remove the list item's bullet
-        // so it is seen as the next token.
-        space = item.length;
-        item = item.replace(/^ *([*+-]|\d+\.) +/, '');
-
-        // Outdent whatever the
-        // list item contains. Hacky.
-        if (~item.indexOf('\n ')) {
-          space -= item.length;
-          item = !this.options.pedantic
-            ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
-            : item.replace(/^ {1,4}/gm, '');
-        }
-
-        // Determine whether the next list item belongs here.
-        // Backpedal if it does not belong in this list.
-        if (this.options.smartLists && i !== l - 1) {
-          b = block.bullet.exec(cap[i + 1])[0];
-          if (bull !== b && !(bull.length > 1 && b.length > 1)) {
-            src = cap.slice(i + 1).join('\n') + src;
-            i = l - 1;
-          }
-        }
-
-        // Determine whether item is loose or not.
-        // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
-        // for discount behavior.
-        loose = next || /\n\n(?!\s*$)/.test(item);
-        if (i !== l - 1) {
-          next = item.charAt(item.length - 1) === '\n';
-          if (!loose) loose = next;
-        }
-
-        // Check for task list items
-        istask = /^\[[ xX]\] /.test(item);
-        ischecked = undefined;
-        if (istask) {
-          ischecked = item[1] !== ' ';
-          item = item.replace(/^\[[ xX]\] +/, '');
-        }
-
-        this.tokens.push({
-          type: loose
-            ? 'loose_item_start'
-            : 'list_item_start',
-          task: istask,
-          checked: ischecked
-        });
-
-        // Recurse.
-        this.token(item, false);
-
-        this.tokens.push({
-          type: 'list_item_end'
-        });
-      }
-
-      this.tokens.push({
-        type: 'list_end'
-      });
-
-      continue;
-    }
-
-    // html
-    if (cap = this.rules.html.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: this.options.sanitize
-          ? 'paragraph'
-          : 'html',
-        pre: !this.options.sanitizer
-          && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
-        text: cap[0]
-      });
-      continue;
-    }
-
-    // def
-    if (top && (cap = this.rules.def.exec(src))) {
-      src = src.substring(cap[0].length);
-      if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
-      tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
-      if (!this.tokens.links[tag]) {
-        this.tokens.links[tag] = {
-          href: cap[2],
-          title: cap[3]
-        };
-      }
-      continue;
-    }
-
-    // table (gfm)
-    if (top && (cap = this.rules.table.exec(src))) {
-      item = {
-        type: 'table',
-        header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
-        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
-        cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : []
-      };
-
-      if (item.header.length === item.align.length) {
-        src = src.substring(cap[0].length);
-
-        for (i = 0; i < item.align.length; i++) {
-          if (/^ *-+: *$/.test(item.align[i])) {
-            item.align[i] = 'right';
-          } else if (/^ *:-+: *$/.test(item.align[i])) {
-            item.align[i] = 'center';
-          } else if (/^ *:-+ *$/.test(item.align[i])) {
-            item.align[i] = 'left';
-          } else {
-            item.align[i] = null;
-          }
-        }
-
-        for (i = 0; i < item.cells.length; i++) {
-          item.cells[i] = splitCells(
-            item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
-            item.header.length);
-        }
-
-        this.tokens.push(item);
-
-        continue;
-      }
-    }
-
-    // lheading
-    if (cap = this.rules.lheading.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'heading',
-        depth: cap[2] === '=' ? 1 : 2,
-        text: cap[1]
-      });
-      continue;
-    }
-
-    // top-level paragraph
-    if (top && (cap = this.rules.paragraph.exec(src))) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'paragraph',
-        text: cap[1].charAt(cap[1].length - 1) === '\n'
-          ? cap[1].slice(0, -1)
-          : cap[1]
-      });
-      continue;
-    }
-
-    // text
-    if (cap = this.rules.text.exec(src)) {
-      // Top-level should never reach here.
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'text',
-        text: cap[0]
-      });
-      continue;
-    }
-
-    if (src) {
-      throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
-    }
-  }
-
-  return this.tokens;
-};
-
-/**
- * Inline-Level Grammar
- */
-
-var inline = {
-  escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
-  autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
-  url: noop,
-  tag: '^comment'
-    + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
-    + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
-    + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
-    + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
-    + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
-  link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,
-  reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
-  nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
-  strong: /^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,
-  em: /^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,
-  code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,
-  br: /^ {2,}\n(?!\s*$)/,
-  del: noop,
-  text: /^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/
-};
-
-inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
-
-inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
-inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
-inline.autolink = edit(inline.autolink)
-  .replace('scheme', inline._scheme)
-  .replace('email', inline._email)
-  .getRegex();
-
-inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
-
-inline.tag = edit(inline.tag)
-  .replace('comment', block._comment)
-  .replace('attribute', inline._attribute)
-  .getRegex();
-
-inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/;
-inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/;
-inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
-
-inline.link = edit(inline.link)
-  .replace('label', inline._label)
-  .replace('href', inline._href)
-  .replace('title', inline._title)
-  .getRegex();
-
-inline.reflink = edit(inline.reflink)
-  .replace('label', inline._label)
-  .getRegex();
-
-/**
- * Normal Inline Grammar
- */
-
-inline.normal = merge({}, inline);
-
-/**
- * Pedantic Inline Grammar
- */
-
-inline.pedantic = merge({}, inline.normal, {
-  strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
-  em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,
-  link: edit(/^!?\[(label)\]\((.*?)\)/)
-    .replace('label', inline._label)
-    .getRegex(),
-  reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
-    .replace('label', inline._label)
-    .getRegex()
-});
-
-/**
- * GFM Inline Grammar
- */
-
-inline.gfm = merge({}, inline.normal, {
-  escape: edit(inline.escape).replace('])', '~|])').getRegex(),
-  url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/)
-    .replace('email', inline._email)
-    .getRegex(),
-  _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
-  del: /^~~(?=\S)([\s\S]*?\S)~~/,
-  text: edit(inline.text)
-    .replace(']|', '~]|')
-    .replace('|', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|')
-    .getRegex()
-});
-
-/**
- * GFM + Line Breaks Inline Grammar
- */
-
-inline.breaks = merge({}, inline.gfm, {
-  br: edit(inline.br).replace('{2,}', '*').getRegex(),
-  text: edit(inline.gfm.text).replace('{2,}', '*').getRegex()
-});
-
-/**
- * Inline Lexer & Compiler
- */
-
-function InlineLexer(links, options) {
-  this.options = options || marked.defaults;
-  this.links = links;
-  this.rules = inline.normal;
-  this.renderer = this.options.renderer || new Renderer();
-  this.renderer.options = this.options;
-
-  if (!this.links) {
-    throw new Error('Tokens array requires a `links` property.');
-  }
-
-  if (this.options.pedantic) {
-    this.rules = inline.pedantic;
-  } else if (this.options.gfm) {
-    if (this.options.breaks) {
-      this.rules = inline.breaks;
-    } else {
-      this.rules = inline.gfm;
-    }
-  }
-}
-
-/**
- * Expose Inline Rules
- */
-
-InlineLexer.rules = inline;
-
-/**
- * Static Lexing/Compiling Method
- */
-
-InlineLexer.output = function(src, links, options) {
-  var inline = new InlineLexer(links, options);
-  return inline.output(src);
-};
-
-/**
- * Lexing/Compiling
- */
-
-InlineLexer.prototype.output = function(src) {
-  var out = '',
-      link,
-      text,
-      href,
-      title,
-      cap;
-
-  while (src) {
-    // escape
-    if (cap = this.rules.escape.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += cap[1];
-      continue;
-    }
-
-    // autolink
-    if (cap = this.rules.autolink.exec(src)) {
-      src = src.substring(cap[0].length);
-      if (cap[2] === '@') {
-        text = escape(this.mangle(cap[1]));
-        href = 'mailto:' + text;
-      } else {
-        text = escape(cap[1]);
-        href = text;
-      }
-      out += this.renderer.link(href, null, text);
-      continue;
-    }
-
-    // url (gfm)
-    if (!this.inLink && (cap = this.rules.url.exec(src))) {
-      cap[0] = this.rules._backpedal.exec(cap[0])[0];
-      src = src.substring(cap[0].length);
-      if (cap[2] === '@') {
-        text = escape(cap[0]);
-        href = 'mailto:' + text;
-      } else {
-        text = escape(cap[0]);
-        if (cap[1] === 'www.') {
-          href = 'http://' + text;
-        } else {
-          href = text;
-        }
-      }
-      out += this.renderer.link(href, null, text);
-      continue;
-    }
-
-    // tag
-    if (cap = this.rules.tag.exec(src)) {
-      if (!this.inLink && /^<a /i.test(cap[0])) {
-        this.inLink = true;
-      } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
-        this.inLink = false;
-      }
-      src = src.substring(cap[0].length);
-      out += this.options.sanitize
-        ? this.options.sanitizer
-          ? this.options.sanitizer(cap[0])
-          : escape(cap[0])
-        : cap[0]
-      continue;
-    }
-
-    // link
-    if (cap = this.rules.link.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.inLink = true;
-      href = cap[2];
-      if (this.options.pedantic) {
-        link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
-
-        if (link) {
-          href = link[1];
-          title = link[3];
-        } else {
-          title = '';
-        }
-      } else {
-        title = cap[3] ? cap[3].slice(1, -1) : '';
-      }
-      href = href.trim().replace(/^<([\s\S]*)>$/, '$1');
-      out += this.outputLink(cap, {
-        href: InlineLexer.escapes(href),
-        title: InlineLexer.escapes(title)
-      });
-      this.inLink = false;
-      continue;
-    }
-
-    // reflink, nolink
-    if ((cap = this.rules.reflink.exec(src))
-        || (cap = this.rules.nolink.exec(src))) {
-      src = src.substring(cap[0].length);
-      link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
-      link = this.links[link.toLowerCase()];
-      if (!link || !link.href) {
-        out += cap[0].charAt(0);
-        src = cap[0].substring(1) + src;
-        continue;
-      }
-      this.inLink = true;
-      out += this.outputLink(cap, link);
-      this.inLink = false;
-      continue;
-    }
-
-    // strong
-    if (cap = this.rules.strong.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));
-      continue;
-    }
-
-    // em
-    if (cap = this.rules.em.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));
-      continue;
-    }
-
-    // code
-    if (cap = this.rules.code.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.codespan(escape(cap[2].trim(), true));
-      continue;
-    }
-
-    // br
-    if (cap = this.rules.br.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.br();
-      continue;
-    }
-
-    // del (gfm)
-    if (cap = this.rules.del.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.del(this.output(cap[1]));
-      continue;
-    }
-
-    // text
-    if (cap = this.rules.text.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.text(escape(this.smartypants(cap[0])));
-      continue;
-    }
-
-    if (src) {
-      throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
-    }
-  }
-
-  return out;
-};
-
-InlineLexer.escapes = function(text) {
-  return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;
-}
-
-/**
- * Compile Link
- */
-
-InlineLexer.prototype.outputLink = function(cap, link) {
-  var href = link.href,
-      title = link.title ? escape(link.title) : null;
-
-  return cap[0].charAt(0) !== '!'
-    ? this.renderer.link(href, title, this.output(cap[1]))
-    : this.renderer.image(href, title, escape(cap[1]));
-};
-
-/**
- * Smartypants Transformations
- */
-
-InlineLexer.prototype.smartypants = function(text) {
-  if (!this.options.smartypants) return text;
-  return text
-    // em-dashes
-    .replace(/---/g, '\u2014')
-    // en-dashes
-    .replace(/--/g, '\u2013')
-    // opening singles
-    .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
-    // closing singles & apostrophes
-    .replace(/'/g, '\u2019')
-    // opening doubles
-    .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
-    // closing doubles
-    .replace(/"/g, '\u201d')
-    // ellipses
-    .replace(/\.{3}/g, '\u2026');
-};
-
-/**
- * Mangle Links
- */
-
-InlineLexer.prototype.mangle = function(text) {
-  if (!this.options.mangle) return text;
-  var out = '',
-      l = text.length,
-      i = 0,
-      ch;
-
-  for (; i < l; i++) {
-    ch = text.charCodeAt(i);
-    if (Math.random() > 0.5) {
-      ch = 'x' + ch.toString(16);
-    }
-    out += '&#' + ch + ';';
-  }
-
-  return out;
-};
-
-/**
- * Renderer
- */
-
-function Renderer(options) {
-  this.options = options || marked.defaults;
-}
-
-Renderer.prototype.code = function(code, lang, escaped) {
-  if (this.options.highlight) {
-    var out = this.options.highlight(code, lang);
-    if (out != null && out !== code) {
-      escaped = true;
-      code = out;
-    }
-  }
-
-  if (!lang) {
-    return '<pre><code>'
-      + (escaped ? code : escape(code, true))
-      + '</code></pre>';
-  }
-
-  return '<pre><code class="'
-    + this.options.langPrefix
-    + escape(lang, true)
-    + '">'
-    + (escaped ? code : escape(code, true))
-    + '</code></pre>\n';
-};
-
-Renderer.prototype.blockquote = function(quote) {
-  return '<blockquote>\n' + quote + '</blockquote>\n';
-};
-
-Renderer.prototype.html = function(html) {
-  return html;
-};
-
-Renderer.prototype.heading = function(text, level, raw) {
-  if (this.options.headerIds) {
-    return '<h'
-      + level
-      + ' id="'
-      + this.options.headerPrefix
-      + raw.toLowerCase().replace(/[^\w]+/g, '-')
-      + '">'
-      + text
-      + '</h'
-      + level
-      + '>\n';
-  }
-  // ignore IDs
-  return '<h' + level + '>' + text + '</h' + level + '>\n';
-};
-
-Renderer.prototype.hr = function() {
-  return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
-};
-
-Renderer.prototype.list = function(body, ordered, start) {
-  var type = ordered ? 'ol' : 'ul',
-      startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
-  return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
-};
-
-Renderer.prototype.listitem = function(text) {
-  return '<li>' + text + '</li>\n';
-};
-
-Renderer.prototype.checkbox = function(checked) {
-  return '<input '
-    + (checked ? 'checked="" ' : '')
-    + 'disabled="" type="checkbox"'
-    + (this.options.xhtml ? ' /' : '')
-    + '> ';
-}
-
-Renderer.prototype.paragraph = function(text) {
-  return '<p>' + text + '</p>\n';
-};
-
-Renderer.prototype.table = function(header, body) {
-  if (body) body = '<tbody>' + body + '</tbody>';
-
-  return '<table>\n'
-    + '<thead>\n'
-    + header
-    + '</thead>\n'
-    + body
-    + '</table>\n';
-};
-
-Renderer.prototype.tablerow = function(content) {
-  return '<tr>\n' + content + '</tr>\n';
-};
-
-Renderer.prototype.tablecell = function(content, flags) {
-  var type = flags.header ? 'th' : 'td';
-  var tag = flags.align
-    ? '<' + type + ' align="' + flags.align + '">'
-    : '<' + type + '>';
-  return tag + content + '</' + type + '>\n';
-};
-
-// span level renderer
-Renderer.prototype.strong = function(text) {
-  return '<strong>' + text + '</strong>';
-};
-
-Renderer.prototype.em = function(text) {
-  return '<em>' + text + '</em>';
-};
-
-Renderer.prototype.codespan = function(text) {
-  return '<code>' + text + '</code>';
-};
-
-Renderer.prototype.br = function() {
-  return this.options.xhtml ? '<br/>' : '<br>';
-};
-
-Renderer.prototype.del = function(text) {
-  return '<del>' + text + '</del>';
-};
-
-Renderer.prototype.link = function(href, title, text) {
-  if (this.options.sanitize) {
-    try {
-      var prot = decodeURIComponent(unescape(href))
-        .replace(/[^\w:]/g, '')
-        .toLowerCase();
-    } catch (e) {
-      return text;
-    }
-    if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
-      return text;
-    }
-  }
-  if (this.options.baseUrl && !originIndependentUrl.test(href)) {
-    href = resolveUrl(this.options.baseUrl, href);
-  }
-  try {
-    href = encodeURI(href).replace(/%25/g, '%');
-  } catch (e) {
-    return text;
-  }
-  var out = '<a href="' + escape(href) + '"';
-  if (title) {
-    out += ' title="' + title + '"';
-  }
-  out += '>' + text + '</a>';
-  return out;
-};
-
-Renderer.prototype.image = function(href, title, text) {
-  if (this.options.baseUrl && !originIndependentUrl.test(href)) {
-    href = resolveUrl(this.options.baseUrl, href);
-  }
-  var out = '<img src="' + href + '" alt="' + text + '"';
-  if (title) {
-    out += ' title="' + title + '"';
-  }
-  out += this.options.xhtml ? '/>' : '>';
-  return out;
-};
-
-Renderer.prototype.text = function(text) {
-  return text;
-};
-
-/**
- * TextRenderer
- * returns only the textual part of the token
- */
-
-function TextRenderer() {}
-
-// no need for block level renderers
-
-TextRenderer.prototype.strong =
-TextRenderer.prototype.em =
-TextRenderer.prototype.codespan =
-TextRenderer.prototype.del =
-TextRenderer.prototype.text = function (text) {
-  return text;
-}
-
-TextRenderer.prototype.link =
-TextRenderer.prototype.image = function(href, title, text) {
-  return '' + text;
-}
-
-TextRenderer.prototype.br = function() {
-  return '';
-}
-
-/**
- * Parsing & Compiling
- */
-
-function Parser(options) {
-  this.tokens = [];
-  this.token = null;
-  this.options = options || marked.defaults;
-  this.options.renderer = this.options.renderer || new Renderer();
-  this.renderer = this.options.renderer;
-  this.renderer.options = this.options;
-}
-
-/**
- * Static Parse Method
- */
-
-Parser.parse = function(src, options) {
-  var parser = new Parser(options);
-  return parser.parse(src);
-};
-
-/**
- * Parse Loop
- */
-
-Parser.prototype.parse = function(src) {
-  this.inline = new InlineLexer(src.links, this.options);
-  // use an InlineLexer with a TextRenderer to extract pure text
-  this.inlineText = new InlineLexer(
-    src.links,
-    merge({}, this.options, {renderer: new TextRenderer()})
-  );
-  this.tokens = src.reverse();
-
-  var out = '';
-  while (this.next()) {
-    out += this.tok();
-  }
-
-  return out;
-};
-
-/**
- * Next Token
- */
-
-Parser.prototype.next = function() {
-  return this.token = this.tokens.pop();
-};
-
-/**
- * Preview Next Token
- */
-
-Parser.prototype.peek = function() {
-  return this.tokens[this.tokens.length - 1] || 0;
-};
-
-/**
- * Parse Text Tokens
- */
-
-Parser.prototype.parseText = function() {
-  var body = this.token.text;
-
-  while (this.peek().type === 'text') {
-    body += '\n' + this.next().text;
-  }
-
-  return this.inline.output(body);
-};
-
-/**
- * Parse Current Token
- */
-
-Parser.prototype.tok = function() {
-  switch (this.token.type) {
-    case 'space': {
-      return '';
-    }
-    case 'hr': {
-      return this.renderer.hr();
-    }
-    case 'heading': {
-      return this.renderer.heading(
-        this.inline.output(this.token.text),
-        this.token.depth,
-        unescape(this.inlineText.output(this.token.text)));
-    }
-    case 'code': {
-      return this.renderer.code(this.token.text,
-        this.token.lang,
-        this.token.escaped);
-    }
-    case 'table': {
-      var header = '',
-          body = '',
-          i,
-          row,
-          cell,
-          j;
-
-      // header
-      cell = '';
-      for (i = 0; i < this.token.header.length; i++) {
-        cell += this.renderer.tablecell(
-          this.inline.output(this.token.header[i]),
-          { header: true, align: this.token.align[i] }
-        );
-      }
-      header += this.renderer.tablerow(cell);
-
-      for (i = 0; i < this.token.cells.length; i++) {
-        row = this.token.cells[i];
-
-        cell = '';
-        for (j = 0; j < row.length; j++) {
-          cell += this.renderer.tablecell(
-            this.inline.output(row[j]),
-            { header: false, align: this.token.align[j] }
-          );
-        }
-
-        body += this.renderer.tablerow(cell);
-      }
-      return this.renderer.table(header, body);
-    }
-    case 'blockquote_start': {
-      body = '';
-
-      while (this.next().type !== 'blockquote_end') {
-        body += this.tok();
-      }
-
-      return this.renderer.blockquote(body);
-    }
-    case 'list_start': {
-      body = '';
-      var ordered = this.token.ordered,
-          start = this.token.start;
-
-      while (this.next().type !== 'list_end') {
-        body += this.tok();
-      }
-
-      return this.renderer.list(body, ordered, start);
-    }
-    case 'list_item_start': {
-      body = '';
-
-      if (this.token.task) {
-        body += this.renderer.checkbox(this.token.checked);
-      }
-
-      while (this.next().type !== 'list_item_end') {
-        body += this.token.type === 'text'
-          ? this.parseText()
-          : this.tok();
-      }
-
-      return this.renderer.listitem(body);
-    }
-    case 'loose_item_start': {
-      body = '';
-
-      while (this.next().type !== 'list_item_end') {
-        body += this.tok();
-      }
-
-      return this.renderer.listitem(body);
-    }
-    case 'html': {
-      // TODO parse inline content if parameter markdown=1
-      return this.renderer.html(this.token.text);
-    }
-    case 'paragraph': {
-      return this.renderer.paragraph(this.inline.output(this.token.text));
-    }
-    case 'text': {
-      return this.renderer.paragraph(this.parseText());
-    }
-  }
-};
-
-/**
- * Helpers
- */
-
-function escape(html, encode) {
-  return html
-    .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
-    .replace(/</g, '&lt;')
-    .replace(/>/g, '&gt;')
-    .replace(/"/g, '&quot;')
-    .replace(/'/g, '&#39;');
-}
-
-function unescape(html) {
-  // explicitly match decimal, hex, and named HTML entities
-  return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) {
-    n = n.toLowerCase();
-    if (n === 'colon') return ':';
-    if (n.charAt(0) === '#') {
-      return n.charAt(1) === 'x'
-        ? String.fromCharCode(parseInt(n.substring(2), 16))
-        : String.fromCharCode(+n.substring(1));
-    }
-    return '';
-  });
-}
-
-function edit(regex, opt) {
-  regex = regex.source || regex;
-  opt = opt || '';
-  return {
-    replace: function(name, val) {
-      val = val.source || val;
-      val = val.replace(/(^|[^\[])\^/g, '$1');
-      regex = regex.replace(name, val);
-      return this;
-    },
-    getRegex: function() {
-      return new RegExp(regex, opt);
-    }
-  };
-}
-
-function resolveUrl(base, href) {
-  if (!baseUrls[' ' + base]) {
-    // we can ignore everything in base after the last slash of its path component,
-    // but we might need to add _that_
-    // https://tools.ietf.org/html/rfc3986#section-3
-    if (/^[^:]+:\/*[^/]*$/.test(base)) {
-      baseUrls[' ' + base] = base + '/';
-    } else {
-      baseUrls[' ' + base] = base.replace(/[^/]*$/, '');
-    }
-  }
-  base = baseUrls[' ' + base];
-
-  if (href.slice(0, 2) === '//') {
-    return base.replace(/:[\s\S]*/, ':') + href;
-  } else if (href.charAt(0) === '/') {
-    return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
-  } else {
-    return base + href;
-  }
-}
-var baseUrls = {};
-var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
-
-function noop() {}
-noop.exec = noop;
-
-function merge(obj) {
-  var i = 1,
-      target,
-      key;
-
-  for (; i < arguments.length; i++) {
-    target = arguments[i];
-    for (key in target) {
-      if (Object.prototype.hasOwnProperty.call(target, key)) {
-        obj[key] = target[key];
-      }
-    }
-  }
-
-  return obj;
-}
-
-function splitCells(tableRow, count) {
-  var cells = tableRow.replace(/([^\\])\|/g, '$1 |').split(/ +\| */),
-      i = 0;
-
-  if (cells.length > count) {
-    cells.splice(count);
-  } else {
-    while (cells.length < count) cells.push('');
-  }
-
-  for (; i < cells.length; i++) {
-    cells[i] = cells[i].replace(/\\\|/g, '|');
-  }
-  return cells;
-}
-
-/**
- * Marked
- */
-
-function marked(src, opt, callback) {
-  // throw error in case of non string input
-  if (typeof src === 'undefined' || src === null) {
-    throw new Error('marked(): input parameter is undefined or null');
-  }
-  if (typeof src !== 'string') {
-    throw new Error('marked(): input parameter is of type '
-      + Object.prototype.toString.call(src) + ', string expected');
-  }
-
-  if (callback || typeof opt === 'function') {
-    if (!callback) {
-      callback = opt;
-      opt = null;
-    }
-
-    opt = merge({}, marked.defaults, opt || {});
-
-    var highlight = opt.highlight,
-        tokens,
-        pending,
-        i = 0;
-
-    try {
-      tokens = Lexer.lex(src, opt)
-    } catch (e) {
-      return callback(e);
-    }
-
-    pending = tokens.length;
-
-    var done = function(err) {
-      if (err) {
-        opt.highlight = highlight;
-        return callback(err);
-      }
-
-      var out;
-
-      try {
-        out = Parser.parse(tokens, opt);
-      } catch (e) {
-        err = e;
-      }
-
-      opt.highlight = highlight;
-
-      return err
-        ? callback(err)
-        : callback(null, out);
-    };
-
-    if (!highlight || highlight.length < 3) {
-      return done();
-    }
-
-    delete opt.highlight;
-
-    if (!pending) return done();
-
-    for (; i < tokens.length; i++) {
-      (function(token) {
-        if (token.type !== 'code') {
-          return --pending || done();
-        }
-        return highlight(token.text, token.lang, function(err, code) {
-          if (err) return done(err);
-          if (code == null || code === token.text) {
-            return --pending || done();
-          }
-          token.text = code;
-          token.escaped = true;
-          --pending || done();
-        });
-      })(tokens[i]);
-    }
-
-    return;
-  }
-  try {
-    if (opt) opt = merge({}, marked.defaults, opt);
-    return Parser.parse(Lexer.lex(src, opt), opt);
-  } catch (e) {
-    e.message += '\nPlease report this to https://github.com/markedjs/marked.';
-    if ((opt || marked.defaults).silent) {
-      return '<p>An error occurred:</p><pre>'
-        + escape(e.message + '', true)
-        + '</pre>';
-    }
-    throw e;
-  }
-}
-
-/**
- * Options
- */
-
-marked.options =
-marked.setOptions = function(opt) {
-  merge(marked.defaults, opt);
-  return marked;
-};
-
-marked.getDefaults = function () {
-  return {
-    baseUrl: null,
-    breaks: false,
-    gfm: true,
-    headerIds: true,
-    headerPrefix: '',
-    highlight: null,
-    langPrefix: 'language-',
-    mangle: true,
-    pedantic: false,
-    renderer: new Renderer(),
-    sanitize: false,
-    sanitizer: null,
-    silent: false,
-    smartLists: false,
-    smartypants: false,
-    tables: true,
-    xhtml: false
-  };
-}
-
-marked.defaults = marked.getDefaults();
-
-/**
- * Expose
- */
-
-marked.Parser = Parser;
-marked.parser = Parser.parse;
-
-marked.Renderer = Renderer;
-marked.TextRenderer = TextRenderer;
-
-marked.Lexer = Lexer;
-marked.lexer = Lexer.lex;
-
-marked.InlineLexer = InlineLexer;
-marked.inlineLexer = InlineLexer.output;
-
-marked.parse = marked;
-
-if (typeof module !== 'undefined' && typeof exports === 'object') {
-  module.exports = marked;
-} else if (typeof define === 'function' && define.amd) {
-  define(function() { return marked; });
-} else {
-  root.marked = marked;
-}
-})(this || (typeof window !== 'undefined' ? window : global));
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json b/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
deleted file mode 100644
index d51ac744b92..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,34 +0,0 @@
-[
-    {
-        "Id": "markdowneditor-marked",
-        "Name": "Marked (WebEngine Markdown Editor example)",
-        "QDocModule": "qtwebengine",
-        "QtUsage": "Marked is used in the WebEngine MarkDown Editor example",
-        "QtParts": [ "examples" ],
-        "Files": "marked.js",
-        "Description": "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.",
-        "Homepage": "https://github.com/chjj/marked",
-        "Version": "0.4.0",
-        "DownloadLocation": "https://github.com/markedjs/marked/blob/0.4.0/lib/marked.js",
-        "Copyright": "Copyright (c) 2011-2018, Christopher Jeffrey",
-        "License": "MIT License",
-        "LicenseId": "MIT",
-        "LicenseFile": "MARKED-LICENSE.txt"
-    },
-    {
-        "Id": "markdowneditor-markdowncss",
-        "Name": "Markdown.css (WebEngine Markdown Editor example)",
-        "QDocModule": "qtwebengine",
-        "QtUsage": "markdown.css is used in the WebEngine MarkDown Editor example",
-        "QtParts": [ "examples" ],
-        "Files": "markdown.css",
-        "Description": "Markdown.css is better default styling for your Markdown files.",
-        "Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
-        "DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
-        "Copyright": "Copyright 2011 Kevin Burke
-    Copyright Twitter Inc.",
-        "License": "Apache License 2.0",
-        "LicenseId": "Apache-2.0",
-        "LicenseFile": "MARKDOWN-LICENSE.txt"
-    }
-]
diff --git a/examples/webenginewidgets/markdowneditor/resources/default.md b/examples/webenginewidgets/markdowneditor/resources/default.md
deleted file mode 100644
index af835fa4d79..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/default.md
+++ /dev/null
@@ -1,12 +0,0 @@
-## WebEngine Markdown Editor Example
-
-This example uses [QWebEngineView](http://doc.qt.io/qt-5/qwebengineview.html)
-to preview text written using the [Markdown](https://en.wikipedia.org/wiki/Markdown)
-syntax.
-
-### Acknowledgments
-
-The conversion from Markdown to HTML is done with the help of the
-[marked JavaScript library](https://github.com/chjj/marked) by _Christopher Jeffrey_.
-The [style sheet](https://kevinburke.bitbucket.io/markdowncss/)
-was created by _Kevin Burke_.
diff --git a/examples/webenginewidgets/markdowneditor/resources/index.html b/examples/webenginewidgets/markdowneditor/resources/index.html
deleted file mode 100644
index 289a2110b4b..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/index.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!doctype html>
-<html lang="en">
-<meta charset="utf-8">
-<head>
-  <link rel="stylesheet" type="text/css" href="3rdparty/markdown.css">
-  <script src="3rdparty/marked.js"></script>
-  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
-</head>
-<body>
-  <div id="placeholder"></div>
-  <script>
-  'use strict';
-
-  var placeholder = document.getElementById('placeholder');
-
-  var updateText = function(text) {
-      placeholder.innerHTML = marked(text);
-  }
-
-  new QWebChannel(qt.webChannelTransport,
-    function(channel) {
-      var content = channel.objects.content;
-      updateText(content.text);
-      content.textChanged.connect(updateText);
-    }
-  );
-  </script>
-</body>
-</html>
-
-
-
diff --git a/examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc b/examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc
deleted file mode 100644
index bc738f1cf6e..00000000000
--- a/examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file>default.md</file>
-        <file>index.html</file>
-        <file>3rdparty/markdown.css</file>
-        <file>3rdparty/marked.js</file>
-    </qresource>
-</RCC>
diff --git a/examples/webenginewidgets/recipebrowser/CMakeLists.txt b/examples/webenginewidgets/recipebrowser/CMakeLists.txt
new file mode 100644
index 00000000000..d10409c0940
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/CMakeLists.txt
@@ -0,0 +1,71 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(recipebrowser LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+    set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/recipebrowser")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(recipebrowser
+    main.cpp
+    mainwindow.cpp mainwindow.h mainwindow.ui
+    stylesheetdialog.cpp stylesheetdialog.h stylesheetdialog.ui
+    document.cpp document.h
+)
+
+set_target_properties(recipebrowser PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(recipebrowser PUBLIC
+    Qt::Core
+    Qt::Gui
+    Qt::WebEngineWidgets
+)
+
+# Resources:
+set(recipebrowser_resource_files
+    "assets/3rdparty/markdown.css"
+    "assets/3rdparty/marked.js"
+    "assets/custom.css"
+    "assets/custom.js"
+    "assets/pages/burger.html"
+    "assets/pages/cupcakes.html"
+    "assets/pages/images/burger.jpg"
+    "assets/pages/images/cupcakes.jpg"
+    "assets/pages/images/pasta.jpg"
+    "assets/pages/images/pizza.jpg"
+    "assets/pages/images/skewers.jpg"
+    "assets/pages/images/soup.jpg"
+    "assets/pages/images/steak.jpg"
+    "assets/pages/pasta.html"
+    "assets/pages/pizza.html"
+    "assets/pages/skewers.html"
+    "assets/pages/soup.html"
+    "assets/pages/steak.html"
+)
+
+qt_add_resources(recipebrowser "recipebrowser"
+    PREFIX
+        "/"
+    BASE
+        "assets"
+    FILES
+        ${recipebrowser_resource_files}
+)
+
+install(TARGETS recipebrowser
+    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt b/examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKDOWN-LICENSE.txt
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt
rename to examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKDOWN-LICENSE.txt
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt b/examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKED-LICENSE.txt
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt
rename to examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKED-LICENSE.txt
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/markdown.css b/examples/webenginewidgets/recipebrowser/assets/3rdparty/markdown.css
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/markdown.css
rename to examples/webenginewidgets/recipebrowser/assets/3rdparty/markdown.css
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/marked.js b/examples/webenginewidgets/recipebrowser/assets/3rdparty/marked.js
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/marked.js
rename to examples/webenginewidgets/recipebrowser/assets/3rdparty/marked.js
diff --git a/examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json b/examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json
new file mode 100644
index 00000000000..f8b0fd023b8
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json
@@ -0,0 +1,34 @@
+[
+    {
+        "Id" : "recipebrowser-marked",
+        "Name" : "Marked (WebEngine Recipe Browser example)",
+        "QDocModule" : "qtwebengine",
+        "QtUsage" : "Marked is used in the WebEngine Recipe Browser example",
+        "QtParts" : ["examples"],
+        "Files" : "marked.js",
+        "Description" :
+                "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.",
+        "Homepage" : "https://github.com/chjj/marked",
+        "Version" : "0.4.0",
+        "DownloadLocation" : "https://github.com/markedjs/marked/blob/0.4.0/lib/marked.js",
+        "Copyright" : "Copyright (c) 2011-2018, Christopher Jeffrey",
+        "License" : "MIT License",
+        "LicenseId" : "MIT",
+        "LicenseFile" : "MARKED-LICENSE.txt"
+    },
+    {
+        "Id" : "recipebrowser-markdowncss",
+        "Name" : "Markdown.css (WebEngine Recipe Browser example)",
+        "QDocModule" : "qtwebengine",
+        "QtUsage" : "markdown.css is used in the WebEngine Recipe Browser example",
+        "QtParts" : ["examples"],
+        "Files" : "markdown.css",
+        "Description" : "Markdown.css is better default styling for your Markdown files.",
+        "Version" : "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
+        "DownloadLocation" : "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
+        "Copyright" : "Copyright 2011 Kevin Burke Copyright Twitter Inc.",
+        "License" : "Apache License 2.0",
+        "LicenseId" : "Apache-2.0",
+        "LicenseFile" : "MARKDOWN-LICENSE.txt"
+    }
+ ]
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/custom.css b/examples/webenginewidgets/recipebrowser/assets/custom.css
similarity index 87%
rename from examples/webenginequick/recipebrowser/resources/pages/assets/custom.css
rename to examples/webenginewidgets/recipebrowser/assets/custom.css
index 8d2f6cb0bd5..cc1106af3c2 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/assets/custom.css
+++ b/examples/webenginewidgets/recipebrowser/assets/custom.css
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 body {
diff --git a/examples/webenginewidgets/recipebrowser/assets/custom.js b/examples/webenginewidgets/recipebrowser/assets/custom.js
new file mode 100644
index 00000000000..34470164ee6
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/custom.js
@@ -0,0 +1,13 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+marked.setOptions({
+    renderer : new marked.Renderer(),
+    gfm : true,
+    tables : true,
+    breaks : false,
+    pedantic : false,
+    sanitize : false,
+    smartLists : true,
+    smartypants : false
+});
diff --git a/examples/webenginequick/recipebrowser/resources/pages/burger.html b/examples/webenginewidgets/recipebrowser/assets/pages/burger.html
similarity index 79%
rename from examples/webenginequick/recipebrowser/resources/pages/burger.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/burger.html
index 6651cc0f06e..99497959fb1 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/burger.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/burger.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Insanity Burger</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -68,8 +71,24 @@
 
   </div><!--End of content-->
 
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginequick/recipebrowser/resources/pages/cupcakes.html b/examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html
similarity index 70%
rename from examples/webenginequick/recipebrowser/resources/pages/cupcakes.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html
index 4791c7ffafd..e8e14a9b6b4 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/cupcakes.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Cupcakes</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -46,8 +49,25 @@
 **Enjoy!**
 
   </div><!--End of content-->
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/burger.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/burger.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/burger.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/burger.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/cupcakes.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/cupcakes.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/cupcakes.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/cupcakes.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/pasta.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/pasta.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/pasta.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/pasta.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/pizza.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/pizza.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/pizza.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/pizza.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/skewers.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/skewers.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/skewers.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/skewers.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/soup.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/soup.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/soup.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/soup.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/images/steak.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/steak.jpg
similarity index 100%
rename from examples/webenginequick/recipebrowser/resources/pages/images/steak.jpg
rename to examples/webenginewidgets/recipebrowser/assets/pages/images/steak.jpg
diff --git a/examples/webenginequick/recipebrowser/resources/pages/pasta.html b/examples/webenginewidgets/recipebrowser/assets/pages/pasta.html
similarity index 73%
rename from examples/webenginequick/recipebrowser/resources/pages/pasta.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/pasta.html
index 41ed1a756bf..c2b3d840a9e 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/pasta.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/pasta.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Pasta</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -49,8 +52,25 @@
 **Enjoy!**
 
   </div><!--End of content-->
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginequick/recipebrowser/resources/pages/pizza.html b/examples/webenginewidgets/recipebrowser/assets/pages/pizza.html
similarity index 63%
rename from examples/webenginequick/recipebrowser/resources/pages/pizza.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/pizza.html
index 348d809e8a3..7e390a3734b 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/pizza.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/pizza.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Pizza Diavola</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -40,8 +43,25 @@
 **Enjoy!**
 
   </div><!--End of content-->
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginequick/recipebrowser/resources/pages/skewers.html b/examples/webenginewidgets/recipebrowser/assets/pages/skewers.html
similarity index 75%
rename from examples/webenginequick/recipebrowser/resources/pages/skewers.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/skewers.html
index aca4c485908..db2df5472a7 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/skewers.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/skewers.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Grilled skewers</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -46,8 +49,24 @@
 
   </div><!--End of content-->
 
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginequick/recipebrowser/resources/pages/soup.html b/examples/webenginewidgets/recipebrowser/assets/pages/soup.html
similarity index 53%
rename from examples/webenginequick/recipebrowser/resources/pages/soup.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/soup.html
index 1b7027e5de1..ea51fc8a577 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/soup.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/soup.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Soup</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -34,8 +37,25 @@
 **Enjoy!**
 
   </div><!--End of content-->
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginequick/recipebrowser/resources/pages/steak.html b/examples/webenginewidgets/recipebrowser/assets/pages/steak.html
similarity index 75%
rename from examples/webenginequick/recipebrowser/resources/pages/steak.html
rename to examples/webenginewidgets/recipebrowser/assets/pages/steak.html
index a56313e27d6..26391b40977 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/steak.html
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/steak.html
@@ -3,8 +3,11 @@
 <head>
   <meta charset="utf-8">
   <title>Grilled steak and rice</title>
-  <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
-  <link rel="stylesheet" type="text/css" href="assets/custom.css">
+  <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+  <link rel="stylesheet" type="text/css" href="../custom.css">
+  <script src="../3rdparty/marked.js"></script>
+  <script src="../custom.js"></script>
+  <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
 </head>
 <body>
   <div id="placeholder"></div>
@@ -60,8 +63,24 @@
 
   </div><!--End of content-->
 
-  <script src="assets/3rdparty/marked.js"></script>
-  <script src="assets/custom.js"></script>
+  <script>
+    'use strict';
+
+    var jsContent = document.getElementById('content');
+    var placeholder = document.getElementById('placeholder');
+
+    var updateText = function(text) {
+      placeholder.innerHTML = marked.parse(text);
+    }
+
+    new QWebChannel(qt.webChannelTransport,
+      function(channel) {
+        var content = channel.objects.content;
+        content.setInitialText(jsContent.innerHTML);
+        content.textChanged.connect(updateText);
+      }
+    );
+  </script>
 </body>
 </html>
 
diff --git a/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp b/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp
new file mode 100644
index 0000000000000000000000000000000000000000..8446bcde340939f8e16ccd5b07cd97a260139ed7
GIT binary patch
diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
new file mode 100644
index 00000000000..4ac9973b396
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -0,0 +1,197 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+    \example webenginewidgets/recipebrowser
+    \title Recipe Browser
+    \meta category {Application Examples}
+    \meta tag {widgets, webengine, webchannel, webenginescript}
+    \ingroup webengine-widgetexamples
+    \brief Injecting custom stylsheets into web pages and providing a rich text preview
+    tool for a custom markup language.
+
+    \image recipebrowser.webp
+
+    \e {Recipe Browser} is a small hybrid web browser application. It demonstrates how to
+    use the \l{Qt WebEngine Widgets C++ Classes} {Qt WebEngine C++ classes} to combine
+    C++ and JavaScript logic in the following ways.
+
+    \list
+        \li Running arbitrary JavaScript code via \c QWebEnginePage::runJavaScript() to
+            inject custom CSS stylesheets
+        \li Using QWebEngineScript and QWebEngineScriptCollection to persist the JavaScript
+            code and inject it to every page
+        \li Using QWebChannel to interact with and provide a rich text preview for a custom
+            markup language
+    \endlist
+
+    \l{http://daringfireball.net/projects/markdown/}{Markdown} is a lightweight
+    markup language with a plain text formatting syntax.
+    Some services, such as \l{http://github.com}{github}, acknowledge the
+    format, and render the content as rich text when viewed in a browser.
+
+    The Recipe Browser main window is split into a navigation on the left and
+    a preview area on the right. The preview area on the right switches to an
+    editor when the user clicks the Edit button on the top left of the main window.
+    The editor supports the Markdown syntax and is implemented by using
+    QPlainTextEdit. The document is rendered as rich text in the preview area,
+    once the user clicks the View button,to which the Edit button transforms to.
+    This rendering is implemented by using QWebEngineView. To render the text,
+    a JavaScript library inside the web engine converts the Markdown text to HTML.
+    The preview is updated from the editor through QWebChannel.
+
+    \include examples-run.qdocinc
+
+    \section1 Exposing Document Text
+
+    To render the current Markdown text it needs to be exposed to the web engine through
+    QWebChannel. To achieve this it has to be part of Qt metatype system. This is done
+    by using a dedicated \c Document class that exposes the document text as a
+    \c {Q_PROPERTY}:
+
+    \quotefromfile webenginewidgets/recipebrowser/document.h
+    \skipto class Document
+    \printto #endif
+
+    The \c Document class wraps a QString \c m_currentText to be set on the C++
+    side with  the \c setText() method and exposes it at runtime as a \c text
+    property with a \c textChanged signal. We define the \c setText method as
+    follows:
+
+    \quotefromfile webenginewidgets/recipebrowser/document.cpp
+    \skipto Document::setText(const QString &text)
+    \printuntil /^\}/
+
+    Additionally, the \c Document class keeps track of the current recipe via
+    \c m_currentPage. We call the recipes pages here, because each recipe has
+    its distinct HTML document that contains the initial text content.
+    Furthermore, \c m_textCollection is a QMap<QString, QString> that contains
+    the key/value pairs \{page, text\}, so that changes made to the text content
+    of a page is persisted between navigation. Nevertheless, we do not write the
+    modified text contents to the drive, but instead we persist them between
+    application start and shutdown via QSettings.
+
+    \section1 Creating the Main Window
+
+    The \c MainWindow class inherits the QMainWindow class:
+
+    \quotefromfile webenginewidgets/recipebrowser/mainwindow.h
+    \skipto class MainWindow :
+    \printto endif
+
+    The class declares private slots that match the two buttons on the
+    top left, over the navigation list view. Additionally, helper
+    methods for custom CSS stylesheets are declared.
+
+    The actual layout of the main window is specified in a \c .ui file.
+    The widgets and actions are available at runtime in the \c ui member
+    variable.
+
+    \c m_isEditMode is a boolean that toggles between the editor and the
+    preview area.
+    \c m_content is an instance of the \c Document class.
+
+    The actual setup of the different objects is done in the \c MainWindow
+    constructor:
+
+    \quotefromfile webenginewidgets/recipebrowser/mainwindow.cpp
+    \skipto MainWindow::MainWindow
+    \printto connect
+
+    The constructor first calls \c setupUi to construct the widgets and menu
+    actions according to the UI file. The text editor font is set to one
+    with a fixed character width, and the QWebEngineView widget is told not
+    to show a context menu. Furthermore, the editor is hidden away.
+
+    \printto ui->recipes
+
+    Here the \c clicked signals of QPushButton are connected to respective functions
+    that show the stylesheets dialog or toggle between edit and view mode, that is,
+    hide and show the editor and preview area respectively.
+
+    \printto m_content.setTextEdit
+
+    Here the navigation QListWidget on the left is setup with the 7 recipes.
+    Also, the currentItemChanged signal of QListWidget is connected to a lambda
+    that loads the new, current recipe page and updates the page in \c m_content.
+
+    \printto connect
+
+    Next, the pointer to the ui editor, a QPlainTextEdit, is passed to \c m_content to ensure that
+    calls to \c Document::setInitialText() work properly.
+
+    \printto QSettings
+
+    Here the \c textChanged signal of the editor is connected to a lambda that
+    updates the text in \c m_content. This object is then exposed to the JS side
+    by \c QWebChannel under the name \c{content}.
+
+    \printto ui->recipes
+
+    By using QSettings we persist stylesheets between application runs. If there
+    should be no stylesheets configured, for example, because the user deleted all of them
+    in a previous run, we load default ones.
+
+    \printto }
+
+    Finally, we set the currently selected list item to the first contained in the
+    navigation list widget. This triggers the previously mentioned
+    QListWidget::currentItemChanged signal and navigates to the page of the list item.
+
+    \section1 Working With Stylesheets
+
+    We use JavaScript to create and append CSS elements to the documents.
+    After declaring the script source, QWebEnginePage::runJavaScript() can run it
+    immediately and apply newly created styles on the current content of the web view.
+    Encapsulating the script into a QWebEngineScript and adding it to the script collection
+    of QWebEnginePage makes its effect permanent.
+
+    \quotefromfile webenginewidgets/recipebrowser/mainwindow.cpp
+    \skipto MainWindow::insertStyleSheet
+    \printuntil /^\}/
+
+    Removing stylesheets can be done similarly:
+
+    \quotefromfile webenginewidgets/recipebrowser/mainwindow.cpp
+    \skipto MainWindow::removeStyleSheet
+    \printuntil /^\}/
+
+    \section1 Creating a recipe file
+
+    \quotefile webenginewidgets/recipebrowser/assets/pages/burger.html
+
+    All the different recipe pages are set up the same way.
+
+    In the \c <head> part they
+    include two CSS files: \c markdown.css, that styles the markdown, and
+    custom.css, that does some further styling but most importantly hides the
+    \c <div> with id \e content, as this \c <div> only contains the unmodified,
+    initial content text. Also, three JS scripts are included. \c marked.js
+    is responsible for parsing the markdown and transforming it into HTML.
+    \c custom.js does some configuration of \c marked.js, and \c qwebchannel.js
+    exposes the QWebChannel JavaScript API.
+
+    In the body there are two \c <div> elements. The \c <div> with id \e placeholder
+    gets the markdown text injected that is rendered and visible. The \c <div> with id
+    \e content is hidden by \c custom.css and only contains the original, unmodified
+    text content of the recipe.
+
+    Finally, on the bottom of each recipe HTML file is a script that is responsible for
+    the communication between the C++ and JavaScript side via QWebChannel. The original,
+    unmodified text content inside the \c <div> with id \e content is passed to the C++
+    side and a callback is setup that is invoked when the \c textChanged signal of
+    \c m_content is emitted. The callback then updates the contents of the \c <div>
+    \e placeholder with the parsed markdown.
+
+    \section1 Files and Attributions
+
+    The example bundles the following code with third-party licenses:
+    \table
+    \row
+        \li \l{recipebrowser-marked}{Marked}
+        \li MIT License
+    \row
+        \li \l{recipebrowser-markdowncss}{Markdown.css}
+        \li Apache License 2.0
+    \endtable
+*/
diff --git a/examples/webenginewidgets/recipebrowser/document.cpp b/examples/webenginewidgets/recipebrowser/document.cpp
new file mode 100644
index 00000000000..c991e14f824
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/document.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "document.h"
+
+#include <QSettings>
+
+Document::Document(QObject *parent) : QObject(parent)
+{
+    QSettings settings;
+    settings.beginGroup("textCollection");
+    QStringList pageTexts = settings.allKeys();
+    for (const QString &name : std::as_const(pageTexts)) {
+        QString pageText = settings.value(name).value<QString>();
+        if (!pageText.isEmpty())
+            m_textCollection.insert(name, pageText);
+    }
+    settings.endGroup();
+}
+
+void Document::setTextEdit(QPlainTextEdit *textEdit)
+{
+    m_textEdit = textEdit;
+}
+
+void Document::setCurrentPage(const QString &page)
+{
+    m_currentPage = page;
+}
+
+void Document::setInitialText(const QString &text)
+{
+    m_textEdit->setPlainText(m_textCollection.value(m_currentPage, text));
+}
+
+void Document::setText(const QString &text)
+{
+    if (text == m_currentText)
+        return;
+    m_currentText = text;
+    emit textChanged(m_currentText);
+
+    QSettings settings;
+    settings.beginGroup("textCollection");
+    settings.setValue(m_currentPage, text);
+    m_textCollection.insert(m_currentPage, text);
+    settings.endGroup();
+}
diff --git a/examples/webenginewidgets/recipebrowser/document.h b/examples/webenginewidgets/recipebrowser/document.h
new file mode 100644
index 00000000000..f6b537eb8c6
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/document.h
@@ -0,0 +1,36 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef DOCUMENT_H
+#define DOCUMENT_H
+
+#include <QObject>
+#include <QString>
+#include <QPlainTextEdit>
+
+class Document : public QObject
+{
+    Q_OBJECT
+    Q_PROPERTY(QString text MEMBER m_currentText NOTIFY textChanged FINAL)
+public:
+    explicit Document(QObject *parent = nullptr);
+
+    void setTextEdit(QPlainTextEdit *textEdit);
+    void setCurrentPage(const QString &page);
+
+public slots:
+    void setInitialText(const QString &text);
+    void setText(const QString &text);
+
+signals:
+    void textChanged(const QString &text);
+
+private:
+    QPlainTextEdit *m_textEdit;
+
+    QString m_currentText;
+    QString m_currentPage;
+    QMap<QString, QString> m_textCollection;
+};
+
+#endif // DOCUMENT_H
diff --git a/examples/webenginewidgets/stylesheetbrowser/main.cpp b/examples/webenginewidgets/recipebrowser/main.cpp
similarity index 82%
rename from examples/webenginewidgets/stylesheetbrowser/main.cpp
rename to examples/webenginewidgets/recipebrowser/main.cpp
index cf1e5f718a8..b0b42d16bfc 100644
--- a/examples/webenginewidgets/stylesheetbrowser/main.cpp
+++ b/examples/webenginewidgets/recipebrowser/main.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 #include "mainwindow.h"
@@ -12,7 +12,7 @@ int main(int argc, char *argv[])
 
     QCoreApplication::setOrganizationName("QtExamples");
     QApplication a(argc, argv);
-    MainWindow w(QUrl("http://qt.io"));
+    MainWindow w;
     w.show();
     return a.exec();
 }
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.cpp b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
new file mode 100644
index 00000000000..7288fe4ceb3
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
@@ -0,0 +1,153 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "mainwindow.h"
+#include "stylesheetdialog.h"
+#include "ui_mainwindow.h"
+
+#include <QWebChannel>
+
+static QMap<QString, QString> defaultStyleSheets = {
+    { "Upside down", "body { -webkit-transform: rotate(180deg); }" },
+    { "Darkmode",
+      "body { color: #FFF; background-color: #000 }"
+      "h1, h2, h3, h4, h5 { color: #FFF }" }
+};
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent), ui(new Ui::MainWindow), m_isEditMode(false)
+{
+    ui->setupUi(this);
+    ui->textEdit->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
+    ui->textEdit->hide();
+    ui->webEngineView->setContextMenuPolicy(Qt::NoContextMenu);
+
+    connect(ui->stylesheetsButton, &QPushButton::clicked, this, &MainWindow::showStyleSheetsDialog);
+    connect(ui->editViewButton, &QPushButton::clicked, this, &MainWindow::toggleEditView);
+
+    ui->recipes->insertItem(0, "Burger");
+    ui->recipes->insertItem(1, "Cupcakes");
+    ui->recipes->insertItem(2, "Pasta");
+    ui->recipes->insertItem(3, "Pizza");
+    ui->recipes->insertItem(4, "Skewers");
+    ui->recipes->insertItem(5, "Soup");
+    ui->recipes->insertItem(6, "Steak");
+    connect(ui->recipes, &QListWidget::currentItemChanged, this,
+            [this](QListWidgetItem *current, QListWidgetItem * /* previous */) {
+                const QString page = current->text().toLower();
+                const QString url = QStringLiteral("qrc:/pages/") + page + QStringLiteral(".html");
+                ui->webEngineView->setUrl(QUrl(url));
+                m_content.setCurrentPage(page);
+            });
+
+    m_content.setTextEdit(ui->textEdit);
+
+    connect(ui->textEdit, &QPlainTextEdit::textChanged, this,
+            [this]() { m_content.setText(ui->textEdit->toPlainText()); });
+
+    QWebChannel *channel = new QWebChannel(this);
+    channel->registerObject(QStringLiteral("content"), &m_content);
+    ui->webEngineView->page()->setWebChannel(channel);
+
+    QSettings settings;
+    settings.beginGroup("styleSheets");
+    QStringList styleSheets = settings.allKeys();
+    if (styleSheets.empty()) {
+        // Add back default style sheets if the user cleared them out
+        loadDefaultStyleSheets();
+    } else {
+        for (const auto &name : std::as_const(styleSheets)) {
+            StyleSheet styleSheet = settings.value(name).value<StyleSheet>();
+            if (styleSheet.second)
+                insertStyleSheet(name, styleSheet.first, false);
+        }
+    }
+    settings.endGroup();
+
+    ui->recipes->setCurrentItem(ui->recipes->item(0));
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+void MainWindow::insertStyleSheet(const QString &name, const QString &source, bool immediately)
+{
+    QWebEngineScript script;
+    QString s = QString::fromLatin1("(function() {"
+                                    "    css = document.createElement('style');"
+                                    "    css.type = 'text/css';"
+                                    "    css.id = '%1';"
+                                    "    document.head.appendChild(css);"
+                                    "    css.innerText = '%2';"
+                                    "})()")
+                        .arg(name, source.simplified());
+    if (immediately)
+        ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
+
+    script.setName(name);
+    script.setSourceCode(s);
+    script.setInjectionPoint(QWebEngineScript::DocumentReady);
+    script.setRunsOnSubFrames(true);
+    script.setWorldId(QWebEngineScript::ApplicationWorld);
+    ui->webEngineView->page()->scripts().insert(script);
+}
+
+void MainWindow::removeStyleSheet(const QString &name, bool immediately)
+{
+    QString s = QString::fromLatin1("(function() {"
+                                    "    var element = document.getElementById('%1');"
+                                    "    element.outerHTML = '';"
+                                    "    delete element;"
+                                    "})()")
+                        .arg(name);
+    if (immediately)
+        ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
+
+    const QList<QWebEngineScript> scripts = ui->webEngineView->page()->scripts().find(name);
+    if (!scripts.isEmpty())
+        ui->webEngineView->page()->scripts().remove(scripts.first());
+}
+
+bool MainWindow::hasStyleSheet(const QString &name)
+{
+    const QList<QWebEngineScript> scripts = ui->webEngineView->page()->scripts().find(name);
+    return !scripts.isEmpty();
+}
+
+void MainWindow::loadDefaultStyleSheets()
+{
+    QSettings settings;
+    settings.beginGroup("styleSheets");
+
+    for (auto it = defaultStyleSheets.constBegin(); it != defaultStyleSheets.constEnd(); ++it) {
+        settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), true)));
+        insertStyleSheet(it.key(), it.value(), false);
+    }
+
+    settings.endGroup();
+}
+
+void MainWindow::showStyleSheetsDialog()
+{
+    StylesheetDialog *dialog = new StylesheetDialog(this);
+    dialog->show();
+}
+
+void MainWindow::toggleEditView()
+{
+    m_isEditMode = !m_isEditMode;
+
+    if (m_isEditMode) {
+        ui->webEngineView->hide();
+        ui->textEdit->show();
+
+        ui->editViewButton->setText(QStringLiteral("View"));
+    } else {
+        ui->textEdit->hide();
+        ui->webEngineView->show();
+
+        ui->editViewButton->setText(QStringLiteral("Edit"));
+    }
+}
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.h b/examples/webenginewidgets/recipebrowser/mainwindow.h
similarity index 74%
rename from examples/webenginewidgets/stylesheetbrowser/mainwindow.h
rename to examples/webenginewidgets/recipebrowser/mainwindow.h
index 92d6d02fec4..959c82af8b0 100644
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.h
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.h
@@ -1,12 +1,15 @@
-// Copyright (C) 2017 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
+#include "document.h"
 #include <QMainWindow>
 #include <QSettings>
 #include <QWebEngineScriptCollection>
+#include <QWebEngineView>
+#include <QPlainTextEdit>
 
 QT_BEGIN_NAMESPACE
 namespace Ui {
@@ -19,7 +22,7 @@ class MainWindow : public QMainWindow
     Q_OBJECT
 
 public:
-    explicit MainWindow(const QUrl &url);
+    explicit MainWindow(QWidget *parent = nullptr);
     ~MainWindow();
 
     void insertStyleSheet(const QString &name, const QString &source, bool immediately);
@@ -28,13 +31,14 @@ class MainWindow : public QMainWindow
     void loadDefaultStyleSheets();
 
 private slots:
-    void urlEntered();
-    void urlChanged(const QUrl &url);
     void showStyleSheetsDialog();
-    void reloadRequested();
+    void toggleEditView();
 
 private:
     Ui::MainWindow *ui;
+
+    bool m_isEditMode;
+    Document m_content;
 };
 
 #endif // MAINWINDOW_H
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.ui b/examples/webenginewidgets/recipebrowser/mainwindow.ui
new file mode 100644
index 00000000000..b7c29f1b81c
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.ui
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>713</width>
+    <height>455</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Recipe Browser</string>
+  </property>
+  <property name="unifiedTitleAndToolBarOnMac">
+   <bool>false</bool>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <layout class="QGridLayout" name="gridLayout">
+    <item row="0" column="0">
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <layout class="QVBoxLayout" name="navigation">
+        <item>
+         <layout class="QHBoxLayout" name="navigationBar">
+          <item>
+           <widget class="QLabel" name="label">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>Recipes</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignCenter</set>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="editViewButton">
+            <property name="text">
+             <string>Edit</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="stylesheetsButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>Stylesheets</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QListWidget" name="recipes">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QWebEngineView" name="webEngineView" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPlainTextEdit" name="textEdit"/>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+  <customwidget>
+   <class>QWebEngineView</class>
+   <extends>QWidget</extends>
+   <header>qwebengineview.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro b/examples/webenginewidgets/recipebrowser/recipebrowser.pro
similarity index 50%
rename from examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro
rename to examples/webenginewidgets/recipebrowser/recipebrowser.pro
index a9ff544004a..8f8895b52e6 100644
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro
+++ b/examples/webenginewidgets/recipebrowser/recipebrowser.pro
@@ -1,22 +1,24 @@
 TEMPLATE = app
-TARGET = stylesheetbrowser
+TARGET = recipebrowser
 QT += webenginewidgets
 
 HEADERS += \
     mainwindow.h \
-    stylesheetdialog.h
+    stylesheetdialog.h \
+    document.h
 
 SOURCES += \
     main.cpp \
     mainwindow.cpp \
-    stylesheetdialog.cpp
+    stylesheetdialog.cpp \
+    document.cpp
 
 FORMS += \
     mainwindow.ui \
     stylesheetdialog.ui
 
-RESOURCES += stylesheetbrowser.qrc
+RESOURCES += recipebrowser.qrc
 
 # install
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/stylesheetbrowser
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/recipebrowser
 INSTALLS += target
diff --git a/examples/webenginewidgets/recipebrowser/recipebrowser.qrc b/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
new file mode 100644
index 00000000000..2dc003f308f
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
@@ -0,0 +1,15 @@
+<RCC>
+    <qresource prefix="/">
+        <file>assets/3rdparty/markdown.css</file>
+        <file>assets/3rdparty/marked.js</file>
+        <file>assets/custom.js</file>
+        <file>assets/custom.css</file>
+        <file>assets/pages/burger.html</file>
+        <file>assets/pages/cupcakes.html</file>
+        <file>assets/pages/pasta.html</file>
+        <file>assets/pages/pizza.html</file>
+        <file>assets/pages/skewers.html</file>
+        <file>assets/pages/soup.html</file>
+        <file>assets/pages/steak.html</file>
+    </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp b/examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp
similarity index 86%
rename from examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp
rename to examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp
index 30409f107b6..2137617c355 100644
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp
+++ b/examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp
@@ -1,18 +1,18 @@
-// Copyright (C) 2017 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 #include "mainwindow.h"
 #include "stylesheetdialog.h"
 #include "ui_stylesheetdialog.h"
 
-StylesheetDialog::StylesheetDialog(QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::StylesheetDialog)
+StylesheetDialog::StylesheetDialog(QWidget *parent) : QDialog(parent), ui(new Ui::StylesheetDialog)
 {
     ui->setupUi(this);
 
-    connect(ui->styleSheetList, &QListWidget::currentItemChanged, this, &StylesheetDialog::currentStyleSheetChanged);
-    connect(ui->styleSheetList, &QListWidget::itemClicked, this, &StylesheetDialog::listItemClicked);
+    connect(ui->styleSheetList, &QListWidget::currentItemChanged, this,
+            &StylesheetDialog::currentStyleSheetChanged);
+    connect(ui->styleSheetList, &QListWidget::itemClicked, this,
+            &StylesheetDialog::listItemClicked);
     connect(ui->fileNameEdit, &QLineEdit::textChanged, this, &StylesheetDialog::fileNameChanged);
 
     connect(ui->addButton, &QPushButton::clicked, this, &StylesheetDialog::addButtonClicked);
@@ -20,8 +20,8 @@ StylesheetDialog::StylesheetDialog(QWidget *parent) :
 
     QSettings settings;
     settings.beginGroup("styleSheets");
-    for (auto name : settings.allKeys()) {
-        QListWidgetItem *listItem = new QListWidgetItem(name,  ui->styleSheetList);
+    for (const auto &name : settings.allKeys()) {
+        QListWidgetItem *listItem = new QListWidgetItem(name, ui->styleSheetList);
         listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);
         bool checked = settings.value(name).value<StyleSheet>().second;
         listItem->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
@@ -59,9 +59,8 @@ void StylesheetDialog::listItemClicked(QListWidgetItem *item)
 {
     MainWindow *window = static_cast<MainWindow *>(parent());
     const QString name = item->text();
-    bool checkedStateChanged =
-            (item->checkState() == Qt::Checked && !window->hasStyleSheet(name)) ||
-            (item->checkState() == Qt::Unchecked && window->hasStyleSheet(name));
+    bool checkedStateChanged = (item->checkState() == Qt::Checked && !window->hasStyleSheet(name))
+            || (item->checkState() == Qt::Unchecked && window->hasStyleSheet(name));
     if (!checkedStateChanged)
         return;
 
@@ -96,7 +95,7 @@ void StylesheetDialog::addButtonClicked()
     if (name.isEmpty() || source.isEmpty())
         return;
 
-    QListWidgetItem *listItem = new QListWidgetItem(ui->fileNameEdit->text(),  ui->styleSheetList);
+    QListWidgetItem *listItem = new QListWidgetItem(ui->fileNameEdit->text(), ui->styleSheetList);
     listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);
     listItem->setCheckState(Qt::Checked);
 
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h b/examples/webenginewidgets/recipebrowser/stylesheetdialog.h
similarity index 95%
rename from examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h
rename to examples/webenginewidgets/recipebrowser/stylesheetdialog.h
index 7bebff74f6e..ca1b4ae9932 100644
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h
+++ b/examples/webenginewidgets/recipebrowser/stylesheetdialog.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 #ifndef STYLESHEETDIALOG_H
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui b/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
similarity index 100%
rename from examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui
rename to examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING b/examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING
deleted file mode 100644
index 220881da67d..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING
+++ /dev/null
@@ -1 +0,0 @@
-The icons in this repository are herefore released into the Public Domain.
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
deleted file mode 100644
index f779da7e275..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-    "Id": "stylesheetbrowser-tango",
-    "Name": "Tango Icon Library",
-    "QDocModule": "qtwebengine",
-    "QtUsage": "Used in WebEngine StyleSheet Browser example.",
-
-    "QtParts": [ "examples" ],
-    "Description": "Selected icons from the Tango Icon Library",
-    "Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
-    "Version": "0.8.90",
-    "DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
-    "LicenseId": "urn:dje:license:public-domain",
-    "License": "Public Domain",
-    "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
-}
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.png b/examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.png
deleted file mode 100644
index cab4d02c756502f922bbff34df34c0056406bd96..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt b/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt
deleted file mode 100644
index 56ecd51f3f9..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(stylesheetbrowser LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
-    set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/stylesheetbrowser")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
-
-qt_add_executable(stylesheetbrowser
-    main.cpp
-    mainwindow.cpp mainwindow.h mainwindow.ui
-    stylesheetdialog.cpp stylesheetdialog.h stylesheetdialog.ui
-)
-
-set_target_properties(stylesheetbrowser PROPERTIES
-    WIN32_EXECUTABLE TRUE
-    MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(stylesheetbrowser PUBLIC
-    Qt::Core
-    Qt::Gui
-    Qt::WebEngineWidgets
-)
-
-# Resources:
-set(stylesheetbrowser_resource_files
-    "3rdparty/view-refresh.png"
-)
-
-qt_add_resources(stylesheetbrowser "stylesheetbrowser"
-    PREFIX
-        "/"
-    BASE
-        "3rdparty"
-    FILES
-        ${stylesheetbrowser_resource_files}
-)
-
-install(TARGETS stylesheetbrowser
-    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
-    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
-    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.png b/examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.png
deleted file mode 100644
index 32c7c43edbbeca934e866beaae06af57fafc7720..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc b/examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc
deleted file mode 100644
index 80f333323d1..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
-    \example webenginewidgets/stylesheetbrowser
-    \title WebEngine StyleSheet Browser Example
-    \ingroup webengine-widgetexamples
-    \brief Demonstrates how to inject CSS into web pages using user scripts.
-
-    \image stylesheetbrowser.png
-
-    \e {StyleSheet Browser} demonstrates how to use the \l{Qt WebEngine Widgets C++ Classes}
-    {Qt WebEngine C++ classes} to inject user stylesheets into web pages.
-
-    \include examples-run.qdocinc
-
-    \section1 Working With Stylesheets
-
-    We use JavaScript to create and append CSS elements to the documents.
-    After declaring the script source, QWebEnginePage::runJavaScript() can run it
-    immediately and apply newly created styles on the current content of the web view.
-    Encapsulating the script into a QWebEngineScript and adding it to the script collection
-    of QWebEnginePage makes its effect permanent.
-
-    \quotefromfile webenginewidgets/stylesheetbrowser/mainwindow.cpp
-    \skipto MainWindow::insertStyleSheet
-    \printuntil /^\}/
-
-    Removing stylesheets can be done similarly:
-
-    \quotefromfile webenginewidgets/stylesheetbrowser/mainwindow.cpp
-    \skipto MainWindow::removeStyleSheet
-    \printuntil /^\}/
-
-    \section1 Files and Attributions
-
-    The example uses icons from the Tango Icon Library:
-
-    \table
-    \row
-        \li \l{stylesheetbrowser-tango}{Tango Icon Library}
-        \li Public Domain
-    \endtable
-*/
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp b/examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp
deleted file mode 100644
index ab786d5c9bb..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "mainwindow.h"
-#include "stylesheetdialog.h"
-#include "ui_mainwindow.h"
-
-static QMap<QString, QString> defaultStyleSheets = {
-    {"Upside down", "body { -webkit-transform: rotate(180deg); }"}
-};
-
-MainWindow::MainWindow(const QUrl &url) :
-    QMainWindow(),
-    ui(new Ui::MainWindow)
-{
-    ui->setupUi(this);
-
-    connect(ui->urlBar, &QLineEdit::returnPressed, this, &MainWindow::urlEntered);
-    connect(ui->webEngineView, &QWebEngineView::urlChanged, this, &MainWindow::urlChanged);
-    connect(ui->settingsButton, &QPushButton::clicked, this, &MainWindow::showStyleSheetsDialog);
-    connect(ui->reloadButton, &QPushButton::clicked, this, &MainWindow::reloadRequested);
-
-    QSettings settings;
-    settings.beginGroup("styleSheets");
-    QStringList styleSheets = settings.allKeys();
-    if (styleSheets.empty()) {
-        // Add back default style sheets if the user cleared them out
-        loadDefaultStyleSheets();
-    } else {
-        for (auto name : std::as_const(styleSheets)) {
-            StyleSheet styleSheet = settings.value(name).value<StyleSheet>();
-            if (styleSheet.second)
-                insertStyleSheet(name, styleSheet.first, false);
-        }
-    }
-    settings.endGroup();
-
-    ui->webEngineView->setUrl(url);
-}
-
-MainWindow::~MainWindow()
-{
-    delete ui;
-}
-
-void MainWindow::insertStyleSheet(const QString &name, const QString &source, bool immediately)
-{
-    QWebEngineScript script;
-    QString s = QString::fromLatin1("(function() {"\
-                                    "    css = document.createElement('style');"\
-                                    "    css.type = 'text/css';"\
-                                    "    css.id = '%1';"\
-                                    "    document.head.appendChild(css);"\
-                                    "    css.innerText = '%2';"\
-                                    "})()").arg(name).arg(source.simplified());
-    if (immediately)
-        ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
-
-    script.setName(name);
-    script.setSourceCode(s);
-    script.setInjectionPoint(QWebEngineScript::DocumentReady);
-    script.setRunsOnSubFrames(true);
-    script.setWorldId(QWebEngineScript::ApplicationWorld);
-    ui->webEngineView->page()->scripts().insert(script);
-}
-
-void MainWindow::removeStyleSheet(const QString &name, bool immediately)
-{
-    QString s = QString::fromLatin1("(function() {"\
-                                    "    var element = document.getElementById('%1');"\
-                                    "    element.outerHTML = '';"\
-                                    "    delete element;"\
-                                    "})()").arg(name);
-    if (immediately)
-        ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
-
-    const QList<QWebEngineScript> scripts = ui->webEngineView->page()->scripts().find(name);
-    if (!scripts.isEmpty())
-        ui->webEngineView->page()->scripts().remove(scripts.first());
-}
-
-bool MainWindow::hasStyleSheet(const QString &name)
-{
-    const QList<QWebEngineScript> scripts = ui->webEngineView->page()->scripts().find(name);
-    return !scripts.isEmpty();
-}
-
-void MainWindow::loadDefaultStyleSheets()
-{
-    QSettings settings;
-    settings.beginGroup("styleSheets");
-
-    auto it = defaultStyleSheets.constBegin();
-    while (it != defaultStyleSheets.constEnd()) {
-        settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), true)));
-        insertStyleSheet(it.key(), it.value(), false);
-        ++it;
-    }
-
-    settings.endGroup();
-}
-
-void MainWindow::urlEntered()
-{
-    ui->webEngineView->setUrl(QUrl::fromUserInput(ui->urlBar->text()));
-}
-
-void MainWindow::urlChanged(const QUrl &url)
-{
-    ui->urlBar->setText(url.toString());
-}
-
-void MainWindow::showStyleSheetsDialog()
-{
-    StylesheetDialog *dialog = new StylesheetDialog(this);
-    dialog->show();
-}
-
-void MainWindow::reloadRequested()
-{
-    ui->webEngineView->reload();
-}
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui b/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
deleted file mode 100644
index bc68c16bbff..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>713</width>
-    <height>455</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>StyleSheet Browser</string>
-  </property>
-  <property name="unifiedTitleAndToolBarOnMac">
-   <bool>false</bool>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <layout class="QHBoxLayout" name="horizontalLayout">
-    <property name="spacing">
-     <number>0</number>
-    </property>
-    <property name="leftMargin">
-     <number>0</number>
-    </property>
-    <property name="topMargin">
-     <number>0</number>
-    </property>
-    <property name="rightMargin">
-     <number>0</number>
-    </property>
-    <property name="bottomMargin">
-     <number>0</number>
-    </property>
-    <item>
-     <widget class="QWidget" name="webContentsWidget" native="true">
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <property name="spacing">
-        <number>0</number>
-       </property>
-       <property name="leftMargin">
-        <number>0</number>
-       </property>
-       <property name="topMargin">
-        <number>0</number>
-       </property>
-       <property name="rightMargin">
-        <number>0</number>
-       </property>
-       <property name="bottomMargin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QWidget" name="urlBarWidget" native="true">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <item>
-           <widget class="QLineEdit" name="urlBar"/>
-          </item>
-          <item>
-           <widget class="QPushButton" name="reloadButton">
-            <property name="text">
-             <string/>
-            </property>
-            <property name="icon">
-             <iconset resource="stylesheetbrowser.qrc">
-              <normaloff>:/view-refresh.png</normaloff>:/view-refresh.png</iconset>
-            </property>
-            <property name="shortcut">
-             <string>Ctrl+R</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="settingsButton">
-            <property name="text">
-             <string>Settings</string>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <widget class="QWebEngineView" name="webEngineView" native="true">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="url" stdset="0">
-          <url>
-           <string>about:blank</string>
-          </url>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menuBar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>713</width>
-     <height>20</height>
-    </rect>
-   </property>
-  </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <customwidgets>
-  <customwidget>
-   <class>QWebEngineView</class>
-   <extends>QWidget</extends>
-   <header location="global">QtWebEngineWidgets/QWebEngineView</header>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="stylesheetbrowser.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc b/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc
deleted file mode 100644
index a1cebd6a77c..00000000000
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file alias="view-refresh.png">3rdparty/view-refresh.png</file>
-    </qresource>
-</RCC>
diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro
index aedd2cc627b..2a24686cf28 100644
--- a/examples/webenginewidgets/webenginewidgets.pro
+++ b/examples/webenginewidgets/webenginewidgets.pro
@@ -7,12 +7,11 @@ SUBDIRS += \
     cookiebrowser \
     notifications \
     simplebrowser \
-    stylesheetbrowser \
     push-notifications \
     videoplayer
 
 qtConfig(webengine-geolocation): SUBDIRS += maps
-qtConfig(webengine-webchannel): SUBDIRS += markdowneditor
+qtConfig(webengine-webchannel): SUBDIRS += recipebrowser
 
 qtConfig(webengine-printing-and-pdf) {
     SUBDIRS += printme html2pdf
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 14e6c3ed84b..84f71cf1061 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -61,7 +61,7 @@
     new windows, such as pop-up windows, you can subclass QWebEngineView and
     reimplement the createWindow() function.
 
-    \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}, {WebEngine Markdown Editor Example}
+    \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}, {WebEngine Recipe Browser Example}
 */
 
 

From 5bdc4bf4048a18ece193c9baf8f283add6639dc3 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 15 Mar 2023 15:07:19 +0100
Subject: [PATCH 145/681] Rework painting integration and support Metal RHI
 over ANGLE

Move graphics details into compositor, and add support for a native
buffer mode uses ANGLE on the Chromium side.

The initially support is for Metal.

Fixes: QTBUG-112282
Task-number: QTBUG-112280
Change-Id: I066ba1d3e72508e047d259ae5797659d45335fb2
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit cceda0895b3aca208e37669b2acb38c01e9f1774)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt                       |   8 +
 src/core/api/qtwebenginecoreglobal.cpp        |   3 +-
 src/core/compositor/compositor.cpp            |  21 +-
 src/core/compositor/compositor.h              |  36 +-
 src/core/compositor/display_overrides.cpp     |  13 +-
 .../compositor/display_skia_output_device.cpp |  52 ++-
 .../compositor/display_skia_output_device.h   |   7 +-
 .../display_software_output_surface.cpp       |  13 +-
 .../compositor/native_skia_output_device.cpp  | 391 ++++++++++++++++++
 .../compositor/native_skia_output_device.h    | 103 +++++
 .../native_skia_output_device_mac.mm          |  30 ++
 .../native_skia_output_device_mac2.mm         |  25 ++
 src/core/ozone/gl_share_context_qt.cpp        |   8 +
 src/core/ozone/gl_share_context_qt.h          |   2 +-
 ...nder_widget_host_view_qt_delegate_item.cpp |  69 ++--
 ...render_widget_host_view_qt_delegate_item.h |   1 +
 src/core/web_engine_context.cpp               |  63 ++-
 .../api/qtwebenginequickglobal.cpp            |   2 +-
 18 files changed, 732 insertions(+), 115 deletions(-)
 create mode 100644 src/core/compositor/native_skia_output_device.cpp
 create mode 100644 src/core/compositor/native_skia_output_device.h
 create mode 100644 src/core/compositor/native_skia_output_device_mac.mm
 create mode 100644 src/core/compositor/native_skia_output_device_mac2.mm

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 9ae5f42144b..8946c76b824 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -99,6 +99,7 @@ foreach(arch ${archs})
                 compositor/content_gpu_client_qt.cpp compositor/content_gpu_client_qt.h
                 compositor/display_overrides.cpp
                 compositor/display_software_output_surface.cpp compositor/display_software_output_surface.h
+                compositor/native_skia_output_device.cpp compositor/native_skia_output_device.h
                 content_browser_client_qt.cpp content_browser_client_qt.h
                 content_client_qt.cpp content_client_qt.h
                 content_main_delegate_qt.cpp content_main_delegate_qt.h
@@ -219,6 +220,12 @@ foreach(arch ${archs})
                 compositor/display_skia_output_device.cpp compositor/display_skia_output_device.h
         )
 
+        extend_gn_target(${buildGn} CONDITION MACOS
+            SOURCES
+                compositor/native_skia_output_device_mac.mm
+                compositor/native_skia_output_device_mac2.mm
+        )
+
         extend_gn_target(${buildGn} CONDITION MACOS AND QT_FEATURE_opengl
             SOURCES
                 macos_context_type_helper.mm macos_context_type_helper.h
@@ -493,6 +500,7 @@ foreach(arch ${archs})
             list(APPEND gnArgArg
                 use_external_popup_menu=false
                 angle_enable_vulkan=false
+                use_static_angle=true
             )
         endif()
 
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 1dded108605..3301695b356 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -212,7 +212,8 @@ static void initialize()
     // QCoreApplication is not yet instantiated, ensuring the call will be deferred
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi)
+    if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi
+        && api != QSGRendererInterface::MetalRhi)
         QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
 #endif // QT_CONFIG(opengl)
 }
diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index fed395cb128..c147f988b35 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -137,36 +137,27 @@ Compositor::Handle<Compositor::Observer> Compositor::observer()
     return nullptr;
 }
 
-QImage Compositor::image()
-{
-    Q_UNREACHABLE();
-    return {};
-}
-
 void Compositor::waitForTexture()
 {
-    Q_UNREACHABLE();
 }
 
-int Compositor::textureId()
+void Compositor::releaseTexture()
 {
-    Q_UNREACHABLE();
-    return 0;
 }
 
-#if QT_CONFIG(webengine_vulkan)
-VkImage Compositor::vkImage(QQuickWindow *)
+QSGTexture *Compositor::texture(QQuickWindow *, uint32_t textureOptions)
 {
     Q_UNREACHABLE();
-    return {};
+    return nullptr;
 }
 
-VkImageLayout Compositor::vkImageLayout()
+bool Compositor::textureIsFlipped()
 {
     Q_UNREACHABLE();
-    return {};
+    return false;
 }
 
+#if QT_CONFIG(webengine_vulkan)
 void Compositor::releaseVulkanResources(QQuickWindow *)
 {
     Q_UNREACHABLE();
diff --git a/src/core/compositor/compositor.h b/src/core/compositor/compositor.h
index 21263150bd2..018d965ba82 100644
--- a/src/core/compositor/compositor.h
+++ b/src/core/compositor/compositor.h
@@ -7,14 +7,10 @@
 #include <QtGui/qtguiglobal.h>
 #include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
 
-#if QT_CONFIG(webengine_vulkan)
-#include <QVulkanInstance>
-#endif
-
 QT_BEGIN_NAMESPACE
-class QImage;
 class QQuickWindow;
 class QSize;
+class QSGTexture;
 QT_END_NAMESPACE
 
 namespace viz {
@@ -25,9 +21,8 @@ namespace QtWebEngineCore {
 
 // Produces composited frames for display.
 //
-// Used by quick/widgets libraries for accessing the frame and
-// controlling frame swapping. Must be cast to a subclass to access
-// the frame as QImage or OpenGL texture, etc.
+// Used by quick/widgets libraries for accessing the frames and
+// controlling frame swapping.
 class Q_WEBENGINECORE_PRIVATE_EXPORT Compositor
 {
     struct Binding;
@@ -38,6 +33,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT Compositor
         Software,
         OpenGL,
         Vulkan,
+        NativeBuffer
     };
 
     // Identifies a compositor.
@@ -126,27 +122,19 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT Compositor
     // Whether frame needs an alpha channel.
     virtual bool requiresAlphaChannel() = 0;
 
-    // (Software) QImage of the frame.
-    //
-    // This is a big image so we should try not to make copies of it.
-    // In particular, the client should drop its QImage reference
-    // before calling swapFrame(), otherwise each swap will cause a
-    // detach.
-    virtual QImage image();
-
-    // (OpenGL) Wait on texture fence in Qt's current OpenGL context.
+    // Wait on texture to be ready aka. sync.
     virtual void waitForTexture();
 
-    // (OpenGL) Texture of the frame.
-    virtual int textureId();
+    // Release any held texture resources
+    virtual void releaseTexture();
 
-#if QT_CONFIG(webengine_vulkan)
-    // (Vulkan) VkImage of the frame.
-    virtual VkImage vkImage(QQuickWindow *win);
+    // QSGTexture of the frame.
+    virtual QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions);
 
-    // (Vulkan) Layout for vkImage().
-    virtual VkImageLayout vkImageLayout();
+    // Is the texture produced upside down?
+    virtual bool textureIsFlipped();
 
+#if QT_CONFIG(webengine_vulkan)
     // (Vulkan) Release Vulkan resources created by Qt's Vulkan instance.
     virtual void releaseVulkanResources(QQuickWindow *win);
 #endif
diff --git a/src/core/compositor/display_overrides.cpp b/src/core/compositor/display_overrides.cpp
index 3b33f5dccdb..2baff5d2044 100644
--- a/src/core/compositor/display_overrides.cpp
+++ b/src/core/compositor/display_overrides.cpp
@@ -3,10 +3,12 @@
 
 #include "display_skia_output_device.h"
 #include "display_software_output_surface.h"
+#include "native_skia_output_device.h"
 
 #include "components/viz/service/display_embedder/output_surface_provider_impl.h"
 #include "components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h"
 #include "gpu/ipc/in_process_command_buffer.h"
+
 #include <qtgui-config.h>
 
 std::unique_ptr<viz::OutputSurface>
@@ -18,6 +20,16 @@ viz::OutputSurfaceProviderImpl::CreateSoftwareOutputSurface(const RendererSettin
 std::unique_ptr<viz::SkiaOutputDevice>
 viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
 {
+    if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE) {
+        return std::make_unique<QtWebEngineCore::NativeSkiaOutputDevice>(
+                context_state_,
+                renderer_settings_.requires_alpha_channel,
+                shared_gpu_deps_->memory_tracker(),
+                dependency_.get(),
+                shared_image_factory_.get(),
+                shared_image_representation_factory_.get(),
+                GetDidSwapBuffersCompleteCallback());
+    }
 #if QT_CONFIG(opengl)
     return std::make_unique<QtWebEngineCore::DisplaySkiaOutputDevice>(
             context_state_,
@@ -28,4 +40,3 @@ viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
     return nullptr;
 #endif // QT_CONFIG(opengl)
 }
-
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index d2cce14d088..9f946219363 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -32,6 +32,8 @@
 #include <QVulkanDeviceFunctions>
 #endif // QT_CONFIG(webengine_vulkan)
 
+#include <QSGTexture>
+
 namespace QtWebEngineCore {
 
 class DisplaySkiaOutputDevice::Buffer
@@ -40,6 +42,9 @@ class DisplaySkiaOutputDevice::Buffer
     Buffer(DisplaySkiaOutputDevice *parent)
         : m_parent(parent)
         , m_shape(m_parent->m_shape)
+    {
+    }
+    void initialize()
     {
         const auto &colorType = m_shape.characterization.colorType();
         DCHECK(colorType != kUnknown_SkColorType);
@@ -77,8 +82,10 @@ class DisplaySkiaOutputDevice::Buffer
 #if QT_CONFIG(webengine_vulkan) && defined(Q_OS_WIN)
         CloseHandle(m_win32Handle);
 #endif
-        DeleteGrBackendTexture(m_parent->m_contextState.get(), &m_texture);
-        m_parent->memory_type_tracker_->TrackMemFree(m_estimatedSize);
+        if (m_texture.isValid()) {
+            DeleteGrBackendTexture(m_parent->m_contextState.get(), &m_texture);
+            m_parent->memory_type_tracker_->TrackMemFree(m_estimatedSize);
+        }
     }
 
     void createFence()
@@ -267,6 +274,9 @@ DisplaySkiaOutputDevice::DisplaySkiaOutputDevice(
 {
     capabilities_.uses_default_gl_framebuffer = false;
     capabilities_.supports_surfaceless = true;
+    capabilities_.preserve_buffer_content = true;
+    capabilities_.only_invalidates_damage_rect = false;
+    capabilities_.number_of_buffers = 3;
 
     capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] =
             kRGBA_8888_SkColorType;
@@ -309,7 +319,7 @@ void DisplaySkiaOutputDevice::SwapBuffers(BufferPresentedCallback feedback,
     {
         QMutexLocker locker(&m_mutex);
         m_taskRunner = base::ThreadTaskRunnerHandle::Get();
-        m_middleBuffer = std::move(m_backBuffer);
+        std::swap(m_middleBuffer, m_backBuffer);
         m_readyToUpdate = true;
     }
 
@@ -325,10 +335,12 @@ void DisplaySkiaOutputDevice::DiscardBackbuffer()
 {
 }
 
-SkSurface *DisplaySkiaOutputDevice::BeginPaint(std::vector<GrBackendSemaphore> *)
+SkSurface *DisplaySkiaOutputDevice::BeginPaint(std::vector<GrBackendSemaphore> *end_semaphores)
 {
-    if (!m_backBuffer || m_backBuffer->shape() != m_shape)
+    if (!m_backBuffer || m_backBuffer->shape() != m_shape) {
         m_backBuffer = std::make_unique<Buffer>(this);
+        m_backBuffer->initialize();
+    }
     return m_backBuffer->surface();
 }
 
@@ -355,16 +367,32 @@ void DisplaySkiaOutputDevice::waitForTexture()
         m_frontBuffer->consumeFence();
 }
 
-int DisplaySkiaOutputDevice::textureId()
+QSGTexture *DisplaySkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
 {
     if (!m_frontBuffer)
-        return 0;
+        return nullptr;
 
-    GrGLTextureInfo info;
-    if (!m_frontBuffer->texture().getGLTextureInfo(&info))
-        return 0;
+    QQuickWindow::CreateTextureOptions texOpts(textureOptions);
 
-    return info.fID;
+    QSGTexture *texture = nullptr;
+#if QT_CONFIG(webengine_vulkan)
+    if (type() == Type::Vulkan) {
+        VkImage image = vkImage(win);
+        VkImageLayout layout = vkImageLayout();
+        texture = QNativeInterface::QSGVulkanTexture::fromNative(image, layout, win, size(), texOpts);
+    } else
+#endif
+    {
+        GrGLTextureInfo info;
+        if (m_frontBuffer->texture().getGLTextureInfo(&info))
+            texture = QNativeInterface::QSGOpenGLTexture::fromNative(info.fID, win, size(), texOpts);
+    }
+    return texture;
+}
+
+bool DisplaySkiaOutputDevice::textureIsFlipped()
+{
+    return true;
 }
 
 QSize DisplaySkiaOutputDevice::size()
@@ -472,7 +500,7 @@ void DisplaySkiaOutputDevice::SwapBuffersFinished()
 {
     {
         QMutexLocker locker(&m_mutex);
-        m_backBuffer = std::move(m_middleBuffer);
+        std::swap(m_backBuffer, m_middleBuffer);
     }
 
     FinishSwapBuffers(gfx::SwapCompletionResult(gfx::SwapResult::SWAP_ACK),
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index 648784f5288..27bee2d1df7 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -44,13 +44,14 @@ class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compo
     // Overridden from Compositor.
     void swapFrame() override;
     void waitForTexture() override;
-    int textureId() override;
+    QSGTexture *texture(QQuickWindow *win, uint32_t texOpts) override;
+    bool textureIsFlipped() override;
     QSize size() override;
     bool requiresAlphaChannel() override;
     float devicePixelRatio() override;
 #if QT_CONFIG(webengine_vulkan)
-    VkImage vkImage(QQuickWindow *win) override;
-    VkImageLayout vkImageLayout() override;
+    VkImage vkImage(QQuickWindow *win);
+    VkImageLayout vkImageLayout();
     void releaseVulkanResources(QQuickWindow *win) override;
 #endif
 
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index 10872da27c5..9d6534c28aa 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -13,6 +13,7 @@
 
 #include <QMutex>
 #include <QPainter>
+#include <QQuickWindow>
 
 namespace QtWebEngineCore {
 
@@ -28,7 +29,8 @@ class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDev
 
     // Overridden from Compositor.
     void swapFrame() override;
-    QImage image() override;
+    QSGTexture *texture(QQuickWindow *win, uint32_t) override;
+    bool textureIsFlipped() override;
     float devicePixelRatio() override;
     QSize size() override;
     bool requiresAlphaChannel() override;
@@ -110,9 +112,14 @@ void DisplaySoftwareOutputSurface::Device::swapFrame()
     m_taskRunner.reset();
 }
 
-QImage DisplaySoftwareOutputSurface::Device::image()
+QSGTexture *DisplaySoftwareOutputSurface::Device::texture(QQuickWindow *win, uint32_t)
 {
-    return m_image;
+    return win->createTextureFromImage(m_image);
+}
+
+bool DisplaySoftwareOutputSurface::Device::textureIsFlipped()
+{
+    return false;
 }
 
 float DisplaySoftwareOutputSurface::Device::devicePixelRatio()
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
new file mode 100644
index 00000000000..47cbd1981ef
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -0,0 +1,391 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "native_skia_output_device.h"
+
+#include "type_conversion.h"
+
+#include "components/viz/common/resources/shared_image_format.h"
+#include "components/viz/service/display_embedder/skia_output_surface_dependency.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/shared_image_usage.h"
+#include "gpu/command_buffer/service/shared_image/shared_image_factory.h"
+#include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
+#include "gpu/command_buffer/service/skia_utils.h"
+#include "third_party/skia/include/gpu/GrDirectContext.h"
+#include "third_party/skia/include/core/SkSurfaceProps.h"
+#include "ui/gl/gl_fence.h"
+
+#ifdef Q_OS_MACOS
+#include "ui/gl/gl_image_io_surface.h"
+#endif
+
+#include <QQuickWindow>
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDevice::Buffer
+{
+public:
+    Buffer(NativeSkiaOutputDevice *parent)
+        : m_parent(parent)
+        , m_shape(m_parent->m_shape)
+    {
+    }
+    ~Buffer()
+    {
+        if (m_scopedSkiaWriteAccess)
+            endWriteSkia(false);
+
+        if (!m_mailbox.IsZero())
+            m_parent->m_factory->DestroySharedImage(m_mailbox);
+    }
+
+    // The following Buffer methods are based on components/viz/service/display_embedder/output_presenter.cc:
+    // Copyright 2020 The Chromium Authors
+    // Use of this source code is governed by a BSD-style license that can be
+    // found in the LICENSE file.
+    bool initialize()
+    {
+        static const uint32_t kDefaultSharedImageUsage =
+                gpu::SHARED_IMAGE_USAGE_SCANOUT | gpu::SHARED_IMAGE_USAGE_DISPLAY_READ
+              | gpu::SHARED_IMAGE_USAGE_DISPLAY_WRITE | gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT;
+        auto mailbox = gpu::Mailbox::GenerateForSharedImage();
+
+        if (!m_parent->m_factory->CreateSharedImage(mailbox,
+                                                    viz::SharedImageFormat::SinglePlane(viz::RGBA_8888),
+                                                    {m_parent->m_shape.characterization.width(), m_parent->m_shape.characterization.height()},
+                                                    m_parent->m_shape.colorSpace,
+                                                    m_parent->capabilities_.output_surface_origin == gfx::SurfaceOrigin::kTopLeft
+                                                        ? kTopLeft_GrSurfaceOrigin
+                                                        : kBottomLeft_GrSurfaceOrigin,
+                                                    kPremul_SkAlphaType,
+                                                    m_parent->m_deps->GetSurfaceHandle(), kDefaultSharedImageUsage)) {
+            LOG(ERROR) << "CreateSharedImage failed.";
+            return false;
+        }
+        m_mailbox = mailbox;
+
+        m_skiaRepresentation = m_parent->m_representationFactory->ProduceSkia(m_mailbox, m_parent->m_deps->GetSharedContextState());
+        if (!m_skiaRepresentation) {
+            LOG(ERROR) << "ProduceSkia() failed.";
+            return false;
+        }
+
+        m_overlayRepresentation = m_parent->m_representationFactory->ProduceOverlay(m_mailbox);
+        if (!m_overlayRepresentation) {
+            LOG(ERROR) << "ProduceOverlay() failed";
+            return false;
+        }
+
+        return true;
+    }
+    SkSurface *beginWriteSkia()
+    {
+        DCHECK(!m_scopedSkiaWriteAccess);
+        DCHECK(!m_presentCount);
+        DCHECK(m_endSemaphores.empty());
+
+        std::vector<GrBackendSemaphore> beginSemaphores;
+        SkSurfaceProps surface_props{0, kUnknown_SkPixelGeometry};
+
+        // Buffer queue is internal to GPU proc and handles texture initialization,
+        // so allow uncleared access.
+        m_scopedSkiaWriteAccess = m_skiaRepresentation->BeginScopedWriteAccess(
+            0 /* sampleCount */, surface_props, &beginSemaphores, &m_endSemaphores,
+            gpu::SharedImageRepresentation::AllowUnclearedAccess::kYes);
+        DCHECK(m_scopedSkiaWriteAccess);
+        if (!beginSemaphores.empty()) {
+            m_scopedSkiaWriteAccess->surface()->wait(
+                beginSemaphores.size(),
+                beginSemaphores.data(),
+                /*deleteSemaphoresAfterWait=*/false);
+        }
+        return m_scopedSkiaWriteAccess->surface();
+    }
+
+    void endWriteSkia(bool force_flush)
+    {
+        // The Flush now takes place in finishPaintCurrentBuffer on the CPU side.
+        // check if end_semaphores is not empty then flush here
+        DCHECK(m_scopedSkiaWriteAccess);
+        auto end_state = m_scopedSkiaWriteAccess->TakeEndState();
+        if (!m_endSemaphores.empty() || end_state || force_flush) {
+            GrFlushInfo flush_info = {};
+                flush_info.fNumSemaphores = m_endSemaphores.size();
+                flush_info.fSignalSemaphores = m_endSemaphores.data();
+            m_scopedSkiaWriteAccess->surface()->flush(flush_info, end_state.get());
+            auto *direct_context = m_scopedSkiaWriteAccess->surface()->recordingContext()->asDirectContext();
+            DCHECK(direct_context);
+            direct_context->submit();
+        }
+        m_scopedSkiaWriteAccess.reset();
+        m_endSemaphores.clear();
+
+        // SkiaRenderer always draws the full frame.
+        m_skiaRepresentation->SetCleared();
+    }
+
+    std::vector<GrBackendSemaphore> takeEndWriteSkiaSemaphores()
+    {
+        return std::exchange(m_endSemaphores, {});
+    }
+
+    void beginPresent()
+    {
+        if (++m_presentCount != 1) {
+            DCHECK(m_scopedOverlayReadAccess);
+            return;
+        }
+
+        DCHECK(!m_scopedSkiaWriteAccess);
+        DCHECK(!m_scopedOverlayReadAccess);
+
+        m_scopedOverlayReadAccess = m_overlayRepresentation->BeginScopedReadAccess(true);
+        DCHECK(m_scopedOverlayReadAccess);
+        m_acquireFence = TakeGpuFence(m_scopedOverlayReadAccess->TakeAcquireFence());
+    }
+
+    void endPresent()
+    {
+        if (!m_presentCount)
+            return;
+        DCHECK(m_scopedOverlayReadAccess);
+        if (--m_presentCount)
+            return;
+
+        m_scopedOverlayReadAccess.reset();
+    }
+    gl::GLImage *glImage()
+    {
+        DCHECK(m_presentCount);
+        return m_scopedOverlayReadAccess->gl_image();
+    }
+
+    void createFence()
+    {
+        // For some reason we still need to create this, but we do not need to wait on it.
+        m_fence = gl::GLFence::Create();
+    }
+
+    void consumeFence()
+    {
+        if (m_acquireFence) {
+            m_acquireFence->Wait();
+            m_acquireFence.reset();
+        }
+    }
+
+    const Shape &shape() const { return m_shape; }
+
+private:
+    NativeSkiaOutputDevice *m_parent;
+    Shape m_shape;
+    uint64_t m_estimatedSize = 0; // FIXME: estimate size
+    static std::unique_ptr<gfx::GpuFence> TakeGpuFence(gfx::GpuFenceHandle fence)
+    {
+      return fence.is_null() ? nullptr
+                             : std::make_unique<gfx::GpuFence>(std::move(fence));
+    }
+    std::unique_ptr<gfx::GpuFence> m_acquireFence;
+    std::unique_ptr<gl::GLFence> m_fence;
+    gpu::Mailbox m_mailbox;
+    std::unique_ptr<gpu::SkiaImageRepresentation> m_skiaRepresentation;
+    std::unique_ptr<gpu::SkiaImageRepresentation::ScopedWriteAccess> m_scopedSkiaWriteAccess;
+    std::unique_ptr<gpu::OverlayImageRepresentation> m_overlayRepresentation;
+    std::unique_ptr<gpu::OverlayImageRepresentation::ScopedReadAccess> m_scopedOverlayReadAccess;
+
+    std::vector<GrBackendSemaphore> m_endSemaphores;
+    int m_presentCount = 0;
+};
+
+NativeSkiaOutputDevice::NativeSkiaOutputDevice(
+        scoped_refptr<gpu::SharedContextState> contextState,
+        bool requiresAlpha,
+        gpu::MemoryTracker *memoryTracker,
+        viz::SkiaOutputSurfaceDependency *dependency,
+        gpu::SharedImageFactory *shared_image_factory,
+        gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+        DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+    : SkiaOutputDevice(contextState->gr_context(), memoryTracker, didSwapBufferCompleteCallback)
+    , Compositor(Compositor::Type::NativeBuffer)
+    , m_requiresAlpha(requiresAlpha)
+    , m_factory(shared_image_factory)
+    , m_representationFactory(shared_image_representation_factory)
+    , m_deps(dependency)
+{
+    capabilities_.uses_default_gl_framebuffer = false;
+    capabilities_.supports_surfaceless = true;
+    capabilities_.preserve_buffer_content = true;
+    capabilities_.only_invalidates_damage_rect = false;
+    capabilities_.number_of_buffers = 3;
+
+    capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] =
+            kRGBA_8888_SkColorType;
+    capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBX_8888)] =
+            kRGBA_8888_SkColorType;
+    capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRA_8888)] =
+            kRGBA_8888_SkColorType;
+    capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRX_8888)] =
+            kRGBA_8888_SkColorType;
+}
+
+NativeSkiaOutputDevice::~NativeSkiaOutputDevice()
+{
+}
+
+void NativeSkiaOutputDevice::SetFrameSinkId(const viz::FrameSinkId &id)
+{
+    bind(id);
+}
+
+bool NativeSkiaOutputDevice::Reshape(const SkSurfaceCharacterization &characterization,
+                                      const gfx::ColorSpace &colorSpace,
+                                      float device_scale_factor,
+                                      gfx::OverlayTransform transform)
+{
+    m_shape = Shape{characterization, device_scale_factor, colorSpace};
+    DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE);
+    return true;
+}
+
+void NativeSkiaOutputDevice::SwapBuffers(BufferPresentedCallback feedback,
+                                          viz::OutputSurfaceFrame frame)
+{
+    DCHECK(m_backBuffer);
+
+    StartSwapBuffers(std::move(feedback));
+    m_frame = std::move(frame);
+    {
+        QMutexLocker locker(&m_mutex);
+        m_backBuffer->createFence();
+        m_taskRunner = base::ThreadTaskRunnerHandle::Get();
+        std::swap(m_middleBuffer, m_backBuffer);
+        m_readyToUpdate = true;
+    }
+
+    if (auto obs = observer())
+        obs->readyToSwap();
+}
+
+void NativeSkiaOutputDevice::EnsureBackbuffer()
+{
+}
+
+void NativeSkiaOutputDevice::DiscardBackbuffer()
+{
+}
+
+
+SkSurface *NativeSkiaOutputDevice::BeginPaint(std::vector<GrBackendSemaphore> *end_semaphores)
+{
+    {
+        QMutexLocker locker(&m_mutex);
+        if (!m_backBuffer || m_backBuffer->shape() != m_shape) {
+            m_backBuffer = std::make_unique<Buffer>(this);
+            if (!m_backBuffer->initialize())
+                return nullptr;
+        }
+    }
+    auto surface = m_backBuffer->beginWriteSkia();
+    *end_semaphores = m_backBuffer->takeEndWriteSkiaSemaphores();
+    return surface;
+}
+
+void NativeSkiaOutputDevice::EndPaint()
+{
+    m_backBuffer->endWriteSkia(true);
+}
+
+void NativeSkiaOutputDevice::swapFrame()
+{
+    QMutexLocker locker(&m_mutex);
+    if (m_readyToUpdate) {
+        std::swap(m_frontBuffer, m_middleBuffer);
+        m_taskRunner->PostTask(FROM_HERE,
+                               base::BindOnce(&NativeSkiaOutputDevice::SwapBuffersFinished,
+                                              base::Unretained(this)));
+        m_taskRunner.reset();
+        m_readyToUpdate = false;
+        if (m_frontBuffer) {
+            m_readyWithTexture = true;
+            m_frontBuffer->beginPresent();
+        }
+    }
+}
+
+void NativeSkiaOutputDevice::waitForTexture()
+{
+    if (m_readyWithTexture)
+        m_frontBuffer->consumeFence();
+}
+
+void NativeSkiaOutputDevice::releaseTexture()
+{
+    if (m_readyWithTexture) {
+        m_frontBuffer->endPresent();
+        m_readyWithTexture = false;
+    }
+}
+
+#ifdef Q_OS_MACOS
+QSGTexture *makeMetalTexture(QQuickWindow *win, IOSurfaceRef io_surface, uint io_surface_plane, int width, int height, uint32_t textureOptions);
+
+QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+    if (!m_frontBuffer || !m_readyWithTexture)
+        return nullptr;
+    gl::GLImageIOSurface *gl_image_iosurface = gl::GLImageIOSurface::FromGLImage(m_frontBuffer->glImage());
+    QSGTexture *texture = nullptr;
+    if (gl_image_iosurface) {
+        texture = makeMetalTexture(win, gl_image_iosurface->io_surface().release(), /* plane */ 0,
+                                   m_shape.characterization.width(), m_shape.characterization.height(),
+                                   textureOptions);
+    } else {
+        qWarning() << "GLImage not an IOSURFACE";
+    }
+
+    return texture;
+}
+#else
+QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *, uint32_t)
+{
+    // Add Windows and Linux versions.
+    NOTIMPLEMENTED();
+    return nullptr;
+}
+#endif
+
+bool NativeSkiaOutputDevice::textureIsFlipped()
+{
+    return true;
+}
+
+QSize NativeSkiaOutputDevice::size()
+{
+    return m_frontBuffer ? toQt(m_frontBuffer->shape().characterization.dimensions()) : QSize();
+}
+
+bool NativeSkiaOutputDevice::requiresAlphaChannel()
+{
+    return m_requiresAlpha;
+}
+
+float NativeSkiaOutputDevice::devicePixelRatio()
+{
+    return m_frontBuffer ? m_frontBuffer->shape().devicePixelRatio : 1;
+}
+
+void NativeSkiaOutputDevice::SwapBuffersFinished()
+{
+    {
+        QMutexLocker locker(&m_mutex);
+        std::swap(m_backBuffer, m_middleBuffer);
+    }
+
+    FinishSwapBuffers(gfx::SwapCompletionResult(gfx::SwapResult::SWAP_ACK),
+                      gfx::Size(m_shape.characterization.width(), m_shape.characterization.height()),
+                      std::move(m_frame));
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/native_skia_output_device.h b/src/core/compositor/native_skia_output_device.h
new file mode 100644
index 00000000000..450f909b0b3
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device.h
@@ -0,0 +1,103 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_SKIA_OUTPUT_DEVICE_H
+#define NATIVE_SKIA_OUTPUT_DEVICE_H
+
+#include "compositor.h"
+
+#include "base/threading/thread_task_runner_handle.h"
+#include "components/viz/service/display_embedder/skia_output_device.h"
+#include "gpu/command_buffer/service/shared_context_state.h"
+
+#include <QMutex>
+
+QT_BEGIN_NAMESPACE
+class QQuickWindow;
+QT_END_NAMESPACE
+
+namespace gpu {
+class SharedImageFactory;
+class SharedImageRepresentationFactory;
+}
+
+namespace viz {
+class SkiaOutputSurfaceDependency;
+}
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDevice final : public viz::SkiaOutputDevice, public Compositor
+{
+public:
+    NativeSkiaOutputDevice(scoped_refptr<gpu::SharedContextState> contextState,
+                            bool requiresAlpha,
+                            gpu::MemoryTracker *memoryTracker,
+                            viz::SkiaOutputSurfaceDependency *dependency,
+                            gpu::SharedImageFactory *shared_image_factory,
+                            gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+                            DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+    ~NativeSkiaOutputDevice() override;
+
+    // Overridden from SkiaOutputDevice.
+    void SetFrameSinkId(const viz::FrameSinkId &frame_sink_id) override;
+    bool Reshape(const SkSurfaceCharacterization &characterization,
+                 const gfx::ColorSpace& colorSpace,
+                 float device_scale_factor,
+                 gfx::OverlayTransform transform) override;
+    void SwapBuffers(BufferPresentedCallback feedback,
+                     viz::OutputSurfaceFrame frame) override;
+    void EnsureBackbuffer() override;
+    void DiscardBackbuffer() override;
+    SkSurface *BeginPaint(std::vector<GrBackendSemaphore> *semaphores) override;
+    void EndPaint() override;
+
+    // Overridden from Compositor.
+    void swapFrame() override;
+    void waitForTexture() override;
+    void releaseTexture() override;
+    QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions) override;
+    bool textureIsFlipped() override;
+    QSize size() override;
+    bool requiresAlphaChannel() override;
+    float devicePixelRatio() override;
+
+private:
+    struct Shape
+    {
+        SkSurfaceCharacterization characterization;
+        float devicePixelRatio;
+        gfx::ColorSpace colorSpace;
+
+        bool operator==(const Shape &that) const
+        {
+            return (characterization == that.characterization &&
+                    devicePixelRatio == that.devicePixelRatio &&
+                    colorSpace == that.colorSpace);
+        }
+        bool operator!=(const Shape &that) const { return !(*this == that); }
+    };
+
+    class Buffer;
+    friend class NativeSkiaOutputDevice::Buffer;
+    void SwapBuffersFinished();
+
+    mutable QMutex m_mutex;
+    Shape m_shape;
+    std::unique_ptr<Buffer> m_frontBuffer;
+    std::unique_ptr<Buffer> m_middleBuffer;
+    std::unique_ptr<Buffer> m_backBuffer;
+    viz::OutputSurfaceFrame m_frame;
+    bool m_readyToUpdate = false;
+    bool m_readyWithTexture = false;
+    bool m_requiresAlpha;
+    scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
+
+    const raw_ptr<gpu::SharedImageFactory> m_factory;
+    const raw_ptr<gpu::SharedImageRepresentationFactory> m_representationFactory;
+    const raw_ptr<viz::SkiaOutputSurfaceDependency> m_deps;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // !NATIVE_SKIA_OUTPUT_DEVICE_H
diff --git a/src/core/compositor/native_skia_output_device_mac.mm b/src/core/compositor/native_skia_output_device_mac.mm
new file mode 100644
index 00000000000..51b11b13f85
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_mac.mm
@@ -0,0 +1,30 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#import <IOSurface/IOSurface.h>
+#import <Metal/Metal.h>
+
+#include <QtCore/qtconfigmacros.h>
+
+QT_BEGIN_NAMESPACE
+class QSGTexture;
+class QQuickWindow;
+QT_END_NAMESPACE
+
+@class MTLDevice;
+
+namespace QtWebEngineCore {
+QSGTexture *makeMetalTexture2(QQuickWindow *win, id<MTLTexture> mtlTexture, int width, int height, uint32_t textureOptions);
+MTLDevice *getRhiDev(QQuickWindow *win);
+
+QSGTexture *makeMetalTexture(QQuickWindow *win, IOSurfaceRef io_surface, uint io_surface_plane, int width, int height, uint32_t textureOptions)
+{
+    auto desc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatBGRA8Unorm
+                 width:width height:height mipmapped:false];
+
+    auto device = getRhiDev(win);
+    auto texture = [device newTextureWithDescriptor:desc iosurface:io_surface plane:io_surface_plane];
+    return makeMetalTexture2(win, texture, width, height, textureOptions);
+}
+
+} // namespace
diff --git a/src/core/compositor/native_skia_output_device_mac2.mm b/src/core/compositor/native_skia_output_device_mac2.mm
new file mode 100644
index 00000000000..645f26c617d
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_mac2.mm
@@ -0,0 +1,25 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <qquickwindow.h>
+#include <qsgrendererinterface.h>
+#include <qsgtexture.h>
+
+@class MTLDevice;
+@protocol MTLTexture;
+
+namespace QtWebEngineCore {
+
+MTLDevice *getRhiDev(QQuickWindow *win)
+{
+    QSGRendererInterface *ri = win->rendererInterface();
+    return static_cast<MTLDevice *>(ri->getResource(win, QSGRendererInterface::DeviceResource));
+}
+
+QSGTexture *makeMetalTexture2(QQuickWindow *win, id<MTLTexture> mtlTexture, int width, int height, uint32_t textureOptions)
+{
+    QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+    return QNativeInterface::QSGMetalTexture::fromNative(mtlTexture, win, {width, height}, texOpts);
+}
+
+} // namespace
diff --git a/src/core/ozone/gl_share_context_qt.cpp b/src/core/ozone/gl_share_context_qt.cpp
index 086317b4640..0290d712315 100644
--- a/src/core/ozone/gl_share_context_qt.cpp
+++ b/src/core/ozone/gl_share_context_qt.cpp
@@ -5,6 +5,9 @@
 #include <QtGui/qtgui-config.h>
 #include <qpa/qplatformnativeinterface.h>
 
+#include "ui/gl/gl_context_egl.h"
+#include "ui/gl/gl_implementation.h"
+
 #if QT_CONFIG(opengl)
 #include <QtGui/qopenglcontext_platform.h>
 #include <QOpenGLContext>
@@ -59,6 +62,11 @@ unsigned int QtShareGLContext::CheckStickyGraphicsResetStatusImpl()
 
 void ShareGroupQt::AboutToAddFirstContext()
 {
+    if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE) {
+        m_shareContextQt = new gl::GLContextEGL(nullptr);
+        return;
+    }
+
 #if QT_CONFIG(opengl)
     // This currently has to be setup by ::main in all applications using QQuickWebEngineView with
     // delegated rendering.
diff --git a/src/core/ozone/gl_share_context_qt.h b/src/core/ozone/gl_share_context_qt.h
index ba66b222c6f..89be0042118 100644
--- a/src/core/ozone/gl_share_context_qt.h
+++ b/src/core/ozone/gl_share_context_qt.h
@@ -57,7 +57,7 @@ class ShareGroupQt : public gl::GLShareGroup
     void AboutToAddFirstContext() override;
 
 private:
-    scoped_refptr<QtShareGLContext> m_shareContextQt;
+    scoped_refptr<gl::GLContext> m_shareContextQt;
 };
 } // namespace
 #endif
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index c805589cc1b..e6145f7a6da 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -320,6 +320,8 @@ void RenderWidgetHostViewQtDelegateItem::itemChange(ItemChange change, const Ite
         if (value.window) {
             m_windowConnections.append(connect(value.window, &QQuickWindow::beforeRendering,
                                                this, &RenderWidgetHostViewQtDelegateItem::onBeforeRendering, Qt::DirectConnection));
+            m_windowConnections.append(connect(value.window, &QQuickWindow::afterFrameEnd,
+                                               this, &RenderWidgetHostViewQtDelegateItem::onAfterRendering, Qt::DirectConnection));
             m_windowConnections.append(connect(value.window, SIGNAL(xChanged(int)), SLOT(onWindowPosChanged())));
             m_windowConnections.append(connect(value.window, SIGNAL(yChanged(int)), SLOT(onWindowPosChanged())));
 #if QT_CONFIG(webengine_vulkan)
@@ -347,15 +349,22 @@ QSGNode *RenderWidgetHostViewQtDelegateItem::updatePaintNode(QSGNode *oldNode, U
 {
     auto comp = compositor();
     if (!comp)
-        return nullptr;
+        return oldNode;
 
     QQuickWindow *win = QQuickItem::window();
 
+    QSGImageNode *node = nullptr;
     // Delete old node before swapFrame to decrement refcount of
     // QImage in software mode.
-    delete oldNode;
-    QSGImageNode *node = win->createImageNode();
-    node->setOwnsTexture(true);
+    if (comp->type() == Compositor::Type::Software)
+        delete oldNode;
+    else
+        node = static_cast<QSGImageNode*>(oldNode);
+
+    if (!node) {
+        node = win->createImageNode();
+        node->setOwnsTexture(true);
+    }
 
     comp->swapFrame();
 
@@ -363,36 +372,22 @@ QSGNode *RenderWidgetHostViewQtDelegateItem::updatePaintNode(QSGNode *oldNode, U
     QSizeF texSizeInDips = QSizeF(texSize) / comp->devicePixelRatio();
     node->setRect(QRectF(QPointF(0, 0), texSizeInDips));
 
-    if (comp->type() == Compositor::Type::Software) {
-        QImage image = comp->image();
-        node->setTexture(win->createTextureFromImage(image));
-#if QT_CONFIG(opengl)
-    } else if (comp->type() == Compositor::Type::OpenGL) {
-        QQuickWindow::CreateTextureOptions texOpts;
-        if (comp->requiresAlphaChannel() || m_clearColor.alpha() < 255)
-            texOpts.setFlag(QQuickWindow::TextureHasAlphaChannel);
-        else
-            texOpts.setFlag(QQuickWindow::TextureIsOpaque);
-        int texId = comp->textureId();
-        node->setTexture(QNativeInterface::QSGOpenGLTexture::fromNative(texId, win, texSize, texOpts));
-        node->setTextureCoordinatesTransform(QSGImageNode::MirrorVertically);
-#endif
-#if QT_CONFIG(webengine_vulkan)
-    } else if (comp->type() == Compositor::Type::Vulkan) {
-        QQuickWindow::CreateTextureOptions texOpts;
-        if (comp->requiresAlphaChannel() || m_clearColor.alpha() < 255)
-            texOpts.setFlag(QQuickWindow::TextureHasAlphaChannel);
-        else
-            texOpts.setFlag(QQuickWindow::TextureIsOpaque);
-
-        VkImage image = comp->vkImage(win);
-        VkImageLayout layout = comp->vkImageLayout();
-        node->setTexture(QNativeInterface::QSGVulkanTexture::fromNative(image, layout, win, texSize,
-                                                                        texOpts));
-        node->setTextureCoordinatesTransform(QSGImageNode::MirrorVertically);
-#endif // QT_CONFIG(webengine_vulkan)
+    QQuickWindow::CreateTextureOptions texOpts;
+    if (comp->requiresAlphaChannel() || m_clearColor.alpha() < 255)
+        texOpts.setFlag(QQuickWindow::TextureHasAlphaChannel);
+    else
+        texOpts.setFlag(QQuickWindow::TextureIsOpaque);
+    QSGTexture *texture = comp->texture(win, texOpts);
+    if (texture) {
+        node->setTexture(texture);
+        if (comp->textureIsFlipped())
+            node->setTextureCoordinatesTransform(QSGImageNode::MirrorVertically);
     } else {
-        Q_UNREACHABLE();
+        if (!oldNode || comp->type() == Compositor::Type::Software) {
+            qDebug("Compositor returned null texture");
+            delete node;
+            return nullptr;
+        }
     }
 
     return node;
@@ -406,6 +401,14 @@ void RenderWidgetHostViewQtDelegateItem::onBeforeRendering()
     comp->waitForTexture();
 }
 
+void RenderWidgetHostViewQtDelegateItem::onAfterRendering()
+{
+    auto comp = compositor();
+    if (!comp || comp->type() != Compositor::Type::NativeBuffer)
+        return;
+    comp->releaseTexture();
+}
+
 void RenderWidgetHostViewQtDelegateItem::onWindowPosChanged()
 {
     m_client->visualPropertiesChanged();
diff --git a/src/core/render_widget_host_view_qt_delegate_item.h b/src/core/render_widget_host_view_qt_delegate_item.h
index 6f3289157b3..6af81fea38b 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.h
+++ b/src/core/render_widget_host_view_qt_delegate_item.h
@@ -100,6 +100,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT RenderWidgetHostViewQtDelegateItem
 
 private Q_SLOTS:
     void onBeforeRendering();
+    void onAfterRendering();
     void onWindowPosChanged();
     void releaseVulkanResources();
     void onHide();
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 095b0ed50e8..fc34957b082 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -130,7 +130,8 @@ Q_LOGGING_CATEGORY(webEngineContextLog, "qt.webenginecontext")
 static bool usingSupportedSGBackend()
 {
     if (QQuickWindow::graphicsApi() != QSGRendererInterface::OpenGL
-        && QQuickWindow::graphicsApi() != QSGRendererInterface::Vulkan)
+        && QQuickWindow::graphicsApi() != QSGRendererInterface::Vulkan
+        && QQuickWindow::graphicsApi() != QSGRendererInterface::Metal)
         return false;
 
     const QStringList args = QGuiApplication::arguments();
@@ -190,6 +191,11 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
     if (disableGpu || (!tryGL && !enableGLSoftwareRendering))
         return glType;
 
+#if defined(Q_OS_MACOS)
+    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Metal)
+        return gl::kGLImplementationANGLEName;
+#endif
+
     if (!qt_gl_global_share_context() || !qt_gl_global_share_context()->isValid()) {
         qWarning("WebEngineContext is used before QtWebEngineQuick::initialize() or OpenGL context "
                  "creation failed.");
@@ -227,8 +233,14 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
     return glType;
 }
 #else
-static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
+static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu)
 {
+    if (disableGpu)
+        return gl::kGLImplementationDisabledName;
+#if defined(Q_OS_MACOS)
+    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Metal)
+        return gl::kGLImplementationANGLEName;
+#endif
     return gl::kGLImplementationDisabledName;
 }
 #endif // QT_CONFIG(opengl)
@@ -242,34 +254,41 @@ void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
 static void logContext(const char *glType, base::CommandLine *cmd)
 {
     if (Q_UNLIKELY(webEngineContextLog().isDebugEnabled())) {
-#if QT_CONFIG(opengl)
-        const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format();
-        const auto profile = QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
-                sharedFormat.profile());
-        const auto type = QMetaEnum::fromType<QSurfaceFormat::RenderableType>().valueToKey(
-                sharedFormat.renderableType());
         const base::CommandLine::SwitchMap switch_map = cmd->GetSwitches();
         QStringList params;
         for (const auto &pair : switch_map)
             params << " * " << toQt(pair.first)
                    << toQt(pair.second) << "\n";
+#if QT_CONFIG(opengl)
+        const QSurfaceFormat sharedFormat = qt_gl_global_share_context() ? qt_gl_global_share_context()->format() : QSurfaceFormat::defaultFormat();
+        const auto profile = QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
+                sharedFormat.profile());
+        const auto type = QMetaEnum::fromType<QSurfaceFormat::RenderableType>().valueToKey(
+                sharedFormat.renderableType());
         qCDebug(webEngineContextLog,
-                "\n\nGL Type: %s\n"
+                "\n\nChromium GL Backend: %s\n"
                 "Surface Type: %s\n"
                 "Surface Profile: %s\n"
                 "Surface Version: %d.%d\n"
                 "QSG RHI Backend: %s\n"
                 "Using Supported QSG Backend: %s\n"
                 "Using Software Dynamic GL: %s\n"
+                "Using Shared GL: %s\n"
                 "Using Multithreaded OpenGL: %s\n\n"
                 "Init Parameters:\n %s",
                 glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
                 qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
                 usingSupportedSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
+                qt_gl_global_share_context() ? "yes" : "no",
                 !WebEngineContext::isGpuServiceOnUIThread() ? "yes" : "no",
                 qPrintable(params.join(" ")));
 #else
-        qCDebug(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
+        qCDebug(webEngineContextLog,
+                "\n\nChromium GL Backend: %s\n"
+                "QSG RHI Backend: %s\n\n"
+                "Init Parameters:\n %s",
+                glType, qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
+                qPrintable(params.join(" ")));
 #endif //QT_CONFIG(opengl)
     }
 }
@@ -716,19 +735,21 @@ WebEngineContext::WebEngineContext()
             parsedCommandLine->AppendSwitch(switches::kIgnoreGpuBlocklist);
         }
 #if QT_CONFIG(opengl)
-        const QSurfaceFormat sharedFormat = QOpenGLContext::globalShareContext()->format();
-        if (sharedFormat.profile() == QSurfaceFormat::CompatibilityProfile)
-            parsedCommandLine->AppendSwitch(switches::kCreateDefaultGLContext);
+        if (glType != gl::kGLImplementationANGLEName) {
+            const QSurfaceFormat sharedFormat = QOpenGLContext::globalShareContext()->format();
+            if (sharedFormat.profile() == QSurfaceFormat::CompatibilityProfile)
+                parsedCommandLine->AppendSwitch(switches::kCreateDefaultGLContext);
 #if defined(Q_OS_WIN)
-        // This switch is used in Chromium's gl_context_wgl.cc file to determine whether to create
-        // an OpenGL Core Profile context. If the switch is not set, it would always try to create a
-        // Core Profile context, even if Qt uses a legacy profile, which causes
-        // "Could not share GL contexts" warnings, because it's not possible to share between Core and
-        // legacy profiles. See GLContextWGL::Initialize().
-        if (sharedFormat.renderableType() == QSurfaceFormat::OpenGL
-            && sharedFormat.profile() != QSurfaceFormat::CoreProfile)
-            parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext);
+            // This switch is used in Chromium's gl_context_wgl.cc file to determine whether to create
+            // an OpenGL Core Profile context. If the switch is not set, it would always try to create a
+            // Core Profile context, even if Qt uses a legacy profile, which causes
+            // "Could not share GL contexts" warnings, because it's not possible to share between Core and
+            // legacy profiles. See GLContextWGL::Initialize().
+            if (sharedFormat.renderableType() == QSurfaceFormat::OpenGL
+                && sharedFormat.profile() != QSurfaceFormat::CoreProfile)
+                parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext);
 #endif
+        }
 #endif //QT_CONFIG(opengl)
     } else if (!disableGpu) {
         parsedCommandLine->AppendSwitch(switches::kDisableGpu);
diff --git a/src/webenginequick/api/qtwebenginequickglobal.cpp b/src/webenginequick/api/qtwebenginequickglobal.cpp
index b16305dae94..60f7991c8a6 100644
--- a/src/webenginequick/api/qtwebenginequickglobal.cpp
+++ b/src/webenginequick/api/qtwebenginequickglobal.cpp
@@ -47,7 +47,7 @@ void initialize()
     // call initialize the same way as widgets do
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi)
+    if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi && api != QSGRendererInterface::MetalRhi)
         QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
 }
 } // namespace QtWebEngineQuick

From f8e1e9156c34b44357fe971f956006a301e0c593 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 12 Apr 2023 15:37:44 +0000
Subject: [PATCH 146/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I14edaf0c92bc473239535fdbc4946b4e792950f5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3743ec632a2..11ed98a5150 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b8c8041aaaec0b8e68b2d3f7cf4eaff4f5b13533
+    ref: 519594ac5b2206bdf12506364330e2047c88eff1
     required: true
   ../qtpositioning:
-    ref: 54e12f9a457573263111cf29ca295db0e04e441e
+    ref: e50303c0a1ceee4809e376e9e9b19a6c939d57ca
     required: false
   ../qttools:
-    ref: ba59722484f8e4765fdec00fed2583aa29db063e
+    ref: 83b3eea6c6ec7568b4c584754607d09333ffbb29
     required: false
   ../qtwebchannel:
-    ref: c37968ae50a009588bf4e02972d47cda47da9bc9
+    ref: 0dfbd1d727f18fe1e31f4d9121c016f08e5293b7
     required: false

From c486f5dd6a7141ff6cadc32124c7f31e06671669 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Tue, 11 Apr 2023 11:52:27 +0000
Subject: [PATCH 147/681] Doc: Use the \examplecategory macro to tag examples

The '\meta category' command was used for tagging examples with a
specific category, used in Qt Creators Welcome mode.

As we want to also generate lists of examples belonging to a category
elsewhere in the documentation, replace the command with a macro that
expands to the original \meta command and also adds the example to
a group using the \ingroup command. This way, the category names can
be used as arguments to the \generatelist or \annotatedlist commands.

Task-number: QTBUG-112731
Change-Id: If9519fd8994c64cf57dc4c9a9387d7be80493d80
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 89cdfed48ce61b06581c178d151d427ad7d67ac6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
index 4ac9973b396..dd701f1f2d7 100644
--- a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -4,7 +4,7 @@
 /*!
     \example webenginewidgets/recipebrowser
     \title Recipe Browser
-    \meta category {Application Examples}
+    \examplecategory {Application Examples}
     \meta tag {widgets, webengine, webchannel, webenginescript}
     \ingroup webengine-widgetexamples
     \brief Injecting custom stylsheets into web pages and providing a rich text preview

From 46cb4327ea2b4fa18e7b21f1878a3978f00aba27 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 13 Apr 2023 16:11:19 +0000
Subject: [PATCH 148/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I8196d82556288995ce52f8e2bf7839854cc9bccf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 11ed98a5150..a108793d7e9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 519594ac5b2206bdf12506364330e2047c88eff1
+    ref: 29dc46ed82ad8e683f56f7df8f3d68c3330bf3bf
     required: true
   ../qtpositioning:
-    ref: e50303c0a1ceee4809e376e9e9b19a6c939d57ca
+    ref: f0fa5991a45537d27f5a23c1889be056a5752742
     required: false
   ../qttools:
-    ref: 83b3eea6c6ec7568b4c584754607d09333ffbb29
+    ref: 4dddea47b2a4882a43abf313c31af5466a0ab1b5
     required: false
   ../qtwebchannel:
-    ref: 0dfbd1d727f18fe1e31f4d9121c016f08e5293b7
+    ref: 1c34a5df26737be9e9163f6627158d09c167127b
     required: false

From 5c16439cc4acd949296ec93cd8963526806b60ce Mon Sep 17 00:00:00 2001
From: Amir Masoud Abdol <amir.abdol@qt.io>
Date: Thu, 13 Apr 2023 16:16:35 +0200
Subject: [PATCH 149/681] Resolve duplicate symbol error

When doing unity build, `CharacterHitTolerance` collides with similarly
named variable in `qpdfdocument.cpp`.

Task-number: QTBUG-109394
Change-Id: If7ac4ec095c88bff38f3b62b4caac82f0bfd8368
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a6a97f23bcebfc7c3319607b612be3b0d59ea46f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfsearchmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index a8946ccfe29..7fe11c2fee8 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -20,7 +20,6 @@ Q_LOGGING_CATEGORY(qLcS, "qt.pdf.search")
 
 static const int UpdateTimerInterval = 100;
 static const int ContextChars = 64;
-static const double CharacterHitTolerance = 6.0;
 
 /*!
     \class QPdfSearchModel
@@ -257,6 +256,7 @@ bool QPdfSearchModelPrivate::doSearch(int page)
     }
     FPDF_SCHHANDLE sh = FPDFText_FindStart(textPage, searchString.utf16(), 0, 0);
     QList<QPdfLink> newSearchResults;
+    constexpr double CharacterHitTolerance = 6.0;
     while (FPDFText_FindNext(sh)) {
         int idx = FPDFText_GetSchResultIndex(sh);
         int count = FPDFText_GetSchCount(sh);

From 5ddd0ad9b3ecc1a82e53aac68e0d1003fe71ee06 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 17 Apr 2023 20:57:31 +0000
Subject: [PATCH 150/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I569b1030113924ef9c8b01bab72b7cb85977bfdf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index a108793d7e9..a2c43a62c45 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 29dc46ed82ad8e683f56f7df8f3d68c3330bf3bf
+    ref: b6da0b0b65806fe67b2dd5e4921baa2796bf5f5d
     required: true
   ../qtpositioning:
-    ref: f0fa5991a45537d27f5a23c1889be056a5752742
+    ref: 103522693c4b72c0f89e5b5c6d9bdde0ef948897
     required: false
   ../qttools:
-    ref: 4dddea47b2a4882a43abf313c31af5466a0ab1b5
+    ref: 3aecee0e8a7f6fd132880c367f8d17f5eec6259f
     required: false
   ../qtwebchannel:
-    ref: 1c34a5df26737be9e9163f6627158d09c167127b
+    ref: e4cec7288cc548b9497099bcebb0a63361169afb
     required: false

From ab87258d72ab545f42d17ead1c66aea042867d9f Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 18 Apr 2023 17:27:08 +0200
Subject: [PATCH 151/681] Stop disabling optimization of V8

It is no longer necessary to build successfully, and improves loading times in debug mode.

Task-number: QTBUG-110504
Change-Id: If2a49fc96aaa113a90d5573371069754da354f7a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 9c4782e178f3798d006e79f3b340b722556b9f8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 7562bffb660..25997d7f1d7 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -846,7 +846,7 @@ macro(append_build_type_setup)
     if(${config} STREQUAL "Debug")
         list(APPEND gnArgArg is_debug=true symbol_level=2)
         if(WIN32)
-            list(APPEND gnArgArg enable_iterator_debugging=true v8_optimized_debug=false)
+            list(APPEND gnArgArg enable_iterator_debugging=true)
         endif()
     elseif(${config} STREQUAL "Release")
         list(APPEND gnArgArg is_debug=false symbol_level=0)

From e7d02b8fd8ff96898d748392abe57c23f50c145e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 20 Apr 2023 09:50:18 +0000
Subject: [PATCH 152/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I27e2cde8b258ff8f00b88cf0dd2055913bd7ba30
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index a2c43a62c45..94868cbda30 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b6da0b0b65806fe67b2dd5e4921baa2796bf5f5d
+    ref: be518d69cd624efbc78b3480f2ab62ff25348892
     required: true
   ../qtpositioning:
-    ref: 103522693c4b72c0f89e5b5c6d9bdde0ef948897
+    ref: d5c01592763dc79034a8154e7f9daf1df1ae7588
     required: false
   ../qttools:
-    ref: 3aecee0e8a7f6fd132880c367f8d17f5eec6259f
+    ref: 74f93427079b03381c2faa144ee22ff45b8ad6e7
     required: false
   ../qtwebchannel:
-    ref: e4cec7288cc548b9497099bcebb0a63361169afb
+    ref: 610aaf323797871261d21207a34c1352d89fdffe
     required: false

From f42a049fd8480f354b6dfb8e1773bfb598dbd49f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 4 Apr 2023 16:13:07 +0200
Subject: [PATCH 153/681] Update Chromium

Submodule src/3rdparty 22fec96c..d3c3d748:
  * Revert "[Backport] CVE-2023-0704: Insufficient policy enforcement in DevTools"
  * Do not stop navigation during saving the page if not necessary
  * Pass through non-keymutex share handles
  * [Backport] CVE-2023-1236: Inappropriate implementation in Internals
  * [Backport] CVE-2023-0704: Insufficient policy enforcement in DevTools
  * [Backport] Security bug 1417585
  * [Backport] Security bug 1418734 (2/2)
  * [Backport] Security bug 1418734 (1/2)
  * [Backport] Security bug 1415249
  * [Backport] Security bug 1402921
  * [Backport] Security bug 1337747
  * [Backport] Security bug 1412991
  * [Backport] CVE-2023-1532: Out of bounds read in GPU Video
  * [Backport] CVE-2023-1534: Out of bounds read in ANGLE
  * [Backport] CVE-2023-1531: Use after free in ANGLE
  * [Backport] CVE-2023-1530: Use after free in PDF (2/2)
  * [Backport] CVE-2023-1530: Use after free in PDF (1/2)
  * [Backport] CVE-2023-1529: Out of bounds memory access in WebHID
  * [Backport] CVE-2023-1235: Type Confusion in DevTools
  * [Backport] CVE-2023-1232: Insufficient policy enforcement in Resource Timing
  * [Backport] CVE-2023-1233: Insufficient policy enforcement in Resource Timing
  * [Backport] CVE-2023-1222: Heap buffer overflow in Web Audio API
  * [Backport] CVE-2023-1220: Heap buffer overflow in UMA
  * [Backport] CVE-2023-1219: Heap buffer overflow in Metrics (3/3)
  * [Backport] CVE-2023-1219: Heap buffer overflow in Metrics (2/3)
  * [Backport] CVE-2023-1219: Heap buffer overflow in Metrics (1/3)
  * [Backport] CVE-2023-1218: Use after free in WebRTC
  * [Backport] CVE-2023-1217: Stack buffer overflow in Crash reporting
  * [Backport] CVE-2023-1215: Type Confusion in CSS
  * [Backport] CVE-2023-1214: Type Confusion in V8

Fixes: QTBUG-112166
Change-Id: I747f60f72cbf6847bc0ee89bee655972968da921
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ffc26420b81901bf7f47fe783f8582588451c7e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index c87bec9a9db..14249239c4f 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           110.0.5481.104
+Patched with security patches up to Chromium version:           111.0.5563.110
diff --git a/src/3rdparty b/src/3rdparty
index 22fec96c830..d3c3d7483ef 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 22fec96c83014753f8d4d709dad25902cafa1a75
+Subproject commit d3c3d7483efc6da75e40f37c1f36525b8663d3c1
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index fc34957b082..769807ca2ce 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -925,7 +925,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "110.0.5481.104"; // FIXME: Remember to update
+    return "111.0.5563.110"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From ed34a0b838ec8808ddc9e8593beb8aac133b6cda Mon Sep 17 00:00:00 2001
From: Mikolaj Boc <mikolaj.boc@qt.io>
Date: Wed, 12 Apr 2023 18:32:35 +0200
Subject: [PATCH 154/681] Clear PDF search results on document page model
 change

Not clearing the search results leads to crashes when the incoming
page model is larger than the outgoing model, due to internal
state being still in sync with the old document, but the page count
of the new document being used.

Fixes: QTBUG-111067
Change-Id: Ic81744ebe0cb7d1a152453721abd7d1b5c5fa2b9
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit d1347ebbe99b467799680bb6e3cee81932751df5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfsearchmodel.cpp | 12 ++++++++++++
 src/pdf/qpdfsearchmodel.h   |  1 +
 src/pdf/qpdfsearchmodel_p.h |  2 ++
 3 files changed, 15 insertions(+)

diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 7fe11c2fee8..3109430f0d6 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -194,11 +194,23 @@ void QPdfSearchModel::setDocument(QPdfDocument *document)
     if (d->document == document)
         return;
 
+    disconnect(d->documentConnection);
+    d->documentConnection = connect(document, &QPdfDocument::pageCountChanged, this,
+                                    &QPdfSearchModel::onDocumentPageCountChanged);
+
     d->document = document;
     d->clearResults();
     emit documentChanged();
 }
 
+void QPdfSearchModel::onDocumentPageCountChanged(int count)
+{
+    Q_UNUSED(count);
+
+    Q_D(QPdfSearchModel);
+    d->clearResults();
+}
+
 void QPdfSearchModel::timerEvent(QTimerEvent *event)
 {
     Q_D(QPdfSearchModel);
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
index c1e4e64ece6..b1094b67b5b 100644
--- a/src/pdf/qpdfsearchmodel.h
+++ b/src/pdf/qpdfsearchmodel.h
@@ -55,6 +55,7 @@ public Q_SLOTS:
 protected:
     void updatePage(int page);
     void timerEvent(QTimerEvent *event) override;
+    void onDocumentPageCountChanged(int count);
 
 private:
     QHash<int, QByteArray> m_roleNames;
diff --git a/src/pdf/qpdfsearchmodel_p.h b/src/pdf/qpdfsearchmodel_p.h
index 4922c81e90a..5ffa08f5dd2 100644
--- a/src/pdf/qpdfsearchmodel_p.h
+++ b/src/pdf/qpdfsearchmodel_p.h
@@ -45,6 +45,8 @@ class QPdfSearchModelPrivate : public QAbstractItemModelPrivate
     int rowCountSoFar = 0;
     int updateTimerId = -1;
     int nextPageToUpdate = 0;
+
+    QMetaObject::Connection documentConnection;
 };
 
 QT_END_NAMESPACE

From db2de3ebf9e0a883bd130968868f5927f799aaa9 Mon Sep 17 00:00:00 2001
From: Yigit Akcay <yigit.akcay@qt.io>
Date: Wed, 19 Apr 2023 12:10:59 +0200
Subject: [PATCH 155/681] Use paintRect instead of pageRect when printing to
 account for margins

Currently, when printing via QWebEngineView::print(), the margins are handled by QPainter and not Chromium, unlike QWebEngineView::printToPdf() or QWebEnginePage::printToPdf(). The changes in this patch don't affect the
latter two.

QPainter handles margins by making a distinction between pageRect and
paintRect, where paintRect == pageRect - margins. Furthermore, to
actually apply the top and left margin, QPainter moves paintRect by
(marginLeft, marginTop).

This means that we have to draw what is to be printed in the size of
paintRect and QPainter will move it to apply top and left margins.
Right now, this is not the case, as we draw what is to be printed in
the size of pageRect. QPainter then moves it, thereby the result
contains the top and left margins, but overflows the page on the
right and bottom, effectively cropping the final result.

In this patch we fix this by using the size of paintRect instead of
pageRect to draw what is to be printed when printing via
QWebEngineView::print().

Fixes: QTBUG-111909
Change-Id: Ibc7a9035e654e92d84a594c6dd1ec2efc6e108ff
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 421d3c4e0b57170343df57de0b222d0f57a7bcb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/printing/printer_worker.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/printing/printer_worker.cpp b/src/core/printing/printer_worker.cpp
index 9eb82c590a5..da71656236d 100644
--- a/src/core/printing/printer_worker.cpp
+++ b/src/core/printing/printer_worker.cpp
@@ -65,8 +65,8 @@ void PrinterWorker::print()
             bool isLandscape = documentSize.width() > documentSize.height();
             m_device->setPageOrientation(isLandscape ? QPageLayout::Landscape
                                                       : QPageLayout::Portrait);
-            QRectF pageRect = m_device->pageLayout().pageSize().rectPixels(m_deviceResolution);
-            documentSize = documentSize.scaled(pageRect.size(), Qt::KeepAspectRatio);
+            QRectF paintRect = m_device->pageLayout().paintRectPixels(m_deviceResolution);
+            documentSize = documentSize.scaled(paintRect.size(), Qt::KeepAspectRatio);
 
             // setPageOrientation has to be called before qpainter.begin() or before
             // qprinter.newPage() so correct metrics is used, therefore call begin now for only

From 04b23af98ce3d0841eda2ed14391234705b46c64 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 29 Mar 2023 16:21:37 +0200
Subject: [PATCH 156/681] Support painting to Direct3D11 using ANGLE

Task-number: QTBUG-112280
Fixes: QTBUG-109401
Change-Id: Iaebb79921030ce42bcfe8be1ba46d309c93dca6d
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 479d9d965acaff3fc08412d56ce205e8c8822dbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt                       |  2 +
 src/core/api/qtwebenginecoreglobal.cpp        |  6 +-
 .../compositor/native_skia_output_device.cpp  | 56 ++++++++++++++++++-
 src/core/ozone/gl_share_context_qt.cpp        |  2 +-
 src/core/web_engine_context.cpp               |  9 ++-
 .../api/qtwebenginequickglobal.cpp            |  5 +-
 6 files changed, 71 insertions(+), 9 deletions(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 8946c76b824..1adcf50b38c 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -323,6 +323,7 @@ foreach(arch ${archs})
             angle_enable_swiftshader=false
             dawn_use_swiftshader=false
             use_dawn=false
+            build_dawn_tests=false
             enable_vr=false
             enable_web_speech=false
             enable_widevine=true
@@ -516,6 +517,7 @@ foreach(arch ${archs})
                 com_init_check_hook_disabled=true
                 heterogeneous_executables=true
                 enable_vr=false
+                use_static_angle=true
             )
         endif()
 
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 3301695b356..d8d3d3b26dc 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -212,9 +212,9 @@ static void initialize()
     // QCoreApplication is not yet instantiated, ensuring the call will be deferred
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi
-        && api != QSGRendererInterface::MetalRhi)
-        QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
+    if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan
+        && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)
+        QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
 #endif // QT_CONFIG(opengl)
 }
 
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
index 47cbd1981ef..aa0be8c264f 100644
--- a/src/core/compositor/native_skia_output_device.cpp
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -16,8 +16,12 @@
 #include "third_party/skia/include/core/SkSurfaceProps.h"
 #include "ui/gl/gl_fence.h"
 
-#ifdef Q_OS_MACOS
+#if defined(Q_OS_MACOS)
 #include "ui/gl/gl_image_io_surface.h"
+#elif defined(Q_OS_WIN)
+#include "ui/gl/gl_image_d3d.h"
+#include <QtQuick/qsgtexture.h>
+#include <d3d11_1.h>
 #endif
 
 #include <QQuickWindow>
@@ -155,6 +159,10 @@ class NativeSkiaOutputDevice::Buffer
             return;
 
         m_scopedOverlayReadAccess.reset();
+        if (m_textureCleanup) {
+            m_textureCleanup();
+            m_textureCleanup = nullptr;
+        }
     }
     gl::GLImage *glImage()
     {
@@ -178,6 +186,7 @@ class NativeSkiaOutputDevice::Buffer
 
     const Shape &shape() const { return m_shape; }
 
+    std::function<void()> m_textureCleanup;
 private:
     NativeSkiaOutputDevice *m_parent;
     Shape m_shape;
@@ -347,10 +356,53 @@ QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureO
 
     return texture;
 }
+#elif defined(Q_OS_WIN)
+QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+    if (!m_frontBuffer || !m_readyWithTexture)
+        return nullptr;
+    Q_ASSERT(QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11);
+
+    QSGTexture *texture = nullptr;
+    gl::GLImageD3D *gl_image_d3d = gl::GLImageD3D::FromGLImage(m_frontBuffer->glImage());
+    if (gl_image_d3d) {
+        // Pass texture between two D3D devices:
+        HRESULT status = S_OK;
+        HANDLE sharedHandle;
+        sharedHandle = gl_image_d3d->shared_handle();
+        if (!sharedHandle) {
+            qWarning() << "No shared handle";
+            return nullptr;
+        }
+        Q_ASSERT(sharedHandle);
+
+        HANDLE sharedHandleDup;
+        DuplicateHandle(GetCurrentProcess(), sharedHandle, GetCurrentProcess(), &sharedHandleDup, 0, FALSE, DUPLICATE_SAME_ACCESS);
+
+        QSGRendererInterface *ri = win->rendererInterface();
+        ID3D11Device1 *device = static_cast<ID3D11Device1 *>(ri->getResource(win, QSGRendererInterface::DeviceResource));
+
+        ID3D11Texture2D *qtTexture;
+        status = device->OpenSharedResource1(sharedHandleDup, __uuidof(ID3D11Texture2D), (void**)&qtTexture);
+        Q_ASSERT(status == S_OK);
+
+        QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+        texture = QNativeInterface::QSGD3D11Texture::fromNative(qtTexture, win, size(), texOpts);
+
+        m_frontBuffer->m_textureCleanup = [qtTexture,sharedHandleDup]() {
+            qtTexture->Release();
+            ::CloseHandle(sharedHandleDup);
+        };
+    } else {
+        qWarning() << "GLImage is not D3D";
+    }
+
+    return texture;
+}
 #else
 QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *, uint32_t)
 {
-    // Add Windows and Linux versions.
+    // Add Linux versions.
     NOTIMPLEMENTED();
     return nullptr;
 }
diff --git a/src/core/ozone/gl_share_context_qt.cpp b/src/core/ozone/gl_share_context_qt.cpp
index 0290d712315..35bd18f22de 100644
--- a/src/core/ozone/gl_share_context_qt.cpp
+++ b/src/core/ozone/gl_share_context_qt.cpp
@@ -77,7 +77,7 @@ void ShareGroupQt::AboutToAddFirstContext()
                "QCoreApplication is created.");
     }
     m_shareContextQt = new QtShareGLContext(shareContext);
-#endif
+#endif // QT_CONFIG(opengl)
 }
 
 } // namespace
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 769807ca2ce..cc4c89609ae 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -131,7 +131,8 @@ static bool usingSupportedSGBackend()
 {
     if (QQuickWindow::graphicsApi() != QSGRendererInterface::OpenGL
         && QQuickWindow::graphicsApi() != QSGRendererInterface::Vulkan
-        && QQuickWindow::graphicsApi() != QSGRendererInterface::Metal)
+        && QQuickWindow::graphicsApi() != QSGRendererInterface::Metal
+        && QQuickWindow::graphicsApi() != QSGRendererInterface::Direct3D11)
         return false;
 
     const QStringList args = QGuiApplication::arguments();
@@ -194,6 +195,9 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
 #if defined(Q_OS_MACOS)
     if (QQuickWindow::graphicsApi() == QSGRendererInterface::Metal)
         return gl::kGLImplementationANGLEName;
+#elif defined(Q_OS_WIN)
+    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11)
+        return gl::kGLImplementationANGLEName;
 #endif
 
     if (!qt_gl_global_share_context() || !qt_gl_global_share_context()->isValid()) {
@@ -240,6 +244,9 @@ static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu
 #if defined(Q_OS_MACOS)
     if (QQuickWindow::graphicsApi() == QSGRendererInterface::Metal)
         return gl::kGLImplementationANGLEName;
+#elif defined(Q_OS_WIN)
+    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11)
+        return gl::kGLImplementationANGLEName;
 #endif
     return gl::kGLImplementationDisabledName;
 }
diff --git a/src/webenginequick/api/qtwebenginequickglobal.cpp b/src/webenginequick/api/qtwebenginequickglobal.cpp
index 60f7991c8a6..f8f520a05cb 100644
--- a/src/webenginequick/api/qtwebenginequickglobal.cpp
+++ b/src/webenginequick/api/qtwebenginequickglobal.cpp
@@ -47,8 +47,9 @@ void initialize()
     // call initialize the same way as widgets do
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi && api != QSGRendererInterface::MetalRhi)
-        QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
+    if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan
+            && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)
+        QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
 }
 } // namespace QtWebEngineQuick
 

From eb8774d071d0ab85a17e3b39b642c294a200c479 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Mon, 17 Apr 2023 14:48:19 +0200
Subject: [PATCH 157/681] Disable devtools screencast by default

After 73acb3b3e devtools starts with screencast opened.
Bring back old behavior.

Fixes: QTBUG-112772
Change-Id: Ifa1b860dc125e006ab5c2e3cd60a82980c32abe0
Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 59e1a33ffa4e9ba670c099e96d2677e06bf665c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/devtools_frontend_qt.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 8ac834c9ddf..731414db96f 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -15,6 +15,8 @@
 
 #include "chrome/browser/devtools/devtools_eye_dropper.h"
 #include "chrome/browser/devtools/devtools_ui_bindings.h"
+#include "chrome/common/pref_names.h"
+#include "components/prefs/scoped_user_pref_update.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/devtools_agent_host.h"
 #include "content/public/browser/navigation_controller.h"
@@ -25,6 +27,7 @@
 using namespace QtWebEngineCore;
 
 namespace {
+static const char kScreencastEnabled[] = "screencastEnabled";
 
 static std::string GetFrontendURL()
 {
@@ -80,6 +83,14 @@ DevToolsFrontendQt::DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webCon
     // bindings take ownership over devtools
     m_bindings->SetDelegate(this);
     m_bindings->AttachTo(content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents));
+
+    auto *prefService = m_bindings->profile()->GetPrefs();
+    const auto &devtoolsPrefs = prefService->GetDict(prefs::kDevToolsPreferences);
+
+    if (!devtoolsPrefs.Find(kScreencastEnabled)) {
+        ScopedDictPrefUpdate update(prefService, prefs::kDevToolsPreferences);
+        update->Set(kScreencastEnabled, "false");
+    }
 }
 
 DevToolsFrontendQt::~DevToolsFrontendQt()

From ac3b5280d2cca1ed361663b68030b04c3db2bee9 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 20 Mar 2023 08:45:26 +0100
Subject: [PATCH 158/681] Minor. Small clean up of qmake leftovers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I0ef7f97b3d76c43e815daeb7d6782215c08e4f7d
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 67eb9e151f75ff1fc570c27ede7868f40ed299ff)
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 src/core/configure.json          | 288 -------------------------------
 tests/manual/manual.pro          |   7 -
 tests/manual/quick/quick.pro     |   5 -
 tests/manual/widgets/widgets.pro |   5 -
 4 files changed, 305 deletions(-)
 delete mode 100644 src/core/configure.json
 delete mode 100644 tests/manual/manual.pro
 delete mode 100644 tests/manual/quick/quick.pro
 delete mode 100644 tests/manual/widgets/widgets.pro

diff --git a/src/core/configure.json b/src/core/configure.json
deleted file mode 100644
index e73f471cf34..00000000000
--- a/src/core/configure.json
+++ /dev/null
@@ -1,288 +0,0 @@
-{
-    "module": "webenginecore",
-    "depends": [
-        "buildtools-private",
-        "core-private",
-        "gui-private",
-        "printsupport"
-    ],
-    "condition": "module.gui && features.build-qtwebengine-core && features.webengine-core-support",
-    "testDir": "../../config.tests",
-    "commandline": {
-        "options": {
-            "webengine-alsa": "boolean",
-            "webengine-embedded-build": "boolean",
-            "webengine-full-debug-info": "boolean",
-            "webengine-icu": { "type": "enum", "name": "webengine-system-icu", "values": { "system": "yes", "qt": "no" } },
-            "webengine-ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } },
-            "webengine-opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } },
-            "webengine-webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } },
-            "webengine-pepper-plugins": "boolean",
-            "webengine-printing-and-pdf": "boolean",
-            "webengine-proprietary-codecs": "boolean",
-            "webengine-pulseaudio": "boolean",
-            "webengine-spellchecker": "boolean",
-            "webengine-native-spellchecker": "boolean",
-            "webengine-extensions": "boolean",
-            "webengine-webrtc": "boolean",
-            "webengine-webrtc-pipewire": "boolean",
-            "webengine-geolocation": "boolean",
-            "webengine-webchannel": "boolean",
-            "webengine-kerberos": "boolean",
-            "alsa": { "type": "boolean", "name": "webengine-alsa" },
-            "pulseaudio": { "type": "boolean", "name": "webengine-pulseaudio" },
-            "ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } },
-            "opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } },
-            "webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } },
-            "pepper-plugins": { "type": "boolean", "name": "webengine-pepper-plugins" },
-            "printing-and-pdf": { "type": "boolean", "name": "webengine-printing-and-pdf" },
-            "proprietary-codecs": { "type": "boolean", "name": "webengine-proprietary-codecs" },
-            "spellchecker": { "type": "boolean", "name": "webengine-spellchecker" },
-            "extensions": { "type": "boolean", "name": "webengine-extensions" },
-            "webrtc": { "type": "boolean", "name": "webengine-webrtc" }
-        }
-    },
-
-    "libraries": {
-        "webengine-alsa": {
-            "label": "alsa",
-            "test": {
-                "tail": [
-                    "#if SND_LIB_VERSION < 0x1000a  // 1.0.10",
-                    "#error Alsa version found too old, require >= 1.0.10",
-                    "#endif"
-                ]
-            },
-            "headers" : ["alsa/asoundlib.h"],
-            "sources" : [{ "type": "pkgConfig", "args": "alsa" }
-            ]
-        },
-        "webengine-poppler-cpp": {
-            "label": "poppler-cpp",
-            "sources": [
-                { "type": "pkgConfig", "args": "poppler-cpp" }
-            ]
-        },
-        "webengine-pulseaudio": {
-            "label": "pulseaudio >= 0.9.10",
-            "sources": [
-                { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" }
-            ]
-        },
-        "webengine-gio": {
-            "label": "gio",
-            "sources": [
-                { "type": "pkgConfig", "args": "gio-2.0" }
-            ]
-        }
-    },
-    "tests" : {
-        "webengine-host-compiler": {
-            "label": "host compiler",
-            "test": "hostcompiler",
-            "host": "true",
-            "type": "compile"
-        },
-        "webengine-host-pkg-config": {
-            "label": "host pkg-config",
-            "type": "detectHostPkgConfig",
-            "log": "path"
-        },
-        "webengine-embedded-build": {
-            "label": "embedded build",
-            "type": "detectEmbedded"
-        }
-    },
-    "features": {
-        "webengine-embedded-build": {
-            "label": "Embedded build",
-            "purpose": "Enables the embedded build configuration.",
-            "condition": "config.unix",
-            "autoDetect": "tests.webengine-embedded-build",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-alsa": {
-            "label": "Use ALSA",
-            "condition": "config.unix && libs.webengine-alsa",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-geolocation": {
-            "label": "Geolocation",
-            "condition": "module.positioning",
-            "output": [ "publicFeature" ]
-        },
-        "webengine-pulseaudio": {
-            "label": "Use PulseAudio",
-            "autoDetect": "config.unix",
-            "condition": "libs.webengine-pulseaudio",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-pepper-plugins": {
-            "label": "Pepper Plugins",
-            "purpose": "Enables use of Pepper Flash plugins.",
-            "autoDetect": "!features.webengine-embedded-build",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-printing-and-pdf": {
-            "label": "Printing and PDF",
-            "purpose": "Provides printing and output to PDF.",
-            "condition": "module.printsupport && features.printer",
-            "autoDetect": "!features.webengine-embedded-build",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-webchannel": {
-            "label": "WebChannel support",
-            "purpose": "Provides QtWebChannel integration.",
-            "section": "WebEngine",
-            "condition": "module.webchannel",
-            "output": [ "publicFeature" ]
-        },
-        "webengine-proprietary-codecs": {
-            "label": "Proprietary Codecs",
-            "purpose": "Enables the use of proprietary codecs such as h.264/h.265 and MP3.",
-            "autoDetect": false,
-            "output": [ "privateFeature" ]
-        },
-        "webengine-kerberos": {
-            "label": "Kerberos Authentication",
-            "purpose": "Enables Kerberos Authentication Support",
-            "autoDetect": "config.win32",
-            "section": "WebEngine",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-spellchecker": {
-            "label": "Spellchecker",
-            "purpose": "Provides a spellchecker.",
-            "output": [ "publicFeature" ]
-        },
-        "webengine-native-spellchecker": {
-            "label": "Native Spellchecker",
-            "purpose": "Use the system's native spellchecking engine.",
-            "autoDetect": false,
-            "condition": "config.macos && features.webengine-spellchecker",
-            "output": [ "publicFeature" ]
-        },
-        "webengine-extensions": {
-            "label": "Extensions",
-            "purpose": "Enables Chromium extensions within certain limits. Currently used for enabling the pdf viewer.",
-            "section": "WebEngine",
-            "condition": "features.webengine-printing-and-pdf",
-            "autoDetect": "features.webengine-printing-and-pdf",
-            "output": [ "publicFeature" ]
-        },
-        "webengine-webrtc": {
-            "label": "WebRTC",
-            "purpose": "Provides WebRTC support.",
-            "autoDetect": "!features.webengine-embedded-build",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-webrtc-pipewire": {
-            "label": "PipeWire over GIO",
-            "purpose": "Provides PipeWire support in WebRTC using GIO.",
-            "condition": "features.webengine-webrtc && libs.webengine-gio",
-            "autoDetect": "false",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-ozone" : {
-             "label": "Support qpa-xcb",
-             "condition": "features.webengine-ozone-x11",
-             "output": [ "privateFeature" ]
-        },
-        "webengine-poppler-cpp": {
-            "label": "poppler-cpp",
-            "autoDetect": "config.unix",
-            "condition": "libs.webengine-poppler-cpp",
-            "output": [ "privateFeature" ]
-        },
-        "webengine-full-debug-info": {
-            "label": "Full debug information",
-            "purpose": "Enables debug information for Blink and V8.",
-            "autoDetect": false,
-            "condition": "config.debug || features.debug_and_release || features.force_debug_info",
-            "output": [
-              { "type": "privateConfig", "name": "v8base_debug" },
-              { "type": "privateConfig", "name": "webcore_debug" }
-            ]
-        }
-    },
-
-    "report": [
-        {
-            "type": "warning",
-            "condition": "config.unix && !features.webengine-host-pkg-config",
-            "message": "host pkg-config not found"
-        },
-        {
-            "type": "warning",
-            "condition": "config.linux && features.webengine-embedded-build && !features.webengine-system-ffmpeg && arch.arm && !features.webengine-arm-thumb",
-            "message": "Thumb instruction set is required to build ffmpeg for QtWebEngine."
-        }
-    ],
-
-    "summary": [
-        {
-            "section": "Qt WebEngineCore",
-            "condition": "features.build-qtwebengine-core",
-            "entries": [
-                "webengine-embedded-build",
-                "webengine-full-debug-info",
-                "webengine-pepper-plugins",
-                "webengine-printing-and-pdf",
-                "webengine-proprietary-codecs",
-                "webengine-spellchecker",
-                "webengine-native-spellchecker",
-                "webengine-webrtc",
-                "webengine-webrtc-pipewire",
-                "webengine-geolocation",
-                "webengine-webchannel",
-                "webengine-kerberos",
-                "webengine-extensions",
-                {
-                    "type": "feature",
-                    "args": "webengine-ozone",
-                    "condition": "config.unix"
-                },
-                {
-                    "type": "feature",
-                    "args": "webengine-alsa",
-                    "condition": "config.unix"
-                },
-                {
-                    "type": "feature",
-                    "args": "webengine-pulseaudio",
-                    "condition": "config.unix"
-                },
-                {
-                    "message": "macOS version",
-                    "type": "macosToolchainVersion",
-                    "args": "macosVersion",
-                    "condition": "config.macos"
-                },
-                {
-                    "message": "Xcode version",
-                    "type": "macosToolchainVersion",
-                    "args": "xcodeVersion",
-                    "condition": "config.macos"
-                },
-                {
-                    "message": "Clang version",
-                    "type": "macosToolchainVersion",
-                    "args": "clangVersion",
-                    "condition": "config.macos"
-                },
-                {
-                    "message": "macOS SDK version",
-                    "type": "macosToolchainVersion",
-                    "args": "sdkVersion",
-                    "condition": "config.macos"
-                },
-                {
-                    "message": "macOS minimum deployment target",
-                    "type": "macosToolchainVersion",
-                    "args": "deploymentTarget",
-                    "condition": "config.macos"
-                }
-            ]
-        }
-    ]
-}
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
deleted file mode 100644
index edf95846cbe..00000000000
--- a/tests/manual/manual.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
-    widgets \
-    quick
-
-!qtHaveModule(webenginewidgets): SUBDIRS -= widgets
diff --git a/tests/manual/quick/quick.pro b/tests/manual/quick/quick.pro
deleted file mode 100644
index 8522763f859..00000000000
--- a/tests/manual/quick/quick.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
-    faviconbrowser \
-    touchbrowser
diff --git a/tests/manual/widgets/widgets.pro b/tests/manual/widgets/widgets.pro
deleted file mode 100644
index 34e88f0e3a4..00000000000
--- a/tests/manual/widgets/widgets.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE= subdirs
-
-SUBDIRS += \
-    inputmethods \
-    webgl

From d3bb2fbefeb5ebfef6e573017b1f885b3169ffad Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sat, 22 Apr 2023 16:10:13 +0100
Subject: [PATCH 159/681] Fix build with GCC 13

Fixes: QTBUG-111697
Change-Id: Ife05645ae96d1e18727d8d79efbbd64f813b8dcd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 778554ec28039dd5ddaf536be9776ea0f6301501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browsing_data_remover_delegate_qt.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/core/browsing_data_remover_delegate_qt.h b/src/core/browsing_data_remover_delegate_qt.h
index 4e690ffb193..a611a710cdd 100644
--- a/src/core/browsing_data_remover_delegate_qt.h
+++ b/src/core/browsing_data_remover_delegate_qt.h
@@ -4,6 +4,8 @@
 #ifndef BROWSING_DATA_REMOVER_DELEGATE_QT_H
 #define BROWSING_DATA_REMOVER_DELEGATE_QT_H
 
+#include <cstdint>
+
 #include "content/public/browser/browsing_data_remover_delegate.h"
 
 namespace QtWebEngineCore {

From 98ff0e0257389352aa8418a3d7dcbe92088b8681 Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Mon, 24 Apr 2023 11:28:08 +0200
Subject: [PATCH 160/681] Bump the minimum harfbuzz version

components/paint_preview/common/subset_font.cc includes hp-cplusplus.hh
which appeared in harfbuzz 4.3.0.

Change-Id: I147d1df34e88879826587341be58d00ede1487bb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0a0269e4f611a39911df0091d45e62ae57c2a7c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index c5e561b1227..d4810ebdd7f 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -38,7 +38,7 @@ if(PkgConfig_FOUND)
     pkg_check_modules(X11 x11)
     pkg_check_modules(XPROTO glproto)
     pkg_check_modules(GLIB glib-2.0>=2.32.0)
-    pkg_check_modules(HARFBUZZ harfbuzz>=2.9.0 harfbuzz-subset>=2.9.0)
+    pkg_check_modules(HARFBUZZ harfbuzz>=4.3.0 harfbuzz-subset>=4.3.0)
     pkg_check_modules(JPEG libjpeg IMPORTED_TARGET)
     pkg_check_modules(LIBEVENT libevent)
     pkg_check_modules(MINIZIP minizip)

From c52fcde53cefbe4e69993a9dc4b696e059b0fb9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 21 Apr 2023 23:37:28 +0200
Subject: [PATCH 161/681] Remove assert on outer web contents in accessibility

It was introduced under the assumption that the accessibility would only
not be available for guest views, but it is also the case for child frames.

Change-Id: I202b598cde98f84a40dcbb0ee24f2569c5d9ee65
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2d1506e345df8be568d6ece2cfb7c461dcbeebc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_manager_qt.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 8aa245e6826..49a193b057a 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -37,9 +37,6 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
 #if QT_CONFIG(webengine_extensions)
     // Accessibility is not supported for guest views.
     if (!access) {
-        Q_ASSERT(content::WebContents::FromRenderFrameHost(
-                         static_cast<content::RenderFrameHostImpl *>(delegate))
-                         ->GetOuterWebContents());
         return nullptr;
     }
 #endif // QT_CONFIG(webengine_extensions)

From 03f58a2980c85e51d77c6161f89f6257737bafcf Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 25 Apr 2023 13:51:14 +0200
Subject: [PATCH 162/681] Don't show QtWebEngineProcess in the dock
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Added Info_mac.plist.in file
- Set the LSUIElement key in Info_mac.plist.in to prevent seeing a jumping icon in the dock while the OS
waits for the QtWebEngineProcess to create a window.
- Set MACOSX_BUNDLE_INFO_PLIST to Info_mac.plist.in

Fixes: QTBUG-112700
Change-Id: Ibd1dcc399ce440236b1d9b474191e3fc2f5c8ffc
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit a2d0bb9ef69bb5d677d177d91dd9ad414b915436)
---
 src/process/CMakeLists.txt    |  1 +
 src/process/Info_mac.plist.in | 44 +++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 src/process/Info_mac.plist.in

diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index 4c283da1134..63783af696c 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -69,6 +69,7 @@ if(isFramework)
     set_target_properties(${qtWebEngineProcessName} PROPERTIES
         MACOSX_BUNDLE TRUE
         INSTALL_RPATH "@loader_path/../../../../../../../"
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info_mac.plist.in"
     )
 
     target_sources(${qtWebEngineProcessName} PRIVATE QtWebEngineProcess.entitlements)
diff --git a/src/process/Info_mac.plist.in b/src/process/Info_mac.plist.in
new file mode 100644
index 00000000000..22c8c026d23
--- /dev/null
+++ b/src/process/Info_mac.plist.in
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+
+    <key>CFBundleDevelopmentRegion</key>
+    <string>en</string>
+    <key>CFBundleAllowMixedLocalizations</key>
+    <true/>
+
+    <key>NSPrincipalClass</key>
+    <string>NSApplication</string>
+
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>LSUIElement</key>
+    <true/>
+</dict>
+</plist>

From c8e59f81592c7c194231a96d97143f27ab2aab19 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 26 Apr 2023 16:56:02 +0000
Subject: [PATCH 163/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I740f8dfe387798edeab0d75328f5fde726a7803b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 94868cbda30..355f33a7f9e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: be518d69cd624efbc78b3480f2ab62ff25348892
+    ref: c241296bc7f7f341bc1f80542973d9e436bf973d
     required: true
   ../qtpositioning:
-    ref: d5c01592763dc79034a8154e7f9daf1df1ae7588
+    ref: dba2d226231980b91ac307d3243c65b77505d94b
     required: false
   ../qttools:
-    ref: 74f93427079b03381c2faa144ee22ff45b8ad6e7
+    ref: 1929f292053f89ecbb4ec3afc4928f399e567dcb
     required: false
   ../qtwebchannel:
-    ref: 610aaf323797871261d21207a34c1352d89fdffe
+    ref: 7a00fba2ed6c200f3abac84cb8c3f5926b8544fb
     required: false

From 0e782086d53df22a469a39281784ad864e88e8ee Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 28 Apr 2023 15:53:41 +0000
Subject: [PATCH 164/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iec28c0932ee9e53f0f26044903992d36d2347d5e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 355f33a7f9e..ed46702ae37 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: c241296bc7f7f341bc1f80542973d9e436bf973d
+    ref: ead4f545ed1de4b74387e4b8802366685b57825d
     required: true
   ../qtpositioning:
-    ref: dba2d226231980b91ac307d3243c65b77505d94b
+    ref: 9c534ed229720ac140919fc1846358b6ede8ba7c
     required: false
   ../qttools:
-    ref: 1929f292053f89ecbb4ec3afc4928f399e567dcb
+    ref: 027cc0aa12b756e6a2eb73ae25a44feccaa59940
     required: false
   ../qtwebchannel:
-    ref: 7a00fba2ed6c200f3abac84cb8c3f5926b8544fb
+    ref: aff4db050864fd2f4154451c715dd574041bed13
     required: false

From 4b185cd293e68fd083148719fef0e5359de6f399 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 24 Apr 2023 17:33:17 +0200
Subject: [PATCH 165/681] Fix user script management when subframes are present
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Only the main frames should administer scripts associated with it.

Fixes: QTBUG-113109
Change-Id: Ibda66f55ef99da632134a9de1425797262faba9b
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Martin Negyokru <negyokru@inf.u-szeged.hu>
(cherry picked from commit 17c64fd5d2778df4a52849e8942104d4d9555a1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../renderer/user_resource_controller.cpp     | 19 +++++++----
 .../qwebenginescript/tst_qwebenginescript.cpp | 33 +++++++++++++++++++
 2 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index c49ecd39192..ce942e0c817 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -289,10 +289,11 @@ void UserResourceController::renderFrameDestroyed(content::RenderFrame *renderFr
     FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(renderFrame);
     if (it == m_frameUserScriptMap.end()) // ASSERT maybe?
         return;
-    for (uint64_t id : std::as_const(it.value())) {
-        m_scripts.remove(id);
+    if (renderFrame->IsMainFrame()) {
+        for (uint64_t id : std::as_const(it.value()))
+            m_scripts.remove(id);
     }
-    m_frameUserScriptMap.remove(renderFrame);
+    m_frameUserScriptMap.erase(it);
 }
 
 void UserResourceController::addScriptForFrame(const QtWebEngineCore::UserScriptData &script,
@@ -304,7 +305,8 @@ void UserResourceController::addScriptForFrame(const QtWebEngineCore::UserScript
 
     if (!(*it).contains(script.scriptId))
         (*it).append(script.scriptId);
-    m_scripts.insert(script.scriptId, script);
+    if (!frame || frame->IsMainFrame())
+        m_scripts.insert(script.scriptId, script);
 }
 
 void UserResourceController::removeScriptForFrame(const QtWebEngineCore::UserScriptData &script,
@@ -315,7 +317,8 @@ void UserResourceController::removeScriptForFrame(const QtWebEngineCore::UserScr
         return;
 
     (*it).removeOne(script.scriptId);
-    m_scripts.remove(script.scriptId);
+    if (!frame || frame->IsMainFrame())
+        m_scripts.remove(script.scriptId);
 }
 
 void UserResourceController::clearScriptsForFrame(content::RenderFrame *frame)
@@ -323,8 +326,10 @@ void UserResourceController::clearScriptsForFrame(content::RenderFrame *frame)
     FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(frame);
     if (it == m_frameUserScriptMap.end())
         return;
-    for (uint64_t id : std::as_const(it.value()))
-        m_scripts.remove(id);
+    if (!frame || frame->IsMainFrame()) {
+        for (uint64_t id : std::as_const(it.value()))
+            m_scripts.remove(id);
+    }
 
     m_frameUserScriptMap.remove(frame);
 }
diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
index ed12fdba025..9ba13589f2a 100644
--- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
+++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
@@ -76,6 +76,7 @@ private Q_SLOTS:
     void scriptsInNestedIframes();
     void matchQrcUrl();
     void injectionOrder();
+    void reloadWithSubframes();
 };
 
 void tst_QWebEngineScript::domEditing()
@@ -694,6 +695,38 @@ void tst_QWebEngineScript::injectionOrder()
     QTRY_COMPARE(page.log, expected);
 }
 
+void tst_QWebEngineScript::reloadWithSubframes()
+{
+    class Page : public QWebEnginePage
+    {
+    public:
+        Page() : QWebEnginePage() {}
+        QVector<QString> log;
+
+    protected:
+        void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel, const QString &message, int,
+                                      const QString &) override
+        {
+            log.append(message);
+        }
+    } page;
+
+    QWebEngineScript s;
+    s.setInjectionPoint(QWebEngineScript::DocumentCreation);
+    s.setSourceCode(QStringLiteral("console.log('Hello');"));
+    page.scripts().insert(s);
+
+    page.setHtml(QStringLiteral("<body>"
+                                "  <h1>Test scripts working on reload </h1>"
+                                "  <iframe src='about://blank'>"
+                                "  </iframe>"
+                                "</body>"));
+    QTRY_COMPARE(page.log.size(), 1);
+
+    page.triggerAction(QWebEnginePage::Reload);
+    QTRY_COMPARE(page.log.size(), 2);
+}
+
 QTEST_MAIN(tst_QWebEngineScript)
 
 #include "tst_qwebenginescript.moc"

From ae8cf2305631061d1a6ad371aa59db8c41fd154e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 1 May 2023 07:22:31 +0000
Subject: [PATCH 166/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I96d81cd7a0b99a8daa6516b45c9c37a54fdc995b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index ed46702ae37..f28b2d251ce 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: ead4f545ed1de4b74387e4b8802366685b57825d
+    ref: b2e146691a3554cb3f0fdbe56b972777e40e8764
     required: true
   ../qtpositioning:
-    ref: 9c534ed229720ac140919fc1846358b6ede8ba7c
+    ref: e63e52aca79f0a0a245b32d4507bb657e6c92288
     required: false
   ../qttools:
-    ref: 027cc0aa12b756e6a2eb73ae25a44feccaa59940
+    ref: 638eb559a83b619648c08369eb3c4a9119489941
     required: false
   ../qtwebchannel:
-    ref: aff4db050864fd2f4154451c715dd574041bed13
+    ref: 43db6ae7e24ef1e8ab61972f2eb60fabc8db6f82
     required: false

From ed92534858050a2faabb3d122b91631957d824fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Fri, 21 Apr 2023 13:47:36 +0200
Subject: [PATCH 167/681] Doc: Remove mention of x86 cross-compilation on
 Windows
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Qt 6 doesn't support x86 builds anymore. Also, the build fails due
to Chromium issues.

Also fixed a nearby typo.

Fixes: QTBUG-113035
Change-Id: Ic2310a365220c4b53d973da00b7285d933e2a622
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 7765029d0b0fbc78af4c555fd2e4fbd3ed20f796)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-platform-notes.qdoc | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index 76f5bbfda08..98873a2aa7f 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -52,13 +52,7 @@
         \li Windows 10 SDK version 10.0.20348.0 or later
     \endlist
 
-    \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 x64 to x86 cross-compile
-    toolchain. This toolchain can be set up on the command line by running
-    \c{vcvarsall.bat amd64_x86}.
-
-    \note It is not recommended to use tools form  \c msys2 or \c cygwin to build \QWE as it may result in build errors.
+    \note It is not recommended to use tools from  \c msys2 or \c cygwin to build \QWE as it may result in build errors.
 
     \section2 Linux
 

From 852efb1195bf7e24dde25bb861394cd679bd4ade Mon Sep 17 00:00:00 2001
From: Alexey Edelev <alexey.edelev@qt.io>
Date: Wed, 12 Apr 2023 15:04:15 +0200
Subject: [PATCH 168/681] Add the use of the qt_internal_project_setup function

The function sets the required CMake variables and policies.

Task-number: QTBUG-112685
Change-Id: I5eb3f91a180f2a844a2575ed19abc28a913ce5b9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 34eff61f9c617062a1935826eb6afac675a85c9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CMakeLists.txt          | 1 +
 src/host/CMakeLists.txt | 1 +
 2 files changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b25edfa0056..1011fcfb622 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ project(QtWebEngine
     HOMEPAGE_URL "https://qt.io/"
     LANGUAGES CXX C
 )
+qt_internal_project_setup()
 
 find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
     Gui Widgets Network OpenGL Quick Qml PrintSupport
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 2b92ebe8593..08da14c1d5a 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -20,6 +20,7 @@ project(QtWebEngineConfigure
     LANGUAGES CXX C)
 
 find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+qt_internal_project_setup()
 
 set(buildDir ${CMAKE_CURRENT_BINARY_DIR})
 configure_gn_toolchain(host ${TEST_architecture_arch} ${TEST_architecture_arch}

From 9d0209892e522830326f350bf6c0b49f260e3add Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 27 Mar 2023 18:42:00 +0200
Subject: [PATCH 169/681] Do not provide v8 snapshot toolchain if not needed

We should provide v8 snapshot toolchain only in case of cross
compilation, otherwise gn can simply use current toolchain for
creating v8 snapshot generator.

This prevents triggering second pointless build of v8 and blink
to generate snapshot of v8 context for desktop builds.

Change-Id: I214b8b802c6827fbece3b2158f206b65fb768288
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8dfb4a3c514e2fcb6b65684c8e263ff180c6d06b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 25997d7f1d7..56f13f2ae9c 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1048,11 +1048,13 @@ macro(append_toolchain_setup)
         list(APPEND gnArgArg
             custom_toolchain="${buildDir}/target_toolchain:target"
             host_toolchain="${buildDir}/host_toolchain:host"
-            v8_snapshot_toolchain="${buildDir}/v8_toolchain:v8"
         )
         get_gn_arch(cpu ${TEST_architecture_arch})
         if(CMAKE_CROSSCOMPILING)
-            list(APPEND gnArgArg target_cpu="${cpu}")
+            list(APPEND gnArgArg
+                v8_snapshot_toolchain="${buildDir}/v8_toolchain:v8"
+                target_cpu="${cpu}"
+            )
         else()
             list(APPEND gnArgArg host_cpu="${cpu}")
         endif()

From a764519c6c9e6028f90610737ba8d5f6306fac24 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 3 May 2023 17:57:30 +0000
Subject: [PATCH 170/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I4a7af9228a5c76cf42e322718e926a11e325981b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index f28b2d251ce..85cddae8997 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b2e146691a3554cb3f0fdbe56b972777e40e8764
+    ref: 4f9200af8c767f078b499735f9bb41c62a5a127c
     required: true
   ../qtpositioning:
-    ref: e63e52aca79f0a0a245b32d4507bb657e6c92288
+    ref: f5ca6f089ff19906184d788e78aecbf52de6ac8b
     required: false
   ../qttools:
-    ref: 638eb559a83b619648c08369eb3c4a9119489941
+    ref: 9e105d6a07967a45d93cf3ce6092d1cebbfd53fb
     required: false
   ../qtwebchannel:
-    ref: 43db6ae7e24ef1e8ab61972f2eb60fabc8db6f82
+    ref: 7c42bc89ab1de5aad4f3782ac76449fd18a68b5a
     required: false

From 6757f18523fcc781537f5c75fe0ca05de29a1606 Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Tue, 2 May 2023 09:12:43 +0300
Subject: [PATCH 171/681] Bump version to 6.5.2

Change-Id: I7c2f0db0226a414482d8f19f2f93d62109c548ec
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index b71b9d93918..d0173741c19 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,3 +1,3 @@
-set(QT_REPO_MODULE_VERSION "6.5.1")
+set(QT_REPO_MODULE_VERSION "6.5.2")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")

From bb9327375e8485f5f084fd6e4eb5b59f331e55d7 Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Mon, 24 Apr 2023 09:32:24 +0200
Subject: [PATCH 172/681] Bump the minimum ICU version to 70

ICU 68 is too old for the Chromium branch used by qtwebengine.

Change-Id: I801d03ef7d4d12446a568c5dc9a50edeab8bf3c4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit abaa182fb9e63380f15bc96302223663638aa2f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index d4810ebdd7f..918ed7ab469 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -45,7 +45,7 @@ if(PkgConfig_FOUND)
     pkg_check_modules(PNG libpng>=1.6.0)
     pkg_check_modules(ZLIB zlib)
     pkg_check_modules(RE2 re2 IMPORTED_TARGET)
-    pkg_check_modules(ICU icu-uc>=68 icu-i18n>=68)
+    pkg_check_modules(ICU icu-uc>=70 icu-i18n>=70)
     pkg_check_modules(WEBP libwebp libwebpmux libwebpdemux)
     pkg_check_modules(LCMS2 lcms2)
     pkg_check_modules(FREETYPE freetype2 IMPORTED_TARGET)

From 8f160a91d3e3759f0670938c4eb88081b3d78cea Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 2 May 2023 09:41:17 +0200
Subject: [PATCH 173/681] Test WebWindowType parameter in CreateWindow()

- Added testcase to test WebWindowType parameter in CreateWindow.

Fixes: QTBUG-112645
Change-Id: I4f6bf452afcceeaa67ff07b879a2acd836bd8fac
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit db21f13e77982623b8342f981f31d8fa2ea12434)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../qwebenginepage/tst_qwebenginepage.cpp     | 74 +++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 34646cfedf1..ba88fd99ebf 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -267,6 +267,8 @@ private Q_SLOTS:
     void localToRemoteNavigation();
     void clientHints();
     void childFrameInput();
+    void openLinkInNewPageWithWebWindowType_data();
+    void openLinkInNewPageWithWebWindowType();
 
 private:
     static QPoint elementCenter(QWebEnginePage *page, const QString &id);
@@ -5255,6 +5257,78 @@ void tst_QWebEnginePage::childFrameInput()
     QTRY_COMPARE(page.messages[8], QString("Left"));
 }
 
+void tst_QWebEnginePage::openLinkInNewPageWithWebWindowType_data()
+{
+    QTest::addColumn<QWebEnginePage::WebWindowType>("webWindowType");
+    QTest::addColumn<QString>("elementId");
+    QTest::addColumn<Qt::MouseButton>("button");
+    QTest::addColumn<Qt::KeyboardModifier>("keyboardModififer");
+    QTest::newRow("webBrowserWindow")
+            << QWebEnginePage::WebBrowserWindow << "link" << Qt::LeftButton << Qt::ShiftModifier;
+    QTest::newRow("webBrowserTab")
+            << QWebEnginePage::WebBrowserTab << "link" << Qt::LeftButton << Qt::NoModifier;
+    QTest::newRow("webDialog") << QWebEnginePage::WebDialog << "openWindow" << Qt::LeftButton
+                               << Qt::NoModifier;
+    QTest::newRow("webBrowserBackgroundTab") << QWebEnginePage::WebBrowserBackgroundTab << "link"
+                                             << Qt::MiddleButton << Qt::NoModifier;
+}
+
+class WebWindowTypeTestPage : public QWebEnginePage
+{
+    Q_OBJECT
+
+public:
+    WebWindowType windowType;
+
+signals:
+    void windowCreated();
+
+private:
+    QWebEnginePage *createWindow(WebWindowType type) override
+    {
+        windowType = type;
+        emit windowCreated();
+        return nullptr;
+    }
+};
+
+void tst_QWebEnginePage::openLinkInNewPageWithWebWindowType()
+{
+    QFETCH(QWebEnginePage::WebWindowType, webWindowType);
+    QFETCH(QString, elementId);
+    QFETCH(Qt::MouseButton, button);
+    QFETCH(Qt::KeyboardModifier, keyboardModififer);
+
+    WebWindowTypeTestPage page;
+    QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+    QSignalSpy windowCreatedSpy(&page, &WebWindowTypeTestPage::windowCreated);
+    QWebEngineView view(&page);
+    view.resize(640, 480);
+    view.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+    page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+    page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
+    QString html = "<html><body>"
+                   "<a id='link' href='hello' target='_blank'>link</a>"
+                   "<br><br>"
+                   "<button id='openWindow' onclick='myFunction()'>Try it</button>"
+                   "<script>"
+                   "function myFunction() {"
+                   " const myWindow = window.open('', '', 'width=300,height=300');"
+                   "}"
+                   "</script>"
+                   "</body></html>";
+
+    page.setHtml(html);
+    QVERIFY(loadFinishedSpy.wait());
+
+    QTest::mouseClick(view.focusProxy(), button, keyboardModififer,
+                      elementCenter(&page, elementId));
+    QVERIFY(windowCreatedSpy.wait());
+    QCOMPARE(page.windowType, webWindowType);
+}
+
 static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
 W_QTEST_MAIN(tst_QWebEnginePage, params)
 

From e3dd4bdde06ce25dbfcbecb873816d209858d1d6 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 3 May 2023 18:20:03 +0200
Subject: [PATCH 174/681] Disable EyeDropperAPI

This patch fixes the devtools eyedropper.
The EyeDropperAPI is an experimental feature which
we don't implement and devtools uses it by default.

Change-Id: Iaa28ee5d0381750fc967dbc72d725b46b239a656
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 15fbd9b171b9ec8be6b1748f77a03233841c970d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_context.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index cc4c89609ae..3e0806e5df6 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -700,6 +700,11 @@ WebEngineContext::WebEngineContext()
     // Avoid crashing when websites tries using this feature (since 83)
     disableFeatures.push_back(features::kInstalledApp.name);
 
+    // Not implemented but it overrides the devtools eyedropper
+    // Should be sync with kEyeDropper base::Feature
+    parsedCommandLine->AppendSwitchASCII(switches::kDisableBlinkFeatures, "EyeDropperAPI");
+    disableFeatures.push_back(features::kEyeDropper.name);
+
     // Explicitly tell Chromium about default-on features we do not support
     disableFeatures.push_back(features::kBackgroundFetch.name);
     disableFeatures.push_back(features::kWebOTP.name);

From 4b62dc7506fe70d26213d00283ddead1725f4bc8 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 12 May 2023 10:32:33 +0000
Subject: [PATCH 175/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I28da811335cde361241d5f3157b4e197d2b50e92
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 85cddae8997..dfdeac56615 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4f9200af8c767f078b499735f9bb41c62a5a127c
+    ref: 48010f7f8be918e44b36fd1e0eddc940c8ad45f4
     required: true
   ../qtpositioning:
-    ref: f5ca6f089ff19906184d788e78aecbf52de6ac8b
+    ref: 1f8c1240cd8128b892d7a348ba03824b62a7e049
     required: false
   ../qttools:
-    ref: 9e105d6a07967a45d93cf3ce6092d1cebbfd53fb
+    ref: 6687d24c8d6641bfa8778b80820457b5868b6f9e
     required: false
   ../qtwebchannel:
-    ref: 7c42bc89ab1de5aad4f3782ac76449fd18a68b5a
+    ref: dcaee5fa937e2228b58e25aac468ed2e156c38ae
     required: false

From f1cf7b1e4f54b52aa9f907629a5b6c82c13349ea Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 4 May 2023 11:49:29 +0200
Subject: [PATCH 176/681] Update Chromium

Submodule src/3rdparty b5e07b71..dbb0d0bd:
* Fixup for '[Backport] CVE-2023-1818: Use after free in Vulkan. (2/2)'
* Bump V8_PATCH_LEVEL
* [Backport] CVE-2023-1815: Use after free in Networking APIs
* [Backport] Security bug 1428820 (3/3)
* [Backport] Security bug 1428820 (2/3)
* [Backport] Security bug 1428820 (1/3)
* [Backport] Security bug 1404790
* [Backport] Security bug 1360571
* [Backport] CVE-2023-2137: Heap buffer overflow in sqlite
* [Backport] CVE-2023-2134: Out of bounds memory access in Service Worker API
* [Backport] CVE-2023-2133: Out of bounds memory access in Service Worker API.
* [Backport] CVE-2023-2136: Integer overflow in Skia (2/2)
* [Backport] CVE-2023-2136: Integer overflow in Skia (1/2)
* [Backport] Security bug 1427388
* [Backport] CVE-2023-2033: Type Confusion in V8
* [Backport] CVE-2023-1818: Use after free in Vulkan. (2/2)
* [Backport] CVE-2023-1818: Use after free in Vulkan. (1/2)
* [Backport] CVE-2023-1819: Out of bounds read in Accessibility
* [Backport] CVE-2023-1813: Inappropriate implementation in Extensions
* [Backport] CVE-2023-1812: Out of bounds memory access in DOM Bindings
* [Backport] CVE-2023-1811: Use after free in Frames
* [Backport] CVE-2023-1810: Heap buffer overflow in Visuals
* Fix v8 context snapshot generator compilation
* Fix build with ICU 70
* Fixup 'Fixes for jumbo build'
* Avoid exporting API from static ANGLE builds
* Collect extra gpu info on in-process-gpu too

Change-Id: I17e57fa32674389c1783c8d33486dffa3920156f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit caead8aaa5e6cd529b7e8f0d7ca1c87bcc546ef5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 14249239c4f..d357202075c 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           111.0.5563.110
+Patched with security patches up to Chromium version:           112.0.5615.138
diff --git a/src/3rdparty b/src/3rdparty
index d3c3d7483ef..dbb0d0bdcf5 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit d3c3d7483efc6da75e40f37c1f36525b8663d3c1
+Subproject commit dbb0d0bdcf58d44531e0039d692c8c37ad3061ff
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 3e0806e5df6..c15119b354c 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -937,7 +937,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "111.0.5563.110"; // FIXME: Remember to update
+    return "112.0.5615.138"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From d103445039bcb0881f1e752aca62fcf79f3f196b Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 28 Mar 2023 08:36:09 +0200
Subject: [PATCH 177/681] Add update-chromium target and unify 'Update
 Chromium' commits

To save some typing when doing 3rdparty udpate introduce
'update-chromium' target, which creates commit with nicely
formated commit message with shas, it can be used for example
with following steps:

* qtwebengine repo is at the origin HEAD with nothing stagged
* there are some new commits in 3rdparty
* code compiles and there are no issues
* make update commit by typing in <build_dir>
    * ninja update-chromium
    or
    * cmake --build . --target update-chromium
* push the commit

You can also create the commit from <source_dir> with:
   cmake -P cmake/SubmoduleUpdate.cmake

Change-Id: Ia6b051cd2df0646707c2cc88175245841728794f
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Yigit Akcay <yigit.akcay@qt.io>
(cherry picked from commit c228e708678f32ced2efb26b9dfb24a515e8e4f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/SubmoduleUpdate.cmake | 70 +++++++++++++++++++++++++++++++++++++
 src/core/CMakeLists.txt     |  8 +++++
 2 files changed, 78 insertions(+)
 create mode 100644 cmake/SubmoduleUpdate.cmake

diff --git a/cmake/SubmoduleUpdate.cmake b/cmake/SubmoduleUpdate.cmake
new file mode 100644
index 00000000000..123db55bf3a
--- /dev/null
+++ b/cmake/SubmoduleUpdate.cmake
@@ -0,0 +1,70 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT CMAKE_SCRIPT_MODE_FILE)
+    message("This file should run only in script mode")
+    return()
+endif()
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+find_program(GIT_EXECUTABLE NAMES git REQUIRED)
+
+execute_process(
+    COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD
+    WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
+    OUTPUT_VARIABLE SUBMODULE_NEW_SHA
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+execute_process(
+    COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD:src/3rdparty
+    WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+    OUTPUT_VARIABLE SUBMODULE_OLD_SHA
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+set(shas "${SUBMODULE_OLD_SHA}..${SUBMODULE_NEW_SHA}")
+set(format "* %s")
+execute_process(
+    COMMAND ${GIT_EXECUTABLE} log
+        --pretty=format:${format}
+        --abbrev-commit ${shas}
+    WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
+    OUTPUT_VARIABLE SUBMODULE_COMMITS
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+if(SUBMODULE_COMMITS)
+   message("commits found for ${shas}")
+   execute_process(
+       COMMAND ${GIT_EXECUTABLE} add src/3rdparty
+       WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+   )
+   set(commits ${SUBMODULE_COMMITS})
+   execute_process(
+       COMMAND ${GIT_EXECUTABLE} commit
+           --allow-empty
+           -m "Update Chromium"
+           -m "Submodule src/3rdparty ${shas}:\n${commits}"
+       WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+       RESULT_VARIABLE gitResult
+       OUTPUT_VARIABLE gitOutput
+       ERROR_VARIABLE gitError
+   )
+
+   if(NOT gitResult EQUAL 0)
+       message(FATAL_ERROR "\n-- Git Commit FAILED\n${gitOutput}\n${gitError}\n${gitResult}\n")
+   else()
+       string(REGEX REPLACE "\n$" "" gnOutput "${gitOutput}")
+       message("-- Git Commit ${gitOutput}")
+       execute_process(
+           COMMAND ${GIT_EXECUTABLE} show HEAD
+           WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+       )
+   endif()
+else()
+   message(FATAL_ERROR "-- Git Commit found no commits for ${shas}")
+endif()
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1adcf50b38c..6450d37e832 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -593,3 +593,11 @@ if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
     add_dependencies(${dict_target_name} WebEngineCore)
 endif()
 
+##
+#  CHROMIUM UPDATE
+##
+
+add_custom_target(update-chromium
+    COMMAND ${CMAKE_COMMAND} -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/SubmoduleUpdate.cmake
+    DEPENDS ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/SubmoduleUpdate.cmake
+)

From 99094c116bad58c0249ef176279783f284d3e2c4 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 5 May 2023 14:23:55 +0200
Subject: [PATCH 178/681] Test for presence of local frame in runJavaScript
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It can be missing if we are in the process of shutting down.

Fixes: QTBUG-113400
Change-Id: Ib494e479db08d51825c15f54354037c265ba96b0
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 2b24435c7f5c1a4d5de117ff92d2b3c064952143)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.cpp                | 10 ++++++++--
 src/core/web_contents_adapter.cpp              |  8 ++++++++
 src/webenginequick/api/qquickwebengineview.cpp |  6 +++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 99edc724648..dff2418b536 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -1999,7 +1999,10 @@ void QWebEnginePage::runJavaScript(const QString& scriptSource, const std::funct
         return;
     }
     quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, QWebEngineScript::MainWorld);
-    d->m_variantCallbacks.insert(requestId, resultCallback);
+    if (requestId)
+        d->m_variantCallbacks.insert(requestId, resultCallback);
+    else if (resultCallback)
+        resultCallback(QVariant());
 }
 
 void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, const std::function<void(const QVariant &)> &resultCallback)
@@ -2014,7 +2017,10 @@ void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId,
     }
     if (resultCallback) {
         quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, worldId);
-        d->m_variantCallbacks.insert(requestId, resultCallback);
+        if (requestId)
+            d->m_variantCallbacks.insert(requestId, resultCallback);
+        else
+            resultCallback(QVariant());
     } else {
         d->adapter->runJavaScript(scriptSource, worldId);
     }
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 081505d7fac..37f3b13aced 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1034,6 +1034,10 @@ void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldI
     CHECK_INITIALIZED();
     content::RenderFrameHost *rfh =  m_webContents->GetPrimaryMainFrame();
     Q_ASSERT(rfh);
+    if (!static_cast<content::RenderFrameHostImpl*>(rfh)->GetAssociatedLocalFrame()) {
+        qWarning() << "Local frame is gone, not running script";
+        return;
+    }
     if (worldId == 0)
         rfh->ExecuteJavaScript(toString16(javaScript), base::NullCallback());
     else
@@ -1045,6 +1049,10 @@ quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScrip
     CHECK_INITIALIZED(0);
     content::RenderFrameHost *rfh =  m_webContents->GetPrimaryMainFrame();
     Q_ASSERT(rfh);
+    if (!static_cast<content::RenderFrameHostImpl*>(rfh)->GetAssociatedLocalFrame()) {
+        qWarning() << "Local frame is gone, not running script";
+        return 0;
+    }
     content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, m_nextRequestId);
     if (worldId == 0)
         rfh->ExecuteJavaScript(toString16(javaScript), std::move(callback));
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index 9eb8a1e2a83..5e248327d32 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -1346,7 +1346,11 @@ void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId,
     d->ensureContentsAdapter();
     if (!callback.isUndefined()) {
         quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, worldId);
-        d->m_callbacks.insert(requestId, callback);
+        if (requestId) {
+            d->m_callbacks.insert(requestId, callback);
+        } else {
+            callback.call();
+        }
     } else
         d->adapter->runJavaScript(script, worldId);
 }

From 53dbe2c337cb0337d01b38224fd084878175a55c Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 2 May 2023 09:11:55 +0200
Subject: [PATCH 179/681] Fix use of system png for qtpdf

QtPdf has own png library which is controlled by
pdfium_use_system_libpng and used by xfa.
However skia dependency also pulls root third_party
png and we need also use_system_libpng flag set accordingly.

Add missing pdfium_use_system_zlib flag too.

Fixes: QTBUG-112466
Change-Id: I08b7b32e5fd0ffe08cf77421ff2f0965755304ca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7ed48983b0cb5025bd3bde52e57f937894e7fa1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 0a039cdd141..e79bbd85e06 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -188,6 +188,14 @@ foreach(arch ${archs})
             ARGS pdf_enable_xfa_tiff
             CONDITION QT_FEATURE_pdf_xfa_tiff
         )
+        extend_gn_list(gnArgArg
+            ARGS pdfium_use_system_zlib
+            CONDITION QT_FEATURE_webengine_system_zlib
+        )
+        extend_gn_list(gnArgArg
+            ARGS pdfium_use_system_libpng use_system_libpng
+            CONDITION QT_FEATURE_webengine_system_libpng
+        )
         extend_gn_list(gnArgArg
             ARGS pdfium_use_qt_libpng
             CONDITION QT_FEATURE_webengine_qt_libpng

From ed3e91a2cac39b8b99b3640fc1a191823fa4c5dc Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 2 May 2023 12:30:01 +0200
Subject: [PATCH 180/681] Minor. Fix typo in qtharfbuzz feature label

Change-Id: I79010bae7f8627aeee894e468943cde90ce7b73f
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a3e94d3cb6d736a039e5c6e3f6e6d22487277ec9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index 918ed7ab469..35d21b8951a 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -409,7 +409,7 @@ qt_feature("webengine-system-harfbuzz" PRIVATE
     CONDITION UNIX AND TARGET Qt::Gui AND HARFBUZZ_FOUND AND QT_FEATURE_system_harfbuzz
 )
 qt_feature("webengine-qt-harfbuzz" PRIVATE
-    LABEL "qtpng"
+    LABEL "qtharfbuzz"
     CONDITION QT_FEATURE_static
         AND TARGET Qt::Gui
         AND QT_FEATURE_harfbuzz

From 8c7d83c150a72c1f18a2c8a59f4c38abab58dde2 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 11 May 2023 12:19:52 +0200
Subject: [PATCH 181/681] Enable large pdbs by default

The current limit is often hit by incremental builds when working on
webengine, and it costs us nothing to enable it.

Change-Id: I3aa96b789e0949637b174be31b5f36315718e201
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 6d8617742f179b09631653a9d2fc4da8be876a54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 56f13f2ae9c..e2812665362 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -497,6 +497,8 @@ function(add_linker_options target buildDir completeStatic)
         endif()
         get_copy_of_response_file(libs_rsp ${target} libs)
         target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${libs_rsp}>")
+        # enable larger PDBs
+        target_link_options(${cmakeTarget} PRIVATE "/pdbpagesize:8192")
         # we need libs rsp also when linking process with sandbox lib
         set_property(TARGET ${cmakeTarget} PROPERTY LIBS_RSP ${libs_rsp})
     endif()

From 28f09f3748129e0b95153dce321748cc13eb76eb Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 12 May 2023 13:30:09 +0200
Subject: [PATCH 182/681] Minor clean-up of gn arguments

Change-Id: Idd33f032cc30cd40bffcb436eb007456d2dfb78e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 737ba4c619675b1847b2a79fdbf5956cc8bdbfcf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 6450d37e832..1d183573f63 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -318,6 +318,7 @@ foreach(arch ${archs})
             enable_reporting=false
             enable_resource_allowlist_generation=false
             enable_screen_ai_service=false
+            enable_session_service=false
             enable_swiftshader=false
             enable_swiftshader_vulkan=false
             angle_enable_swiftshader=false
@@ -410,7 +411,6 @@ foreach(arch ${archs})
                 use_bluez=false
                 use_vaapi=false
                 use_udev=true
-                enable_session_service=false
                 is_cfi=false
                 use_ozone=true
                 ozone_auto_platforms=false
@@ -512,11 +512,9 @@ foreach(arch ${archs})
 
         if(WIN32)
             list(APPEND gnArgArg
-                enable_session_service=false
                 ninja_use_custom_environment_files=false
                 com_init_check_hook_disabled=true
                 heterogeneous_executables=true
-                enable_vr=false
                 use_static_angle=true
             )
         endif()

From 67914610f3bbc466aa654c9d63bd1a4edbb90497 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 15 May 2023 11:18:04 +0200
Subject: [PATCH 183/681] Fix "redundant move in initialization" warning

Moving a constant reference makes no sense.

Change-Id: I1be8d8dd787592be528e1e5d08593595c4888ac1
Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit be1c3bb212a68f08bcab2af787cc9396e82d5b6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../file_system_access_permission_request_controller.h          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/file_system_access/file_system_access_permission_request_controller.h b/src/core/file_system_access/file_system_access_permission_request_controller.h
index f1b446de6e4..e659f81a770 100644
--- a/src/core/file_system_access/file_system_access_permission_request_controller.h
+++ b/src/core/file_system_access/file_system_access_permission_request_controller.h
@@ -17,7 +17,7 @@ class FileSystemAccessPermissionRequestController : public RequestController
 public:
     FileSystemAccessPermissionRequestController(const QUrl &origin, const QUrl &filePath,
                                                 HandleType handleType, AccessFlags accessType)
-        : RequestController(std::move(origin))
+        : RequestController(origin)
         , m_filePath(filePath)
         , m_handleType(handleType)
         , m_accessType(accessType)

From 418a1b5b314b03878165640bb8012a6de11a00b7 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 28 Apr 2023 12:25:14 +0200
Subject: [PATCH 184/681] Add a clarification of GPL usage

We were listing Speech Dispatcher and XDG Shared Mime Info as GPLv2
contributions.

Fixes: QTBUG-113270
Change-Id: I9392cf12ad17a5f3efac0b245209a9ed946c2e51
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 6601ba752da3b1e76056619cc10f139300f7fed9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qwebengine-licensing.qdoc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/doc/src/qwebengine-licensing.qdoc b/src/core/doc/src/qwebengine-licensing.qdoc
index d498500220a..796a9664d90 100644
--- a/src/core/doc/src/qwebengine-licensing.qdoc
+++ b/src/core/doc/src/qwebengine-licensing.qdoc
@@ -14,6 +14,10 @@ respect the licenses of Chromium, and third-party code included in
 Chromium. The arguably most restrictive license to be respected by
 all users is LGPLv2.1.
 
+\note Any GPL licenses listed below are only used to access Linux system
+resources. \QWE does not link to nor distribute GPL binary code, and
+it does not affect users of \QWE.
+
 Third party licenses included in the sources are:
 */
 

From 87eda0d439c8971c602deb68c4325129ac18faae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 17 May 2023 12:54:44 +0200
Subject: [PATCH 185/681] [macOS] Add missing entitlements for https in
 notarized applications

There were reports about https pages being inaccessible in notarized
applications when this entitlement was missing.

Fixes: QTBUG-113524
Change-Id: Ib55fe5cd934d5c1ccc06d44486551f16105ad22e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d13dd9f71412525a8c57f89158caf324792b6074)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/process/QtWebEngineProcess.entitlements | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/process/QtWebEngineProcess.entitlements b/src/process/QtWebEngineProcess.entitlements
index f2fbabddbbd..59a4b6c1540 100644
--- a/src/process/QtWebEngineProcess.entitlements
+++ b/src/process/QtWebEngineProcess.entitlements
@@ -8,5 +8,7 @@
 	<true/>
 	<key>com.apple.security.cs.allow-jit</key>
 	<true/>
+        <key>com.apple.security.cs.disable-executable-page-protection</key>
+        <true/>
 </dict>
 </plist>

From 9f43bc4809e3f83f8694a0327d2dccb4f814aef8 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 18 May 2023 03:55:02 +0000
Subject: [PATCH 186/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I35f97e72787859845c7307741c008a246fa53ec1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index dfdeac56615..8dee9295444 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 48010f7f8be918e44b36fd1e0eddc940c8ad45f4
+    ref: f745cd21ee58ff9f9c381497e45b3cc9d0340db8
     required: true
   ../qtpositioning:
-    ref: 1f8c1240cd8128b892d7a348ba03824b62a7e049
+    ref: b4cb40e73c8954099b468b4a77a1c939bc9f0a96
     required: false
   ../qttools:
-    ref: 6687d24c8d6641bfa8778b80820457b5868b6f9e
+    ref: 64eab97327fc4248b648bef6d6a17bf3ffdb1bd2
     required: false
   ../qtwebchannel:
-    ref: dcaee5fa937e2228b58e25aac468ed2e156c38ae
+    ref: 1fd142dfc8cf2e9559309be091b704a7ac4acf36
     required: false

From 4fe0a6375bba7abfd60fda0a54d6a795735be1aa Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 9 May 2023 16:54:49 +0200
Subject: [PATCH 187/681] QuickNanoBrowser: Switch to Fusion style

Since Qt 6, the default Qt Quick Controls style is native style on
Windows and macOS. Since Qt 6.5, there is a warning to not to
customize native style:
  "QML QQuickItem: The current style does not support customization of
  this control ..."

Use non-native Fusion style instead, which appearance still resembles
the native style and is customizable.

Change-Id: Ifadd74a152b739461f2ad7ef1cb9763a2974b492
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 107447f59348513e4eed6d8ba2e56c2100a46f6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/quicknanobrowser/BrowserWindow.qml | 2 +-
 examples/webenginequick/quicknanobrowser/DownloadView.qml  | 2 +-
 examples/webenginequick/quicknanobrowser/FindBar.qml       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
index a517c5a5113..c40fc17955f 100644
--- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -4,7 +4,7 @@
 import QtCore
 import QtQml
 import QtQuick
-import QtQuick.Controls
+import QtQuick.Controls.Fusion
 import QtQuick.Layouts
 import QtQuick.Window
 import QtWebEngine
diff --git a/examples/webenginequick/quicknanobrowser/DownloadView.qml b/examples/webenginequick/quicknanobrowser/DownloadView.qml
index e16647cdba3..421b4f55cc9 100644
--- a/examples/webenginequick/quicknanobrowser/DownloadView.qml
+++ b/examples/webenginequick/quicknanobrowser/DownloadView.qml
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 import QtQuick
-import QtQuick.Controls
+import QtQuick.Controls.Fusion
 import QtWebEngine
 import QtQuick.Layouts
 
diff --git a/examples/webenginequick/quicknanobrowser/FindBar.qml b/examples/webenginequick/quicknanobrowser/FindBar.qml
index 4d130a22b25..de73f88cd1e 100644
--- a/examples/webenginequick/quicknanobrowser/FindBar.qml
+++ b/examples/webenginequick/quicknanobrowser/FindBar.qml
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 
 import QtQuick
-import QtQuick.Controls
+import QtQuick.Controls.Fusion
 import QtQuick.Layouts
 
 Rectangle {

From dce8ba4cba56bfe3e31e42f93517570e47dc8896 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 9 May 2023 15:17:10 +0200
Subject: [PATCH 188/681] QuickNanoBrowser: Make FindBar visible in dark mode

Change-Id: Iec4f3db0a6dad1eb040e44b09bc0b0000714ecdb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
(cherry picked from commit 403b4df5a14856d146a7a8c065237c8f79634043)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginequick/quicknanobrowser/FindBar.qml    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/examples/webenginequick/quicknanobrowser/FindBar.qml b/examples/webenginequick/quicknanobrowser/FindBar.qml
index de73f88cd1e..409d8dcffe8 100644
--- a/examples/webenginequick/quicknanobrowser/FindBar.qml
+++ b/examples/webenginequick/quicknanobrowser/FindBar.qml
@@ -51,6 +51,7 @@ Rectangle {
             TextField {
                 id: findTextField
                 anchors.fill: parent
+                color: "black"
                 background: Rectangle {
                     color: "transparent"
                 }
@@ -64,6 +65,7 @@ Rectangle {
         Label {
             text: activeMatch + "/" + numberOfMatches
             visible: findTextField.text != ""
+            color: "black"
         }
 
         Rectangle {
@@ -79,17 +81,29 @@ Rectangle {
             text: "<"
             enabled: numberOfMatches > 0
             onClicked: root.findPrevious()
+            contentItem: Text {
+                color: "black"
+                text: parent.text
+            }
         }
 
         ToolButton {
             text: ">"
             enabled: numberOfMatches > 0
             onClicked: root.findNext()
+            contentItem: Text {
+                color: "black"
+                text: parent.text
+            }
         }
 
         ToolButton {
             text: "x"
             onClicked: root.visible = false
+            contentItem: Text {
+                color: "black"
+                text: parent.text
+            }
         }
     }
 }

From 99b9335b031a5dbca943deec8941df2ae0a5e024 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 19 May 2023 08:05:32 +0000
Subject: [PATCH 189/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I85046fd9fdf72535bbfafa5460229d800827f6eb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8dee9295444..3e200c1edc7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f745cd21ee58ff9f9c381497e45b3cc9d0340db8
+    ref: 67478f84290efeb2218c1197507cc633f59f7e3f
     required: true
   ../qtpositioning:
-    ref: b4cb40e73c8954099b468b4a77a1c939bc9f0a96
+    ref: d98b7f0a04821582efde3b068cae923bfb5a77b9
     required: false
   ../qttools:
-    ref: 64eab97327fc4248b648bef6d6a17bf3ffdb1bd2
+    ref: 0ff9d87b4a6f6de8ef109b29ac477c693eb516b5
     required: false
   ../qtwebchannel:
-    ref: 1fd142dfc8cf2e9559309be091b704a7ac4acf36
+    ref: e2ea8c7cb352dfc88a77a3baf3c51bd8ce2bd062
     required: false

From 3a8cbb678e509937db881316942250c67cfd59ba Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 22 May 2023 08:45:36 +0000
Subject: [PATCH 190/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iac65c34ccd6055e6c56ef0c2c2d71b3677c55f06
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3e200c1edc7..dfdd55915f2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 67478f84290efeb2218c1197507cc633f59f7e3f
+    ref: d8eaea139cc6677adece04bd364e195f55dd71c9
     required: true
   ../qtpositioning:
-    ref: d98b7f0a04821582efde3b068cae923bfb5a77b9
+    ref: 921f6010e4147aa7bd921403b8c90c686e595cb8
     required: false
   ../qttools:
-    ref: 0ff9d87b4a6f6de8ef109b29ac477c693eb516b5
+    ref: 0cf5200e2adb13d6aedf64787cb8be0fc4d050c0
     required: false
   ../qtwebchannel:
-    ref: e2ea8c7cb352dfc88a77a3baf3c51bd8ce2bd062
+    ref: 30b1608d28ec0f5d932f5e1adf7d8440b9f05f89
     required: false

From 2dff3b3666f9dff0dee23df225cd241a76b74bb9 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 12 May 2023 12:56:36 +0200
Subject: [PATCH 191/681] Add mising cmake function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Provide missing cmake function in case
webengine is compiled with older qt.

Change-Id: I4d7d09d15d50f3f6b539fa3077d7bb880045a6b5
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 CMakeLists.txt          | 5 ++++-
 cmake/Functions.cmake   | 9 +++++++++
 src/host/CMakeLists.txt | 5 ++++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1011fcfb622..fbe69c154f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,10 @@ project(QtWebEngine
     HOMEPAGE_URL "https://qt.io/"
     LANGUAGES CXX C
 )
-qt_internal_project_setup()
+
+if(COMMAND qt_internal_project_setup)
+    qt_internal_project_setup()
+endif()
 
 find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
     Gui Widgets Network OpenGL Quick Qml PrintSupport
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index e2812665362..f3c836432da 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1,6 +1,15 @@
 # Copyright (C) 2022 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
+# this macro is missing in 6.2
+if(NOT COMMAND _qt_internal_validate_all_args_are_parsed)
+    macro(_qt_internal_validate_all_args_are_parsed result)
+        if(DEFINED ${result}_UNPARSED_ARGUMENTS)
+            message(FATAL_ERROR "Unknown arguments (${${result}_UNPARSED_ARGUMENTS}).")
+        endif()
+    endmacro()
+endif()
+
 function(assertTargets)
     cmake_parse_arguments(PARSE_ARGV 0 arg
         "" "" "MODULES;TARGETS"
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 08da14c1d5a..0b423882138 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -20,7 +20,10 @@ project(QtWebEngineConfigure
     LANGUAGES CXX C)
 
 find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
-qt_internal_project_setup()
+
+if(COMMAND qt_internal_project_setup)
+    qt_internal_project_setup()
+endif()
 
 set(buildDir ${CMAKE_CURRENT_BINARY_DIR})
 configure_gn_toolchain(host ${TEST_architecture_arch} ${TEST_architecture_arch}

From 7b447546d4029bdb9f7961d4bbe4228a3f6c0161 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 16 May 2023 10:57:01 +0200
Subject: [PATCH 192/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty dbb0d0bd..34482ee5:
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (10/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (9/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (8/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (7/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (7/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (6/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (5/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (4/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (3/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (2/10)
* [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (1/10)
* [Backport] CVE-2023-2459: Inappropriate implementation in Prompts
* [Backport] CVE-2023-29469 / Security bug 1433328
* [Backport] Security bug 1423360
* FIXUP: Add pdfium_use_system_libtiff build option
* [Backport] Fix SharedImageFactory log message
* Fix v8 context snapshot generator jumbo build compilation issue
* Add pdfium_use_system_libtiff build option

Change-Id: Ie2b170f7aa9ba056b7069f2fc62049e49967de7e
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index dbb0d0bdcf5..34482ee5da8 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit dbb0d0bdcf58d44531e0039d692c8c37ad3061ff
+Subproject commit 34482ee5da826627131767d907800f6f4a2f0a36

From a233c9a95274848c42efd86bff6062c0171e09b0 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 23 May 2023 07:11:49 +0000
Subject: [PATCH 193/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I1921fcaa36477109f18fb1376568af2e29473d97
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index dfdd55915f2..5215cbb7d81 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d8eaea139cc6677adece04bd364e195f55dd71c9
+    ref: 73216d61e7bff4b3c08f0a98a8e458ba60273b14
     required: true
   ../qtpositioning:
-    ref: 921f6010e4147aa7bd921403b8c90c686e595cb8
+    ref: dcbb3cfad6e69e80f7f760c2f983066facefe3f9
     required: false
   ../qttools:
-    ref: 0cf5200e2adb13d6aedf64787cb8be0fc4d050c0
+    ref: ac8fb652f22953022e70a367118ef75482bd98ad
     required: false
   ../qtwebchannel:
-    ref: 30b1608d28ec0f5d932f5e1adf7d8440b9f05f89
+    ref: 09e0efa859089ad98f10916a90df9d77a4b3f5de
     required: false

From 16d6d6dc5685b2a09e6e9a260ad4d4b513c5ab77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 17 May 2023 14:56:26 +0200
Subject: [PATCH 194/681] [macos] Improve documentation for deploying
 applications on macos

Add information on camera and microphone usage description and enabling
microphone and camera access for notarized applications.

Task-number: QTBUG-113524
Change-Id: I285103652a7d977c3d2fb8b0e3d393cbff77c219
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 595b37848ead3d63b897ce9193aa231aa3aa87b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-deploying.qdoc | 43 +++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index 3fb46a67285..7504965e30b 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -138,4 +138,47 @@
     QTQUICK_COMPILER_SKIPPED_RESOURCES += resources/my_resource.qrc
     \endcode
 
+    \section2 \macos Specific Deployment Steps
+
+    To deploy a \QWE application that accesses the microphone or camera
+    on \macos, you will need to provide texts for the messages that will be shown to the user to
+    explain why the application asks for permission to access to the camera or microphone.
+    To do this, add the texts to the application's \c Info.plist file using the keys
+    described below.
+
+    For the camera usage message, provide a text using the following key:
+    \code
+    <key>NSCameraUsageDescription</key>
+    <string>Your message text for camera usage.</string>
+    \endcode
+
+    \sa \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription} {Apple's property list file documentation}
+
+    For the microphone usage message, provide a text using the following key:
+    \code
+    <key>NSMicrophoneUsageDescription</key>
+    <string>Your message text for microphone usage.</string>
+    \endcode
+
+    \sa \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nsmicrophoneusagedescription} {Apple's property list file documentation}
+
+    To notarize an application that accesses the camera or the microphone,
+    you will need to add the corresponding keys to your application's entitlements file used for
+    deployment and notarization.
+
+    To enable access to the camera, add:
+    \code
+    <key>com.apple.security.device.camera</key>
+    <true/>
+    \endcode
+
+    \sa \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_camera} {Apple's camera entitlement documentation}.
+
+    To enable access to the microphone, add:
+    \code
+    <key>com.apple.security.device.microphone</key>
+    <true/>
+    \endcode
+
+    /sa \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_microphone} {Apple's microphone entitlement documentation}.
 */

From 73b1cea7020cd74311b031a2c698b98c65a5ea4f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 24 May 2023 10:00:26 +0000
Subject: [PATCH 195/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I0edaa3cc4124989262a3efa8ad64adce288948af
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 5215cbb7d81..fac985550e1 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 73216d61e7bff4b3c08f0a98a8e458ba60273b14
+    ref: 4a274bde02de2ca1bf1d125ebc165a0dd5ebe6e5
     required: true
   ../qtpositioning:
-    ref: dcbb3cfad6e69e80f7f760c2f983066facefe3f9
+    ref: 1db9b5a5e0d1e5335b0a732ab6c3ad0968f562ce
     required: false
   ../qttools:
-    ref: ac8fb652f22953022e70a367118ef75482bd98ad
+    ref: 4fa72f0225574aee638d4baa626dc4ce325c88c2
     required: false
   ../qtwebchannel:
-    ref: 09e0efa859089ad98f10916a90df9d77a4b3f5de
+    ref: 5ea7d2d7c60328e9889bf53b27c9f97696edbc4b
     required: false

From 9cc2a24e4d716816b696816b4056cd55290578df Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 12 May 2023 12:57:51 +0200
Subject: [PATCH 196/681] Do not compile QtPdf if qt version too low
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

QtPdf uses macros from 6.3 and should not be compiled
with 6.2. Moreover is was never officially released with 6.2.

Change-Id: I1971fc91056b173a60020907c15a6896aea8b5af
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 configure.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.cmake b/configure.cmake
index 35d21b8951a..68c768440e6 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -251,6 +251,7 @@ qt_feature("qtwebengine-quick-build" PRIVATE
 qt_feature("qtpdf-build" PUBLIC
     LABEL "Build Qt PDF"
     PURPOSE "Enables building the Qt Pdf modules."
+    CONDITION Qt6Core_VERSION VERSION_GREATER_EQUAL "6.3"
 )
 qt_feature("qtpdf-widgets-build" PRIVATE
     LABEL "Build QtPdfWidgets"

From e16c1f6366e550ce35e0ddf2fae7b818c3d884ca Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 12 May 2023 13:09:23 +0200
Subject: [PATCH 197/681] Do not compile examples or tests with 6.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We keep changes which fixes examples and tests in 6.2-lts
branch. As examples and tests use some more modern features
it would not look right to downgrade or clutter those with
some workarounds in 6.5 branch.

Change-Id: I49dd9840115e5fe3d5110f801d2514b9976ff822
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 examples/CMakeLists.txt | 2 +-
 tests/CMakeLists.txt    | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 2d3ccab7ec8..f3b098d0bca 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -4,7 +4,7 @@
 cmake_minimum_required(VERSION 3.16)
 
 qt_examples_build_begin(EXTERNAL_BUILD)
-if(NOT CMAKE_CROSSCOMPILING) #QTBUG-86533
+if(NOT CMAKE_CROSSCOMPILING AND Qt6Core_VERSION VERSION_GREATER_EQUAL "6.5") #QTBUG-86533
     if(TARGET Qt::WebEngineCore)
         add_subdirectory(webenginequick)
     endif()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a8f031a5d25..9e02c40caac 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1 +1,3 @@
-qt_build_tests()
+if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.5")
+   qt_build_tests()
+endif()

From 9023d2e3ba0deea2a8c8e95041bd43e474740226 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 12 May 2023 13:09:03 +0200
Subject: [PATCH 198/681] Fix compilation issues with 6.2

Change-Id: Ida30b9d06c0f15d494d28670b51b2f30c3ef8c85
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
---
 src/core/browser_accessibility_manager_qt.h | 3 +--
 src/core/browser_accessibility_qt.h         | 2 +-
 src/webenginewidgets/api/qwebengineview.h   | 1 +
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index e36edd979b0..2b1989d7c98 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -6,8 +6,7 @@
 
 #include "content/browser/accessibility/browser_accessibility_manager.h"
 
-#include <QtCore/qtclasshelpermacros.h>
-#include <QtCore/qtconfigmacros.h>
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
 
 QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
 
diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index 45547824728..b61338ce3e3 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -4,7 +4,7 @@
 #ifndef BROWSER_ACCESSIBILITY_QT_H
 #define BROWSER_ACCESSIBILITY_QT_H
 
-#include <QtCore/qtconfigmacros.h>
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
 
 QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
 
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index f93d61b12c7..d594c825419 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -26,6 +26,7 @@ class QWebEngineHttpRequest;
 class QWebEngineSettings;
 class QWebEngineViewAccessible;
 class QWebEngineViewPrivate;
+class QMenu;
 
 class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget
 {

From e8f350039570666d80064c01132083e56d1557ab Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 25 May 2023 15:36:20 +0000
Subject: [PATCH 199/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iedd32ba718ab091098e3abcac55b7eafb1223677
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index fac985550e1..dc6f3cbaa27 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4a274bde02de2ca1bf1d125ebc165a0dd5ebe6e5
+    ref: d6e18b88b003dc0691153f56405cf344c8ab19f3
     required: true
   ../qtpositioning:
-    ref: 1db9b5a5e0d1e5335b0a732ab6c3ad0968f562ce
+    ref: 11a9bfc6a4290b7043b8cc19ed3b77ee3f96cd1a
     required: false
   ../qttools:
-    ref: 4fa72f0225574aee638d4baa626dc4ce325c88c2
+    ref: 12e1c012f9fc18f4d84036b7107d4761dc7fdeb0
     required: false
   ../qtwebchannel:
-    ref: 5ea7d2d7c60328e9889bf53b27c9f97696edbc4b
+    ref: 3b5d2afa9bc1c1fe75d4cad84a78671b0e9f4df6
     required: false

From d67072fdbed438bf78d140c9d5054d6ab97eedff Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 29 May 2023 12:16:47 +0000
Subject: [PATCH 200/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I6c260c00eca9e984896d16967fd642898e11d593
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index dc6f3cbaa27..76d73192abe 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d6e18b88b003dc0691153f56405cf344c8ab19f3
+    ref: befb71eb20757a3ac934d36ffec4c5b8e36cb037
     required: true
   ../qtpositioning:
-    ref: 11a9bfc6a4290b7043b8cc19ed3b77ee3f96cd1a
+    ref: 2b4fc92e266727a2a7dc45c14954104e7aa7b20f
     required: false
   ../qttools:
-    ref: 12e1c012f9fc18f4d84036b7107d4761dc7fdeb0
+    ref: 14587c13d7535bdfa51e5a6f163029e8ef7a509b
     required: false
   ../qtwebchannel:
-    ref: 3b5d2afa9bc1c1fe75d4cad84a78671b0e9f4df6
+    ref: f72213101dc87f58a125d0deee3ee80a5d453928
     required: false

From 281174f5e010d819a49562b48b2c2067255a41c6 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 19 May 2023 01:00:41 +0200
Subject: [PATCH 201/681] Normalize clipboard permissions

Handle clipboard read and write permissions the same way everywhere.

Fixes: QTBUG-113579
Change-Id: If1f271e8591c54f4ee2f935486502df19d5f6b3e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 79e4a37668a9176373e81fe4fc8dfe29f6c8c37b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/permission_manager_qt.cpp | 46 +++++++++++++++---------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 9d98c05929a..28e1c981d9b 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -84,6 +84,22 @@ static blink::mojom::PermissionStatus toBlink(ProfileAdapter::PermissionState re
     }
 }
 
+static blink::mojom::PermissionStatus getStatusFromSettings(blink::PermissionType type, WebEngineSettings *settings)
+{
+    switch (type) {
+    case blink::PermissionType::CLIPBOARD_READ_WRITE:
+        if (!settings->testAttribute(QWebEngineSettings::JavascriptCanPaste))
+            return blink::mojom::PermissionStatus::DENIED;
+         Q_FALLTHROUGH();
+    case blink::PermissionType::CLIPBOARD_SANITIZED_WRITE:
+        if (!settings->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard))
+            return blink::mojom::PermissionStatus::DENIED;
+        return blink::mojom::PermissionStatus::GRANTED;
+    default:
+        return blink::mojom::PermissionStatus::ASK;
+    }
+}
+
 PermissionManagerQt::PermissionManagerQt()
     : m_requestIdCount(0)
 {
@@ -179,13 +195,8 @@ void PermissionManagerQt::RequestPermission(blink::PermissionType permission,
     Q_ASSERT(contentsDelegate);
 
     ProfileAdapter::PermissionType permissionType = toQt(permission);
-    if (permissionType == ProfileAdapter::ClipboardRead) {
-        WebEngineSettings *settings = contentsDelegate->webEngineSettings();
-        if (settings->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard)
-            && settings->testAttribute(QWebEngineSettings::JavascriptCanPaste))
-            std::move(callback).Run(blink::mojom::PermissionStatus::GRANTED);
-        else
-            std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
+    if (permissionType == ProfileAdapter::ClipboardRead || permissionType == ProfileAdapter::ClipboardWrite) {
+        std::move(callback).Run(getStatusFromSettings(permission, contentsDelegate->webEngineSettings()));
         return;
     } else if (!canRequestPermissionFor(permissionType)) {
         std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
@@ -220,14 +231,9 @@ void PermissionManagerQt::RequestPermissions(const std::vector<blink::Permission
         const ProfileAdapter::PermissionType permissionType = toQt(permission);
         if (permissionType == ProfileAdapter::UnsupportedPermission)
             result.push_back(blink::mojom::PermissionStatus::DENIED);
-        else if (permissionType == ProfileAdapter::ClipboardRead) {
-            WebEngineSettings *settings = contentsDelegate->webEngineSettings();
-            if (settings->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard)
-                && settings->testAttribute(QWebEngineSettings::JavascriptCanPaste))
-                result.push_back(blink::mojom::PermissionStatus::GRANTED);
-            else
-                result.push_back(blink::mojom::PermissionStatus::DENIED);
-        } else {
+        else if (permissionType == ProfileAdapter::ClipboardRead || permissionType == ProfileAdapter::ClipboardWrite)
+            result.push_back(getStatusFromSettings(permission, contentsDelegate->webEngineSettings()));
+        else {
             answerable = false;
             break;
         }
@@ -280,14 +286,8 @@ blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForCurren
             permission == blink::PermissionType::CLIPBOARD_SANITIZED_WRITE) {
         WebContentsDelegateQt *delegate = static_cast<WebContentsDelegateQt *>(
                 content::WebContents::FromRenderFrameHost(render_frame_host)->GetDelegate());
-        if (!delegate->webEngineSettings()->testAttribute(
-                    QWebEngineSettings::JavascriptCanAccessClipboard))
-            return blink::mojom::PermissionStatus::DENIED;
-        if (permission == blink::PermissionType::CLIPBOARD_READ_WRITE
-            && !delegate->webEngineSettings()->testAttribute(
-                    QWebEngineSettings::JavascriptCanPaste))
-            return blink::mojom::PermissionStatus::DENIED;
-        return blink::mojom::PermissionStatus::GRANTED;
+        Q_ASSERT(delegate);
+        return getStatusFromSettings(permission, delegate->webEngineSettings());
     }
 
     return GetPermissionStatus(

From 193cf15847f084e1e3d75feb1dcf31ed416b28a6 Mon Sep 17 00:00:00 2001
From: Alexey Edelev <alexey.edelev@qt.io>
Date: Wed, 24 May 2023 19:13:49 +0200
Subject: [PATCH 202/681] Compute the path to the Qt host toolchain using
 QT_HOST_PATH_CMAKE_DIR

QT_HOST_PATH_CMAKE_DIR might differ from '${QT_HOST_PATH}/lib/cmake'
if users prefer the custom installation layout. WebEngine should
use QT_HOST_PATH_CMAKE_DIR directly when looking for the
qt.toolchain.cmake file.

Fixes: QTBUG-113802
Change-Id: I24087fc1a2f220092b43a32bd00d4e4827a1d879
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit d50c5f3b6c154cd25657582a51d2c8a5dc52b90d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a62252783ad..59eb27e73e8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -169,7 +169,7 @@ if(CMAKE_CROSSCOMPILING AND NOT IOS AND NOT MACOS)
         PREFIX      host
         USES_TERMINAL_BUILD TRUE
         EXCLUDE_FROM_ALL TRUE
-        CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH}/lib/cmake/Qt6/qt.toolchain.cmake
+        CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH_CMAKE_DIR}/Qt6/qt.toolchain.cmake
                    -DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
                    -DWEBENGINE_ROOT_SOURCE_DIR=${WEBENGINE_ROOT_SOURCE_DIR}
                    -DGN_TARGET_CPU=${TEST_architecture_arch}

From 8383d31abd62c8beccb149058c24f222db973e6e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 31 May 2023 07:48:32 +0000
Subject: [PATCH 203/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I949833066ffac37e2daf2e37d57501a0500dd917
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 76d73192abe..62d48e01f67 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: befb71eb20757a3ac934d36ffec4c5b8e36cb037
+    ref: 56812a55ae05be2e66942c661f9398882bbad023
     required: true
   ../qtpositioning:
-    ref: 2b4fc92e266727a2a7dc45c14954104e7aa7b20f
+    ref: d519ac9a3242613212fe8b4ed3a389ddfa466781
     required: false
   ../qttools:
-    ref: 14587c13d7535bdfa51e5a6f163029e8ef7a509b
+    ref: 308f8a0dda0a2ae3244df03c2ca6181e2695a7c0
     required: false
   ../qtwebchannel:
-    ref: f72213101dc87f58a125d0deee3ee80a5d453928
+    ref: 4b606450cbc2e187f7adf01e91b00eefa09c8155
     required: false

From ccc2693bd31059e09915affb733bc4e089441820 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 25 May 2023 13:55:41 +0200
Subject: [PATCH 204/681] Fix accessibility crash on <li> elements

QAccessibleTableCellInterface::table() is not expected to return
nullptr. Ensure that BrowserAccessibilityInterface::interface_cast()
doesn't cast an interface to QAccessibleTableCellInterface without a
table parent.

Fixes: QTBUG-113859
Change-Id: If7c0d863c27190f51ff023efef4ee038423fc8bf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 83dbd2e4864c3d237ddda62e41da091eac92ab07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_qt.cpp | 32 ++++++++++++++++++---------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index 844d774925f..d1cdd4b2067 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -126,6 +126,8 @@ class BrowserAccessibilityInterface
     void modelChange(QAccessibleTableModelChangeEvent *event) override;
 
 private:
+    content::BrowserAccessibility *findTable() const;
+
     QObject *m_object = nullptr;
     QAccessible::Id m_id = 0;
     BrowserAccessibilityQt *q;
@@ -212,10 +214,14 @@ void *BrowserAccessibilityInterface::interface_cast(QAccessible::InterfaceType t
     }
     case QAccessible::TableCellInterface: {
         QAccessible::Role r = role();
-        if (r == QAccessible::Cell ||
-            r == QAccessible::ListItem ||
-            r == QAccessible::TreeItem)
-            return static_cast<QAccessibleTableCellInterface*>(this);
+        if (r == QAccessible::Cell) {
+            Q_ASSERT(findTable());
+            return static_cast<QAccessibleTableCellInterface *>(this);
+        }
+        if (r == QAccessible::ListItem || r == QAccessible::TreeItem) {
+            if (findTable())
+                return static_cast<QAccessibleTableCellInterface *>(this);
+        }
         break;
     }
     default:
@@ -1102,14 +1108,20 @@ bool BrowserAccessibilityInterface::isSelected() const
     return false;
 }
 
+content::BrowserAccessibility *BrowserAccessibilityInterface::findTable() const
+{
+    content::BrowserAccessibility *parent = q->PlatformGetParent();
+    while (parent && parent->GetRole() != ax::mojom::Role::kTable)
+        parent = parent->PlatformGetParent();
+
+    return parent;
+}
+
 QAccessibleInterface *BrowserAccessibilityInterface::table() const
 {
-    content::BrowserAccessibility *find_table = q->PlatformGetParent();
-    while (find_table && find_table->GetRole() != ax::mojom::Role::kTable)
-        find_table = find_table->PlatformGetParent();
-    if (!find_table)
-        return nullptr;
-    return content::toQAccessibleInterface(find_table);
+    content::BrowserAccessibility *table = findTable();
+    Q_ASSERT(table);
+    return content::toQAccessibleInterface(table);
 }
 
 void BrowserAccessibilityInterface::modelChange(QAccessibleTableModelChangeEvent *)

From e3968b68630179220d751a352e7ee9efd548075d Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 31 May 2023 18:53:20 +0200
Subject: [PATCH 205/681] Update Chromium

Submodule src/3rdparty 34482ee5..06943d86:
* Fix name clash with SetForm
* Add is_mingw helper and fix gn configurations
* [Backport] CVE-2023-2724: Type Confusion in V8
* [Backport] CVE-2023-2723: Use after free in DevTools
* [Backport] Security bug 1439691
* [Backport] Security bug 1442263
* [Backport] Security bug 1425115
* [Backport] CVE-2023-2721: Use after free in Navigation
* Add workaround for broken windows.foundation.h header on mingw
* Do not use posix_memalign with mingw
* Fix nasm config for mingw
* Add gn mingw compilation

Change-Id: I557330876c215a700fa42fdf2679eb9218e50431
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2da9670a25b784c08b2983af72564c29ba684d05)
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index d357202075c..586f452ee42 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           112.0.5615.138
+Patched with security patches up to Chromium version:           113.0.5672.126
diff --git a/src/3rdparty b/src/3rdparty
index 34482ee5da8..45483c4d326 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 34482ee5da826627131767d907800f6f4a2f0a36
+Subproject commit 45483c4d3267d923adf4441d6823600743132c18
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index c15119b354c..fab0501bed8 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -937,7 +937,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "112.0.5615.138"; // FIXME: Remember to update
+    return "113.0.5672.126"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 3f3a4816ed8f80f3c9076f8e7b00bbeef0bad340 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Fri, 12 May 2023 15:06:28 +0200
Subject: [PATCH 206/681] Fix quicknanobrowser tab closing

Calling TabBar.removeItem(Item item) with an integer results
in an exception in the qml engine making the tabs not closable.
'removeItem' is called twice on the same item/index.
Remove the wrong call.

Change-Id: Ie46794e219e82b956b615fa5cbb5dfe745598901
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit e1e52fc25817b8a1d56c0997aaf9d6235c884faf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginequick/quicknanobrowser/BrowserWindow.qml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
index c40fc17955f..d5ae19f540f 100644
--- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -471,7 +471,6 @@ ApplicationWindow {
         }
 
         function removeView(index) {
-            tabBar.removeItem(index);
             if (tabBar.count > 1) {
                 tabBar.removeItem(tabBar.itemAt(index));
                 tabLayout.children[index].destroy();

From 5f44b2a151a1619b6279686f34322cfd23af3ea7 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 6 Jun 2023 01:14:33 +0000
Subject: [PATCH 207/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I0c8e4bd819f5cea9d5c6bdb6f03ec5a1925e1280
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 585a85f4fd8..9b468bcb84c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 649f5f650b4fc9d96e84be597176dda5e6893a0a
+    ref: 2b6c749898ebdc3a61bb28d5816fb546f6c0af96
     required: true
   ../qtpositioning:
-    ref: c575b1271f9582fcb0522479fac5b5e14a44c47c
+    ref: 471b72fd1a6cb498f88c0155d1d472da90102d42
     required: false
   ../qttools:
-    ref: 7dcd4cacf6bd845ea2993c68fb62f125f918f098
+    ref: 4c57b383e72af19637c1a48dad42872b3ae155d1
     required: false
   ../qtwebchannel:
-    ref: 20b419f3e6f0eda32289b0f562c6adc30060aae1
+    ref: f39973f7747babd0ff459dc1bacb8864225dd5e7
     required: false

From bf32e203420385ed7ecca21a86921b7cdfa1a298 Mon Sep 17 00:00:00 2001
From: Safiyyah Moosa <safiyyah.moosa@qt.io>
Date: Wed, 26 Apr 2023 15:18:49 +0200
Subject: [PATCH 208/681] Docs: Fix "Can't link to" example warnings

Task-number: QTBUG-113160
Change-Id: Ic987711802db7eb32cdb15ac9f313d2203984981
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 7b69f3728ace534bfb933e9ae196bff0e2394344)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/doc/src/qtpdf-index.qdoc                      | 2 +-
 src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pdf/doc/src/qtpdf-index.qdoc b/src/pdf/doc/src/qtpdf-index.qdoc
index fb44eb5fadb..055a36b4fba 100644
--- a/src/pdf/doc/src/qtpdf-index.qdoc
+++ b/src/pdf/doc/src/qtpdf-index.qdoc
@@ -17,7 +17,7 @@
     and holds the search results. The QPdfBookmarkModel class holds the
     table of contents, if present. The QPdfLinkModel holds information
     about hyperlinks on a page. The \l QPdfView widget is a complete
-    PDF viewer, and the \l {PDF Viewer Example} shows how to use it.
+    PDF viewer, and the \l {PDF Viewer Widget Example} shows how to use it.
 
     For Qt Quick applications, three kinds of full-featured viewer
     components are provided. \l PdfMultiPageView should be your
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 84f71cf1061..9b8ee29eb91 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -61,7 +61,7 @@
     new windows, such as pop-up windows, you can subclass QWebEngineView and
     reimplement the createWindow() function.
 
-    \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}, {WebEngine Recipe Browser Example}
+    \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}
 */
 
 

From 3f3dda50110cb34430507f3a8a29c4515097d4d7 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 6 Jun 2023 11:45:19 +0000
Subject: [PATCH 209/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I7f6aa97458d55fa3dad33a17f2487ed957377d3e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 62d48e01f67..d525135902a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 56812a55ae05be2e66942c661f9398882bbad023
+    ref: 0410298e506aa6a68f0d712558ad561653d91fe4
     required: true
   ../qtpositioning:
-    ref: d519ac9a3242613212fe8b4ed3a389ddfa466781
+    ref: 5da06d9715b1a8de582576d72041abddbc87e8e1
     required: false
   ../qttools:
-    ref: 308f8a0dda0a2ae3244df03c2ca6181e2695a7c0
+    ref: 30fb3d463bfcdc4536445909aeda7452c44e5bee
     required: false
   ../qtwebchannel:
-    ref: 4b606450cbc2e187f7adf01e91b00eefa09c8155
+    ref: 9ed5fb932ee8deb48020b8e17dcc299eaadfae0f
     required: false

From d23013df64912faf93876811cd810580d987c4f6 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Sat, 22 Apr 2023 13:06:42 +0200
Subject: [PATCH 210/681] Fix non-OpenGL RHI with Qt 6.2

Non-OpenGL support was only working in QQuickWidget in 6.4.0

Change-Id: I5fbf55a95df419b125e803333b07a595f6d11461
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 88cbf24c2377ab17941c79e615b7c5122a67ada2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qtwebenginecoreglobal.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index d8d3d3b26dc..7029cebbdcc 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -212,8 +212,12 @@ static void initialize()
     // QCoreApplication is not yet instantiated, ensuring the call will be deferred
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan
-        && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)
+    if (api != QSGRendererInterface::OpenGL
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+        && api != QSGRendererInterface::Vulkan
+        && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11
+#endif
+        )
         QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
 #endif // QT_CONFIG(opengl)
 }

From 716a3270581ff3f21d13068a3979676787cf8c80 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Sat, 22 Apr 2023 13:06:42 +0200
Subject: [PATCH 211/681] Fix non-OpenGL RHI with Qt 6.2

Non-OpenGL support was only working in QQuickWidget in 6.4.0

Change-Id: I5fbf55a95df419b125e803333b07a595f6d11461
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 88cbf24c2377ab17941c79e615b7c5122a67ada2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qtwebenginecoreglobal.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 9082052f2fd..82bd1c4d2e3 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -214,8 +214,12 @@ static void initialize()
     // QCoreApplication is not yet instantiated, ensuring the call will be deferred
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan
-        && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)
+    if (api != QSGRendererInterface::OpenGL
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+        && api != QSGRendererInterface::Vulkan
+        && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11
+#endif
+        )
         QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
 #endif // QT_CONFIG(opengl)
 }

From 089895e428bb464cdfd770bd03b62a66281b9760 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 22 Nov 2022 12:38:32 -0800
Subject: [PATCH 212/681] Build: install the metatypes inside Qt's own
 arch-specific data dir

We don't want it in /lib64/metatypes, but instead /lib64/qt6/metatypes

Change-Id: Id8e48e8f498c4a029619fffd17293602d7fd8bd8
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 9927a8b649fc944076825dd9616c9a1687087b00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 coin/qt-installer-package-config.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coin/qt-installer-package-config.json b/coin/qt-installer-package-config.json
index b3fa3a3a493..ac604d77b0d 100644
--- a/coin/qt-installer-package-config.json
+++ b/coin/qt-installer-package-config.json
@@ -7,11 +7,11 @@
             "**/lib/cmake/Qt*Gui/*Pdf*",
             "**/lib/cmake/Qt*Pdf*/*",
             "**/lib/cmake/Qt*Qml/QmlPlugins/*Pdf*",
-            "**/lib/metatypes/*pdf*",
             "**/lib/pkgconfig/*Pdf*",
             "**/lib/*Pdf*",
             "**/lib/static_chrome/*",
             "**/lib/QtPdf*.framework/**",
+            "**/metatypes/*pdf*",
             "**/mkspecs/modules/qt_lib_pdf*",
             "**/mkspecs/modules/qt_plugin_qpdf.pri",
             "**/modules/Pdf*",

From 75ee28655ee1b318f4710987f01b65d8c5183e36 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 7 Jun 2023 17:44:56 +0200
Subject: [PATCH 213/681] Fix string -> stringlist conversion in filePicker
 test

Since 67d0c0821 in declarative strings are not longer converted
to QStringList in case of c++ calls. Be explicit now.

Fixes: QTBUG-114339
Change-Id: I644a50eea6640d751d81a5a21f478577d4c999cb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0f58d62688ab5ce573a719c19e9e802d9373c322)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/quick/qmltests/data/tst_filePicker.qml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index a557369edb3..2d6a8870352 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -98,7 +98,7 @@ TestWebEngineView {
 
             function acceptedFileHandler(request) {
                 request.accepted = true;
-                request.dialogAccept(row.input);
+                request.dialogAccept([row.input]);
                 finished = true;
             }
 
@@ -253,7 +253,7 @@ TestWebEngineView {
 
             function acceptedFileHandler(request) {
                 request.accepted = true;
-                request.dialogAccept(row.input);
+                request.dialogAccept([row.input]);
                 finished = true;
             }
 

From 4ca3339a7a66ba2253c9ab8f250d2aedb2e2bc02 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 8 Jun 2023 09:51:04 +0000
Subject: [PATCH 214/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Iab6e749d536428a694c44792b07fdba29bb9618c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 9b468bcb84c..c412bda6f00 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 2b6c749898ebdc3a61bb28d5816fb546f6c0af96
+    ref: f7e6e6a262e36ed8383b5b7784945d91dd5a96c7
     required: true
   ../qtpositioning:
-    ref: 471b72fd1a6cb498f88c0155d1d472da90102d42
+    ref: 87b3748c48934f8c3ed578de23d1f15f6f2b56f2
     required: false
   ../qttools:
-    ref: 4c57b383e72af19637c1a48dad42872b3ae155d1
+    ref: 6940cd222a2951632d40a767fd01f5d157f4408a
     required: false
   ../qtwebchannel:
-    ref: f39973f7747babd0ff459dc1bacb8864225dd5e7
+    ref: c4ed51dd438f1274c60d73b62bb24dbae1d9b253
     required: false

From 3613436cd6f648bbf4f374882404b3c90241cdfd Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Thu, 8 Jun 2023 08:55:20 +0000
Subject: [PATCH 215/681] Doc: Remove duplicate \qmlmethod documentation

Properties and methods of WebEngineHistory are documented in
src/webenginequick/doc/src/navigation_history.qdoc

Change-Id: Idaf2da33f71a4e5858f948e23d653adc902c83f5
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit d8d5bea1faf0d0f780e14cb3cad2ea6e7724b246)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginehistory.cpp | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/core/api/qwebenginehistory.cpp b/src/core/api/qwebenginehistory.cpp
index b70c0b73d41..5d2fc8e9e14 100644
--- a/src/core/api/qwebenginehistory.cpp
+++ b/src/core/api/qwebenginehistory.cpp
@@ -242,13 +242,6 @@ QWebEngineHistory::QWebEngineHistory(QWebEngineHistoryPrivate *d) : d_ptr(d) { }
 
 QWebEngineHistory::~QWebEngineHistory() { }
 
-/*!
-    \qmlmethod void WebEngineHistory::clear()
-    \since QtWebEngine 1.11
-
-    Clears the history.
-*/
-
 void QWebEngineHistory::clear()
 {
     Q_D(const QWebEngineHistory);

From 794fc7e0c5d8f20b04b768d68302553504f90c05 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Thu, 8 Jun 2023 08:55:20 +0000
Subject: [PATCH 216/681] Doc: Remove duplicate \qmlmethod documentation

Properties and methods of WebEngineHistory are documented in
src/webenginequick/doc/src/navigation_history.qdoc

Change-Id: Idaf2da33f71a4e5858f948e23d653adc902c83f5
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit d8d5bea1faf0d0f780e14cb3cad2ea6e7724b246)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginehistory.cpp | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/core/api/qwebenginehistory.cpp b/src/core/api/qwebenginehistory.cpp
index b70c0b73d41..5d2fc8e9e14 100644
--- a/src/core/api/qwebenginehistory.cpp
+++ b/src/core/api/qwebenginehistory.cpp
@@ -242,13 +242,6 @@ QWebEngineHistory::QWebEngineHistory(QWebEngineHistoryPrivate *d) : d_ptr(d) { }
 
 QWebEngineHistory::~QWebEngineHistory() { }
 
-/*!
-    \qmlmethod void WebEngineHistory::clear()
-    \since QtWebEngine 1.11
-
-    Clears the history.
-*/
-
 void QWebEngineHistory::clear()
 {
     Q_D(const QWebEngineHistory);

From fff2d969b23ffebe46198d0f081550936adf2b1d Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 6 Jun 2023 18:22:43 +0200
Subject: [PATCH 217/681] Fix crashes on sendEvent on 'invalid' key.text

A user can create QKeyEvent which may have too long
QKeyEvent::text and does not fit into null terminated blink
WebKeyboardEvent::text. Till now the text was mem copied
however without null-termination if it was too long
(which is char16_t[WebKeyboardEvent::kTextLengthCap])

It seems that real keyboard events do not generate any 'key.text'
for modifiers, however user can provide any text (for example
in the form of 'shift' 'control'). Therefore 'alt' still
worked as we had 16 bytes of space but 'shift' was already
too long.

In case we can not fit into blink web keyboard event text
with null terminated string simply skip the text
as it is not there in the first place in case of non-user
generated key events. This way the text is always
null-terminated.

Fixes: QTBUG-113704
Change-Id: Ib1560a44e7451ab7d886c72338b7433fc51318ed
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit fb9bc02df6114ae9de15ae8267fc2dac79144aa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_event_factory.cpp                | 10 +++--
 .../qwebengineview/tst_qwebengineview.cpp     | 45 +++++++++++++++++++
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 508a4b55743..71f8cf74d03 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1677,10 +1677,12 @@ content::NativeWebKeyboardEvent WebEventFactory::toWebKeyboardEvent(QKeyEvent *e
                 ui::DomCodeToUsLayoutKeyboardCode(static_cast<ui::DomCode>(webKitEvent.dom_code));
 
     const ushort* text = qtText.utf16();
-    size_t textSize = std::min(sizeof(webKitEvent.text), size_t(qtText.length() * 2));
-    memcpy(&webKitEvent.text, text, textSize);
-    memcpy(&webKitEvent.unmodified_text, text, textSize);
-
+    size_t size = std::char_traits<char16_t>::length((char16_t *)text);
+    if (size <= blink::WebKeyboardEvent::kTextLengthCap - 1) { // should be null terminated
+        size_t textSize = std::min(sizeof(webKitEvent.text), size * sizeof(char16_t));
+        memcpy(&webKitEvent.text, text, textSize);
+        memcpy(&webKitEvent.unmodified_text, text, textSize);
+    }
     if (webKitEvent.windows_key_code == VK_RETURN) {
         // This is the same behavior as GTK:
         // We need to treat the enter key as a key press of character \r. This
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 15e22613943..c242d240efb 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -183,6 +183,7 @@ private Q_SLOTS:
     void navigateOnDrop_data();
     void navigateOnDrop();
     void datalist();
+    void longKeyEventText();
 };
 
 // This will be called before the first test function is executed.
@@ -3785,5 +3786,49 @@ void tst_QWebEngineView::datalist()
             QStringLiteral("fil"));
 }
 
+class ConsolePage : public QWebEnginePage
+{
+    Q_OBJECT
+public:
+    ConsolePage(QObject *parent = nullptr) : QWebEnginePage(parent) { }
+    void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message,
+                                  int lineNumber, const QString &sourceID) override
+    {
+        Q_UNUSED(level)
+        Q_UNUSED(lineNumber)
+        Q_UNUSED(sourceID)
+        if (message.contains("TEST_KEY:Shift"))
+            emit done();
+    }
+signals:
+    void done();
+};
+
+//qtbug_113704
+void tst_QWebEngineView::longKeyEventText()
+{
+    const QString html(QStringLiteral("<html><body><p>TEST</p>"
+                                      "<script>"
+                                      "document.addEventListener('keydown', (event)=> {"
+                                      "console.log('TEST_KEY:' + event.key);"
+                                      "});"
+                                      "</script>"
+                                      "</body></html>"));
+
+    QWebEngineView view;
+    ConsolePage page;
+    view.setPage(&page);
+    QSignalSpy loadFinishedSpy(view.page(), &QWebEnginePage::loadFinished);
+    view.resize(200, 400);
+    view.show();
+    view.setHtml(html);
+    QTRY_VERIFY(loadFinishedSpy.size());
+    QSignalSpy consoleMessageSpy(&page, &ConsolePage::done);
+    Qt::Key key(Qt::Key_Shift);
+    QKeyEvent event(QKeyEvent::KeyPress, key, Qt::NoModifier, QKeySequence(key).toString());
+    QApplication::sendEvent(view.focusProxy(), &event);
+    QTRY_VERIFY(consoleMessageSpy.size());
+}
+
 QTEST_MAIN(tst_QWebEngineView)
 #include "tst_qwebengineview.moc"

From e08f9ee453e617a143e443858a100690fc79a4dd Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 6 Jun 2023 18:22:43 +0200
Subject: [PATCH 218/681] Fix crashes on sendEvent on 'invalid' key.text

A user can create QKeyEvent which may have too long
QKeyEvent::text and does not fit into null terminated blink
WebKeyboardEvent::text. Till now the text was mem copied
however without null-termination if it was too long
(which is char16_t[WebKeyboardEvent::kTextLengthCap])

It seems that real keyboard events do not generate any 'key.text'
for modifiers, however user can provide any text (for example
in the form of 'shift' 'control'). Therefore 'alt' still
worked as we had 16 bytes of space but 'shift' was already
too long.

In case we can not fit into blink web keyboard event text
with null terminated string simply skip the text
as it is not there in the first place in case of non-user
generated key events. This way the text is always
null-terminated.

Fixes: QTBUG-113704
Change-Id: Ib1560a44e7451ab7d886c72338b7433fc51318ed
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit fb9bc02df6114ae9de15ae8267fc2dac79144aa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_event_factory.cpp                | 10 +++--
 .../qwebengineview/tst_qwebengineview.cpp     | 45 +++++++++++++++++++
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 986c2fe9189..a802ba158c0 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1697,10 +1697,12 @@ content::NativeWebKeyboardEvent WebEventFactory::toWebKeyboardEvent(QKeyEvent *e
                 ui::DomCodeToUsLayoutKeyboardCode(static_cast<ui::DomCode>(webKitEvent.dom_code));
 
     const ushort* text = qtText.utf16();
-    size_t textSize = std::min(sizeof(webKitEvent.text), size_t(qtText.length() * 2));
-    memcpy(&webKitEvent.text, text, textSize);
-    memcpy(&webKitEvent.unmodified_text, text, textSize);
-
+    size_t size = std::char_traits<char16_t>::length((char16_t *)text);
+    if (size <= blink::WebKeyboardEvent::kTextLengthCap - 1) { // should be null terminated
+        size_t textSize = std::min(sizeof(webKitEvent.text), size * sizeof(char16_t));
+        memcpy(&webKitEvent.text, text, textSize);
+        memcpy(&webKitEvent.unmodified_text, text, textSize);
+    }
     if (webKitEvent.windows_key_code == VK_RETURN) {
         // This is the same behavior as GTK:
         // We need to treat the enter key as a key press of character \r. This
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 15e22613943..c242d240efb 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -183,6 +183,7 @@ private Q_SLOTS:
     void navigateOnDrop_data();
     void navigateOnDrop();
     void datalist();
+    void longKeyEventText();
 };
 
 // This will be called before the first test function is executed.
@@ -3785,5 +3786,49 @@ void tst_QWebEngineView::datalist()
             QStringLiteral("fil"));
 }
 
+class ConsolePage : public QWebEnginePage
+{
+    Q_OBJECT
+public:
+    ConsolePage(QObject *parent = nullptr) : QWebEnginePage(parent) { }
+    void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message,
+                                  int lineNumber, const QString &sourceID) override
+    {
+        Q_UNUSED(level)
+        Q_UNUSED(lineNumber)
+        Q_UNUSED(sourceID)
+        if (message.contains("TEST_KEY:Shift"))
+            emit done();
+    }
+signals:
+    void done();
+};
+
+//qtbug_113704
+void tst_QWebEngineView::longKeyEventText()
+{
+    const QString html(QStringLiteral("<html><body><p>TEST</p>"
+                                      "<script>"
+                                      "document.addEventListener('keydown', (event)=> {"
+                                      "console.log('TEST_KEY:' + event.key);"
+                                      "});"
+                                      "</script>"
+                                      "</body></html>"));
+
+    QWebEngineView view;
+    ConsolePage page;
+    view.setPage(&page);
+    QSignalSpy loadFinishedSpy(view.page(), &QWebEnginePage::loadFinished);
+    view.resize(200, 400);
+    view.show();
+    view.setHtml(html);
+    QTRY_VERIFY(loadFinishedSpy.size());
+    QSignalSpy consoleMessageSpy(&page, &ConsolePage::done);
+    Qt::Key key(Qt::Key_Shift);
+    QKeyEvent event(QKeyEvent::KeyPress, key, Qt::NoModifier, QKeySequence(key).toString());
+    QApplication::sendEvent(view.focusProxy(), &event);
+    QTRY_VERIFY(consoleMessageSpy.size());
+}
+
 QTEST_MAIN(tst_QWebEngineView)
 #include "tst_qwebengineview.moc"

From 0b8ffcc2af7d2bc73eee674434f348536f7b53ae Mon Sep 17 00:00:00 2001
From: Alexey Edelev <alexey.edelev@qt.io>
Date: Thu, 8 Jun 2023 17:22:39 +0200
Subject: [PATCH 219/681] Add explicit dependency on thirdparty_sync_headers
 target

Add the dependency on thirdparty_sync_headers target for gn targets.
gn expects 3rdparty libraries like freetype or harfbuzz are in sync
and replicate the initial structure from the bundled sources.
We need to make sure that _sync_headers targets of 3rdparty libraries
are executed before runing any gn tasks.

Task-number: QTBUG-113416
Change-Id: Ica77e2a0a04c63906515dddd76dfb8d0868602e6
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ed386f5524f3b75a1246e7ad43e3cd62f9eaeb51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index f3c836432da..73a06d59fbf 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1245,6 +1245,9 @@ function(add_gn_command)
             ${arg_BUILDDIR}/${targetConfigFileName}
     )
     add_dependencies(run_${arg_MODULE}_GnDone runGn_${arg_GN_TARGET})
+    if(TARGET thirdparty_sync_headers)
+        add_dependencies(runGn_${arg_GN_TARGET} thirdparty_sync_headers)
+    endif()
     create_gn_target_config(${arg_GN_TARGET} ${arg_BUILDDIR}/${targetConfigFileName})
 endfunction()
 

From d8281f1b091689156fed15e8a895773dd930dca0 Mon Sep 17 00:00:00 2001
From: Yigit Akcay <yigit.akcay@qt.io>
Date: Wed, 7 Jun 2023 18:51:44 +0200
Subject: [PATCH 220/681] QWebEngineUrlResponseInterceptor: Small cleanup

Make the constructor explicit, add explicit external destructor.
Use QMultiMap instead of QHash for request headers, as those can
potentially be repeating.

Change-Id: Id1730b015971287e63562ac67cfa964f2abbb7cc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 082eef1916a86d6d5e0c751d271c7c8a1a5e457d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineurlresponseinfo.cpp         |  8 +++++---
 src/core/api/qwebengineurlresponseinfo.h           | 14 ++++++++------
 src/core/api/qwebengineurlresponseinfo_p.h         |  4 ++--
 src/core/net/proxying_url_loader_factory_qt.cpp    |  4 ++--
 .../tst_qwebengineurlresponseinterceptor.cpp       |  6 +++---
 5 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/src/core/api/qwebengineurlresponseinfo.cpp b/src/core/api/qwebengineurlresponseinfo.cpp
index 8ec1024dad9..4a99857058b 100644
--- a/src/core/api/qwebengineurlresponseinfo.cpp
+++ b/src/core/api/qwebengineurlresponseinfo.cpp
@@ -18,13 +18,15 @@ QT_BEGIN_NAMESPACE
     \sa QWebEngineUrlResponseInterceptor
 */
 QWebEngineUrlResponseInfo::QWebEngineUrlResponseInfo(
-        const QUrl &requestUrl, const QHash<QByteArray, QByteArray> &requestHeaders,
+        const QUrl &requestUrl, const QMultiHash<QByteArray, QByteArray> &requestHeaders,
         const QHash<QByteArray, QByteArray> &responseHeaders, QObject *p)
     : QObject(p)
     , d_ptr(new QWebEngineUrlResponseInfoPrivate(requestUrl, requestHeaders, responseHeaders))
 {
 }
 
+QWebEngineUrlResponseInfo::~QWebEngineUrlResponseInfo(){};
+
 /*!
     \property QWebEngineUrlResponseInfo::requestUrl
     \brief Holds the URL of the URL load request.
@@ -39,7 +41,7 @@ QUrl QWebEngineUrlResponseInfo::requestUrl() const
     \property QWebEngineUrlResponseInfo::requestHeaders
     \brief Holds the request headers of the URL load request.
 */
-QHash<QByteArray, QByteArray> QWebEngineUrlResponseInfo::requestHeaders() const
+QMultiHash<QByteArray, QByteArray> QWebEngineUrlResponseInfo::requestHeaders() const
 {
     Q_D(const QWebEngineUrlResponseInfo);
     return d->requestHeaders;
@@ -57,7 +59,7 @@ QHash<QByteArray, QByteArray> QWebEngineUrlResponseInfo::responseHeaders() const
 
 /*!
     \fn void QWebEngineUrlResponseInfo::setResponseHeaders(
-        const QHash<QByteArray, QByteArray> &newResponseHeaders)
+        const QMultiMap<QByteArray, QByteArray> &newResponseHeaders)
     \brief Sets the response headers to \a newResponseHeaders.
 
     Sets the response headers to \a newResponseHeaders. If \a newResponseHeaders
diff --git a/src/core/api/qwebengineurlresponseinfo.h b/src/core/api/qwebengineurlresponseinfo.h
index e8286b313c9..c9f444768a5 100644
--- a/src/core/api/qwebengineurlresponseinfo.h
+++ b/src/core/api/qwebengineurlresponseinfo.h
@@ -22,18 +22,15 @@ class Q_WEBENGINECORE_EXPORT QWebEngineUrlResponseInfo : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(QUrl requestUrl READ requestUrl CONSTANT FINAL)
-    Q_PROPERTY(QHash<QByteArray,QByteArray> requestHeaders READ requestHeaders CONSTANT FINAL)
+    Q_PROPERTY(QMultiHash<QByteArray, QByteArray> requestHeaders READ requestHeaders CONSTANT FINAL)
     Q_PROPERTY(QHash<QByteArray,QByteArray> responseHeaders READ responseHeaders WRITE
                        setResponseHeaders)
 
 public:
-    QWebEngineUrlResponseInfo(const QUrl &requestUrl,
-                              const QHash<QByteArray, QByteArray> &requestHeaders,
-                              const QHash<QByteArray, QByteArray> &responseHeaders,
-                              QObject *p = nullptr);
+    ~QWebEngineUrlResponseInfo() override;
 
     QUrl requestUrl() const;
-    QHash<QByteArray, QByteArray> requestHeaders() const;
+    QMultiHash<QByteArray, QByteArray> requestHeaders() const;
     QHash<QByteArray, QByteArray> responseHeaders() const;
 
     void setResponseHeaders(const QHash<QByteArray, QByteArray> &newResponseHeaders);
@@ -42,6 +39,11 @@ class Q_WEBENGINECORE_EXPORT QWebEngineUrlResponseInfo : public QObject
     friend class QtWebEngineCore::InterceptedRequest;
     Q_DECLARE_PRIVATE(QWebEngineUrlResponseInfo)
     QWebEngineUrlResponseInfoPrivate *d_ptr;
+
+    QWebEngineUrlResponseInfo(const QUrl &requestUrl,
+                              const QMultiHash<QByteArray, QByteArray> &requestHeaders,
+                              const QHash<QByteArray, QByteArray> &responseHeaders,
+                              QObject *p = nullptr);
 };
 
 QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlresponseinfo_p.h b/src/core/api/qwebengineurlresponseinfo_p.h
index 0e500e3f012..162da2f8b84 100644
--- a/src/core/api/qwebengineurlresponseinfo_p.h
+++ b/src/core/api/qwebengineurlresponseinfo_p.h
@@ -26,7 +26,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineUrlResponseInfoPrivate
 {
 public:
     QWebEngineUrlResponseInfoPrivate(const QUrl &requestUrl,
-                                     const QHash<QByteArray, QByteArray> &requestHeaders,
+                                     const QMultiHash<QByteArray, QByteArray> &requestHeaders,
                                      const QHash<QByteArray, QByteArray> &responseHeaders)
         : requestUrl(requestUrl)
         , requestHeaders(requestHeaders)
@@ -36,7 +36,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineUrlResponseInfoPrivate
     }
 
     QUrl requestUrl;
-    QHash<QByteArray, QByteArray> requestHeaders;
+    QMultiHash<QByteArray, QByteArray> requestHeaders;
     QHash<QByteArray, QByteArray> responseHeaders;
     bool isModified;
 };
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 4e40f9fc806..8a74b89c45c 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -293,9 +293,9 @@ void InterceptedRequest::interceptResponseHeaders(
     }
 
     const QUrl requestUrl = QUrl::fromEncoded(QByteArray::fromStdString(request_.url.spec()));
-    const QHash<QByteArray, QByteArray> requestHeaders =
+    const QMultiHash<QByteArray, QByteArray> requestHeaders =
             [](const net::HttpRequestHeaders &headers) {
-                QHash<QByteArray, QByteArray> result;
+                QMultiHash<QByteArray, QByteArray> result;
                 for (const auto &header : headers.GetHeaderVector()) {
                     result.insert(QByteArray::fromStdString(header.key),
                                   QByteArray::fromStdString(header.value));
diff --git a/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp b/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp
index 4d08853eff4..6a46decf436 100644
--- a/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp
@@ -37,7 +37,7 @@ class Interceptor : public QWebEngineUrlResponseInterceptor
     Q_OBJECT
 
     QUrl m_receivedRequestUrl;
-    QHash<QByteArray, QByteArray> m_receivedRequestHeaders;
+    QMultiHash<QByteArray, QByteArray> m_receivedRequestHeaders;
 
 public:
     void interceptResponseHeaders(QWebEngineUrlResponseInfo &info) override
@@ -53,7 +53,7 @@ class Interceptor : public QWebEngineUrlResponseInterceptor
     }
 
     void getReceivedRequest(QUrl *receivedRequestUrl,
-                            QHash<QByteArray, QByteArray> *receivedRequestHeaders)
+                            QMultiHash<QByteArray, QByteArray> *receivedRequestHeaders)
     {
         *receivedRequestUrl = m_receivedRequestUrl;
         *receivedRequestHeaders = m_receivedRequestHeaders;
@@ -118,7 +118,7 @@ void tst_QWebEngineUrlResponseInterceptor::interceptRequest()
     QVERIFY(loadSpy.wait());
 
     QUrl receivedRequestUrl;
-    QHash<QByteArray, QByteArray> receivedRequestHeaders;
+    QMultiHash<QByteArray, QByteArray> receivedRequestHeaders;
     interceptor.getReceivedRequest(&receivedRequestUrl, &receivedRequestHeaders);
 
     bool receivedRequestHeadersContainsQtWebEngine = false;

From 7d27df27b507509f3616571f05ca78a4b5562388 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Fri, 9 Jun 2023 11:28:04 +0000
Subject: [PATCH 221/681] Doc: Fix documentation issues

* Replace \sa commands specific to section titles with 'See also'
  paragraphs.

* Fix incorrectly named property WebEngineView::devToolsId

Change-Id: I7f823701c9bb0a1cb8e4a4449ccfc42a34391e99
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 68ddebe893e73b50e2b1c62f8ec3769c58fdf319)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-deploying.qdoc        | 12 ++++++++----
 src/webenginequick/doc/src/webengineview_lgpl.qdoc |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index 7504965e30b..eb84708514c 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -152,7 +152,8 @@
     <string>Your message text for camera usage.</string>
     \endcode
 
-    \sa \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription} {Apple's property list file documentation}
+    See also \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription}
+    {Apple's property list file documentation}.
 
     For the microphone usage message, provide a text using the following key:
     \code
@@ -160,7 +161,8 @@
     <string>Your message text for microphone usage.</string>
     \endcode
 
-    \sa \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nsmicrophoneusagedescription} {Apple's property list file documentation}
+    See also \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nsmicrophoneusagedescription}
+    {Apple's property list file documentation}.
 
     To notarize an application that accesses the camera or the microphone,
     you will need to add the corresponding keys to your application's entitlements file used for
@@ -172,7 +174,8 @@
     <true/>
     \endcode
 
-    \sa \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_camera} {Apple's camera entitlement documentation}.
+    See also \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_camera}
+    {Apple's camera entitlement documentation}.
 
     To enable access to the microphone, add:
     \code
@@ -180,5 +183,6 @@
     <true/>
     \endcode
 
-    /sa \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_microphone} {Apple's microphone entitlement documentation}.
+    See also \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_microphone}
+    {Apple's microphone entitlement documentation}.
 */
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 16c5b07f647..1bcc922dba2 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -1304,7 +1304,7 @@
 */
 
 /*!
-    \qmlproperty WebEngineView WebEngineView::devToolsView
+    \qmlproperty WebEngineView WebEngineView::devToolsId
     \since QtWebEngine 6.6
     \readonly
 

From eb21ba280d20a565316f6b03524edef9baeb4b63 Mon Sep 17 00:00:00 2001
From: Amir Masoud Abdol <amir.abdol@qt.io>
Date: Tue, 23 May 2023 15:53:29 +0200
Subject: [PATCH 222/681] Remove the manual undef of the min/max macros, or def
 NOMINMAX

We now add NOMINMAX to PlatformCommonInternal target which will be
linked to everything else, so min/max will not be defined upon the
inclusion of `windows.h`, or other headers.

Change-Id: Ib6d0719126b1fa2b324ba4dfea8db69093280c37
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit f1e6155db58a4a5b4f65b20298965e93ab68332a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/CMakeLists.txt   | 1 -
 src/core/tools/CMakeLists.txt | 2 +-
 src/pdf/CMakeLists.txt        | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index 73c5edba855..208ccf10da5 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -41,7 +41,6 @@ qt_internal_add_module(WebEngineCore
         qwebengineglobalsettings.cpp qwebengineglobalsettings.h qwebengineglobalsettings_p.h
     DEFINES
         BUILDING_CHROMIUM
-        NOMINMAX
     INCLUDE_DIRECTORIES
         ../
         ../../3rdparty/chromium
diff --git a/src/core/tools/CMakeLists.txt b/src/core/tools/CMakeLists.txt
index 9029b60a1ff..b332e96f8b3 100644
--- a/src/core/tools/CMakeLists.txt
+++ b/src/core/tools/CMakeLists.txt
@@ -22,7 +22,7 @@ if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
     qt_skip_warnings_are_errors(${dict_target_name})
     add_dependencies(${dict_target_name} WebEngineCore)
     qt_internal_extend_target(${dict_target_name} CONDITION WIN32
-        DEFINES WIN32_LEAN_AND_MEAN NOMINMAX
+        DEFINES WIN32_LEAN_AND_MEAN
     )
     qt_internal_extend_target(${dict_target_name} CONDITION GCC OR CLANG
         COMPILE_OPTIONS -Wno-unused-parameter
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 563aa9d433a..1a008011f97 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -32,7 +32,6 @@ qt_internal_add_module(Pdf
         ../3rdparty/chromium
     DEFINES
         QT_BUILD_PDF_LIB
-        NOMINMAX
     LIBRARIES
         Qt::CorePrivate
         Qt::Network

From 02a58909f077c8c0616584e2750b0dd7ae114e68 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 12 Jun 2023 11:21:59 +0200
Subject: [PATCH 223/681] Try to fix build with precompiled Qt headers

Do not read chromium headers with 'signals' defined

Fixes: QTBUG-114457
Change-Id: I48977120c7de4e0be30ff47fe496deb6768f71a5
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit fbd7764174ae1b0da4cbdf85de8fe0f7a13cbef7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineglobalsettings.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
index 685d9d593e1..a12c8d2fd33 100644
--- a/src/core/api/qwebengineglobalsettings.cpp
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -1,12 +1,16 @@
 // Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
-#include "services/network/network_service.h"
-#include "content/public/browser/network_service_instance.h"
-
 #include "qwebengineglobalsettings.h"
 #include "qwebengineglobalsettings_p.h"
 
+#ifdef signals
+#undef signals
+#endif
+
+#include "content/public/browser/network_service_instance.h"
+#include "services/network/network_service.h"
+
 QT_BEGIN_NAMESPACE
 
 /*!

From b5ecc25bd5e49bbb26713e9cb0f53a4b5a63af27 Mon Sep 17 00:00:00 2001
From: Safiyyah Moosa <safiyyah.moosa@qt.io>
Date: Mon, 5 Jun 2023 15:48:11 +0200
Subject: [PATCH 224/681] Docs: Add that Qt PDF for Android is not supported

Task-number: QTBUG-83459
Task-number: QTBUG-113551
Change-Id: I1b3e21da8fbd714d4a4291a8804e6c901bf8e292
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fc86aaa6c0eda5246eb1d03c1c53884c64104976)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/doc/src/qtpdf-index.qdoc         |  5 +++++
 src/pdf/doc/src/qtpdf-platformnotes.qdoc | 11 +++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 src/pdf/doc/src/qtpdf-platformnotes.qdoc

diff --git a/src/pdf/doc/src/qtpdf-index.qdoc b/src/pdf/doc/src/qtpdf-index.qdoc
index 055a36b4fba..b72619fbf94 100644
--- a/src/pdf/doc/src/qtpdf-index.qdoc
+++ b/src/pdf/doc/src/qtpdf-index.qdoc
@@ -65,6 +65,11 @@
         \li \l{Qt Quick PDF QML Types}
     \endlist
 
+    \section1 Articles and Guides
+    \list
+        \li {Qt PDF Platform Notes} {Platform Notes}
+    \endlist
+
     \section1 Licenses and Attributions
 
     Qt PDF is available under commercial licenses from \l{The Qt Company}.
diff --git a/src/pdf/doc/src/qtpdf-platformnotes.qdoc b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
new file mode 100644
index 00000000000..f50be120dca
--- /dev/null
+++ b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
@@ -0,0 +1,11 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+    \page qtpdf-platformnotes.html
+    \title Qt PDF Platform Notes
+
+    Building Qt PDF for Android is currently
+    \l{https://bugreports.qt.io/browse/QTBUG-83459} {not supported} on Windows host platforms.
+*/
+

From 00da7d8d88aa28805edc694dcac97a7f189b4788 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 6 Jun 2023 15:53:46 +0200
Subject: [PATCH 225/681] Validate QNetworkProxy::applicationProxy configs

Invalid proxy settings may result in a crash in chromium.
Use chromium's helper function that validates proxy configs
instead of constructing net::ProxyServer manually.
On invalid input, result will be a `SCHEME_INVALID` ProxyServer.

Fixes: QTBUG-113992
Change-Id: I1745ae3c3cd4da40d3d8b92a14f752ac9b3f8d31
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4a79ac857cb675abbd989f5b9ae21dea8016e74e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/net/proxy_config_service_qt.cpp |  7 ++++---
 tests/auto/widgets/proxy/tst_proxy.cpp   | 16 +++++++++++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/core/net/proxy_config_service_qt.cpp b/src/core/net/proxy_config_service_qt.cpp
index 70bcb59b430..fcce08550a9 100644
--- a/src/core/net/proxy_config_service_qt.cpp
+++ b/src/core/net/proxy_config_service_qt.cpp
@@ -16,14 +16,15 @@
 
 net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qtProxy)
 {
-    net::HostPortPair hostPortPair(qtProxy.hostName().toStdString(), qtProxy.port());
+    std::string host = qtProxy.hostName().toStdString();
+    uint16_t port = qtProxy.port();
     switch (qtProxy.type()) {
     case QNetworkProxy::Socks5Proxy:
-        return net::ProxyServer(net::ProxyServer::SCHEME_SOCKS5, hostPortPair);
+        return net::ProxyServer::FromSchemeHostAndPort(net::ProxyServer::SCHEME_SOCKS5, host, port);
     case QNetworkProxy::HttpProxy:
     case QNetworkProxy::HttpCachingProxy:
     case QNetworkProxy::FtpCachingProxy:
-        return net::ProxyServer(net::ProxyServer::SCHEME_HTTP, hostPortPair);
+        return net::ProxyServer::FromSchemeHostAndPort(net::ProxyServer::SCHEME_HTTP, host, port);
     case QNetworkProxy::NoProxy:
     case QNetworkProxy::DefaultProxy:
         return net::ProxyServer(net::ProxyServer::SCHEME_DIRECT, net::HostPortPair());
diff --git a/tests/auto/widgets/proxy/tst_proxy.cpp b/tests/auto/widgets/proxy/tst_proxy.cpp
index f378ae22f5c..3dc72618c9b 100644
--- a/tests/auto/widgets/proxy/tst_proxy.cpp
+++ b/tests/auto/widgets/proxy/tst_proxy.cpp
@@ -8,7 +8,7 @@
 #include <QWebEnginePage>
 #include <QWebEngineView>
 #include <QWebEngineUrlRequestInterceptor>
-
+#include <QWebEngineLoadingInfo>
 
 struct Interceptor : public QWebEngineUrlRequestInterceptor
 {
@@ -28,6 +28,7 @@ class tst_Proxy : public QObject {
 private slots:
     void proxyAuthentication();
     void forwardCookie();
+    void invalidHostName();
 };
 
 
@@ -72,6 +73,19 @@ void tst_Proxy::forwardCookie()
     QTRY_VERIFY2(cookieSpy.size() > 0, "Could not get cookie");
 }
 
+// Crash test ( https://bugreports.qt.io/browse/QTBUG-113992 )
+void tst_Proxy::invalidHostName()
+{
+    QNetworkProxy proxy;
+    proxy.setType(QNetworkProxy::HttpProxy);
+    proxy.setHostName("999.0.0.0");
+    QNetworkProxy::setApplicationProxy(proxy);
+    QWebEnginePage page;
+    QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+    page.load(QUrl("http://www.qt.io"));
+    QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+}
+
 #include "tst_proxy.moc"
 QTEST_MAIN(tst_Proxy)
 

From 1a301c8ffe126f4517b2dc55a4b1723b6aa188ca Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 6 Jun 2023 15:53:46 +0200
Subject: [PATCH 226/681] Validate QNetworkProxy::applicationProxy configs

Invalid proxy settings may result in a crash in chromium.
Use chromium's helper function that validates proxy configs
instead of constructing net::ProxyServer manually.
On invalid input, result will be a `SCHEME_INVALID` ProxyServer.

Fixes: QTBUG-113992
Change-Id: I1745ae3c3cd4da40d3d8b92a14f752ac9b3f8d31
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4a79ac857cb675abbd989f5b9ae21dea8016e74e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/net/proxy_config_service_qt.cpp |  7 ++++---
 tests/auto/widgets/proxy/tst_proxy.cpp   | 16 +++++++++++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/core/net/proxy_config_service_qt.cpp b/src/core/net/proxy_config_service_qt.cpp
index 70bcb59b430..fcce08550a9 100644
--- a/src/core/net/proxy_config_service_qt.cpp
+++ b/src/core/net/proxy_config_service_qt.cpp
@@ -16,14 +16,15 @@
 
 net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qtProxy)
 {
-    net::HostPortPair hostPortPair(qtProxy.hostName().toStdString(), qtProxy.port());
+    std::string host = qtProxy.hostName().toStdString();
+    uint16_t port = qtProxy.port();
     switch (qtProxy.type()) {
     case QNetworkProxy::Socks5Proxy:
-        return net::ProxyServer(net::ProxyServer::SCHEME_SOCKS5, hostPortPair);
+        return net::ProxyServer::FromSchemeHostAndPort(net::ProxyServer::SCHEME_SOCKS5, host, port);
     case QNetworkProxy::HttpProxy:
     case QNetworkProxy::HttpCachingProxy:
     case QNetworkProxy::FtpCachingProxy:
-        return net::ProxyServer(net::ProxyServer::SCHEME_HTTP, hostPortPair);
+        return net::ProxyServer::FromSchemeHostAndPort(net::ProxyServer::SCHEME_HTTP, host, port);
     case QNetworkProxy::NoProxy:
     case QNetworkProxy::DefaultProxy:
         return net::ProxyServer(net::ProxyServer::SCHEME_DIRECT, net::HostPortPair());
diff --git a/tests/auto/widgets/proxy/tst_proxy.cpp b/tests/auto/widgets/proxy/tst_proxy.cpp
index f378ae22f5c..3dc72618c9b 100644
--- a/tests/auto/widgets/proxy/tst_proxy.cpp
+++ b/tests/auto/widgets/proxy/tst_proxy.cpp
@@ -8,7 +8,7 @@
 #include <QWebEnginePage>
 #include <QWebEngineView>
 #include <QWebEngineUrlRequestInterceptor>
-
+#include <QWebEngineLoadingInfo>
 
 struct Interceptor : public QWebEngineUrlRequestInterceptor
 {
@@ -28,6 +28,7 @@ class tst_Proxy : public QObject {
 private slots:
     void proxyAuthentication();
     void forwardCookie();
+    void invalidHostName();
 };
 
 
@@ -72,6 +73,19 @@ void tst_Proxy::forwardCookie()
     QTRY_VERIFY2(cookieSpy.size() > 0, "Could not get cookie");
 }
 
+// Crash test ( https://bugreports.qt.io/browse/QTBUG-113992 )
+void tst_Proxy::invalidHostName()
+{
+    QNetworkProxy proxy;
+    proxy.setType(QNetworkProxy::HttpProxy);
+    proxy.setHostName("999.0.0.0");
+    QNetworkProxy::setApplicationProxy(proxy);
+    QWebEnginePage page;
+    QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+    page.load(QUrl("http://www.qt.io"));
+    QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+}
+
 #include "tst_proxy.moc"
 QTEST_MAIN(tst_Proxy)
 

From 7b4a9d5ac51035aef92c93410644a8fe493794ad Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 12 Jun 2023 21:03:21 +0000
Subject: [PATCH 227/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iaa01165e7defd6af0bf680104cb3eec071b59c12
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index d525135902a..c25175b9bf2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 0410298e506aa6a68f0d712558ad561653d91fe4
+    ref: 6aa623168e5ef833dc21808f17fa6326ce71e717
     required: true
   ../qtpositioning:
-    ref: 5da06d9715b1a8de582576d72041abddbc87e8e1
+    ref: 0fd7a20569fab77f725bcf81b7c3e6952dc3d172
     required: false
   ../qttools:
-    ref: 30fb3d463bfcdc4536445909aeda7452c44e5bee
+    ref: 62d27664d1f3380d1f1dee947def70ce56da3b80
     required: false
   ../qtwebchannel:
-    ref: 9ed5fb932ee8deb48020b8e17dcc299eaadfae0f
+    ref: 725dab6d75e459c982101a3a00ad8a6ee3cb34b8
     required: false

From 308adb695e75368824cbffbb504e08cb714fe2b0 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 13 Jun 2023 22:03:18 +0000
Subject: [PATCH 228/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ie7d8393425a7c34a0515583431625310a32d5192
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c25175b9bf2..6030a657346 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 6aa623168e5ef833dc21808f17fa6326ce71e717
+    ref: a7dbf497890b7138fd9457730573be3ad2cfba3f
     required: true
   ../qtpositioning:
-    ref: 0fd7a20569fab77f725bcf81b7c3e6952dc3d172
+    ref: 809c472f8b5ed75f7a2912b79bfe656ee711d6c3
     required: false
   ../qttools:
-    ref: 62d27664d1f3380d1f1dee947def70ce56da3b80
+    ref: 4c10b637a62c1cfef8d45db7cb81b82fda01bf57
     required: false
   ../qtwebchannel:
-    ref: 725dab6d75e459c982101a3a00ad8a6ee3cb34b8
+    ref: 8fbc04e8ba516e18fd2820bdb3a0158f7190b59a
     required: false

From 9a2f70a10b4fe33fac918b06ef47d9dd943119d8 Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Wed, 14 Jun 2023 07:11:06 +0100
Subject: [PATCH 229/681] Bump version to 6.5.3

Change-Id: Iac8dd358fb244d1a82798f4429a240bfade80d86
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index d0173741c19..2943a34cc2e 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,3 +1,3 @@
-set(QT_REPO_MODULE_VERSION "6.5.2")
+set(QT_REPO_MODULE_VERSION "6.5.3")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")

From 18ecd70f4c2424d5c3d896b79302650f8b8ec923 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 15 Jun 2023 13:05:56 +0000
Subject: [PATCH 230/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I0398177e7b9497e9cbccfb748a50fed9a57f8db6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 6030a657346..6af2eaaa338 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a7dbf497890b7138fd9457730573be3ad2cfba3f
+    ref: 64bf6adda346e2141410ca3b9bbd11f0b038d6c9
     required: true
   ../qtpositioning:
-    ref: 809c472f8b5ed75f7a2912b79bfe656ee711d6c3
+    ref: eb685988006d6dcd3583539af5779543d3e44d17
     required: false
   ../qttools:
-    ref: 4c10b637a62c1cfef8d45db7cb81b82fda01bf57
+    ref: ca7de7eec8ed8501740c3e148ec47381d9bf01df
     required: false
   ../qtwebchannel:
-    ref: 8fbc04e8ba516e18fd2820bdb3a0158f7190b59a
+    ref: 8eae46f3c48f6134ac4812706d476f72da76f833
     required: false

From 77f50587c50831f4136575c562e82ad12579bca3 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Wed, 24 May 2023 19:04:16 +0000
Subject: [PATCH 231/681] Generate chromium_attributions.qdoc before running
 qdoc -prepare

If chromium_attributions.qdoc doesn't exist by the time QDoc is run
in -prepare mode, Chromium attribution pages are not listed in
qtwebengine.index file and therefore not visible to documentation sets
outside Qt WebEngine.

This meant that the attributions were not listed on the main Qt
Licensing documentation page (that lives in qtdoc).

Make the prepare_docs_WebEngineCore target depend on
generate_chromium_attributions to ensure the correct order for
doc generation.

Fixes: QTBUG-113806
Change-Id: I4e2a16974d1c6d29c3942becfbb46f0078cf3113
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 98c84d8d7a4ef4a308b1a75f90ff075135995c60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index 922adfd8c8f..94ed3c852d0 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -95,7 +95,7 @@ add_code_attributions_target(
     BUILDDIR ${buildDir}/${config}/${arch}
 )
 add_dependencies(generate_chromium_attributions run_core_GnDone)
-add_dependencies(docs generate_chromium_attributions)
+add_dependencies(prepare_docs_WebEngineCore generate_chromium_attributions)
 
 ##
 #  WEBENGINECORE RESOURCES

From b1c6d6ee28c511550edeca75ac1de15ada6ea283 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 15 Jun 2023 17:02:22 +0000
Subject: [PATCH 232/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I70429b02220d1d976f2b3861f4fb73eda6a1b961
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c412bda6f00..dfdba87fa21 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f7e6e6a262e36ed8383b5b7784945d91dd5a96c7
+    ref: 1960df0a091c48007f18f7a36eb4483e54462011
     required: true
   ../qtpositioning:
-    ref: 87b3748c48934f8c3ed578de23d1f15f6f2b56f2
+    ref: c1fa55dabdfa0d1f4d21ced154385a9cc081c173
     required: false
   ../qttools:
-    ref: 6940cd222a2951632d40a767fd01f5d157f4408a
+    ref: c13e03bca4c47b732991d5d83924c3ce8c99c17e
     required: false
   ../qtwebchannel:
-    ref: c4ed51dd438f1274c60d73b62bb24dbae1d9b253
+    ref: 6bfbcb589f151a768d41d668b5235eae4988670e
     required: false

From 14a5fb9ade6046817e11de159c8ad04c6604a2a1 Mon Sep 17 00:00:00 2001
From: Axel Spoerl <axel.spoerl@qt.io>
Date: Thu, 15 Jun 2023 14:40:27 +0200
Subject: [PATCH 233/681] Add PdfQuick dependency CMakeLists.txt for webengine
 autotests

The pdfquick subdir was added when the target Pdf was found.
This breaks the build if PdfQuick is not compiled.

=> make adding the subdir conditional to PdfQuick.

Change-Id: I9f46d4254c402f7f1dbde8a899edffd3f8b21c4e
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit abfb3c473ba5cd8b1ac33291ae2f5a80e26353a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index 6fff2b35c21..ad69710b116 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -13,5 +13,7 @@ if(TARGET Qt::WebEngineWidgets)
 endif()
 if(TARGET Qt::Pdf)
     add_subdirectory(pdf)
+endif()
+if(TARGET Qt::PdfQuick)
     add_subdirectory(pdfquick)
 endif()

From 6b575352e1287ca0b78c93d3634401f20faa604d Mon Sep 17 00:00:00 2001
From: Axel Spoerl <axel.spoerl@qt.io>
Date: Thu, 15 Jun 2023 14:40:27 +0200
Subject: [PATCH 234/681] Add PdfQuick dependency CMakeLists.txt for webengine
 autotests

The pdfquick subdir was added when the target Pdf was found.
This breaks the build if PdfQuick is not compiled.

=> make adding the subdir conditional to PdfQuick.

Change-Id: I9f46d4254c402f7f1dbde8a899edffd3f8b21c4e
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit abfb3c473ba5cd8b1ac33291ae2f5a80e26353a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index 6fff2b35c21..ad69710b116 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -13,5 +13,7 @@ if(TARGET Qt::WebEngineWidgets)
 endif()
 if(TARGET Qt::Pdf)
     add_subdirectory(pdf)
+endif()
+if(TARGET Qt::PdfQuick)
     add_subdirectory(pdfquick)
 endif()

From b0bd7516bed0aca07f128c71367e1cf3ef2d7990 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 13 Jun 2023 16:09:42 +0200
Subject: [PATCH 235/681] Don't use QScroller in QPdfView

This should be up to applications if desired, not a built-in feature.
For example, qtdoc/examples/demos/documentviewer installs its own
QScroller. Perhaps QScroller should only handle touch gestures, to
avoid interfering with built-in QAbstractScrollArea behavior.

Fixes: QTBUG-113981
Change-Id: I5fdeb362d16e00f1ae656f7529450d5f5f6ffe83
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3fd2f6fd1cf339e43d70dcc02f3bf221b7e73629)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfwidgets/qpdfview.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index 8295fd57b36..bc231b369ba 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -16,7 +16,6 @@
 #include <QPdfSearchModel>
 #include <QScreen>
 #include <QScrollBar>
-#include <QScroller>
 
 QT_BEGIN_NAMESPACE
 
@@ -296,7 +295,6 @@ QPdfView::QPdfView(QWidget *parent)
     verticalScrollBar()->setSingleStep(20);
     horizontalScrollBar()->setSingleStep(20);
 
-    QScroller::grabGesture(this);
     setMouseTracking(true);
     d->calculateViewport();
 }

From 8cbe13a4fb157f442f88dbf9785b328059943557 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 13 Jun 2023 16:56:37 +0200
Subject: [PATCH 236/681] Move QPdfLinkModel::m_roleNames to
 QPdfLinkModelPrivate

Amends f36f0d5202fee3b778290dd68d1c30911b75b5b4.

Task-number: QTBUG-114367
Change-Id: If1478f4021e5bcc4f011c943fcc3817580ec21c2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 733780d34c129a705990ca2663641d0daa359486)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdflinkmodel.cpp | 6 ++++--
 src/pdf/qpdflinkmodel.h   | 1 -
 src/pdf/qpdflinkmodel_p.h | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp
index 5fae579d351..8e243e4afe7 100644
--- a/src/pdf/qpdflinkmodel.cpp
+++ b/src/pdf/qpdflinkmodel.cpp
@@ -46,9 +46,10 @@ Q_LOGGING_CATEGORY(qLcLink, "qt.pdf.links")
 QPdfLinkModel::QPdfLinkModel(QObject *parent)
     : QAbstractListModel(*(new QPdfLinkModelPrivate()), parent)
 {
+    Q_D(QPdfLinkModel);
     QMetaEnum rolesMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role"));
     for (int r = Qt::UserRole; r < int(Role::NRoles); ++r)
-        m_roleNames.insert(r, QByteArray(rolesMetaEnum.valueToKey(r)).toLower());
+        d->roleNames.insert(r, QByteArray(rolesMetaEnum.valueToKey(r)).toLower());
 }
 
 /*!
@@ -58,7 +59,8 @@ QPdfLinkModel::~QPdfLinkModel() {}
 
 QHash<int, QByteArray> QPdfLinkModel::roleNames() const
 {
-    return m_roleNames;
+    Q_D(const QPdfLinkModel);
+    return d->roleNames;
 }
 
 /*!
diff --git a/src/pdf/qpdflinkmodel.h b/src/pdf/qpdflinkmodel.h
index 73cc23d1f74..4ae23d8477d 100644
--- a/src/pdf/qpdflinkmodel.h
+++ b/src/pdf/qpdflinkmodel.h
@@ -56,7 +56,6 @@ private Q_SLOTS:
     void onStatusChanged(QPdfDocument::Status status);
 
 private:
-    QHash<int, QByteArray> m_roleNames;
     Q_DECLARE_PRIVATE(QPdfLinkModel)
 };
 
diff --git a/src/pdf/qpdflinkmodel_p.h b/src/pdf/qpdflinkmodel_p.h
index 99bd5f1730a..dbd420890e8 100644
--- a/src/pdf/qpdflinkmodel_p.h
+++ b/src/pdf/qpdflinkmodel_p.h
@@ -29,6 +29,7 @@ class QPdfLinkModelPrivate: public QAbstractItemModelPrivate
 
     void update();
 
+    QHash<int, QByteArray> roleNames;
     QPdfDocument *document = nullptr;
     QList<QPdfLink> links;
     int page = 0;

From 4ae60b79dc91e675cf7b4b81567a58ddbe1ad505 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Thu, 27 Apr 2023 17:14:19 +0200
Subject: [PATCH 237/681] Add Windows 10 compatible manifest to examples

This manifest is required for User-Agent to report the
correct Windows versions.
Document Windows App Manifest in platform-notes and
mention it in the httpUserAgent documentation.

Fixes: QTBUG-63021
Change-Id: Ie3896c50a0a912742e8d1a0dc20f3305b343d3f4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a565ffcc172da74ae6ca0f847a0b162ffd68e918)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../quicknanobrowser/CMakeLists.txt           |  7 ++++++
 .../quicknanobrowser.exe.manifest             | 17 ++++++++++++++
 .../quicknanobrowser/quicknanobrowser.pro     |  5 +++++
 .../simplebrowser/CMakeLists.txt              |  7 ++++++
 .../simplebrowser/simplebrowser.exe.manifest  | 17 ++++++++++++++
 .../simplebrowser/simplebrowser.pro           |  5 +++++
 src/core/api/qwebengineprofile.cpp            |  2 +-
 .../doc/src/qtwebengine-platform-notes.qdoc   | 22 +++++++++++++++++++
 8 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
 create mode 100644 examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest

diff --git a/examples/webenginequick/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
index ac41569aacf..c1f0080bbfe 100644
--- a/examples/webenginequick/quicknanobrowser/CMakeLists.txt
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -19,6 +19,13 @@ qt_add_executable(quicknanobrowser
     utils.h
 )
 
+if(WIN32)
+    set_property(
+        TARGET quicknanobrowser
+        APPEND PROPERTY
+            SOURCES quicknanobrowser.exe.manifest)
+endif()
+
 set_target_properties(quicknanobrowser PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
diff --git a/examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest b/examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
new file mode 100644
index 00000000000..acc40177692
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+    <!--The ID below indicates application support for Windows Vista -->
+    <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+    <!--The ID below indicates application support for Windows 7 -->
+    <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+    <!--The ID below indicates application support for Windows 8 -->
+    <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+    <!--The ID below indicates application support for Windows 8.1 -->
+    <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+    <!--The ID below indicates application support for Windows 10/11 -->
+    <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+    </application>
+</compatibility>
+</assembly>
diff --git a/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
index e4c0cdfd1ab..bd5427dc529 100644
--- a/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
+++ b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
@@ -6,6 +6,11 @@ TARGET = quicknanobrowser
 HEADERS = utils.h
 SOURCES = main.cpp
 
+win32 {
+    CONFIG -= embed_manifest_exe
+    QMAKE_MANIFEST = $$PWD/quicknanobrowser.exe.manifest
+}
+
 RESOURCES += resources.qrc
 
 QT += qml quick webenginequick
diff --git a/examples/webenginewidgets/simplebrowser/CMakeLists.txt b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
index 2dd4fd57a34..cb0769e77ca 100644
--- a/examples/webenginewidgets/simplebrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
@@ -29,6 +29,13 @@ qt_add_executable(simplebrowser
     webview.cpp webview.h
 )
 
+if(WIN32)
+    set_property(
+        TARGET simplebrowser
+        APPEND PROPERTY
+            SOURCES simplebrowser.exe.manifest)
+endif()
+
 set_target_properties(simplebrowser PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
diff --git a/examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest b/examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest
new file mode 100644
index 00000000000..acc40177692
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+    <!--The ID below indicates application support for Windows Vista -->
+    <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+    <!--The ID below indicates application support for Windows 7 -->
+    <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+    <!--The ID below indicates application support for Windows 8 -->
+    <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+    <!--The ID below indicates application support for Windows 8.1 -->
+    <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+    <!--The ID below indicates application support for Windows 10/11 -->
+    <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+    </application>
+</compatibility>
+</assembly>
diff --git a/examples/webenginewidgets/simplebrowser/simplebrowser.pro b/examples/webenginewidgets/simplebrowser/simplebrowser.pro
index 7584cfb0179..d4cce773826 100644
--- a/examples/webenginewidgets/simplebrowser/simplebrowser.pro
+++ b/examples/webenginewidgets/simplebrowser/simplebrowser.pro
@@ -23,6 +23,11 @@ SOURCES += \
     webpopupwindow.cpp \
     webview.cpp
 
+win32 {
+    CONFIG -= embed_manifest_exe
+    QMAKE_MANIFEST = $$PWD/simplebrowser.exe.manifest
+}
+
 FORMS += \
     certificateerrordialog.ui \
     passworddialog.ui \
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
index 3a4c899d9f0..df447de339c 100644
--- a/src/core/api/qwebengineprofile.cpp
+++ b/src/core/api/qwebengineprofile.cpp
@@ -463,7 +463,7 @@ void QWebEngineProfile::setCachePath(const QString &path)
     "Windows NT 6.2" (Windows 8), unless the application does contain a manifest
     that declares newer Windows versions as supported.
 
-    \sa setHttpUserAgent()
+    \sa setHttpUserAgent(), {windows_manifest} {Windows Application Manifest}
 */
 QString QWebEngineProfile::httpUserAgent() const
 {
diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index e005012dc4b..c7bdb4831ab 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -197,4 +197,26 @@
     Because of a limitation in the Windows compositor, applications that show a fullscreen web
     engine view will not properly display popups or other top-level windows. The reason and
     workaround is described in \l {Fullscreen OpenGL Based Windows}.
+
+    \target windows_manifest
+    \section1 Windows Application Manifest
+    A manifest is an XML file that is read when the program starts and informs Windows how to run the program.
+    Some \QWE features may require adding a manifest file for the user application to work correctly on Windows.
+
+    The following snippets show the manifest file's structure and how to embed it into the program.
+
+    \note These code snippets are taken from the \l {WebEngine Quick Nano Browser} example.
+
+    The manifest file defines which Windows versions the application supports.
+    \l {QWebEngineProfile::} {httpUserAgent} needs this information to report the correct Windows version.
+    \quotefile ../../../../examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
+
+    To embed the file into the executable, add it to the sources:
+    \quotefromfile ../../../../examples/webenginequick/quicknanobrowser/CMakeLists.txt
+    \skipto qt_add_executable
+    \dots
+    \printuntil endif
+    \dots
+
+    For more information, see the \l {https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests} {Application manifest documentation page}.
 */

From 4242a058872d524ea008f8914fc46f370ba28bb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kimmo=20Leppa=CC=88la=CC=88?= <kimmo.leppala@qt.io>
Date: Mon, 19 Jun 2023 11:55:59 +0300
Subject: [PATCH 238/681] Add Quick Nano Browser to Application Examples

Change-Id: Ia6f1950425d078fbcf4b5e212e5cc983544f3397
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 74b958accfa49eeef9c70a6e6055acfaced6679f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../quicknanobrowser/doc/src/quicknanobrowser.qdoc               | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index ee94e0fd72f..e9964266134 100644
--- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -8,6 +8,7 @@
     \brief A web browser implemented using the WebEngineView QML type.
 
     \image quicknanobrowser-demo.jpg
+    \examplecategory {Application Examples}
 
     \e {Quick Nano Browser} demonstrates how to use the \l{Qt WebEngine QML Types}
     {Qt WebEngine QML types} to develop a small web browser application that consists of a browser

From c8448040077516693eb99b0aac194ae708bbcb03 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 20 Jun 2023 07:50:49 +0000
Subject: [PATCH 239/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ic91649f2955ab322a39a7c9ccf1cd64334f85e61
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index dfdba87fa21..9e31a70e269 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 1960df0a091c48007f18f7a36eb4483e54462011
+    ref: a63e9a2e86c34c32b184f31a7a308c701bad4926
     required: true
   ../qtpositioning:
-    ref: c1fa55dabdfa0d1f4d21ced154385a9cc081c173
+    ref: 9fd5da2b0e3147da39c4c451f34d4eb27c603456
     required: false
   ../qttools:
-    ref: c13e03bca4c47b732991d5d83924c3ce8c99c17e
+    ref: 4ca0d81fb8957cd84559d3a2f780399b669afafb
     required: false
   ../qtwebchannel:
-    ref: 6bfbcb589f151a768d41d668b5235eae4988670e
+    ref: a6c9501c566cb7e4ad5a8bcf6ec3883f22c262f1
     required: false

From de94de6c87693ec0eb03c15d0d12047dd2cdbc2a Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 24 May 2023 10:07:14 +0200
Subject: [PATCH 240/681] Set example category on Widgets examples
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I795da5e37bd084e5c101aaed14fda5a9b3be4b92
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit 233b35fb92c050da15e792a3d1c8879dba893635)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../clientcertificate/doc/src/clientcertificate.qdoc           | 1 +
 .../contentmanipulation/doc/src/contentmanipulation.qdoc       | 1 +
 .../webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc  | 1 +
 examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc       | 1 +
 examples/webenginewidgets/maps/doc/src/maps.qdoc               | 1 +
 .../webenginewidgets/notifications/doc/src/notifications.qdoc  | 1 +
 examples/webenginewidgets/printme/doc/src/printme.qdoc         | 3 ++-
 .../push-notifications/doc/src/push-notifications.qdoc         | 1 +
 .../webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc  | 1 +
 examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc | 1 +
 10 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index 427e5052c51..f296c092537 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/clientcertificate
+    \examplecategory {Networking}
     \title WebEngine Widgets Client Certificate Example
     \ingroup webengine-widgetexamples
     \brief A simple client certificate authentication scenario using \QWE and \l QSslServer.
diff --git a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
index dc0383357bb..104a1773020 100644
--- a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
+++ b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/contentmanipulation
+    \examplecategory {Desktop}
     \title WebEngine Content Manipulation Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to load and manipulate web content.
diff --git a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
index fe6d1b04673..92f6f0f011b 100644
--- a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
+++ b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/cookiebrowser
+    \examplecategory {Input/Output}
     \title WebEngine Cookie Browser Example
     \ingroup webengine-widgetexamples
     \brief A cookie browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
index ba05c4e2b7e..7b4c908c728 100644
--- a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
+++ b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/html2pdf
+    \examplecategory {Graphics}
     \title WebEngine Widgets Html2Pdf Example
     \ingroup webengine-widgetexamples
     \brief Converts web pages to PDF documents using \QWE.
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index ad727e1652e..f8f1dfea360 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/maps
+    \examplecategory {Desktop}
     \title WebEngine Widgets Maps Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to handle geolocation requests.
diff --git a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
index fd3ffa482c5..bfe41613300 100644
--- a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
+++ b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/notifications
+    \examplecategory {Desktop}
     \title WebEngine Notifications Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to pass HTML5 web notifications to users.
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
index 76449f92efb..c849b63b6d0 100644
--- a/examples/webenginewidgets/printme/doc/src/printme.qdoc
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -2,7 +2,8 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
 
 /*!
-   \example webenginewidgets/printme
+    \example webenginewidgets/printme
+    \examplecategory {Desktop}
     \title WebEngine Widgets PrintMe Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to print web pages using Qt WebEngine Widgets.
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
index 2f234c1e052..97aaff50a33 100644
--- a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -4,6 +4,7 @@
 /*!
 
 \example webenginewidgets/push-notifications
+\examplecategory {Desktop}
 \title WebEngine Push Notifications Example
 \ingroup webengine-widgetexamples
 \brief Demonstrates how to subscribe to and unsubscribe from push notifications.
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index f45b362df99..748d19e38c3 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/simplebrowser
+    \examplecategory {Application Examples}
     \title WebEngine Widgets Simple Browser Example
     \ingroup webengine-widgetexamples
     \brief A simple browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
index 9dcd5c0ff18..87000047267 100644
--- a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
+++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/videoplayer
+    \examplecategory {Desktop}
     \title WebEngine Widgets Video Player Example
     \ingroup webengine-widgetexamples
     \brief Displays full screen video using \l QWebEngineView.

From 3bb2379e05eec9748c8ced1a7bcbaf7aa592ee51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kimmo=20Leppa=CC=88la=CC=88?= <kimmo.leppala@qt.io>
Date: Mon, 19 Jun 2023 11:55:59 +0300
Subject: [PATCH 241/681] Add Quick Nano Browser to Application Examples

Change-Id: Ia6f1950425d078fbcf4b5e212e5cc983544f3397
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 74b958accfa49eeef9c70a6e6055acfaced6679f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../quicknanobrowser/doc/src/quicknanobrowser.qdoc               | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index ee94e0fd72f..e9964266134 100644
--- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -8,6 +8,7 @@
     \brief A web browser implemented using the WebEngineView QML type.
 
     \image quicknanobrowser-demo.jpg
+    \examplecategory {Application Examples}
 
     \e {Quick Nano Browser} demonstrates how to use the \l{Qt WebEngine QML Types}
     {Qt WebEngine QML types} to develop a small web browser application that consists of a browser

From 8860740443e70ed373519cb1f5a81233584e70c5 Mon Sep 17 00:00:00 2001
From: Alexey Edelev <alexey.edelev@qt.io>
Date: Thu, 8 Jun 2023 17:22:39 +0200
Subject: [PATCH 242/681] Add explicit dependency on thirdparty_sync_headers
 target

Add the dependency on thirdparty_sync_headers target for gn targets.
gn expects 3rdparty libraries like freetype or harfbuzz are in sync
and replicate the initial structure from the bundled sources.
We need to make sure that _sync_headers targets of 3rdparty libraries
are executed before runing any gn tasks.

Task-number: QTBUG-113416
Change-Id: Ica77e2a0a04c63906515dddd76dfb8d0868602e6
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ed386f5524f3b75a1246e7ad43e3cd62f9eaeb51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index b90447ed36e..e7981134644 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1276,6 +1276,9 @@ function(add_gn_command)
             ${arg_BUILDDIR}/${targetConfigFileName}
     )
     add_dependencies(run_${arg_MODULE}_GnDone runGn_${arg_GN_TARGET})
+    if(TARGET thirdparty_sync_headers)
+        add_dependencies(runGn_${arg_GN_TARGET} thirdparty_sync_headers)
+    endif()
     create_gn_target_config(${arg_GN_TARGET} ${arg_BUILDDIR}/${targetConfigFileName})
 endfunction()
 

From d99acea745bf146f8af64e1171ab3f4ecd5ed93d Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 24 May 2023 10:07:14 +0200
Subject: [PATCH 243/681] Set example category on Widgets examples
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I795da5e37bd084e5c101aaed14fda5a9b3be4b92
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit 233b35fb92c050da15e792a3d1c8879dba893635)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../clientcertificate/doc/src/clientcertificate.qdoc           | 1 +
 .../contentmanipulation/doc/src/contentmanipulation.qdoc       | 1 +
 .../webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc  | 1 +
 examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc       | 1 +
 examples/webenginewidgets/maps/doc/src/maps.qdoc               | 1 +
 .../webenginewidgets/notifications/doc/src/notifications.qdoc  | 1 +
 examples/webenginewidgets/printme/doc/src/printme.qdoc         | 3 ++-
 .../push-notifications/doc/src/push-notifications.qdoc         | 1 +
 .../webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc  | 1 +
 examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc | 1 +
 10 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index 427e5052c51..f296c092537 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/clientcertificate
+    \examplecategory {Networking}
     \title WebEngine Widgets Client Certificate Example
     \ingroup webengine-widgetexamples
     \brief A simple client certificate authentication scenario using \QWE and \l QSslServer.
diff --git a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
index dc0383357bb..104a1773020 100644
--- a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
+++ b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/contentmanipulation
+    \examplecategory {Desktop}
     \title WebEngine Content Manipulation Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to load and manipulate web content.
diff --git a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
index fe6d1b04673..92f6f0f011b 100644
--- a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
+++ b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/cookiebrowser
+    \examplecategory {Input/Output}
     \title WebEngine Cookie Browser Example
     \ingroup webengine-widgetexamples
     \brief A cookie browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
index ba05c4e2b7e..7b4c908c728 100644
--- a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
+++ b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/html2pdf
+    \examplecategory {Graphics}
     \title WebEngine Widgets Html2Pdf Example
     \ingroup webengine-widgetexamples
     \brief Converts web pages to PDF documents using \QWE.
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index ad727e1652e..f8f1dfea360 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/maps
+    \examplecategory {Desktop}
     \title WebEngine Widgets Maps Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to handle geolocation requests.
diff --git a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
index fd3ffa482c5..bfe41613300 100644
--- a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
+++ b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/notifications
+    \examplecategory {Desktop}
     \title WebEngine Notifications Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to pass HTML5 web notifications to users.
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
index 76449f92efb..c849b63b6d0 100644
--- a/examples/webenginewidgets/printme/doc/src/printme.qdoc
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -2,7 +2,8 @@
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
 
 /*!
-   \example webenginewidgets/printme
+    \example webenginewidgets/printme
+    \examplecategory {Desktop}
     \title WebEngine Widgets PrintMe Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to print web pages using Qt WebEngine Widgets.
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
index 2f234c1e052..97aaff50a33 100644
--- a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -4,6 +4,7 @@
 /*!
 
 \example webenginewidgets/push-notifications
+\examplecategory {Desktop}
 \title WebEngine Push Notifications Example
 \ingroup webengine-widgetexamples
 \brief Demonstrates how to subscribe to and unsubscribe from push notifications.
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index f45b362df99..748d19e38c3 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/simplebrowser
+    \examplecategory {Application Examples}
     \title WebEngine Widgets Simple Browser Example
     \ingroup webengine-widgetexamples
     \brief A simple browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
index 9dcd5c0ff18..87000047267 100644
--- a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
+++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
@@ -3,6 +3,7 @@
 
 /*!
     \example webenginewidgets/videoplayer
+    \examplecategory {Desktop}
     \title WebEngine Widgets Video Player Example
     \ingroup webengine-widgetexamples
     \brief Displays full screen video using \l QWebEngineView.

From 01d79e39d7e2f978852e3630a2247b1edb268f0e Mon Sep 17 00:00:00 2001
From: Safiyyah Moosa <safiyyah.moosa@qt.io>
Date: Mon, 5 Jun 2023 15:48:11 +0200
Subject: [PATCH 244/681] Docs: Add that Qt PDF for Android is not supported

Task-number: QTBUG-83459
Task-number: QTBUG-113551
Change-Id: I1b3e21da8fbd714d4a4291a8804e6c901bf8e292
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fc86aaa6c0eda5246eb1d03c1c53884c64104976)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/doc/src/qtpdf-index.qdoc         |  5 +++++
 src/pdf/doc/src/qtpdf-platformnotes.qdoc | 11 +++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 src/pdf/doc/src/qtpdf-platformnotes.qdoc

diff --git a/src/pdf/doc/src/qtpdf-index.qdoc b/src/pdf/doc/src/qtpdf-index.qdoc
index 055a36b4fba..b72619fbf94 100644
--- a/src/pdf/doc/src/qtpdf-index.qdoc
+++ b/src/pdf/doc/src/qtpdf-index.qdoc
@@ -65,6 +65,11 @@
         \li \l{Qt Quick PDF QML Types}
     \endlist
 
+    \section1 Articles and Guides
+    \list
+        \li {Qt PDF Platform Notes} {Platform Notes}
+    \endlist
+
     \section1 Licenses and Attributions
 
     Qt PDF is available under commercial licenses from \l{The Qt Company}.
diff --git a/src/pdf/doc/src/qtpdf-platformnotes.qdoc b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
new file mode 100644
index 00000000000..f50be120dca
--- /dev/null
+++ b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
@@ -0,0 +1,11 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+    \page qtpdf-platformnotes.html
+    \title Qt PDF Platform Notes
+
+    Building Qt PDF for Android is currently
+    \l{https://bugreports.qt.io/browse/QTBUG-83459} {not supported} on Windows host platforms.
+*/
+

From 217ab60ea1a9640ff6b9ca901cef6b134f852ece Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 15 Jun 2023 11:06:23 +0200
Subject: [PATCH 245/681] Silence deprecation warning for
 QWebEngineNavigationRequest::actionChanged signal

Change-Id: I26f3c8d281bf8fa6626cc071ce1ad9ca37798432
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 19d9b353e1eec1b066ae472757fcd04545700d31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginenavigationrequest.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/api/qwebenginenavigationrequest.cpp b/src/core/api/qwebenginenavigationrequest.cpp
index c14a7bf41e0..0a30f647279 100644
--- a/src/core/api/qwebenginenavigationrequest.cpp
+++ b/src/core/api/qwebenginenavigationrequest.cpp
@@ -89,7 +89,10 @@ void QWebEngineNavigationRequest::setAction(QWebEngineNavigationRequest::Navigat
         return;
 
     acceptRequest ? accept() : reject();
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
     emit actionChanged();
+QT_WARNING_POP
 }
 #endif
 /*!

From 039b15444733b53bf00e92140fd7d74bf394440c Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Fri, 28 Apr 2023 17:37:24 +0200
Subject: [PATCH 246/681] Fix devtools context menus

Set devtools custom menus on 'OnLoadCompleted' event.
This event should be triggered by the Js frontend
not by WebContentsObserver.

Fixes: QTBUG-113251
Change-Id: I815d818c5867d0f1d160a962be5a41a762699e00
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1243b80433d4a18bc57cf43ab29d02e6007261f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/devtools_frontend_qt.cpp | 2 +-
 src/core/devtools_frontend_qt.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index f802c2517c5..e4eadca4357 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -162,7 +162,7 @@ void DevToolsFrontendQt::ActivateWindow()
     web_contents()->Focus();
 }
 
-void DevToolsFrontendQt::InspectElementCompleted()
+void DevToolsFrontendQt::OnLoadCompleted()
 {
     m_bindings->CallClientMethod("DevToolsAPI", "setUseSoftMenu", base::Value(true));
 }
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index e822fe5916d..a22bb05598f 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -55,18 +55,18 @@ class DevToolsFrontendQt : public DevToolsUIBindings::Delegate, public content::
 
     // DevToolsUIBindings::Delegate overrides
     void ActivateWindow() override;
-    void InspectElementCompleted() override;
     void SetEyeDropperActive(bool active) override;
     void OpenInNewTab(const std::string &url) override;
     void InspectedContentsClosing() override;
+    void OnLoadCompleted() override;
 
+    void InspectElementCompleted() override{};
     void CloseWindow() override{};
     void Inspect(scoped_refptr<content::DevToolsAgentHost>) override{};
     void SetInspectedPageBounds(const gfx::Rect &) override{};
     void SetIsDocked(bool) override{};
     void SetWhitelistedShortcuts(const std::string &) override{};
     void OpenNodeFrontend() override{};
-    void OnLoadCompleted() override{};
     void ReadyForTest() override{};
     void ConnectionReady() override{};
     void SetOpenNewWindowForPopups(bool) override{};

From cefecd88199edb8708063f4f2e284649fd21012b Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 15 Jun 2023 11:06:23 +0200
Subject: [PATCH 247/681] Silence deprecation warning for
 QWebEngineNavigationRequest::actionChanged signal

Change-Id: I26f3c8d281bf8fa6626cc071ce1ad9ca37798432
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 19d9b353e1eec1b066ae472757fcd04545700d31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginenavigationrequest.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/api/qwebenginenavigationrequest.cpp b/src/core/api/qwebenginenavigationrequest.cpp
index c14a7bf41e0..0a30f647279 100644
--- a/src/core/api/qwebenginenavigationrequest.cpp
+++ b/src/core/api/qwebenginenavigationrequest.cpp
@@ -89,7 +89,10 @@ void QWebEngineNavigationRequest::setAction(QWebEngineNavigationRequest::Navigat
         return;
 
     acceptRequest ? accept() : reject();
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
     emit actionChanged();
+QT_WARNING_POP
 }
 #endif
 /*!

From 4ed9aaae61213af083af2ee4f28aafbd10bc6073 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 7 Jun 2023 17:44:56 +0200
Subject: [PATCH 248/681] Fix string -> stringlist conversion in filePicker
 test

Since 67d0c0821 in declarative strings are not longer converted
to QStringList in case of c++ calls. Be explicit now.

Fixes: QTBUG-114339
Change-Id: I644a50eea6640d751d81a5a21f478577d4c999cb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0f58d62688ab5ce573a719c19e9e802d9373c322)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/quick/qmltests/data/tst_filePicker.qml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index a557369edb3..2d6a8870352 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -98,7 +98,7 @@ TestWebEngineView {
 
             function acceptedFileHandler(request) {
                 request.accepted = true;
-                request.dialogAccept(row.input);
+                request.dialogAccept([row.input]);
                 finished = true;
             }
 
@@ -253,7 +253,7 @@ TestWebEngineView {
 
             function acceptedFileHandler(request) {
                 request.accepted = true;
-                request.dialogAccept(row.input);
+                request.dialogAccept([row.input]);
                 finished = true;
             }
 

From e1fe0ba80151ef2ca9fc9495f7b2052923de16db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 21 Jun 2023 14:57:52 +0200
Subject: [PATCH 249/681] Update Chromium

Submodule src/3rdparty 45483c4d..ba3cfe92:
  * FIXUP: Jumbo builds
  * Bump V8_PATCH_LEVEL
  * [Backport] CVE-2023-2936: Type Confusion in V8
  * [Backport] Dependency for CVE-2023-2936: Type Confusion in V8 (1/1)
  * [Backport] CVE-2023-2937: Inappropriate implementation in Picture In Picture
  * [Backport] Dependency for CVE-2023-2937: Inappropriate implementation in Picture In Picture (2/2)
  * [Backport] Dependency for CVE-2023-2937: Inappropriate implementation in Picture In Picture (1/2)
  * [Backport] CVE-2023-3217: Use after free in WebXR (2/2)
  * [Backport] CVE-2023-3217: Use after free in WebXR (1/2)
  * [Backport] CVE-2023-3216: Type Confusion in V8
  * [Backport] CVE-2023-3079: Type Confusion in V8
  * [Backport] Security bug 1428743
  * [Backport] Security bug 1444195
  * [Backport] CVE-2023-2938: Inappropriate implementation in Picture In Picture
  * [Backport] CVE-2023-2935: Type Confusion in V8
  * [Backport] CVE-2023-2933: Use after free in PDF
  * [Backport] CVE-2023-2932: Use after free in PDF
  * [Backport] CVE-2023-2931: Use after free in PDF
  * [Backport] CVE-2023-2930: Use after free in Extensions
  * [Backport] Security bug 1418955
  * FIXUP: Adapt DevToolsUIBindings for WebEngine

Task-number: QTBUG-114754
Change-Id: Ia7befcfcb8c746b17f90417e0016007d94421a15
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit c00d3840262041fa736200deb36eac0b977c335a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 45483c4d326..ba3cfe92dd2 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 45483c4d3267d923adf4441d6823600743132c18
+Subproject commit ba3cfe92dd2ad3e8bd9e33dbbe78591139ffa6a3

From 66e010eeeb6eef93d664787a3802738d02984e6c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 21 Jun 2023 18:52:41 +0000
Subject: [PATCH 250/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I8fd2b7fa8e344620071f5832c4362b39adc6c93a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 9e31a70e269..b9731dc8673 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a63e9a2e86c34c32b184f31a7a308c701bad4926
+    ref: baf0c61e12601e1164ef6864f55eb8aec22fe73e
     required: true
   ../qtpositioning:
-    ref: 9fd5da2b0e3147da39c4c451f34d4eb27c603456
+    ref: e3e83c11019c38bc7e3d5dab6424bab5ebf6fe1b
     required: false
   ../qttools:
-    ref: 4ca0d81fb8957cd84559d3a2f780399b669afafb
+    ref: 1b25b79b6436aa24f3c3a2d494bf719d37697ef1
     required: false
   ../qtwebchannel:
-    ref: a6c9501c566cb7e4ad5a8bcf6ec3883f22c262f1
+    ref: bf937863907f4ff1f34bffbebde9bc993abb4c54
     required: false

From 4c284e972a6a88ff1a4c87698c8c317c086b28a7 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 22 Jun 2023 07:52:21 +0000
Subject: [PATCH 251/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I6bef2c241fdee2369113fcb0a72542b5a7b9fe66
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 6af2eaaa338..00df3c33d68 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 64bf6adda346e2141410ca3b9bbd11f0b038d6c9
+    ref: d21dc38b7ecb811dbed9b5fc41cb2528d863c554
     required: true
   ../qtpositioning:
-    ref: eb685988006d6dcd3583539af5779543d3e44d17
+    ref: 892cf1b644ccc50ef78c998115d175711bee1280
     required: false
   ../qttools:
-    ref: ca7de7eec8ed8501740c3e148ec47381d9bf01df
+    ref: 737a2065254f7232b92b1955c1069e166205b910
     required: false
   ../qtwebchannel:
-    ref: 8eae46f3c48f6134ac4812706d476f72da76f833
+    ref: a6e81f75e7f358789584f07f0c3146b03ecca9db
     required: false

From ee8bc5a42e5a2903561b7dbe265dea4991885589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 22 Jun 2023 10:23:10 +0200
Subject: [PATCH 252/681] Update Chromium

Submodule src/3rdparty ba3cfe92..a4a9769c:
  * [Backport] Security bug 1447430

Task-number: QTBUG-114754
Change-Id: I0aaa8c8783f5fdbb9617b0dc850caf31db6c3a36
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
(cherry picked from commit 8c23756c8a7b3dcadd6dff20f76d156e4dace876)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 586f452ee42..a024b4f70a8 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           113.0.5672.126
+Patched with security patches up to Chromium version:           114.0.5735.133
diff --git a/src/3rdparty b/src/3rdparty
index ba3cfe92dd2..a4a9769c67d 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit ba3cfe92dd2ad3e8bd9e33dbbe78591139ffa6a3
+Subproject commit a4a9769c67d4d62570a2035945ea08db7cb8c127
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index fab0501bed8..d0da744d712 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -937,7 +937,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "113.0.5672.126"; // FIXME: Remember to update
+    return "114.0.5735.133"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 9d8b57489c1c594b20821a2f6a5be30cea4b03a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 21 Jun 2023 14:57:52 +0200
Subject: [PATCH 253/681] Update Chromium

Submodule src/3rdparty 45483c4d..ba3cfe92:
  * FIXUP: Jumbo builds
  * Bump V8_PATCH_LEVEL
  * [Backport] CVE-2023-2936: Type Confusion in V8
  * [Backport] Dependency for CVE-2023-2936: Type Confusion in V8 (1/1)
  * [Backport] CVE-2023-2937: Inappropriate implementation in Picture In Picture
  * [Backport] Dependency for CVE-2023-2937: Inappropriate implementation in Picture In Picture (2/2)
  * [Backport] Dependency for CVE-2023-2937: Inappropriate implementation in Picture In Picture (1/2)
  * [Backport] CVE-2023-3217: Use after free in WebXR (2/2)
  * [Backport] CVE-2023-3217: Use after free in WebXR (1/2)
  * [Backport] CVE-2023-3216: Type Confusion in V8
  * [Backport] CVE-2023-3079: Type Confusion in V8
  * [Backport] Security bug 1428743
  * [Backport] Security bug 1444195
  * [Backport] CVE-2023-2938: Inappropriate implementation in Picture In Picture
  * [Backport] CVE-2023-2935: Type Confusion in V8
  * [Backport] CVE-2023-2933: Use after free in PDF
  * [Backport] CVE-2023-2932: Use after free in PDF
  * [Backport] CVE-2023-2931: Use after free in PDF
  * [Backport] CVE-2023-2930: Use after free in Extensions
  * [Backport] Security bug 1418955
  * FIXUP: Adapt DevToolsUIBindings for WebEngine

Task-number: QTBUG-114754
Change-Id: Ia7befcfcb8c746b17f90417e0016007d94421a15
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit c00d3840262041fa736200deb36eac0b977c335a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 45483c4d326..ba3cfe92dd2 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 45483c4d3267d923adf4441d6823600743132c18
+Subproject commit ba3cfe92dd2ad3e8bd9e33dbbe78591139ffa6a3

From 53b5d93d924e3d6fdf05083139f47ec4a668181f Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 13 Jan 2023 23:23:08 +0100
Subject: [PATCH 254/681] RenderWidgetHostViewQtDelegateItem: keep grabs

If a WebView or WebEngineView gets a mouse or touch grab, we don't want
to give it up to any handlers that may be lurking on Items underneath.
WebView is opaque, so we don't know whether the user is trying to drag a
scrollbar or something else, but interactive items outside shouldn't
interfere, in general.

[ChangeLog][QtWebEngineQuick] WebEngineView (or WebView backed by Qt
WebEngine) no longer allows components outside to take over the mouse or
touch exclusive grab. For example if the user starts dragging a
scrollbar inside the web view, that continues until release, regardless
of any DragHandler, Flickable etc.

Fixes: QTBUG-103518
Change-Id: I4352dc8482020f0efc7a0901e94ccf7fc147fa1b
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 3feab861f5ead63e2a661343f0df2358fa0af894)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 ...nder_widget_host_view_qt_delegate_item.cpp |  2 +
 tests/auto/quick/qmltests/CMakeLists.txt      |  1 +
 .../data/tst_dragHandlerUnderView.qml         | 67 +++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml

diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index e6145f7a6da..9723fcf2ce6 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -22,8 +22,10 @@ RenderWidgetHostViewQtDelegateItem::RenderWidgetHostViewQtDelegateItem(RenderWid
 {
     setFlag(ItemHasContents);
     setAcceptedMouseButtons(Qt::AllButtons);
+    setKeepMouseGrab(true);
     setAcceptHoverEvents(true);
     setAcceptTouchEvents(true);
+    setKeepTouchGrab(true);
     if (!isPopup) {
         setFocus(true);
         setActiveFocusOnTab(true);
diff --git a/tests/auto/quick/qmltests/CMakeLists.txt b/tests/auto/quick/qmltests/CMakeLists.txt
index 542e44706d6..c102b243349 100644
--- a/tests/auto/quick/qmltests/CMakeLists.txt
+++ b/tests/auto/quick/qmltests/CMakeLists.txt
@@ -25,6 +25,7 @@ set(testList
     tst_datalist.qml
     tst_desktopBehaviorLoadHtml.qml
     tst_download.qml
+    tst_dragHandlerUnderView.qml
     tst_favicon.qml
     tst_faviconDatabase.qml
     tst_filePicker.qml
diff --git a/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml b/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml
new file mode 100644
index 00000000000..c22bd44c285
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml
@@ -0,0 +1,67 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+Item {
+    id: parentItem
+    width: 400
+    height: 300
+
+    Rectangle {
+        id: draggableDownUnder
+        color: "wheat"
+        width: 350
+        height: 250
+
+        DragHandler { id: dragHandler }
+    }
+
+    TestWebEngineView {
+        id: webEngineView
+        width: 300
+        height: 250
+
+        property var testUrl: Qt.resolvedUrl("test4.html")
+
+        SignalSpy {
+            id: scrollPositionSpy
+            target: webEngineView
+            signalName: "onScrollPositionChanged"
+        }
+
+        SignalSpy {
+            id: dragActiveSpy
+            target: dragHandler
+            signalName: "activeChanged"
+        }
+
+        TestCase {
+            id: testCase
+            name: "KeepMouseGrabDuringScrolling"
+            when: windowShown
+
+            function test_scroll() {
+                webEngineView.url = Qt.resolvedUrl("test4.html");
+                verify(webEngineView.waitForLoadSucceeded());
+
+                mousePress(webEngineView, 295, 20);
+                mouseMove(webEngineView, 295, 200);
+                mouseRelease(webEngineView, 295, 200);
+
+                // WebEngineView scrolled if the scrollbar was visible.
+                // But on macOS, the scrollbar is hidden, so text gets selected.
+                tryVerify(function() {
+                    return (scrollPositionSpy.count === 1 && webEngineView.scrollPosition.y > 100)
+                            || webEngineView.getTextSelection().length > 0;
+                });
+
+                // DragHandler didn't take over and drag
+                compare(dragActiveSpy.count, 0);
+                compare(draggableDownUnder.y, 0);
+            }
+        }
+    }
+}

From e74557dc1e620a845ce2fcae280aa3f65c3ef8e1 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Sat, 10 Jun 2023 20:37:59 +0000
Subject: [PATCH 255/681] Doc: QWebEngineUrlResponseInfo: Remove incorrect \fn
 command

QDoc is able to match the documentation to the declaration without
an \fn command as the comment appears directly above the function definition.

Fixes QDoc warning:
clang couldn't find function when parsing
\fn void QWebEngineUrlResponseInfo::setResponseHeaders(
const QMultiMap<QByteArray, QByteArray> &newResponseHeaders)

Change-Id: I9adb86f3dcc2e287439463fa572b5d227c597bfd
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 3f5de5fab74e6c152cdf5d04f3d893feaa31790b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineurlresponseinfo.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/core/api/qwebengineurlresponseinfo.cpp b/src/core/api/qwebengineurlresponseinfo.cpp
index 4a99857058b..e904bc8cfc2 100644
--- a/src/core/api/qwebengineurlresponseinfo.cpp
+++ b/src/core/api/qwebengineurlresponseinfo.cpp
@@ -58,8 +58,6 @@ QHash<QByteArray, QByteArray> QWebEngineUrlResponseInfo::responseHeaders() const
 }
 
 /*!
-    \fn void QWebEngineUrlResponseInfo::setResponseHeaders(
-        const QMultiMap<QByteArray, QByteArray> &newResponseHeaders)
     \brief Sets the response headers to \a newResponseHeaders.
 
     Sets the response headers to \a newResponseHeaders. If \a newResponseHeaders

From 4a26a7b9207d969c7061355211586373beadd24b Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 13 Jan 2023 23:23:08 +0100
Subject: [PATCH 256/681] RenderWidgetHostViewQtDelegateItem: keep grabs

If a WebView or WebEngineView gets a mouse or touch grab, we don't want
to give it up to any handlers that may be lurking on Items underneath.
WebView is opaque, so we don't know whether the user is trying to drag a
scrollbar or something else, but interactive items outside shouldn't
interfere, in general.

[ChangeLog][QtWebEngineQuick] WebEngineView (or WebView backed by Qt
WebEngine) no longer allows components outside to take over the mouse or
touch exclusive grab. For example if the user starts dragging a
scrollbar inside the web view, that continues until release, regardless
of any DragHandler, Flickable etc.

Fixes: QTBUG-103518
Change-Id: I4352dc8482020f0efc7a0901e94ccf7fc147fa1b
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 3feab861f5ead63e2a661343f0df2358fa0af894)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 ...nder_widget_host_view_qt_delegate_item.cpp |  2 +
 tests/auto/quick/qmltests/CMakeLists.txt      |  1 +
 .../data/tst_dragHandlerUnderView.qml         | 67 +++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml

diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index 8579ce51d94..7e7b949fcb6 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -22,8 +22,10 @@ RenderWidgetHostViewQtDelegateItem::RenderWidgetHostViewQtDelegateItem(RenderWid
 {
     setFlag(ItemHasContents);
     setAcceptedMouseButtons(Qt::AllButtons);
+    setKeepMouseGrab(true);
     setAcceptHoverEvents(true);
     setAcceptTouchEvents(true);
+    setKeepTouchGrab(true);
     if (!isPopup) {
         setFocus(true);
         setActiveFocusOnTab(true);
diff --git a/tests/auto/quick/qmltests/CMakeLists.txt b/tests/auto/quick/qmltests/CMakeLists.txt
index acd783bd598..6301e5ab6d2 100644
--- a/tests/auto/quick/qmltests/CMakeLists.txt
+++ b/tests/auto/quick/qmltests/CMakeLists.txt
@@ -25,6 +25,7 @@ set(testList
     tst_datalist.qml
     tst_desktopBehaviorLoadHtml.qml
     tst_download.qml
+    tst_dragHandlerUnderView.qml
     tst_favicon.qml
     tst_faviconDatabase.qml
     tst_filePicker.qml
diff --git a/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml b/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml
new file mode 100644
index 00000000000..c22bd44c285
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml
@@ -0,0 +1,67 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+Item {
+    id: parentItem
+    width: 400
+    height: 300
+
+    Rectangle {
+        id: draggableDownUnder
+        color: "wheat"
+        width: 350
+        height: 250
+
+        DragHandler { id: dragHandler }
+    }
+
+    TestWebEngineView {
+        id: webEngineView
+        width: 300
+        height: 250
+
+        property var testUrl: Qt.resolvedUrl("test4.html")
+
+        SignalSpy {
+            id: scrollPositionSpy
+            target: webEngineView
+            signalName: "onScrollPositionChanged"
+        }
+
+        SignalSpy {
+            id: dragActiveSpy
+            target: dragHandler
+            signalName: "activeChanged"
+        }
+
+        TestCase {
+            id: testCase
+            name: "KeepMouseGrabDuringScrolling"
+            when: windowShown
+
+            function test_scroll() {
+                webEngineView.url = Qt.resolvedUrl("test4.html");
+                verify(webEngineView.waitForLoadSucceeded());
+
+                mousePress(webEngineView, 295, 20);
+                mouseMove(webEngineView, 295, 200);
+                mouseRelease(webEngineView, 295, 200);
+
+                // WebEngineView scrolled if the scrollbar was visible.
+                // But on macOS, the scrollbar is hidden, so text gets selected.
+                tryVerify(function() {
+                    return (scrollPositionSpy.count === 1 && webEngineView.scrollPosition.y > 100)
+                            || webEngineView.getTextSelection().length > 0;
+                });
+
+                // DragHandler didn't take over and drag
+                compare(dragActiveSpy.count, 0);
+                compare(draggableDownUnder.y, 0);
+            }
+        }
+    }
+}

From 67603a8539d05bb0cdf005e20e4444ae6930bda1 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 23 Jun 2023 15:18:41 +0200
Subject: [PATCH 257/681] Disable accessibility for child frames

It was already disabled if extensions were enabled. It caused crash with
disabled extensions.

We don't implement RenderWidgetHostViewQt for child frames thus we
can't create content::WebContentsAccessibility for them.

Change-Id: I5b353143e05a0a12126c89b9c51cdcc69440521a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c49bca87f0e11fd2ff76b7c7929e37be07cb4e03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_manager_qt.cpp | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 49a193b057a..299eb7bb361 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -13,10 +13,6 @@
 #include "render_widget_host_view_qt.h" // WebContentsAccessibilityQt
 
 #include "content/browser/accessibility/browser_accessibility.h"
-#if QT_CONFIG(webengine_extensions)
-#include "content/browser/renderer_host/render_frame_host_impl.h"
-#include "content/public/browser/web_contents.h"
-#endif // QT_CONFIG(webengine_extensions)
 #include "ui/accessibility/ax_enums.mojom.h"
 
 #include <QtGui/qaccessible.h>
@@ -34,12 +30,10 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
     QtWebEngineCore::WebContentsAccessibilityQt *access = nullptr;
     access = static_cast<QtWebEngineCore::WebContentsAccessibilityQt *>(delegate->AccessibilityGetWebContentsAccessibility());
 
-#if QT_CONFIG(webengine_extensions)
-    // Accessibility is not supported for guest views.
+    // Accessibility is not supported for guest views and child frames.
     if (!access) {
         return nullptr;
     }
-#endif // QT_CONFIG(webengine_extensions)
 
     return new BrowserAccessibilityManagerQt(access, initialTree, delegate);
 #else

From 13efc60213b8485b9d56ff24333e4f44cfe484d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kimmo=20Leppa=CC=88la=CC=88?= <kimmo.leppala@qt.io>
Date: Mon, 26 Jun 2023 17:51:46 +0300
Subject: [PATCH 258/681] Remove recipebrowser and simplebrowser from
 Application Examples
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There's already nanobrowser in Application Examples so this removes the
other webengine examples from that category.

Change-Id: I1f6dc7be7cb0ad4b0ac8134eb438ac0a0db7a5d3
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 8b2d2cd8387808dc589eda9bfbc119cc84ca4633)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc    | 1 -
 .../webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc    | 1 -
 2 files changed, 2 deletions(-)

diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
index dd701f1f2d7..e6693b60a01 100644
--- a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -4,7 +4,6 @@
 /*!
     \example webenginewidgets/recipebrowser
     \title Recipe Browser
-    \examplecategory {Application Examples}
     \meta tag {widgets, webengine, webchannel, webenginescript}
     \ingroup webengine-widgetexamples
     \brief Injecting custom stylsheets into web pages and providing a rich text preview
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index 748d19e38c3..f45b362df99 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -3,7 +3,6 @@
 
 /*!
     \example webenginewidgets/simplebrowser
-    \examplecategory {Application Examples}
     \title WebEngine Widgets Simple Browser Example
     \ingroup webengine-widgetexamples
     \brief A simple browser based on \QWE Widgets.

From dc4cb6ca9303235fb216468fc85627ac4834cff9 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Mon, 19 Jun 2023 16:59:03 +0200
Subject: [PATCH 259/681] Sync WebAction enums of
 QQuickWebEngineView/QWebEnginePage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: Ibe750d541dba458f2278632355bcaf864fdc845a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit aec0e99b5b7431740ab1e3ece40a137d6bc2a8c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineview.cpp     | 4 ++++
 src/webenginequick/api/qquickwebengineview_p.h     | 1 +
 src/webenginequick/doc/src/webengineview_lgpl.qdoc | 1 +
 tests/auto/quick/publicapi/tst_publicapi.cpp       | 1 +
 4 files changed, 7 insertions(+)

diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index d20cde3056b..7bab27e74b3 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -36,6 +36,7 @@
 #include <QtWebEngineCore/qwebenginefullscreenrequest.h>
 #include <QtWebEngineCore/qwebengineloadinginfo.h>
 #include <QtWebEngineCore/qwebenginenavigationrequest.h>
+#include <QtWebEngineCore/qwebenginepage.h>
 #include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h>
 #include <QtWebEngineCore/qwebenginescriptcollection.h>
 #include <QtWebEngineCore/private/qwebenginecontextmenurequest_p.h>
@@ -77,6 +78,7 @@
 QT_BEGIN_NAMESPACE
 using namespace QtWebEngineCore;
 
+Q_STATIC_ASSERT(int(QQuickWebEngineView::WebActionCount) == int(QWebEnginePage::WebActionCount));
 #if QT_DEPRECATED_SINCE(6, 2)
 QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::AcceptRequest)            == static_cast<int>(QWebEngineNavigationRequest::AcceptRequest));
@@ -2115,6 +2117,8 @@ QQuickWebEngineAction *QQuickWebEngineView::action(WebAction action)
         text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
         iconName = QStringLiteral("document-save");
         break;
+    case OpenLinkInNewBackgroundTab:
+        break;
     case ViewSource:
         text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
         break;
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index 5b8e183d56a..7084eb173ff 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -214,6 +214,7 @@ QT_WARNING_POP
         RequestClose,
         Unselect,
         SavePage,
+        OpenLinkInNewBackgroundTab, // Not supported in QML
         ViewSource,
 
         ToggleBold,
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 1bcc922dba2..c4d87dc4d18 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -787,6 +787,7 @@
             Exit the fullscreen mode. (Added in Qt 5.6)
     \value  WebEngineView.SavePage
             Save the current web page to disk. (Added in Qt 5.7)
+    \omitvalue WebEngineView.OpenLinkInNewBackgroundTab
     \value  WebEngineView.ViewSource
             Show the source of the current page in a new tab. Requires a handler for the
             \l newWindowRequested() signal. (Added in Qt 5.8)
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index a388886a525..2c85b5d2503 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -671,6 +671,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.ToggleUnderline --> WebAction"
     << "QQuickWebEngineView.Undo --> WebAction"
     << "QQuickWebEngineView.Unselect --> WebAction"
+    << "QQuickWebEngineView.OpenLinkInNewBackgroundTab --> WebAction"
     << "QQuickWebEngineView.ViewSource --> WebAction"
     << "QQuickWebEngineView.WarningMessageLevel --> JavaScriptConsoleMessageLevel"
     << "QQuickWebEngineView.WebActionCount --> WebAction"

From e992354f6473557ee17caf01ba61e141542b1d94 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 23 Jun 2023 15:18:41 +0200
Subject: [PATCH 260/681] Disable accessibility for child frames

It was already disabled if extensions were enabled. It caused crash with
disabled extensions.

We don't implement RenderWidgetHostViewQt for child frames thus we
can't create content::WebContentsAccessibility for them.

Change-Id: I5b353143e05a0a12126c89b9c51cdcc69440521a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c49bca87f0e11fd2ff76b7c7929e37be07cb4e03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_manager_qt.cpp | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 49a193b057a..299eb7bb361 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -13,10 +13,6 @@
 #include "render_widget_host_view_qt.h" // WebContentsAccessibilityQt
 
 #include "content/browser/accessibility/browser_accessibility.h"
-#if QT_CONFIG(webengine_extensions)
-#include "content/browser/renderer_host/render_frame_host_impl.h"
-#include "content/public/browser/web_contents.h"
-#endif // QT_CONFIG(webengine_extensions)
 #include "ui/accessibility/ax_enums.mojom.h"
 
 #include <QtGui/qaccessible.h>
@@ -34,12 +30,10 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
     QtWebEngineCore::WebContentsAccessibilityQt *access = nullptr;
     access = static_cast<QtWebEngineCore::WebContentsAccessibilityQt *>(delegate->AccessibilityGetWebContentsAccessibility());
 
-#if QT_CONFIG(webengine_extensions)
-    // Accessibility is not supported for guest views.
+    // Accessibility is not supported for guest views and child frames.
     if (!access) {
         return nullptr;
     }
-#endif // QT_CONFIG(webengine_extensions)
 
     return new BrowserAccessibilityManagerQt(access, initialTree, delegate);
 #else

From 91d49bcb7face9c75666e87216b521b573bf16a9 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Wed, 14 Jun 2023 14:38:58 +0200
Subject: [PATCH 261/681] Reduce repetitive translated texts of
 QQuickWebEngineView/QWebEnginePage actions

With the action enums in sync, a helper for function returning
the translated texts for the enum values can be introduced.

Change-Id: I1584f0a4d3fd55d0308dbb914777346ba9d0e285
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a2f794dd9a6f743168473e824850e6bd7f121f27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.cpp               | 252 ++++++++----------
 src/core/api/qwebenginepage_p.h               |   2 +
 .../api/qquickwebengineview.cpp               |  63 +----
 3 files changed, 108 insertions(+), 209 deletions(-)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index afb4cde3ce1..4c0b7b8ff6c 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -329,6 +329,109 @@ void QWebEnginePagePrivate::createNewWindow(WindowOpenDisposition disposition, b
     Q_EMIT q->newWindowRequested(request);
 }
 
+QString QWebEnginePagePrivate::actionText(int action)
+{
+    switch (action) {
+    case QWebEnginePage::Back:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Back);
+    case QWebEnginePage::Forward:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Forward);
+    case QWebEnginePage::Stop:
+        return QWebEnginePage::tr("Stop");
+    case QWebEnginePage::Reload:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Reload);
+    case QWebEnginePage::ReloadAndBypassCache:
+        return QWebEnginePage::tr("Reload and Bypass Cache");
+    case QWebEnginePage::Cut:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Cut);
+    case QWebEnginePage::Copy:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Copy);
+    case QWebEnginePage::Paste:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Paste);
+    case QWebEnginePage::Undo:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Undo);
+    case QWebEnginePage::Redo:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Redo);
+    case QWebEnginePage::SelectAll:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SelectAll);
+    case QWebEnginePage::PasteAndMatchStyle:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::PasteAndMatchStyle);
+    case QWebEnginePage::OpenLinkInThisWindow:
+        return QWebEnginePage::tr("Open link in this window");
+    case QWebEnginePage::OpenLinkInNewWindow:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewWindow);
+    case QWebEnginePage::OpenLinkInNewTab:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewTab);
+    case QWebEnginePage::OpenLinkInNewBackgroundTab:
+        return QWebEnginePage::tr("Open link in new background tab");
+    case QWebEnginePage::CopyLinkToClipboard:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyLinkToClipboard);
+    case QWebEnginePage::DownloadLinkToDisk:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadLinkToDisk);
+    case QWebEnginePage::CopyImageToClipboard:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageToClipboard);
+    case QWebEnginePage::CopyImageUrlToClipboard:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageUrlToClipboard);
+    case QWebEnginePage::DownloadImageToDisk:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadImageToDisk);
+    case QWebEnginePage::CopyMediaUrlToClipboard:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyMediaUrlToClipboard);
+    case QWebEnginePage::ToggleMediaControls:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaControls);
+    case QWebEnginePage::ToggleMediaLoop:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaLoop);
+    case QWebEnginePage::ToggleMediaPlayPause:
+        return QWebEnginePage::tr("Toggle Play/Pause");
+    case QWebEnginePage::ToggleMediaMute:
+        return QWebEnginePage::tr("Toggle Mute");
+    case QWebEnginePage::DownloadMediaToDisk:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadMediaToDisk);
+    case QWebEnginePage::InspectElement:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::InspectElement);
+    case QWebEnginePage::ExitFullScreen:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ExitFullScreen);
+    case QWebEnginePage::RequestClose:
+        return QWebEnginePage::tr("Close Page");
+    case QWebEnginePage::Unselect:
+        return QWebEnginePage::tr("Unselect");
+    case QWebEnginePage::SavePage:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
+    case QWebEnginePage::ViewSource:
+        return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
+    case QWebEnginePage::ToggleBold:
+        return QWebEnginePage::tr("&Bold");
+    case QWebEnginePage::ToggleItalic:
+        return QWebEnginePage::tr("&Italic");
+    case QWebEnginePage::ToggleUnderline:
+        return QWebEnginePage::tr("&Underline");
+    case QWebEnginePage::ToggleStrikethrough:
+        return QWebEnginePage::tr("&Strikethrough");
+    case QWebEnginePage::AlignLeft:
+        return QWebEnginePage::tr("Align &Left");
+    case QWebEnginePage::AlignCenter:
+        return QWebEnginePage::tr("Align &Center");
+    case QWebEnginePage::AlignRight:
+        return QWebEnginePage::tr("Align &Right");
+    case QWebEnginePage::AlignJustified:
+        return QWebEnginePage::tr("Align &Justified");
+    case QWebEnginePage::Indent:
+        return QWebEnginePage::tr("&Indent");
+    case QWebEnginePage::Outdent:
+        return QWebEnginePage::tr("&Outdent");
+    case QWebEnginePage::InsertOrderedList:
+        return QWebEnginePage::tr("Insert &Ordered List");
+    case QWebEnginePage::InsertUnorderedList:
+        return QWebEnginePage::tr("Insert &Unordered List");
+    case QWebEnginePage::ChangeTextDirectionLTR:
+        return QWebEnginePage::tr("Change text direction left to right");
+    case QWebEnginePage::ChangeTextDirectionRTL:
+        return QWebEnginePage::tr("Change text direction right to left");
+    default:
+        break;
+    }
+    return {};
+}
+
 class WebContentsAdapterOwner : public QObject
 {
 public:
@@ -1042,154 +1145,7 @@ QAction *QWebEnginePage::action(WebAction action) const
     if (d->actions[action])
         return d->actions[action];
 
-    QString text;
-    switch (action) {
-    case Back:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Back);
-        break;
-    case Forward:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Forward);
-        break;
-    case Stop:
-        text = tr("Stop");
-        break;
-    case Reload:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Reload);
-        break;
-    case ReloadAndBypassCache:
-        text = tr("Reload and Bypass Cache");
-        break;
-    case Cut:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Cut);
-        break;
-    case Copy:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Copy);
-        break;
-    case Paste:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Paste);
-        break;
-    case Undo:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Undo);
-        break;
-    case Redo:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Redo);
-        break;
-    case SelectAll:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SelectAll);
-        break;
-    case PasteAndMatchStyle:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::PasteAndMatchStyle);
-        break;
-    case OpenLinkInThisWindow:
-        text = tr("Open link in this window");
-        break;
-    case OpenLinkInNewWindow:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewWindow);
-        break;
-    case OpenLinkInNewTab:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewTab);
-        break;
-    case OpenLinkInNewBackgroundTab:
-        text = tr("Open link in new background tab");
-        break;
-    case CopyLinkToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyLinkToClipboard);
-        break;
-    case DownloadLinkToDisk:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadLinkToDisk);
-        break;
-    case CopyImageToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageToClipboard);
-        break;
-    case CopyImageUrlToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageUrlToClipboard);
-        break;
-    case DownloadImageToDisk:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadImageToDisk);
-        break;
-    case CopyMediaUrlToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyMediaUrlToClipboard);
-        break;
-    case ToggleMediaControls:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaControls);
-        break;
-    case ToggleMediaLoop:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaLoop);
-        break;
-    case ToggleMediaPlayPause:
-        text = tr("Toggle Play/Pause");
-        break;
-    case ToggleMediaMute:
-        text = tr("Toggle Mute");
-        break;
-    case DownloadMediaToDisk:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadMediaToDisk);
-        break;
-    case InspectElement:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::InspectElement);
-        break;
-    case ExitFullScreen:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ExitFullScreen);
-        break;
-    case RequestClose:
-        text = tr("Close Page");
-        break;
-    case Unselect:
-        text = tr("Unselect");
-        break;
-    case SavePage:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
-        break;
-    case ViewSource:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
-        break;
-    case ToggleBold:
-        text = tr("&Bold");
-        break;
-    case ToggleItalic:
-        text = tr("&Italic");
-        break;
-    case ToggleUnderline:
-        text = tr("&Underline");
-        break;
-    case ToggleStrikethrough:
-        text = tr("&Strikethrough");
-        break;
-    case AlignLeft:
-        text = tr("Align &Left");
-        break;
-    case AlignCenter:
-        text = tr("Align &Center");
-        break;
-    case AlignRight:
-        text = tr("Align &Right");
-        break;
-    case AlignJustified:
-        text = tr("Align &Justified");
-        break;
-    case Indent:
-        text = tr("&Indent");
-        break;
-    case Outdent:
-        text = tr("&Outdent");
-        break;
-    case InsertOrderedList:
-        text = tr("Insert &Ordered List");
-        break;
-    case InsertUnorderedList:
-        text = tr("Insert &Unordered List");
-        break;
-    case ChangeTextDirectionLTR:
-        text = tr("Change text direction left to right");
-        break;
-    case ChangeTextDirectionRTL:
-        text = tr("Change text direction right to left");
-        break;
-    case NoWebAction:
-    case WebActionCount:
-        Q_UNREACHABLE();
-        break;
-    }
+    const QString text = QWebEnginePagePrivate::actionText(action);
 
     QAction *a = new QAction(const_cast<QWebEnginePage*>(this));
     a->setText(text);
diff --git a/src/core/api/qwebenginepage_p.h b/src/core/api/qwebenginepage_p.h
index bb33c7e984e..532a9b942fa 100644
--- a/src/core/api/qwebenginepage_p.h
+++ b/src/core/api/qwebenginepage_p.h
@@ -186,6 +186,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEnginePagePrivate : public QtWebEngineC
     void setFullScreenMode(bool);
     void ensureInitialized() const;
 
+    static QString actionText(int action);
+
     QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
     QWebEngineHistory *history;
     QWebEngineProfile *profile;
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index 7bab27e74b3..aafec7295d4 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -43,6 +43,7 @@
 #include <QtWebEngineCore/private/qwebenginehistory_p.h>
 #include <QtWebEngineCore/private/qwebenginenewwindowrequest_p.h>
 #include <QtWebEngineCore/private/qwebenginescriptcollection_p.h>
+#include <QtWebEngineCore/private/qwebenginepage_p.h>
 #include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
 
 #include <QtCore/qloggingcategory.h>
@@ -2002,173 +2003,113 @@ QQuickWebEngineAction *QQuickWebEngineView::action(WebAction action)
         return d->actions[action];
     }
 
-    QString text;
+    const QString text = QWebEnginePagePrivate::actionText(action);
     QString iconName;
 
     switch (action) {
     case Back:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Back);
         iconName = QStringLiteral("go-previous");
         break;
     case Forward:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Forward);
         iconName = QStringLiteral("go-next");
         break;
     case Stop:
-        text = tr("Stop");
         iconName = QStringLiteral("process-stop");
         break;
     case Reload:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Reload);
         iconName = QStringLiteral("view-refresh");
         break;
     case ReloadAndBypassCache:
-        text = tr("Reload and Bypass Cache");
         iconName = QStringLiteral("view-refresh");
         break;
     case Cut:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Cut);
         iconName = QStringLiteral("edit-cut");
         break;
     case Copy:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Copy);
         iconName = QStringLiteral("edit-copy");
         break;
     case Paste:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Paste);
         iconName = QStringLiteral("edit-paste");
         break;
     case Undo:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Undo);
         iconName = QStringLiteral("edit-undo");
         break;
     case Redo:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Redo);
         iconName = QStringLiteral("edit-redo");
         break;
     case SelectAll:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SelectAll);
         iconName = QStringLiteral("edit-select-all");
         break;
     case PasteAndMatchStyle:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::PasteAndMatchStyle);
         iconName = QStringLiteral("edit-paste");
         break;
     case OpenLinkInThisWindow:
-        text = tr("Open link in this window");
-        break;
     case OpenLinkInNewWindow:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewWindow);
-        break;
     case OpenLinkInNewTab:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewTab);
-        break;
     case CopyLinkToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyLinkToClipboard);
-        break;
     case DownloadLinkToDisk:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadLinkToDisk);
-        break;
     case CopyImageToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageToClipboard);
-        break;
     case CopyImageUrlToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageUrlToClipboard);
-        break;
     case DownloadImageToDisk:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadImageToDisk);
-        break;
     case CopyMediaUrlToClipboard:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyMediaUrlToClipboard);
-        break;
     case ToggleMediaControls:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaControls);
-        break;
     case ToggleMediaLoop:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaLoop);
         break;
     case ToggleMediaPlayPause:
-        text = tr("Toggle Play/Pause");
         iconName = QStringLiteral("media-playback-start");
         break;
     case ToggleMediaMute:
-        text = tr("Toggle Mute");
         iconName = QStringLiteral("audio-volume-muted");
         break;
     case DownloadMediaToDisk:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadMediaToDisk);
-        break;
     case InspectElement:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::InspectElement);
         break;
     case ExitFullScreen:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ExitFullScreen);
         iconName = QStringLiteral("view-fullscreen");
         break;
     case RequestClose:
-        text = tr("Close Page");
         iconName = QStringLiteral("window-close");
         break;
     case Unselect:
-        text = tr("Unselect");
         iconName = QStringLiteral("edit-select-none");
         break;
     case SavePage:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
         iconName = QStringLiteral("document-save");
         break;
     case OpenLinkInNewBackgroundTab:
         break;
     case ViewSource:
-        text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
         break;
     case ToggleBold:
-        text = tr("&Bold");
         iconName = QStringLiteral("format-text-bold");
         break;
     case ToggleItalic:
-        text = tr("&Italic");
         iconName = QStringLiteral("format-text-italic");
         break;
     case ToggleUnderline:
-        text = tr("&Underline");
         iconName = QStringLiteral("format-text-underline");
         break;
     case ToggleStrikethrough:
-        text = tr("&Strikethrough");
         iconName = QStringLiteral("format-text-strikethrough");
         break;
     case AlignLeft:
-        text = tr("Align &Left");
         break;
     case AlignCenter:
-        text = tr("Align &Center");
         break;
     case AlignRight:
-        text = tr("Align &Right");
         break;
     case AlignJustified:
-        text = tr("Align &Justified");
         break;
     case Indent:
-        text = tr("&Indent");
         iconName = QStringLiteral("format-indent-more");
         break;
     case Outdent:
-        text = tr("&Outdent");
         iconName = QStringLiteral("format-indent-less");
         break;
     case InsertOrderedList:
-        text = tr("Insert &Ordered List");
-        break;
     case InsertUnorderedList:
-        text = tr("Insert &Unordered List");
-        break;
     case ChangeTextDirectionLTR:
-        text = tr("Change text direction left to right");
-        break;
     case ChangeTextDirectionRTL:
-        text = tr("Change text direction right to left");
         break;
     case NoWebAction:
     case WebActionCount:

From 071ad4ac482995f163bb2cb4fdb685c5447a345e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 28 Jun 2023 22:32:08 +0200
Subject: [PATCH 262/681] Add Info.plist file to macos version of some examples

This demonstrates how to use NSLocationUsageDescription to enable the
application to habve macos prompt the user for permission to access the
location.

Also, add a signing to the post build steps and document that this is
necessary on macos.

Fixes: QTBUG-114117
Change-Id: If81a24cb9a48ef8fefa53f672a8fc7bf25a25477
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 .../quicknanobrowser/CMakeLists.txt           | 13 ++++++++
 .../quicknanobrowser/Info.cmake.macos.plist   | 32 +++++++++++++++++++
 examples/webenginewidgets/maps/CMakeLists.txt | 14 ++++++++
 .../maps/Info.cmake.macos.plist               | 32 +++++++++++++++++++
 .../simplebrowser/CMakeLists.txt              | 14 ++++++++
 .../simplebrowser/Info.cmake.macos.plist      | 32 +++++++++++++++++++
 src/core/doc/src/qtwebengine-features.qdoc    |  4 +++
 7 files changed, 141 insertions(+)
 create mode 100644 examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
 create mode 100644 examples/webenginewidgets/maps/Info.cmake.macos.plist
 create mode 100644 examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist

diff --git a/examples/webenginequick/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
index ac41569aacf..b2736e03026 100644
--- a/examples/webenginequick/quicknanobrowser/CMakeLists.txt
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -22,6 +22,7 @@ qt_add_executable(quicknanobrowser
 set_target_properties(quicknanobrowser PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginequick.quicknanobrowser"
 )
 
 target_link_libraries(quicknanobrowser PUBLIC
@@ -77,6 +78,18 @@ if(TARGET Qt::Widgets)
     )
 endif()
 
+if (APPLE)
+    set_target_properties(quicknanobrowser PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET quicknanobrowser
+            POST_BUILD COMMAND codesign -s - quicknanobrowser.app)
+    endif()
+endif()
+
 install(TARGETS quicknanobrowser
     RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
     BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
new file mode 100644
index 00000000000..cb967fc9003
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>Quick Nano Browser would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/examples/webenginewidgets/maps/CMakeLists.txt b/examples/webenginewidgets/maps/CMakeLists.txt
index f6e6b94ea42..7f3f6d9eda4 100644
--- a/examples/webenginewidgets/maps/CMakeLists.txt
+++ b/examples/webenginewidgets/maps/CMakeLists.txt
@@ -22,6 +22,7 @@ qt_add_executable(maps
 set_target_properties(maps PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.maps"
 )
 
 target_link_libraries(maps PUBLIC
@@ -30,6 +31,19 @@ target_link_libraries(maps PUBLIC
     Qt::WebEngineWidgets
 )
 
+if (APPLE)
+    set_target_properties(maps PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET maps
+            POST_BUILD COMMAND codesign -s - maps.app)
+    endif()
+endif()
+
+
 install(TARGETS maps
     RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
     BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webenginewidgets/maps/Info.cmake.macos.plist b/examples/webenginewidgets/maps/Info.cmake.macos.plist
new file mode 100644
index 00000000000..56104a7d98d
--- /dev/null
+++ b/examples/webenginewidgets/maps/Info.cmake.macos.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>The maps demo would like to access your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/examples/webenginewidgets/simplebrowser/CMakeLists.txt b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
index 2dd4fd57a34..75f2e37daeb 100644
--- a/examples/webenginewidgets/simplebrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
@@ -32,6 +32,7 @@ qt_add_executable(simplebrowser
 set_target_properties(simplebrowser PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.simplebrowser"
 )
 
 target_link_libraries(simplebrowser PUBLIC
@@ -75,6 +76,19 @@ qt_add_resources(simplebrowser "simplebrowser1"
         ${simplebrowser1_resource_files}
 )
 
+if (APPLE)
+    set_target_properties(simplebrowser PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET simplebrowser
+            POST_BUILD COMMAND codesign -s - simplebrowser.app)
+    endif()
+endif()
+
+
 install(TARGETS simplebrowser
     RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
     BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
new file mode 100644
index 00000000000..76f74771993
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>Simple Browser would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 3d6d0fea8c7..11de95d4440 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -304,6 +304,10 @@
     {Location services}, \uicontrol {Let apps access your location} and \uicontrol
     {Let desktop apps access your location}.
 
+    \note On macOS add a description text explaining why use of the location is needed
+    using the \c NSLocationUsageDescription in your application's \c Info.plist file
+    and sign the application to trigger \c macos to ask the user for permission.
+
     See \l{Qt Positioning} for a possible backend setup like the GPS or IP based positioning.
 
     Support for this feature was added in Qt 5.5.0.

From f3dfb707d7effafbf96567b9d87b95b83cc4140a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Thu, 29 Jun 2023 15:43:37 +0200
Subject: [PATCH 263/681] Doc: Promote Qt6::WebEngine* cmake targets

Be consistent with the other modules, and promote
Qt6:: targets instead of the (mostly functionally equivalent)
Qt:: one's.

Change-Id: I4da0b7a29782d8927de5e5eafcaf934afb128937
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 58ec902ec47284eee430715ddd39a30d871a18e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc        | 2 +-
 src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc  | 2 +-
 .../doc/snippets/qtwebenginewidgets_build_snippet.qdoc          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
index ee22ea774c9..9a7370d62f2 100644
--- a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
+++ b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
@@ -7,5 +7,5 @@ QT += webenginecore
 
 //! [2]
 find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
-target_link_libraries(target PRIVATE Qt::WebEngineCore)
+target_link_libraries(target PRIVATE Qt6::WebEngineCore)
 //! [2]
diff --git a/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc b/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
index 76dea97cfbd..f8fbbd669c2 100644
--- a/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
+++ b/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
@@ -7,5 +7,5 @@ QT += webenginequick
 
 //! [2]
 find_package(Qt6 REQUIRED COMPONENTS WebEngineQuick)
-target_link_libraries(target PRIVATE Qt::WebEngineQuick)
+target_link_libraries(target PRIVATE Qt6::WebEngineQuick)
 //! [2]
diff --git a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
index 4ab54a2ba83..f11f550ffe0 100644
--- a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
+++ b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
@@ -7,5 +7,5 @@ QT += webenginewidgets
 
 //! [2]
 find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets)
-target_link_libraries(target PRIVATE Qt::WebEngineWidgets)
+target_link_libraries(target PRIVATE Qt6::WebEngineWidgets)
 //! [2]

From f59cd58a7307f5f5849a2b1068f6b42380150449 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 3 Jul 2023 05:51:18 +0000
Subject: [PATCH 264/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I703e8c39faaab4d9ce0170c06f1d80623fd2b12b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b9731dc8673..c992b6a336a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: baf0c61e12601e1164ef6864f55eb8aec22fe73e
+    ref: aee6865deb1c122c563c0bdca03d3ca7e56b9d75
     required: true
   ../qtpositioning:
-    ref: e3e83c11019c38bc7e3d5dab6424bab5ebf6fe1b
+    ref: b760114fff8266c0b1923db723e3720049c813a0
     required: false
   ../qttools:
-    ref: 1b25b79b6436aa24f3c3a2d494bf719d37697ef1
+    ref: bb122d3e4d986b48ff7793ff537910e21890e798
     required: false
   ../qtwebchannel:
-    ref: bf937863907f4ff1f34bffbebde9bc993abb4c54
+    ref: 1afc61f83b45c5b3b9222aa02056aebf5c788fce
     required: false

From 562ad5e4de5814043bf5aa1e66f7848c8ed2ad65 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 4 Jul 2023 21:06:27 +0200
Subject: [PATCH 265/681] Change QPdfLinkModel::linkAt() to take QPointF by
 value

...as suggested in the 6.6 header review.
It's small enough to be more efficient that way.

Change-Id: Ia2b7a983f4edf6e66dc13905e31a11d7e4be4290
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 00783b4f988c97ac1af59981d168704629f92610)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdflinkmodel.cpp | 2 +-
 src/pdf/qpdflinkmodel.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp
index 8e243e4afe7..819af708228 100644
--- a/src/pdf/qpdflinkmodel.cpp
+++ b/src/pdf/qpdflinkmodel.cpp
@@ -154,7 +154,7 @@ void QPdfLinkModel::setPage(int page)
     not found. In other words, this function is useful for picking, to handle
     mouse click or hover.
 */
-QPdfLink QPdfLinkModel::linkAt(const QPointF &point) const
+QPdfLink QPdfLinkModel::linkAt(QPointF point) const
 {
     Q_D(const QPdfLinkModel);
     for (const auto &link : std::as_const(d->links)) {
diff --git a/src/pdf/qpdflinkmodel.h b/src/pdf/qpdflinkmodel.h
index 4ae23d8477d..2923b81cd72 100644
--- a/src/pdf/qpdflinkmodel.h
+++ b/src/pdf/qpdflinkmodel.h
@@ -42,7 +42,7 @@ class Q_PDF_EXPORT QPdfLinkModel : public QAbstractListModel
 
     int page() const;
 
-    QPdfLink linkAt(const QPointF &point) const;
+    QPdfLink linkAt(QPointF point) const;
 
 public Q_SLOTS:
     void setDocument(QPdfDocument *document);

From 03ebe2a65b5b08bb280ac72024bc616d19e360b6 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 7 Jul 2023 20:07:32 +0000
Subject: [PATCH 266/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I8fbf8bd2194185abcb9f65c2eeee8ce7b66d48fc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c992b6a336a..506548dcafd 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: aee6865deb1c122c563c0bdca03d3ca7e56b9d75
+    ref: b336de30c1525e19b4691591c11d020962d2b530
     required: true
   ../qtpositioning:
-    ref: b760114fff8266c0b1923db723e3720049c813a0
+    ref: 987a5a5d3efee715f415d822b869cf23b77477bc
     required: false
   ../qttools:
-    ref: bb122d3e4d986b48ff7793ff537910e21890e798
+    ref: a662dd624ee0ebb3ec633c8ee080955215269753
     required: false
   ../qtwebchannel:
-    ref: 1afc61f83b45c5b3b9222aa02056aebf5c788fce
+    ref: 2142bdfdc5db587939b4775e968569798af14ef4
     required: false

From 2789071383399996d8ba7c32c2b11fe86f514593 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 28 Jun 2023 16:13:27 +0200
Subject: [PATCH 267/681] Fix invalid html in tst_touchinput

With the invalid 'width' attribute the input element
defaults to a size that depends on the system (charmap) settings.
It may result in failing tests that depend on the size of the element
e.g. tests that use 'elementCenter'.

Task-number: QTBUG-105342
Change-Id: I508d365fc4240d67d3e2240e8e33495c1de6ee4c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 17bafdc301a057ed4b28dc3acc9bd636183683d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/widgets/touchinput/tst_touchinput.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/widgets/touchinput/tst_touchinput.cpp b/tests/auto/widgets/touchinput/tst_touchinput.cpp
index 562ccfcef0e..de3712370a0 100644
--- a/tests/auto/widgets/touchinput/tst_touchinput.cpp
+++ b/tests/auto/widgets/touchinput/tst_touchinput.cpp
@@ -130,7 +130,7 @@ void TouchInputTest::initTestCase()
     view.setHtml("<html><head><style>.rect { min-width: 240px; min-height: 120px; }</style></head><body>"
                  "<p id='text' style='width: 150px;'>The Qt Company</p>"
                  "<div id='notext' style='width: 150px; height: 100px; background-color: #f00;'></div>"
-                 "<form><input id='input' width='150px' type='text' value='The Qt Company2' /></form>"
+                 "<form><input id='input' style='width: 150px;' type='text' value='The Qt Company2' /></form>"
                  "<button id='btn' type='button' onclick='alert(\"button clicked!\")'>Click Me!</button>"
                  "<select id='select' onchange='alert(\"option changed to: \" + this.value)'>"
                  "<option value='O1'>O1</option><option value='O2'>O2</option><option value='O3'>O3</option></select>"

From 34b64411bc6701bf9a63a8bd3320e7b83a8dc63c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 12 Jul 2023 15:44:45 +0000
Subject: [PATCH 268/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I755430a26c0bb47a9e85a2197ff1510bd3e951cb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 506548dcafd..0e0663d4c56 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b336de30c1525e19b4691591c11d020962d2b530
+    ref: 52647cdc485534eec5387fb816f187046fed45b4
     required: true
   ../qtpositioning:
-    ref: 987a5a5d3efee715f415d822b869cf23b77477bc
+    ref: df9deada2d5dd259ee32572423d7a8f7529dc079
     required: false
   ../qttools:
-    ref: a662dd624ee0ebb3ec633c8ee080955215269753
+    ref: 6826785b101281fbafc69d49c7bfadf463609a57
     required: false
   ../qtwebchannel:
-    ref: 2142bdfdc5db587939b4775e968569798af14ef4
+    ref: 87976cfbacf70d5349211278c400e90bd2d6e113
     required: false

From 0f8528fb7a2b06557cd7d94056acb5ed40e60f17 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 11 Jul 2023 08:23:08 +0200
Subject: [PATCH 269/681] Stabilize qwebengineloadinginfo::responseHeaders

The wait took too long. Rewrite it to be race safe, and increase timeoue.

Change-Id: I18c8e17621502bfcfaa739d900ea64e33d0678f6
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 43990d33bb25ff88305ba0ed5d51a8bbf1bf5877)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
index 064abe816f1..daa6bb0791e 100644
--- a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
+++ b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
@@ -82,7 +82,7 @@ private Q_SLOTS:
         QWebEngineHttpRequest request(httpServer.url("/somepage.html"));
         page.load(request);
 
-        QVERIFY(spy.wait());
+        QTRY_VERIFY_WITH_TIMEOUT(spy.count() > 0, 20000);
         QVERIFY(httpServer.stop());
     }
 };

From 9daed7956558370f94767698855ceec3a4231e65 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 10 Jul 2023 13:46:36 +0200
Subject: [PATCH 270/681] Fix path to licenses.py

Change-Id: I7afe79cceb11f8166990cac4470dfc8e44d52b0c
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
(cherry picked from commit a3452104907874f4a3ffee83ec99c639004405e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index e7981134644..89c3b62173f 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1383,7 +1383,7 @@ function(add_code_attributions_target)
     add_custom_command(
         OUTPUT ${arg_OUTPUT}
         COMMAND ${CMAKE_COMMAND}
-            -DLICENSE_SCRIPT=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
+            -DLICENSE_SCRIPT=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses/licenses.py
             -DFILE_TEMPLATE=${fileTemplate}
             -DENTRY_TEMPLATE=${entryTemplate}
             -DGN_TARGET=${arg_GN_TARGET}
@@ -1393,7 +1393,7 @@ function(add_code_attributions_target)
             -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/License.cmake
         WORKING_DIRECTORY ${WEBENGINE_ROOT_BUILD_DIR}
         DEPENDS
-            ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses.py
+            ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses/licenses.py
             ${arg_FILE_TEMPLATE}
             ${arg_ENTRY_TEMPLATE}
             ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/License.cmake

From daced2f5621bbe73ac1bbf0aa7ae83b0f49d7a4c Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 24 Apr 2023 09:47:09 +0200
Subject: [PATCH 271/681] Make compatible with Chromium EGL

Change-Id: I3ee4d2f9940966f5a050cce3d9d6d3d415a13901
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 09ab9ab74efcd0da0a310c992629bc650a5a80ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/ozone/gl_ozone_egl_qt.cpp   | 27 +++-------
 src/core/ozone/gl_surface_egl_qt.cpp | 79 ----------------------------
 2 files changed, 7 insertions(+), 99 deletions(-)

diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp
index 5e2540af862..287f07713cd 100644
--- a/src/core/ozone/gl_ozone_egl_qt.cpp
+++ b/src/core/ozone/gl_ozone_egl_qt.cpp
@@ -25,35 +25,22 @@
 
 namespace ui {
 
-bool GLOzoneEGLQt::LoadGLES2Bindings(const gl::GLImplementationParts & /*implementation*/)
+bool LoadQtEGLBindings()
 {
-    base::NativeLibrary eglgles2Library = dlopen(NULL, RTLD_LAZY);
-    if (!eglgles2Library) {
-        LOG(ERROR) << "Failed to open EGL/GLES2 context " << dlerror();
-        return false;
-    }
-
-    gl::GLGetProcAddressProc get_proc_address =
-            reinterpret_cast<gl::GLGetProcAddressProc>(
-                base::GetFunctionPointerFromNativeLibrary(eglgles2Library,
-                                                          "eglGetProcAddress"));
-    if (!get_proc_address) {
-        // QTBUG-63341 most likely libgles2 not linked with libegl -> fallback to qpa
-        get_proc_address =
-                reinterpret_cast<gl::GLGetProcAddressProc>(GLContextHelper::getEglGetProcAddress());
-    }
-
+    gl::GLGetProcAddressProc get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(GLContextHelper::getEglGetProcAddress());
     if (!get_proc_address) {
         LOG(ERROR) << "eglGetProcAddress not found.";
-        base::UnloadNativeLibrary(eglgles2Library);
         return false;
     }
-
     gl::SetGLGetProcAddressProc(get_proc_address);
-    gl::AddGLNativeLibrary(eglgles2Library);
     return true;
 }
 
+bool GLOzoneEGLQt::LoadGLES2Bindings(const gl::GLImplementationParts & /*implementation*/)
+{
+    return LoadQtEGLBindings();
+}
+
 gl::GLDisplay *GLOzoneEGLQt::InitializeGLOneOffPlatform(uint64_t system_device_id)
 {
     if (auto display = gl::GLSurfaceEGLQt::InitializeOneOff(system_device_id)) {
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index b83f8f50664..63694d59db6 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -21,75 +21,6 @@ using ui::GetLastEGLErrorString;
 
 namespace gl {
 
-bool GLDisplayEGL::InitializeExtensionSettings()
-{
-    if (display_ == EGL_NO_DISPLAY)
-        return false;
-    ext->UpdateConditionalExtensionSettings(display_);
-    return true;
-}
-
-GLDisplayEGL *GLDisplayEGL::GetDisplayForCurrentContext()
-{
-    GLContext *context = GLContext::GetCurrent();
-    return context ? context->GetGLDisplayEGL() : nullptr;
-}
-
-bool GLDisplayEGL::IsEGLSurfacelessContextSupported()
-{
-    return GLSurfaceEGLQt::g_egl_surfaceless_context_supported;
-}
-
-bool GLDisplayEGL::IsEGLContextPrioritySupported()
-{
-    return false;
-}
-
-bool GLDisplayEGL::Initialize(gl::EGLDisplayPlatform native_display)
-{
-    auto glDisplay = GLSurfaceEGLQt::InitializeOneOff(0);
-
-    if (glDisplay) {
-        display_ = glDisplay->GetDisplay();
-        native_display_ = native_display;
-        std::string platform_extensions(ext->GetPlatformExtensions(display_));
-        gfx::ExtensionSet extensions(gfx::MakeExtensionSet(platform_extensions));
-        ext->b_EGL_EXT_image_dma_buf_import =
-                gfx::HasExtension(extensions, "EGL_EXT_image_dma_buf_import");
-        ext->b_EGL_EXT_image_dma_buf_import_modifiers =
-                gfx::HasExtension(extensions, "EGL_EXT_image_dma_buf_import_modifiers");
-//        ext->InitializeExtensionSettings(display_); Not functional for us at this moment
-    }
-
-    return glDisplay;
-}
-
-bool GLDisplayEGL::IsAndroidNativeFenceSyncSupported()
-{
-    return false;
-}
-
-// static
-GLDisplayEGL *GLSurfaceEGL::GetGLDisplayEGL()
-{
-    return GLDisplayManagerEGL::GetInstance()->GetDisplay(GpuPreference::kDefault);
-}
-
-DisplayType GLDisplayEGL::GetDisplayType() const
-{
-    return DisplayType::DEFAULT;
-}
-
-EGLDisplayPlatform GLDisplayEGL::GetNativeDisplay() const
-{
-    return native_display_;
-}
-
-GLSurface *GLSurfaceEGL::createSurfaceless(gl::GLDisplayEGL *display, const gfx::Size& size)
-{
-    return new GLSurfacelessQtEGL(display, size);
-}
-
 bool GLSurfaceEGLQt::g_egl_surfaceless_context_supported = false;
 bool GLSurfaceEGLQt::s_initialized = false;
 
@@ -265,15 +196,5 @@ void* GLSurfacelessQtEGL::GetShareHandle()
     return NULL;
 }
 
-std::string DisplayExtensionsEGL::GetPlatformExtensions(EGLDisplay)
-{
-    EGLDisplay display = GLContextHelper::getEGLDisplay();
-    if (display == EGL_NO_DISPLAY)
-        return "";
-
-    const char* str = eglQueryString(display, EGL_EXTENSIONS);
-    return str ? std::string(str) : "";
-}
-
 } // namespace gl
 #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)

From 51457a3d76a43d2b9b9278470ef181ac1afc21bd Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 16 Feb 2023 17:57:29 +0100
Subject: [PATCH 272/681] Adaptations for Chromium 110

Change-Id: I56e1695ee4fc2b0e12da6580a5673df80bba8b6d
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit d488349ee0ecac8a2e5a87a18d249c7b5de39152)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake                         |  5 ++-
 src/core/CMakeLists.txt                       |  6 +--
 src/core/autofill_client_qt.cpp               |  2 +-
 src/core/autofill_client_qt.h                 |  2 +-
 src/core/browser_accessibility_manager_qt.cpp |  2 +-
 src/core/client_hints.cpp                     |  2 +-
 src/core/client_hints.h                       |  2 +-
 .../display_software_output_surface.cpp       |  4 +-
 .../compositor/native_skia_output_device.cpp  | 22 ++++-----
 src/core/configure/BUILD.root.gn.in           |  1 -
 src/core/content_main_delegate_qt.cpp         |  2 +-
 src/core/extensions/extension_system_qt.cpp   | 41 ++++++++++-------
 src/core/extensions/extension_system_qt.h     |  2 +-
 .../extensions_browser_client_qt.cpp          |  4 +-
 .../pdf_iframe_navigation_throttle_qt.cpp     | 13 +++---
 src/core/favicon_service_factory_qt.cpp       |  9 +++-
 src/core/favicon_service_factory_qt.h         |  2 +-
 ...le_system_access_permission_context_qt.cpp |  4 ++
 ...file_system_access_permission_context_qt.h |  1 +
 .../proxying_restricted_cookie_manager_qt.cpp | 14 ++----
 .../proxying_restricted_cookie_manager_qt.h   |  4 --
 src/core/ozone/gl_ozone_glx_qt.cpp            |  3 +-
 src/core/ozone/gl_ozone_glx_qt.h              |  2 +-
 src/core/ozone/platform_window_qt.h           |  2 +-
 src/core/permission_manager_qt.cpp            |  2 +-
 src/core/pref_service_adapter.cpp             |  2 -
 .../printing/print_view_manager_base_qt.cpp   | 45 ++++++-------------
 .../printing/print_view_manager_base_qt.h     | 10 +----
 src/core/process_main.cpp                     |  1 -
 .../renderer/content_renderer_client_qt.cpp   | 15 ++++---
 .../renderer/web_channel_ipc_transport.cpp    | 17 +++----
 src/core/web_contents_adapter.cpp             |  7 ++-
 src/core/web_contents_delegate_qt.cpp         |  6 ---
 src/core/web_contents_delegate_qt.h           |  1 -
 src/core/web_engine_context.cpp               |  1 -
 src/pdf/CMakeLists.txt                        |  5 +++
 36 files changed, 114 insertions(+), 149 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 89c3b62173f..10601e866da 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -855,7 +855,8 @@ macro(append_build_type_setup)
         forbid_non_component_debug_builds=false
         treat_warnings_as_errors=false
         use_allocator_shim=false
-        use_allocator="none"
+        use_partition_alloc=true
+        use_partition_alloc_as_malloc=false
         use_custom_libcxx=false
     )
     if(${config} STREQUAL "Debug")
@@ -878,7 +879,7 @@ macro(append_build_type_setup)
     if(FEATURE_developer_build OR (${config} STREQUAL "Debug") OR QT_FEATURE_webengine_sanitizer)
         list(APPEND gnArgArg
              is_official_build=false
-             from_here_uses_location_builtins=false
+             use_viz_debugger=false
         )
     else()
         list(APPEND gnArgArg is_official_build=true)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 3600e161c8e..631521c8d82 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -339,14 +339,14 @@ foreach(arch ${archs})
             strip_absolute_paths_from_debug_symbols=false
             devtools_fast_bundle=false
             devtools_skip_typecheck=false
-            enable_jxl_decoder=false # temporarily because libjxl causes internal compiler error on armv7
+            use_static_angle=true
         )
         extend_gn_list(gnArgArg
             ARGS use_v8_context_snapshot v8_use_external_startup_data
             CONDITION QT_FEATURE_webengine_v8_context_snapshot
         )
         extend_gn_list(gnArgArg
-            ARGS enable_basic_printing enable_print_preview enable_pdf
+            ARGS enable_printing enable_basic_printing enable_print_preview enable_pdf
             CONDITION QT_FEATURE_webengine_printing_and_pdf
         )
         extend_gn_list(gnArgArg
@@ -520,8 +520,6 @@ foreach(arch ${archs})
         if(MACOS)
             list(APPEND gnArgArg
                 use_external_popup_menu=false
-                angle_enable_vulkan=false
-                use_static_angle=true
             )
         endif()
 
diff --git a/src/core/autofill_client_qt.cpp b/src/core/autofill_client_qt.cpp
index aaf775d60e0..4166cbeddec 100644
--- a/src/core/autofill_client_qt.cpp
+++ b/src/core/autofill_client_qt.cpp
@@ -103,7 +103,7 @@ void AutofillClientQt::HideAutofillPopup(autofill::PopupHidingReason)
     adapterClient()->hideAutofillPopup();
 }
 
-bool AutofillClientQt::IsAutocompleteEnabled()
+bool AutofillClientQt::IsAutocompleteEnabled() const
 {
     return autofill::prefs::IsAutocompleteEnabled(GetPrefs());
 }
diff --git a/src/core/autofill_client_qt.h b/src/core/autofill_client_qt.h
index 95ae460f225..4830cac3486 100644
--- a/src/core/autofill_client_qt.h
+++ b/src/core/autofill_client_qt.h
@@ -52,7 +52,7 @@ class AutofillClientQt : public autofill::AutofillClient,
     base::span<const autofill::Suggestion> GetPopupSuggestions() const override;
     void UpdatePopup(const std::vector<autofill::Suggestion> &, autofill::PopupType) override;
     void HideAutofillPopup(autofill::PopupHidingReason reason) override;
-    bool IsAutocompleteEnabled() override;
+    bool IsAutocompleteEnabled() const override;
     bool IsPasswordManagerEnabled() override;
     void PropagateAutofillPredictions(autofill::AutofillDriver *,
                                       const std::vector<autofill::FormStructure *> &) override;
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 299eb7bb361..07785626696 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -74,7 +74,7 @@ BrowserAccessibilityManagerQt::~BrowserAccessibilityManagerQt()
 
 QAccessibleInterface *BrowserAccessibilityManagerQt::rootParentAccessible()
 {
-    content::BrowserAccessibility *parent_node = GetParentNodeFromParentTree();
+    content::BrowserAccessibility *parent_node = GetParentNodeFromParentTreeAsBrowserAccessibility();
     if (!parent_node) {
         Q_ASSERT(m_webContentsAccessibility);
         return QAccessible::queryAccessibleInterface(m_webContentsAccessibility->accessibilityParentObject());
diff --git a/src/core/client_hints.cpp b/src/core/client_hints.cpp
index 2a30bb51b26..2fcecde58f4 100644
--- a/src/core/client_hints.cpp
+++ b/src/core/client_hints.cpp
@@ -151,7 +151,7 @@ bool ClientHints::IsJavaScriptAllowed(const GURL &url, content::RenderFrameHost
     return true;
 }
 
-bool ClientHints::AreThirdPartyCookiesBlocked(const GURL &url)
+bool ClientHints::AreThirdPartyCookiesBlocked(const GURL &url, content::RenderFrameHost *rfh)
 {
     return false; // we probably can not report anything more specific
 }
diff --git a/src/core/client_hints.h b/src/core/client_hints.h
index a80629fc9dc..193982d1600 100644
--- a/src/core/client_hints.h
+++ b/src/core/client_hints.h
@@ -58,7 +58,7 @@ class ClientHints : public KeyedService, public content::ClientHintsControllerDe
 
     bool IsJavaScriptAllowed(const GURL &url, content::RenderFrameHost *parent_rfh) override;
 
-    bool AreThirdPartyCookiesBlocked(const GURL &url) override;
+    bool AreThirdPartyCookiesBlocked(const GURL &url, content::RenderFrameHost *rfh) override;
 
     blink::UserAgentMetadata GetUserAgentMetadata() override;
 
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index 9d6534c28aa..647c761c34d 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -25,7 +25,7 @@ class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDev
 
     // Overridden from viz::SoftwareOutputDevice.
     void Resize(const gfx::Size &sizeInPixels, float devicePixelRatio) override;
-    void OnSwapBuffers(SwapBuffersCallback swap_ack_callback) override;
+    void OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gl::FrameData data) override;
 
     // Overridden from Compositor.
     void swapFrame() override;
@@ -60,7 +60,7 @@ void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels,
     surface_ = SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(sizeInPixels.width(), sizeInPixels.height()));
 }
 
-void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback)
+void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gl::FrameData data)
 {
     { // MEMO don't hold a lock together with an 'observer', as the call from Qt's scene graph may come at the same time
         QMutexLocker locker(&m_mutex);
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
index aa0be8c264f..dfd2ee24bed 100644
--- a/src/core/compositor/native_skia_output_device.cpp
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -145,7 +145,7 @@ class NativeSkiaOutputDevice::Buffer
         DCHECK(!m_scopedSkiaWriteAccess);
         DCHECK(!m_scopedOverlayReadAccess);
 
-        m_scopedOverlayReadAccess = m_overlayRepresentation->BeginScopedReadAccess(true);
+        m_scopedOverlayReadAccess = m_overlayRepresentation->BeginScopedReadAccess();
         DCHECK(m_scopedOverlayReadAccess);
         m_acquireFence = TakeGpuFence(m_scopedOverlayReadAccess->TakeAcquireFence());
     }
@@ -164,11 +164,13 @@ class NativeSkiaOutputDevice::Buffer
             m_textureCleanup = nullptr;
         }
     }
-    gl::GLImage *glImage()
+#ifdef Q_OS_MACOS
+    gfx::ScopedIOSurface ioSurface() const
     {
         DCHECK(m_presentCount);
-        return m_scopedOverlayReadAccess->gl_image();
+        return m_scopedOverlayReadAccess->GetIOSurface();
     }
+#endif
 
     void createFence()
     {
@@ -344,17 +346,11 @@ QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureO
 {
     if (!m_frontBuffer || !m_readyWithTexture)
         return nullptr;
-    gl::GLImageIOSurface *gl_image_iosurface = gl::GLImageIOSurface::FromGLImage(m_frontBuffer->glImage());
-    QSGTexture *texture = nullptr;
-    if (gl_image_iosurface) {
-        texture = makeMetalTexture(win, gl_image_iosurface->io_surface().release(), /* plane */ 0,
-                                   m_shape.characterization.width(), m_shape.characterization.height(),
-                                   textureOptions);
-    } else {
-        qWarning() << "GLImage not an IOSURFACE";
-    }
+    Q_ASSERT(QQuickWindow::graphicsApi() == QSGRendererInterface::Metal);
 
-    return texture;
+    return makeMetalTexture(win, m_frontBuffer->ioSurface().release(), /* plane */ 0,
+                            m_shape.characterization.width(), m_shape.characterization.height(),
+                            textureOptions);
 }
 #elif defined(Q_OS_WIN)
 QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 86369cbbbbe..45707ddca7d 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -386,7 +386,6 @@ source_set("qtwebengine_sources") {
       "//extensions/common:core_api_provider",
       "//extensions/browser",
       "//extensions/browser/api",
-      "//extensions/browser:core_api_provider",
       "//extensions/renderer",
       "//extensions:extensions_resources",
       "//extensions/strings",
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 2033a296b4c..b5c8210cd80 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -89,7 +89,7 @@ struct LazyDirectoryListerCacher
                 webui::GetI18nTemplateHtml(
                     ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_DIR_HEADER_HTML),
                     std::move(dict));
-        html_data = base::RefCountedString::TakeString(&html);
+        html_data = base::MakeRefCounted<base::RefCountedString>(std::move(html));
     }
 
     scoped_refptr<base::RefCountedMemory> html_data;
diff --git a/src/core/extensions/extension_system_qt.cpp b/src/core/extensions/extension_system_qt.cpp
index 0f44b8db332..42dfd0d67f3 100644
--- a/src/core/extensions/extension_system_qt.cpp
+++ b/src/core/extensions/extension_system_qt.cpp
@@ -69,28 +69,28 @@ namespace extensions {
 
 namespace {
 
-std::string GenerateId(const base::DictionaryValue *manifest, const base::FilePath &path)
+std::string GenerateId(const base::Value::Dict &manifest, const base::FilePath &path)
 {
-    std::string raw_key;
+    const std::string *raw_key;
     std::string id_input;
-    CHECK(manifest->GetString(manifest_keys::kPublicKey, &raw_key));
-    CHECK(Extension::ParsePEMKeyBytes(raw_key, &id_input));
+    CHECK(raw_key = manifest.FindString(manifest_keys::kPublicKey));
+    CHECK(Extension::ParsePEMKeyBytes(*raw_key, &id_input));
     std::string id = crx_file::id_util::GenerateId(id_input);
     return id;
 }
 
 // Implementation based on ComponentLoader::ParseManifest.
-std::unique_ptr<base::DictionaryValue> ParseManifest(const std::string &manifest_contents)
+absl::optional<base::Value::Dict> ParseManifest(base::StringPiece manifest_contents)
 {
     JSONStringValueDeserializer deserializer(manifest_contents);
-    std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
+    std::unique_ptr<base::Value> manifest = deserializer.Deserialize(nullptr, nullptr);
 
     if (!manifest.get() || !manifest->is_dict()) {
         LOG(ERROR) << "Failed to parse extension manifest.";
-        return NULL;
+        return absl::nullopt;
     }
-    // Transfer ownership to the caller.
-    return base::DictionaryValue::From(std::move(manifest));
+
+    return std::move(*manifest).TakeDict();
 }
 
 } // namespace
@@ -129,14 +129,15 @@ class ContentVerifierDelegateQt : public ContentVerifierDelegate
     void Shutdown() override {}
 };
 
-void ExtensionSystemQt::LoadExtension(std::string extension_id, std::unique_ptr<base::DictionaryValue> manifest, const base::FilePath &directory)
+void ExtensionSystemQt::LoadExtension(std::string extension_id, const base::Value::Dict &manifest, const base::FilePath &directory)
 {
     int flags = Extension::REQUIRE_KEY;
     std::string error;
+
     scoped_refptr<const Extension> extension = Extension::Create(
             directory,
             mojom::ManifestLocation::kComponent,
-            *manifest,
+            manifest,
             flags,
             &error);
     if (!extension.get())
@@ -191,8 +192,10 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
 #if BUILDFLAG(ENABLE_PLUGINS)
     // Register plugins included with the extension.
     // Implementation based on PluginManager::OnExtensionLoaded.
+    bool plugins_changed = false;
     const MimeTypesHandler *handler = MimeTypesHandler::GetHandler(extension);
     if (handler && handler->HasPlugin()) {
+        plugins_changed = true;
         content::WebPluginInfo info;
         info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN;
         info.name = base::UTF8ToUTF16(extension->name());
@@ -214,6 +217,8 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
         plugin_service->RefreshPlugins();
         plugin_service->RegisterInternalPlugin(info, true);
     }
+    if (plugins_changed)
+      content::PluginService::GetInstance()->PurgePluginListCache(browser_context_, false);
 #endif // BUILDFLAG(ENABLE_PLUGINS)
 }
 
@@ -331,24 +336,26 @@ void ExtensionSystemQt::Init(bool extensions_enabled)
             std::string pdf_manifest = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_PDF_MANIFEST);
             base::ReplaceFirstSubstringAfterOffset(&pdf_manifest, 0, "<NAME>", "chromium-pdf");
 
-            std::unique_ptr<base::DictionaryValue> pdfManifestDict = ParseManifest(pdf_manifest);
+            auto pdfManifestDict = ParseManifest(pdf_manifest);
+            CHECK(pdfManifestDict);
             base::FilePath path;
             base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &path);
             path = path.Append(base::FilePath(FILE_PATH_LITERAL("pdf")));
-            std::string id = GenerateId(pdfManifestDict.get(), path);
-            LoadExtension(id, std::move(pdfManifestDict), path);
+            std::string id = GenerateId(pdfManifestDict.value(), path);
+            LoadExtension(id, pdfManifestDict.value(), path);
         }
 #endif // BUILDFLAG(ENABLE_PDF)
 
 #if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
         {
             std::string hangout_manifest = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_HANGOUT_SERVICES_MANIFEST);
-            std::unique_ptr<base::DictionaryValue> hangoutManifestDict = ParseManifest(hangout_manifest);
+            auto hangoutManifestDict = ParseManifest(hangout_manifest);
+            CHECK(hangoutManifestDict);
             base::FilePath path;
             base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &path);
             path = path.Append(base::FilePath(FILE_PATH_LITERAL("hangout_services")));
-            std::string id = GenerateId(hangoutManifestDict.get(), path);
-            LoadExtension(id, std::move(hangoutManifestDict), path);
+            std::string id = GenerateId(hangoutManifestDict.value(), path);
+            LoadExtension(id, hangoutManifestDict.value(), path);
         }
 #endif // BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
     }
diff --git a/src/core/extensions/extension_system_qt.h b/src/core/extensions/extension_system_qt.h
index 02fbaee371c..87e740820da 100644
--- a/src/core/extensions/extension_system_qt.h
+++ b/src/core/extensions/extension_system_qt.h
@@ -83,7 +83,7 @@ class ExtensionSystemQt : public ExtensionSystem
     void OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension);
 
     void NotifyExtensionLoaded(const Extension *extension);
-    void LoadExtension(std::string extension_id, std::unique_ptr<base::DictionaryValue> manifest, const base::FilePath &directory);
+    void LoadExtension(std::string extension_id, const base::Value::Dict &manifest, const base::FilePath &directory);
     // The services that are shared between normal and incognito profiles.
 
     // Data to be accessed on the IO thread. Must outlive process_manager_.
diff --git a/src/core/extensions/extensions_browser_client_qt.cpp b/src/core/extensions/extensions_browser_client_qt.cpp
index ab44c23ebbb..54610586610 100644
--- a/src/core/extensions/extensions_browser_client_qt.cpp
+++ b/src/core/extensions/extensions_browser_client_qt.cpp
@@ -19,9 +19,9 @@
 #include "chrome/browser/profiles/profile.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/render_frame_host.h"
+#include "extensions/browser/api/core_extensions_browser_api_provider.h"
 #include "extensions/browser/api/extensions_api_client.h"
 #include "extensions/browser/api/runtime/runtime_api_delegate.h"
-#include "extensions/browser/core_extensions_browser_api_provider.h"
 #include "extensions/browser/event_router.h"
 #include "extensions/browser/extension_host_delegate.h"
 #include "extensions/browser/extension_protocols.h"
@@ -79,7 +79,7 @@ scoped_refptr<base::RefCountedMemory> GetResource(int resource_id, const std::st
         base::StringPiece input(reinterpret_cast<const char *>(bytes->front()), bytes->size());
         std::string temp_str = ui::ReplaceTemplateExpressions(input, *replacements);
         DCHECK(!temp_str.empty());
-        return base::RefCountedString::TakeString(&temp_str);
+        return base::MakeRefCounted<base::RefCountedString>(std::move(temp_str));
     }
     return bytes;
 }
diff --git a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
index 5a93b4b8461..15aa4a6c4ce 100644
--- a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
+++ b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
@@ -37,7 +37,6 @@ class PdfWebContentsLifetimeHelper : public content::WebContentsUserData<PdfWebC
 public:
     explicit PdfWebContentsLifetimeHelper(content::WebContents *web_contents)
         : content::WebContentsUserData<PdfWebContentsLifetimeHelper>(*web_contents)
-        , web_contents_(web_contents)
     {}
 
     base::WeakPtr<PdfWebContentsLifetimeHelper> GetWeakPtr()
@@ -47,13 +46,12 @@ class PdfWebContentsLifetimeHelper : public content::WebContentsUserData<PdfWebC
 
     void NavigateIFrameToPlaceholder(const content::OpenURLParams &url_params)
     {
-        web_contents_->OpenURL(url_params);
+        GetWebContents().OpenURL(url_params);
     }
 
 private:
     friend class content::WebContentsUserData<PdfWebContentsLifetimeHelper>;
 
-    content::WebContents *const web_contents_;
     base::WeakPtrFactory<PdfWebContentsLifetimeHelper> weak_factory_{this};
 
     WEB_CONTENTS_USER_DATA_KEY_DECL();
@@ -74,10 +72,11 @@ bool IsPDFPluginEnabled(content::NavigationHandle *navigation_handle, bool *is_s
     content::WebPluginInfo plugin_info;
     // Will check WebEngineSettings by PluginServiceFilterQt
     return content::PluginService::GetInstance()->GetPluginInfo(
-                process_id, routing_id, nullptr, navigation_handle->GetURL(),
-                kPDFMimeType,
-                false /* allow_wildcard */, is_stale, &plugin_info,
-                nullptr /* actual_mime_type */);
+                process_id, routing_id,
+                navigation_handle->GetWebContents()->GetBrowserContext(),
+                navigation_handle->GetURL(),
+                kPDFMimeType, false /* allow_wildcard */,
+                is_stale, &plugin_info, nullptr /* actual_mime_type */);
 }
 
 std::string GetPDFPlaceholderHTML(const GURL &pdf_url)
diff --git a/src/core/favicon_service_factory_qt.cpp b/src/core/favicon_service_factory_qt.cpp
index d76bfab118c..1ed33d559e2 100644
--- a/src/core/favicon_service_factory_qt.cpp
+++ b/src/core/favicon_service_factory_qt.cpp
@@ -23,12 +23,17 @@ void HistoryClientQt::OnHistoryServiceCreated(history::HistoryService *history_s
 
 void HistoryClientQt::Shutdown() { }
 
-bool HistoryClientQt::CanAddURL(const GURL &url)
+static bool CanAddURL(const GURL &url)
 {
     Q_UNUSED(url);
     return true;
 }
 
+history::CanAddURLCallback HistoryClientQt::GetThreadSafeCanAddURLCallback() const
+{
+    return base::BindRepeating(&CanAddURL);
+}
+
 void HistoryClientQt::NotifyProfileError(sql::InitStatus init_status,
                                          const std::string &diagnostics)
 {
@@ -84,7 +89,7 @@ HistoryServiceFactoryQt::BuildServiceInstanceFor(content::BrowserContext *contex
 
     std::unique_ptr<history::HistoryService> historyService(
             new history::HistoryService(std::make_unique<HistoryClientQt>(), nullptr));
-    if (!historyService->Init(history::HistoryDatabaseParamsForPath(context->GetPath()))) {
+    if (!historyService->Init(history::HistoryDatabaseParamsForPath(context->GetPath(), version_info::Channel::DEFAULT))) {
         return nullptr;
     }
     return historyService.release();
diff --git a/src/core/favicon_service_factory_qt.h b/src/core/favicon_service_factory_qt.h
index 44a43211ee5..0c3bfd7b56a 100644
--- a/src/core/favicon_service_factory_qt.h
+++ b/src/core/favicon_service_factory_qt.h
@@ -48,7 +48,7 @@ class HistoryClientQt : public history::HistoryClient
 
     void OnHistoryServiceCreated(history::HistoryService *history_service) override;
     void Shutdown() override;
-    bool CanAddURL(const GURL &url) override;
+    history::CanAddURLCallback GetThreadSafeCanAddURLCallback() const override;
     void NotifyProfileError(sql::InitStatus init_status, const std::string &diagnostics) override;
     std::unique_ptr<history::HistoryBackendClient> CreateBackendClient() override;
     void UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, base::Time time) override;
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
index 2fd710ad693..5628744eaa8 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.cpp
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
@@ -471,4 +471,8 @@ void FileSystemAccessPermissionContextQt::PermissionGrantDestroyed(
         grants.erase(grant_it);
 }
 
+void FileSystemAccessPermissionContextQt::NotifyEntryMoved(const url::Origin &, const base::FilePath &, const base::FilePath &)
+{
+}
+
 } // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.h b/src/core/file_system_access/file_system_access_permission_context_qt.h
index 09e890038b0..06fbfae3f0e 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.h
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.h
@@ -52,6 +52,7 @@ class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPerm
     GetLastPickedDirectory(const url::Origin &origin, const std::string &id) override;
     base::FilePath GetWellKnownDirectoryPath(blink::mojom::WellKnownDirectory directory, const url::Origin &origin) override;
     std::u16string GetPickerTitle(const blink::mojom::FilePickerOptionsPtr &) override;
+    void NotifyEntryMoved(const url::Origin &, const base::FilePath &, const base::FilePath &) override;
 
     void NavigatedAwayFromOrigin(const url::Origin &origin);
     content::BrowserContext *profile() const { return m_profile; }
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index 8608d35cd23..d0c5b67dec2 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -68,14 +68,13 @@ void ProxyingRestrictedCookieManagerQt::GetAllForUrl(const GURL &url,
                                                      const net::SiteForCookies &site_for_cookies,
                                                      const url::Origin &top_frame_origin,
                                                      network::mojom::CookieManagerGetOptionsPtr options,
-                                                     bool partitioned_cookies_runtime_feature_enabled,
                                                      GetAllForUrlCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
         underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options),
-                                                            partitioned_cookies_runtime_feature_enabled, std::move(callback));
+                                                            std::move(callback));
     } else {
         std::move(callback).Run(std::vector<net::CookieWithAccessResult>());
     }
@@ -111,14 +110,13 @@ void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
                                                             const net::SiteForCookies &site_for_cookies,
                                                             const url::Origin &top_frame_origin,
                                                             const std::string &cookie,
-                                                            bool partitioned_cookies_runtime_feature_enabled,
                                                             SetCookieFromStringCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
         underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, cookie,
-                                                                   partitioned_cookies_runtime_feature_enabled, std::move(callback));
+                                                                   std::move(callback));
     } else {
         std::move(callback).Run(false, false); // FIXME: is true, true in aw_proxying_restricted_cookie_manager.cc though..
     }
@@ -127,14 +125,13 @@ void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
 void ProxyingRestrictedCookieManagerQt::GetCookiesString(const GURL &url,
                                                          const net::SiteForCookies &site_for_cookies,
                                                          const url::Origin &top_frame_origin,
-                                                         bool partitioned_cookies_runtime_feature_enabled,
                                                          GetCookiesStringCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
         underlying_restricted_cookie_manager_->GetCookiesString(url, site_for_cookies, top_frame_origin,
-                                                                partitioned_cookies_runtime_feature_enabled, std::move(callback));
+                                                                std::move(callback));
     } else {
         std::move(callback).Run("");
     }
@@ -149,11 +146,6 @@ void ProxyingRestrictedCookieManagerQt::CookiesEnabledFor(const GURL &url,
     std::move(callback).Run(allowCookies(url, site_for_cookies));
 }
 
-void ProxyingRestrictedCookieManagerQt::ConvertPartitionedCookiesToUnpartitioned(const GURL&)
-{
-    NOTIMPLEMENTED();
-}
-
 bool ProxyingRestrictedCookieManagerQt::allowCookies(const GURL &url, const net::SiteForCookies &site_for_cookies) const
 {
     if (!m_profileIoData)
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.h b/src/core/net/proxying_restricted_cookie_manager_qt.h
index 95e193f761f..70b8499c04e 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.h
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.h
@@ -28,7 +28,6 @@ class ProxyingRestrictedCookieManagerQt : public network::mojom::RestrictedCooki
                       const net::SiteForCookies &site_for_cookies,
                       const url::Origin &top_frame_origin,
                       network::mojom::CookieManagerGetOptionsPtr options,
-                      bool partitioned_cookies_runtime_feature_enabled,
                       GetAllForUrlCallback callback) override;
     void SetCanonicalCookie(const net::CanonicalCookie& cookie,
                             const GURL &url,
@@ -45,18 +44,15 @@ class ProxyingRestrictedCookieManagerQt : public network::mojom::RestrictedCooki
                              const net::SiteForCookies &site_for_cookies,
                              const url::Origin &top_frame_origin,
                              const std::string &cookie,
-                             bool partitioned_cookies_runtime_feature_enabled,
                              SetCookieFromStringCallback callback) override;
     void GetCookiesString(const GURL &url,
                           const net::SiteForCookies &site_for_cookies,
                           const url::Origin &top_frame_origin,
-                          bool partitioned_cookies_runtime_feature_enabled,
                           GetCookiesStringCallback callback) override;
     void CookiesEnabledFor(const GURL &url,
                            const net::SiteForCookies &site_for_cookies,
                            const url::Origin &top_frame_origin,
                            CookiesEnabledForCallback callback) override;
-    void ConvertPartitionedCookiesToUnpartitioned(const GURL&) override;
 
     // Internal:
     bool allowCookies(const GURL &url, const net::SiteForCookies &site_for_cookies) const;
diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp
index e9946806aeb..661314085bb 100644
--- a/src/core/ozone/gl_ozone_glx_qt.cpp
+++ b/src/core/ozone/gl_ozone_glx_qt.cpp
@@ -14,6 +14,7 @@
 #include "ui/gl/gl_context_glx.h"
 #include "ui/gl/gl_gl_api_implementation.h"
 #include "ui/gl/gl_glx_api_implementation.h"
+#include "ui/gl/presenter.h"
 #include "ui/ozone/platform/x11/native_pixmap_glx_binding.h"
 
 #include <dlfcn.h>
@@ -91,7 +92,7 @@ scoped_refptr<gl::GLSurface> GLOzoneGLXQt::CreateViewGLSurface(
     return nullptr;
 }
 
-scoped_refptr<gl::GLSurface> GLOzoneGLXQt::CreateSurfacelessViewGLSurface(
+scoped_refptr<gl::Presenter> GLOzoneGLXQt::CreateSurfacelessViewGLSurface(
         gl::GLDisplay* display,
         gfx::AcceleratedWidget window) {
     return nullptr;
diff --git a/src/core/ozone/gl_ozone_glx_qt.h b/src/core/ozone/gl_ozone_glx_qt.h
index cc0feb563be..177d37ba128 100644
--- a/src/core/ozone/gl_ozone_glx_qt.h
+++ b/src/core/ozone/gl_ozone_glx_qt.h
@@ -39,7 +39,7 @@ class GLOzoneGLXQt : public GLOzone {
             gl::GLDisplay* display,
             gfx::AcceleratedWidget window) override;
 
-    scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface(
+    scoped_refptr<gl::Presenter> CreateSurfacelessViewGLSurface(
             gl::GLDisplay* display,
             gfx::AcceleratedWidget window) override;
 
diff --git a/src/core/ozone/platform_window_qt.h b/src/core/ozone/platform_window_qt.h
index 0d1743f6830..c025102bbfb 100644
--- a/src/core/ozone/platform_window_qt.h
+++ b/src/core/ozone/platform_window_qt.h
@@ -33,7 +33,7 @@ class PlatformWindowQt : public PlatformWindow, public PlatformEventDispatcher
     void SetCapture() override { }
     void ReleaseCapture() override { }
     bool HasCapture() const override { return false; }
-    void ToggleFullscreen() override { }
+    void SetFullscreen(bool, int64_t) override { }
     void Maximize() override { }
     void Minimize() override { }
     void Restore() override { }
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 28e1c981d9b..ca50b5af1e3 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -33,7 +33,7 @@ static ProfileAdapter::PermissionType toQt(blink::PermissionType type)
         return ProfileAdapter::NotificationPermission;
     case blink::PermissionType::ACCESSIBILITY_EVENTS:
     case blink::PermissionType::CAMERA_PAN_TILT_ZOOM:
-    case blink::PermissionType::WINDOW_PLACEMENT:
+    case blink::PermissionType::WINDOW_MANAGEMENT:
         return ProfileAdapter::UnsupportedPermission;
     case blink::PermissionType::MIDI_SYSEX:
     case blink::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index b6cfc27145f..9d18384a118 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -87,8 +87,6 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
     registry->RegisterIntegerPref(prefs::kNotificationNextPersistentId, 10000);
     registry->RegisterDictionaryPref(prefs::kPushMessagingAppIdentifierMap);
     registry->RegisterListPref(prefs::kAccountInfo);
-    registry->RegisterStringPref(prefs::kGoogleServicesLastAccountId,
-                               std::string());
     registry->RegisterStringPref(prefs::kGoogleServicesLastUsername,
                                std::string());
     registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string());
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index f071b59ad2f..2e92512001e 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -145,9 +145,6 @@ PrintViewManagerBaseQt::PrintViewManagerBaseQt(content::WebContents *contents)
     , m_didPrintingSucceed(false)
     , m_printerQueriesQueue(WebEngineContext::current()->getPrintJobManager()->queue())
 {
-    // FIXME: Check if this needs to be executed async:
-    // TODO: Add isEnabled to profile
-    PrintViewManagerBaseQt::UpdatePrintingEnabled();
 }
 
 PrintViewManagerBaseQt::~PrintViewManagerBaseQt()
@@ -181,18 +178,6 @@ void PrintViewManagerBaseQt::ScriptedPrintReply(ScriptedPrintCallback callback,
     std::move(callback).Run(std::move(params));
 }
 
-void PrintViewManagerBaseQt::UpdatePrintingEnabled()
-{
-    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-    bool enabled = false;
-#if QT_CONFIG(webengine_printing_and_pdf)
-    enabled = true;
-#endif
-    web_contents()->ForEachRenderFrameHost([this, enabled](content::RenderFrameHost *rfh) {
-        SendPrintingEnabled(enabled, rfh);
-    });
-}
-
 void PrintViewManagerBaseQt::NavigationStopped()
 {
     // Cancel the current job, wait for the worker to finish.
@@ -284,6 +269,7 @@ void PrintViewManagerBaseQt::GetDefaultPrintSettings(GetDefaultPrintSettingsCall
      printer_query_ptr->GetDefaultSettings(
                  base::BindOnce(&OnDidGetDefaultPrintSettings, m_printerQueriesQueue,
                                 std::move(printer_query), std::move(callback_wrapper)),
+                 false,
                  !render_process_host->IsPdf());
 }
 
@@ -298,6 +284,15 @@ void PrintViewManagerBaseQt::PrintingFailed(int32_t cookie, printing::mojom::Pri
 
     ReleasePrinterQuery();
 }
+void PrintViewManagerBaseQt::IsPrintingEnabled(IsPrintingEnabledCallback callback)
+{
+    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+    bool enabled = false;
+#if QT_CONFIG(webengine_printing_and_pdf)
+    enabled = true;
+#endif
+    std::move(callback).Run(enabled);
+}
 
 void PrintViewManagerBaseQt::ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr params,
                                            printing::mojom::PrintManagerHost::ScriptedPrintCallback callback)
@@ -328,11 +323,6 @@ void PrintViewManagerBaseQt::ShowInvalidPrinterSettingsError()
 {
 }
 
-void PrintViewManagerBaseQt::DidStartLoading()
-{
-    UpdatePrintingEnabled();
-}
-
 // Note: In PrintViewManagerQt we always initiate printing with
 // printing::mojom::PrintRenderFrame::InitiatePrintPreview()
 // so m_printingRFH is never set and used at the moment.
@@ -536,11 +526,10 @@ bool PrintViewManagerBaseQt::RunInnerMessageLoop()
 
   m_quitInnerLoop = run_loop.QuitClosure();
 
-  // Need to enable recursive task.
-  {
-      base::CurrentThread::ScopedNestableTaskAllower allow;
-      run_loop.Run();
-  }
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  run_loop.Run();
+  if (!weak_this)
+      return false;
 
   bool success = !m_quitInnerLoop;
   m_quitInnerLoop.Reset();
@@ -610,12 +599,6 @@ void PrintViewManagerBaseQt::StopWorker(int documentCookie)
     printerQuery->StopWorker();
 }
 
-void PrintViewManagerBaseQt::SendPrintingEnabled(bool enabled, content::RenderFrameHost* rfh)
-{
-    if (rfh->IsRenderFrameLive())
-        GetPrintRenderFrame(rfh)->SetPrintingEnabled(enabled);
-}
-
 void PrintViewManagerBaseQt::UpdatePrintSettings(int32_t cookie, base::Value::Dict job_settings,
                                                  UpdatePrintSettingsCallback callback)
 {
diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h
index 8201a42253c..fbd847f81b8 100644
--- a/src/core/printing/print_view_manager_base_qt.h
+++ b/src/core/printing/print_view_manager_base_qt.h
@@ -36,9 +36,6 @@ class PrintViewManagerBaseQt : public printing::PrintManager
 public:
     ~PrintViewManagerBaseQt() override;
 
-    // Whether printing is enabled or not.
-    void UpdatePrintingEnabled();
-
     std::u16string RenderSourceName();
 
     // mojom::PrintManagerHost:
@@ -48,6 +45,7 @@ class PrintViewManagerBaseQt : public printing::PrintManager
     void GetDefaultPrintSettings(GetDefaultPrintSettingsCallback callback) override;
     void UpdatePrintSettings(int32_t cookie, base::Value::Dict job_settings,
                              UpdatePrintSettingsCallback callback) override;
+    void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
     void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr,
                        printing::mojom::PrintManagerHost::ScriptedPrintCallback) override;
     void ShowInvalidPrinterSettingsError() override;
@@ -83,9 +81,6 @@ class PrintViewManagerBaseQt : public printing::PrintManager
     void StopWorker(int documentCookie);
 
 private:
-    // content::WebContentsObserver implementation.
-    void DidStartLoading() override;
-
     // Requests the RenderView to render all the missing pages for the print job.
     // No-op if no print job is pending. Returns true if at least one page has
     // been requested to the renderer.
@@ -136,9 +131,6 @@ class PrintViewManagerBaseQt : public printing::PrintManager
     // Release the PrinterQuery associated with our |cookie_|.
     void ReleasePrinterQuery();
 
-    // Helper method for UpdatePrintingEnabled().
-    void SendPrintingEnabled(bool enabled, content::RenderFrameHost* rfh);
-
 private:
     content::NotificationRegistrar m_registrar;
     scoped_refptr<printing::PrintJob> m_printJob;
diff --git a/src/core/process_main.cpp b/src/core/process_main.cpp
index ce92db0834b..6a7d26ffd0f 100644
--- a/src/core/process_main.cpp
+++ b/src/core/process_main.cpp
@@ -39,7 +39,6 @@ int processMain(int argc, const char **argv)
     CHECK(seatbelt.server->InitializeSandbox());
   }
 #endif  // IS_MAC
-
     return content::ContentMain(std::move(params));
 }
 
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 80bbabf6304..5ec4a1935dd 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -290,11 +290,12 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF
         // TODO(elproxy): We could potentially get better diagnostics here by first calling
         // NetErrorHelper::GetErrorStringsForDnsProbe, but that one is harder to untangle.
 
+        base::Value::Dict error_page_params;
         error_page::LocalizedError::PageState errorPageState =
                 error_page::LocalizedError::GetPageState(
                         error.reason(), error.domain(), error.url(), isPost, false,
                         error.stale_copy_in_cache(), false,
-                        RenderConfiguration::is_incognito_process(), false, false, false, locale, false);
+                        RenderConfiguration::is_incognito_process(), false, false, false, locale, false, &error_page_params);
 
         resourceId = IDR_NET_ERROR_HTML;
 
@@ -477,7 +478,7 @@ static const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"
 
 // External Clear Key (used for testing).
 static void AddExternalClearKey(const media::mojom::KeySystemCapabilityPtr &capability,
-                                media::KeySystemInfoVector *key_systems)
+                                media::KeySystemInfos* key_systems)
 {
     Q_UNUSED(capability);
     if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) {
@@ -486,7 +487,7 @@ static void AddExternalClearKey(const media::mojom::KeySystemCapabilityPtr &capa
     }
 
     // TODO(xhwang): Actually use `capability` to determine capabilities.
-    key_systems->push_back(std::make_unique<cdm::ExternalClearKeyProperties>());
+    key_systems->push_back(std::make_unique<cdm::ExternalClearKeyKeySystemInfo>());
 }
 
 #if BUILDFLAG(ENABLE_WIDEVINE)
@@ -603,7 +604,7 @@ static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& cap
 }
 
 static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
-                        media::KeySystemInfoVector *key_systems)
+                        media::KeySystemInfos *key_systems)
 {
     // Codecs and encryption schemes.
     media::SupportedCodecs codecs = media::EME_CODEC_NONE;
@@ -658,11 +659,11 @@ static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
 void OnKeySystemSupportUpdated(media::GetSupportedKeySystemsCB cb,
                                content::KeySystemCapabilityPtrMap key_system_capabilities)
 {
-    media::KeySystemInfoVector key_systems;
+    media::KeySystemInfos key_systems;
     for (const auto &entry : key_system_capabilities) {
+#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
         const auto &key_system = entry.first;
         const auto &capability = entry.second;
-#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
 #if BUILDFLAG(ENABLE_WIDEVINE)
         if (key_system == kWidevineKeySystem) {
             AddWidevine(capability, &key_systems);
@@ -674,9 +675,9 @@ void OnKeySystemSupportUpdated(media::GetSupportedKeySystemsCB cb,
             AddExternalClearKey(capability, &key_systems);
             continue;
         }
-#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
 
         DLOG(ERROR) << "Unrecognized key system: " << key_system;
+#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
     }
 
     cb.Run(std::move(key_systems));
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index 04a4ce70500..89b20c7d11c 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -43,8 +43,6 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId)
 {
     v8::Isolate *isolate = blink::MainThreadIsolate();
     v8::HandleScope handleScope(isolate);
-    v8::MicrotasksScope microtasks_scope(
-        isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
     v8::Local<v8::Context> context;
     if (worldId == 0)
         context = frame->MainWorldScriptContext();
@@ -59,15 +57,14 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId)
         return;
 
     v8::Local<v8::Object> global = context->Global();
-    v8::Local<v8::Value> qtObjectValue;
     v8::Local<v8::Object> qtObject;
-    if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject()) {
-        qtObject = v8::Object::New(isolate);
-        global->Set(context, gin::StringToV8(isolate, "qt"), qtObject).Check();
-    } else {
-        qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
-    }
-    qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8()).Check();
+    qtObject = v8::Object::New(isolate);
+    global->CreateDataProperty(context,
+                               gin::StringToSymbol(isolate, "qt"),
+                               qtObject).Check();
+    qtObject->CreateDataProperty(context,
+                                 gin::StringToSymbol(isolate, "webChannelTransport"),
+                                 transport.ToV8()).Check();
 }
 
 void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index f1bdb07c0e7..6312103f57e 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -979,9 +979,8 @@ void WebContentsAdapter::setZoomFactor(qreal factor)
     content::HostZoomMap *zoomMap = content::HostZoomMap::GetForWebContents(m_webContents.get());
 
     if (zoomMap) {
-        int render_process_id = m_webContents->GetPrimaryMainFrame()->GetProcess()->GetID();
-        int render_view_id = m_webContents->GetRenderViewHost()->GetRoutingID();
-        zoomMap->SetTemporaryZoomLevel(render_process_id, render_view_id, zoomLevel);
+        const content::GlobalRenderFrameHostId global_id = m_webContents->GetPrimaryMainFrame()->GetGlobalId();
+        zoomMap->SetTemporaryZoomLevel(global_id, zoomLevel);
     }
 }
 
@@ -1546,7 +1545,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
     }
 
     {
-        base::CurrentThread::ScopedNestableTaskAllower allow;
+        base::CurrentThread::ScopedAllowApplicationTasksInNativeNestedLoop allow;
         drag->exec(allowedActions);
     }
 
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 7470e5cc2d8..a8020ae1cfd 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -641,12 +641,6 @@ void WebContentsDelegateQt::UpdateTargetURL(content::WebContents* source, const
     m_viewClient->didUpdateTargetURL(toQt(url));
 }
 
-void WebContentsDelegateQt::OnVisibilityChanged(content::Visibility visibility)
-{
-    if (visibility != content::Visibility::HIDDEN)
-        web_cache::WebCacheManager::GetInstance()->ObserveActivity(web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID());
-}
-
 void WebContentsDelegateQt::ActivateContents(content::WebContents* contents)
 {
     QWebEngineSettings *settings = m_viewClient->webEngineSettings();
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 37c2c73418c..7f25f29d835 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -124,7 +124,6 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
     void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code) override;
     void DidFinishLoad(content::RenderFrameHost *render_frame_host, const GURL &validated_url) override;
     void BeforeUnloadFired(bool proceed, const base::TimeTicks& proceed_time) override;
-    void OnVisibilityChanged(content::Visibility visibility) override;
     void ActivateContents(content::WebContents* contents) override;
     void ResourceLoadComplete(content::RenderFrameHost* render_frame_host,
                               const content::GlobalRequestID& request_id,
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index d0da744d712..f2b90ad9d2f 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -710,7 +710,6 @@ WebEngineContext::WebEngineContext()
     disableFeatures.push_back(features::kWebOTP.name);
     disableFeatures.push_back(features::kWebPayments.name);
     disableFeatures.push_back(features::kWebUsb.name);
-    disableFeatures.push_back(media::kPictureInPicture.name);
 
     if (useEmbeddedSwitches) {
         // embedded switches are based on the switches for Android, see content/browser/android/content_startup_flags.cc
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 1a008011f97..e3566145e8d 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -119,6 +119,11 @@ foreach(arch ${archs})
           qt_libjpeg_config="${buildDir}/${config}/${arch}:qt_libjpeg_config"
           qt_harfbuzz_config="${buildDir}/${config}/${arch}:qt_harfbuzz_config"
           qt_freetype_config="${buildDir}/${config}/${arch}:qt_freetype_config"
+          enable_swiftshader=false
+          enable_swiftshader_vulkan=false
+          angle_enable_swiftshader=false
+          dawn_use_swiftshader=false
+          use_dawn=false
           enable_ipc_fuzzer=false
           enable_remoting=false
           enable_resource_allowlist_generation=false

From 06b1d6c584eaa1fb221a66d08a0cd717475e9bce Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 14 Apr 2023 16:03:59 +0200
Subject: [PATCH 273/681] Adaptations for Chromium 112

Change-Id: I1bb84b20a080d7f615bf0795ac2d97739e99ac1d
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 96abe0c83c7399cf771eb5155998c706a2243f0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake                         |  4 +-
 configure.cmake                               | 14 +++----
 src/core/CMakeLists.txt                       | 10 ++++-
 src/core/autofill_client_qt.cpp               | 20 +++++----
 src/core/autofill_client_qt.h                 |  5 ++-
 src/core/browser_main_parts_qt.cpp            | 16 +++----
 src/core/browser_message_filter_qt.h          |  2 +-
 .../browsing_data_remover_delegate_qt.cpp     |  4 +-
 src/core/certificate_error_controller.h       |  4 +-
 src/core/client_cert_select_controller.cpp    |  5 ++-
 .../compositor/display_skia_output_device.cpp |  2 +-
 .../compositor/display_skia_output_device.h   |  2 +-
 .../display_software_output_surface.cpp       |  8 ++--
 .../compositor/native_skia_output_device.cpp  | 42 ++++++++++---------
 .../compositor/native_skia_output_device.h    |  2 +-
 src/core/configure/BUILD.root.gn.in           | 25 ++++++-----
 src/core/content_client_qt.cpp                |  2 +
 src/core/devtools_frontend_qt.cpp             | 12 +++---
 .../extensions/extension_host_delegate_qt.cpp |  4 +-
 .../extensions/extension_host_delegate_qt.h   |  2 +-
 src/core/extensions/extension_system_qt.cpp   |  2 +-
 .../pdf_iframe_navigation_throttle_qt.cpp     |  3 +-
 ...le_system_access_permission_context_qt.cpp |  4 ++
 ...tem_access_permission_request_manager_qt.h |  2 +-
 src/core/javascript_dialog_controller_p.h     |  2 +-
 src/core/location_provider_qt.cpp             |  2 +-
 src/core/net/client_cert_qt.cpp               |  4 +-
 src/core/net/client_cert_qt.h                 |  4 +-
 src/core/net/client_cert_store_data.cpp       |  3 +-
 src/core/net/cookie_monster_delegate_qt.cpp   |  2 +-
 src/core/net/custom_url_loader_factory.cpp    |  6 ++-
 ...sponse_interceptor_url_loader_throttle.cpp |  2 +-
 .../proxying_restricted_cookie_manager_qt.cpp | 25 ++++++-----
 .../proxying_restricted_cookie_manager_qt.h   |  7 ++++
 .../net/proxying_url_loader_factory_qt.cpp    |  2 +-
 src/core/net/ssl_host_state_delegate_qt.cpp   |  2 +-
 .../net/system_network_context_manager.cpp    |  2 +-
 src/core/net/webui_controller_factory_qt.cpp  |  2 +-
 src/core/ozone/gl_ozone_egl_qt.cpp            |  9 ++--
 src/core/ozone/gl_ozone_egl_qt.h              |  4 +-
 src/core/ozone/gl_ozone_glx_qt.cpp            |  5 ++-
 src/core/ozone/gl_ozone_glx_qt.h              |  2 +-
 src/core/ozone/gl_surface_egl_qt.cpp          |  4 +-
 src/core/ozone/gl_surface_egl_qt.h            |  2 +-
 src/core/ozone/gl_surface_glx_qt.cpp          |  4 +-
 src/core/ozone/gl_surface_glx_qt.h            |  2 +-
 src/core/ozone/gl_surface_qt.cpp              | 11 ++---
 src/core/ozone/gl_surface_qt.h                |  2 +-
 src/core/ozone/gl_surface_wgl_qt.cpp          |  4 +-
 src/core/ozone/gl_surface_wgl_qt.h            |  2 +-
 src/core/ozone/platform_window_qt.cpp         |  2 +-
 src/core/permission_manager_qt.cpp            |  1 +
 src/core/permission_manager_qt.h              |  2 +-
 .../printing/print_view_manager_base_qt.cpp   | 20 +--------
 .../printing/print_view_manager_base_qt.h     |  1 -
 src/core/profile_adapter.cpp                  |  6 +--
 src/core/profile_io_data_qt.cpp               |  2 +-
 src/core/render_widget_host_view_qt.cpp       | 10 ++---
 src/core/render_widget_host_view_qt.h         |  9 ++--
 .../renderer/content_renderer_client_qt.cpp   | 14 +++----
 .../plugins/loadable_plugin_placeholder_qt.h  |  2 -
 .../renderer/user_resource_controller.cpp     |  7 ++--
 src/core/tools/main.cpp                       |  2 +-
 src/core/web_contents_adapter.cpp             |  3 +-
 src/core/web_contents_delegate_qt.cpp         |  6 ---
 src/core/web_contents_delegate_qt.h           |  1 -
 src/core/web_contents_view_qt.h               |  1 +
 src/core/web_engine_context.cpp               |  2 +-
 src/core/web_engine_context_threads.cpp       |  2 +-
 src/core/web_engine_settings.cpp              |  1 -
 src/pdf/CMakeLists.txt                        |  2 +-
 src/pdf/configure/BUILD.root.gn.in            |  1 +
 .../inspectorserver/tst_inspectorserver.cpp   |  1 +
 tests/auto/widgets/qtbug_110287/BLACKLIST     |  2 +
 tools/scripts/take_snapshot.py                |  8 +++-
 tools/scripts/version_resolver.py             |  4 +-
 76 files changed, 230 insertions(+), 194 deletions(-)
 create mode 100644 tests/auto/widgets/qtbug_110287/BLACKLIST

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 10601e866da..eaa5a0f3d7d 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -988,11 +988,13 @@ macro(append_compiler_linker_sdk_setup)
     if(MSVC)
         get_filename_component(windowsSdkPath $ENV{WINDOWSSDKDIR} ABSOLUTE)
         get_filename_component(visualStudioPath $ENV{VSINSTALLDIR} ABSOLUTE)
+        set(windowSdkVersion $ENV{WindowsSDKVersion})
         list(APPEND gnArgArg
             win_linker_timing=true
             use_incremental_linking=false
-            visual_studio_version=2019
+            visual_studio_version=2022
             visual_studio_path=\"${visualStudioPath}\"
+            windows_sdk_version=\"${windowsSdkVersion}\"
             windows_sdk_path=\"${windowsSdkPath}\"
         )
     endif()
diff --git a/configure.cmake b/configure.cmake
index 2b150d84954..c41cd34a5d3 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -11,7 +11,7 @@ if(QT_CONFIGURE_RUNNING)
 else()
     find_package(Ninja 1.7.2)
     find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
-    find_program(Python3_EXECUTABLE NAMES python3 HINTS $ENV{PYTHON3_PATH})
+    find_program(Python3_EXECUTABLE NAMES python3 python HINTS $ENV{PYTHON3_PATH})
     if(NOT Python3_EXECUTABLE)
         find_package(Python3 3.6)
     endif()
@@ -21,7 +21,7 @@ else()
     find_package(Perl)
     find_package(PkgConfig)
     find_package(Snappy)
-    find_package(Nodejs 12.0)
+    find_package(Nodejs 14.0)
 endif()
 
 if(PkgConfig_FOUND)
@@ -201,7 +201,7 @@ qt_config_compile_test(winversion
     LABEL "winversion"
     CODE
 "
-#if !defined(__clang__) && _MSC_FULL_VER < 191426428
+#if !defined(__clang__) && _MSC_VER < 1934
 #error unsupported Visual Studio version
 #endif
 int main(void){
@@ -499,7 +499,7 @@ add_check_for_support(
 add_check_for_support(
    MODULES QtWebEngine QtPdf
    CONDITION TARGET Nodejs::Nodejs
-   MESSAGE "node.js version 12 or later is required."
+   MESSAGE "node.js version 14 or later is required."
 )
 add_check_for_support(
     MODULES QtWebEngine
@@ -586,7 +586,7 @@ ${xcbErrorMessage}"
 add_check_for_support(
    MODULES QtWebEngine QtPdf
    CONDITION NOT MSVC OR TEST_winversion
-   MESSAGE "Build requires Visual Studio 2019 or higher."
+   MESSAGE "Build requires Visual Studio 2022 or higher."
 )
 add_check_for_support(
    MODULES QtWebEngine
@@ -614,8 +614,8 @@ if(WIN32)
     if(MSVC)
         add_check_for_support(
             MODULES QtWebEngine QtPdf
-            CONDITION NOT MSVC_VERSION LESS 1929
-            MESSAGE "MSVC compiler version must be at least 14.29."
+            CONDITION NOT MSVC_VERSION LESS 1934
+            MESSAGE "VS compiler version must be at least 14.34"
         )
     endif()
     set(windowsSdkVersion $ENV{WindowsSDKVersion})
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 631521c8d82..1cb016a5fb8 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -4,7 +4,7 @@
 cmake_minimum_required(VERSION 3.19)
 
 find_package(Ninja 1.7.2 REQUIRED)
-find_package(Nodejs 12 REQUIRED)
+find_package(Nodejs 14.19 REQUIRED)
 find_package(Perl)
 find_package(PkgConfig)
 if(PkgConfig_FOUND)
@@ -309,7 +309,6 @@ foreach(arch ${archs})
             enable_background_mode=false
             enable_ipc_fuzzer=false
             enable_ipc_logging=false
-            enable_js_type_check=false
             enable_media_remoting=false
             enable_message_center=false
             enable_nacl=false
@@ -319,6 +318,7 @@ foreach(arch ${archs})
             enable_resource_allowlist_generation=false
             enable_screen_ai_service=false
             enable_session_service=false
+            enable_supervised_users=false
             enable_swiftshader=false
             enable_swiftshader_vulkan=false
             angle_enable_swiftshader=false
@@ -340,6 +340,8 @@ foreach(arch ${archs})
             devtools_fast_bundle=false
             devtools_skip_typecheck=false
             use_static_angle=true
+            chrome_root_store_supported=false
+            trial_comparison_cert_verifier_supported=false
         )
         extend_gn_list(gnArgArg
             ARGS use_v8_context_snapshot v8_use_external_startup_data
@@ -365,6 +367,10 @@ foreach(arch ${archs})
             ARGS enable_webrtc
             CONDITION QT_FEATURE_webengine_webrtc
         )
+        extend_gn_list(gnArgArg
+            ARGS enable_screen_capture
+            CONDITION QT_FEATURE_webengine_webrtc
+        )
         extend_gn_list(gnArgArg
             ARGS enable_hangout_services_extension
             CONDITION QT_FEATURE_webengine_webrtc AND QT_FEATURE_webengine_extensions
diff --git a/src/core/autofill_client_qt.cpp b/src/core/autofill_client_qt.cpp
index 4166cbeddec..c7becd60569 100644
--- a/src/core/autofill_client_qt.cpp
+++ b/src/core/autofill_client_qt.cpp
@@ -10,11 +10,10 @@
 #include "web_contents_adapter_client.h"
 #include "web_contents_view_qt.h"
 
-#include "base/task/thread_pool.h"
-#include "base/threading/thread_task_runner_handle.h"
 #include "chrome/browser/profiles/profile.h"
 #include "components/autofill/core/common/autofill_prefs.h"
 #include "content/browser/web_contents/web_contents_impl.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
 
 namespace QtWebEngineCore {
 
@@ -51,9 +50,6 @@ const PrefService *AutofillClientQt::GetPrefs() const
 void AutofillClientQt::ShowAutofillPopup(const autofill::AutofillClient::PopupOpenArgs &open_args,
                                          base::WeakPtr<autofill::AutofillPopupDelegate> delegate)
 {
-    // Specific popups (personal, address, credit card, password) are not supported.
-    DCHECK(open_args.popup_type == autofill::PopupType::kUnspecified);
-
     m_popupController->d->delegate = delegate;
     m_popupController->d->suggestions = open_args.suggestions;
     m_popupController->updateModel();
@@ -85,11 +81,11 @@ autofill::AutofillClient::PopupOpenArgs AutofillClientQt::GetReopenPopupArgs() c
     return autofill::AutofillClient::PopupOpenArgs();
 }
 
-base::span<const autofill::Suggestion> AutofillClientQt::GetPopupSuggestions() const
+std::vector<autofill::Suggestion> AutofillClientQt::GetPopupSuggestions() const
 {
     // Called by password_manager component only.
     NOTIMPLEMENTED();
-    return base::span<const autofill::Suggestion>();
+    return {};
 }
 
 void AutofillClientQt::UpdatePopup(const std::vector<autofill::Suggestion> &, autofill::PopupType)
@@ -113,6 +109,16 @@ bool AutofillClientQt::IsPasswordManagerEnabled()
     return false;
 }
 
+bool AutofillClientQt::IsOffTheRecord()
+{
+    return web_contents()->GetBrowserContext()->IsOffTheRecord();
+}
+
+scoped_refptr<network::SharedURLLoaderFactory> AutofillClientQt::GetURLLoaderFactory()
+{
+    return nullptr;
+}
+
 void AutofillClientQt::PropagateAutofillPredictions(autofill::AutofillDriver *,
                                                     const std::vector<autofill::FormStructure *> &)
 {
diff --git a/src/core/autofill_client_qt.h b/src/core/autofill_client_qt.h
index 4830cac3486..46e40f1da27 100644
--- a/src/core/autofill_client_qt.h
+++ b/src/core/autofill_client_qt.h
@@ -49,14 +49,15 @@ class AutofillClientQt : public autofill::AutofillClient,
                                            const std::vector<std::u16string> &labels) override;
     void PinPopupView() override;
     autofill::AutofillClient::PopupOpenArgs GetReopenPopupArgs() const override;
-    base::span<const autofill::Suggestion> GetPopupSuggestions() const override;
+    std::vector<autofill::Suggestion> GetPopupSuggestions() const override;
     void UpdatePopup(const std::vector<autofill::Suggestion> &, autofill::PopupType) override;
     void HideAutofillPopup(autofill::PopupHidingReason reason) override;
     bool IsAutocompleteEnabled() const override;
     bool IsPasswordManagerEnabled() override;
     void PropagateAutofillPredictions(autofill::AutofillDriver *,
                                       const std::vector<autofill::FormStructure *> &) override;
-
+    bool IsOffTheRecord() override;
+    scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
 
 private:
     explicit AutofillClientQt(content::WebContents *webContents);
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index e58822c29ce..16952d7cdf9 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -61,6 +61,7 @@
 #if BUILDFLAG(IS_MAC)
 #include "base/message_loop/message_pump_mac.h"
 #include "services/device/public/cpp/geolocation/geolocation_manager.h"
+#include "services/device/public/cpp/geolocation/system_geolocation_source.h"
 #include "ui/base/idle/idle.h"
 #endif
 
@@ -209,19 +210,20 @@ class MessagePumpForUIQt : public base::MessagePump
 };
 
 #if BUILDFLAG(IS_MAC)
-class FakeGeolocationManager : public device::GeolocationManager
+class FakeGeolocationSource : public device::SystemGeolocationSource
 {
 public:
-    FakeGeolocationManager() = default;
-    ~FakeGeolocationManager() override = default;
+    FakeGeolocationSource() = default;
+    ~FakeGeolocationSource() override = default;
 
-    // GeolocationManager implementation:
+    // SystemGeolocationSource implementation:
     void StartWatchingPosition(bool) override {}
     void StopWatchingPosition() override {}
-    device::LocationSystemPermissionStatus GetSystemPermission() const override
+    void RegisterPermissionUpdateCallback(PermissionUpdateCallback callback)
     {
-        return device::LocationSystemPermissionStatus::kDenied;
+        callback.Run(device::LocationSystemPermissionStatus::kDenied);
     }
+    void RegisterPositionUpdateCallback(PositionUpdateCallback callback) {}
 };
 #endif // BUILDFLAG(IS_MAC)
 
@@ -250,7 +252,7 @@ int BrowserMainPartsQt::PreEarlyInitialization()
 void BrowserMainPartsQt::PreCreateMainMessageLoop()
 {
 #if BUILDFLAG(IS_MAC)
-    m_geolocationManager = std::make_unique<FakeGeolocationManager>();
+    m_geolocationManager = std::make_unique<device::GeolocationManager>(std::make_unique<FakeGeolocationSource>());
 #endif
 }
 
diff --git a/src/core/browser_message_filter_qt.h b/src/core/browser_message_filter_qt.h
index 53c48eb6e65..0f5721c824f 100644
--- a/src/core/browser_message_filter_qt.h
+++ b/src/core/browser_message_filter_qt.h
@@ -4,7 +4,7 @@
 #ifndef BROWSER_MESSAGE_FILTER_QT_H
 #define BROWSER_MESSAGE_FILTER_QT_H
 
-#include "base/callback.h"
+#include "base/functional/callback.h"
 #include "content/public/browser/browser_message_filter.h"
 
 class GURL;
diff --git a/src/core/browsing_data_remover_delegate_qt.cpp b/src/core/browsing_data_remover_delegate_qt.cpp
index bbfd902ec41..6a408598a48 100644
--- a/src/core/browsing_data_remover_delegate_qt.cpp
+++ b/src/core/browsing_data_remover_delegate_qt.cpp
@@ -3,8 +3,8 @@
 
 #include "browsing_data_remover_delegate_qt.h"
 
-#include "base/bind.h"
-#include "base/callback.h"
+#include "base/functional/bind.h"
+#include "base/functional/callback.h"
 #include "components/web_cache/browser/web_cache_manager.h"
 #include "content/public/browser/browsing_data_remover.h"
 
diff --git a/src/core/certificate_error_controller.h b/src/core/certificate_error_controller.h
index b61845e7b5f..4fb1a3c7798 100644
--- a/src/core/certificate_error_controller.h
+++ b/src/core/certificate_error_controller.h
@@ -16,8 +16,10 @@
 #define CERTIFICATE_ERROR_CONTROLLER_H
 
 #include "qtwebenginecoreglobal_p.h"
-#include "base/callback.h"
+
+#include "base/functional/callback.h"
 #include "content/public/browser/certificate_request_result_type.h"
+
 #include "qwebenginecertificateerror.h"
 #include <QtCore/QDateTime>
 #include <QtCore/QScopedPointer>
diff --git a/src/core/client_cert_select_controller.cpp b/src/core/client_cert_select_controller.cpp
index a4ce6f6dad3..d6af984c187 100644
--- a/src/core/client_cert_select_controller.cpp
+++ b/src/core/client_cert_select_controller.cpp
@@ -3,7 +3,7 @@
 
 #include "client_cert_select_controller.h"
 
-#include <base/bind.h>
+#include <base/functional/bind.h>
 #include <content/public/browser/client_certificate_delegate.h>
 #include <net/cert/x509_certificate.h>
 #include <net/ssl/client_cert_identity.h>
@@ -77,7 +77,8 @@ void ClientCertSelectController::select(const QSslCertificate &certificate)
     }
     QByteArray derCertificate = certificate.toDer();
     scoped_refptr<net::X509Certificate> selectedCert =
-            net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)derCertificate.constData(), derCertificate.length()));
+            net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)derCertificate.constData(),
+                                                                  (long unsigned)derCertificate.length()));
     for (auto &certInfo : m_clientCerts) {
         scoped_refptr<net::X509Certificate> cert = certInfo->certificate();
         if (cert->EqualsExcludingChain(selectedCert.get())) {
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index 9f946219363..e04f5d5ecee 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -318,7 +318,7 @@ void DisplaySkiaOutputDevice::SwapBuffers(BufferPresentedCallback feedback,
 
     {
         QMutexLocker locker(&m_mutex);
-        m_taskRunner = base::ThreadTaskRunnerHandle::Get();
+        m_taskRunner = base::SingleThreadTaskRunner::GetCurrentDefault();
         std::swap(m_middleBuffer, m_backBuffer);
         m_readyToUpdate = true;
     }
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index 27bee2d1df7..07ea9dfeba1 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -7,7 +7,7 @@
 #include "compositor_resource_fence.h"
 #include "compositor.h"
 
-#include "base/threading/thread_task_runner_handle.h"
+#include "base/task/single_thread_task_runner.h"
 #include "components/viz/service/display_embedder/skia_output_device.h"
 #include "gpu/command_buffer/service/shared_context_state.h"
 
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index 647c761c34d..b934bcd9066 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -7,7 +7,7 @@
 #include "render_widget_host_view_qt_delegate.h"
 #include "type_conversion.h"
 
-#include "base/threading/thread_task_runner_handle.h"
+#include "base/task/single_thread_task_runner.h"
 #include "components/viz/service/display/display.h"
 #include "components/viz/service/display/output_surface_frame.h"
 
@@ -25,7 +25,7 @@ class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDev
 
     // Overridden from viz::SoftwareOutputDevice.
     void Resize(const gfx::Size &sizeInPixels, float devicePixelRatio) override;
-    void OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gl::FrameData data) override;
+    void OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gfx::FrameData data) override;
 
     // Overridden from Compositor.
     void swapFrame() override;
@@ -60,11 +60,11 @@ void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels,
     surface_ = SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(sizeInPixels.width(), sizeInPixels.height()));
 }
 
-void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gl::FrameData data)
+void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gfx::FrameData data)
 {
     { // MEMO don't hold a lock together with an 'observer', as the call from Qt's scene graph may come at the same time
         QMutexLocker locker(&m_mutex);
-        m_taskRunner = base::ThreadTaskRunnerHandle::Get();
+        m_taskRunner = base::SingleThreadTaskRunner::GetCurrentDefault();
         m_swapCompletionCallback = std::move(swap_ack_callback);
     }
 
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
index dfd2ee24bed..df6747ab9d8 100644
--- a/src/core/compositor/native_skia_output_device.cpp
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -16,10 +16,7 @@
 #include "third_party/skia/include/core/SkSurfaceProps.h"
 #include "ui/gl/gl_fence.h"
 
-#if defined(Q_OS_MACOS)
-#include "ui/gl/gl_image_io_surface.h"
-#elif defined(Q_OS_WIN)
-#include "ui/gl/gl_image_d3d.h"
+#if defined(Q_OS_WIN)
 #include <QtQuick/qsgtexture.h>
 #include <d3d11_1.h>
 #endif
@@ -164,7 +161,13 @@ class NativeSkiaOutputDevice::Buffer
             m_textureCleanup = nullptr;
         }
     }
-#ifdef Q_OS_MACOS
+#if defined(Q_OS_WIN)
+    absl::optional<gl::DCLayerOverlayImage> overlayImage() const
+    {
+        DCHECK(m_presentCount);
+        return m_scopedOverlayReadAccess->GetDCLayerOverlayImage();
+    }
+#elif defined(Q_OS_MACOS)
     gfx::ScopedIOSurface ioSurface() const
     {
         DCHECK(m_presentCount);
@@ -270,7 +273,7 @@ void NativeSkiaOutputDevice::SwapBuffers(BufferPresentedCallback feedback,
     {
         QMutexLocker locker(&m_mutex);
         m_backBuffer->createFence();
-        m_taskRunner = base::ThreadTaskRunnerHandle::Get();
+        m_taskRunner = base::SingleThreadTaskRunner::GetCurrentDefault();
         std::swap(m_middleBuffer, m_backBuffer);
         m_readyToUpdate = true;
     }
@@ -360,37 +363,38 @@ QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureO
     Q_ASSERT(QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11);
 
     QSGTexture *texture = nullptr;
-    gl::GLImageD3D *gl_image_d3d = gl::GLImageD3D::FromGLImage(m_frontBuffer->glImage());
-    if (gl_image_d3d) {
+    auto overlay_image = m_frontBuffer->overlayImage();
+    if (overlay_image) {
         // Pass texture between two D3D devices:
         HRESULT status = S_OK;
-        HANDLE sharedHandle;
-        sharedHandle = gl_image_d3d->shared_handle();
-        if (!sharedHandle) {
-            qWarning() << "No shared handle";
+        HANDLE sharedHandle = nullptr;
+        IDXGIResource1 *resource = nullptr;
+        if (!overlay_image->nv12_texture()) {
+            qWarning() << "No D3D texture";
             return nullptr;
         }
+        status = overlay_image->nv12_texture()->QueryInterface(__uuidof(IDXGIResource1), (void**)&resource);
+        Q_ASSERT(status == S_OK);
+        status = resource->CreateSharedHandle(NULL, DXGI_SHARED_RESOURCE_READ, NULL, &sharedHandle);
+        Q_ASSERT(status == S_OK);
         Q_ASSERT(sharedHandle);
 
-        HANDLE sharedHandleDup;
-        DuplicateHandle(GetCurrentProcess(), sharedHandle, GetCurrentProcess(), &sharedHandleDup, 0, FALSE, DUPLICATE_SAME_ACCESS);
-
         QSGRendererInterface *ri = win->rendererInterface();
         ID3D11Device1 *device = static_cast<ID3D11Device1 *>(ri->getResource(win, QSGRendererInterface::DeviceResource));
 
         ID3D11Texture2D *qtTexture;
-        status = device->OpenSharedResource1(sharedHandleDup, __uuidof(ID3D11Texture2D), (void**)&qtTexture);
+        status = device->OpenSharedResource1(sharedHandle, __uuidof(ID3D11Texture2D), (void**)&qtTexture);
         Q_ASSERT(status == S_OK);
 
         QQuickWindow::CreateTextureOptions texOpts(textureOptions);
         texture = QNativeInterface::QSGD3D11Texture::fromNative(qtTexture, win, size(), texOpts);
 
-        m_frontBuffer->m_textureCleanup = [qtTexture,sharedHandleDup]() {
+        m_frontBuffer->m_textureCleanup = [qtTexture,sharedHandle]() {
             qtTexture->Release();
-            ::CloseHandle(sharedHandleDup);
+            ::CloseHandle(sharedHandle);
         };
     } else {
-        qWarning() << "GLImage is not D3D";
+        qWarning() << "No overlay image";
     }
 
     return texture;
diff --git a/src/core/compositor/native_skia_output_device.h b/src/core/compositor/native_skia_output_device.h
index 450f909b0b3..7b92ba6449d 100644
--- a/src/core/compositor/native_skia_output_device.h
+++ b/src/core/compositor/native_skia_output_device.h
@@ -6,7 +6,7 @@
 
 #include "compositor.h"
 
-#include "base/threading/thread_task_runner_handle.h"
+#include "base/task/single_thread_task_runner.h"
 #include "components/viz/service/display_embedder/skia_output_device.h"
 #include "gpu/command_buffer/service/shared_context_state.h"
 
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 45707ddca7d..b60651a6269 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -87,20 +87,19 @@ config("embedded_config") {
   defines = [ "QTWEBENGINE_EMBEDDED_SWITCHES=1" ]
 }
 
-config("cpp17_config") {
-  # static initialized constexpr expressions must be compiled always as c++14 or always as c++17
-  # and our qtwebengine core sources use them as c++17
+config("cpp20_config") {
+  # Chromium is build with C++20
   if (is_win) {
-    cflags_cc = [ "/std:c++17" ]
+    cflags_cc = [ "/std:c++20" ]
   } else {
-    cflags_cc = [ "-std=c++17" ]
+    cflags_cc = [ "-std=c++20" ]
   }
 }
 
 shared_library("QtWebEngineCore") {
   rsp_types = [ "objects", "archives", "libs", "lflags"]
   configs += [
-    ":cpp17_config",
+    ":cpp20_config",
     ":QtWebEngineCore_config",
     "//build/config:precompiled_headers"
   ]
@@ -125,6 +124,7 @@ shared_library("QtWebEngineCore") {
     "//components/gcm_driver",
     "//components/history/content/browser",
     "//components/keyed_service/content",
+    "//components/lens:buildflags",
     "//components/navigation_interception",
     "//components/network_hints/browser",
     "//components/network_hints/common:mojo_bindings",
@@ -135,6 +135,7 @@ shared_library("QtWebEngineCore") {
     "//components/web_cache/browser",
     "//components/web_cache/renderer",
     "//components/spellcheck:buildflags",
+    "//components/supervised_user/core/common:buildflags",
     "//components/profile_metrics",
     "//components/proxy_config",
     "//components/user_prefs",
@@ -225,7 +226,7 @@ source_set("qtwebengine_spellcheck_sources") {
 }
 
 source_set("devtools_sources") {
-  configs += [ ":cpp17_config" ]
+  configs += [ ":cpp20_config" ]
   deps = [
     "//components/zoom",
     "//third_party/blink/public/mojom:mojom_platform",
@@ -252,7 +253,7 @@ source_set("devtools_sources") {
 
 source_set("qtwebengine_sources") {
   configs += [
-    ":cpp17_config",
+    ":cpp20_config",
     "//skia:skia_config",
     "//third_party/boringssl:external_config",
   ]
@@ -513,7 +514,7 @@ source_set("qtwebengine_sources") {
 if (is_win) {
   static_library("QtWebEngineCoreSandbox") {
     complete_static_lib = true
-    configs += [ ":cpp17_config",
+    configs += [ ":cpp20_config",
                  ":QtWebEngineCore_config",
                  "//build/config:precompiled_headers"
     ]
@@ -548,6 +549,7 @@ repack("qtwebengine_repack_resources") {
     "$root_gen_dir/chrome/net_internals_resources.pak",
     "$root_gen_dir/components/components_resources.pak",
     "$root_gen_dir/components/dev_ui_components_resources.pak",
+    "$root_gen_dir/content/attribution_internals_resources.pak",
     "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
     "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
     "$root_gen_dir/content/content_resources.pak",
@@ -557,7 +559,7 @@ repack("qtwebengine_repack_resources") {
     "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
     "$root_gen_dir/net/net_resources.pak",
     "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
-    "$root_gen_dir/ui/resources/webui_generated_resources.pak",
+    "$root_gen_dir/ui/resources/webui_resources.pak",
   ]
   output = "$root_out_dir/qtwebengine_resources.pak"
   deps = [
@@ -567,6 +569,7 @@ repack("qtwebengine_repack_resources") {
      "//chrome/common:resources_grit",
      "//components/resources:components_resources_grit",
      "//components/resources:dev_ui_components_resources_grit",
+     "//content/browser/resources/attribution_reporting:resources",
      "//content/browser/resources/media:resources",
      "//content/browser/tracing:resources",
      "//content:content_resources",
@@ -576,7 +579,7 @@ repack("qtwebengine_repack_resources") {
      "//mojo/public/js:resources",
      "//net:net_resources_grit",
      "//third_party/blink/public:resources_grit",
-     "//ui/resources:webui_generated_resources_grd",
+     "//ui/resources:webui_resources_grd",
   ]
   if (enable_extensions) {
     sources += [
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index fab8a5abb0a..5d93e25ba6c 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -30,8 +30,10 @@
 #include <QLibraryInfo>
 #include <QString>
 
+
 #if BUILDFLAG(ENABLE_LIBRARY_CDMS)
 #include "media/cdm/cdm_paths.h"  // nogncheck
+#include "media/cdm/clear_key_cdm_common.h"
 #include "third_party/widevine/cdm/buildflags.h"
 #include "third_party/widevine/cdm/widevine_cdm_common.h"
 #if BUILDFLAG(ENABLE_WIDEVINE) && !BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index e4eadca4357..8c537a6c72e 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -136,12 +136,12 @@ WebContentsDelegateQt *DevToolsFrontendQt::frontendDelegate() const
 
 void DevToolsFrontendQt::ColorPickedInEyeDropper(int r, int g, int b, int a)
 {
-    base::DictionaryValue color;
-    color.SetInteger("r", r);
-    color.SetInteger("g", g);
-    color.SetInteger("b", b);
-    color.SetInteger("a", a);
-    m_bindings->CallClientMethod("DevToolsAPI", "eyeDropperPickedColor", std::move(color));
+    base::Value::Dict color;
+    color.Set("r", r);
+    color.Set("g", g);
+    color.Set("b", b);
+    color.Set("a", a);
+    m_bindings->CallClientMethod("DevToolsAPI", "eyeDropperPickedColor", base::Value(std::move(color)));
 }
 
 // content::WebContentsObserver implementation
diff --git a/src/core/extensions/extension_host_delegate_qt.cpp b/src/core/extensions/extension_host_delegate_qt.cpp
index 6cc268e75cf..067ec3d9d35 100644
--- a/src/core/extensions/extension_host_delegate_qt.cpp
+++ b/src/core/extensions/extension_host_delegate_qt.cpp
@@ -33,13 +33,13 @@ content::JavaScriptDialogManager *ExtensionHostDelegateQt::GetJavaScriptDialogMa
 void ExtensionHostDelegateQt::CreateTab(std::unique_ptr<content::WebContents> web_contents,
                                         const std::string &extension_id,
                                         WindowOpenDisposition disposition,
-                                        const gfx::Rect &initial_rect,
+                                        const blink::mojom::WindowFeatures &features,
                                         bool user_gesture)
 {
     Q_UNUSED(web_contents);
     Q_UNUSED(extension_id);
     Q_UNUSED(disposition);
-    Q_UNUSED(initial_rect);
+    Q_UNUSED(features);
     Q_UNUSED(user_gesture);
 
     Q_UNREACHABLE();
diff --git a/src/core/extensions/extension_host_delegate_qt.h b/src/core/extensions/extension_host_delegate_qt.h
index e5577b3fd40..1c2688933ea 100644
--- a/src/core/extensions/extension_host_delegate_qt.h
+++ b/src/core/extensions/extension_host_delegate_qt.h
@@ -20,7 +20,7 @@ class ExtensionHostDelegateQt : public ExtensionHostDelegate
     void CreateTab(std::unique_ptr<content::WebContents> web_contents,
                    const std::string &extension_id,
                    WindowOpenDisposition disposition,
-                   const gfx::Rect &initial_rect,
+                   const blink::mojom::WindowFeatures &features,
                    bool user_gesture) override;
     void ProcessMediaAccessRequest(content::WebContents *web_contents,
                                    const content::MediaStreamRequest &request,
diff --git a/src/core/extensions/extension_system_qt.cpp b/src/core/extensions/extension_system_qt.cpp
index 42dfd0d67f3..d55d7d03680 100644
--- a/src/core/extensions/extension_system_qt.cpp
+++ b/src/core/extensions/extension_system_qt.cpp
@@ -11,7 +11,7 @@
 
 #include "base/base_paths.h"
 #include "base/base_switches.h"
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
diff --git a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
index 15aa4a6c4ce..9b6b38a52bb 100644
--- a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
+++ b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
@@ -9,6 +9,7 @@
 
 #include "extensions/pdf_iframe_navigation_throttle_qt.h"
 
+#include "base/task/sequenced_task_runner.h"
 #include "chrome/grit/renderer_resources.h"
 #include "components/strings/grit/components_strings.h"
 #include "content/public/browser/download_utils.h"
@@ -181,7 +182,7 @@ void PDFIFrameNavigationThrottleQt::LoadPlaceholderHTML()
 
     PdfWebContentsLifetimeHelper::CreateForWebContents(web_contents);
     PdfWebContentsLifetimeHelper *helper = PdfWebContentsLifetimeHelper::FromWebContents(web_contents);
-    base::SequencedTaskRunnerHandle::Get()->PostTask(
+    base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
         FROM_HERE,
         base::BindOnce(&PdfWebContentsLifetimeHelper::NavigateIFrameToPlaceholder,
                        helper->GetWeakPtr(), std::move(params)));
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
index 5628744eaa8..8bb9d8d7783 100644
--- a/src/core/file_system_access/file_system_access_permission_context_qt.cpp
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
@@ -241,6 +241,8 @@ FileSystemAccessPermissionContextQt::GetReadPermissionGrant(const url::Origin &o
         break;
     case UserAction::kLoadFromStorage:
         break;
+    case UserAction::kNone:
+        Q_UNREACHABLE();
     }
 
     return existing_grant;
@@ -285,6 +287,8 @@ FileSystemAccessPermissionContextQt::GetWritePermissionGrant(const url::Origin &
     case UserAction::kDragAndDrop:
     case UserAction::kLoadFromStorage:
         break;
+    case UserAction::kNone:
+        Q_UNREACHABLE();
     }
 
     return existing_grant;
diff --git a/src/core/file_system_access/file_system_access_permission_request_manager_qt.h b/src/core/file_system_access/file_system_access_permission_request_manager_qt.h
index f8746eabf37..84085491153 100644
--- a/src/core/file_system_access/file_system_access_permission_request_manager_qt.h
+++ b/src/core/file_system_access/file_system_access_permission_request_manager_qt.h
@@ -4,9 +4,9 @@
 #ifndef FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_MANAGER_QT_H
 #define FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_MANAGER_QT_H
 
-#include "base/callback_helpers.h"
 #include "base/containers/circular_deque.h"
 #include "base/files/file_path.h"
+#include "base/functional/callback_helpers.h"
 #include "base/memory/weak_ptr.h"
 #include "content/public/browser/file_system_access_permission_context.h"
 #include "content/public/browser/web_contents_observer.h"
diff --git a/src/core/javascript_dialog_controller_p.h b/src/core/javascript_dialog_controller_p.h
index 8345cd50b54..af064250bce 100644
--- a/src/core/javascript_dialog_controller_p.h
+++ b/src/core/javascript_dialog_controller_p.h
@@ -15,7 +15,7 @@
 // We mean it.
 //
 
-#include "base/callback.h"
+#include "base/functional/callback.h"
 #include "content/public/browser/javascript_dialog_manager.h"
 
 #include "web_contents_adapter_client.h"
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp
index c7273eaeaf2..cb0565f629c 100644
--- a/src/core/location_provider_qt.cpp
+++ b/src/core/location_provider_qt.cpp
@@ -12,7 +12,7 @@
 #include <QtCore/QThread>
 #include <QtPositioning/QGeoPositionInfoSource>
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "base/memory/weak_ptr.h"
 #include "content/public/browser/browser_thread.h"
 #include "services/device/geolocation/geolocation_provider.h"
diff --git a/src/core/net/client_cert_qt.cpp b/src/core/net/client_cert_qt.cpp
index d5ea1a77615..1a6f9707961 100644
--- a/src/core/net/client_cert_qt.cpp
+++ b/src/core/net/client_cert_qt.cpp
@@ -3,8 +3,8 @@
 
 #include "client_cert_qt.h"
 
-#include "base/bind.h"
-#include "base/callback_forward.h"
+#include "base/functional/bind.h"
+#include "base/functional/callback_forward.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "crypto/crypto_buildflags.h"
 #include "net/ssl/client_cert_store.h"
diff --git a/src/core/net/client_cert_qt.h b/src/core/net/client_cert_qt.h
index 85b0d28be70..96579fae65d 100644
--- a/src/core/net/client_cert_qt.h
+++ b/src/core/net/client_cert_qt.h
@@ -4,9 +4,9 @@
 #ifndef CLIENT_CERT_QT_P_H
 #define CLIENT_CERT_QT_P_H
 
-#include "net/ssl/client_cert_store.h"
-#include "base/callback_forward.h"
+#include "base/functional/callback_forward.h"
 #include "net/cert/x509_certificate.h"
+#include "net/ssl/client_cert_store.h"
 
 namespace net {
 class SSLCertRequestInfo;
diff --git a/src/core/net/client_cert_store_data.cpp b/src/core/net/client_cert_store_data.cpp
index 306e782e040..0de6885df85 100644
--- a/src/core/net/client_cert_store_data.cpp
+++ b/src/core/net/client_cert_store_data.cpp
@@ -97,7 +97,8 @@ void ClientCertificateStoreData::add(const QSslCertificate &certificate, const Q
 
     Entry *data = new Entry;
     data->keyPtr = wrapOpenSSLPrivateKey(sslKeyInBytes);
-    data->certPtr = net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)certInBytes.data(), certInBytes.length()));
+    data->certPtr = net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)certInBytes.data(),
+                                                                          (unsigned long)certInBytes.length()));
     data->key = privateKey;
     data->certificate = certificate;
     extraCerts.append(data);
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index dc47de20793..147e63f9a99 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -3,7 +3,7 @@
 
 #include "cookie_monster_delegate_qt.h"
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "net/cookies/cookie_util.h"
 #include "services/network/public/mojom/cookie_manager.mojom.h"
 
diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp
index bd19aa436f8..69b7c6b6842 100644
--- a/src/core/net/custom_url_loader_factory.cpp
+++ b/src/core/net/custom_url_loader_factory.cpp
@@ -271,7 +271,8 @@ class CustomURLLoader : public network::mojom::URLLoader
         m_head->encoded_data_length = m_head->headers->raw_headers().length();
 
         if (!m_redirect.is_empty()) {
-            m_head->content_length = m_head->encoded_body_length = -1;
+            m_head->content_length = {};
+            m_head->encoded_body_length = {};
             net::RedirectInfo::FirstPartyURLPolicy first_party_url_policy =
                     m_request.update_first_party_url_on_redirect ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
                                                                  : net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
@@ -339,7 +340,8 @@ class CustomURLLoader : public network::mojom::URLLoader
         }
         m_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
         m_head->encoded_data_length = m_head->headers->raw_headers().length();
-        m_head->content_length = m_head->encoded_body_length = -1;
+        m_head->content_length = {};
+        m_head->encoded_body_length = {};
         m_client->OnReceiveResponse(std::move(m_head), mojo::ScopedDataPipeConsumerHandle(), absl::nullopt);
         CompleteWithFailure(net::Error(error));
     }
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
index f61fb704a60..fb765639233 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
@@ -8,7 +8,7 @@
 
 #include "plugin_response_interceptor_url_loader_throttle.h"
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "base/guid.h"
 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
 #include "content/public/browser/browser_context.h"
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index d0c5b67dec2..5bae987e2ee 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -66,15 +66,15 @@ ProxyingRestrictedCookieManagerQt::~ProxyingRestrictedCookieManagerQt()
 
 void ProxyingRestrictedCookieManagerQt::GetAllForUrl(const GURL &url,
                                                      const net::SiteForCookies &site_for_cookies,
-                                                     const url::Origin &top_frame_origin,
+                                                     const url::Origin &top_frame_origin, bool has_storage_access,
                                                      network::mojom::CookieManagerGetOptionsPtr options,
                                                      GetAllForUrlCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
-        underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options),
-                                                            std::move(callback));
+        underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, has_storage_access,
+                                                            std::move(options), std::move(callback));
     } else {
         std::move(callback).Run(std::vector<net::CookieWithAccessResult>());
     }
@@ -84,13 +84,15 @@ void ProxyingRestrictedCookieManagerQt::SetCanonicalCookie(const net::CanonicalC
                                                            const GURL &url,
                                                            const net::SiteForCookies &site_for_cookies,
                                                            const url::Origin &top_frame_origin,
+                                                           bool has_storage_access,
                                                            net::CookieInclusionStatus status,
                                                            SetCanonicalCookieCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
-        underlying_restricted_cookie_manager_->SetCanonicalCookie(cookie, url, site_for_cookies, top_frame_origin, status, std::move(callback));
+        underlying_restricted_cookie_manager_->SetCanonicalCookie(cookie, url, site_for_cookies, top_frame_origin,
+                                                                  has_storage_access, status, std::move(callback));
     } else {
         std::move(callback).Run(false);
     }
@@ -99,24 +101,26 @@ void ProxyingRestrictedCookieManagerQt::SetCanonicalCookie(const net::CanonicalC
 void ProxyingRestrictedCookieManagerQt::AddChangeListener(const GURL &url,
                                                           const net::SiteForCookies &site_for_cookies,
                                                           const url::Origin &top_frame_origin,
+                                                          bool has_storage_access,
                                                           mojo::PendingRemote<network::mojom::CookieChangeListener> listener,
                                                           AddChangeListenerCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-    underlying_restricted_cookie_manager_->AddChangeListener(url, site_for_cookies, top_frame_origin, std::move(listener), std::move(callback));
+    underlying_restricted_cookie_manager_->AddChangeListener(url, site_for_cookies, top_frame_origin, has_storage_access,
+                                                             std::move(listener), std::move(callback));
 }
 
 void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
                                                             const net::SiteForCookies &site_for_cookies,
-                                                            const url::Origin &top_frame_origin,
+                                                            const url::Origin &top_frame_origin, bool has_storage_access,
                                                             const std::string &cookie,
                                                             SetCookieFromStringCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
-        underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, cookie,
-                                                                   std::move(callback));
+        underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, has_storage_access,
+                                                                   cookie, std::move(callback));
     } else {
         std::move(callback).Run(false, false); // FIXME: is true, true in aw_proxying_restricted_cookie_manager.cc though..
     }
@@ -124,14 +128,14 @@ void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
 
 void ProxyingRestrictedCookieManagerQt::GetCookiesString(const GURL &url,
                                                          const net::SiteForCookies &site_for_cookies,
-                                                         const url::Origin &top_frame_origin,
+                                                         const url::Origin &top_frame_origin, bool has_storage_access,
                                                          GetCookiesStringCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
 
     if (allowCookies(url, site_for_cookies)) {
         underlying_restricted_cookie_manager_->GetCookiesString(url, site_for_cookies, top_frame_origin,
-                                                                std::move(callback));
+                                                                has_storage_access, std::move(callback));
     } else {
         std::move(callback).Run("");
     }
@@ -140,6 +144,7 @@ void ProxyingRestrictedCookieManagerQt::GetCookiesString(const GURL &url,
 void ProxyingRestrictedCookieManagerQt::CookiesEnabledFor(const GURL &url,
                                                           const net::SiteForCookies &site_for_cookies,
                                                           const url::Origin & /*top_frame_origin*/,
+                                                          bool /*has_storage_access*/,
                                                           CookiesEnabledForCallback callback)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.h b/src/core/net/proxying_restricted_cookie_manager_qt.h
index 70b8499c04e..6afdc9301af 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.h
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.h
@@ -27,31 +27,38 @@ class ProxyingRestrictedCookieManagerQt : public network::mojom::RestrictedCooki
     void GetAllForUrl(const GURL &url,
                       const net::SiteForCookies &site_for_cookies,
                       const url::Origin &top_frame_origin,
+                      bool has_storage_access,
                       network::mojom::CookieManagerGetOptionsPtr options,
                       GetAllForUrlCallback callback) override;
+
     void SetCanonicalCookie(const net::CanonicalCookie& cookie,
                             const GURL &url,
                             const net::SiteForCookies &site_for_cookies,
                             const url::Origin &top_frame_origin,
+                            bool has_storage_access,
                             net::CookieInclusionStatus status,
                             SetCanonicalCookieCallback callback) override;
     void AddChangeListener(const GURL &url,
                            const net::SiteForCookies &site_for_cookies,
                            const url::Origin &top_frame_origin,
+                           bool has_storage_access,
                            mojo::PendingRemote<network::mojom::CookieChangeListener> listener,
                            AddChangeListenerCallback callback) override;
     void SetCookieFromString(const GURL &url,
                              const net::SiteForCookies &site_for_cookies,
                              const url::Origin &top_frame_origin,
+                             bool has_storage_access,
                              const std::string &cookie,
                              SetCookieFromStringCallback callback) override;
     void GetCookiesString(const GURL &url,
                           const net::SiteForCookies &site_for_cookies,
                           const url::Origin &top_frame_origin,
+                          bool has_storage_access,
                           GetCookiesStringCallback callback) override;
     void CookiesEnabledFor(const GURL &url,
                            const net::SiteForCookies &site_for_cookies,
                            const url::Origin &top_frame_origin,
+                           bool has_storage_access,
                            CookiesEnabledForCallback callback) override;
 
     // Internal:
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 8a74b89c45c..42e5d8bc14a 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -5,7 +5,7 @@
 
 #include <utility>
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/web_contents.h"
diff --git a/src/core/net/ssl_host_state_delegate_qt.cpp b/src/core/net/ssl_host_state_delegate_qt.cpp
index d0308389d3e..20429e62efd 100644
--- a/src/core/net/ssl_host_state_delegate_qt.cpp
+++ b/src/core/net/ssl_host_state_delegate_qt.cpp
@@ -3,7 +3,7 @@
 
 #include "ssl_host_state_delegate_qt.h"
 
-#include "base/callback.h"
+#include "base/functional/callback.h"
 
 namespace QtWebEngineCore {
 
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index 8df65b7a573..1a7b01ce898 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -8,8 +8,8 @@
 
 #include "net/system_network_context_manager.h"
 
-#include "base/bind.h"
 #include "base/command_line.h"
+#include "base/functional/bind.h"
 #include "base/strings/string_split.h"
 #include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
 #include "chrome/common/chrome_switches.h"
diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp
index edfe9ade27e..ca0e66a9b1c 100644
--- a/src/core/net/webui_controller_factory_qt.cpp
+++ b/src/core/net/webui_controller_factory_qt.cpp
@@ -11,7 +11,7 @@
 #include "build_config_qt.h"
 #include "devtools_frontend_qt.h"
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "build/build_config.h"
 #include "chrome/browser/accessibility/accessibility_ui.h"
 #include "chrome/browser/profiles/profile.h"
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp
index 287f07713cd..43305289de3 100644
--- a/src/core/ozone/gl_ozone_egl_qt.cpp
+++ b/src/core/ozone/gl_ozone_egl_qt.cpp
@@ -41,10 +41,12 @@ bool GLOzoneEGLQt::LoadGLES2Bindings(const gl::GLImplementationParts & /*impleme
     return LoadQtEGLBindings();
 }
 
-gl::GLDisplay *GLOzoneEGLQt::InitializeGLOneOffPlatform(uint64_t system_device_id)
+gl::GLDisplay *GLOzoneEGLQt::InitializeGLOneOffPlatform(bool supports_angle,
+                                                        std::vector<gl::DisplayType> init_displays,
+                                                        gl::GpuPreference gpu_preference)
 {
-    if (auto display = gl::GLSurfaceEGLQt::InitializeOneOff(system_device_id)) {
-        if (!static_cast<gl::GLDisplayEGL*>(display)->Initialize(GetNativeDisplay())) {
+    if (auto display = gl::GLSurfaceEGLQt::InitializeOneOff(gpu_preference)) {
+        if (!static_cast<gl::GLDisplayEGL*>(display)->Initialize(supports_angle, std::move(init_displays), GetNativeDisplay())) {
             LOG(ERROR) << "GLDisplayEGL::Initialize failed.";
             return nullptr;
         }
@@ -53,6 +55,7 @@ gl::GLDisplay *GLOzoneEGLQt::InitializeGLOneOffPlatform(uint64_t system_device_i
     return nullptr;
 }
 
+
 bool GLOzoneEGLQt::InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *display)
 {
     return static_cast<gl::GLDisplayEGL*>(display)->InitializeExtensionSettings();
diff --git a/src/core/ozone/gl_ozone_egl_qt.h b/src/core/ozone/gl_ozone_egl_qt.h
index 6a313c8faac..7ac55979a86 100644
--- a/src/core/ozone/gl_ozone_egl_qt.h
+++ b/src/core/ozone/gl_ozone_egl_qt.h
@@ -12,7 +12,9 @@ namespace ui {
 
 class GLOzoneEGLQt : public GLOzoneEGL {
 public:
-    gl::GLDisplay *InitializeGLOneOffPlatform(uint64_t system_device_id) override;
+    gl::GLDisplay *InitializeGLOneOffPlatform(bool supports_angle,
+                                              std::vector<gl::DisplayType> init_displays,
+                                              gl::GpuPreference gpu_preference) override;
     bool InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *display) override;
     scoped_refptr<gl::GLSurface> CreateViewGLSurface(
             gl::GLDisplay *display,
diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp
index 661314085bb..a4a4ac5fbaa 100644
--- a/src/core/ozone/gl_ozone_glx_qt.cpp
+++ b/src/core/ozone/gl_ozone_glx_qt.cpp
@@ -21,8 +21,9 @@
 
 namespace ui {
 
-gl::GLDisplay *GLOzoneGLXQt::InitializeGLOneOffPlatform(uint64_t system_device_id) {
-    return gl::GLSurfaceGLXQt::InitializeOneOff(system_device_id);
+gl::GLDisplay *GLOzoneGLXQt::InitializeGLOneOffPlatform(bool, std::vector<gl::DisplayType>, gl::GpuPreference preference)
+{
+    return gl::GLSurfaceGLXQt::InitializeOneOff(preference);
 }
 
 bool GLOzoneGLXQt::InitializeStaticGLBindings(
diff --git a/src/core/ozone/gl_ozone_glx_qt.h b/src/core/ozone/gl_ozone_glx_qt.h
index 177d37ba128..4df26ba7124 100644
--- a/src/core/ozone/gl_ozone_glx_qt.h
+++ b/src/core/ozone/gl_ozone_glx_qt.h
@@ -15,7 +15,7 @@ class GLOzoneGLXQt : public GLOzone {
     GLOzoneGLXQt() {}
     ~GLOzoneGLXQt() override {}
 
-    gl::GLDisplay *InitializeGLOneOffPlatform(uint64_t system_device_id) override;
+    gl::GLDisplay *InitializeGLOneOffPlatform(bool, std::vector<gl::DisplayType>, gl::GpuPreference) override;
     bool InitializeStaticGLBindings(const gl::GLImplementationParts &implementation) override;
     bool InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *display) override;
     void ShutdownGL(gl::GLDisplay *display) override;
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 63694d59db6..413d2a20ff2 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -35,12 +35,12 @@ GLSurfaceEGLQt::~GLSurfaceEGLQt()
     Destroy();
 }
 
-gl::GLDisplay *GLSurfaceEGLQt::InitializeOneOff(uint64_t system_device_id)
+gl::GLDisplay *GLSurfaceEGLQt::InitializeOneOff(gl::GpuPreference preference)
 {
     if (s_initialized)
         return g_display;
 
-    auto *egl_display = GLDisplayManagerEGL::GetInstance()->GetDisplay(system_device_id);
+    auto *egl_display = GLDisplayManagerEGL::GetInstance()->GetDisplay(preference);
     g_display = egl_display;
     egl_display->SetDisplay(GLContextHelper::getEGLDisplay());
     if (!egl_display->GetDisplay()) {
diff --git a/src/core/ozone/gl_surface_egl_qt.h b/src/core/ozone/gl_surface_egl_qt.h
index 71992e7004e..6eee132e9f9 100644
--- a/src/core/ozone/gl_surface_egl_qt.h
+++ b/src/core/ozone/gl_surface_egl_qt.h
@@ -16,7 +16,7 @@ class GLSurfaceEGLQt: public GLSurfaceQt {
 public:
     explicit GLSurfaceEGLQt(gl::GLDisplayEGL *display, const gfx::Size& size);
 
-    static gl::GLDisplay *InitializeOneOff(uint64_t system_device_id);
+    static gl::GLDisplay *InitializeOneOff(gl::GpuPreference preference);
     static bool InitializeExtensionSettingsOneOff();
 
     bool Initialize(GLSurfaceFormat format) override;
diff --git a/src/core/ozone/gl_surface_glx_qt.cpp b/src/core/ozone/gl_surface_glx_qt.cpp
index 21de815a81f..a2a76ce00d0 100644
--- a/src/core/ozone/gl_surface_glx_qt.cpp
+++ b/src/core/ozone/gl_surface_glx_qt.cpp
@@ -88,12 +88,12 @@ GLSurfaceGLXQt::~GLSurfaceGLXQt()
     Destroy();
 }
 
-GLDisplay *GLSurfaceGLXQt::InitializeOneOff(uint64_t system_device_id)
+GLDisplay *GLSurfaceGLXQt::InitializeOneOff(gl::GpuPreference preference)
 {
     if (s_initialized)
         return g_display;
 
-    g_display = GLDisplayManagerX11::GetInstance()->GetDisplay(system_device_id);
+    g_display = GLDisplayManagerX11::GetInstance()->GetDisplay(preference);
     if (!g_display->GetDisplay()) {
         LOG(ERROR) << "GLContextHelper::getXDisplay() failed.";
         return nullptr;
diff --git a/src/core/ozone/gl_surface_glx_qt.h b/src/core/ozone/gl_surface_glx_qt.h
index f81f6e9df60..8cbf1fcf297 100644
--- a/src/core/ozone/gl_surface_glx_qt.h
+++ b/src/core/ozone/gl_surface_glx_qt.h
@@ -12,7 +12,7 @@ class GLSurfaceGLXQt: public GLSurfaceQt {
 public:
     explicit GLSurfaceGLXQt(const gfx::Size& size);
 
-    static gl::GLDisplay *InitializeOneOff(uint64_t system_device_id);
+    static gl::GLDisplay *InitializeOneOff(gl::GpuPreference preference);
     static bool InitializeExtensionSettingsOneOff();
 
     bool Initialize(GLSurfaceFormat format) override;
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index b6242b427a0..fbb53e0a649 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -19,6 +19,7 @@
 #include "ozone/gl_surface_egl_qt.h"
 
 #include "gpu/ipc/service/image_transport_surface.h"
+#include "ui/gl/init/gl_display_initializer.h"
 #include "ui/gl/direct_composition_support.h"
 #include "ui/gl/gl_display.h"
 #include "ui/gl/gl_implementation.h"
@@ -62,7 +63,7 @@ bool GLSurfaceQt::IsOffscreen()
     return true;
 }
 
-gfx::SwapResult GLSurfaceQt::SwapBuffers(PresentationCallback callback, FrameData data)
+gfx::SwapResult GLSurfaceQt::SwapBuffers(PresentationCallback callback, gfx::FrameData data)
 {
     LOG(ERROR) << "Attempted to call SwapBuffers on a pbuffer.";
     Q_UNREACHABLE();
@@ -92,18 +93,18 @@ void* GLSurfaceQt::GetConfig()
 #if BUILDFLAG(IS_WIN)
 namespace init {
 
-gl::GLDisplay *InitializeGLOneOffPlatform(uint64_t system_device_id)
+gl::GLDisplay *InitializeGLOneOffPlatform(gl::GpuPreference gpu_preference)
 {
     VSyncProviderWin::InitializeOneOff();
 
     if (GetGLImplementation() == kGLImplementationDesktopGL || GetGLImplementation() == kGLImplementationDesktopGLCoreProfile)
-        return GLSurfaceWGLQt::InitializeOneOff(system_device_id);
+        return GLSurfaceWGLQt::InitializeOneOff(gpu_preference);
 
-    GLDisplayEGL *display = GetDisplayEGL(system_device_id);
+    GLDisplayEGL *display = GetDisplayEGL(gpu_preference);
     switch (GetGLImplementation()) {
     case kGLImplementationEGLANGLE:
     case kGLImplementationEGLGLES2:
-        if (!display->Initialize(EGLDisplayPlatform(GetDC(nullptr)))) {
+        if (!InitializeDisplay(display, EGLDisplayPlatform(GetDC(nullptr)))) {
             LOG(ERROR) << "GLDisplayEGL::Initialize failed.";
             return nullptr;
         }
diff --git a/src/core/ozone/gl_surface_qt.h b/src/core/ozone/gl_surface_qt.h
index 0ef8fbbcae5..f79a2608e4e 100644
--- a/src/core/ozone/gl_surface_qt.h
+++ b/src/core/ozone/gl_surface_qt.h
@@ -21,7 +21,7 @@ class GLSurfaceQt: public GLSurface {
     GLDisplay *GetGLDisplay() override;
     void *GetConfig() override;
     bool IsOffscreen() override;
-    gfx::SwapResult SwapBuffers(PresentationCallback callback, FrameData data) override;
+    gfx::SwapResult SwapBuffers(PresentationCallback callback, gfx::FrameData data) override;
     gfx::Size GetSize() override;
     GLSurfaceFormat GetFormat() override;
 
diff --git a/src/core/ozone/gl_surface_wgl_qt.cpp b/src/core/ozone/gl_surface_wgl_qt.cpp
index 0788a04c14e..db4aed88461 100644
--- a/src/core/ozone/gl_surface_wgl_qt.cpp
+++ b/src/core/ozone/gl_surface_wgl_qt.cpp
@@ -20,10 +20,10 @@ GLSurfaceWGLQt::~GLSurfaceWGLQt()
     Destroy();
 }
 
-gl::GLDisplay *GLSurfaceWGLQt::InitializeOneOff(uint64_t system_device_id)
+gl::GLDisplay *GLSurfaceWGLQt::InitializeOneOff(gl::GpuPreference gpu_preference)
 {
     if (GLSurfaceWGL::InitializeOneOff())
-        return GLDisplayManagerWGL::GetInstance()->GetDisplay(GpuPreference::kDefault);
+        return GLDisplayManagerWGL::GetInstance()->GetDisplay(gpu_preference);
 
     return nullptr;
 }
diff --git a/src/core/ozone/gl_surface_wgl_qt.h b/src/core/ozone/gl_surface_wgl_qt.h
index 5b671ebd931..6c590e46c6d 100644
--- a/src/core/ozone/gl_surface_wgl_qt.h
+++ b/src/core/ozone/gl_surface_wgl_qt.h
@@ -16,7 +16,7 @@ class GLSurfaceWGLQt: public GLSurfaceQt {
 public:
     explicit GLSurfaceWGLQt(const gfx::Size& size);
 
-    static gl::GLDisplay *InitializeOneOff(uint64_t system_device_id);
+    static gl::GLDisplay *InitializeOneOff(gl::GpuPreference gpu_preference);
 
     bool Initialize(GLSurfaceFormat format) override;
     void Destroy() override;
diff --git a/src/core/ozone/platform_window_qt.cpp b/src/core/ozone/platform_window_qt.cpp
index fe8a715ce7e..4923f0f8884 100644
--- a/src/core/ozone/platform_window_qt.cpp
+++ b/src/core/ozone/platform_window_qt.cpp
@@ -3,7 +3,7 @@
 
 #if defined(USE_OZONE)
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "ozone/platform_window_qt.h"
 #include "ui/base/cursor/platform_cursor.h"
 #include "ui/events/ozone/events_ozone.h"
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index ca50b5af1e3..b44fb430092 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -53,6 +53,7 @@ static ProfileAdapter::PermissionType toQt(blink::PermissionType type)
     case blink::PermissionType::STORAGE_ACCESS_GRANT:
     case blink::PermissionType::LOCAL_FONTS:
     case blink::PermissionType::DISPLAY_CAPTURE:
+    case blink::PermissionType::TOP_LEVEL_STORAGE_ACCESS:
     case blink::PermissionType::NUM:
         LOG(INFO) << "Unexpected unsupported permission type: " << static_cast<int>(type);
         break;
diff --git a/src/core/permission_manager_qt.h b/src/core/permission_manager_qt.h
index 8778c538d5c..6cfeb874e4d 100644
--- a/src/core/permission_manager_qt.h
+++ b/src/core/permission_manager_qt.h
@@ -4,7 +4,7 @@
 #ifndef PERMISSION_MANAGER_QT_H
 #define PERMISSION_MANAGER_QT_H
 
-#include "base/callback.h"
+#include "base/functional/callback.h"
 #include "content/public/browser/permission_controller_delegate.h"
 
 #include "profile_adapter.h"
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index 2e92512001e..d6113ecd944 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -65,8 +65,6 @@ void OnDidGetDefaultPrintSettings(scoped_refptr<printing::PrintQueriesQueue> que
         // If user hasn't cancelled.
         if (printer_query->cookie() && printer_query->settings().dpi()) {
             queue->QueuePrinterQuery(std::move(printer_query));
-        } else {
-            printer_query->StopWorker();
         }
     }
 }
@@ -109,8 +107,6 @@ void OnDidUpdatePrintSettings(scoped_refptr<printing::PrintQueriesQueue> queue,
 
     if (printer_query->cookie() && printer_query->settings().dpi()) {
         queue->QueuePrinterQuery(std::move(printer_query));
-    } else {
-        printer_query->StopWorker();
     }
 }
 
@@ -132,8 +128,6 @@ void OnDidScriptedPrint(scoped_refptr<printing::PrintQueriesQueue> queue,
 
     if (has_dpi && has_valid_cookie) {
         queue->QueuePrinterQuery(std::move(printer_query));
-    } else {
-        printer_query->StopWorker();
     }
 }
 
@@ -319,10 +313,6 @@ void PrintViewManagerBaseQt::ScriptedPrint(printing::mojom::ScriptedPrintParamsP
                 base::BindOnce(&OnDidScriptedPrint, m_printerQueriesQueue, std::move(printer_query), std::move(callback_wrapper)));
 }
 
-void PrintViewManagerBaseQt::ShowInvalidPrinterSettingsError()
-{
-}
-
 // Note: In PrintViewManagerQt we always initiate printing with
 // printing::mojom::PrintRenderFrame::InitiatePrintPreview()
 // so m_printingRFH is never set and used at the moment.
@@ -580,11 +570,8 @@ void PrintViewManagerBaseQt::ReleasePrinterQuery()
     if (!printJobManager)
         return;
 
-    std::unique_ptr<printing::PrinterQuery> printerQuery;
-    printerQuery = m_printerQueriesQueue->PopPrinterQuery(cookie);
-    if (!printerQuery)
-        return;
-    printerQuery->StopWorker();
+    std::unique_ptr<printing::PrinterQuery> printerQuery =
+            m_printerQueriesQueue->PopPrinterQuery(cookie);
 }
 
 // Originally from print_preview_message_handler.cc:
@@ -594,9 +581,6 @@ void PrintViewManagerBaseQt::StopWorker(int documentCookie)
         return;
     std::unique_ptr<printing::PrinterQuery> printerQuery =
             m_printerQueriesQueue->PopPrinterQuery(documentCookie);
-    if (!printerQuery)
-        return;
-    printerQuery->StopWorker();
 }
 
 void PrintViewManagerBaseQt::UpdatePrintSettings(int32_t cookie, base::Value::Dict job_settings,
diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h
index fbd847f81b8..e8e59f8a5e4 100644
--- a/src/core/printing/print_view_manager_base_qt.h
+++ b/src/core/printing/print_view_manager_base_qt.h
@@ -48,7 +48,6 @@ class PrintViewManagerBaseQt : public printing::PrintManager
     void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
     void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr,
                        printing::mojom::PrintManagerHost::ScriptedPrintCallback) override;
-    void ShowInvalidPrinterSettingsError() override;
     void PrintingFailed(int32_t cookie,
                         printing::mojom::PrintFailureReason reason) override;
 
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 1b71744c999..4747ac21b0e 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -332,7 +332,7 @@ void ProfileAdapter::setHttpUserAgent(const QString &userAgent)
         if (web_contents->GetBrowserContext() == m_profile.data())
             web_contents->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(stdUserAgent), true);
 
-    m_profile->ForEachStoragePartition(
+    m_profile->ForEachLoadedStoragePartition(
                 base::BindRepeating([](const std::string &user_agent, content::StoragePartition *storage_partition) {
                     storage_partition->GetNetworkContext()->SetUserAgent(user_agent);
                 }, stdUserAgent));
@@ -474,7 +474,7 @@ const QList<QByteArray> ProfileAdapter::customUrlSchemes() const
 
 void ProfileAdapter::updateCustomUrlSchemeHandlers()
 {
-    m_profile->ForEachStoragePartition(
+    m_profile->ForEachLoadedStoragePartition(
         base::BindRepeating([](content::StoragePartition *storage_partition) {
             storage_partition->ResetURLLoaderFactories();
         }));
@@ -596,7 +596,7 @@ void ProfileAdapter::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
         }
     }
 
-    m_profile->ForEachStoragePartition(
+    m_profile->ForEachLoadedStoragePartition(
         base::BindRepeating([](std::string accept_language, content::StoragePartition *storage_partition) {
             storage_partition->GetNetworkContext()->SetAcceptLanguage(accept_language);
         }, http_accept_language));
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index c11d35c950e..822c923a26a 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -161,7 +161,7 @@ void ProfileIODataQt::resetNetworkContext()
 {
     Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
     setFullConfiguration();
-    m_profile->ForEachStoragePartition(
+    m_profile->ForEachLoadedStoragePartition(
             base::BindRepeating([](content::StoragePartition *storage) {
                 auto storage_impl = static_cast<content::StoragePartitionImpl *>(storage);
                 storage_impl->ResetURLLoaderFactories();
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 3d4e5bbc2cd..fcd684b4365 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -12,7 +12,6 @@
 #include "web_contents_adapter_client.h"
 #include "web_event_factory.h"
 
-#include "base/threading/thread_task_runner_handle.h"
 #include "components/viz/common/features.h"
 #include "components/viz/common/frame_sinks/begin_frame_source.h"
 #include "components/viz/common/surfaces/frame_sink_id_allocator.h"
@@ -47,7 +46,7 @@
 #endif
 
 #if defined(USE_AURA)
-#include "ui/wm/core/cursors_aura.h"
+#include "ui/wm/core/cursor_util.h"
 #include "ui/base/cursor/cursor_size.h"
 #endif
 
@@ -145,7 +144,7 @@ class FlingingCompositor : public ui::Compositor
 
 RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget)
     : content::RenderWidgetHostViewBase::RenderWidgetHostViewBase(widget)
-    , m_taskRunner(base::ThreadTaskRunnerHandle::Get())
+    , m_taskRunner(base::SingleThreadTaskRunner::GetCurrentDefault())
     , m_gestureProvider(QtGestureProviderConfig(), this)
     , m_frameSinkId(host()->GetFrameSinkId())
     , m_delegateClient(new RenderWidgetHostViewQtDelegateClient(this))
@@ -478,14 +477,13 @@ bool RenderWidgetHostViewQt::updateCursorFromResource(ui::mojom::CursorType type
     return true;
 }
 
-void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor)
+void RenderWidgetHostViewQt::UpdateCursor(const ui::Cursor &webCursor)
 {
     DisplayCursor(webCursor);
 }
 
-void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
+void RenderWidgetHostViewQt::DisplayCursor(const ui::Cursor &cursorInfo)
 {
-    const ui::Cursor &cursorInfo = webCursor.cursor();
     Qt::CursorShape shape = Qt::ArrowCursor;
     switch (cursorInfo.type()) {
     case ui::mojom::CursorType::kNull:
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 25fd201157d..d2bd8aaf7d2 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -77,8 +77,8 @@ class RenderWidgetHostViewQt
     blink::mojom::PointerLockResult LockMouse(bool) override;
     blink::mojom::PointerLockResult ChangeMouseLock(bool) override;
     void UnlockMouse() override;
-    void UpdateCursor(const content::WebCursor&) override;
-    void DisplayCursor(const content::WebCursor&) override;
+    void UpdateCursor(const ui::Cursor&) override;
+    void DisplayCursor(const ui::Cursor&) override;
     content::CursorManager *GetCursorManager() override;
     void SetIsLoading(bool) override;
     void ImeCancelComposition() override;
@@ -132,9 +132,8 @@ class RenderWidgetHostViewQt
     void SetWindowFrameInScreen(const gfx::Rect&) override { QT_NOT_YET_IMPLEMENTED }
 #endif // BUILDFLAG(IS_MAC)
     void NotifyHostAndDelegateOnWasShown(blink::mojom::RecordContentToVisibleTimeRequestPtr) override { QT_NOT_YET_IMPLEMENTED }
-    void RequestPresentationTimeFromHostOrDelegate(blink::mojom::RecordContentToVisibleTimeRequestPtr) override { QT_NOT_YET_IMPLEMENTED }
-    void CancelPresentationTimeRequestForHostAndDelegate() override { QT_NOT_YET_IMPLEMENTED }
-
+    void RequestSuccessfulPresentationTimeFromHostOrDelegate(blink::mojom::RecordContentToVisibleTimeRequestPtr) override {}
+    void CancelSuccessfulPresentationTimeRequestForHostAndDelegate() override {}
 
     // Overridden from ui::GestureProviderClient.
     void OnGestureEvent(const ui::GestureEventData& gesture) override;
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 5ec4a1935dd..6b3df4a2791 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -10,8 +10,8 @@
 #include "renderer/web_engine_page_render_frame.h"
 #include "web_engine_library_info.h"
 
+#include "base/task/sequenced_task_runner.h"
 #include "components/autofill/content/renderer/autofill_agent.h"
-#include "components/autofill/content/renderer/autofill_assistant_agent.h"
 #include "components/autofill/content/renderer/password_autofill_agent.h"
 #include "components/autofill/content/renderer/password_generation_agent.h"
 #include "components/cdm/renderer/external_clear_key_key_system_info.h"
@@ -131,12 +131,12 @@ void ContentRendererClientQt::RenderThreadStarted()
 void ContentRendererClientQt::ExposeInterfacesToBrowser(mojo::BinderMap* binders)
 {
     binders->Add<visitedlink::mojom::VisitedLinkNotificationSink>(
-                m_visitedLinkReader->GetBindCallback(), base::SequencedTaskRunnerHandle::Get());
+                m_visitedLinkReader->GetBindCallback(), base::SingleThreadTaskRunner::GetCurrentDefault());
 
     binders->Add<web_cache::mojom::WebCache>(
                 base::BindRepeating(&web_cache::WebCacheImpl::BindReceiver,
                                     base::Unretained(m_webCacheImpl.get())),
-                base::SequencedTaskRunnerHandle::Get());
+                base::SingleThreadTaskRunner::GetCurrentDefault());
 
 #if QT_CONFIG(webengine_spellchecker)
     binders->Add<spellcheck::mojom::SpellChecker>(
@@ -147,7 +147,7 @@ void ContentRendererClientQt::ExposeInterfacesToBrowser(mojo::BinderMap* binders
                                  client->InitSpellCheck();
                              client->m_spellCheck->BindReceiver(std::move(receiver));
                          }, this),
-                 base::SequencedTaskRunnerHandle::Get());
+                 base::SingleThreadTaskRunner::GetCurrentDefault());
 #endif
 
 #if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
@@ -157,7 +157,7 @@ void ContentRendererClientQt::ExposeInterfacesToBrowser(mojo::BinderMap* binders
                             mojo::PendingReceiver<chrome::mojom::WebRtcLoggingAgent> receiver) {
                                 client->GetWebRtcLoggingAgent()->AddReceiver(std::move(receiver));
                          }, this),
-                 base::SequencedTaskRunnerHandle::Get());
+                 base::SingleThreadTaskRunner::GetCurrentDefault());
 #endif
 }
 
@@ -195,8 +195,6 @@ void ContentRendererClientQt::RenderFrameCreated(content::RenderFrame *render_fr
     ExtensionsRendererClientQt::GetInstance()->RenderFrameCreated(render_frame, render_frame_observer->registry());
 #endif
 
-    autofill::AutofillAssistantAgent *autofill_assistant_agent =
-            new autofill::AutofillAssistantAgent(render_frame);
     autofill::PasswordAutofillAgent *password_autofill_agent =
             new autofill::PasswordAutofillAgent(render_frame, associated_interfaces);
     autofill::PasswordGenerationAgent *password_generation_agent =
@@ -204,7 +202,7 @@ void ContentRendererClientQt::RenderFrameCreated(content::RenderFrame *render_fr
                                                   associated_interfaces);
 
     new autofill::AutofillAgent(render_frame, password_autofill_agent, password_generation_agent,
-                                autofill_assistant_agent, associated_interfaces);
+                                associated_interfaces);
 }
 
 void ContentRendererClientQt::WebViewCreated(blink::WebView *web_view,
diff --git a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
index fd808f766b2..9b9d1bca855 100644
--- a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
+++ b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
@@ -31,8 +31,6 @@ class LoadablePluginPlaceholderQt final : public plugins::LoadablePluginPlacehol
 
     // content::LoadablePluginPlaceholder overrides.
     blink::WebPlugin* CreatePlugin() override;
-    void OnBlockedContent(content::RenderFrame::PeripheralContentStatus status,
-                          bool is_same_origin) override {}
 
     // WebViewPlugin::Delegate (via PluginPlaceholder) methods:
     v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) override;
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index ce942e0c817..eff304981c5 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -5,6 +5,7 @@
 
 #include "base/memory/weak_ptr.h"
 #include "base/strings/pattern.h"
+#include "base/task/single_thread_task_runner.h"
 #include "content/public/renderer/render_frame.h"
 #include "content/public/renderer/render_frame_observer.h"
 #include "extensions/common/url_pattern.h"
@@ -203,7 +204,7 @@ void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad
 
     m_runner.reset(new Runner(render_frame()->GetWebFrame(), m_userResourceController));
 
-    base::ThreadTaskRunnerHandle::Get()->PostTask(
+    base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
             FROM_HERE,
             base::BindOnce(&Runner::run, m_runner->AsWeakPtr(),
                            QtWebEngineCore::UserScriptData::DocumentElementCreation));
@@ -214,7 +215,7 @@ void UserResourceController::RenderFrameObserverHelper::DidDispatchDOMContentLoa
     // Don't run scripts if provisional load failed (DidFailProvisionalLoad
     // called instead of DidCommitProvisionalLoad).
     if (m_runner)
-        base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+        base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
                 FROM_HERE,
                 base::BindOnce(&Runner::run, m_runner->AsWeakPtr(),
                                QtWebEngineCore::UserScriptData::AfterLoad),
@@ -224,7 +225,7 @@ void UserResourceController::RenderFrameObserverHelper::DidDispatchDOMContentLoa
 void UserResourceController::RenderFrameObserverHelper::DidFinishLoad()
 {
     if (m_runner)
-        base::ThreadTaskRunnerHandle::Get()->PostTask(
+        base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
                 FROM_HERE,
                 base::BindOnce(&Runner::run, m_runner->AsWeakPtr(),
                                QtWebEngineCore::UserScriptData::AfterLoad));
diff --git a/src/core/tools/main.cpp b/src/core/tools/main.cpp
index 4b6c82997d6..a82947ddc35 100644
--- a/src/core/tools/main.cpp
+++ b/src/core/tools/main.cpp
@@ -111,7 +111,7 @@ inline bool VerifyWords(const convert_dict::DicReader::WordList& org_words,
         }
 
         base::span<const int> expectedAffixes(org_words[i].second);
-        base::span<const int> actualAffixes(affix_ids, affix_matches);
+        base::span<const int> actualAffixes(affix_ids, (size_t)affix_matches);
 
         if (!std::equal(expectedAffixes.begin(), expectedAffixes.end(),
                         actualAffixes.begin(), actualAffixes.end(),
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 6312103f57e..515e5d4816a 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -152,7 +152,7 @@ static QVariant fromJSValue(const base::Value *result)
         }
         break;
     }
-    case base::Value::Type::DICTIONARY:
+    case base::Value::Type::DICT:
     {
         if (const auto dict = result->GetIfDict()) {
             QVariantMap map;
@@ -304,6 +304,7 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
             toGurl(virtualUrl),
             content::Referrer(toGurl(referrerUrl), static_cast<network::mojom::ReferrerPolicy>(referrerPolicy)),
             absl::nullopt, // optional initiator_origin
+            absl::nullopt, // optional initiator_base_url
             // Use a transition type of reload so that we don't incorrectly
             // increase the typed count.
             ui::PAGE_TRANSITION_RELOAD,
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index a8020ae1cfd..f96b68b3405 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -745,12 +745,6 @@ void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool pr
         m_viewClient->windowCloseRejected();
 }
 
-void WebContentsDelegateQt::BeforeUnloadFired(bool proceed, const base::TimeTicks &proceed_time)
-{
-    Q_UNUSED(proceed);
-    Q_UNUSED(proceed_time);
-}
-
 bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost *, const GURL& security_origin, blink::mojom::MediaStreamType type)
 {
     switch (type) {
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 7f25f29d835..cce1578bed0 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -123,7 +123,6 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
     void DidStopLoading() override;
     void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code) override;
     void DidFinishLoad(content::RenderFrameHost *render_frame_host, const GURL &validated_url) override;
-    void BeforeUnloadFired(bool proceed, const base::TimeTicks& proceed_time) override;
     void ActivateContents(content::WebContents* contents) override;
     void ResourceLoadComplete(content::RenderFrameHost* render_frame_host,
                               const content::GlobalRequestID& request_id,
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index 15528b41d16..8754250e641 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -73,6 +73,7 @@ class WebContentsViewQt
     void FocusThroughTabTraversal(bool reverse) override;
     void OnCapturerCountChanged() override { QT_NOT_YET_IMPLEMENTED }
     void FullscreenStateChanged(bool) override { }
+    void UpdateWindowControlsOverlay(const gfx::Rect &) override { QT_NOT_YET_IMPLEMENTED }
 
 #if BUILDFLAG(IS_MAC)
     bool CloseTabAfterEventTrackingIfNeeded() override { QT_NOT_YET_IMPLEMENTED return false; }
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index f2b90ad9d2f..b4c4bdb6740 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -6,7 +6,7 @@
 #include <math.h>
 
 #include "base/base_switches.h"
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/power_monitor/power_monitor.h"
diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp
index f62e2074e28..ce39b198bdd 100644
--- a/src/core/web_engine_context_threads.cpp
+++ b/src/core/web_engine_context_threads.cpp
@@ -3,7 +3,7 @@
 
 #include "web_engine_context.h"
 
-#include "base/bind.h"
+#include "base/functional/bind.h"
 #include "base/task/thread_pool.h"
 #include "base/threading/platform_thread.h"
 #include "base/threading/thread_restrictions.h"
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 11adc8d19d4..40ddbdac77d 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -9,7 +9,6 @@
 
 #include "base/command_line.h"
 #include "chrome/common/chrome_switches.h"
-#include "content/browser/gpu/gpu_process_host.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/common/content_switches.h"
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index e3566145e8d..0144c5f5ac8 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -3,7 +3,7 @@
 
 cmake_minimum_required(VERSION 3.19)
 find_package(Ninja 1.7.2 REQUIRED)
-find_package(Nodejs 12 REQUIRED)
+find_package(Nodejs 14.19 REQUIRED)
 find_package(PkgConfig)
 if(PkgConfig_FOUND)
     create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in
index 71358756523..186fc422586 100644
--- a/src/pdf/configure/BUILD.root.gn.in
+++ b/src/pdf/configure/BUILD.root.gn.in
@@ -63,6 +63,7 @@ static_library("QtPdf") {
     libs = [
       "dloadhelper.lib",
       "winmm.lib",
+      "usp10.lib",
     ]
   }
   if (is_mingw) {
diff --git a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
index 8b80c1a5f04..667f923bbd2 100644
--- a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
+++ b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
@@ -38,6 +38,7 @@ private Q_SLOTS:
 
 tst_InspectorServer::tst_InspectorServer()
 {
+    qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--remote-allow-origins=*");
     qputenv("QTWEBENGINE_REMOTE_DEBUGGING", INSPECTOR_SERVER_PORT);
     QtWebEngineQuick::initialize();
     QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
diff --git a/tests/auto/widgets/qtbug_110287/BLACKLIST b/tests/auto/widgets/qtbug_110287/BLACKLIST
new file mode 100644
index 00000000000..1b99e150379
--- /dev/null
+++ b/tests/auto/widgets/qtbug_110287/BLACKLIST
@@ -0,0 +1,2 @@
+[getAddrInfo]
+b2qt arm
diff --git a/tools/scripts/take_snapshot.py b/tools/scripts/take_snapshot.py
index 41cd46b3c1c..735660e2aae 100755
--- a/tools/scripts/take_snapshot.py
+++ b/tools/scripts/take_snapshot.py
@@ -41,7 +41,6 @@ def isInChromiumBlacklist(file_path):
     if (file_path.startswith('android_webview')
         or file_path.startswith('apps/')
         or file_path.startswith('ash/')
-        or file_path.startswith('base/android')
         or file_path.startswith('buildtools/clang_format/script')
         or file_path.startswith('buildtools/third_party/libc++')
         or file_path.startswith('buildtools/third_party/libc++abi')
@@ -118,7 +117,10 @@ def isInChromiumBlacklist(file_path):
         or (file_path.startswith('net/data/')
           and '_unittest/' in file_path)
         or file_path.startswith('net/data/fuzzer_data/')
-        or file_path.startswith('remoting')
+        or (file_path.startswith('remoting')
+            and not file_path.endswith('VERSION')
+            and not file_path.endswith('branding_Chromium')
+            and not file_path.endswith('remove_spaces.py'))
         or file_path.startswith('rlz')
         or file_path.startswith('testing/android')
         or file_path.startswith('testing/buildbot')
@@ -155,6 +157,7 @@ def isInChromiumBlacklist(file_path):
             or file_path.startswith('third_party/chromite')
             or file_path.startswith('third_party/colorama')
             or file_path.startswith('third_party/depot_tools')
+            or file_path.startswith('third_party/devtools-frontend/src/third_party/image_diff')
             or (file_path.startswith('third_party/node/node_modules/')
               and not file_path.startswith('third_party/node/node_modules/@babel/')
               and not file_path.startswith('third_party/node/node_modules/@types/d3')
@@ -180,6 +183,7 @@ def isInChromiumBlacklist(file_path):
               and not file_path.startswith('third_party/node/node_modules/indent/')
               and not file_path.startswith('third_party/node/node_modules/is-core-module/')
               and not file_path.startswith('third_party/node/node_modules/is-windows/')
+              and not file_path.startswith('third_party/node/node_modules/@jridgewell/')
               and not file_path.startswith('third_party/node/node_modules/js-tokens/')
               and not file_path.startswith('third_party/node/node_modules/jsesc/')
               and not file_path.startswith('third_party/node/node_modules/jsonschema/')
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py
index 9dd60b4776b..b5e6f67b822 100644
--- a/tools/scripts/version_resolver.py
+++ b/tools/scripts/version_resolver.py
@@ -43,8 +43,8 @@ def get_recursedeps(self):
         return self.local_scope["recursedeps"]
 
 
-chromium_version = '108.0.5359.220'
-chromium_branch = '5359'
+chromium_version = '112.0.5615.213'
+chromium_branch = '5615'
 ninja_version = 'v1.8.2'
 
 json_url = 'http://omahaproxy.appspot.com/all.json'

From a5d2329d9b9a25ec2a2334dd5b6d61cb1f9d9373 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 30 Mar 2023 12:58:48 +0200
Subject: [PATCH 274/681] Support ANGLE to CGL painting

Support opengl backend for macOS without CGL support in Chromium.

Means we can remove a lot of hacks.

Change-Id: I3773fab24ab851bc471411fb31baf93727b9c110
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit eddd06014881ed28e09ee68fe5c68a0458d04866)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt                       |   5 -
 src/core/api/qtwebenginecoreglobal.cpp        | 118 +-----------------
 src/core/compositor/compositor.cpp            |   4 +-
 src/core/compositor/compositor.h              |   6 +-
 src/core/compositor/display_overrides.cpp     |   3 +
 .../compositor/display_skia_output_device.cpp |   2 +-
 .../compositor/display_skia_output_device.h   |   2 +-
 .../compositor/native_skia_output_device.cpp  |  39 +++++-
 .../compositor/native_skia_output_device.h    |   1 +
 .../native_skia_output_device_mac.mm          |  10 +-
 .../native_skia_output_device_mac2.mm         |  70 ++++++++++-
 src/core/macos_context_type_helper.h          |   7 --
 src/core/macos_context_type_helper.mm         |  18 ---
 src/core/ozone/gl_share_context_qt.cpp        |   8 +-
 ...nder_widget_host_view_qt_delegate_item.cpp |  12 +-
 ...render_widget_host_view_qt_delegate_item.h |   2 +-
 src/core/web_engine_context.cpp               |  15 +--
 17 files changed, 136 insertions(+), 186 deletions(-)
 delete mode 100644 src/core/macos_context_type_helper.h
 delete mode 100644 src/core/macos_context_type_helper.mm

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1cb016a5fb8..a3f6190f2ea 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -226,11 +226,6 @@ foreach(arch ${archs})
                 compositor/native_skia_output_device_mac2.mm
         )
 
-        extend_gn_target(${buildGn} CONDITION MACOS AND QT_FEATURE_opengl
-            SOURCES
-                macos_context_type_helper.mm macos_context_type_helper.h
-        )
-
         extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_pepper_plugins
             SOURCES
                 renderer/pepper/pepper_renderer_host_factory_qt.cpp renderer/pepper/pepper_renderer_host_factory_qt.h
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 82bd1c4d2e3..8a02b1bec61 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -6,12 +6,6 @@
 #include <QGuiApplication>
 #if QT_CONFIG(opengl)
 # include <QOpenGLContext>
-#ifdef Q_OS_MACOS
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#include <QOffscreenSurface>
-#include "macos_context_type_helper.h"
-#endif
 #endif
 #include <QThread>
 #include <QQuickWindow>
@@ -19,33 +13,15 @@
 
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 
-#if QT_CONFIG(opengl)
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
 QT_BEGIN_NAMESPACE
 Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
 Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
 QT_END_NAMESPACE
 #endif
 
-#if QT_CONFIG(opengl)
-#ifdef Q_OS_MACOS
-static bool needsOfflineRendererWorkaround()
-{
-    size_t hwmodelsize = 0;
-
-    if (sysctlbyname("hw.model", nullptr, &hwmodelsize, nullptr, 0) == -1)
-        return false;
-
-    char hwmodel[hwmodelsize];
-    if (sysctlbyname("hw.model", &hwmodel, &hwmodelsize, nullptr, 0) == -1)
-        return false;
-
-    return QString::fromLatin1(hwmodel) == QLatin1String("MacPro6,1");
-}
-#endif
-#endif
-
 namespace QtWebEngineCore {
-#if QT_CONFIG(opengl)
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
 static QOpenGLContext *shareContext;
 
 static void deleteShareContext()
@@ -64,13 +40,9 @@ static void deleteShareContext()
 
 Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
 {
-#if QT_CONFIG(opengl)
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
 #ifdef Q_OS_WIN32
     qputenv("QT_D3DCREATE_MULTITHREADED", "1");
-#endif
-#ifdef Q_OS_MACOS
-    if (needsOfflineRendererWorkaround())
-        qputenv("QT_MAC_PRO_WEBENGINE_WORKAROUND", "1");
 #endif
     // No need to override the shared context if QApplication already set one (e.g with Qt::AA_ShareOpenGLContexts).
     if (!qt_gl_global_share_context()) {
@@ -96,57 +68,6 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
         shareContext = new QOpenGLContext;
         QSurfaceFormat format = QSurfaceFormat::defaultFormat();
 
-#if defined(Q_OS_MACOS)
-        if (format == QSurfaceFormat()) {
-            QOpenGLContext testContext;
-
-            // Chromium turns off OpenGL for CoreProfiles with versions < 4.1
-            // The newest Mac that only supports 3.3 was released in Mid 2011,
-            // so it should be safe to request 4.1, but we still double check it
-            // works in order not to set an invalid default surface format.
-            format.setVersion(4, 1);
-            format.setProfile(QSurfaceFormat::CoreProfile);
-
-            testContext.setFormat(format);
-            if (testContext.create()) {
-                QOffscreenSurface surface;
-                surface.setFormat(format);
-                surface.create();
-
-                if (testContext.makeCurrent(&surface)) {
-                    // The Cocoa QPA integration allows sharing between OpenGL 3.2 and 4.1 contexts,
-                    // which means even though we requested a 4.1 context, if we only get a 3.2
-                    // context, it will still work an Chromium will not black list it.
-                    if (testContext.format().version() >= qMakePair(3, 2)
-                        && testContext.format().profile() == QSurfaceFormat::CoreProfile
-                        && !isCurrentContextSoftware()) {
-                        QSurfaceFormat::setDefaultFormat(format);
-                    } else {
-                        qWarning("The available OpenGL surface format was either not version 3.2 "
-                                 "or higher or not a Core Profile.\n"
-                                 "Chromium on macOS will fall back to software rendering in this "
-                                 "case.\n"
-                                 "Hardware acceleration and features such as WebGL will not be "
-                                 "available.");
-                        format = QSurfaceFormat::defaultFormat();
-                    }
-                    testContext.doneCurrent();
-                }
-                surface.destroy();
-            }
-        } else {
-            // The user explicitly requested a specific surface format that does not fit Chromium's
-            // requirements. Warn them about this.
-            if (format.version() < qMakePair(3, 2)
-                || format.profile() != QSurfaceFormat::CoreProfile) {
-                qWarning("An OpenGL surfcace format was requested that is either not version 3.2 "
-                         "or higher or a not Core Profile.\n"
-                         "Chromium on macOS will fall back to software rendering in this case.\n"
-                         "Hardware acceleration and features such as WebGL will not be available.");
-            }
-        }
-#endif
-
         shareContext->setFormat(format);
         shareContext->create();
         qAddPostRoutine(deleteShareContext);
@@ -156,22 +77,7 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
         app->setAttribute(Qt::AA_ShareOpenGLContexts);
     }
 
-#if defined(Q_OS_MACOS)
-    // Check that the default QSurfaceFormat OpenGL profile is compatible with the global OpenGL
-    // shared context profile, otherwise this could lead to a nasty crash.
-    QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format();
-    QSurfaceFormat defaultFormat = QSurfaceFormat::defaultFormat();
-
-    if (defaultFormat.profile() != sharedFormat.profile()
-        && defaultFormat.profile() == QSurfaceFormat::CoreProfile
-        && defaultFormat.version() >= qMakePair(3, 2)) {
-        qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile is not compatible with the "
-               "global shared context OpenGL profile. Please make sure you set a compatible "
-               "QSurfaceFormat before the QtGui application instance is created.");
-    }
-#endif
-
-#endif // QT_CONFIG(opengl)
+#endif // QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
 }
 
 bool closingDown()
@@ -196,21 +102,7 @@ sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterf
 #endif
 static void initialize()
 {
-#if QT_CONFIG(opengl)
-    if (QCoreApplication::instance()) {
-        // On Windows/ANGLE, calling QtWebEngineQuick::initialize from DllMain will result in a
-        // crash.
-        if (!qt_gl_global_share_context()
-            && !(QCoreApplication::testAttribute(Qt::AA_ShareOpenGLContexts)
-                 && QQuickWindow::graphicsApi() == QSGRendererInterface::OpenGLRhi)) {
-            qWarning("Qt WebEngine seems to be initialized from a plugin. Please "
-                     "set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute and "
-                     "QSGRendererInterface::OpenGLRhi using QQuickWindow::setGraphicsApi "
-                     "before constructing QGuiApplication.");
-        }
-        return;
-    }
-
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
     // QCoreApplication is not yet instantiated, ensuring the call will be deferred
     qAddPreRoutine(QtWebEngineCore::initialize);
     auto api = QQuickWindow::graphicsApi();
diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index c147f988b35..62dd8ebe4fa 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -157,12 +157,10 @@ bool Compositor::textureIsFlipped()
     return false;
 }
 
-#if QT_CONFIG(webengine_vulkan)
-void Compositor::releaseVulkanResources(QQuickWindow *)
+void Compositor::releaseResources(QQuickWindow *)
 {
     Q_UNREACHABLE();
 }
-#endif
 
 // static
 void Compositor::unlockBindings()
diff --git a/src/core/compositor/compositor.h b/src/core/compositor/compositor.h
index 018d965ba82..26e9463cde4 100644
--- a/src/core/compositor/compositor.h
+++ b/src/core/compositor/compositor.h
@@ -134,10 +134,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT Compositor
     // Is the texture produced upside down?
     virtual bool textureIsFlipped();
 
-#if QT_CONFIG(webengine_vulkan)
-    // (Vulkan) Release Vulkan resources created by Qt's Vulkan instance.
-    virtual void releaseVulkanResources(QQuickWindow *win);
-#endif
+    // Release resources created in texture()
+    virtual void releaseResources(QQuickWindow *win);
 
 protected:
     Compositor(Type type) : m_type(type) { }
diff --git a/src/core/compositor/display_overrides.cpp b/src/core/compositor/display_overrides.cpp
index 2baff5d2044..1ca245ff831 100644
--- a/src/core/compositor/display_overrides.cpp
+++ b/src/core/compositor/display_overrides.cpp
@@ -30,6 +30,9 @@ viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
                 shared_image_representation_factory_.get(),
                 GetDidSwapBuffersCompleteCallback());
     }
+#ifdef Q_OS_MACOS
+    qFatal("macOS only supports ANGLE");
+#endif
 #if QT_CONFIG(opengl)
     return std::make_unique<QtWebEngineCore::DisplaySkiaOutputDevice>(
             context_state_,
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index e04f5d5ecee..cb47a300f46 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -472,7 +472,7 @@ VkImageLayout DisplaySkiaOutputDevice::vkImageLayout()
     return m_frontBuffer->imageLayout();
 }
 
-void DisplaySkiaOutputDevice::releaseVulkanResources(QQuickWindow *win)
+void DisplaySkiaOutputDevice::releaseResources(QQuickWindow *win)
 {
     VkDevice *vkDevicePtr = static_cast<VkDevice *>(
             win->rendererInterface()->getResource(win, QSGRendererInterface::DeviceResource));
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index 07ea9dfeba1..55aa4a6d5e7 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -52,7 +52,7 @@ class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compo
 #if QT_CONFIG(webengine_vulkan)
     VkImage vkImage(QQuickWindow *win);
     VkImageLayout vkImageLayout();
-    void releaseVulkanResources(QQuickWindow *win) override;
+    void releaseResources(QQuickWindow *win) override;
 #endif
 
 private:
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
index df6747ab9d8..ef38feeccbf 100644
--- a/src/core/compositor/native_skia_output_device.cpp
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -156,6 +156,10 @@ class NativeSkiaOutputDevice::Buffer
             return;
 
         m_scopedOverlayReadAccess.reset();
+    }
+
+    void freeTexture()
+    {
         if (m_textureCleanup) {
             m_textureCleanup();
             m_textureCleanup = nullptr;
@@ -325,6 +329,8 @@ void NativeSkiaOutputDevice::swapFrame()
             m_readyWithTexture = true;
             m_frontBuffer->beginPresent();
         }
+        if (m_middleBuffer)
+            m_middleBuffer->freeTexture();
     }
 }
 
@@ -342,18 +348,41 @@ void NativeSkiaOutputDevice::releaseTexture()
     }
 }
 
-#ifdef Q_OS_MACOS
+void NativeSkiaOutputDevice::releaseResources(QQuickWindow *)
+{
+    if (m_frontBuffer)
+        m_frontBuffer->freeTexture();
+}
+
+#if defined(Q_OS_MACOS)
 QSGTexture *makeMetalTexture(QQuickWindow *win, IOSurfaceRef io_surface, uint io_surface_plane, int width, int height, uint32_t textureOptions);
+QSGTexture *makeCGLTexture(QQuickWindow *win, IOSurfaceRef io_surface, int width, int height, uint32_t textureOptions, uint32_t *heldTexture);
+void releaseGlTexture(uint32_t);
 
 QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
 {
     if (!m_frontBuffer || !m_readyWithTexture)
         return nullptr;
-    Q_ASSERT(QQuickWindow::graphicsApi() == QSGRendererInterface::Metal);
+    static const auto graphicsApi = QQuickWindow::graphicsApi();
 
-    return makeMetalTexture(win, m_frontBuffer->ioSurface().release(), /* plane */ 0,
-                            m_shape.characterization.width(), m_shape.characterization.height(),
-                            textureOptions);
+    QSGTexture *texture = nullptr;
+    gfx::ScopedIOSurface ioSurface = m_frontBuffer->ioSurface();
+    if (graphicsApi == QSGRendererInterface::Metal) {
+        texture = makeMetalTexture(win, ioSurface.release(), /* plane */ 0,
+                                   m_shape.characterization.width(), m_shape.characterization.height(),
+                                   textureOptions);
+#if QT_CONFIG(opengl)
+    } else if (graphicsApi == QSGRendererInterface::OpenGL) {
+        uint heldTexture;
+        texture = makeCGLTexture(win, ioSurface.release(),
+                                 m_shape.characterization.width(), m_shape.characterization.height(),
+                                 textureOptions, &heldTexture);
+        m_frontBuffer->m_textureCleanup = [heldTexture]() { releaseGlTexture(heldTexture); };
+#endif
+    }
+    if (!texture)
+        qFatal("Unknown QSG graphics backend");
+    return texture;
 }
 #elif defined(Q_OS_WIN)
 QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
diff --git a/src/core/compositor/native_skia_output_device.h b/src/core/compositor/native_skia_output_device.h
index 7b92ba6449d..6313007e4bd 100644
--- a/src/core/compositor/native_skia_output_device.h
+++ b/src/core/compositor/native_skia_output_device.h
@@ -56,6 +56,7 @@ class NativeSkiaOutputDevice final : public viz::SkiaOutputDevice, public Compos
     void swapFrame() override;
     void waitForTexture() override;
     void releaseTexture() override;
+    void releaseResources(QQuickWindow *win) override;
     QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions) override;
     bool textureIsFlipped() override;
     QSize size() override;
diff --git a/src/core/compositor/native_skia_output_device_mac.mm b/src/core/compositor/native_skia_output_device_mac.mm
index 51b11b13f85..beadeeb1d1c 100644
--- a/src/core/compositor/native_skia_output_device_mac.mm
+++ b/src/core/compositor/native_skia_output_device_mac.mm
@@ -1,10 +1,11 @@
 // Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
+#import <AppKit/AppKit.h>
 #import <IOSurface/IOSurface.h>
 #import <Metal/Metal.h>
 
-#include <QtCore/qtconfigmacros.h>
+#include <QtGui/qtguiglobal.h>
 
 QT_BEGIN_NAMESPACE
 class QSGTexture;
@@ -27,4 +28,11 @@
     return makeMetalTexture2(win, texture, width, height, textureOptions);
 }
 
+#if QT_CONFIG(opengl)
+CGLContextObj getCGLContext(NSOpenGLContext *context)
+{
+    return [context CGLContextObj];
+}
+#endif
+
 } // namespace
diff --git a/src/core/compositor/native_skia_output_device_mac2.mm b/src/core/compositor/native_skia_output_device_mac2.mm
index 645f26c617d..3778ee8a0ba 100644
--- a/src/core/compositor/native_skia_output_device_mac2.mm
+++ b/src/core/compositor/native_skia_output_device_mac2.mm
@@ -1,9 +1,17 @@
 // Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
-#include <qquickwindow.h>
-#include <qsgrendererinterface.h>
-#include <qsgtexture.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qsgrendererinterface.h>
+#include <QtQuick/qsgtexture.h>
+
+#if QT_CONFIG(opengl)
+#include <OpenGL/OpenGL.h>
+#include <QtGui/qopenglcontext.h>
+#include <QtGui/qopenglextrafunctions.h>
+#include <QtOpenGL/qopengltextureblitter.h>
+#include <QtOpenGL/qopenglframebufferobject.h>
+#endif
 
 @class MTLDevice;
 @protocol MTLTexture;
@@ -22,4 +30,60 @@ @protocol MTLTexture;
     return QNativeInterface::QSGMetalTexture::fromNative(mtlTexture, win, {width, height}, texOpts);
 }
 
+#if QT_CONFIG(opengl)
+CGLContextObj getCGLContext(NSOpenGLContext *context);
+
+void releaseGlTexture(uint32_t glTexture)
+{
+    auto *glContext = QOpenGLContext::currentContext();
+    if (!glContext)
+        return;
+    auto glFun = glContext->functions();
+    glFun->glDeleteTextures(1, &glTexture);
+}
+
+QSGTexture *makeCGLTexture(QQuickWindow *win, IOSurfaceRef io_surface, int width, int height, uint32_t textureOptions, uint32_t *heldTexture)
+{
+    auto glContext = QOpenGLContext::currentContext();
+    auto glFun = glContext->extraFunctions();
+    auto nscontext = glContext->nativeInterface<QNativeInterface::QCocoaGLContext>()->nativeContext();
+    CGLContextObj cglContext = getCGLContext(nscontext);
+
+    win->beginExternalCommands();
+    // Bind the IO surface to a texture
+    GLuint glTexture;
+    glFun->glGenTextures(1, &glTexture);
+    glFun->glBindTexture(GL_TEXTURE_RECTANGLE_ARB, glTexture);
+    CGLTexImageIOSurface2D(cglContext, GL_TEXTURE_RECTANGLE_ARB, GL_RGBA, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, io_surface, 0);
+    glFun->glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
+    glFun->glViewport(0, 0, width, height);
+
+    // The bound IO surface is a weird dynamic bind, so take a snapshot of it to a normal texture
+    {
+        QOpenGLFramebufferObject fbo(width, height, GL_TEXTURE_2D);
+        auto success = fbo.bind();
+        Q_ASSERT(success);
+
+        QOpenGLTextureBlitter blitter;
+        success = blitter.create();
+        Q_ASSERT(success);
+        glFun->glDisable(GL_BLEND);
+        glFun->glDisable(GL_SCISSOR_TEST);
+        blitter.bind(GL_TEXTURE_RECTANGLE_ARB);
+        blitter.blit(glTexture, {}, QOpenGLTextureBlitter::OriginBottomLeft);
+        blitter.release();
+        blitter.destroy();
+
+        glFun->glDeleteTextures(1, &glTexture);
+        glTexture = fbo.takeTexture();
+        fbo.release();
+    }
+    win->endExternalCommands();
+
+    *heldTexture = glTexture;
+    QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+    return QNativeInterface::QSGOpenGLTexture::fromNative(glTexture, win, {width, height}, texOpts);
+}
+#endif
+
 } // namespace
diff --git a/src/core/macos_context_type_helper.h b/src/core/macos_context_type_helper.h
deleted file mode 100644
index 1a2b0ff61ee..00000000000
--- a/src/core/macos_context_type_helper.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef MACOS_CONTEXT_TYPE_HELPER_H_
-#define MACOS_CONTEXT_TYPE_HELPER_H_
-bool isCurrentContextSoftware();
-void* cglContext(NSOpenGLContext*);
-#endif // MACOS_CONTEXT_TYPE_HELPER_H_
diff --git a/src/core/macos_context_type_helper.mm b/src/core/macos_context_type_helper.mm
deleted file mode 100644
index 9bdd360857e..00000000000
--- a/src/core/macos_context_type_helper.mm
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#import <Foundation/Foundation.h>
-#import <AppKit/AppKit.h>
-
-#include "macos_context_type_helper.h"
-
-bool isCurrentContextSoftware()
-{
-    int rendererID = 0;
-    [NSOpenGLContext.currentContext getValues:&rendererID forParameter:NSOpenGLContextParameterCurrentRendererID];
-    return (rendererID & kCGLRendererIDMatchingMask) == kCGLRendererGenericFloatID;
-}
-
-void* cglContext(NSOpenGLContext *nsOpenGLContext)
-{
-   return [nsOpenGLContext CGLContextObj];
-}
diff --git a/src/core/ozone/gl_share_context_qt.cpp b/src/core/ozone/gl_share_context_qt.cpp
index 35bd18f22de..b1c5e201f10 100644
--- a/src/core/ozone/gl_share_context_qt.cpp
+++ b/src/core/ozone/gl_share_context_qt.cpp
@@ -12,10 +12,6 @@
 #include <QtGui/qopenglcontext_platform.h>
 #include <QOpenGLContext>
 #include <QOpenGLExtraFunctions>
-
-#if defined(Q_OS_MACOS)
-#include "macos_context_type_helper.h"
-#endif // defined(Q_OS_MACOS)
 #endif // QT_CONFIG(opengl)
 
 namespace QtWebEngineCore {
@@ -25,9 +21,7 @@ QtShareGLContext::QtShareGLContext(QOpenGLContext *context)
 {
 #if QT_CONFIG(opengl)
 #if defined(Q_OS_MACOS)
-    auto *mac_ctx = context->nativeInterface<QNativeInterface::QCocoaGLContext>();
-    if (mac_ctx)
-        m_handle = cglContext(mac_ctx->nativeContext());
+    qFatal("macOS only support using ANGLE.");
 #endif
 #if defined(Q_OS_WIN)
     auto *win_ctx = context->nativeInterface<QNativeInterface::QWGLContext>();
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index 7e7b949fcb6..af19776b9d0 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -35,7 +35,7 @@ RenderWidgetHostViewQtDelegateItem::RenderWidgetHostViewQtDelegateItem(RenderWid
 
 RenderWidgetHostViewQtDelegateItem::~RenderWidgetHostViewQtDelegateItem()
 {
-    releaseVulkanResources();
+    releaseTextureResources();
     if (m_widgetDelegate) {
         m_widgetDelegate->Unbind();
         m_widgetDelegate->Destroy();
@@ -330,7 +330,7 @@ void RenderWidgetHostViewQtDelegateItem::itemChange(ItemChange change, const Ite
 #if QT_CONFIG(webengine_vulkan)
             m_windowConnections.append(
                     connect(value.window, &QQuickWindow::sceneGraphAboutToStop, this,
-                            &RenderWidgetHostViewQtDelegateItem::releaseVulkanResources,
+                            &RenderWidgetHostViewQtDelegateItem::releaseTextureResources,
                             Qt::DirectConnection));
 #endif
             if (!m_isPopup)
@@ -423,15 +423,13 @@ void RenderWidgetHostViewQtDelegateItem::onHide()
     m_client->forwardEvent(&event);
 }
 
-void RenderWidgetHostViewQtDelegateItem::releaseVulkanResources()
+void RenderWidgetHostViewQtDelegateItem::releaseTextureResources()
 {
-#if QT_CONFIG(webengine_vulkan)
     auto comp = compositor();
-    if (!comp || comp->type() != Compositor::Type::Vulkan)
+    if (!comp || (comp->type() != Compositor::Type::Vulkan && comp->type() != Compositor::Type::NativeBuffer))
         return;
 
-    comp->releaseVulkanResources(QQuickItem::window());
-#endif
+    comp->releaseResources(QQuickItem::window());
 }
 
 void RenderWidgetHostViewQtDelegateItem::adapterClientChanged(WebContentsAdapterClient *client)
diff --git a/src/core/render_widget_host_view_qt_delegate_item.h b/src/core/render_widget_host_view_qt_delegate_item.h
index 6af81fea38b..b1eb001fa6a 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.h
+++ b/src/core/render_widget_host_view_qt_delegate_item.h
@@ -102,7 +102,7 @@ private Q_SLOTS:
     void onBeforeRendering();
     void onAfterRendering();
     void onWindowPosChanged();
-    void releaseVulkanResources();
+    void releaseTextureResources();
     void onHide();
 
 private:
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index b4c4bdb6740..32ddded9b15 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -193,9 +193,9 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
         return glType;
 
 #if defined(Q_OS_MACOS)
-    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Metal)
-        return gl::kGLImplementationANGLEName;
-#elif defined(Q_OS_WIN)
+    return gl::kGLImplementationANGLEName;
+#else
+#if defined(Q_OS_WIN)
     if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11)
         return gl::kGLImplementationANGLEName;
 #endif
@@ -211,15 +211,10 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
     switch (sharedFormat.renderableType()) {
     case QSurfaceFormat::OpenGL:
         if (sharedFormat.profile() == QSurfaceFormat::CoreProfile) {
-#if defined(Q_OS_MACOS)
-            // Chromium supports core profile only on mac
-            glType = gl::kGLImplementationCoreProfileName;
-#else
             glType = gl::kGLImplementationDesktopName;
             qWarning("An OpenGL Core Profile was requested, but it is not supported "
                      "on the current platform. Falling back to a non-Core profile. "
                      "Note that this might cause rendering issues.");
-#endif
         } else {
             glType = gl::kGLImplementationDesktopName;
         }
@@ -235,6 +230,7 @@ static const char *getGLType(bool enableGLSoftwareRendering, bool disableGpu)
                  "https://bugreports.qt.io");
     }
     return glType;
+#endif // defined(Q_OS_MACOS)
 }
 #else
 static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu)
@@ -242,8 +238,7 @@ static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu
     if (disableGpu)
         return gl::kGLImplementationDisabledName;
 #if defined(Q_OS_MACOS)
-    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Metal)
-        return gl::kGLImplementationANGLEName;
+    return gl::kGLImplementationANGLEName;
 #elif defined(Q_OS_WIN)
     if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11)
         return gl::kGLImplementationANGLEName;

From 3f7d2709b77e7f42a9a6bfa11b97b26d13daf1f4 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 13 Jun 2023 14:59:36 +0200
Subject: [PATCH 275/681] Adjust pdfium gn args for 112-based

We do not override use skia in 3rparty, set it as gn arg.
Do not use ml inliner as does not work properly with our android
ndk.

Change-Id: Idefe6d94438b2403b90e00cf4343b0f882b60881
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ee272cba2b8465af4c1c3c7802ddd8fd183dbda1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt | 1 +
 src/pdf/CMakeLists.txt  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index a3f6190f2ea..e250be41c44 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -332,6 +332,7 @@ foreach(arch ${archs})
             chrome_pgo_phase=0
             optimize_webui=false
             strip_absolute_paths_from_debug_symbols=false
+            pdf_use_skia=true
             devtools_fast_bundle=false
             devtools_skip_typecheck=false
             use_static_angle=true
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 0144c5f5ac8..f51e461acf6 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -138,6 +138,7 @@ foreach(arch ${archs})
                 ozone_auto_platforms=false
                 use_gnome_keyring=false
                 enable_vr=false
+                use_ml_inliner=false
             )
             extend_gn_list(gnArgArg
                 ARGS use_system_icu

From 6f34a789c75a7f9e3f210aa6ef5b334b2cece38a Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 1 Jun 2023 12:21:29 +0200
Subject: [PATCH 276/681] Update Chromium to 112-based

Change-Id: I2e9196ad7d3f306a450edb5bc24cb25fbd7bca2e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b62fff064ce8558301939965bc0bd0c0e51323fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index a4a9769c67d..98addf86677 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit a4a9769c67d4d62570a2035945ea08db7cb8c127
+Subproject commit 98addf8667779d3de8a0484a7c31caa2c51743cd

From 8fd70f89aa7e35e3144878a199fae36606ff2e65 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 13 Jul 2023 20:06:42 +0000
Subject: [PATCH 277/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I0bba753abbf49ad20e3f5e35151f6aff63b7374b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 00df3c33d68..6a88cf788a6 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d21dc38b7ecb811dbed9b5fc41cb2528d863c554
+    ref: bf193bb6b0341fdfdc45a1d24311828e16ac5783
     required: true
   ../qtpositioning:
-    ref: 892cf1b644ccc50ef78c998115d175711bee1280
+    ref: e125f5032a92dadff380baeb628398a05eeacc96
     required: false
   ../qttools:
-    ref: 737a2065254f7232b92b1955c1069e166205b910
+    ref: 707fab0064fa64b11612470ecc779b3ce445c54e
     required: false
   ../qtwebchannel:
-    ref: a6e81f75e7f358789584f07f0c3146b03ecca9db
+    ref: a449a84fddae6aace24462aa27c89aec4697df71
     required: false

From f16e843b4196072d456519a57526bbba9887fb17 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 14 Jul 2023 18:55:48 +0000
Subject: [PATCH 278/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I30a49dd695d231970a62c78aad0f7cee448ff548
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 6a88cf788a6..0a0b925f5fe 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: bf193bb6b0341fdfdc45a1d24311828e16ac5783
+    ref: f197737d3b8dc36967051a0a7889396cf64f8194
     required: true
   ../qtpositioning:
-    ref: e125f5032a92dadff380baeb628398a05eeacc96
+    ref: dedcb7bd444b7dbf96ba1e2fde80a5183edc8f00
     required: false
   ../qttools:
-    ref: 707fab0064fa64b11612470ecc779b3ce445c54e
+    ref: a885bc91ebf0395f977350361758900f0276760f
     required: false
   ../qtwebchannel:
-    ref: a449a84fddae6aace24462aa27c89aec4697df71
+    ref: dffbd2c32e07b314208619297e9bf31680ced5e6
     required: false

From b605bed8212755275d3a276826583a0db7a08c33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 7 Jul 2023 17:15:17 +0200
Subject: [PATCH 279/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty 98addf86..45b6427d:
  * [Backport] Security bug 1418955
  * [Backport] CVE-2023-2465: Inappropriate implementation in CORS
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (8/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (7/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (6/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (5/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (4/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (3/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (2/8)
  * [Backport] CVE-2023-2462: Inappropriate implementation in Prompts (1/8)
  * [Backport] CVE-2023-2460: Insufficient validation of untrusted input in Extensions.
  * [Backport] CVE-2023-2459: Inappropriate implementation in Prompts

Fixes: QTBUG-115129
Change-Id: I55f1440f36a34db28edb9b1ebccf4a1cde17505c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ddccbe3fd41897531669f3b10d23a648239746b7)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 98addf86677..45b6427df15 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 98addf8667779d3de8a0484a7c31caa2c51743cd
+Subproject commit 45b6427df1509ba99a573e99a7cf4a42e0e21eeb

From 64279b0b0c78cd65f52117c4b21070939c853fe6 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 5 Jun 2023 10:20:39 +0200
Subject: [PATCH 280/681] Use 'ldir' coming from gn
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use 'ldir' response files directly and drop cmake workaround.

This also drops cmake FILE_PERMISSIONS which requires cmake 3.21

This change amends 75ae9b61967dc484e91f3dbee435045e63258c84

Task-number: QTBUG-105053
Task-number: QTBUG-111225
Fixes: QTBUG-115033
Change-Id: I8d59dca3eaa842939d71727f419f66e3589d6e0a
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 14568476ff83e03a57b3a02deaa4ebe14b28cd04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake               | 26 +++-----------------------
 src/core/configure/BUILD.root.gn.in |  4 ++--
 src/pdf/configure/BUILD.root.gn.in  |  2 +-
 3 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index eaa5a0f3d7d..7145c6192e5 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -445,6 +445,7 @@ function(add_linker_options target buildDir completeStatic)
     set(objects_rsp "${buildDir}/${ninjaTarget}_objects.rsp")
     set(archives_rsp "${buildDir}/${ninjaTarget}_archives.rsp")
     set(libs_rsp "${buildDir}/${ninjaTarget}_libs.rsp")
+    set(ldir_rsp "${buildDir}/${ninjaTarget}_ldir.rsp")
     set_target_properties(${cmakeTarget} PROPERTIES STATIC_LIBRARY_OPTIONS "@${objects_rsp}")
     if(LINUX OR ANDROID)
          get_gn_arch(cpu ${TEST_architecture_arch})
@@ -460,30 +461,9 @@ function(add_linker_options target buildDir completeStatic)
              )
          endif()
 
-         # we need only the '-L' flags from lflags.rsp, filter them
-         set(lflags_rsp "${buildDir}/${ninjaTarget}_lflags.rsp")
-         set(lflags_filtered_rsp "${buildDir}/${ninjaTarget}_lflags_filtered.rsp")
-         set(lflags_filter_script "${buildDir}/${ninjaTarget}_lflags_filter.cmake")
-         file(GENERATE OUTPUT ${lflags_filter_script}
-              CONTENT "file(STRINGS ${lflags_rsp} lflags)
-                       string(REGEX MATCHALL \"-L.*\" lflags_filtered \${lflags})
-                       file(WRITE ${lflags_filtered_rsp} \${lflags_filtered})"
-              FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
-         )
-         add_custom_command(
-            OUTPUT ${lflags_filtered_rsp}
-            COMMAND ${CMAKE_COMMAND} -P ${lflags_filter_script}
-            DEPENDS ${lflags_filter_script} ${lflags_rsp}
-         )
-         add_custom_target(
-            run_${cmakeTarget}_${config}_lflags_filter
-            DEPENDS ${lflags_filtered_rsp}
-         )
-         add_dependencies(${cmakeTarget} run_${cmakeTarget}_${config}_lflags_filter)
-
          # linker here options are just to prevent processing it by cmake
          target_link_libraries(${cmakeTarget} PRIVATE
-             "$<1:-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${lflags_filtered_rsp}> $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings>"
+             "$<1:-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${ldir_rsp}> $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings>"
          )
     endif()
     if(MACOS)
@@ -1245,7 +1225,7 @@ function(add_gn_command)
     file(WRITE ${gnArgArgFile} ${arg_GN_ARGS})
 
     foreach(ninjaTarget ${arg_NINJA_TARGETS})
-        list(APPEND output ${ninjaTarget}_objects.rsp ${ninjaTarget}_archives.rsp ${ninjaTarget}_libs.rsp ${ninjaTarget}_lflags.rsp)
+        list(APPEND output ${ninjaTarget}_objects.rsp ${ninjaTarget}_archives.rsp ${ninjaTarget}_libs.rsp ${ninjaTarget}_ldir.rsp)
     endforeach()
     list(TRANSFORM output PREPEND "${arg_BUILDDIR}/")
 
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index b60651a6269..7b61ff4ef0f 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -97,7 +97,7 @@ config("cpp20_config") {
 }
 
 shared_library("QtWebEngineCore") {
-  rsp_types = [ "objects", "archives", "libs", "lflags"]
+  rsp_types = [ "objects", "archives", "libs", "ldir"]
   configs += [
     ":cpp20_config",
     ":QtWebEngineCore_config",
@@ -714,7 +714,7 @@ if (enable_extensions) {
 
 if (enable_spellcheck) {
   shared_library("convert_dict") {
-    rsp_types = [ "objects", "archives", "libs", "lflags" ]
+    rsp_types = [ "objects", "archives", "libs", "ldir" ]
     configs += [ "//build/config/compiler:wexit_time_destructors" ]
     deps = [
       "//chrome/tools/convert_dict:lib",
diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in
index 186fc422586..44481923d1c 100644
--- a/src/pdf/configure/BUILD.root.gn.in
+++ b/src/pdf/configure/BUILD.root.gn.in
@@ -51,7 +51,7 @@ config("cpp17_config") {
 
 static_library("QtPdf") {
   complete_static_lib = true
-  rsp_types = [ "objects", "archives", "libs", "lflags" ]
+  rsp_types = [ "objects", "archives", "libs", "ldir" ]
   configs += [
     ":cpp17_config",
     ":QtPdf_config"

From 87f35f2de45f966b8cbd66b5b74ab15f6f914edf Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 7 Jul 2023 15:59:16 +0200
Subject: [PATCH 281/681] Add mingw-llvm builds support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Task-number: QTBUG-111362
Change-Id: Ieefb38308fe9d046b9f5cac7c1a18ef7f88227ba
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit cf2d557193acf3d9cf4986aeaef73b5cbbc362ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake       | 3 ++-
 src/gn/CMakeLists.txt | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index c41cd34a5d3..d6ec021db24 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -605,7 +605,8 @@ add_check_for_support(
        (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
        (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR
        (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
-       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL GNU)
+       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
+       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
    MESSAGE
        "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )
diff --git a/src/gn/CMakeLists.txt b/src/gn/CMakeLists.txt
index 6f73e29c7b7..60d4451f5e5 100644
--- a/src/gn/CMakeLists.txt
+++ b/src/gn/CMakeLists.txt
@@ -26,7 +26,7 @@ find_package(Ninja 1.7.2 REQUIRED)
 
 if(WIN32)
     set(GN_EXECUTABLE gn.exe)
-    if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MINGW)
         # Use lld-link instead of clang-cl.
         set(GN_LINKER ${CMAKE_LINKER})
     endif()

From 0125d2510c4823a662023f5d0d9f87b4c1223f18 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 11 Jul 2023 14:42:57 +0200
Subject: [PATCH 282/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty 45b6427d..dd25f259:
* Fix linker warnings for gn
* [Backport] Security bug 1447430
* [Backport] CVE-2023-3420: Type Confusion in V8 (2/2)
* [Backport] CVE-2023-3420: Type Confusion in V8 (1/2)
* [Backport] Security bug 1454860
* [Backport] CVE-2023-3422: Use after free in Guest View
* [Backport] CVE-2023-3421: Use after free in Media
* [Backport] CVE-2023-3217: Use after free in WebXR (2/2)
* [Backport] CVE-2023-3217: Use after free in WebXR (1/2)
* [Backport] CVE-2023-3216: Type Confusion in V8
* [Backport] CVE-2023-3079: Type Confusion in V8
* [Backport] Security bug 1444195
* [Backport] Security bug 1428743
* [Backport] CVE-2023-2938: Inappropriate implementation in Picture In Picture
* [Backport] CVE-2023-2937: Inappropriate implementation in Picture In Picture
* [Backport] CVE-2023-2936: Type Confusion in V8
* [Backport] CVE-2023-2935: Type Confusion in V8
* [Backport] CVE-2023-2934: Out of bounds memory access in Mojo
* [Backport] CVE-2023-2933: Use after free in PDF
* [Backport] CVE-2023-2932: Use after free in PDF
* [Backport] CVE-2023-2931: Use after free in PDF
* [Backport] CVE-2023-2930: Use after free in Extensions
* [Backport] CVE-2023-2929: Out of bounds write in Swiftshader
* Fix warnings for gn
* Support mingw-llvm builds
* Add ldir flags to gn rsp writer
* Minor. Fix crashes of gn_unittest
* Merge "Merge remote-tracking branch 'origin/upstream-master' into HEAD" into 112-based
* Merge remote-tracking branch 'origin/upstream-master' into HEAD
* Update GN to 112.0.5615.213

Change-Id: I59041390d0842634d480f400e1b3f83cd83a06c1
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 787a1db4e83de3c028502b95e1560a5d48a7a78e)
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 45b6427df15..dd25f25955c 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 45b6427df1509ba99a573e99a7cf4a42e0e21eeb
+Subproject commit dd25f25955c8a1701c322846c3ba6fefe0f7fb62

From b3ab75698d2e8cec7423f7370d4fa9707971a7c3 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 17 Jul 2023 17:16:43 +0000
Subject: [PATCH 283/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I710c6d2c3a8c2b7f9070ea9b3c6fbdbc8bb684af
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0a0b925f5fe..f203dc3366f 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f197737d3b8dc36967051a0a7889396cf64f8194
+    ref: f6fd4107d4435568d0027839941f347af1e1e47f
     required: true
   ../qtpositioning:
-    ref: dedcb7bd444b7dbf96ba1e2fde80a5183edc8f00
+    ref: d1b6953e3f8d1496df532d859b1a1fc7fdc5a009
     required: false
   ../qttools:
-    ref: a885bc91ebf0395f977350361758900f0276760f
+    ref: 1909f6d4ee9f259afeb10ac05dcdae26441a4b79
     required: false
   ../qtwebchannel:
-    ref: dffbd2c32e07b314208619297e9bf31680ced5e6
+    ref: 3c296df9b878c73825d16278d67f6d3c2cbd9524
     required: false

From 7edf6d57bc66ae5e2ede2f7d3836264f26151469 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 21 Jul 2023 16:45:19 +0000
Subject: [PATCH 284/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I9a78f50fc15304e1cf7b405a94b7ad7a33fc5539
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0e0663d4c56..abfe4ef3143 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 52647cdc485534eec5387fb816f187046fed45b4
+    ref: f89375e58d16f5439270db66a9906930725ad155
     required: true
   ../qtpositioning:
-    ref: df9deada2d5dd259ee32572423d7a8f7529dc079
+    ref: 6cda4623357366016e3b3c61c5703e4ba8e749a6
     required: false
   ../qttools:
-    ref: 6826785b101281fbafc69d49c7bfadf463609a57
+    ref: 341ac81dc6927b30a3fb941de642a9ef86018644
     required: false
   ../qtwebchannel:
-    ref: 87976cfbacf70d5349211278c400e90bd2d6e113
+    ref: ce6c057a4ae069d80afdb8ffd7eb4147dc0b3a88
     required: false

From 95673ada2553936debd4bdc9bff4fad1569cda81 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 26 Jul 2023 14:11:32 +0000
Subject: [PATCH 285/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I9ffe2502909d28b87537e5c052d35d31dab31c81
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index abfe4ef3143..64f5bb7d1ec 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f89375e58d16f5439270db66a9906930725ad155
+    ref: 3b6a51f53cd07e4fd8bc6e9ea414d099ca91314f
     required: true
   ../qtpositioning:
-    ref: 6cda4623357366016e3b3c61c5703e4ba8e749a6
+    ref: fa400cfc3d2fdc598f19a447a690c6c7cf6d4a63
     required: false
   ../qttools:
-    ref: 341ac81dc6927b30a3fb941de642a9ef86018644
+    ref: 1bfb469e614e2f35870a60fcdd934c6f893666a1
     required: false
   ../qtwebchannel:
-    ref: ce6c057a4ae069d80afdb8ffd7eb4147dc0b3a88
+    ref: fab8735e499ec7fab5092aa6991aa9988c391207
     required: false

From 25150a395917ff8584923c468a269bbb684302bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 27 Jun 2023 20:16:54 +0200
Subject: [PATCH 286/681] Fix geolocation permissions to use new Qt Permissions
 API

QtPositioningHelper now uses the Qt Permissions API. Also fixup the
examples Simple Browser, Quick Nano Browser and Maps to use the right
key on macOS and sign the application as part of the build process

Moves the Geopermission auto tests to manual tests for webenginequick
and webenginewidgets on macOS.

Fixes: QTBUG-114939
Change-Id: Id6771889f20c866d2fcdbb477dbbb7da30367043
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 3106a9ab7897cb3de9c640a7699d06e3f02a295d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../quicknanobrowser/CMakeLists.txt           | 15 ++++-
 .../quicknanobrowser/Info.cmake.macos.plist   | 32 ++++++++++
 examples/webenginewidgets/maps/CMakeLists.txt | 15 ++++-
 .../maps/Info.cmake.macos.plist               | 33 ++++++++++
 .../simplebrowser/CMakeLists.txt              | 13 ++++
 .../simplebrowser/Info.cmake.macos.plist      | 32 ++++++++++
 src/core/location_provider_qt.cpp             | 39 +++++++++++-
 tests/auto/quick/qmltests/CMakeLists.txt      |  7 ++-
 .../qwebenginepage/tst_qwebenginepage.cpp     |  6 +-
 tests/manual/quick/CMakeLists.txt             |  1 +
 .../manual/quick/geopermission/CMakeLists.txt | 63 +++++++++++++++++++
 tests/manual/quick/geopermission/Info.plist   | 32 ++++++++++
 .../quick/geopermission/geolocation.html      | 32 ++++++++++
 tests/manual/quick/geopermission/main.cpp     | 39 ++++++++++++
 .../quick/geopermission/tst_geopermission.qml | 28 +++++++++
 tests/manual/widgets/CMakeLists.txt           |  1 +
 .../manual/widgets/geolocation/CMakeLists.txt | 55 ++++++++++++++++
 tests/manual/widgets/geolocation/Info.plist   | 32 ++++++++++
 .../widgets/geolocation/geolocation.html      | 32 ++++++++++
 tests/manual/widgets/geolocation/main.cpp     | 51 +++++++++++++++
 20 files changed, 552 insertions(+), 6 deletions(-)
 create mode 100644 examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
 create mode 100644 examples/webenginewidgets/maps/Info.cmake.macos.plist
 create mode 100644 examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
 create mode 100644 tests/manual/quick/geopermission/CMakeLists.txt
 create mode 100644 tests/manual/quick/geopermission/Info.plist
 create mode 100644 tests/manual/quick/geopermission/geolocation.html
 create mode 100644 tests/manual/quick/geopermission/main.cpp
 create mode 100644 tests/manual/quick/geopermission/tst_geopermission.qml
 create mode 100644 tests/manual/widgets/geolocation/CMakeLists.txt
 create mode 100644 tests/manual/widgets/geolocation/Info.plist
 create mode 100644 tests/manual/widgets/geolocation/geolocation.html
 create mode 100644 tests/manual/widgets/geolocation/main.cpp

diff --git a/examples/webenginequick/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
index c1f0080bbfe..10daece4c9c 100644
--- a/examples/webenginequick/quicknanobrowser/CMakeLists.txt
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
 cmake_minimum_required(VERSION 3.16)
@@ -29,6 +29,7 @@ endif()
 set_target_properties(quicknanobrowser PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginequick.quicknanobrowser"
 )
 
 target_link_libraries(quicknanobrowser PUBLIC
@@ -84,6 +85,18 @@ if(TARGET Qt::Widgets)
     )
 endif()
 
+if (APPLE)
+    set_target_properties(quicknanobrowser PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET quicknanobrowser
+            POST_BUILD COMMAND codesign -s - quicknanobrowser.app)
+    endif()
+endif()
+
 install(TARGETS quicknanobrowser
     RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
     BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
new file mode 100644
index 00000000000..8aa89c9eaad
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>Quick Nanobrowser would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/examples/webenginewidgets/maps/CMakeLists.txt b/examples/webenginewidgets/maps/CMakeLists.txt
index f6e6b94ea42..524892957ac 100644
--- a/examples/webenginewidgets/maps/CMakeLists.txt
+++ b/examples/webenginewidgets/maps/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
 cmake_minimum_required(VERSION 3.16)
@@ -22,6 +22,7 @@ qt_add_executable(maps
 set_target_properties(maps PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.maps"
 )
 
 target_link_libraries(maps PUBLIC
@@ -30,6 +31,18 @@ target_link_libraries(maps PUBLIC
     Qt::WebEngineWidgets
 )
 
+if (APPLE)
+    set_target_properties(maps PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET maps
+            POST_BUILD COMMAND codesign -s - maps.app)
+    endif()
+endif()
+
 install(TARGETS maps
     RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
     BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webenginewidgets/maps/Info.cmake.macos.plist b/examples/webenginewidgets/maps/Info.cmake.macos.plist
new file mode 100644
index 00000000000..82336b25ad3
--- /dev/null
+++ b/examples/webenginewidgets/maps/Info.cmake.macos.plist
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>The maps demo would like to access your location for demo purposes.</string>
+
+</dict>
+</plist>
diff --git a/examples/webenginewidgets/simplebrowser/CMakeLists.txt b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
index cb0769e77ca..0897cbeab4d 100644
--- a/examples/webenginewidgets/simplebrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
@@ -39,6 +39,7 @@ endif()
 set_target_properties(simplebrowser PROPERTIES
     WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.simplebrowser"
 )
 
 target_link_libraries(simplebrowser PUBLIC
@@ -82,6 +83,18 @@ qt_add_resources(simplebrowser "simplebrowser1"
         ${simplebrowser1_resource_files}
 )
 
+if (APPLE)
+    set_target_properties(simplebrowser PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET simplebrowser
+            POST_BUILD COMMAND codesign -s - simplebrowser.app)
+    endif()
+endif()
+
 install(TARGETS simplebrowser
     RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
     BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
new file mode 100644
index 00000000000..76f74771993
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>Simple Browser would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp
index cb0565f629c..8952c7c6953 100644
--- a/src/core/location_provider_qt.cpp
+++ b/src/core/location_provider_qt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
 #include "location_provider_qt.h"
@@ -12,6 +12,10 @@
 #include <QtCore/QThread>
 #include <QtPositioning/QGeoPositionInfoSource>
 
+#if QT_CONFIG(permissions)
+#include <QtCore/qpermissions.h>
+#endif
+
 #include "base/functional/bind.h"
 #include "base/memory/weak_ptr.h"
 #include "content/public/browser/browser_thread.h"
@@ -37,6 +41,7 @@ private Q_SLOTS:
     void error(QGeoPositionInfoSource::Error positioningError);
 
 private:
+    void startImpl(bool highAccuracy);
     LocationProviderQt *m_locationProvider;
     QGeoPositionInfoSource *m_positionInfoSource;
     base::WeakPtrFactory<LocationProviderQt> m_locationProviderFactory;
@@ -66,6 +71,38 @@ static bool isHighAccuracySource(const QGeoPositionInfoSource *source)
 void QtPositioningHelper::start(bool highAccuracy)
 {
     DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+    // New Qt permissions API from 6.5.0
+#if QT_CONFIG(permissions)
+    QLocationPermission locationPermission;
+    locationPermission.setAvailability(QLocationPermission::WhenInUse);
+
+    QLocationPermission::Accuracy accuracy = highAccuracy ? QLocationPermission::Precise
+                                                          : QLocationPermission::Approximate;
+    locationPermission.setAccuracy(accuracy);
+
+    switch (qApp->checkPermission(locationPermission)) {
+    case Qt::PermissionStatus::Undetermined:
+        qApp->requestPermission(locationPermission, this,
+                    [this, &highAccuracy](const QPermission &permission) {
+                      if (permission.status() == Qt::PermissionStatus::Granted)
+                          this->startImpl(highAccuracy);
+                    });
+
+        return;
+    case Qt::PermissionStatus::Denied:
+        qWarning("Failed to initialize location provider: The user does not have the right "
+                 "permissions or has denied the permission request.");
+        return;
+    case Qt::PermissionStatus::Granted:
+        break; // Proceed
+    }
+#endif
+    startImpl(highAccuracy);
+}
+
+void QtPositioningHelper::startImpl(bool highAccuracy){
+    DCHECK_CURRENTLY_ON(BrowserThread::UI);
     if (!m_positionInfoSource)
         m_positionInfoSource = QGeoPositionInfoSource::createDefaultSource(this);
     if (!m_positionInfoSource) {
diff --git a/tests/auto/quick/qmltests/CMakeLists.txt b/tests/auto/quick/qmltests/CMakeLists.txt
index 6301e5ab6d2..daae6d60dcd 100644
--- a/tests/auto/quick/qmltests/CMakeLists.txt
+++ b/tests/auto/quick/qmltests/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
 include(../../httpserver/httpserver.cmake)
@@ -33,7 +33,6 @@ set(testList
     tst_findText.qml
     tst_focusOnNavigation.qml
     tst_fullScreenRequest.qml
-    tst_geopermission.qml
     tst_getUserMedia.qml
     tst_inputMethod.qml
     tst_inputTextDirection.qml
@@ -72,6 +71,10 @@ if(QT_FEATURE_ssl)
     list(APPEND testList tst_certificateError.qml)
 endif()
 
+if (NOT APPLE)
+   list(APPEND testList tst_geopermission.qml)
+endif()
+
 set(content "")
 foreach(test ${testList})
    set(contents "${contents}${CMAKE_CURRENT_LIST_DIR}/data/${test}\n")
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 43d29d12a4c..c9bcb11bdb1 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 The Qt Company Ltd.
+    Copyright (C) 2023 The Qt Company Ltd.
     Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
     Copyright (C) 2010 Holger Hans Peter Freyther
 
@@ -116,8 +116,10 @@ private Q_SLOTS:
     void acceptNavigationRequest();
     void acceptNavigationRequestNavigationType();
     void acceptNavigationRequestRelativeToNothing();
+#ifndef Q_OS_MACOS
     void geolocationRequestJS_data();
     void geolocationRequestJS();
+#endif
     void loadFinished();
     void actionStates();
     void pasteImage();
@@ -451,6 +453,7 @@ public Q_SLOTS:
     bool m_allowGeolocation;
 };
 
+#ifndef Q_OS_MACOS
 void tst_QWebEnginePage::geolocationRequestJS_data()
 {
     QTest::addColumn<bool>("allowed");
@@ -490,6 +493,7 @@ void tst_QWebEnginePage::geolocationRequestJS()
         QEXPECT_FAIL("", "No location service available.", Continue);
     QCOMPARE(result, errorCode);
 }
+#endif
 
 void tst_QWebEnginePage::loadFinished()
 {
diff --git a/tests/manual/quick/CMakeLists.txt b/tests/manual/quick/CMakeLists.txt
index 0562237b4d0..d6c4b88a984 100644
--- a/tests/manual/quick/CMakeLists.txt
+++ b/tests/manual/quick/CMakeLists.txt
@@ -1 +1,2 @@
 add_subdirectory(touchbrowser)
+add_subdirectory(geopermission)
diff --git a/tests/manual/quick/geopermission/CMakeLists.txt b/tests/manual/quick/geopermission/CMakeLists.txt
new file mode 100644
index 00000000000..088f248e1ac
--- /dev/null
+++ b/tests/manual/quick/geopermission/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+    cmake_minimum_required(VERSION 3.16)
+    project(tst_geopermission LANGUAGES CXX)
+    find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(tst_geopermission
+    SOURCES
+        main.cpp
+    LIBRARIES
+        Qt::Core
+        Qt::Gui
+        Qt::Qml
+        Qt::Quick
+        Qt::WebEngineQuick
+)
+
+if(WIN32)
+    set_property(
+        TARGET tst_geopermission
+        APPEND PROPERTY
+            SOURCES tst_geopermission.exe.manifest)
+endif()
+
+set_target_properties(tst_geopermission PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.dev.webenginequick.tst_geopermission"
+)
+
+# Resources:
+set(resources_resource_files
+    "tst_geopermission.qml"
+    "geolocation.html"
+)
+
+qt_add_resources(tst_geopermission "resources"
+    PREFIX
+        "/"
+    FILES
+        ${resources_resource_files}
+)
+
+foreach(permission_plugin IN LISTS QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE_permissions)
+    set(permission_plugin "${QT_CMAKE_EXPORT_NAMESPACE}::${permission_plugin}")
+        qt6_import_plugins(tst_geopermission INCLUDE ${permission_plugin})
+endforeach()
+
+if (APPLE)
+    set_target_properties(tst_geopermission PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET tst_geopermission
+            POST_BUILD COMMAND codesign -s - tst_geopermission.app)
+    endif()
+endif()
+
diff --git a/tests/manual/quick/geopermission/Info.plist b/tests/manual/quick/geopermission/Info.plist
new file mode 100644
index 00000000000..9853e190081
--- /dev/null
+++ b/tests/manual/quick/geopermission/Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>Geolocation test would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/tests/manual/quick/geopermission/geolocation.html b/tests/manual/quick/geopermission/geolocation.html
new file mode 100644
index 00000000000..e8c54bc5847
--- /dev/null
+++ b/tests/manual/quick/geopermission/geolocation.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<title>Geolocation Permission API Test</title>
+<script>
+
+var errorMessage;
+var handled = false;
+
+function successHandler(location) {
+    var message = document.getElementById("message");
+    message.innerHTML = "Latitude: " + location.coords.latitude +
+    "<br>Longitude: " + location.coords.longitude;
+
+    errorMessage = "";
+    handled = true;
+}
+
+function errorHandler(error) {
+    errorMessage = error.message;
+    handled = true;
+}
+
+<!-- One shot example -->
+navigator.geolocation.getCurrentPosition(successHandler, errorHandler);
+
+</script>
+</head>
+<body>
+<div id="message">Location unknown</div>
+</body>
+</html>
+
diff --git a/tests/manual/quick/geopermission/main.cpp b/tests/manual/quick/geopermission/main.cpp
new file mode 100644
index 00000000000..e0ff6f3e7f3
--- /dev/null
+++ b/tests/manual/quick/geopermission/main.cpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+#include <QtQml/QQmlApplicationEngine>
+#include <QtQml/QQmlContext>
+#include <QQuickView>
+
+#include <QtGui/QGuiApplication>
+
+#include <QtCore/QCommandLineParser>
+#include <QtCore/QCommandLineOption>
+#include <QtCore/QLoggingCategory>
+
+int main(int argc, char **argv)
+{
+    QCoreApplication::setApplicationName("Geopermission test");
+    QCoreApplication::setOrganizationName("QtProject");
+
+    QtWebEngineQuick::initialize();
+
+    QGuiApplication app(argc, argv);
+
+    QQuickView view;
+
+    view.setTitle("Touch Browser");
+    view.setFlags(Qt::Window | Qt::WindowTitleHint);
+    view.setResizeMode(QQuickView::SizeRootObjectToView);
+    view.setSource(QUrl("qrc:/tst_geopermission.qml"));
+
+    QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+
+    view.show();
+    if (view.size().isEmpty())
+        view.setGeometry(0, 0, 800, 600);
+
+    return app.exec();
+}
diff --git a/tests/manual/quick/geopermission/tst_geopermission.qml b/tests/manual/quick/geopermission/tst_geopermission.qml
new file mode 100644
index 00000000000..36317c176ae
--- /dev/null
+++ b/tests/manual/quick/geopermission/tst_geopermission.qml
@@ -0,0 +1,28 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+WebEngineView {
+    id: webEngineView
+    width: 200
+    height: 200
+    url: Qt.resolvedUrl("qrc:/geolocation.html")
+    property bool deniedGeolocation: false
+    property bool geoPermissionRequested: false
+
+    onFeaturePermissionRequested: function(securityOrigin, feature) {
+        if (feature === WebEngineView.Geolocation) {
+            geoPermissionRequested = true
+            if (deniedGeolocation) {
+                webEngineView.grantFeaturePermission(securityOrigin, feature, false)
+            }
+            else {
+                webEngineView.grantFeaturePermission(securityOrigin, feature, true)
+            }
+        }
+    }
+
+}
diff --git a/tests/manual/widgets/CMakeLists.txt b/tests/manual/widgets/CMakeLists.txt
index 1153e7763ea..297a9b20653 100644
--- a/tests/manual/widgets/CMakeLists.txt
+++ b/tests/manual/widgets/CMakeLists.txt
@@ -1,3 +1,4 @@
 add_subdirectory(inputmethods)
+add_subdirectory(geolocation)
 add_subdirectory(touchbrowser)
 add_subdirectory(webgl)
diff --git a/tests/manual/widgets/geolocation/CMakeLists.txt b/tests/manual/widgets/geolocation/CMakeLists.txt
new file mode 100644
index 00000000000..2ca8c2f524b
--- /dev/null
+++ b/tests/manual/widgets/geolocation/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+    cmake_minimum_required(VERSION 3.16)
+    project(geolocation LANGUAGES CXX)
+    find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(geolocation
+    GUI
+    SOURCES
+        main.cpp
+    LIBRARIES
+        Qt::Core
+        Qt::Gui
+        Qt::Test
+        Qt::WebEngineWidgets
+    ENABLE_AUTOGEN_TOOLS
+        moc
+)
+
+set_target_properties(geolocation PROPERTIES
+    WIN32_EXECUTABLE TRUE
+    MACOSX_BUNDLE TRUE
+    MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.dev.webenginewidgets.geolocation"
+)
+
+set(geolocation_resource_files
+    "geolocation.html"
+)
+
+qt_add_resources(geolocation "geolocation"
+    PREFIX
+    "/"
+    FILES
+    ${geolocation_resource_files}
+)
+
+    foreach(permission_plugin IN LISTS QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE_permissions)
+        set(permission_plugin "${QT_CMAKE_EXPORT_NAMESPACE}::${permission_plugin}")
+        qt6_import_plugins(geolocation INCLUDE ${permission_plugin})
+    endforeach()
+
+if (APPLE)
+    set_target_properties(geolocation PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+    )
+
+    if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+        # Need to sign application for location permissions to work
+        add_custom_command(TARGET geolocation
+            POST_BUILD COMMAND codesign -s - geolocation.app)
+    endif()
+endif()
diff --git a/tests/manual/widgets/geolocation/Info.plist b/tests/manual/widgets/geolocation/Info.plist
new file mode 100644
index 00000000000..9853e190081
--- /dev/null
+++ b/tests/manual/widgets/geolocation/Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+    <true/>
+    <key>NSLocationUsageDescription</key>
+    <string>Geolocation test would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/tests/manual/widgets/geolocation/geolocation.html b/tests/manual/widgets/geolocation/geolocation.html
new file mode 100644
index 00000000000..e8c54bc5847
--- /dev/null
+++ b/tests/manual/widgets/geolocation/geolocation.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<title>Geolocation Permission API Test</title>
+<script>
+
+var errorMessage;
+var handled = false;
+
+function successHandler(location) {
+    var message = document.getElementById("message");
+    message.innerHTML = "Latitude: " + location.coords.latitude +
+    "<br>Longitude: " + location.coords.longitude;
+
+    errorMessage = "";
+    handled = true;
+}
+
+function errorHandler(error) {
+    errorMessage = error.message;
+    handled = true;
+}
+
+<!-- One shot example -->
+navigator.geolocation.getCurrentPosition(successHandler, errorHandler);
+
+</script>
+</head>
+<body>
+<div id="message">Location unknown</div>
+</body>
+</html>
+
diff --git a/tests/manual/widgets/geolocation/main.cpp b/tests/manual/widgets/geolocation/main.cpp
new file mode 100644
index 00000000000..f33cf5798b7
--- /dev/null
+++ b/tests/manual/widgets/geolocation/main.cpp
@@ -0,0 +1,51 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QApplication>
+#include <QFormLayout>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QMainWindow>
+#include <QMessageBox>
+#include <QVBoxLayout>
+#include <QWebEnginePage>
+#include <QWebEngineView>
+
+class GeoPermissionWebView : public QWebEngineView {
+  Q_OBJECT
+
+public slots:
+    void handleFeaturePermissionRequested(const QUrl &securityOrigin,
+                                               QWebEnginePage::Feature feature)
+    {
+        qWarning("Feature Permission");
+        QString title = tr("Permission Request");
+        QString question = QLatin1String("Allow access to geolocation?");
+        if (!question.isEmpty() && QMessageBox::question(window(), title, question) == QMessageBox::Yes)
+            page()->setFeaturePermission(securityOrigin, feature,
+                                         QWebEnginePage::PermissionGrantedByUser);
+        else
+            page()->setFeaturePermission(securityOrigin, feature,
+                                         QWebEnginePage::PermissionDeniedByUser);
+    }
+
+};
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    QMainWindow w;
+    GeoPermissionWebView webview;
+    QWebEnginePage page;
+    QObject::connect(&page, &QWebEnginePage::featurePermissionRequested, &webview,
+            &GeoPermissionWebView::handleFeaturePermissionRequested);
+    webview.setPage(&page);
+    page.load(QUrl("qrc:/geolocation.html"));
+    w.setCentralWidget(&webview);
+    w.show();
+
+    return a.exec();
+}
+
+#include "main.moc"

From 7d09b40b705e29168253e0703099d664595357c8 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Mon, 24 Jul 2023 20:58:56 +0200
Subject: [PATCH 287/681] PdfMultiPageView: don't force TableView to rebuild
 from scratch on zoom

It's behaving better now without this workaround, which was also causing
TableView to iteratively pool and reuse delegates for all pages, which
was causing them to actually request images for each page. But at least
forceLayout() still seems to be necessary to cope with the change in
cell size: as the docs say, the columnWidthProvider and
rowHeightProvider functions will return different values after zooming,
so TableView needs to be told to re-evaluate the size and position of
each visible row.

Reverts 4a08034ca3b274e0309530bed4630521b8ad91c9

Fixes: QTBUG-114953
Change-Id: Id84e5359239300d1450868219fe30f402d56c3cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8787c532976be33eb9d40569ff083b5504637503)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfquick/PdfMultiPageView.qml | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
index 0f62a229d5a..10683f55dee 100644
--- a/src/pdfquick/PdfMultiPageView.qml
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -298,14 +298,7 @@ Item {
         property point jumpLocationMargin: Qt.point(10, 10)  // px away from viewport edges
         anchors.fill: parent
         anchors.leftMargin: 2
-        model: modelInUse && root.document ? root.document.pageCount : 0
-        // workaround to make TableView do scheduleRebuildTable(RebuildOption::All) in cases when forceLayout() doesn't
-        property bool modelInUse: true
-        function rebuild() {
-            modelInUse = false
-            modelInUse = true
-        }
-        // end workaround
+        model: root.document ? root.document.pageCount : 0
         rowSpacing: 6
         property real rotationNorm: Math.round((360 + (root.pageRotation % 360)) % 360)
         property bool rot90: rotationNorm == 90 || rotationNorm == 270
@@ -528,8 +521,8 @@ Item {
         // and don't force layout either, because positionViewAtCell() will do that
         if (pageNavigator.jumping)
             return
-        // make TableView rebuild from scratch, because otherwise it doesn't know the delegates are changing size
-        tableView.rebuild()
+        // page size changed: TableView needs to redo layout to avoid overlapping delegates or gaps between them
+        tableView.forceLayout()
         const cell = tableView.cellAtPos(root.width / 2, root.height / 2)
         const currentItem = tableView.itemAtCell(cell)
         if (currentItem) {

From ea697065753b51aed096af3b3e63ae2494abf669 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Mon, 24 Jul 2023 20:58:56 +0200
Subject: [PATCH 288/681] PdfMultiPageView: don't force TableView to rebuild
 from scratch on zoom

It's behaving better now without this workaround, which was also causing
TableView to iteratively pool and reuse delegates for all pages, which
was causing them to actually request images for each page. But at least
forceLayout() still seems to be necessary to cope with the change in
cell size: as the docs say, the columnWidthProvider and
rowHeightProvider functions will return different values after zooming,
so TableView needs to be told to re-evaluate the size and position of
each visible row.

Reverts 4a08034ca3b274e0309530bed4630521b8ad91c9

Fixes: QTBUG-114953
Change-Id: Id84e5359239300d1450868219fe30f402d56c3cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8787c532976be33eb9d40569ff083b5504637503)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfquick/PdfMultiPageView.qml | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
index 0f62a229d5a..10683f55dee 100644
--- a/src/pdfquick/PdfMultiPageView.qml
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -298,14 +298,7 @@ Item {
         property point jumpLocationMargin: Qt.point(10, 10)  // px away from viewport edges
         anchors.fill: parent
         anchors.leftMargin: 2
-        model: modelInUse && root.document ? root.document.pageCount : 0
-        // workaround to make TableView do scheduleRebuildTable(RebuildOption::All) in cases when forceLayout() doesn't
-        property bool modelInUse: true
-        function rebuild() {
-            modelInUse = false
-            modelInUse = true
-        }
-        // end workaround
+        model: root.document ? root.document.pageCount : 0
         rowSpacing: 6
         property real rotationNorm: Math.round((360 + (root.pageRotation % 360)) % 360)
         property bool rot90: rotationNorm == 90 || rotationNorm == 270
@@ -528,8 +521,8 @@ Item {
         // and don't force layout either, because positionViewAtCell() will do that
         if (pageNavigator.jumping)
             return
-        // make TableView rebuild from scratch, because otherwise it doesn't know the delegates are changing size
-        tableView.rebuild()
+        // page size changed: TableView needs to redo layout to avoid overlapping delegates or gaps between them
+        tableView.forceLayout()
         const cell = tableView.cellAtPos(root.width / 2, root.height / 2)
         const currentItem = tableView.itemAtCell(cell)
         if (currentItem) {

From 3e28cb436fd56c548c3a9e4efd317e6405c6a5c3 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 15 Jun 2023 12:56:24 +0200
Subject: [PATCH 289/681] Fix and silence warnings after Chromium 112
 adaptations

Change-Id: Ib8fbcdc28d935b5634149a71b5391278edb4d472
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6aa142e88bb556cd6654e07bff8206e035418cd5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/CMakeLists.txt    | 11 ++++++++++-
 src/core/type_conversion.cpp   |  1 +
 src/core/web_event_factory.cpp | 13 +++++++------
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index 208ccf10da5..c0ff8034690 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -64,7 +64,16 @@ set_target_properties(WebEngineCore PROPERTIES QTWEBENGINEPROCESS_NAME ${qtWebEn
 qt_skip_warnings_are_errors(WebEngineCore)
 
 if(CLANG OR GCC)
-    target_compile_options(WebEngineCore PRIVATE "-Wno-unused-parameter")
+    target_compile_options(WebEngineCore PRIVATE
+        "-Wno-unused-parameter"
+        "-Wno-expansion-to-defined"
+    )
+endif()
+
+if(GCC)
+    target_compile_options(WebEngineCore PRIVATE
+        "-Wno-packed-not-aligned"
+    )
 endif()
 
 qt_internal_extend_target(WebEngineCore CONDITION QT_FEATURE_webengine_webchannel
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index 54f6e2e4fb9..2d4fb323dc4 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -103,6 +103,7 @@ QImage toQImage(const SkBitmap &bitmap)
         }
         break;
     case kBGR_101010x_SkColorType:
+    case kBGR_101010x_XR_SkColorType:
     case kBGRA_1010102_SkColorType:
         switch (bitmap.alphaType()) {
         case kUnknown_SkAlphaType:
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index a802ba158c0..3ccfcccb41a 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1541,8 +1541,9 @@ static QPoint getWheelEventDelta(const blink::WebGestureEvent &webEvent)
 {
     static const float cDefaultQtScrollStep = 20.f;
     static const int wheelScrollLines = QGuiApplication::styleHints()->wheelScrollLines();
-    return QPoint(webEvent.data.scroll_update.delta_x * QWheelEvent::DefaultDeltasPerStep / (wheelScrollLines * cDefaultQtScrollStep),
-                  webEvent.data.scroll_update.delta_y * QWheelEvent::DefaultDeltasPerStep / (wheelScrollLines * cDefaultQtScrollStep));
+    static const float deltasPerStep = static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
+    return QPoint(webEvent.data.scroll_update.delta_x * deltasPerStep / (wheelScrollLines * cDefaultQtScrollStep),
+                  webEvent.data.scroll_update.delta_y * deltasPerStep / (wheelScrollLines * cDefaultQtScrollStep));
 }
 
 blink::WebMouseWheelEvent::Phase toBlinkPhase(QWheelEvent *ev)
@@ -1589,8 +1590,8 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev)
     webEvent.SetPositionInScreen(static_cast<float>(ev->globalPosition().x()),
                                  static_cast<float>(ev->globalPosition().y()));
 
-    webEvent.wheel_ticks_x = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep;
-    webEvent.wheel_ticks_y = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep;
+    webEvent.wheel_ticks_x = ev->angleDelta().x() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
+    webEvent.wheel_ticks_y = ev->angleDelta().y() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
     webEvent.phase = toBlinkPhase(ev);
 #if defined(Q_OS_DARWIN)
     // PrecisePixel is a macOS term meaning it is a system scroll gesture, see qnsview_mouse.mm
@@ -1627,8 +1628,8 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent,
     webEvent.SetPositionInScreen(static_cast<float>(ev->globalPosition().x()),
                                  static_cast<float>(ev->globalPosition().y()));
 
-    webEvent.wheel_ticks_x += static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep;
-    webEvent.wheel_ticks_y += static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep;
+    webEvent.wheel_ticks_x = ev->angleDelta().x() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
+    webEvent.wheel_ticks_y = ev->angleDelta().y() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
     setBlinkWheelEventDelta(webEvent);
 
     return true;

From c78c1ec1568a5fce44f78e7b32304d3d9b681389 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Thu, 20 Jul 2023 11:57:50 +0200
Subject: [PATCH 290/681] Qt Designer: Enable QWebEngineView for all Graphics
 APIs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

-Change qtdeclarative/a184f2e0abfa0daf9190b72901208373dd5c1f79
enables QQuickWidget to be used with all Graphics APIs.
-Removed the exclusion introduced by QTBUG-100285

Fixes: QTBUG-113512
Change-Id: Ib2c381cad021804e41e646b08196314960e480a6
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit d4f4a90490dddd2a23d7ecbd796359553b8eb687)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../plugins/qwebengineview/qwebengineview_plugin.cpp      | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
index 2ff1de1690b..6ba64a1783e 100644
--- a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
+++ b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
@@ -79,14 +79,6 @@ void QWebEngineViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
 
 QString QWebEngineViewPlugin::domXml() const
 {
-    const auto graphicsApi = QQuickWindow::graphicsApi();
-    if (graphicsApi != QSGRendererInterface::OpenGLRhi
-        && graphicsApi != QSGRendererInterface::Software) {
-        qWarning("Qt Designer: The QWebEngineView custom widget plugin is disabled because it requires OpenGL/Software RHI (current: %d).",
-                 int(graphicsApi));
-        return {};
-    }
-
     return QStringLiteral("\
     <ui language=\"c++\">\
         <widget class=\"QWebEngineView\" name=\"webEngineView\">\

From 1b821a811dbc7399c568a2a174c80561a5f7990d Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Thu, 20 Jul 2023 11:57:50 +0200
Subject: [PATCH 291/681] Qt Designer: Enable QWebEngineView for all Graphics
 APIs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

-Change qtdeclarative/a184f2e0abfa0daf9190b72901208373dd5c1f79
enables QQuickWidget to be used with all Graphics APIs.
-Removed the exclusion introduced by QTBUG-100285

Fixes: QTBUG-113512
Change-Id: Ib2c381cad021804e41e646b08196314960e480a6
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit d4f4a90490dddd2a23d7ecbd796359553b8eb687)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../plugins/qwebengineview/qwebengineview_plugin.cpp      | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
index 2ff1de1690b..6ba64a1783e 100644
--- a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
+++ b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
@@ -79,14 +79,6 @@ void QWebEngineViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
 
 QString QWebEngineViewPlugin::domXml() const
 {
-    const auto graphicsApi = QQuickWindow::graphicsApi();
-    if (graphicsApi != QSGRendererInterface::OpenGLRhi
-        && graphicsApi != QSGRendererInterface::Software) {
-        qWarning("Qt Designer: The QWebEngineView custom widget plugin is disabled because it requires OpenGL/Software RHI (current: %d).",
-                 int(graphicsApi));
-        return {};
-    }
-
     return QStringLiteral("\
     <ui language=\"c++\">\
         <widget class=\"QWebEngineView\" name=\"webEngineView\">\

From 65b27ad6c4f45ed44933cfe777fa74e48e4c9936 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 14 Jun 2023 14:48:07 +0200
Subject: [PATCH 292/681] Do no load default style sheets in recipe browser
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If no settings loaded, start recipe browser example
with no style sheets applied.

Fixes: QTBUG-114471
Change-Id: Ibdcf0e5171dfa76925e9af95754f0583aedec9bd
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit c1c084157c90cbc21950fae7b3cbcea068c4e9b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/recipebrowser/mainwindow.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.cpp b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
index 7288fe4ceb3..79cd3bb6b3c 100644
--- a/examples/webenginewidgets/recipebrowser/mainwindow.cpp
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
@@ -122,8 +122,7 @@ void MainWindow::loadDefaultStyleSheets()
     settings.beginGroup("styleSheets");
 
     for (auto it = defaultStyleSheets.constBegin(); it != defaultStyleSheets.constEnd(); ++it) {
-        settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), true)));
-        insertStyleSheet(it.key(), it.value(), false);
+        settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), false)));
     }
 
     settings.endGroup();

From d48e328458959a00a052a73512c5567de1db6206 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 14 Jun 2023 14:48:07 +0200
Subject: [PATCH 293/681] Do no load default style sheets in recipe browser
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If no settings loaded, start recipe browser example
with no style sheets applied.

Fixes: QTBUG-114471
Change-Id: Ibdcf0e5171dfa76925e9af95754f0583aedec9bd
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit c1c084157c90cbc21950fae7b3cbcea068c4e9b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/recipebrowser/mainwindow.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.cpp b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
index 7288fe4ceb3..79cd3bb6b3c 100644
--- a/examples/webenginewidgets/recipebrowser/mainwindow.cpp
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
@@ -122,8 +122,7 @@ void MainWindow::loadDefaultStyleSheets()
     settings.beginGroup("styleSheets");
 
     for (auto it = defaultStyleSheets.constBegin(); it != defaultStyleSheets.constEnd(); ++it) {
-        settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), true)));
-        insertStyleSheet(it.key(), it.value(), false);
+        settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), false)));
     }
 
     settings.endGroup();

From ef1543cf5060df608fbd604b5deaf42de29a39bc Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 19 Jul 2023 16:35:06 +0200
Subject: [PATCH 294/681] Disable error page for
 tst_QWebEngineLoadingInfo::responseHeaders

The error page is not relevant for the test but it can significantly
slow down the test because of the embedded javascript.

Change-Id: I8b7e876f74110f758c5a23579018c598a29ba1e2
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit d08e1f06121f943f75bf0d337ad857b1cbb7a94b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
index daa6bb0791e..65cc639862a 100644
--- a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
+++ b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
@@ -6,6 +6,7 @@
 #include <QtWebEngineCore/qwebenginepage.h>
 #include <QtWebEngineCore/qwebengineloadinginfo.h>
 #include <QtWebEngineCore/qwebenginehttprequest.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
 
 #include <httpserver.h>
 #include <httpreqrep.h>
@@ -75,6 +76,7 @@ private Q_SLOTS:
 
         QWebEngineProfile profile;
         QWebEnginePage page(&profile);
+        page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
         QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
         QObject::connect(&page, &QWebEnginePage::loadingChanged, this, &tst_QWebEngineLoadingInfo::loadingInfoChanged);
 
@@ -82,7 +84,7 @@ private Q_SLOTS:
         QWebEngineHttpRequest request(httpServer.url("/somepage.html"));
         page.load(request);
 
-        QTRY_VERIFY_WITH_TIMEOUT(spy.count() > 0, 20000);
+        QTRY_VERIFY(spy.count() > 0);
         QVERIFY(httpServer.stop());
     }
 };

From b233954b63552aadf9f4d67d41f396ac8076ad0c Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 4 Jul 2023 15:16:25 +0200
Subject: [PATCH 295/681] Stabilize tst_Accessibility::roles test on QEMU after
 Chromium 112

The accessibility tree serialization may happen before the layouting is
completed. This means that during the serialization some children may
have not been created yet and results different roles for elements.

It has been broken by enabling the TimedHTMLParserBudget optimization:
https://crrev.com/c/4152859

Change-Id: I798a8ed5bd704a6900c7b56f462091b79a12815d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 91d2702481a7f865d85667a141d19066f4d9f7c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/widgets/accessibility/CMakeLists.txt        | 1 +
 tests/auto/widgets/accessibility/tst_accessibility.cpp | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/auto/widgets/accessibility/CMakeLists.txt b/tests/auto/widgets/accessibility/CMakeLists.txt
index 4c0bb17eeb9..f6a08c9d38d 100644
--- a/tests/auto/widgets/accessibility/CMakeLists.txt
+++ b/tests/auto/widgets/accessibility/CMakeLists.txt
@@ -8,5 +8,6 @@ qt_internal_add_test(tst_webengine_accessibility
         tst_accessibility.cpp
     LIBRARIES
         Qt::WebEngineWidgets
+        Qt::WebEngineCorePrivate
         Test::Util
 )
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp
index 68566c0827c..9659cb8f7e3 100644
--- a/tests/auto/widgets/accessibility/tst_accessibility.cpp
+++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp
@@ -17,6 +17,7 @@
     Boston, MA 02110-1301, USA.
 */
 
+#include <QtWebEngineCore/private/qtwebenginecore-config_p.h>
 #include <qtest.h>
 #include <widgetutil.h>
 
@@ -607,7 +608,11 @@ void tst_Accessibility::crossTreeParent()
 
 static QByteArrayList params = QByteArrayList()
     << "--force-renderer-accessibility"
-    << "--enable-features=AccessibilityExposeARIAAnnotations";
+    << "--enable-features=AccessibilityExposeARIAAnnotations"
+#if QT_CONFIG(webengine_embedded_build)
+    << "--disable-features=TimedHTMLParserBudget"
+#endif
+    ;
 
 W_QTEST_MAIN(tst_Accessibility, params)
 #include "tst_accessibility.moc"

From 5177cbe8338970e2254dd654dbb97eddf883e662 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 20 Jul 2023 13:58:57 +0200
Subject: [PATCH 296/681] Clean up rendering code

Change-Id: I1bea5b05677791046fcd260ecac0236674730889
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b26889eca92bcbdc14dfbc42d33a1341ebb8ea6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/compositor/compositor.cpp                     |  1 -
 src/core/compositor/compositor.h                       |  1 -
 src/core/compositor/content_gpu_client_qt.cpp          |  1 -
 src/core/compositor/display_skia_output_device.cpp     |  1 +
 src/core/compositor/display_skia_output_device.h       |  9 +++++++--
 .../compositor/display_software_output_surface.cpp     |  1 -
 src/core/ozone/gl_context_qt.cpp                       |  4 ++--
 src/core/ozone/gl_context_qt.h                         |  1 -
 src/core/ozone/gl_ozone_egl_qt.cpp                     | 10 ----------
 src/core/ozone/gl_surface_egl_qt.cpp                   |  2 --
 src/core/ozone/gl_surface_egl_qt.h                     |  1 -
 src/core/ozone/gl_surface_qt.cpp                       |  2 --
 src/core/ozone/gl_surface_qt.h                         |  1 -
 .../render_widget_host_view_qt_delegate_client.cpp     |  2 --
 src/core/render_widget_host_view_qt_delegate_item.cpp  |  7 ++++---
 src/core/render_widget_host_view_qt_delegate_item.h    |  2 +-
 16 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index 62dd8ebe4fa..6bfb3140fef 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -7,7 +7,6 @@
 #include "components/viz/common/surfaces/frame_sink_id.h"
 
 #include <QHash>
-#include <QImage>
 #include <QMutex>
 #include <QQuickWindow>
 
diff --git a/src/core/compositor/compositor.h b/src/core/compositor/compositor.h
index 26e9463cde4..bf3e29c9182 100644
--- a/src/core/compositor/compositor.h
+++ b/src/core/compositor/compositor.h
@@ -4,7 +4,6 @@
 #ifndef COMPOSITOR_H
 #define COMPOSITOR_H
 
-#include <QtGui/qtguiglobal.h>
 #include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
 
 QT_BEGIN_NAMESPACE
diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp
index d12074d2e9b..6ef8048f295 100644
--- a/src/core/compositor/content_gpu_client_qt.cpp
+++ b/src/core/compositor/content_gpu_client_qt.cpp
@@ -3,7 +3,6 @@
 
 #include "content_gpu_client_qt.h"
 #include "ozone/gl_share_context_qt.h"
-#include "web_engine_context.h"
 
 namespace QtWebEngineCore {
 
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index cb47a300f46..d46154f7e57 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -3,6 +3,7 @@
 
 #include "display_skia_output_device.h"
 
+#include "compositor_resource_fence.h"
 #include "type_conversion.h"
 
 #include "gpu/command_buffer/service/skia_utils.h"
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index 55aa4a6d5e7..abe0e05e971 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -4,14 +4,18 @@
 #ifndef DISPLAY_SKIA_OUTPUT_DEVICE_H
 #define DISPLAY_SKIA_OUTPUT_DEVICE_H
 
-#include "compositor_resource_fence.h"
+#include <QtCore/QMutex>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
 #include "compositor.h"
 
 #include "base/task/single_thread_task_runner.h"
 #include "components/viz/service/display_embedder/skia_output_device.h"
 #include "gpu/command_buffer/service/shared_context_state.h"
 
-#include <QMutex>
+#if QT_CONFIG(webengine_vulkan)
+#include <vulkan/vulkan.h>
+#endif
 
 QT_BEGIN_NAMESPACE
 class QQuickWindow;
@@ -49,6 +53,7 @@ class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compo
     QSize size() override;
     bool requiresAlphaChannel() override;
     float devicePixelRatio() override;
+
 #if QT_CONFIG(webengine_vulkan)
     VkImage vkImage(QQuickWindow *win);
     VkImageLayout vkImageLayout();
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index b934bcd9066..c326c8cdf02 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -4,7 +4,6 @@
 #include "display_software_output_surface.h"
 
 #include "compositor.h"
-#include "render_widget_host_view_qt_delegate.h"
 #include "type_conversion.h"
 
 #include "base/task/single_thread_task_runner.h"
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 40fa92b9924..accfe375f8f 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -8,11 +8,11 @@
 #include <QThread>
 #include <QtGui/private/qtgui-config_p.h>
 #include <qpa/qplatformnativeinterface.h>
-#include "ui/gl/gl_context_egl.h"
-#include "ui/gl/gl_implementation.h"
 
 #if BUILDFLAG(IS_WIN)
+#include "ui/gl/gl_context_egl.h"
 #include "ui/gl/gl_context_wgl.h"
+#include "ui/gl/gl_implementation.h"
 #endif
 
 QT_BEGIN_NAMESPACE
diff --git a/src/core/ozone/gl_context_qt.h b/src/core/ozone/gl_context_qt.h
index f3ec219e6f4..655fd7e19e9 100644
--- a/src/core/ozone/gl_context_qt.h
+++ b/src/core/ozone/gl_context_qt.h
@@ -8,7 +8,6 @@
 #include "ui/gl/gl_context.h"
 
 namespace gl {
-class GLContext;
 class GLSurface;
 }
 
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp
index 43305289de3..7b27fb9211b 100644
--- a/src/core/ozone/gl_ozone_egl_qt.cpp
+++ b/src/core/ozone/gl_ozone_egl_qt.cpp
@@ -6,23 +6,13 @@
 #include "gl_ozone_egl_qt.h"
 #include "gl_surface_egl_qt.h"
 
-#include "base/files/file_path.h"
-#include "base/native_library.h"
 #include "media/gpu/buildflags.h"
 #include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_context_egl.h"
 #include "ui/gl/gl_display.h"
-#include "ui/gl/gl_implementation.h"
-#include "ui/gl/gl_egl_api_implementation.h"
 #include "ui/gl/gl_surface.h"
 #include "ui/gl/gl_utils.h"
-#include "ui/gl/init/gl_factory.h"
-#include "ui/gl/init/gl_initializer.h"
 #include "ui/ozone/common/native_pixmap_egl_binding.h"
 
-#include <EGL/egl.h>
-#include <dlfcn.h>
-
 namespace ui {
 
 bool LoadQtEGLBindings()
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 413d2a20ff2..a0c120ac61c 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -12,7 +12,6 @@
 #include "ui/gl/gl_bindings.h"
 #include "ui/gl/gl_display.h"
 #include "ui/gl/gl_display_manager.h"
-#include "ui/gl/gl_surface_egl.h"
 #include "ui/gl/init/gl_factory.h"
 
 #if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
@@ -59,7 +58,6 @@ gl::GLDisplay *GLSurfaceEGLQt::InitializeOneOff(gl::GpuPreference preference)
         return nullptr;
     }
 
-    g_client_extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
     g_extensions = eglQueryString(egl_display->GetDisplay(), EGL_EXTENSIONS);
     g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions.c_str(), "EGL_KHR_surfaceless_context");
     if (g_egl_surfaceless_context_supported) {
diff --git a/src/core/ozone/gl_surface_egl_qt.h b/src/core/ozone/gl_surface_egl_qt.h
index 6eee132e9f9..d581f9079aa 100644
--- a/src/core/ozone/gl_surface_egl_qt.h
+++ b/src/core/ozone/gl_surface_egl_qt.h
@@ -6,7 +6,6 @@
 
 #include "gl_surface_qt.h"
 #include <EGL/egl.h>
-#include <EGL/eglext.h>
 
 namespace gl {
 
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index fbb53e0a649..67d534f95bf 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -16,7 +16,6 @@
 #if BUILDFLAG(IS_WIN)
 #include "web_engine_context.h"
 #include "ozone/gl_surface_wgl_qt.h"
-#include "ozone/gl_surface_egl_qt.h"
 
 #include "gpu/ipc/service/image_transport_surface.h"
 #include "ui/gl/init/gl_display_initializer.h"
@@ -33,7 +32,6 @@ namespace gl {
 
 GLDisplay *GLSurfaceQt::g_display = nullptr;
 void *GLSurfaceQt::g_config = nullptr;
-std::string GLSurfaceQt::g_client_extensions;
 std::string GLSurfaceQt::g_extensions;
 
 GLSurfaceQt::~GLSurfaceQt()
diff --git a/src/core/ozone/gl_surface_qt.h b/src/core/ozone/gl_surface_qt.h
index f79a2608e4e..1ae41a078e5 100644
--- a/src/core/ozone/gl_surface_qt.h
+++ b/src/core/ozone/gl_surface_qt.h
@@ -36,7 +36,6 @@ class GLSurfaceQt: public GLSurface {
     static void* g_config;
     static GLDisplay *g_display;
     static std::string g_extensions;
-    static std::string g_client_extensions;
 };
 
 } // namespace gl
diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index 1b30e995332..ce31772b38a 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -16,9 +16,7 @@
 
 #include <QEvent>
 #include <QInputMethodEvent>
-#include <QScopeGuard>
 #include <QSet>
-#include <QSGNode>
 #include <QStyleHints>
 #include <QTextFormat>
 #include <QVariant>
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index af19776b9d0..1ad664a1fa3 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -323,8 +323,9 @@ void RenderWidgetHostViewQtDelegateItem::itemChange(ItemChange change, const Ite
         if (value.window) {
             m_windowConnections.append(connect(value.window, &QQuickWindow::beforeRendering,
                                                this, &RenderWidgetHostViewQtDelegateItem::onBeforeRendering, Qt::DirectConnection));
-            m_windowConnections.append(connect(value.window, &QQuickWindow::afterFrameEnd,
-                                               this, &RenderWidgetHostViewQtDelegateItem::onAfterRendering, Qt::DirectConnection));
+            m_windowConnections.append(connect(value.window, &QQuickWindow::afterFrameEnd, this,
+                                               &RenderWidgetHostViewQtDelegateItem::onAfterFrameEnd,
+                                               Qt::DirectConnection));
             m_windowConnections.append(connect(value.window, SIGNAL(xChanged(int)), SLOT(onWindowPosChanged())));
             m_windowConnections.append(connect(value.window, SIGNAL(yChanged(int)), SLOT(onWindowPosChanged())));
 #if QT_CONFIG(webengine_vulkan)
@@ -404,7 +405,7 @@ void RenderWidgetHostViewQtDelegateItem::onBeforeRendering()
     comp->waitForTexture();
 }
 
-void RenderWidgetHostViewQtDelegateItem::onAfterRendering()
+void RenderWidgetHostViewQtDelegateItem::onAfterFrameEnd()
 {
     auto comp = compositor();
     if (!comp || comp->type() != Compositor::Type::NativeBuffer)
diff --git a/src/core/render_widget_host_view_qt_delegate_item.h b/src/core/render_widget_host_view_qt_delegate_item.h
index b1eb001fa6a..082bd77911e 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.h
+++ b/src/core/render_widget_host_view_qt_delegate_item.h
@@ -100,7 +100,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT RenderWidgetHostViewQtDelegateItem
 
 private Q_SLOTS:
     void onBeforeRendering();
-    void onAfterRendering();
+    void onAfterFrameEnd();
     void onWindowPosChanged();
     void releaseTextureResources();
     void onHide();

From 6be60531512dd26d88f704f91797a221f9c8c157 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 16 Jun 2023 15:33:21 +0200
Subject: [PATCH 297/681] Initialize hardware accelerated video decoding in
 browser process only

Initializing them for renderer process doesn't make too much sense.

VAAPI is already initialized for browser process in
InProcessGpuThread::Init() since https://crrev.com/c/1953730

Video decoder initializations for Windows and macOS are still needed
because they are not initiliazed for in-process-gpu in upstream.

Change-Id: I36c3a70c5c63440308de9d44720e6fb90046e92a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5da32e17b7b52855b318d0c78e54a09d7ec538c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/content_main_delegate_qt.cpp | 28 +++++++++++----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 52e23399e3e..feaaaaa9a82 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -14,7 +14,6 @@
 #include "content/public/browser/browser_main_runner.h"
 #include "content/public/common/content_paths.h"
 #include "content/public/common/content_switches.h"
-#include "media/gpu/buildflags.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/ui_base_paths.h"
 #include "ui/base/resource/resource_bundle.h"
@@ -39,9 +38,6 @@
 #include "ui/base/ui_base_switches.h"
 #endif
 
-// must be included before vaapi_wrapper.h
-#include <QtCore/qcoreapplication.h>
-
 #if BUILDFLAG(IS_WIN)
 #include "media/gpu/windows/dxva_video_decode_accelerator_win.h"
 #include "media/gpu/windows/media_foundation_video_encode_accelerator_win.h"
@@ -53,9 +49,7 @@
 #include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
 #endif
 
-#if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi/vaapi_wrapper.h"
-#endif
+#include <QtCore/qcoreapplication.h>
 
 namespace content {
 ContentClient *GetContentClient();
@@ -171,21 +165,21 @@ void ContentMainDelegateQt::PreSandboxStartup()
         setlocale(LC_NUMERIC, "C");
 #endif
 
-    // from gpu_main.cc:
-#if BUILDFLAG(USE_VAAPI)
-    media::VaapiWrapper::PreSandboxInitialization();
-#endif
+    bool isBrowserProcess = !parsedCommandLine->HasSwitch(switches::kProcessType);
+    if (isBrowserProcess) {
+        // from gpu_main.cc:
 #if BUILDFLAG(IS_WIN)
-    media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
-    media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
+        media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
+        media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
 #endif
 
 #if BUILDFLAG(IS_MAC)
-    {
-        TRACE_EVENT0("gpu", "Initialize VideoToolbox");
-        media::InitializeVideoToolbox();
-    }
+        {
+            TRACE_EVENT0("gpu", "Initialize VideoToolbox");
+            media::InitializeVideoToolbox();
+        }
 #endif
+    }
 
     if (parsedCommandLine->HasSwitch(switches::kApplicationName)) {
         std::string appName = parsedCommandLine->GetSwitchValueASCII(switches::kApplicationName);

From 884b0eecc119faebb51701b2dab97d9f8fb462ab Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 16 Jun 2023 15:33:21 +0200
Subject: [PATCH 298/681] Initialize hardware accelerated video decoding in
 browser process only

Initializing them for renderer process doesn't make too much sense.

VAAPI is already initialized for browser process in
InProcessGpuThread::Init() since https://crrev.com/c/1953730

Video decoder initializations for Windows and macOS are still needed
because they are not initiliazed for in-process-gpu in upstream.

Change-Id: I36c3a70c5c63440308de9d44720e6fb90046e92a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5da32e17b7b52855b318d0c78e54a09d7ec538c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/content_main_delegate_qt.cpp | 28 +++++++++++----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index b5c8210cd80..0aea6ca207f 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -14,7 +14,6 @@
 #include "content/public/browser/browser_main_runner.h"
 #include "content/public/common/content_paths.h"
 #include "content/public/common/content_switches.h"
-#include "media/gpu/buildflags.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/ui_base_paths.h"
 #include "ui/base/resource/resource_bundle.h"
@@ -39,9 +38,6 @@
 #include "ui/base/ui_base_switches.h"
 #endif
 
-// must be included before vaapi_wrapper.h
-#include <QtCore/qcoreapplication.h>
-
 #if BUILDFLAG(IS_WIN)
 #include "media/gpu/windows/dxva_video_decode_accelerator_win.h"
 #include "media/gpu/windows/media_foundation_video_encode_accelerator_win.h"
@@ -53,9 +49,7 @@
 #include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
 #endif
 
-#if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi/vaapi_wrapper.h"
-#endif
+#include <QtCore/qcoreapplication.h>
 
 namespace content {
 ContentClient *GetContentClient();
@@ -171,21 +165,21 @@ void ContentMainDelegateQt::PreSandboxStartup()
         setlocale(LC_NUMERIC, "C");
 #endif
 
-    // from gpu_main.cc:
-#if BUILDFLAG(USE_VAAPI)
-    media::VaapiWrapper::PreSandboxInitialization();
-#endif
+    bool isBrowserProcess = !parsedCommandLine->HasSwitch(switches::kProcessType);
+    if (isBrowserProcess) {
+        // from gpu_main.cc:
 #if BUILDFLAG(IS_WIN)
-    media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
-    media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
+        media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
+        media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
 #endif
 
 #if BUILDFLAG(IS_MAC)
-    {
-        TRACE_EVENT0("gpu", "Initialize VideoToolbox");
-        media::InitializeVideoToolbox();
-    }
+        {
+            TRACE_EVENT0("gpu", "Initialize VideoToolbox");
+            media::InitializeVideoToolbox();
+        }
 #endif
+    }
 
     if (parsedCommandLine->HasSwitch(switches::kApplicationName)) {
         std::string appName = parsedCommandLine->GetSwitchValueASCII(switches::kApplicationName);

From 45fc325d786ba8a2757ce63ccdbccf9ae294665e Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Mon, 24 Jul 2023 16:59:24 +0200
Subject: [PATCH 299/681] Disable Armv8 branch protection features for QEMU
 arm64 CI

It significantly slows down v8 parser.

The detection of the QEMU target relies on the environment variable
TARGET_OSVERSION_COIN=qemu on the CI.

Change-Id: I714d7b14bb90e13b6f5b31d4fccc19ae50c0700b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 40226c72b57ac3242eeed7dc378fac954e0d787c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index e250be41c44..09e40061943 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -511,10 +511,12 @@ foreach(arch ${archs})
             endif()
 
             if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm64")
-                # V8 sandbox initialization is slow in QEMU.
                 # This is a workaround to avoid auto test timeouts on the QEMU arm64 CI.
                 if ("$ENV{TARGET_OSVERSION_COIN}" STREQUAL "qemu")
-                    list(APPEND gnArgArg v8_enable_sandbox=false)
+                    list(APPEND gnArgArg
+                        v8_enable_sandbox=false
+                        arm_control_flow_integrity="none"
+                    )
                 endif()
             endif()
         endif()

From faef6efd412ece9de5ecb31be69150c091142d9f Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 13 Jul 2023 13:20:30 +0200
Subject: [PATCH 300/681] Pump up required msvc/sdk versions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Note Windows 10.0.22621.0 SDK is called Windows 11 SDK
in VS installer, the latest still Windows 10 SDK version is not
supported due to some enums missing in sdk files.

Change-Id: I7c574121f94a7c9ac12d09277f3fb42a0593a475
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 4c12eab799ed4446d6a4a4d5cc7fbc9a3cf33217)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake                                  | 8 ++++----
 src/core/doc/src/qtwebengine-platform-notes.qdoc | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index d6ec021db24..51ef08f0326 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -615,8 +615,8 @@ if(WIN32)
     if(MSVC)
         add_check_for_support(
             MODULES QtWebEngine QtPdf
-            CONDITION NOT MSVC_VERSION LESS 1934
-            MESSAGE "VS compiler version must be at least 14.34"
+            CONDITION NOT MSVC_VERSION LESS 1936
+            MESSAGE "VS compiler version must be at least 14.36"
         )
     endif()
     set(windowsSdkVersion $ENV{WindowsSDKVersion})
@@ -625,8 +625,8 @@ if(WIN32)
     message("-- Windows 10 SDK version: ${windowsSdkVersion}")
     add_check_for_support(
         MODULES QtWebEngine
-        CONDITION sdkMinor GREATER_EQUAL 20348
-        MESSAGE "Build requires Windows 10 SDK at least version 10.0.20348.0"
+        CONDITION sdkMinor GREATER_EQUAL 22621
+        MESSAGE "Build requires Windows 11 SDK at least version 10.0.22621.0"
     )
 endif()
 
diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index c7bdb4831ab..aecffa4a107 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -46,10 +46,10 @@
     On Windows, the following additional tools are required:
 
     \list
-        \li Visual Studio 2019 or later, or clang-cl version 10 or later
+        \li Visual Studio 2022 or later, or clang-cl version 10 or later
         \li Active Template Library (ATL), usually included in the Visual Studio
             installation
-        \li Windows 10 SDK version 10.0.20348.0 or later
+        \li Windows 11 SDK version 10.0.22621.0 or later
     \endlist
 
     \note It is not recommended to use tools from  \c msys2 or \c cygwin to build \QWE as it may result in build errors.

From 99c4a18dd792a0840ab1254f0700f4ef9ded8ec5 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 13 Jun 2023 16:09:42 +0200
Subject: [PATCH 301/681] Don't use QScroller in QPdfView

This should be up to applications if desired, not a built-in feature.
For example, qtdoc/examples/demos/documentviewer installs its own
QScroller. Perhaps QScroller should only handle touch gestures, to
avoid interfering with built-in QAbstractScrollArea behavior.

Fixes: QTBUG-113981
Change-Id: I5fdeb362d16e00f1ae656f7529450d5f5f6ffe83
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3fd2f6fd1cf339e43d70dcc02f3bf221b7e73629)
---
 src/pdfwidgets/qpdfview.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index 831b51515b1..6e65639f070 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -14,7 +14,6 @@
 #include <QPdfPageNavigator>
 #include <QScreen>
 #include <QScrollBar>
-#include <QScroller>
 
 QT_BEGIN_NAMESPACE
 
@@ -281,8 +280,6 @@ QPdfView::QPdfView(QWidget *parent)
     verticalScrollBar()->setSingleStep(20);
     horizontalScrollBar()->setSingleStep(20);
 
-    QScroller::grabGesture(this);
-
     d->calculateViewport();
 }
 

From 38a2cea6159b783fdfbbd53b7b34d6586c7d42c8 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Fri, 30 Jun 2023 17:29:03 +0200
Subject: [PATCH 302/681] Fix blacklisted qemu-arm64 tests

 - test_findTextInterruptedByLoad:
   Remove whitespaces from the text as it takes lot
   of time to render according to perf.
   It should fix the timeout errors.

 - loadStartedAfterInPageNavigation:
   Remove the viewport meta tag from test.html.
   The 2x scale is only applied in embedded builds,
   it puts some elements out of the view.

 - acceptNavigationRequestNavigationType:
   Refresh the reload.html page only once.
   On qemu it may reload multiple times messing up
   the list of navigation types.

 - horizontalScrollbarTest:
   Skip instead of blacklist.

 - tst_qtbug_110287:
   Use an url that loads faster.

Task-number: QTBUG-105342
Change-Id: Ifbd41885fee62b12f7022534f9b8bd5e20cbef01
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e354d602e5459dc27e209a0e62aefc4107cc8903)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/quick/qmltests/BLACKLIST                      | 5 -----
 tests/auto/quick/qmltests/data/test4.html                | 1 -
 tests/auto/quick/qmltests/data/tst_findText.qml          | 3 +--
 tests/auto/widgets/qtbug_110287/BLACKLIST                | 2 --
 tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp     | 2 +-
 tests/auto/widgets/qwebenginepage/BLACKLIST              | 3 ---
 tests/auto/widgets/qwebenginepage/resources/reload.html  | 2 +-
 tests/auto/widgets/qwebengineview/BLACKLIST              | 1 -
 tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 6 ++++++
 9 files changed, 9 insertions(+), 16 deletions(-)
 delete mode 100644 tests/auto/widgets/qtbug_110287/BLACKLIST

diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index 36c7376939f..fc8f9f0d8bd 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -10,8 +10,3 @@ macos
 [CertificateError::test_error]
 *
 
-[WebViewFindText::test_findTextInterruptedByLoad]
-b2qt arm 64bit
-
-[WebEngineViewLoadUrl::test_loadStartedAfterInPageNavigation]
-b2qt
diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html
index cf570899455..82830668a68 100644
--- a/tests/auto/quick/qmltests/data/test4.html
+++ b/tests/auto/quick/qmltests/data/test4.html
@@ -9,7 +9,6 @@
                  font-size: 50px;
             }
         </style>
-        <meta name="viewport" content="initial-scale=2.0"/>
     </head>
     <body>
         <button onclick="scrollWin()" id="scroll">Click me to scroll!</button><br><br>
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index 392ce5dcafa..597cff73e97 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -206,8 +206,7 @@ TestWebEngineView {
 
             var listItemText = '';
             for (var i = 0; i < 100000; ++i)
-                listItemText += "bla ";
-            listItemText = listItemText.trim();
+                listItemText += "bla";
 
             webEngineView.loadHtml(
                         "<html><body>" +
diff --git a/tests/auto/widgets/qtbug_110287/BLACKLIST b/tests/auto/widgets/qtbug_110287/BLACKLIST
deleted file mode 100644
index 1b99e150379..00000000000
--- a/tests/auto/widgets/qtbug_110287/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[getAddrInfo]
-b2qt arm
diff --git a/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp b/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp
index 1389682da1b..9453ae9b845 100644
--- a/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp
+++ b/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp
@@ -22,7 +22,7 @@ void tst_qtbug_110287::getAddrInfo()
     QNetworkAccessManager nam;
     QSignalSpy namSpy(&nam, &QNetworkAccessManager::finished);
 
-    QString address("http://www.qt.io");
+    QString address("http://www.example.com");
     QScopedPointer<QNetworkReply> reply(nam.get(QNetworkRequest(address)));
 
     if (!namSpy.wait(25000) || reply->error() != QNetworkReply::NoError)
diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST
index 66c5de42c7e..52def48d170 100644
--- a/tests/auto/widgets/qwebenginepage/BLACKLIST
+++ b/tests/auto/widgets/qwebenginepage/BLACKLIST
@@ -5,9 +5,6 @@ osx
 windows
 macos # Can't move cursor (QTBUG-76312)
 
-[acceptNavigationRequestNavigationType]
-b2qt arm
-
 [comboBoxPopupPositionAfterMove]
 macos
 
diff --git a/tests/auto/widgets/qwebenginepage/resources/reload.html b/tests/auto/widgets/qwebenginepage/resources/reload.html
index d9c33dfcd57..6fc570caeb2 100644
--- a/tests/auto/widgets/qwebenginepage/resources/reload.html
+++ b/tests/auto/widgets/qwebenginepage/resources/reload.html
@@ -1,6 +1,6 @@
 <html>
 <head>
-<meta http-equiv="refresh" content="2">
+<meta http-equiv="refresh" content="2;url=">
 </head>
 <body>
 This is test content
diff --git a/tests/auto/widgets/qwebengineview/BLACKLIST b/tests/auto/widgets/qwebengineview/BLACKLIST
index 356f9c9b0c2..26f2da4bbe8 100644
--- a/tests/auto/widgets/qwebengineview/BLACKLIST
+++ b/tests/auto/widgets/qwebengineview/BLACKLIST
@@ -8,6 +8,5 @@ windows
 windows
 
 [horizontalScrollbarTest]
-b2qt # different scrollbar
 macos
 rhel # flaky
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index c242d240efb..a0f93faac87 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -684,6 +684,12 @@ void tst_QWebEngineView::unhandledKeyEventPropagation()
 
 void tst_QWebEngineView::horizontalScrollbarTest()
 {
+#if QT_CONFIG(webengine_embedded_build)
+    // Embedded builds enable the OverlayScrollbar and Viewport features (see 'useEmbeddedSwitches' in web_engine_context.cpp).
+    // These features make the scrollbar simpler assuming we are on a device with small (usually touch) display.
+    // These scrollbars behave differently on mouse events.
+    QSKIP("Embedded builds have different scrollbar, skipping test.");
+#endif
     QString html("<html><body>"
                  "<div style='width: 1000px; height: 1000px; background-color: green' />"
                  "</body></html>");

From 18be6e81c7402314f211cbd54a9a8bfba56da2ec Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 28 Jul 2023 12:06:19 +0000
Subject: [PATCH 303/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iaeb236e40cc0b33435824a0f3c779358e227b341
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index f203dc3366f..fdc5a13b8ed 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: f6fd4107d4435568d0027839941f347af1e1e47f
+    ref: 635a41e1e5a12de7e8f9b8e95b2c290943194eb3
     required: true
   ../qtpositioning:
-    ref: d1b6953e3f8d1496df532d859b1a1fc7fdc5a009
+    ref: 492f5ba00970e2ffdfe72471b45495835dc60300
     required: false
   ../qttools:
-    ref: 1909f6d4ee9f259afeb10ac05dcdae26441a4b79
+    ref: 8231f8b30103cc2887bca5560d46caf47731f43d
     required: false
   ../qtwebchannel:
-    ref: 3c296df9b878c73825d16278d67f6d3c2cbd9524
+    ref: 3855e6a6e50d2143e982b24f01bd4c2fad4df3f3
     required: false

From a11534225920bc36a5302d98684d148bd9a09272 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 4 Jul 2023 16:47:03 +0200
Subject: [PATCH 304/681] Fix crash on Google Meet when dark mode is enabled

Extensions can use offscreen views to perform background tasks or
isolate script contexts. Avoid access of non-existing Qt delegate
by early return.

Task-number: QTBUG-113369
Change-Id: I361df0afc0da30c1a013380e1c97973153ffbfd3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0548893a182f2896c98ecc252e9811261a08d982)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index fcd684b4365..7561c5d7974 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -367,6 +367,9 @@ gfx::Rect RenderWidgetHostViewQt::GetViewBounds()
 
 void RenderWidgetHostViewQt::UpdateBackgroundColor()
 {
+    if (!m_delegate)
+        return;
+
     DCHECK(GetBackgroundColor());
     SkColor color = *GetBackgroundColor();
 

From e0ed6d02fa5a7aa8119c53f51c22b8aac9890947 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 11 Apr 2023 15:48:26 +0200
Subject: [PATCH 305/681] Fix print button of PDF viewer plugin

Do not try to start print preview automatically, just notify the
embedder via printRequested signal instead of crashing.
Also fix the signal name in WebEngineView docs.

Task-number: QTBUG-104610
Change-Id: I251e0b8f6f03a73236320a66a0d3c7690939d88b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3801a9244cb57bfb6b6b08be652f42a135b71142)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/printing/print_view_manager_qt.cpp        | 13 ++++++++++++-
 src/webenginequick/doc/src/webengineview_lgpl.qdoc |  5 +++--
 src/webenginewidgets/api/qwebengineview.cpp        |  3 ++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 7d8a796f773..892c9e40633 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -336,12 +336,23 @@ void PrintViewManagerQt::ShowScriptedPrintPreview(bool /*source_is_modifiable*/)
     // ignore for now
 }
 
-void PrintViewManagerQt::RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr /*params*/)
+void PrintViewManagerQt::RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr params)
 {
+    if (!m_printPreviewRfh && params->webnode_only) {
+        // The preview was requested by the print button of PDF viewer plugin. The code path ends up here, because
+        // Chromium automatically initiated a preview generation. We don't want that, just notify our embedder
+        // like we do in SetupScriptedPrintPreview() after window.print() and let them decide what to do.
+        content::WebContentsView *view = static_cast<content::WebContentsImpl*>(web_contents()->GetOutermostWebContents())->GetView();
+        if (WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client())
+            client->printRequested();
+        return;
+    }
+
     if (m_printSettings.empty()) {
         PrintPreviewDone();
         return;
     }
+
     mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> printRenderFrame;
     m_printPreviewRfh->GetRemoteAssociatedInterfaces()->GetInterface(&printRenderFrame);
     printRenderFrame->PrintPreview(m_printSettings.Clone());
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index c4d87dc4d18..8ba247d35b3 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -1334,10 +1334,11 @@
 */
 
 /*!
-    \qmlsignal WebEngineView::printRequest
+    \qmlsignal WebEngineView::printRequested
     \since QtWebEngine 1.8
 
-    This signal is emitted when the JavaScript \c{window.print()} method is called.
+    This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+    button of PDF viewer plugin.
     Typically, the signal handler can simply call printToPdf().
 
     \sa printToPdf
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 35fb9813879..8d88726fac8 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -1379,7 +1379,8 @@ void QWebEngineView::printToPdf(const std::function<void(const QByteArray&)> &re
     \fn void QWebEngineView::printRequested()
     \since 6.2
 
-    This signal is emitted when the JavaScript \c{window.print()} method is called.
+    This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+    button of PDF viewer plugin.
     Typically, the signal handler can simply call print().
 
     \sa print()

From 7570aa3b27ee81f98b54918c7ff2093b27a12570 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 12 Jul 2023 10:23:18 +0200
Subject: [PATCH 306/681] Do comments from api 6.6 review
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Additionally make destructor out of line in
qwebengineurlrequestinterceptor as it mirrors
qwebenigneurlresponeinterceptor.

Change-Id: I0cdf7eae9faa671415359368560fb8f6aabf05fe
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit ab21f39c6a54be331dd8a155d3374bfe790e0274)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/CMakeLists.txt                           |  3 ++-
 src/core/api/qtwebenginecoreglobal.h                  |  3 ++-
 src/core/api/qwebengineglobalsettings.cpp             |  6 +++---
 src/core/api/qwebengineglobalsettings.h               |  8 ++++----
 src/core/api/qwebenginepage.cpp                       |  4 ++--
 src/core/api/qwebenginepage.h                         |  2 +-
 src/core/api/qwebengineurlrequestinterceptor.cpp      | 11 +++++++++++
 src/core/api/qwebengineurlrequestinterceptor.h        |  3 +--
 src/core/api/qwebengineurlresponseinfo.h              |  8 ++++----
 src/core/api/qwebengineurlresponseinterceptor.cpp     | 10 ++++++++++
 src/core/api/qwebengineurlresponseinterceptor.h       |  3 +--
 src/core/net/system_network_context_manager.cpp       |  2 +-
 src/webenginequick/api/qquickwebengineprofile.h       |  2 +-
 .../tst_qwebengineglobalsettings.cpp                  |  2 +-
 14 files changed, 44 insertions(+), 23 deletions(-)
 create mode 100644 src/core/api/qwebengineurlrequestinterceptor.cpp
 create mode 100644 src/core/api/qwebengineurlresponseinterceptor.cpp

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index c0ff8034690..b3a13274625 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -33,7 +33,8 @@ qt_internal_add_module(WebEngineCore
         qwebenginescriptcollection.cpp qwebenginescriptcollection.h qwebenginescriptcollection_p.h
         qwebenginesettings.cpp qwebenginesettings.h
         qwebengineurlrequestinfo.cpp qwebengineurlrequestinfo.h qwebengineurlrequestinfo_p.h
-        qwebengineurlrequestinterceptor.h qwebengineurlresponseinterceptor.h
+        qwebengineurlrequestinterceptor.h qwebengineurlrequestinterceptor.cpp
+        qwebengineurlresponseinterceptor.h qwebengineurlresponseinterceptor.cpp
         qwebengineurlresponseinfo.cpp qwebengineurlresponseinfo.h qwebengineurlresponseinfo_p.h
         qwebengineurlrequestjob.cpp qwebengineurlrequestjob.h
         qwebengineurlscheme.cpp qwebengineurlscheme.h
diff --git a/src/core/api/qtwebenginecoreglobal.h b/src/core/api/qtwebenginecoreglobal.h
index 166a82b788d..0041a72be79 100644
--- a/src/core/api/qtwebenginecoreglobal.h
+++ b/src/core/api/qtwebenginecoreglobal.h
@@ -5,11 +5,12 @@
 #define QTWEBENGINECOREGLOBAL_H
 
 #include <QtCore/qglobal.h>
-#include <QtCore/qurl.h>
 #include <QtWebEngineCore/qtwebenginecore-config.h>
 
 QT_BEGIN_NAMESPACE
 
+class QUrl;
+
 #if defined(BUILDING_CHROMIUM)
 #  define Q_WEBENGINECORE_EXPORT Q_DECL_EXPORT
 #else
diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
index a12c8d2fd33..b4b09e01331 100644
--- a/src/core/api/qwebengineglobalsettings.cpp
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -39,7 +39,7 @@ QWebEngineGlobalSettings::~QWebEngineGlobalSettings() { }
 
     Gets the global instance of QWebEngineGlobalSettings.
 */
-QWebEngineGlobalSettings *QWebEngineGlobalSettings::GetInstance()
+QWebEngineGlobalSettings *QWebEngineGlobalSettings::instance()
 {
     static QWebEngineGlobalSettings settings;
     return &settings;
@@ -58,7 +58,7 @@ QWebEngineGlobalSettings *QWebEngineGlobalSettings::GetInstance()
 */
 
 /*!
-    \fn QWebEngineGlobalSettings::configureDnsOverHttps(const DnsMode dnsMode,
+    \fn QWebEngineGlobalSettings::configureDnsOverHttps(DnsMode dnsMode,
                                                         const QString &dnsOverHttpsTemplates)
 
     Configures the Chromium stub host resolver, thus allowing DNS-over-HTTPS functionality.
@@ -73,7 +73,7 @@ QWebEngineGlobalSettings *QWebEngineGlobalSettings::GetInstance()
     valid \l{https://datatracker.ietf.org/doc/html/rfc6570}{URI templates} separated by
     whitespace characters. One example URI template is https://dns.google/dns-query{?dns}.
 */
-void QWebEngineGlobalSettings::configureDnsOverHttps(const DnsMode dnsMode,
+void QWebEngineGlobalSettings::configureDnsOverHttps(DnsMode dnsMode,
                                                      const QString &dnsOverHttpsTemplates)
 {
     Q_D(QWebEngineGlobalSettings);
diff --git a/src/core/api/qwebengineglobalsettings.h b/src/core/api/qwebengineglobalsettings.h
index a65a0835993..cec2c136bda 100644
--- a/src/core/api/qwebengineglobalsettings.h
+++ b/src/core/api/qwebengineglobalsettings.h
@@ -19,21 +19,21 @@ class QWebEngineGlobalSettingsPrivate;
 class Q_WEBENGINECORE_EXPORT QWebEngineGlobalSettings : public QObject
 {
     Q_OBJECT
-    Q_DISABLE_COPY(QWebEngineGlobalSettings)
 public:
-    static QWebEngineGlobalSettings *GetInstance();
+    static QWebEngineGlobalSettings *instance();
 
     // Mapping net::SecureDnsMode
     enum class DnsMode { WithFallback = 1, Secure = 2 };
 
-    void configureDnsOverHttps(const DnsMode dnsMode, const QString &dnsOverHttpsTemplates);
+    void configureDnsOverHttps(DnsMode dnsMode, const QString &dnsOverHttpsTemplates);
 
 private:
     QWebEngineGlobalSettings(QObject *p = nullptr);
-    ~QWebEngineGlobalSettings();
+    ~QWebEngineGlobalSettings() override;
 
     friend class QtWebEngineCore::SystemNetworkContextManager;
     Q_DECLARE_PRIVATE(QWebEngineGlobalSettings)
+    // can't re-use base d_ptr: need to maintain compat with last Qt LTS
     QScopedPointer<QWebEngineGlobalSettingsPrivate> d_ptr;
 };
 
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 4c0b7b8ff6c..37a0d9ff3d6 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -2135,9 +2135,9 @@ void QWebEnginePage::setDevToolsPage(QWebEnginePage *devToolsPage)
    Protocol}.
 */
 
-QString QWebEnginePage::devToolsId()
+QString QWebEnginePage::devToolsId() const
 {
-    Q_D(QWebEnginePage);
+    Q_D(const QWebEnginePage);
     d->ensureInitialized();
     return d->adapter->devToolsId();
 }
diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
index d0f1c70ee48..c76cc0487e9 100644
--- a/src/core/api/qwebenginepage.h
+++ b/src/core/api/qwebenginepage.h
@@ -286,7 +286,7 @@ class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
     QWebEnginePage *inspectedPage() const;
     void setDevToolsPage(QWebEnginePage *page);
     QWebEnginePage *devToolsPage() const;
-    QString devToolsId();
+    QString devToolsId() const;
 
     void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
     void setUrlResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor);
diff --git a/src/core/api/qwebengineurlrequestinterceptor.cpp b/src/core/api/qwebengineurlrequestinterceptor.cpp
new file mode 100644
index 00000000000..c3cd49a5bce
--- /dev/null
+++ b/src/core/api/qwebengineurlrequestinterceptor.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineurlrequestinterceptor.h"
+
+QT_BEGIN_NAMESPACE
+
+// Has to stay empty till Qt7
+QWebEngineUrlRequestInterceptor::~QWebEngineUrlRequestInterceptor() = default;
+
+QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index 98f135e733d..2ca8ee914e5 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -14,10 +14,9 @@ QT_BEGIN_NAMESPACE
 class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject
 {
     Q_OBJECT
-    Q_DISABLE_COPY(QWebEngineUrlRequestInterceptor)
 public:
     explicit QWebEngineUrlRequestInterceptor(QObject *p = nullptr) : QObject(p) {}
-
+    ~QWebEngineUrlRequestInterceptor() override;
     virtual void interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
 };
 
diff --git a/src/core/api/qwebengineurlresponseinfo.h b/src/core/api/qwebengineurlresponseinfo.h
index c9f444768a5..980c259288d 100644
--- a/src/core/api/qwebengineurlresponseinfo.h
+++ b/src/core/api/qwebengineurlresponseinfo.h
@@ -40,10 +40,10 @@ class Q_WEBENGINECORE_EXPORT QWebEngineUrlResponseInfo : public QObject
     Q_DECLARE_PRIVATE(QWebEngineUrlResponseInfo)
     QWebEngineUrlResponseInfoPrivate *d_ptr;
 
-    QWebEngineUrlResponseInfo(const QUrl &requestUrl,
-                              const QMultiHash<QByteArray, QByteArray> &requestHeaders,
-                              const QHash<QByteArray, QByteArray> &responseHeaders,
-                              QObject *p = nullptr);
+    explicit QWebEngineUrlResponseInfo(const QUrl &requestUrl,
+                                       const QMultiHash<QByteArray, QByteArray> &requestHeaders,
+                                       const QHash<QByteArray, QByteArray> &responseHeaders,
+                                       QObject *p = nullptr);
 };
 
 QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlresponseinterceptor.cpp b/src/core/api/qwebengineurlresponseinterceptor.cpp
new file mode 100644
index 00000000000..3c9c6f36bd0
--- /dev/null
+++ b/src/core/api/qwebengineurlresponseinterceptor.cpp
@@ -0,0 +1,10 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineurlresponseinterceptor.h"
+
+QT_BEGIN_NAMESPACE
+
+QWebEngineUrlResponseInterceptor::~QWebEngineUrlResponseInterceptor() = default;
+
+QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlresponseinterceptor.h b/src/core/api/qwebengineurlresponseinterceptor.h
index 505acce5723..d3526861b91 100644
--- a/src/core/api/qwebengineurlresponseinterceptor.h
+++ b/src/core/api/qwebengineurlresponseinterceptor.h
@@ -15,10 +15,9 @@ class QWebEngineUrlResponseInfo;
 class Q_WEBENGINECORE_EXPORT QWebEngineUrlResponseInterceptor : public QObject
 {
     Q_OBJECT
-    Q_DISABLE_COPY(QWebEngineUrlResponseInterceptor)
 public:
     explicit QWebEngineUrlResponseInterceptor(QObject *p = nullptr) : QObject(p) { }
-
+    ~QWebEngineUrlResponseInterceptor() override;
     virtual void interceptResponseHeaders(QWebEngineUrlResponseInfo &info) = 0;
 };
 
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index 1a7b01ce898..e96af8200a2 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -265,7 +265,7 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
     // resolver of the network service here, each time it is instantiated, with our global
     // DNS-Over-HTTPS settings. This ensures that the global settings don't get lost
     // on reinstantiation and are in effect upon initial instantiation.
-    QWebEngineGlobalSettings *const globalSettings = QWebEngineGlobalSettings::GetInstance();
+    QWebEngineGlobalSettings *const globalSettings = QWebEngineGlobalSettings::instance();
     if (globalSettings->d_ptr->isDnsOverHttpsUserConfigured) {
         const bool insecureDnsClientEnabled = globalSettings->d_ptr->insecureDnsClientEnabled;
         const bool additionalInsecureDnsTypesEnabled =
diff --git a/src/webenginequick/api/qquickwebengineprofile.h b/src/webenginequick/api/qquickwebengineprofile.h
index 43b02e45a64..fd6cdb4f892 100644
--- a/src/webenginequick/api/qquickwebengineprofile.h
+++ b/src/webenginequick/api/qquickwebengineprofile.h
@@ -8,7 +8,6 @@
 #include <QtCore/qobject.h>
 #include <QtCore/qscopedpointer.h>
 #include <QtCore/qstring.h>
-#include <QtWebEngineCore/qwebengineurlresponseinterceptor.h>
 #include <QtQml/qqmlregistration.h>
 
 QT_BEGIN_NAMESPACE
@@ -19,6 +18,7 @@ class QWebEngineClientCertificateStore;
 class QWebEngineCookieStore;
 class QWebEngineNotification;
 class QWebEngineUrlRequestInterceptor;
+class QWebEngineUrlResponseInterceptor;
 class QWebEngineUrlSchemeHandler;
 class QQuickWebEngineScriptCollection;
 class QQuickWebEngineProfilePrivate;
diff --git a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
index 409b0eb0cbd..71788ded57f 100644
--- a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
+++ b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
@@ -87,7 +87,7 @@ void tst_QWebEngineGlobalSettings::dnsOverHttps()
     connect(&page, &QWebEnginePage::loadFinished, this,
             [&isLoadSuccessful](bool ok) { isLoadSuccessful = ok; });
 
-    QWebEngineGlobalSettings *globalSettings = QWebEngineGlobalSettings::GetInstance();
+    QWebEngineGlobalSettings *globalSettings = QWebEngineGlobalSettings::instance();
     globalSettings->configureDnsOverHttps(dnsMode, uriTemplate);
 
     page.load(QUrl("https://google.com/"));

From a80e1d3b084b7bd524504eb2dd8782ba5c386251 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 4 Jul 2023 16:47:03 +0200
Subject: [PATCH 307/681] Fix crash on Google Meet when dark mode is enabled

Extensions can use offscreen views to perform background tasks or
isolate script contexts. Avoid access of non-existing Qt delegate
by early return.

Task-number: QTBUG-113369
Change-Id: I361df0afc0da30c1a013380e1c97973153ffbfd3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0548893a182f2896c98ecc252e9811261a08d982)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 3d4e5bbc2cd..aa903577f0f 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -368,6 +368,9 @@ gfx::Rect RenderWidgetHostViewQt::GetViewBounds()
 
 void RenderWidgetHostViewQt::UpdateBackgroundColor()
 {
+    if (!m_delegate)
+        return;
+
     DCHECK(GetBackgroundColor());
     SkColor color = *GetBackgroundColor();
 

From 565e6be400459117087febbab3162248bd8a0cbd Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 28 Jun 2023 15:59:23 +0200
Subject: [PATCH 308/681] Make visual studio configure check last
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Check first for the compiler version as visual studio
test assumes the compiler is valid and the error message
can be misleading in a case the test fails.

Fixes: QTBUG-114875
Change-Id: Ie25185943845cbbfd0dc45334161fba245fb86ea
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 886c3fe8d5e7d9e4938943c04efb943660d4a96e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index 51ef08f0326..688c68d4e70 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -583,11 +583,6 @@ add_check_for_support(
    MESSAGE "Could not find all necessary libraries for qpa-xcb support.\
 ${xcbErrorMessage}"
 )
-add_check_for_support(
-   MODULES QtWebEngine QtPdf
-   CONDITION NOT MSVC OR TEST_winversion
-   MESSAGE "Build requires Visual Studio 2022 or higher."
-)
 add_check_for_support(
    MODULES QtWebEngine
    CONDITION MSVC OR
@@ -610,7 +605,6 @@ add_check_for_support(
    MESSAGE
        "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )
-
 if(WIN32)
     if(MSVC)
         add_check_for_support(
@@ -629,6 +623,11 @@ if(WIN32)
         MESSAGE "Build requires Windows 11 SDK at least version 10.0.22621.0"
     )
 endif()
+add_check_for_support(
+   MODULES QtWebEngine QtPdf
+   CONDITION NOT MSVC OR TEST_winversion
+   MESSAGE "Build requires Visual Studio 2022 or higher."
+)
 
 #### Summary
 

From 1d20ba58eb16e131ff1445cbdab36ce27e9df9df Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 6 Apr 2023 11:54:55 +0200
Subject: [PATCH 309/681] Migrate hostcompiler test to cmake host project
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Check for 32-bit support in case of 64bit compiler and
cross-compilation. This is required as v8 context
generator needs same bit width as target one.

Change-Id: I921e9e657c9caa97d3c6b63f7c1c87ab1052c92f
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit b698955b933e20ef3cf83ed6c7bb8bbd7cce3aca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 config.tests/hostcompiler/hostcompiler.pro         |  9 ---------
 src/host/CMakeLists.txt                            | 14 ++++++++++++++
 src/host/config.tests/hostcompiler/CMakeLists.txt  | 11 +++++++++++
 .../host/config.tests}/hostcompiler/main.cpp       |  0
 4 files changed, 25 insertions(+), 9 deletions(-)
 delete mode 100644 config.tests/hostcompiler/hostcompiler.pro
 create mode 100644 src/host/config.tests/hostcompiler/CMakeLists.txt
 rename {config.tests => src/host/config.tests}/hostcompiler/main.cpp (100%)

diff --git a/config.tests/hostcompiler/hostcompiler.pro b/config.tests/hostcompiler/hostcompiler.pro
deleted file mode 100644
index 5a80246ab01..00000000000
--- a/config.tests/hostcompiler/hostcompiler.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-option(host_build)
-
-gcc:equals(QT_ARCH, "x86_64"):contains(QT_TARGET_ARCH, "arm"):!contains(QT_TARGET_ARCH, "arm64") {
-    QMAKE_CXXFLAGS += -m32
-    QMAKE_LFLAGS += -m32
-}
-
-SOURCES = main.cpp
-
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 08da14c1d5a..d90c6dea2ec 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -49,3 +49,17 @@ if(QT_FEATURE_qtpdf_build)
     )
 endif()
 
+# TODO: this could be run as part of main configure with execute_process
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU AND TEST_architecture_arch STREQUAL "x86_64"
+AND GN_TARGET_CPU STREQUAL "arm")
+    try_compile(
+        has32HostCompiler
+        "${CMAKE_CURRENT_BINARY_DIR}/config.tests/hostcompiler"
+        "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/hostcompiler"
+        hostcompiler
+    )
+    if(NOT has32HostCompiler)
+        MESSAGE(FATAL_ERROR "Compiler does not support 32bit compilation")
+    endif()
+endif()
diff --git a/src/host/config.tests/hostcompiler/CMakeLists.txt b/src/host/config.tests/hostcompiler/CMakeLists.txt
new file mode 100644
index 00000000000..f36886d0a55
--- /dev/null
+++ b/src/host/config.tests/hostcompiler/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(arch LANGUAGES CXX)
+
+add_executable(host_compiler_test)
+set_property(TARGET host_compiler_test PROPERTY MACOSX_BUNDLE FALSE)
+target_sources(host_compiler_test PRIVATE main.cpp)
+target_compile_options(host_compiler_test PRIVATE -m32)
+target_link_options(host_compiler_test PRIVATE -m32)
diff --git a/config.tests/hostcompiler/main.cpp b/src/host/config.tests/hostcompiler/main.cpp
similarity index 100%
rename from config.tests/hostcompiler/main.cpp
rename to src/host/config.tests/hostcompiler/main.cpp

From 6ae3d3a65a8189f502f7641135c172a8e15bd895 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 31 Jul 2023 16:54:19 +0000
Subject: [PATCH 310/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I9285c38480b016ae4a84c2b75935b5257d1b0298
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 64f5bb7d1ec..42745240390 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3b6a51f53cd07e4fd8bc6e9ea414d099ca91314f
+    ref: bfab75938f8e6471ce7ac964123bd08e4e8bfe87
     required: true
   ../qtpositioning:
-    ref: fa400cfc3d2fdc598f19a447a690c6c7cf6d4a63
+    ref: 634e2d661b8b260cd51e843c7dd0deaa5e6ca8c7
     required: false
   ../qttools:
-    ref: 1bfb469e614e2f35870a60fcdd934c6f893666a1
+    ref: dfafcb6938a02bd0e0b3df9c2859ff712cd61d27
     required: false
   ../qtwebchannel:
-    ref: fab8735e499ec7fab5092aa6991aa9988c391207
+    ref: 1da35c5961dec8d5055df0493ffaf734df774e56
     required: false

From 5f253838bd86e3a8e34fffc006ae6031485d2176 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 1 Aug 2023 08:32:55 +0000
Subject: [PATCH 311/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iea2c859e8e37bb1ac1b07bcde3e7fd8bb768df2d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index fdc5a13b8ed..5b0cde5a1b9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 635a41e1e5a12de7e8f9b8e95b2c290943194eb3
+    ref: 62a17d36d48d6fa76da5012f55b1276d3cfa3b40
     required: true
   ../qtpositioning:
-    ref: 492f5ba00970e2ffdfe72471b45495835dc60300
+    ref: 3e0e7c28dfe3a774b2375dba6f2db1bb0423b3ad
     required: false
   ../qttools:
-    ref: 8231f8b30103cc2887bca5560d46caf47731f43d
+    ref: 8d67a51a0894ebafdeeddb46676be4b841e72426
     required: false
   ../qtwebchannel:
-    ref: 3855e6a6e50d2143e982b24f01bd4c2fad4df3f3
+    ref: 63573c17ab2f7011bb01191c80c7ade0eee07f2d
     required: false

From 30a5412dd4659bf08e6915284fff5ff6324f5653 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 1 Aug 2023 11:42:23 +0200
Subject: [PATCH 312/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty dd25f259..b5888eec:
* Revert "Disable advanced arm64 control-flow"
* Use a different file name for v8 context snapshot in debug mode
* FIXUP: Add extensions to Qt build and fix it up for building
* FIXUP: Fix vaapi support for QtWebEngine
* Disable advanced arm64 control-flow
* [Backport] Security bug 1443100
* [Backport] CVE-2023-3740: Insufficient validation of untrusted input in Themes
* [Backport] CVE-2023-3737: Inappropriate implementation in Notifications
* [Backport] CVE-2023-3732: Out of bounds memory access in Mojo
* FIXUP: Fix license generation
* FIXUP: Fixes for building with MSVC
* FIXUP: Add missing include for Supplement
* FIXUP: Fixes for jumbo build

Fixes: QTBUG-115690
Change-Id: Ic4503791bd0d115681998ef7a22733a64aa665e6
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index dd25f25955c..b5888eec6fc 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit dd25f25955c8a1701c322846c3ba6fefe0f7fb62
+Subproject commit b5888eec6fcc052c4cda569599f5096bd6f5d667

From e732e802897a949781c35aa8365860b898a58e29 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 2 Aug 2023 08:40:33 +0200
Subject: [PATCH 313/681] Blacklist acceptNavigationRequestNavigationType again
 for qemu

e354d602e54 removes the test from balcklist however
ci is blocked as test fails all the time now with

'expectedList.size() == page.navigations.size()' in
tst_qwebenginepage.cpp(730)

Change-Id: I6b2c1fbb5a6fa3c8ba3234e06501063638b309b8
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Martin Negyokru <negyokru@inf.u-szeged.hu>
---
 tests/auto/widgets/qwebenginepage/BLACKLIST | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST
index 52def48d170..66c5de42c7e 100644
--- a/tests/auto/widgets/qwebenginepage/BLACKLIST
+++ b/tests/auto/widgets/qwebenginepage/BLACKLIST
@@ -5,6 +5,9 @@ osx
 windows
 macos # Can't move cursor (QTBUG-76312)
 
+[acceptNavigationRequestNavigationType]
+b2qt arm
+
 [comboBoxPopupPositionAfterMove]
 macos
 

From 2200dada4cb9d8802c111a4c8d91d7b191e113de Mon Sep 17 00:00:00 2001
From: Yigit Akcay <yigit.akcay@qt.io>
Date: Fri, 28 Apr 2023 18:11:46 +0200
Subject: [PATCH 314/681] Improve DNS-over-HTTPS configuration logic
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch improves the DNS-over-HTTPS configuration and sets defaults
for the general DNS logic. The following changes are included:

- Insecure Chromium DNS client is always OFF (OFF is the Chromium
  default as well)
- Add DnsMode::SystemOnly, which configures Chromium to only use the
  system DNS
- The default DNS configuration is DnsMode::SystemOnly
- Rename DnsMode::Secure to DnsMode::SecureOnly and
  DnsMode::WithFallback to DnsMode::SecureWithFallback to be clearer
  what each enum value does
- Add error handling for invalid URI templates
- Added test cases to handle the new logic
- Some minor refactoring for cleanup purposes with the new defaults and
  logic taken into consideration
- Some minor bug fixes

Task-number: QTBUG-98284
Change-Id: Ie332166f8b5b83c8939af35e4eb8b69b417abdcf
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit a80b5d2299af8cea49ff0d2c02ae7632efe6d82b)
---
 src/core/api/qwebengineglobalsettings.cpp     | 98 +++++++++++++------
 src/core/api/qwebengineglobalsettings.h       |  5 +-
 src/core/api/qwebengineglobalsettings_p.h     | 14 +--
 .../net/system_network_context_manager.cpp    | 13 +--
 .../tst_qwebengineglobalsettings.cpp          | 73 ++++++++------
 5 files changed, 120 insertions(+), 83 deletions(-)

diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
index b4b09e01331..0f2472c47b8 100644
--- a/src/core/api/qwebengineglobalsettings.cpp
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -3,16 +3,23 @@
 
 #include "qwebengineglobalsettings.h"
 #include "qwebengineglobalsettings_p.h"
+#include <QDebug>
 
 #ifdef signals
 #undef signals
 #endif
 
+#include "content/browser/network_service_instance_impl.h"
 #include "content/public/browser/network_service_instance.h"
 #include "services/network/network_service.h"
 
 QT_BEGIN_NAMESPACE
 
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kSecure, QWebEngineGlobalSettings::DnsMode::SecureOnly)
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kAutomatic,
+                   QWebEngineGlobalSettings::DnsMode::SecureWithFallback)
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kOff, QWebEngineGlobalSettings::DnsMode::SystemOnly)
+
 /*!
     \class QWebEngineGlobalSettings
     \brief The QWebEngineGlobalSettings class configures global properties of the web engine.
@@ -22,9 +29,9 @@ QT_BEGIN_NAMESPACE
     The QWebEngineGlobalSettings class is a singleton that configures global properties
     of the web engine.
 
-    Invoke configureDnsOverHttps() to configure DNS-over-HTTPS capabilities.
+    Invoke setDnsMode() and setDnsServerTemplates() to configure DNS-over-HTTPS.
 
-    \sa QWebEngineGlobalSettings::configureDnsOverHttps()
+    \sa QWebEngineGlobalSettings::setDnsMode(), QWebEngineGlobalSettings::setDnsServerTemplates()
 */
 
 QWebEngineGlobalSettings::QWebEngineGlobalSettings(QObject *p)
@@ -50,46 +57,73 @@ QWebEngineGlobalSettings *QWebEngineGlobalSettings::instance()
 
     This enum sets the DNS-over-HTTPS mode:
 
-    \value WithFallback Enable DNS-over-HTTPS with fallbacks. If a host
-    can't be resolved, try the insecure DNS client of Chromium. If that fails as
-    well, try the system DNS host resolution, which can be secure or insecure.
-    \value Secure Enable DNS-over-HTTPS and only allow the secure Chromium
-    DNS client to resolve hosts.
+    \value SystemOnly This is the default. Use the system DNS host resolution.
+    \value SecureWithFallback Enable DNS-over-HTTPS (DoH). DoH servers have to be
+    provided through QWebEngineGlobalSettings::setDnsServerTemplates(). If a host can't be resolved
+    via the provided servers, the system DNS host resolution is used.
+    \value SecureOnly Enable DNS-over-HTTPS and only allow hosts to be resolved this way.
+    DoH servers have to be provided through QWebEngineGlobalSettings::setDnsServerTemplates().
+    If the DNS-over-HTTPS resolution fails, there is no fallback and DNS host resolution
+    fails completely.
 */
 
 /*!
-    \fn QWebEngineGlobalSettings::configureDnsOverHttps(DnsMode dnsMode,
-                                                        const QString &dnsOverHttpsTemplates)
+    \fn void QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode, const QStringList
+    &dnsServerTemplates)
+
+    Set \a dnsMode to DnsMode::SystemOnly to use the system DNS resolution.
+
+    Set \a dnsMode to DnsMode::SecureOnly to only allow DNS-over-HTTPS host resolution using servers
+    from \a dnsServerTemplates.
 
-    Configures the Chromium stub host resolver, thus allowing DNS-over-HTTPS functionality.
+    Set \a dnsMode to DnsMode::SecureWithFallback to enable DNS-over-HTTPS host resolution using
+    servers from \a dnsServerTemplates,with a fallback to the system DNS.
 
-    Set \a dnsMode to QWebEngineGlobalSettings::DnsMode::WithFallback to enable secure DNS
-    host resolution with a fallback to insecure DNS host resolution and a final fallback to
-    the system DNS resolution, which can be secure or insecure. Set it to
-    QWebEngineGlobalSettings::DnsMode::Secure to only allow secure DNS host resolution via
-    the Chromium DNS client.
+    A list \a dnsServerTemplates is a list of \l{https://datatracker.ietf.org/d7oc/html/rfc6570}{URI
+    templates}. One example URI template is https://dns.google/dns-query{?dns}.
 
-    Independently of \a {dnsMode}, \a dnsOverHttpsTemplates has to be set to one or multiple
-    valid \l{https://datatracker.ietf.org/doc/html/rfc6570}{URI templates} separated by
-    whitespace characters. One example URI template is https://dns.google/dns-query{?dns}.
+    This function returns \c false if the \a dnsServerTemplates list is empty or contains URI
+    templates that cannot be parsed for DnsMode::SecureOnly or DnsMode::SecureWithFallback.
+    Otherwise, it returns \c true meaning the DNS mode change is triggered.
 */
-void QWebEngineGlobalSettings::configureDnsOverHttps(DnsMode dnsMode,
-                                                     const QString &dnsOverHttpsTemplates)
+bool QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode, const QStringList &dnsServerTemplates)
 {
     Q_D(QWebEngineGlobalSettings);
-
+    if (dnsMode != DnsMode::SystemOnly) {
+        const QString servers = dnsServerTemplates.join(QChar::Space);
+        const std::string templates = servers.toStdString();
+        absl::optional<net::DnsOverHttpsConfig> dnsOverHttpsConfig =
+                net::DnsOverHttpsConfig::FromString(templates);
+        if (!dnsOverHttpsConfig.has_value())
+            return false;
+        d->dnsOverHttpsTemplates = templates;
+    }
     d->dnsMode = dnsMode;
-    d->dnsOverHttpsTemplates = dnsOverHttpsTemplates.toStdString();
-    d->isDnsOverHttpsUserConfigured = true;
-
-    // Make sure that DoH settings are in effect immediately if the network service already exists,
-    // thus allowing to change DoH configuration at any point
-    network::mojom::NetworkService *networkService = content::GetNetworkService();
-    if (networkService) {
-        networkService->ConfigureStubHostResolver(
-                d->insecureDnsClientEnabled, net::SecureDnsMode(d->dnsMode),
-                *net::DnsOverHttpsConfig::FromString(d->dnsOverHttpsTemplates),
-                d->additionalInsecureDnsTypesEnabled);
+    d->configureStubHostResolver();
+    return true;
+}
+
+/*!
+    \internal
+*/
+void QWebEngineGlobalSettingsPrivate::configureStubHostResolver()
+{
+    if (content::GetNetworkServiceAvailability()
+        != content::NetworkServiceAvailability::NOT_CREATED) {
+        network::mojom::NetworkService *networkService = content::GetNetworkService();
+        if (networkService) {
+            qDebug() << "doh set to" << dnsOverHttpsTemplates << " -- "
+                     << (dnsMode == QWebEngineGlobalSettings::DnsMode::SecureOnly ? "SecureOnly"
+                                 : dnsMode == QWebEngineGlobalSettings::DnsMode::SystemOnly
+                                 ? "SystemOnly"
+                                 : "SecureWithFallback");
+            absl::optional<net::DnsOverHttpsConfig> dohConfig = dnsOverHttpsTemplates.empty()
+                    ? net::DnsOverHttpsConfig()
+                    : net::DnsOverHttpsConfig::FromString(dnsOverHttpsTemplates);
+            networkService->ConfigureStubHostResolver(insecureDnsClientEnabled,
+                                                      net::SecureDnsMode(dnsMode), *dohConfig,
+                                                      additionalInsecureDnsTypesEnabled);
+        }
     }
 }
 
diff --git a/src/core/api/qwebengineglobalsettings.h b/src/core/api/qwebengineglobalsettings.h
index cec2c136bda..f89aeeadb64 100644
--- a/src/core/api/qwebengineglobalsettings.h
+++ b/src/core/api/qwebengineglobalsettings.h
@@ -23,9 +23,8 @@ class Q_WEBENGINECORE_EXPORT QWebEngineGlobalSettings : public QObject
     static QWebEngineGlobalSettings *instance();
 
     // Mapping net::SecureDnsMode
-    enum class DnsMode { WithFallback = 1, Secure = 2 };
-
-    void configureDnsOverHttps(DnsMode dnsMode, const QString &dnsOverHttpsTemplates);
+    enum class DnsMode { SystemOnly = 0, SecureWithFallback = 1, SecureOnly = 2 };
+    bool setDnsMode(DnsMode dnsMode, const QStringList &dnsServerTemplates);
 
 private:
     QWebEngineGlobalSettings(QObject *p = nullptr);
diff --git a/src/core/api/qwebengineglobalsettings_p.h b/src/core/api/qwebengineglobalsettings_p.h
index 4c15f62b0bd..412697c0f40 100644
--- a/src/core/api/qwebengineglobalsettings_p.h
+++ b/src/core/api/qwebengineglobalsettings_p.h
@@ -25,17 +25,17 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineGlobalSettingsPrivate
 {
 public:
     QWebEngineGlobalSettingsPrivate()
-        : dnsMode(QWebEngineGlobalSettings::DnsMode::WithFallback)
+        : dnsMode(QWebEngineGlobalSettings::DnsMode::SystemOnly)
         , dnsOverHttpsTemplates("")
-        , insecureDnsClientEnabled(true)
-        , additionalInsecureDnsTypesEnabled(true)
-        , isDnsOverHttpsUserConfigured(false){};
+        , insecureDnsClientEnabled(false)
+        , additionalInsecureDnsTypesEnabled(false){};
 
     QWebEngineGlobalSettings::DnsMode dnsMode;
     std::string dnsOverHttpsTemplates;
-    bool insecureDnsClientEnabled;
-    bool additionalInsecureDnsTypesEnabled;
-    bool isDnsOverHttpsUserConfigured;
+    const bool insecureDnsClientEnabled;
+    const bool additionalInsecureDnsTypesEnabled;
+
+    void configureStubHostResolver();
 };
 
 QT_END_NAMESPACE
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index e96af8200a2..ed676fcbc8d 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -265,18 +265,7 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
     // resolver of the network service here, each time it is instantiated, with our global
     // DNS-Over-HTTPS settings. This ensures that the global settings don't get lost
     // on reinstantiation and are in effect upon initial instantiation.
-    QWebEngineGlobalSettings *const globalSettings = QWebEngineGlobalSettings::instance();
-    if (globalSettings->d_ptr->isDnsOverHttpsUserConfigured) {
-        const bool insecureDnsClientEnabled = globalSettings->d_ptr->insecureDnsClientEnabled;
-        const bool additionalInsecureDnsTypesEnabled =
-                globalSettings->d_ptr->additionalInsecureDnsTypesEnabled;
-        const net::SecureDnsMode dnsMode = net::SecureDnsMode(globalSettings->d_ptr->dnsMode);
-        const absl::optional<net::DnsOverHttpsConfig> dnsOverHttpsTemplates =
-                net::DnsOverHttpsConfig::FromString(globalSettings->d_ptr->dnsOverHttpsTemplates);
-        content::GetNetworkService()->ConfigureStubHostResolver(insecureDnsClientEnabled, dnsMode,
-                                                                *dnsOverHttpsTemplates,
-                                                                additionalInsecureDnsTypesEnabled);
-    }
+    QWebEngineGlobalSettings::instance()->d_ptr->configureStubHostResolver();
 }
 
 void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams(network::mojom::NetworkContextParams *network_context_params)
diff --git a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
index 71788ded57f..e3986674f04 100644
--- a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
+++ b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
@@ -36,15 +36,21 @@ void tst_QWebEngineGlobalSettings::dnsOverHttps_data()
 {
     QTest::addColumn<QWebEngineGlobalSettings::DnsMode>("dnsMode");
     QTest::addColumn<QString>("uriTemplate");
-    QTest::addColumn<bool>("isWithCustomDnsServer");
+    QTest::addColumn<bool>("isMockDnsServerCalledExpected");
     QTest::addColumn<bool>("isDnsResolutionSuccessExpected");
-    QTest::newRow("DnsMode::Secure (mock DNS)")
-            << QWebEngineGlobalSettings::DnsMode::Secure
-            << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << false;
-    QTest::newRow("DnsMode::Secure (real DNS)")
-            << QWebEngineGlobalSettings::DnsMode::Secure
-            << QStringLiteral("https://dns.google/dns-query{?dns}") << false << true;
-
+    QTest::addColumn<bool>("isConfigurationSuccessExpected");
+    QTest::newRow("DnsMode::SystemOnly (no DoH server)")
+            << QWebEngineGlobalSettings::DnsMode::SystemOnly << QStringLiteral("") << false << true
+            << true;
+    QTest::newRow("DnsMode::SecureOnly (mock DoH server)")
+            << QWebEngineGlobalSettings::DnsMode::SecureOnly
+            << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << false << true;
+    QTest::newRow("DnsMode::SecureOnly (real DoH server)")
+            << QWebEngineGlobalSettings::DnsMode::SecureOnly
+            << QStringLiteral("https://dns.google/dns-query{?dns}") << false << true << true;
+    QTest::newRow("DnsMode::SecureOnly (Empty URI Templates)")
+            << QWebEngineGlobalSettings::DnsMode::SecureOnly << QStringLiteral("") << false << false
+            << false;
     // Note: In the following test, we can't verify that the DoH server is called first and
     // afterwards insecure DNS is tried, because for the DoH server to ever be used when the DNS
     // mode is set to DnsMode::WithFallback, Chromium starts an asynchronous DoH server DnsProbe and
@@ -52,33 +58,45 @@ void tst_QWebEngineGlobalSettings::dnsOverHttps_data()
     // DNS response, which in turn requires that certificate errors aren't ignored and
     // non-self-signed certificates are used for correct encryption. Instead of implementing
     // all of that, this test verifies that Chromium tries probing the configured DoH server only.
-    QTest::newRow("DnsMode::WithFallback (mock DNS)")
-            << QWebEngineGlobalSettings::DnsMode::WithFallback
-            << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << true;
+    QTest::newRow("DnsMode::SecureWithFallback (mock DoH server)")
+            << QWebEngineGlobalSettings::DnsMode::SecureWithFallback
+            << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << true << true;
+    QTest::newRow("DnsMode::SecureWithFallback (Empty URI Templates)")
+            << QWebEngineGlobalSettings::DnsMode::SecureWithFallback << QStringLiteral("") << false
+            << false << false;
 }
 
 void tst_QWebEngineGlobalSettings::dnsOverHttps()
 {
     QFETCH(QWebEngineGlobalSettings::DnsMode, dnsMode);
     QFETCH(QString, uriTemplate);
-    QFETCH(bool, isWithCustomDnsServer);
+    QFETCH(bool, isMockDnsServerCalledExpected);
     QFETCH(bool, isDnsResolutionSuccessExpected);
-    bool isDnsServerCalled = false;
+    QFETCH(bool, isConfigurationSuccessExpected);
+    bool isMockDnsServerCalled = false;
     bool isLoadSuccessful = false;
 
+    QWebEngineGlobalSettings *globalSettings = QWebEngineGlobalSettings::instance();
+    bool configurationSuccess = globalSettings->setDnsMode(dnsMode, QStringList() << uriTemplate);
+    QCOMPARE(configurationSuccess, isConfigurationSuccessExpected);
+
+    if (!configurationSuccess) {
+        // In this case, DNS has invalid configuration, so the DNS change transaction is not
+        // triggered and the result of the DNS resolution depends on the current DNS mode, which is
+        // set by the previous run of this function.
+        return;
+    }
     HttpsServer httpsServer(":/cert/localhost.crt", ":/cert/localhost.key", ":/cert/RootCA.pem",
                             3000, this);
-    if (isWithCustomDnsServer) {
-        QObject::connect(
-                &httpsServer, &HttpsServer::newRequest, this, [&isDnsServerCalled](HttpReqRep *rr) {
-                    QVERIFY(rr->requestPath().contains(QByteArrayLiteral("/dns-query?dns=")));
-                    isDnsServerCalled = true;
-                    rr->close();
-                });
-        QVERIFY(httpsServer.start());
-        httpsServer.setExpectError(true);
-        httpsServer.setVerifyMode(QSslSocket::PeerVerifyMode::VerifyNone);
-    }
+    QObject::connect(&httpsServer, &HttpsServer::newRequest, this,
+                     [&isMockDnsServerCalled](HttpReqRep *rr) {
+                         QVERIFY(rr->requestPath().contains(QByteArrayLiteral("/dns-query?dns=")));
+                         isMockDnsServerCalled = true;
+                         rr->close();
+                     });
+    QVERIFY(httpsServer.start());
+    httpsServer.setExpectError(isMockDnsServerCalledExpected);
+    httpsServer.setVerifyMode(QSslSocket::PeerVerifyMode::VerifyNone);
 
     QWebEngineProfile profile;
     QWebEnginePage page(&profile);
@@ -87,15 +105,12 @@ void tst_QWebEngineGlobalSettings::dnsOverHttps()
     connect(&page, &QWebEnginePage::loadFinished, this,
             [&isLoadSuccessful](bool ok) { isLoadSuccessful = ok; });
 
-    QWebEngineGlobalSettings *globalSettings = QWebEngineGlobalSettings::instance();
-    globalSettings->configureDnsOverHttps(dnsMode, uriTemplate);
-
     page.load(QUrl("https://google.com/"));
-    if (!loadSpy.wait(10000)) {
+    if (!loadSpy.wait(20000)) {
         QSKIP("Couldn't load page from network, skipping test.");
     }
 
-    QTRY_COMPARE(isDnsServerCalled, isWithCustomDnsServer);
+    QTRY_COMPARE(isMockDnsServerCalled, isMockDnsServerCalledExpected);
     QCOMPARE(isLoadSuccessful, isDnsResolutionSuccessExpected);
     QVERIFY(httpsServer.stop());
 }

From 4d386e067c536f95872eb063a323e16a55b2a4f0 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Fri, 28 Jul 2023 09:07:27 +0200
Subject: [PATCH 315/681] Use a different file name for v8 context snapshot in
 debug mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Use a different file name for v8 context snapshot in debug mode so that
release and debug snapshots can live side-by-side.

Fixes: QTBUG-115369
Change-Id: Ibe90e7abd45b9cd8b8471d3167b74876b6c4b4b2
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit b42d3c1968ba91f9e1c376f94befdb94aec0fa3d)
---
 src/core/api/CMakeLists.txt | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index b3a13274625..d5c81ea4eea 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -126,15 +126,25 @@ set(resourceList qtwebengine_resources.pak
 
 set(stamps ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp)
 
-if(QT_FEATURE_webengine_v8_context_snapshot AND NOT MACOS)
-    list(APPEND resourceList v8_context_snapshot.bin)
-elseif(QT_FEATURE_webengine_v8_context_snapshot)
+if(QT_FEATURE_webengine_v8_context_snapshot)
     foreach(arch ${archs})
        foreach(config ${configs})
-          get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot.${arch}.bin REALPATH)
+           if(MACOS)
+               set(ext_arch ".${arch}")
+           else()
+               unset(ext_arch)
+           endif()
+           if("${config}" STREQUAL "Debug")
+               set(ext_debug ".debug")
+           else()
+               unset(ext_debug)
+           endif()
+          get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot${ext_arch}${ext_debug}.bin REALPATH)
           list(APPEND resourceFiles ${resSourcePath})
        endforeach()
-       set(stamps ${stamps} ${buildDir}/${config}/${arch}/obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
+       if(MACOS)
+           set(stamps ${stamps} ${buildDir}/${config}/${arch}/obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
+        endif()
     endforeach()
 endif()
 

From 3fd36a5722579814d57a55c780010635eef11b4c Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 18 Jul 2023 15:20:22 +0200
Subject: [PATCH 316/681] Fix crashing PDF viewer after changing the storage
 path

Changing the storage path (and recreating PrefService) caused a crash in
the extension system, because the pointer of the old PrefService was
dangling in ExtensionPrefs. Recreating it as well seems to be the nicest
way to update its dangling part.

Task-number: QTBUG-115188
Change-Id: I46321b1737432c7d1cd6ec41c76e7803e69f2011
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 7af3d247a930baa3262654082c441f8a015889b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/profile_qt.cpp | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index 410340fb804..c912c989841 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -46,7 +46,12 @@
 #endif
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "base/command_line.h"
 #include "components/guest_view/browser/guest_view_manager.h"
+#include "extensions/browser/extension_pref_value_map_factory.h"
+#include "extensions/browser/extension_prefs.h"
+#include "extensions/browser/extension_prefs_factory.h"
+#include "extensions/browser/extensions_browser_client.h"
 #include "extensions/browser/pref_names.h"
 #include "extensions/browser/process_manager.h"
 #include "extensions/common/constants.h"
@@ -246,6 +251,7 @@ content::FileSystemAccessPermissionContext *ProfileQt::GetFileSystemAccessPermis
 
 void ProfileQt::setupPrefService()
 {
+    const bool recreation = m_prefServiceAdapter.prefService() != nullptr;
     profile_metrics::SetBrowserProfileType(this,
                                            IsOffTheRecord()
                                                ? profile_metrics::BrowserProfileType::kIncognito
@@ -253,12 +259,28 @@ void ProfileQt::setupPrefService()
 
     // Remove previous handler before we set a new one or we will assert
     // TODO: Remove in Qt6
-    if (m_prefServiceAdapter.prefService() != nullptr) {
+    if (recreation) {
         user_prefs::UserPrefs::Remove(this);
         m_prefServiceAdapter.commit();
     }
     m_prefServiceAdapter.setup(*m_profileAdapter);
     user_prefs::UserPrefs::Set(this, m_prefServiceAdapter.prefService());
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+    if (recreation) {
+        // Recreate ExtensionPrefs to update its pointer to the new PrefService
+        extensions::ExtensionsBrowserClient *client = extensions::ExtensionsBrowserClient::Get();
+        std::vector<extensions::EarlyExtensionPrefsObserver *> prefsObservers;
+        client->GetEarlyExtensionPrefsObservers(this, &prefsObservers);
+        extensions::ExtensionPrefs *extensionPrefs = extensions::ExtensionPrefs::Create(
+            this, client->GetPrefServiceForContext(this),
+            this->GetPath().AppendASCII(extensions::kInstallDirectoryName),
+            ExtensionPrefValueMapFactory::GetForBrowserContext(this),
+            client->AreExtensionsDisabled(*base::CommandLine::ForCurrentProcess(), this),
+            prefsObservers);
+        extensions::ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting(this, base::WrapUnique(extensionPrefs));
+    }
+#endif
 }
 
 PrefServiceAdapter &ProfileQt::prefServiceAdapter()

From b6db0dfb6a4eb0ebed0b7594e7e3b8bf6a85c567 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Sat, 29 Jul 2023 16:22:30 +0200
Subject: [PATCH 317/681] Apply WebEngineSettings to guest views

Animated scrolling is always enabled in the PDF viewer and can't be
disabled by the settings of the embedding web view.

The guest view is still not present at the time when we normally apply
settings to the main WebContents, it is only possible after it was
properly attached.

Change-Id: I6b2c99f67ad90bf028b7299280a9a8b0f31e9f65
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6b46b4503d3672852b4bf590dd276ff4003b26c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_contents_delegate_qt.cpp | 9 +++++++++
 src/core/web_contents_delegate_qt.h   | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index f96b68b3405..ab41483a901 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -815,6 +815,15 @@ void WebContentsDelegateQt::ResourceLoadComplete(content::RenderFrameHost* rende
     }
 }
 
+void WebContentsDelegateQt::InnerWebContentsAttached(content::WebContents *inner_web_contents,
+                                        content::RenderFrameHost *render_frame_host,
+                                        bool is_full_page)
+{
+    blink::web_pref::WebPreferences guestPrefs = inner_web_contents->GetOrCreateWebPreferences();
+    webEngineSettings()->overrideWebPreferences(inner_web_contents, &guestPrefs);
+    inner_web_contents->SetWebPreferences(guestPrefs);
+}
+
 FindTextHelper *WebContentsDelegateQt::findTextHelper()
 {
     return m_findTextHelper.data();
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index cce1578bed0..68649eaa819 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -127,6 +127,9 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
     void ResourceLoadComplete(content::RenderFrameHost* render_frame_host,
                               const content::GlobalRequestID& request_id,
                               const blink::mojom::ResourceLoadInfo& resource_load_info) override;
+    void InnerWebContentsAttached(content::WebContents *inner_web_contents,
+                                  content::RenderFrameHost *render_frame_host,
+                                  bool is_full_page) override;
 
     void didFailLoad(const QUrl &url, int errorCode, const QString &errorDescription);
     void overrideWebPreferences(content::WebContents *, blink::web_pref::WebPreferences*);

From 793c8f0a1b291abdbe1d26e16223887dbf307e66 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Thu, 20 Apr 2023 18:02:40 +0200
Subject: [PATCH 318/681] Fix download button of PDF viewer plugin

The basic case of saving a PDF is easily fixed by installing
PDFWebContentsHelpers in ExtensionsAPIClientQt for the proper
WebContents.

If the PDF file contains input elements and the user modifies
them, the download button offers an option to save the modified
file instead of the original. We need a minimal implementation
of FileSystemDelegate, because this happens through file system
access dialogs instead of normal "save as" dialogs.

Task-number: QTBUG-104610
Task-number: QTBUG-113149
Change-Id: I756f9fe6c72ccb129b04282b2fda05602cbf54cd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit e9eadbb2772d22bec863ee331521f51e78541801)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt                       |   1 +
 .../extensions/extensions_api_client_qt.cpp   |  13 ++
 .../extensions/extensions_api_client_qt.h     |   3 +
 .../extensions/file_system_delegate_qt.cpp    | 146 ++++++++++++++++++
 src/core/extensions/file_system_delegate_qt.h |  89 +++++++++++
 src/core/select_file_dialog_factory_qt.cpp    |   2 +-
 6 files changed, 253 insertions(+), 1 deletion(-)
 create mode 100644 src/core/extensions/file_system_delegate_qt.cpp
 create mode 100644 src/core/extensions/file_system_delegate_qt.h

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 09e40061943..21793972d2b 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -263,6 +263,7 @@ foreach(arch ${archs})
                 extensions/extension_web_contents_observer_qt.cpp extensions/extension_web_contents_observer_qt.h
                 extensions/extensions_api_client_qt.cpp extensions/extensions_api_client_qt.h
                 extensions/extensions_browser_client_qt.cpp extensions/extensions_browser_client_qt.h
+                extensions/file_system_delegate_qt.cpp extensions/file_system_delegate_qt.h
                 extensions/messaging_delegate_qt.cpp extensions/messaging_delegate_qt.h
                 extensions/mime_handler_view_guest_delegate_qt.cpp extensions/mime_handler_view_guest_delegate_qt.h
                 extensions/plugin_service_filter_qt.cpp extensions/plugin_service_filter_qt.h
diff --git a/src/core/extensions/extensions_api_client_qt.cpp b/src/core/extensions/extensions_api_client_qt.cpp
index 3d86c65f775..60536888075 100644
--- a/src/core/extensions/extensions_api_client_qt.cpp
+++ b/src/core/extensions/extensions_api_client_qt.cpp
@@ -7,6 +7,7 @@
 // found in the LICENSE file.
 
 #include "extensions_api_client_qt.h"
+#include "file_system_delegate_qt.h"
 #include "messaging_delegate_qt.h"
 
 #include <memory>
@@ -20,6 +21,7 @@
 
 #if BUILDFLAG(ENABLE_PDF)
 #include "components/pdf/browser/pdf_web_contents_helper.h"
+#include "printing/pdf_web_contents_helper_client_qt.h"
 #endif
 
 #if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -39,6 +41,13 @@ AppViewGuestDelegate *ExtensionsAPIClientQt::CreateAppViewGuestDelegate() const
     return nullptr;
 }
 
+FileSystemDelegate *ExtensionsAPIClientQt::GetFileSystemDelegate()
+{
+    if (!m_fileSystemDelegate)
+        m_fileSystemDelegate = std::make_unique<FileSystemDelegateQt>();
+    return m_fileSystemDelegate.get();
+}
+
 std::unique_ptr<guest_view::GuestViewManagerDelegate> ExtensionsAPIClientQt::CreateGuestViewManagerDelegate(content::BrowserContext *context) const
 {
     return std::make_unique<extensions::ExtensionsGuestViewManagerDelegate>(context);
@@ -56,6 +65,10 @@ void ExtensionsAPIClientQt::AttachWebContentsHelpers(content::WebContents *web_c
     QtWebEngineCore::PrintViewManagerQt::CreateForWebContents(web_contents);
 #endif
     ExtensionWebContentsObserverQt::CreateForWebContents(web_contents);
+
+#if BUILDFLAG(ENABLE_PDF)
+    pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(web_contents, std::make_unique<PDFWebContentsHelperClientQt>());
+#endif
 }
 
 MessagingDelegate *ExtensionsAPIClientQt::GetMessagingDelegate()
diff --git a/src/core/extensions/extensions_api_client_qt.h b/src/core/extensions/extensions_api_client_qt.h
index 7eb74b96c2b..334917a4399 100644
--- a/src/core/extensions/extensions_api_client_qt.h
+++ b/src/core/extensions/extensions_api_client_qt.h
@@ -13,6 +13,7 @@
 
 namespace extensions {
 
+class FileSystemDelegate;
 class MessagingDelegate;
 
 class ExtensionsAPIClientQt : public ExtensionsAPIClient
@@ -22,6 +23,7 @@ class ExtensionsAPIClientQt : public ExtensionsAPIClient
 
     // ExtensionsAPIClient implementation.
     AppViewGuestDelegate *CreateAppViewGuestDelegate() const override;
+    FileSystemDelegate *GetFileSystemDelegate() override;
     std::unique_ptr<guest_view::GuestViewManagerDelegate>
     CreateGuestViewManagerDelegate(content::BrowserContext *context) const override;
     std::unique_ptr<MimeHandlerViewGuestDelegate>
@@ -30,6 +32,7 @@ class ExtensionsAPIClientQt : public ExtensionsAPIClient
     MessagingDelegate *GetMessagingDelegate() override;
 
 private:
+    std::unique_ptr<FileSystemDelegate> m_fileSystemDelegate;
     std::unique_ptr<MessagingDelegate> m_messagingDelegate;
 };
 
diff --git a/src/core/extensions/file_system_delegate_qt.cpp b/src/core/extensions/file_system_delegate_qt.cpp
new file mode 100644
index 00000000000..7c1c5bbd843
--- /dev/null
+++ b/src/core/extensions/file_system_delegate_qt.cpp
@@ -0,0 +1,146 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "file_system_delegate_qt.h"
+
+#include "select_file_dialog_factory_qt.h"
+#include "type_conversion.h"
+
+#include "base/files/file_path.h"
+#include "base/files/file_path.h"
+#include "base/functional/callback.h"
+#include "base/functional/callback.h"
+#include "base/memory/ref_counted.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents.h"
+#include "extensions/browser/api/file_system/file_system_delegate.h"
+#include "extensions/browser/extension_function.h"
+#include "ui/shell_dialogs/selected_file_info.h"
+
+#include <QStandardPaths>
+
+namespace extensions {
+
+FileEntryPickerQt::FileEntryPickerQt(
+        content::WebContents *web_contents,
+        const base::FilePath &suggested_name,
+        const ui::SelectFileDialog::FileTypeInfo *file_type_info,
+        ui::SelectFileDialog::Type picker_type,
+        FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+        base::OnceClosure file_selection_canceled_callback)
+    : m_filesSelectedCallback(std::move(files_selected_callback))
+    , m_fileSelectionCanceledCallback(std::move(file_selection_canceled_callback))
+{
+    const GURL caller = web_contents->GetPrimaryMainFrame()->GetLastCommittedURL();
+    m_selectFileDialog = ui::SelectFileDialog::Create(
+        this, std::make_unique<QtWebEngineCore::SelectFilePolicyQt>(web_contents));
+    m_selectFileDialog->SelectFile(
+        picker_type, std::u16string(), suggested_name, file_type_info, 0,
+        base::FilePath::StringType(), nullptr, nullptr, &caller);
+}
+
+FileEntryPickerQt::~FileEntryPickerQt() = default;
+
+void FileEntryPickerQt::FileSelected(const base::FilePath &path,
+        int index,
+        void *params)
+{
+    MultiFilesSelected({path}, params);
+}
+
+void FileEntryPickerQt::FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file,
+        int index,
+        void *params)
+{
+    FileSelected(file.file_path, index, params);
+}
+
+void FileEntryPickerQt::MultiFilesSelected(const std::vector<base::FilePath>& files,
+                      void* params)
+{
+    Q_UNUSED(params);
+    std::move(m_filesSelectedCallback).Run(files);
+    delete this;
+}
+
+void FileEntryPickerQt::MultiFilesSelectedWithExtraInfo(
+        const std::vector<ui::SelectedFileInfo> &files,
+        void *params)
+{
+    std::vector<base::FilePath> paths;
+    for (const auto& file : files)
+        paths.push_back(file.file_path);
+    MultiFilesSelected(paths, params);
+}
+
+void FileEntryPickerQt::FileSelectionCanceled(void *params)
+{
+    std::move(m_fileSelectionCanceledCallback).Run();
+    delete this;
+}
+
+FileSystemDelegateQt::FileSystemDelegateQt()
+{
+}
+
+base::FilePath FileSystemDelegateQt::GetDefaultDirectory()
+{
+    return QtWebEngineCore::toFilePath(
+        QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
+}
+
+base::FilePath FileSystemDelegateQt::GetManagedSaveAsDirectory(
+        content::BrowserContext *browser_context,
+        const Extension &extension)
+{
+    Q_UNUSED(browser_context);
+    Q_UNUSED(extension);
+    return base::FilePath();
+}
+
+bool FileSystemDelegateQt::ShowSelectFileDialog(
+        scoped_refptr<ExtensionFunction> extension_function,
+        ui::SelectFileDialog::Type type,
+        const base::FilePath &default_path,
+        const ui::SelectFileDialog::FileTypeInfo *file_type_info,
+        FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+        base::OnceClosure file_selection_canceled_callback)
+{
+    content::WebContents *web_contents = extension_function->GetSenderWebContents();
+    if (!web_contents)
+        return false;
+
+    new FileEntryPickerQt(web_contents, default_path, file_type_info, type,
+            std::move(files_selected_callback),
+            std::move(file_selection_canceled_callback));
+    return true;
+}
+
+void FileSystemDelegateQt::ConfirmSensitiveDirectoryAccess(
+        bool has_write_permission,
+        const std::u16string &app_name,
+        content::WebContents *web_contents,
+        base::OnceClosure on_accept,
+        base::OnceClosure on_cancel)
+{
+    Q_UNUSED(has_write_permission);
+    Q_UNUSED(app_name);
+    Q_UNUSED(web_contents);
+    Q_UNUSED(on_accept);
+    std::move(on_cancel).Run();
+}
+
+int FileSystemDelegateQt::GetDescriptionIdForAcceptType(const std::string &accept_type)
+{
+    Q_UNUSED(accept_type);
+    return 0;
+}
+
+SavedFilesServiceInterface *FileSystemDelegateQt::GetSavedFilesService(
+        content::BrowserContext *browser_context)
+{
+    Q_UNUSED(browser_context);
+    return nullptr;
+}
+
+} // namespace extensions
diff --git a/src/core/extensions/file_system_delegate_qt.h b/src/core/extensions/file_system_delegate_qt.h
new file mode 100644
index 00000000000..1e9d87c38fa
--- /dev/null
+++ b/src/core/extensions/file_system_delegate_qt.h
@@ -0,0 +1,89 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_DELEGATE_QT_H
+#define FILE_SYSTEM_DELEGATE_QT_H
+
+#include "extensions/browser/api/file_system/file_system_delegate.h"
+
+#include "base/files/file_path.h"
+#include "base/functional/callback.h"
+#include "base/memory/ref_counted.h"
+#include "extensions/browser/extension_function.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
+
+#include <memory>
+#include <vector>
+
+namespace content {
+class BrowserContext;
+}  // namespace content
+
+namespace extensions {
+
+class FileEntryPickerQt : public ui::SelectFileDialog::Listener {
+public:
+    FileEntryPickerQt(
+        content::WebContents *web_contents,
+        const base::FilePath &suggested_name,
+        const ui::SelectFileDialog::FileTypeInfo *file_type_info,
+        ui::SelectFileDialog::Type picker_type,
+        FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+        base::OnceClosure file_selection_canceled_callback);
+
+    FileEntryPickerQt(const FileEntryPickerQt &) = delete;
+    FileEntryPickerQt &operator=(const FileEntryPickerQt &) = delete;
+
+private:
+    ~FileEntryPickerQt() override;
+
+    // ui::SelectFileDialog::Listener implementation.
+    void FileSelected(const base::FilePath &path,
+        int index,
+        void *params) override;
+    void FileSelectedWithExtraInfo(const ui::SelectedFileInfo &file,
+        int index,
+        void *params) override;
+    void MultiFilesSelected(const std::vector<base::FilePath> &files,
+                          void *params) override;
+    void MultiFilesSelectedWithExtraInfo(
+        const std::vector<ui::SelectedFileInfo> &files,
+        void *params) override;
+    void FileSelectionCanceled(void *params) override;
+
+    FileSystemDelegate::FilesSelectedCallback m_filesSelectedCallback;
+    base::OnceClosure m_fileSelectionCanceledCallback;
+    scoped_refptr<ui::SelectFileDialog> m_selectFileDialog;
+};
+
+class FileSystemDelegateQt : public FileSystemDelegate
+{
+public:
+    FileSystemDelegateQt();
+
+    // FileSystemDelegate implementation
+    virtual base::FilePath GetDefaultDirectory() override;
+    virtual base::FilePath GetManagedSaveAsDirectory(
+        content::BrowserContext *browser_context,
+        const Extension &extension) override;
+    virtual bool ShowSelectFileDialog(
+        scoped_refptr<ExtensionFunction> extension_function,
+        ui::SelectFileDialog::Type type,
+        const base::FilePath &default_path,
+        const ui::SelectFileDialog::FileTypeInfo *file_types,
+        FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+        base::OnceClosure file_selection_canceled_callback) override;
+    virtual void ConfirmSensitiveDirectoryAccess(
+        bool has_write_permission,
+        const std::u16string &app_name,
+        content::WebContents *web_contents,
+        base::OnceClosure on_accept,
+        base::OnceClosure on_cancel) override;
+    virtual int GetDescriptionIdForAcceptType(const std::string &accept_type) override;
+    virtual SavedFilesServiceInterface *GetSavedFilesService(
+        content::BrowserContext *browser_context) override;
+};
+
+} // namespace extensions
+
+#endif // FILE_SYSTEM_DELEGATE_QT_H
diff --git a/src/core/select_file_dialog_factory_qt.cpp b/src/core/select_file_dialog_factory_qt.cpp
index 9da27a4cf1c..1f897a805c3 100644
--- a/src/core/select_file_dialog_factory_qt.cpp
+++ b/src/core/select_file_dialog_factory_qt.cpp
@@ -137,7 +137,7 @@ SelectFileDialogFactoryQt::Create(ui::SelectFileDialog::Listener *listener,
                                   std::unique_ptr<ui::SelectFilePolicy> policy)
 {
     content::WebContents *webContents =
-            static_cast<SelectFilePolicyQt *>(policy.get())->webContents();
+            static_cast<SelectFilePolicyQt *>(policy.get())->webContents()->GetOutermostWebContents();
     WebContentsAdapterClient *client =
             WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())
                     ->client();

From 8e0f709d9c635e52343e4276d27d31b5903cdb61 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 2 Aug 2023 18:41:05 +0000
Subject: [PATCH 319/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I5d7988067b9b9d698d97afa72da9165a764a1c18
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 5b0cde5a1b9..c38d4a9d15b 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 62a17d36d48d6fa76da5012f55b1276d3cfa3b40
+    ref: 53472eb8d5b78b4ed988681c9ebeaa2d2fb0c860
     required: true
   ../qtpositioning:
-    ref: 3e0e7c28dfe3a774b2375dba6f2db1bb0423b3ad
+    ref: a04ee89d9fcee3d2f22e3fbc23dbb30781948270
     required: false
   ../qttools:
-    ref: 8d67a51a0894ebafdeeddb46676be4b841e72426
+    ref: 8497c113b09b3097d95c3b703493c5a497a1e7e4
     required: false
   ../qtwebchannel:
-    ref: 63573c17ab2f7011bb01191c80c7ade0eee07f2d
+    ref: ed48dab02753d3c4d3ed3468b4ef98e5e6f1c590
     required: false

From 6396aca64364cd98d56bfe12a01dae21fdccaec4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 1 Aug 2023 14:28:56 +0200
Subject: [PATCH 320/681] Update Chromium

Sumbodule src/3rdparty ba3cfe92..4e6ef6da:
  * Bump V8_PATCH_LEVEL
  * [Backport] Security bug 1443100
  * [Backport] CVE-2023-3740: Insufficient validation of untrusted input in Themes
  * [Backport] CVE-2023-3737: Inappropriate implementation in Notifications
  * [Backport] CVE-2023-3732: Out of bounds memory access in Mojo
  * [Backport] Security bug 1454860
  * [Backport] CVE-2023-3422: Use after free in Guest View
  * [Backport] CVE-2023-3421: Use after free in Media
  * FIXUP: Disable accelerated_2d_canvas for Intel drivers on Windows
  * Fix compatibility with older XCode
  * Speculative fix for jumbo builds on windows
  * Fixup [Backport] Security bug 1447430
  * [Backport] Security bug 1447430

Fixes: QTBUG-114754
Task-number: QTBUG-115697
Change-Id: I35d63ae67fd0e0ac4a6e1a5c7ac2be591c20de13
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index ba3cfe92dd2..4e6ef6da9ef 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit ba3cfe92dd2ad3e8bd9e33dbbe78591139ffa6a3
+Subproject commit 4e6ef6da9efa4b482eec5e1be1df4a5a63b14311

From 9b70c1825038c2e69eecc774bcdd884adc240cec Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 3 Aug 2023 10:23:58 +0000
Subject: [PATCH 321/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: If3d08e9ab881b321ddc5b20e248504ba212d65fe
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 42745240390..eeb599d862e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: bfab75938f8e6471ce7ac964123bd08e4e8bfe87
+    ref: a10fae074ccb2c833a2829c0646b562a0a312bbd
     required: true
   ../qtpositioning:
-    ref: 634e2d661b8b260cd51e843c7dd0deaa5e6ca8c7
+    ref: 991539b4d30b4b861fcb5087623c4fc42fc85672
     required: false
   ../qttools:
-    ref: dfafcb6938a02bd0e0b3df9c2859ff712cd61d27
+    ref: d10e6d9bff180afe3cbb44a6f8e45646b11ef2df
     required: false
   ../qtwebchannel:
-    ref: 1da35c5961dec8d5055df0493ffaf734df774e56
+    ref: 279ebc0d347b79ded948b05315dd5868acd5c186
     required: false

From 925efb3a8b741cc483b8afda8b450d32e6c83180 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 18 Jul 2023 15:20:22 +0200
Subject: [PATCH 322/681] Fix crashing PDF viewer after changing the storage
 path

Changing the storage path (and recreating PrefService) caused a crash in
the extension system, because the pointer of the old PrefService was
dangling in ExtensionPrefs. Recreating it as well seems to be the nicest
way to update its dangling part.

Task-number: QTBUG-115188
Change-Id: I46321b1737432c7d1cd6ec41c76e7803e69f2011
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 7af3d247a930baa3262654082c441f8a015889b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/profile_qt.cpp | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index 410340fb804..c912c989841 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -46,7 +46,12 @@
 #endif
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "base/command_line.h"
 #include "components/guest_view/browser/guest_view_manager.h"
+#include "extensions/browser/extension_pref_value_map_factory.h"
+#include "extensions/browser/extension_prefs.h"
+#include "extensions/browser/extension_prefs_factory.h"
+#include "extensions/browser/extensions_browser_client.h"
 #include "extensions/browser/pref_names.h"
 #include "extensions/browser/process_manager.h"
 #include "extensions/common/constants.h"
@@ -246,6 +251,7 @@ content::FileSystemAccessPermissionContext *ProfileQt::GetFileSystemAccessPermis
 
 void ProfileQt::setupPrefService()
 {
+    const bool recreation = m_prefServiceAdapter.prefService() != nullptr;
     profile_metrics::SetBrowserProfileType(this,
                                            IsOffTheRecord()
                                                ? profile_metrics::BrowserProfileType::kIncognito
@@ -253,12 +259,28 @@ void ProfileQt::setupPrefService()
 
     // Remove previous handler before we set a new one or we will assert
     // TODO: Remove in Qt6
-    if (m_prefServiceAdapter.prefService() != nullptr) {
+    if (recreation) {
         user_prefs::UserPrefs::Remove(this);
         m_prefServiceAdapter.commit();
     }
     m_prefServiceAdapter.setup(*m_profileAdapter);
     user_prefs::UserPrefs::Set(this, m_prefServiceAdapter.prefService());
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+    if (recreation) {
+        // Recreate ExtensionPrefs to update its pointer to the new PrefService
+        extensions::ExtensionsBrowserClient *client = extensions::ExtensionsBrowserClient::Get();
+        std::vector<extensions::EarlyExtensionPrefsObserver *> prefsObservers;
+        client->GetEarlyExtensionPrefsObservers(this, &prefsObservers);
+        extensions::ExtensionPrefs *extensionPrefs = extensions::ExtensionPrefs::Create(
+            this, client->GetPrefServiceForContext(this),
+            this->GetPath().AppendASCII(extensions::kInstallDirectoryName),
+            ExtensionPrefValueMapFactory::GetForBrowserContext(this),
+            client->AreExtensionsDisabled(*base::CommandLine::ForCurrentProcess(), this),
+            prefsObservers);
+        extensions::ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting(this, base::WrapUnique(extensionPrefs));
+    }
+#endif
 }
 
 PrefServiceAdapter &ProfileQt::prefServiceAdapter()

From e3120aae93ac8894146efef757ec138fc19a18aa Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 4 Aug 2023 07:31:04 +0000
Subject: [PATCH 323/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I9ab90319e341535ee6d471c5e3acd3f8b2c8f8e2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c38d4a9d15b..1cc8d7de744 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 53472eb8d5b78b4ed988681c9ebeaa2d2fb0c860
+    ref: 12cd715c12b1318272d17cff4f6614c9193bd5af
     required: true
   ../qtpositioning:
-    ref: a04ee89d9fcee3d2f22e3fbc23dbb30781948270
+    ref: abbbf9b62a8ebfd2ce931d64a7d056c5f7d2574b
     required: false
   ../qttools:
-    ref: 8497c113b09b3097d95c3b703493c5a497a1e7e4
+    ref: 5433296e3ba00cc1c78beacb7083ff5e6645bc8c
     required: false
   ../qtwebchannel:
-    ref: ed48dab02753d3c4d3ed3468b4ef98e5e6f1c590
+    ref: 7547f893eeea31e71d752ccf68d151a71b352d50
     required: false

From aacf93e14a6f102b79f4506b334ae8a4b014f0c2 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 4 Aug 2023 11:48:08 +0200
Subject: [PATCH 324/681] Support MSVC 2019

Pick-to: dev
Fixes: QTBUG-115713
Change-Id: I45721005d1953c830ab95039827910b06800db54
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
---
 configure.cmake | 8 ++++----
 src/3rdparty    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index 688c68d4e70..8f30b34466b 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -201,7 +201,7 @@ qt_config_compile_test(winversion
     LABEL "winversion"
     CODE
 "
-#if !defined(__clang__) && _MSC_VER < 1934
+#if !defined(__clang__) && _MSC_VER < 1922
 #error unsupported Visual Studio version
 #endif
 int main(void){
@@ -609,8 +609,8 @@ if(WIN32)
     if(MSVC)
         add_check_for_support(
             MODULES QtWebEngine QtPdf
-            CONDITION NOT MSVC_VERSION LESS 1936
-            MESSAGE "VS compiler version must be at least 14.36"
+            CONDITION NOT MSVC_VERSION LESS 1922
+            MESSAGE "VS compiler version must be at least 14.22"
         )
     endif()
     set(windowsSdkVersion $ENV{WindowsSDKVersion})
@@ -626,7 +626,7 @@ endif()
 add_check_for_support(
    MODULES QtWebEngine QtPdf
    CONDITION NOT MSVC OR TEST_winversion
-   MESSAGE "Build requires Visual Studio 2022 or higher."
+   MESSAGE "Build requires Visual Studio 2019 or higher."
 )
 
 #### Summary
diff --git a/src/3rdparty b/src/3rdparty
index b5888eec6fc..96cc1f936fc 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit b5888eec6fcc052c4cda569599f5096bd6f5d667
+Subproject commit 96cc1f936fc89d474f9140e8dd7e682482f2300e

From c9367cb556449999fbfeb7c47e34369177438e6e Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 2 Aug 2023 17:43:39 +0200
Subject: [PATCH 325/681] Rename QPdfView::currentSearchResult() ->
 currentSearchResultIndex()

I don't think it was very confusing, but just in case we could want a
currentSearchResult() returning the actual result object at some point.
It was a suggestion from header review.

Amends 288e9be6ba2be40761333036f3397298df5e1018

Change-Id: Ie3eb500e3a79b80b8abafbe19c48b57c7e9d71be
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 84a5d90fc43ead2ce2aa3bdaac2ca88241700d5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/pdfwidgets/pdfviewer/mainwindow.cpp |  2 +-
 src/pdfwidgets/qpdfview.cpp                  | 20 ++++++++++----------
 src/pdfwidgets/qpdfview.h                    |  8 ++++----
 src/pdfwidgets/qpdfview_p.h                  |  2 +-
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.cpp b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
index 277f9cfb326..5c4554ca2ec 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.cpp
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
@@ -128,7 +128,7 @@ void MainWindow::searchResultSelected(const QModelIndex &current, const QModelIn
     const int page = current.data(int(QPdfSearchModel::Role::Page)).toInt();
     const QPointF location = current.data(int(QPdfSearchModel::Role::Location)).toPointF();
     ui->pdfView->pageNavigator()->jump(page, location);
-    ui->pdfView->setCurrentSearchResult(current.row());
+    ui->pdfView->setCurrentSearchResultIndex(current.row());
 }
 
 void MainWindow::on_actionOpen_triggered()
diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index bc231b369ba..8f4934eae4a 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -366,7 +366,7 @@ void QPdfView::setSearchModel(QPdfSearchModel *searchModel)
         connect(searchModel, &QPdfSearchModel::dataChanged, this,
                 [this](const QModelIndex &, const QModelIndex &, const QList<int> &) { update(); });
     }
-    setCurrentSearchResult(-1);
+    setCurrentSearchResultIndex(-1);
 }
 
 QPdfSearchModel *QPdfView::searchModel() const
@@ -377,7 +377,7 @@ QPdfSearchModel *QPdfView::searchModel() const
 
 /*!
     \since 6.6
-    \property QPdfView::currentSearchResult
+    \property QPdfView::currentSearchResultIndex
 
     If this property is set to a positive number, and \l searchModel is set,
     QPdfView draws a frame around the search result provided by
@@ -388,21 +388,21 @@ QPdfSearchModel *QPdfView::searchModel() const
 
     By default it is \c -1, so that no search results are framed.
 */
-void QPdfView::setCurrentSearchResult(int currentResult)
+void QPdfView::setCurrentSearchResultIndex(int currentResult)
 {
     Q_D(QPdfView);
-    if (d->m_currentSearchResult == currentResult)
+    if (d->m_currentSearchResultIndex == currentResult)
         return;
 
-    d->m_currentSearchResult = currentResult;
-    emit currentSearchResultChanged(currentResult);
+    d->m_currentSearchResultIndex = currentResult;
+    emit currentSearchResultIndexChanged(currentResult);
     viewport()->update(); //update();
 }
 
-int QPdfView::currentSearchResult() const
+int QPdfView::currentSearchResultIndex() const
 {
     Q_D(const QPdfView);
-    return d->m_currentSearchResult;
+    return d->m_currentSearchResultIndex;
 }
 
 /*!
@@ -616,8 +616,8 @@ void QPdfView::paintEvent(QPaintEvent *event)
                         painter.fillRect(scaleTransform.mapRect(rect).translated(pageGeometry.topLeft()), SearchResultHighlight);
                 }
 
-                if (d->m_currentSearchResult >= 0 && d->m_currentSearchResult < d->m_searchModel->rowCount({})) {
-                    const QPdfLink &cur = d->m_searchModel->resultAtIndex(d->m_currentSearchResult);
+                if (d->m_currentSearchResultIndex >= 0 && d->m_currentSearchResultIndex < d->m_searchModel->rowCount({})) {
+                    const QPdfLink &cur = d->m_searchModel->resultAtIndex(d->m_currentSearchResultIndex);
                     if (cur.page() == page) {
                         painter.setPen({CurrentSearchResultHighlight, CurrentSearchResultWidth});
                         for (const auto &rect : cur.rectangles())
diff --git a/src/pdfwidgets/qpdfview.h b/src/pdfwidgets/qpdfview.h
index 54e9ddfd5ba..548ee81cb69 100644
--- a/src/pdfwidgets/qpdfview.h
+++ b/src/pdfwidgets/qpdfview.h
@@ -31,7 +31,7 @@ class Q_PDF_WIDGETS_EXPORT QPdfView : public QAbstractScrollArea
     Q_PROPERTY(QMargins documentMargins READ documentMargins WRITE setDocumentMargins NOTIFY documentMarginsChanged)
 
     Q_PROPERTY(QPdfSearchModel* searchModel READ searchModel WRITE setSearchModel NOTIFY searchModelChanged)
-    Q_PROPERTY(int currentSearchResult READ currentSearchResult WRITE setCurrentSearchResult NOTIFY currentSearchResultChanged)
+    Q_PROPERTY(int currentSearchResultIndex READ currentSearchResultIndex WRITE setCurrentSearchResultIndex NOTIFY currentSearchResultIndexChanged)
 
 public:
     enum class PageMode
@@ -59,7 +59,7 @@ class Q_PDF_WIDGETS_EXPORT QPdfView : public QAbstractScrollArea
     QPdfSearchModel *searchModel() const;
     void setSearchModel(QPdfSearchModel *searchModel);
 
-    int currentSearchResult() const;
+    int currentSearchResultIndex() const;
 
     QPdfPageNavigator *pageNavigator() const;
 
@@ -77,7 +77,7 @@ public Q_SLOTS:
     void setPageMode(QPdfView::PageMode mode);
     void setZoomMode(QPdfView::ZoomMode mode);
     void setZoomFactor(qreal factor);
-    void setCurrentSearchResult(int currentResult);
+    void setCurrentSearchResultIndex(int currentResult);
 
 Q_SIGNALS:
     void documentChanged(QPdfDocument *document);
@@ -87,7 +87,7 @@ public Q_SLOTS:
     void pageSpacingChanged(int pageSpacing);
     void documentMarginsChanged(QMargins documentMargins);
     void searchModelChanged(QPdfSearchModel *searchModel);
-    void currentSearchResultChanged(int currentResult);
+    void currentSearchResultIndexChanged(int currentResult);
 
 protected:
     void paintEvent(QPaintEvent *event) override;
diff --git a/src/pdfwidgets/qpdfview_p.h b/src/pdfwidgets/qpdfview_p.h
index 37222ce8c55..91f6583a353 100644
--- a/src/pdfwidgets/qpdfview_p.h
+++ b/src/pdfwidgets/qpdfview_p.h
@@ -67,7 +67,7 @@ class QPdfViewPrivate
     QPdfView::ZoomMode m_zoomMode;
     qreal m_zoomFactor;
 
-    int m_currentSearchResult = -1;
+    int m_currentSearchResultIndex = -1;
 
     int m_pageSpacing;
     QMargins m_documentMargins;

From fb47deb9203ca2d43c108075245945fd099be854 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 4 Jul 2023 21:04:15 +0200
Subject: [PATCH 326/681] Fix PDF page label search: don't trim in
 QPdfDocument::pageIndexForLabel()

In the 6.6 header review it was suggested that the caller should do the
trimming if necessary; avoiding it here is more efficient. So far the
only caller is QPdfPageSelector (although we may need to implement the
same feature in the Quick PDF examples at some point).

Typing page labels into QPdfPageSelector didn't work because
QPdfPageSelector::validate() was not overridden. Now we reuse
pageIndexForLabel() for that too: if the label is found, it's valid; if
the label is not found, we just assume the user is not done typing yet.
There's no QPdfDocument function to do a substring search for page
labels, or to return the whole list of them either. It seems they
can only be gotten one-at-a-time via the FPDF_GetPageLabel function.

Now it actually works in the widget-based example
qtwebengine/examples/pdfwidgets/pdfviewer/pdfviewer: if you load a
document that has some Roman-numeral-numbered preface pages and type
e.g. " iii" into the spinbox, it jumps to page iii.

Fixes: QTBUG-115476
Change-Id: I070338effee1bbf916581c5ba964367424b786b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c439786616ade9436a599806e67199ffa93f9c91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfdocument.cpp            | 3 +--
 src/pdfwidgets/qpdfpageselector.cpp | 8 +++++++-
 src/pdfwidgets/qpdfpageselector.h   | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 695b30c59ba..e2309be9c22 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -831,9 +831,8 @@ QString QPdfDocument::pageLabel(int page)
 */
 int QPdfDocument::pageIndexForLabel(const QString &label)
 {
-    const auto trimmed = label.trimmed();
     for (int i = 0; i < d->pageCount; ++i) {
-        if (pageLabel(i) == trimmed)
+        if (pageLabel(i) == label)
             return i;
     }
     return -1;
diff --git a/src/pdfwidgets/qpdfpageselector.cpp b/src/pdfwidgets/qpdfpageselector.cpp
index 72ab283555a..7d7e7b11e88 100644
--- a/src/pdfwidgets/qpdfpageselector.cpp
+++ b/src/pdfwidgets/qpdfpageselector.cpp
@@ -88,7 +88,7 @@ int QPdfPageSelector::valueFromText(const QString &text) const
     if (d->document.isNull())
         return 0;
 
-    return d->document->pageIndexForLabel(text);
+    return d->document->pageIndexForLabel(text.trimmed());
 }
 
 QString QPdfPageSelector::textFromValue(int value) const
@@ -100,6 +100,12 @@ QString QPdfPageSelector::textFromValue(int value) const
     return d->document->pageLabel(value);
 }
 
+QValidator::State QPdfPageSelector::validate(QString &text, int &pos) const
+{
+    Q_UNUSED(pos);
+    return valueFromText(text) >= 0 ? QValidator::Acceptable : QValidator::Intermediate;
+}
+
 QT_END_NAMESPACE
 
 #include "moc_qpdfpageselector.cpp"
diff --git a/src/pdfwidgets/qpdfpageselector.h b/src/pdfwidgets/qpdfpageselector.h
index bc2e352f771..f529690e883 100644
--- a/src/pdfwidgets/qpdfpageselector.h
+++ b/src/pdfwidgets/qpdfpageselector.h
@@ -33,6 +33,7 @@ class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QSpinBox
 protected:
     int valueFromText(const QString &text) const override;
     QString textFromValue(int value) const override;
+    QValidator::State validate(QString &text, int &pos) const override;
 
 private:
     Q_DECLARE_PRIVATE(QPdfPageSelector)

From 381175792f1d3b7ef55cea40ec4f0d48f501e9a4 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Fri, 28 Apr 2023 17:37:24 +0200
Subject: [PATCH 327/681] Fix devtools context menus

Set devtools custom menus on 'OnLoadCompleted' event.
This event should be triggered by the Js frontend
not by WebContentsObserver.

Fixes: QTBUG-113251
Change-Id: I815d818c5867d0f1d160a962be5a41a762699e00
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1243b80433d4a18bc57cf43ab29d02e6007261f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/devtools_frontend_qt.cpp | 2 +-
 src/core/devtools_frontend_qt.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 731414db96f..4ef8b35de1f 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -162,7 +162,7 @@ void DevToolsFrontendQt::ActivateWindow()
     web_contents()->Focus();
 }
 
-void DevToolsFrontendQt::InspectElementCompleted()
+void DevToolsFrontendQt::OnLoadCompleted()
 {
     m_bindings->CallClientMethod("DevToolsAPI", "setUseSoftMenu", base::Value(true));
 }
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index 3b722c9ade3..a4f1726dbb8 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -54,18 +54,18 @@ class DevToolsFrontendQt : public DevToolsUIBindings::Delegate, public content::
 
     // DevToolsUIBindings::Delegate overrides
     void ActivateWindow() override;
-    void InspectElementCompleted() override;
     void SetEyeDropperActive(bool active) override;
     void OpenInNewTab(const std::string &url) override;
     void InspectedContentsClosing() override;
+    void OnLoadCompleted() override;
 
+    void InspectElementCompleted() override{};
     void CloseWindow() override{};
     void Inspect(scoped_refptr<content::DevToolsAgentHost>) override{};
     void SetInspectedPageBounds(const gfx::Rect &) override{};
     void SetIsDocked(bool) override{};
     void SetWhitelistedShortcuts(const std::string &) override{};
     void OpenNodeFrontend() override{};
-    void OnLoadCompleted() override{};
     void ReadyForTest() override{};
     void ConnectionReady() override{};
     void SetOpenNewWindowForPopups(bool) override{};

From ebca1ea6c36742182179541077c3bbda63fd1b39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 7 Aug 2023 11:43:48 +0200
Subject: [PATCH 328/681] Fixup: Support MSVC 2019

Commit aacf93e14a6f102b79f4506b334ae8a4b014f0c2 contained a preliminary
SHA1 for the qtwebengine-chromium repository.
Update docs and the Chromium security patch version.

Fixes: QTBUG-115713
Change-Id: Ic50d191b614144e624c747657303a0aff09907cd
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                                 | 2 +-
 src/3rdparty                                     | 2 +-
 src/core/doc/src/qtwebengine-platform-notes.qdoc | 2 +-
 src/core/web_engine_context.cpp                  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index a024b4f70a8..55edfe57d4e 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           114.0.5735.133
+Patched with security patches up to Chromium version:           115.0.5790.98
diff --git a/src/3rdparty b/src/3rdparty
index 96cc1f936fc..fe861d4b449 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 96cc1f936fc89d474f9140e8dd7e682482f2300e
+Subproject commit fe861d4b449cf832b35d04515a6f978c6691c23f
diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index aecffa4a107..fcca298e515 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -46,7 +46,7 @@
     On Windows, the following additional tools are required:
 
     \list
-        \li Visual Studio 2022 or later, or clang-cl version 10 or later
+        \li Visual Studio 2019 or later, or clang-cl version 10 or later
         \li Active Template Library (ATL), usually included in the Visual Studio
             installation
         \li Windows 11 SDK version 10.0.22621.0 or later
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 32ddded9b15..1a2847d3fbb 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -931,7 +931,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "114.0.5735.133"; // FIXME: Remember to update
+    return "115.0.5790.98"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 0105e5f8a413e70478368ef903cfe7039e9d543e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 8 Aug 2023 17:51:31 +0000
Subject: [PATCH 329/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ic2c34a4f7e6333bd0b6302288e4b2cb9e9f463bf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index eeb599d862e..765b11a6c0b 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a10fae074ccb2c833a2829c0646b562a0a312bbd
+    ref: 2da3311057bf5169422a338d439e14af8f635148
     required: true
   ../qtpositioning:
-    ref: 991539b4d30b4b861fcb5087623c4fc42fc85672
+    ref: 2a7715fe909d31508b62c9c81cd4106dd3bb1df3
     required: false
   ../qttools:
-    ref: d10e6d9bff180afe3cbb44a6f8e45646b11ef2df
+    ref: 8ae51aa0acc6a2e251cb4b932efa6d7d487f8a89
     required: false
   ../qtwebchannel:
-    ref: 279ebc0d347b79ded948b05315dd5868acd5c186
+    ref: 48fabbb676176328e8bcf68eff846ebaca11a173
     required: false

From 2644e38c9ce30f5e9b056df869fc0d34dd2e53e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Thu, 6 Jul 2023 12:22:06 +0200
Subject: [PATCH 330/681] Doc: Update example category names
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

WebEngine examples are generally added to the new 'Web Technologies'
category - only Nano Browser remains also in the 'Application Examples'
category.

The 2 Qt PDF examples are placed in the 'Graphics & Multimedia'
category. This is not ideal, but from the existing categories the
arguably best matching one.

Task-number: QTBUG-115174
Change-Id: I3824272f62a4940f91041c8694fd2a06929863ed
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 74aaaa25a1e21a15effc701edd23513eab9e4bdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/pdf/multipage/doc/src/multipage.qdoc                   | 1 +
 examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc            | 1 +
 examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc        | 1 +
 .../quicknanobrowser/doc/src/quicknanobrowser.qdoc              | 1 +
 .../clientcertificate/doc/src/clientcertificate.qdoc            | 2 +-
 .../contentmanipulation/doc/src/contentmanipulation.qdoc        | 2 +-
 .../webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc   | 2 +-
 examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc        | 2 +-
 examples/webenginewidgets/maps/doc/src/maps.qdoc                | 2 +-
 .../webenginewidgets/notifications/doc/src/notifications.qdoc   | 2 +-
 examples/webenginewidgets/printme/doc/src/printme.qdoc          | 2 +-
 .../push-notifications/doc/src/push-notifications.qdoc          | 2 +-
 .../webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc   | 1 +
 .../webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc   | 1 +
 .../webenginewidgets/spellchecker/doc/src/spellchecker.qdoc     | 1 +
 examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc  | 2 +-
 16 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/examples/pdf/multipage/doc/src/multipage.qdoc b/examples/pdf/multipage/doc/src/multipage.qdoc
index b4963c5087e..b9fec15a9bd 100644
--- a/examples/pdf/multipage/doc/src/multipage.qdoc
+++ b/examples/pdf/multipage/doc/src/multipage.qdoc
@@ -5,6 +5,7 @@
     \example multipage
     \meta installpath pdf
     \ingroup qtpdf-examples
+    \examplecategory {Graphics & Multimedia}
 
     \title PDF Multipage Viewer Example
     \brief A Qt Quick PDF viewer that allows scrolling through the pages.
diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index e585a84ef71..0c9fa06a9ae 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -5,6 +5,7 @@
     \example pdfviewer
     \meta installpath pdfwidgets
     \ingroup qtpdf-examples
+    \examplecategory {Graphics & Multimedia}
 
     \title PDF Viewer Widget Example
     \brief A widget-based PDF viewer that allows scrolling through the pages.
diff --git a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
index 4d997b1c407..1580da26d2e 100644
--- a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
+++ b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
@@ -6,6 +6,7 @@
     \title WebEngine Lifecycle Example
     \ingroup webengine-examples
     \brief Freezes and discards background tabs to reduce CPU and memory usage.
+    \examplecategory {Web Technologies}
 
     \image lifecycle.png
 
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index e9964266134..027a1f29ae1 100644
--- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -9,6 +9,7 @@
 
     \image quicknanobrowser-demo.jpg
     \examplecategory {Application Examples}
+    \examplecategory {Web Technologies}
 
     \e {Quick Nano Browser} demonstrates how to use the \l{Qt WebEngine QML Types}
     {Qt WebEngine QML types} to develop a small web browser application that consists of a browser
diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index f296c092537..c5440f08fa7 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/clientcertificate
-    \examplecategory {Networking}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Client Certificate Example
     \ingroup webengine-widgetexamples
     \brief A simple client certificate authentication scenario using \QWE and \l QSslServer.
diff --git a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
index 104a1773020..ae91affe5c7 100644
--- a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
+++ b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/contentmanipulation
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Content Manipulation Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to load and manipulate web content.
diff --git a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
index 92f6f0f011b..adc302779ec 100644
--- a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
+++ b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/cookiebrowser
-    \examplecategory {Input/Output}
+    \examplecategory {Web Technologies}
     \title WebEngine Cookie Browser Example
     \ingroup webengine-widgetexamples
     \brief A cookie browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
index 7b4c908c728..7199a812c47 100644
--- a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
+++ b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/html2pdf
-    \examplecategory {Graphics}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Html2Pdf Example
     \ingroup webengine-widgetexamples
     \brief Converts web pages to PDF documents using \QWE.
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index f8f1dfea360..0175f8b6511 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/maps
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Maps Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to handle geolocation requests.
diff --git a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
index bfe41613300..f4fe1818fe1 100644
--- a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
+++ b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/notifications
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Notifications Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to pass HTML5 web notifications to users.
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
index c849b63b6d0..cac69aa41de 100644
--- a/examples/webenginewidgets/printme/doc/src/printme.qdoc
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/printme
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets PrintMe Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to print web pages using Qt WebEngine Widgets.
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
index 97aaff50a33..05ccf3e8b6d 100644
--- a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -4,7 +4,7 @@
 /*!
 
 \example webenginewidgets/push-notifications
-\examplecategory {Desktop}
+\examplecategory {Web Technologies}
 \title WebEngine Push Notifications Example
 \ingroup webengine-widgetexamples
 \brief Demonstrates how to subscribe to and unsubscribe from push notifications.
diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
index e6693b60a01..0400fcecccd 100644
--- a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -8,6 +8,7 @@
     \ingroup webengine-widgetexamples
     \brief Injecting custom stylsheets into web pages and providing a rich text preview
     tool for a custom markup language.
+    \examplecategory {Web Technologies}
 
     \image recipebrowser.webp
 
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index f45b362df99..7f8e386c029 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -6,6 +6,7 @@
     \title WebEngine Widgets Simple Browser Example
     \ingroup webengine-widgetexamples
     \brief A simple browser based on \QWE Widgets.
+    \examplecategory {Web Technologies}
 
     \image simplebrowser.png
 
diff --git a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
index 85b1b950ca8..1d9d7b73c14 100644
--- a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
+++ b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
@@ -6,6 +6,7 @@
     \title WebEngine Widgets Spellchecker Example
     \ingroup webengine-widgetexamples
     \brief Integrates a spellchecker into a simple HTML form.
+    \examplecategory {Web Technologies}
 
     \image spellchecker-example.png
 
diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
index 87000047267..931f08558e2 100644
--- a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
+++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/videoplayer
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Video Player Example
     \ingroup webengine-widgetexamples
     \brief Displays full screen video using \l QWebEngineView.

From 46715af0bef2eb99d1236b8f5d9a8ba161d01d05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Thu, 6 Jul 2023 12:22:06 +0200
Subject: [PATCH 331/681] Doc: Update example category names
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

WebEngine examples are generally added to the new 'Web Technologies'
category - only Nano Browser remains also in the 'Application Examples'
category.

The 2 Qt PDF examples are placed in the 'Graphics & Multimedia'
category. This is not ideal, but from the existing categories the
arguably best matching one.

Task-number: QTBUG-115174
Change-Id: I3824272f62a4940f91041c8694fd2a06929863ed
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 74aaaa25a1e21a15effc701edd23513eab9e4bdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/pdf/multipage/doc/src/multipage.qdoc                   | 1 +
 examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc            | 1 +
 examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc        | 1 +
 .../quicknanobrowser/doc/src/quicknanobrowser.qdoc              | 1 +
 .../clientcertificate/doc/src/clientcertificate.qdoc            | 2 +-
 .../contentmanipulation/doc/src/contentmanipulation.qdoc        | 2 +-
 .../webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc   | 2 +-
 examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc        | 2 +-
 examples/webenginewidgets/maps/doc/src/maps.qdoc                | 2 +-
 .../webenginewidgets/notifications/doc/src/notifications.qdoc   | 2 +-
 examples/webenginewidgets/printme/doc/src/printme.qdoc          | 2 +-
 .../push-notifications/doc/src/push-notifications.qdoc          | 2 +-
 .../webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc   | 1 +
 .../webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc   | 1 +
 .../webenginewidgets/spellchecker/doc/src/spellchecker.qdoc     | 1 +
 examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc  | 2 +-
 16 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/examples/pdf/multipage/doc/src/multipage.qdoc b/examples/pdf/multipage/doc/src/multipage.qdoc
index b4963c5087e..b9fec15a9bd 100644
--- a/examples/pdf/multipage/doc/src/multipage.qdoc
+++ b/examples/pdf/multipage/doc/src/multipage.qdoc
@@ -5,6 +5,7 @@
     \example multipage
     \meta installpath pdf
     \ingroup qtpdf-examples
+    \examplecategory {Graphics & Multimedia}
 
     \title PDF Multipage Viewer Example
     \brief A Qt Quick PDF viewer that allows scrolling through the pages.
diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index e585a84ef71..0c9fa06a9ae 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -5,6 +5,7 @@
     \example pdfviewer
     \meta installpath pdfwidgets
     \ingroup qtpdf-examples
+    \examplecategory {Graphics & Multimedia}
 
     \title PDF Viewer Widget Example
     \brief A widget-based PDF viewer that allows scrolling through the pages.
diff --git a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
index 4d997b1c407..1580da26d2e 100644
--- a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
+++ b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
@@ -6,6 +6,7 @@
     \title WebEngine Lifecycle Example
     \ingroup webengine-examples
     \brief Freezes and discards background tabs to reduce CPU and memory usage.
+    \examplecategory {Web Technologies}
 
     \image lifecycle.png
 
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index e9964266134..027a1f29ae1 100644
--- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -9,6 +9,7 @@
 
     \image quicknanobrowser-demo.jpg
     \examplecategory {Application Examples}
+    \examplecategory {Web Technologies}
 
     \e {Quick Nano Browser} demonstrates how to use the \l{Qt WebEngine QML Types}
     {Qt WebEngine QML types} to develop a small web browser application that consists of a browser
diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
index f296c092537..c5440f08fa7 100644
--- a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/clientcertificate
-    \examplecategory {Networking}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Client Certificate Example
     \ingroup webengine-widgetexamples
     \brief A simple client certificate authentication scenario using \QWE and \l QSslServer.
diff --git a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
index 104a1773020..ae91affe5c7 100644
--- a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
+++ b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/contentmanipulation
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Content Manipulation Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to load and manipulate web content.
diff --git a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
index 92f6f0f011b..adc302779ec 100644
--- a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
+++ b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/cookiebrowser
-    \examplecategory {Input/Output}
+    \examplecategory {Web Technologies}
     \title WebEngine Cookie Browser Example
     \ingroup webengine-widgetexamples
     \brief A cookie browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
index 7b4c908c728..7199a812c47 100644
--- a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
+++ b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/html2pdf
-    \examplecategory {Graphics}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Html2Pdf Example
     \ingroup webengine-widgetexamples
     \brief Converts web pages to PDF documents using \QWE.
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index f8f1dfea360..0175f8b6511 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/maps
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Maps Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to handle geolocation requests.
diff --git a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
index bfe41613300..f4fe1818fe1 100644
--- a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
+++ b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/notifications
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Notifications Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to pass HTML5 web notifications to users.
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
index c849b63b6d0..cac69aa41de 100644
--- a/examples/webenginewidgets/printme/doc/src/printme.qdoc
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/printme
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets PrintMe Example
     \ingroup webengine-widgetexamples
     \brief Demonstrates how to print web pages using Qt WebEngine Widgets.
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
index 97aaff50a33..05ccf3e8b6d 100644
--- a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -4,7 +4,7 @@
 /*!
 
 \example webenginewidgets/push-notifications
-\examplecategory {Desktop}
+\examplecategory {Web Technologies}
 \title WebEngine Push Notifications Example
 \ingroup webengine-widgetexamples
 \brief Demonstrates how to subscribe to and unsubscribe from push notifications.
diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
index dd701f1f2d7..b862a906da1 100644
--- a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -9,6 +9,7 @@
     \ingroup webengine-widgetexamples
     \brief Injecting custom stylsheets into web pages and providing a rich text preview
     tool for a custom markup language.
+    \examplecategory {Web Technologies}
 
     \image recipebrowser.webp
 
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index 748d19e38c3..a9342f3fe91 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -7,6 +7,7 @@
     \title WebEngine Widgets Simple Browser Example
     \ingroup webengine-widgetexamples
     \brief A simple browser based on \QWE Widgets.
+    \examplecategory {Web Technologies}
 
     \image simplebrowser.png
 
diff --git a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
index 85b1b950ca8..1d9d7b73c14 100644
--- a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
+++ b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
@@ -6,6 +6,7 @@
     \title WebEngine Widgets Spellchecker Example
     \ingroup webengine-widgetexamples
     \brief Integrates a spellchecker into a simple HTML form.
+    \examplecategory {Web Technologies}
 
     \image spellchecker-example.png
 
diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
index 87000047267..931f08558e2 100644
--- a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
+++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
@@ -3,7 +3,7 @@
 
 /*!
     \example webenginewidgets/videoplayer
-    \examplecategory {Desktop}
+    \examplecategory {Web Technologies}
     \title WebEngine Widgets Video Player Example
     \ingroup webengine-widgetexamples
     \brief Displays full screen video using \l QWebEngineView.

From 1ad2d7bcc0af354eeffd2e8b780090bcb5273d03 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 9 Aug 2023 16:26:03 +0200
Subject: [PATCH 332/681] Make webengineview::save a slot

From API review

Change-Id: I7071b05bd92eaefd922913e2800e4b9ade71ec1f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 73a25202670d7383e3b18319c29fd60f373eb3ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineview_p.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index 7084eb173ff..a040571461a 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -469,10 +469,6 @@ QT_WARNING_POP
 
     QQmlComponent *touchHandleDelegate() const;
     void setTouchHandleDelegate(QQmlComponent *delegagte);
-    Q_REVISION(6, 6)
-    Q_INVOKABLE void save(const QString &filePath,
-                          QWebEngineDownloadRequest::SavePageFormat format =
-                                  QWebEngineDownloadRequest::MimeHtmlSaveFormat) const;
 
 public Q_SLOTS:
     void runJavaScript(const QString&, const QJSValue & = QJSValue());
@@ -492,6 +488,9 @@ public Q_SLOTS:
     Q_REVISION(1,3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
     Q_REVISION(1,3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
     Q_REVISION(1,4) void replaceMisspelledWord(const QString &replacement);
+    Q_REVISION(6, 6) void save(const QString &filePath,
+                               QWebEngineDownloadRequest::SavePageFormat format =
+                                       QWebEngineDownloadRequest::MimeHtmlSaveFormat) const;
 
 private Q_SLOTS:
     void lazyInitialize();

From 0277ef2e334453171d8bdd696017d8866c5c1039 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 9 Aug 2023 16:35:18 +0200
Subject: [PATCH 333/681] Rename disableReadingFromCanvas to follow naming
 style

We prefer to name settings with Enabled at the end.

From API review.

Change-Id: I7aacc6dbb92d852fd21b067475d2fd9e7df56163
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
(cherry picked from commit b10ac195de4dac7157575e2899cc19ec45fe1648)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginesettings.h             |  2 +-
 src/core/doc/src/qwebenginesettings_lgpl.qdoc |  7 +++---
 src/core/web_engine_settings.cpp              |  6 ++---
 .../api/qquickwebenginesettings.cpp           | 22 ++++++++++---------
 .../api/qquickwebenginesettings_p.h           |  8 +++----
 .../tst_qwebenginesettings.cpp                |  8 +++----
 tests/auto/quick/publicapi/tst_publicapi.cpp  |  4 ++--
 .../auto/quick/qmltests/data/tst_settings.qml |  4 ++--
 8 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/src/core/api/qwebenginesettings.h b/src/core/api/qwebenginesettings.h
index 8cb10f6a7e6..7919719a1d1 100644
--- a/src/core/api/qwebenginesettings.h
+++ b/src/core/api/qwebenginesettings.h
@@ -60,7 +60,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineSettings
         DnsPrefetchEnabled,
         PdfViewerEnabled,
         NavigateOnDropEnabled,
-        DisableReadingFromCanvas,
+        ReadingFromCanvasEnabled,
     };
 
     enum FontSize {
diff --git a/src/core/doc/src/qwebenginesettings_lgpl.qdoc b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
index 3fdce3ea925..63e9c97102e 100644
--- a/src/core/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
@@ -168,9 +168,10 @@
     \value NavigateOnDropEnabled Specifies that navigations can be triggered by dropping URLs on
            the view.
            Enabled by default. (Added in Qt 6.4)
-    \value DisableReadingFromCanvas Specifies that reading from all canvas elements will be disabled.
-           This setting will have impact on all HTML5 canvas elements irrespective of origin.
-           Disabled by default. (Added in Qt 6.6)
+    \value ReadingFromCanvasEnabled Specifies that reading from all canvas elements is enabled.
+           This setting will have impact on all HTML5 canvas elements irrespective of origin, and can be disabled
+           to prevent canvas fingerprinting.
+           Enabled by default. (Added in Qt 6.6)
 */
 
 /*!
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 40ddbdac77d..1e1a3105dc0 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -261,9 +261,9 @@ void WebEngineSettings::initDefaults()
         s_defaultAttributes.insert(QWebEngineSettings::PdfViewerEnabled, false);
 #endif
         s_defaultAttributes.insert(QWebEngineSettings::NavigateOnDropEnabled, true);
-        bool readingFromCanvas =
+        bool noReadingFromCanvas =
                 commandLine->HasSwitch(switches::kDisableReadingFromCanvas);
-        s_defaultAttributes.insert(QWebEngineSettings::DisableReadingFromCanvas, readingFromCanvas);
+        s_defaultAttributes.insert(QWebEngineSettings::ReadingFromCanvasEnabled, !noReadingFromCanvas);
     }
 
     if (s_defaultFontFamilies.isEmpty()) {
@@ -372,7 +372,7 @@ void WebEngineSettings::applySettingsToWebPreferences(blink::web_pref::WebPrefer
     prefs->dom_paste_enabled = testAttribute(QWebEngineSettings::JavascriptCanPaste);
     prefs->dns_prefetching_enabled = testAttribute(QWebEngineSettings::DnsPrefetchEnabled);
     prefs->navigate_on_drag_drop = testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
-    prefs->disable_reading_from_canvas = testAttribute(QWebEngineSettings::DisableReadingFromCanvas);
+    prefs->disable_reading_from_canvas = !testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled);
 
     // Fonts settings.
     prefs->standard_font_family_map[blink::web_pref::kCommonScript] =
diff --git a/src/webenginequick/api/qquickwebenginesettings.cpp b/src/webenginequick/api/qquickwebenginesettings.cpp
index 54407cc2f1d..2686a577439 100644
--- a/src/webenginequick/api/qquickwebenginesettings.cpp
+++ b/src/webenginequick/api/qquickwebenginesettings.cpp
@@ -433,17 +433,19 @@ bool QQuickWebEngineSettings::navigateOnDropEnabled() const
 }
 
 /*!
-    \qmlproperty bool WebEngineSettings::disableReadingFromCanvas
+    \qmlproperty bool WebEngineSettings::readingFromCanvasEnabled
     \since QtWebEngine 6.6
 
-    Disables JavaScript reading from canvas elements.
-    This setting will have impact on all HTML5 canvas elements irrespective of origin.
+    Specifies that reading from all canvas elements is enabled.
 
-    Disabled by default.
+    This setting will have impact on all HTML5 canvas elements irrespective of origin, and can be disabled
+    to prevent canvas fingerprinting.
+
+    Enabled by default.
  */
-bool QQuickWebEngineSettings::disableReadingFromCanvas() const
+bool QQuickWebEngineSettings::readingFromCanvasEnabled() const
 {
-    return d_ptr->testAttribute(QWebEngineSettings::DisableReadingFromCanvas);
+    return d_ptr->testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled);
 }
 
 /*!
@@ -729,12 +731,12 @@ void QQuickWebEngineSettings::setNavigateOnDropEnabled(bool on)
         Q_EMIT navigateOnDropEnabledChanged();
 }
 
-void QQuickWebEngineSettings::setDisableReadingFromCanvas(bool on)
+void QQuickWebEngineSettings::setReadingFromCanvasEnabled(bool on)
 {
-    bool wasOn = d_ptr->testAttribute(QWebEngineSettings::DisableReadingFromCanvas);
-    d_ptr->setAttribute(QWebEngineSettings::DisableReadingFromCanvas, on);
+    bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled);
+    d_ptr->setAttribute(QWebEngineSettings::ReadingFromCanvasEnabled, on);
     if (wasOn != on)
-        Q_EMIT disableReadingFromCanvasChanged();
+        Q_EMIT readingFromCanvasEnabledChanged();
 }
 
 void QQuickWebEngineSettings::setUnknownUrlSchemePolicy(QQuickWebEngineSettings::UnknownUrlSchemePolicy policy)
diff --git a/src/webenginequick/api/qquickwebenginesettings_p.h b/src/webenginequick/api/qquickwebenginesettings_p.h
index 2fed034c126..53156da0221 100644
--- a/src/webenginequick/api/qquickwebenginesettings_p.h
+++ b/src/webenginequick/api/qquickwebenginesettings_p.h
@@ -57,7 +57,7 @@ class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
     Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged REVISION(1,7) FINAL)
     Q_PROPERTY(bool pdfViewerEnabled READ pdfViewerEnabled WRITE setPdfViewerEnabled NOTIFY pdfViewerEnabledChanged REVISION(1,8) FINAL)
     Q_PROPERTY(bool navigateOnDropEnabled READ navigateOnDropEnabled WRITE setNavigateOnDropEnabled NOTIFY navigateOnDropEnabledChanged REVISION(6,4) FINAL)
-    Q_PROPERTY(bool disableReadingFromCanvas READ disableReadingFromCanvas WRITE setDisableReadingFromCanvas NOTIFY disableReadingFromCanvasChanged REVISION(6,6) FINAL)
+    Q_PROPERTY(bool readingFromCanvasEnabled READ readingFromCanvasEnabled WRITE setReadingFromCanvasEnabled NOTIFY readingFromCanvasEnabledChanged REVISION(6,6) FINAL)
     QML_NAMED_ELEMENT(WebEngineSettings)
     QML_ADDED_IN_VERSION(1, 1)
     QML_EXTRA_VERSION(2, 0)
@@ -105,7 +105,7 @@ class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
     bool dnsPrefetchEnabled() const;
     bool pdfViewerEnabled() const;
     bool navigateOnDropEnabled() const;
-    bool disableReadingFromCanvas() const;
+    bool readingFromCanvasEnabled() const;
 
     void setAutoLoadImages(bool on);
     void setJavascriptEnabled(bool on);
@@ -139,7 +139,7 @@ class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
     void setDnsPrefetchEnabled(bool on);
     void setPdfViewerEnabled(bool on);
     void setNavigateOnDropEnabled(bool on);
-    void setDisableReadingFromCanvas(bool on);
+    void setReadingFromCanvasEnabled(bool on);
 
 signals:
     void autoLoadImagesChanged();
@@ -174,7 +174,7 @@ class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
     Q_REVISION(1,7) void dnsPrefetchEnabledChanged();
     Q_REVISION(1,8) void pdfViewerEnabledChanged();
     Q_REVISION(6,4) void navigateOnDropEnabledChanged();
-    Q_REVISION(6,6) void disableReadingFromCanvasChanged();
+    Q_REVISION(6,6) void readingFromCanvasEnabledChanged();
 
 private:
     explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = nullptr);
diff --git a/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp b/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp
index f63a333c296..14492c728bc 100644
--- a/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp
+++ b/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp
@@ -211,15 +211,15 @@ void tst_QWebEngineSettings::disableReadingFromCanvas()
     QWebEnginePage page;
     QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
     page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
-    page.settings()->setAttribute(QWebEngineSettings::DisableReadingFromCanvas,
-                                  disableReadingFromCanvas);
+    page.settings()->setAttribute(QWebEngineSettings::ReadingFromCanvasEnabled,
+                                  !disableReadingFromCanvas);
     page.setHtml("<html><body>"
                  "<canvas id='myCanvas' width='200' height='40' style='border:1px solid "
                  "#000000;'></canvas>"
                  "</body></html>");
     QVERIFY(loadFinishedSpy.wait());
-    QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::DisableReadingFromCanvas),
-             disableReadingFromCanvas);
+    QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled),
+             !disableReadingFromCanvas);
 
     const QString jsCode("(function(){"
                          "   var canvas = document.getElementById(\"myCanvas\");"
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 2c85b5d2503..1cffd55c738 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -443,8 +443,8 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineSettings.webGLEnabledChanged() --> void"
     << "QQuickWebEngineSettings.webRTCPublicInterfacesOnly --> bool"
     << "QQuickWebEngineSettings.webRTCPublicInterfacesOnlyChanged() --> void"
-    << "QQuickWebEngineSettings.disableReadingFromCanvas --> bool"
-    << "QQuickWebEngineSettings.disableReadingFromCanvasChanged() --> void"
+    << "QQuickWebEngineSettings.readingFromCanvasEnabled --> bool"
+    << "QQuickWebEngineSettings.readingFromCanvasEnabledChanged() --> void"
     << "QQuickWebEngineSingleton.defaultProfile --> QQuickWebEngineProfile*"
     << "QQuickWebEngineSingleton.settings --> QQuickWebEngineSettings*"
     << "QQuickWebEngineSingleton.script() --> QWebEngineScript"
diff --git a/tests/auto/quick/qmltests/data/tst_settings.qml b/tests/auto/quick/qmltests/data/tst_settings.qml
index 2f71407cf1b..6b351a29315 100644
--- a/tests/auto/quick/qmltests/data/tst_settings.qml
+++ b/tests/auto/quick/qmltests/data/tst_settings.qml
@@ -87,12 +87,12 @@ TestWebEngineView {
         }
 
         function test_disableReadingFromCanvas(data) {
-            webEngineView.settings.disableReadingFromCanvas = data.disableReadingFromCanvas;
+            webEngineView.settings.readingFromCanvasEnabled = !data.disableReadingFromCanvas;
             webEngineView.loadHtml("<html><body>" +
                                    "<canvas id='myCanvas' width='200' height='40' style='border:1px solid #000000;'></canvas>" +
                                    "</body></html>");
             verify(webEngineView.waitForLoadSucceeded());
-            verify(webEngineView.settings.disableReadingFromCanvas === data.disableReadingFromCanvas )
+            verify(webEngineView.settings.readingFromCanvasEnabled === !data.disableReadingFromCanvas )
 
             var jsCode = "(function(){" +
                        "   var canvas = document.getElementById(\"myCanvas\");" +

From 118ff6101d705b97ec9139a72ca8fee9d24f992d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Thu, 29 Jun 2023 15:43:37 +0200
Subject: [PATCH 334/681] Doc: Promote Qt6::WebEngine* cmake targets

Be consistent with the other modules, and promote
Qt6:: targets instead of the (mostly functionally equivalent)
Qt:: one's.

Change-Id: I4da0b7a29782d8927de5e5eafcaf934afb128937
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 58ec902ec47284eee430715ddd39a30d871a18e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc        | 2 +-
 src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc  | 2 +-
 .../doc/snippets/qtwebenginewidgets_build_snippet.qdoc          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
index ee22ea774c9..9a7370d62f2 100644
--- a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
+++ b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
@@ -7,5 +7,5 @@ QT += webenginecore
 
 //! [2]
 find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
-target_link_libraries(target PRIVATE Qt::WebEngineCore)
+target_link_libraries(target PRIVATE Qt6::WebEngineCore)
 //! [2]
diff --git a/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc b/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
index 76dea97cfbd..f8fbbd669c2 100644
--- a/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
+++ b/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
@@ -7,5 +7,5 @@ QT += webenginequick
 
 //! [2]
 find_package(Qt6 REQUIRED COMPONENTS WebEngineQuick)
-target_link_libraries(target PRIVATE Qt::WebEngineQuick)
+target_link_libraries(target PRIVATE Qt6::WebEngineQuick)
 //! [2]
diff --git a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
index 4ab54a2ba83..f11f550ffe0 100644
--- a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
+++ b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
@@ -7,5 +7,5 @@ QT += webenginewidgets
 
 //! [2]
 find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets)
-target_link_libraries(target PRIVATE Qt::WebEngineWidgets)
+target_link_libraries(target PRIVATE Qt6::WebEngineWidgets)
 //! [2]

From c1cb8e71b9e26320096aad7c114ab10fd1689dd3 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 11 Aug 2023 15:26:10 +0000
Subject: [PATCH 335/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I55dfb25670c621e6a41817c2943a8a8212f30c88
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 1cc8d7de744..9dcdac2a005 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 12cd715c12b1318272d17cff4f6614c9193bd5af
+    ref: cb653b5792db2cb71f7358a59a2f61e2d28e966e
     required: true
   ../qtpositioning:
-    ref: abbbf9b62a8ebfd2ce931d64a7d056c5f7d2574b
+    ref: c1c85227e6ca431cfd7838aa952abb18d2f3935f
     required: false
   ../qttools:
-    ref: 5433296e3ba00cc1c78beacb7083ff5e6645bc8c
+    ref: 7f55835cb3397abb93bbc68cd4a947f09963948f
     required: false
   ../qtwebchannel:
-    ref: 7547f893eeea31e71d752ccf68d151a71b352d50
+    ref: d98f20aa6db39180a11e77610dad034ccb98af7b
     required: false

From 7ec7028c48312d280a094f7ab609fc3714f831b3 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 8 Aug 2023 18:50:16 +0200
Subject: [PATCH 336/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty fe861d4b..2d71c20d:
* [macOS] Do not subscribe to display callbacks when GPU is disabled
* Make NetworkContext resettable
* [Revert] Destroy old network context before creating the replacement
* [Revert] Expose StoragePartitionImpl::InitNetworkContext
* Add internal version page
* Bring back *://localhost/* exception for Hangouts extension

Change-Id: Ia42fdf08eeea919a780591ee2e9bbdb2cf7e3059
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 800cf14c284690d4f6584abe471b396ed3e4cf21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index fe861d4b449..2d71c20d894 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit fe861d4b449cf832b35d04515a6f978c6691c23f
+Subproject commit 2d71c20d894b2d19ecbbd6b54901eb00e130253d

From cae9efb5054cfa341b24e5953509e01011bc3742 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 14 Aug 2023 09:03:55 +0000
Subject: [PATCH 337/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: If88c46ab448c583a9359028b6ddaefad5ddc321e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 9dcdac2a005..54c27d216cf 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: cb653b5792db2cb71f7358a59a2f61e2d28e966e
+    ref: 651262a68599eb0e11b037e75384e5f5c1d1a955
     required: true
   ../qtpositioning:
-    ref: c1c85227e6ca431cfd7838aa952abb18d2f3935f
+    ref: 46ed9de4f26c9c487cd68ed10c6371b94a264369
     required: false
   ../qttools:
-    ref: 7f55835cb3397abb93bbc68cd4a947f09963948f
+    ref: b574276c5a07d293364fa7303d91a1febb798449
     required: false
   ../qtwebchannel:
-    ref: d98f20aa6db39180a11e77610dad034ccb98af7b
+    ref: 6ffe4c6ac9a9d809b2b1392a0c328db013611722
     required: false

From 692bf646a8756bc60026beab9b6ab39a1e2fe4aa Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Tue, 8 Aug 2023 10:17:16 +0200
Subject: [PATCH 338/681] Prevent QWebEngineCertificateError from being
 exported twice to QML

We need to export the type as a value type, and also export its enums
in a namespace. This resulted in duplicated entries in the qmltypes
file, which confuses Qt Design Studio.

Fix it by introducing a derived class, and using it for exporting the
enums.

Fixes: QTBUG-115365
Change-Id: I5900f4f76fb6357c9262496cc3cc01b276387e46
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit df4121886dfa11cf90e74c72b1121a96462726bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineforeigntypes_p.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index 1591e596f8c..08fac43d5c5 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -53,10 +53,17 @@ struct ForeignWebEngineLoadingInfo
     QML_UNCREATABLE("")
 };
 
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineCertificateErrorDerived : public QWebEngineCertificateError
+{
+    Q_GADGET
+};
+
 namespace ForeignWebEngineCertificateErrorNamespace
 {
     Q_NAMESPACE
-    QML_FOREIGN_NAMESPACE(QWebEngineCertificateError)
+    QML_FOREIGN_NAMESPACE(QWebEngineCertificateErrorDerived)
     QML_NAMED_ELEMENT(WebEngineCertificateError)
     QML_ADDED_IN_VERSION(1, 1)
     QML_EXTRA_VERSION(2, 0)

From 052c6915d1f284651d1087e0c5a43c0c21ad5a12 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Tue, 8 Aug 2023 10:17:16 +0200
Subject: [PATCH 339/681] Prevent QWebEngineCertificateError from being
 exported twice to QML

We need to export the type as a value type, and also export its enums
in a namespace. This resulted in duplicated entries in the qmltypes
file, which confuses Qt Design Studio.

Fix it by introducing a derived class, and using it for exporting the
enums.

Fixes: QTBUG-115365
Change-Id: I5900f4f76fb6357c9262496cc3cc01b276387e46
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit df4121886dfa11cf90e74c72b1121a96462726bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineforeigntypes_p.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index 1591e596f8c..08fac43d5c5 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -53,10 +53,17 @@ struct ForeignWebEngineLoadingInfo
     QML_UNCREATABLE("")
 };
 
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineCertificateErrorDerived : public QWebEngineCertificateError
+{
+    Q_GADGET
+};
+
 namespace ForeignWebEngineCertificateErrorNamespace
 {
     Q_NAMESPACE
-    QML_FOREIGN_NAMESPACE(QWebEngineCertificateError)
+    QML_FOREIGN_NAMESPACE(QWebEngineCertificateErrorDerived)
     QML_NAMED_ELEMENT(WebEngineCertificateError)
     QML_ADDED_IN_VERSION(1, 1)
     QML_EXTRA_VERSION(2, 0)

From 0484b100fbee19cddef7d632f8be651166fdb3f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 27 Jul 2023 13:19:00 +0200
Subject: [PATCH 340/681] Add NSCameraUsageDescription and
 NSMicrophoneUsageDescription to plists
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Quick Nano Browser and Simple Browser need this to be able to use the
camera and microphone on macOS.

Also document the need for signing the applications in the examples
documentation.

Task-number: QTBUG-114939
Change-Id: I7a260a7ec62138fec8f7b4d6c1f2009eee9004d6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a63e5b1f0e4b65c5ce59e705129ab368677a94a8)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 .../webenginequick/quicknanobrowser/Info.cmake.macos.plist | 6 +++++-
 .../quicknanobrowser/doc/src/quicknanobrowser.qdoc         | 7 +++++++
 .../webenginewidgets/simplebrowser/Info.cmake.macos.plist  | 4 ++++
 .../simplebrowser/doc/src/simplebrowser.qdoc               | 7 +++++++
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
index 8aa89c9eaad..cac4fa1f405 100644
--- a/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
+++ b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
@@ -27,6 +27,10 @@
     <key>NSSupportsAutomaticGraphicsSwitching</key>
     <true/>
     <key>NSLocationUsageDescription</key>
-    <string>Quick Nanobrowser would like to give web sites access to your location for demo purposes.</string>
+    <string>Quick Nano Browser would like to give web sites access to your location for demo purposes.</string>
+    <key>NSMicrophoneUsageDescription</key>
+    <string>Quick Nano Browser would like to give web sites access to your computer's microphone for demo purposes.</string>
+    <key>NSCameraUsageDescription</key>
+    <string>Quick Nano Browser would like to give web sites access to your computer's camera for demo purposes.</string>
 </dict>
 </plist>
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index 027a1f29ae1..545002f3072 100644
--- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -144,6 +144,13 @@
     \skipto Escape
     \printuntil /^\ {4}\}/
 
+    \section1 Signing Requirement for macOS
+
+    To allow web sites access to the location, camera, and microphone when running
+    \e {Quick Nano Browser} on macOS, the application needs to be signed. This is
+    done automatically when building, but you need to set up a valid signing identity
+    for the build environment.
+
     \section1 Files and Attributions
 
     The example uses icons from the Tango Icon Library:
diff --git a/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
index 76f74771993..7abb7e01a77 100644
--- a/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
+++ b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
@@ -28,5 +28,9 @@
     <true/>
     <key>NSLocationUsageDescription</key>
     <string>Simple Browser would like to give web sites access to your location for demo purposes.</string>
+    <key>NSMicrophoneUsageDescription</key>
+    <string>Simple Browser would like to give web sites access to your computer's microphone for demo purposes.</string>
+    <key>NSCameraUsageDescription</key>
+    <string>Simple Browser would like to give web sites access to your computer's camera for demo purposes.</string>
 </dict>
 </plist>
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index a9342f3fe91..87d326220cb 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -323,6 +323,13 @@
     finished or when an error occurs. See \c downloadmanagerwidget.cpp for an
     example of how these signals can be handled.
 
+    \section1 Signing Requirement for macOS
+
+    To allow web sites access to the location, camera, and microphone when running
+    \e {Simple Browser} on macOS, the application needs to be signed. This is
+    done automatically when building, but you need to set up a valid signing identity
+    for the build environment.
+
     \section1 Files and Attributions
 
     The example uses icons from the Tango Icon Library:

From 75133302ee7f6b3f48e4df18c31e09bdeddb1b68 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 5 Jan 2023 10:54:33 +0100
Subject: [PATCH 341/681] Add initial internal version page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We kept urls in examples to point to company website.
However this site is heavy to load and moreover it changes
overtime leaving example screenshots obsolete.

Introduce internal qt version web ui page which will
be default page for examples and which displays basic
information and can work offline.

For start show version info and command line options
for chrome://qt

Change-Id: I0271ce6e7b152efe4942a6240b0c74ba382d5fcc
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit a748cb9183143b76cad1e940220dcabf25475493)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginequick/quicknanobrowser/main.cpp  |  2 +-
 .../webenginewidgets/simplebrowser/main.cpp   |  2 +-
 src/core/CMakeLists.txt                       |  1 +
 src/core/net/webui_controller_factory_qt.cpp  |  5 +-
 src/core/version_ui_qt.cpp                    | 57 +++++++++++++++++++
 src/core/version_ui_qt.h                      | 32 +++++++++++
 tests/auto/core/CMakeLists.txt                |  1 +
 tests/auto/core/qtversion/CMakeLists.txt      | 10 ++++
 tests/auto/core/qtversion/tst_qtversion.cpp   | 34 +++++++++++
 tests/manual/examples/quick/minimal/main.qml  |  2 +-
 .../manual/examples/widgets/minimal/main.cpp  |  2 +-
 11 files changed, 143 insertions(+), 5 deletions(-)
 create mode 100644 src/core/version_ui_qt.cpp
 create mode 100644 src/core/version_ui_qt.h
 create mode 100644 tests/auto/core/qtversion/CMakeLists.txt
 create mode 100644 tests/auto/core/qtversion/tst_qtversion.cpp

diff --git a/examples/webenginequick/quicknanobrowser/main.cpp b/examples/webenginequick/quicknanobrowser/main.cpp
index 850b8c443fb..1e693cbcd26 100644
--- a/examples/webenginequick/quicknanobrowser/main.cpp
+++ b/examples/webenginequick/quicknanobrowser/main.cpp
@@ -21,7 +21,7 @@ static QUrl startupUrl(const QCommandLineParser &parser)
         if (url.isValid())
             return url;
     }
-    return QUrl(QStringLiteral("https://www.qt.io"));
+    return QUrl(QStringLiteral("chrome://qt"));
 }
 
 int main(int argc, char **argv)
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index d5d9e78abbc..bd9a3a19814 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -18,7 +18,7 @@ QUrl commandLineUrlArgument()
         if (!arg.startsWith(u'-'))
             return QUrl::fromUserInput(arg);
     }
-    return QUrl(u"https://www.qt.io"_s);
+    return QUrl(u"chrome://qt"_s);
 }
 
 int main(int argc, char **argv)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 21793972d2b..4153ce180d0 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -183,6 +183,7 @@ foreach(arch ${archs})
                 type_conversion.cpp type_conversion.h
                 user_notification_controller.cpp user_notification_controller.h
                 user_script.cpp user_script.h
+                version_ui_qt.cpp version_ui_qt.h
                 visited_links_manager_qt.cpp visited_links_manager_qt.h
                 web_contents_adapter.cpp web_contents_adapter.h
                 web_contents_adapter_client.h
diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp
index ca0e66a9b1c..ed35a3e36fe 100644
--- a/src/core/net/webui_controller_factory_qt.cpp
+++ b/src/core/net/webui_controller_factory_qt.cpp
@@ -10,7 +10,6 @@
 
 #include "build_config_qt.h"
 #include "devtools_frontend_qt.h"
-
 #include "base/functional/bind.h"
 #include "build/build_config.h"
 #include "chrome/browser/accessibility/accessibility_ui.h"
@@ -26,6 +25,7 @@
 #include "media/media_buildflags.h"
 #include "printing/buildflags/buildflags.h"
 #include "url/gurl.h"
+#include "version_ui_qt.h"
 
 #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
 #include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h"
@@ -107,6 +107,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, co
     if (url.host_piece() == chrome::kChromeUIDeviceLogHost)
         return &NewWebUI<chromeos::DeviceLogUI>;
 
+    if (url.host_piece() == chrome::kChromeUIVersionQtHost)
+        return &NewWebUI<VersionUIQt>;
+
 //    if (url.host_piece() == chrome::kChromeUIInspectHost)
 //        return &NewWebUI<InspectUI>;
 //
diff --git a/src/core/version_ui_qt.cpp b/src/core/version_ui_qt.cpp
new file mode 100644
index 00000000000..252394e2b2e
--- /dev/null
+++ b/src/core/version_ui_qt.cpp
@@ -0,0 +1,57 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "version_ui_qt.h"
+#include "api/qtwebenginecoreglobal.h"
+#include "build/build_config.h"
+#include "base/command_line.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/browser/profiles/profile.h"
+#include "qtwebengine/grit/qt_webengine_resources.h"
+#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
+
+namespace {
+const char kQtWebEngineVersion[] = "qtwebengine_version";
+const char kQtWebEngineChromiumVersion[] = "qtwebengine_chromium_version";
+const char kQtWebEngineChromiumSecurityPatchVersion[] =
+        "qtwebengine_chromium_security_patch_version";
+const char kCommandLine[] = "command_line";
+const char kQtVersionCSS[] = "qt_version.css";
+const char kQtLogo[] = "images/qtlogo.png";
+const char kQtWebEngineLogo[] = "images/qtwebengine.png";
+}
+
+VersionUIQt::VersionUIQt(content::WebUI *web_ui) : content::WebUIController(web_ui)
+{
+
+    Profile *profile = Profile::FromWebUI(web_ui);
+    content::WebUIDataSource *html_source =
+            content::WebUIDataSource::Create(chrome::kChromeUIVersionQtHost);
+    html_source->OverrideContentSecurityPolicy(
+            network::mojom::CSPDirectiveName::ScriptSrc,
+            "script-src chrome://resources 'self' 'unsafe-inline';");
+    html_source->SetDefaultResource(IDR_VERSION_UI_QT_HTML);
+    html_source->AddResourcePath(kQtVersionCSS, IDR_VERSION_UI_QT_CSS);
+    html_source->AddResourcePath("images/qt.png", IDR_QT_LOGO);
+    html_source->AddResourcePath("images/qtwebengine.png", IDR_QTWEBENGINE_LOGO);
+
+    html_source->AddString(kQtWebEngineVersion, qWebEngineVersion());
+    html_source->AddString(kQtWebEngineChromiumVersion, qWebEngineChromiumVersion());
+    html_source->AddString(kQtWebEngineChromiumSecurityPatchVersion,
+                           qWebEngineChromiumSecurityPatchVersion());
+#if BUILDFLAG(IS_WIN)
+    html_source->AddString(
+            kCommandLine,
+            base::AsString16(base::CommandLine::ForCurrentProcess()->GetCommandLineString()));
+#else
+    std::string command_line;
+    typedef std::vector<std::string> ArgvList;
+    const ArgvList &argv = base::CommandLine::ForCurrentProcess()->argv();
+    for (auto iter = argv.begin(); iter != argv.end(); iter++)
+        command_line += " " + *iter;
+    html_source->AddString(kCommandLine, command_line);
+#endif
+    content::WebUIDataSource::Add(profile, html_source);
+}
+
+VersionUIQt::~VersionUIQt() { }
diff --git a/src/core/version_ui_qt.h b/src/core/version_ui_qt.h
new file mode 100644
index 00000000000..1fe8ef9e0a6
--- /dev/null
+++ b/src/core/version_ui_qt.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef VERSION_UI_QT_H_
+#define VERSION_UI_QT_H_
+
+#include "build/build_config.h"
+#include "content/public/browser/web_ui_controller.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+class VersionUIQt : public content::WebUIController
+{
+public:
+    explicit VersionUIQt(content::WebUI *web_ui);
+    ~VersionUIQt() override;
+
+    VersionUIQt(const VersionUIQt &) = delete;
+    VersionUIQt &operator=(const VersionUIQt &) = delete;
+};
+
+#endif // VERSION_UI_QT_H
diff --git a/tests/auto/core/CMakeLists.txt b/tests/auto/core/CMakeLists.txt
index 9981d4950dd..3dd8b720a79 100644
--- a/tests/auto/core/CMakeLists.txt
+++ b/tests/auto/core/CMakeLists.txt
@@ -11,6 +11,7 @@ add_subdirectory(qwebengineurlrequestjob)
 add_subdirectory(origins)
 add_subdirectory(devtools)
 add_subdirectory(getdomainandregistry)
+add_subdirectory(qtversion)
 
 if(QT_FEATURE_ssl)
     add_subdirectory(qwebengineclientcertificatestore)
diff --git a/tests/auto/core/qtversion/CMakeLists.txt b/tests/auto/core/qtversion/CMakeLists.txt
new file mode 100644
index 00000000000..9a5e892666c
--- /dev/null
+++ b/tests/auto/core/qtversion/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qtversion
+    SOURCES
+        tst_qtversion.cpp
+    LIBRARIES
+        Qt::WebEngineCore
+)
+
diff --git a/tests/auto/core/qtversion/tst_qtversion.cpp b/tests/auto/core/qtversion/tst_qtversion.cpp
new file mode 100644
index 00000000000..44c2d4e5c90
--- /dev/null
+++ b/tests/auto/core/qtversion/tst_qtversion.cpp
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/qwebenginepage.h>
+
+class tst_QtVersion : public QObject
+{
+    Q_OBJECT
+signals:
+    void done();
+private Q_SLOTS:
+    void checkVersion();
+};
+
+void tst_QtVersion::checkVersion()
+{
+    QWebEnginePage page;
+    QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+    QSignalSpy doneSpy(this, &tst_QtVersion::done);
+    page.load(QUrl("chrome://qt"));
+    QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 12000);
+    page.toPlainText([this](const QString &result) {
+        QVERIFY(result.contains(qWebEngineVersion()));
+        QVERIFY(result.contains(qWebEngineChromiumVersion()));
+        QVERIFY(result.contains(qWebEngineChromiumSecurityPatchVersion()));
+        emit done();
+    });
+    QTRY_VERIFY(doneSpy.size());
+}
+
+QTEST_MAIN(tst_QtVersion)
+
+#include "tst_qtversion.moc"
diff --git a/tests/manual/examples/quick/minimal/main.qml b/tests/manual/examples/quick/minimal/main.qml
index a8733a8c82f..6890b501b9c 100644
--- a/tests/manual/examples/quick/minimal/main.qml
+++ b/tests/manual/examples/quick/minimal/main.qml
@@ -11,6 +11,6 @@ Window {
     visible: true
     WebEngineView {
         anchors.fill: parent
-        url: "https://www.qt.io"
+        url: "chrome://qt"
     }
 }
diff --git a/tests/manual/examples/widgets/minimal/main.cpp b/tests/manual/examples/widgets/minimal/main.cpp
index 86c04e7214f..425973116dd 100644
--- a/tests/manual/examples/widgets/minimal/main.cpp
+++ b/tests/manual/examples/widgets/minimal/main.cpp
@@ -11,7 +11,7 @@ QUrl commandLineUrlArgument()
         if (!arg.startsWith(QLatin1Char('-')))
             return QUrl::fromUserInput(arg);
     }
-    return QUrl(QStringLiteral("https://www.qt.io"));
+    return QUrl(QStringLiteral("chrome://qt"));
 }
 
 int main(int argc, char *argv[])

From 577e81b20b098474f6c4db954ace806203ab07f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 1 Aug 2023 15:02:00 +0200
Subject: [PATCH 342/681] List need for C++20 support in Platform Notes

Chromium 112-based seems to assume C++20 support by default.

Change-Id: I145722e1873ba6afc80b567452437095640457a1
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 2da82ea7c211bbf1b576aa7c2f9f5db10754ec48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-platform-notes.qdoc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index fcca298e515..3b143b0945a 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -34,6 +34,7 @@
     On all platforms, the following tools are required at build time:
 
     \list
+        \li C++20 compiler support
         \li CMake 3.19 or newer
         \li \l Python 3 with html5lib library
         \li Bison, Flex

From ab33440530f6e40d2e49d612857100d3c31cd511 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 9 Aug 2023 17:23:19 +0200
Subject: [PATCH 343/681] Add missing type to Dns Mode enum

Change-Id: Ie4f63415c04b2b699500414a78cee2a6bb015dc5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a43e832284cd8d58d58b63f983d8fdf42e51cae4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineglobalsettings.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/qwebengineglobalsettings.h b/src/core/api/qwebengineglobalsettings.h
index f89aeeadb64..deef5941f44 100644
--- a/src/core/api/qwebengineglobalsettings.h
+++ b/src/core/api/qwebengineglobalsettings.h
@@ -23,7 +23,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineGlobalSettings : public QObject
     static QWebEngineGlobalSettings *instance();
 
     // Mapping net::SecureDnsMode
-    enum class DnsMode { SystemOnly = 0, SecureWithFallback = 1, SecureOnly = 2 };
+    enum class DnsMode : quint8 { SystemOnly = 0, SecureWithFallback = 1, SecureOnly = 2 };
     bool setDnsMode(DnsMode dnsMode, const QStringList &dnsServerTemplates);
 
 private:

From dce6df9297350f44b0be0e8c53ed8f0b69ffb2f0 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 15 Aug 2023 10:07:46 +0000
Subject: [PATCH 344/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Id5388683a3c160690e426e572ae8468cbe53ca33
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 765b11a6c0b..3bd9c939253 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 2da3311057bf5169422a338d439e14af8f635148
+    ref: 200261fd253c7007059179e8f81db21485358145
     required: true
   ../qtpositioning:
-    ref: 2a7715fe909d31508b62c9c81cd4106dd3bb1df3
+    ref: 82838990253d2edef091e7e859d87cf34a4366c4
     required: false
   ../qttools:
-    ref: 8ae51aa0acc6a2e251cb4b932efa6d7d487f8a89
+    ref: 3894c8701f3142966b4a8bbfd202075ae5965550
     required: false
   ../qtwebchannel:
-    ref: 48fabbb676176328e8bcf68eff846ebaca11a173
+    ref: ca16d736f7c6ad95a732125265de151c5de17be7
     required: false

From 07fada113ad7484ec3a6692fb68353e4cffea3d3 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 15 Aug 2023 18:51:31 +0000
Subject: [PATCH 345/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I440ca2b886c3f7962f2b1b10f711206230bc5c82
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3bd9c939253..46498cb7aa7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 200261fd253c7007059179e8f81db21485358145
+    ref: 199fb8b75562ff1d649efb910d05c165329fcba8
     required: true
   ../qtpositioning:
-    ref: 82838990253d2edef091e7e859d87cf34a4366c4
+    ref: f33347dacaef042e82f3892290c7192b3e618657
     required: false
   ../qttools:
-    ref: 3894c8701f3142966b4a8bbfd202075ae5965550
+    ref: c8d388ba7a8d677b90642c61131284be308818b1
     required: false
   ../qtwebchannel:
-    ref: ca16d736f7c6ad95a732125265de151c5de17be7
+    ref: d426ca05e0fe1b35116d24866cc81974045d2783
     required: false

From f9705d97df33825f6b0a895a99f2590a9fcdb5c4 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 16 Aug 2023 11:09:28 +0000
Subject: [PATCH 346/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I027c1a21f7dc4fbc7451f12d6337e9dd5612447a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 54c27d216cf..0dfa8447471 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 651262a68599eb0e11b037e75384e5f5c1d1a955
+    ref: 644f7c4483f5f91e62d027d21c01e01134c647a9
     required: true
   ../qtpositioning:
-    ref: 46ed9de4f26c9c487cd68ed10c6371b94a264369
+    ref: d1211a3d84954e6a643298d3b39507eb9f33bf38
     required: false
   ../qttools:
-    ref: b574276c5a07d293364fa7303d91a1febb798449
+    ref: 4088321c2e4c2668b8d51ec00d9e458b828dfd7e
     required: false
   ../qtwebchannel:
-    ref: 6ffe4c6ac9a9d809b2b1392a0c328db013611722
+    ref: e4ccd6e33068cb95c84d201beb5a6b053a805f40
     required: false

From 9cb551d97f4a9511cc1daea546a9cd1ce91cc5b2 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Mon, 14 Aug 2023 13:37:38 +0200
Subject: [PATCH 347/681] QPdfPageSelector: port from QScopedPointer to const
 std::unique_ptr

The former is on extended life-support, there's nothing a const
unique_ptr does worse, so use the future-proof version.

Found in API-review.

Change-Id: Ic734b45b991b1ff81454c86b6a159897f06f815b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 1df024a1ac83e6e9c288421a125df8d51770aeff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfwidgets/qpdfpageselector.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/pdfwidgets/qpdfpageselector.h b/src/pdfwidgets/qpdfpageselector.h
index f529690e883..978b5e775d8 100644
--- a/src/pdfwidgets/qpdfpageselector.h
+++ b/src/pdfwidgets/qpdfpageselector.h
@@ -7,6 +7,8 @@
 #include <QtPdfWidgets/qtpdfwidgetsglobal.h>
 #include <QtWidgets/qspinbox.h>
 
+#include <memory>
+
 QT_BEGIN_NAMESPACE
 
 class QPdfDocument;
@@ -37,7 +39,7 @@ class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QSpinBox
 
 private:
     Q_DECLARE_PRIVATE(QPdfPageSelector)
-    QScopedPointer<QPdfPageSelectorPrivate> d_ptr;
+    const std::unique_ptr<QPdfPageSelectorPrivate> d_ptr;
 };
 
 QT_END_NAMESPACE

From dc0ec0247cb46c7f9168adc2901646c1d0c2f440 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Mon, 14 Aug 2023 16:42:38 +0200
Subject: [PATCH 348/681] QPdfPageSelector: mark dtor as override

... because it does.

Found in API-review.

Change-Id: Id1004406dbffeb92eb5297ce1623fc609d511494
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit a17fe1a5f7100be4ccad0a8f9033ebf070e455a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfwidgets/qpdfpageselector.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdfwidgets/qpdfpageselector.h b/src/pdfwidgets/qpdfpageselector.h
index 978b5e775d8..9968a583f69 100644
--- a/src/pdfwidgets/qpdfpageselector.h
+++ b/src/pdfwidgets/qpdfpageselector.h
@@ -24,7 +24,7 @@ class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QSpinBox
 public:
     QPdfPageSelector() : QPdfPageSelector(nullptr) {}
     explicit QPdfPageSelector(QWidget *parent);
-    ~QPdfPageSelector();
+    ~QPdfPageSelector() override;
 
     void setDocument(QPdfDocument *document);
     QPdfDocument *document() const;

From 72b72408df1e6ef363cfc8b347b4b5a36d84b209 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 16 Aug 2023 19:50:41 +0000
Subject: [PATCH 349/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I0a1b98e57973600d258ce4794d52e31c84fa396b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 46498cb7aa7..cc7ccaa6ff8 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 199fb8b75562ff1d649efb910d05c165329fcba8
+    ref: e6d50b30e9fb19d83e2af44c2b1595bb6338d9c2
     required: true
   ../qtpositioning:
-    ref: f33347dacaef042e82f3892290c7192b3e618657
+    ref: 0294cda48e6125ea18d077584b42eef05c54ac90
     required: false
   ../qttools:
-    ref: c8d388ba7a8d677b90642c61131284be308818b1
+    ref: cf0ca3708013b505db4c5b338673202b638a8b0b
     required: false
   ../qtwebchannel:
-    ref: d426ca05e0fe1b35116d24866cc81974045d2783
+    ref: efe2c32ac00abec4d809a707c642b22a09f7e631
     required: false

From 2a4f9eec7718e849ab45fe7622a67e41236ed624 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Wed, 16 Aug 2023 11:52:48 +0200
Subject: [PATCH 350/681] QPdfPageSelector: remove unused fwd declarations

Found in API-review.

Change-Id: Ibd5bf18706833e2a8e8a00b132570f75306fa583
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 4df45d3ee6ca8944302f17b04a5cac073849aa40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfwidgets/qpdfpageselector.h   | 1 -
 src/pdfwidgets/qpdfpageselector_p.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/src/pdfwidgets/qpdfpageselector.h b/src/pdfwidgets/qpdfpageselector.h
index 9968a583f69..a2036be210d 100644
--- a/src/pdfwidgets/qpdfpageselector.h
+++ b/src/pdfwidgets/qpdfpageselector.h
@@ -12,7 +12,6 @@
 QT_BEGIN_NAMESPACE
 
 class QPdfDocument;
-class QPdfPageNavigator;
 class QPdfPageSelectorPrivate;
 
 class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QSpinBox
diff --git a/src/pdfwidgets/qpdfpageselector_p.h b/src/pdfwidgets/qpdfpageselector_p.h
index b2cd6ecf721..6954f39cd16 100644
--- a/src/pdfwidgets/qpdfpageselector_p.h
+++ b/src/pdfwidgets/qpdfpageselector_p.h
@@ -21,8 +21,6 @@
 
 QT_BEGIN_NAMESPACE
 
-class QPdfPageRenderer;
-
 class QPdfPageSelectorPrivate
 {
     Q_DECLARE_PUBLIC(QPdfPageSelector)

From d302a9e6202567a97036265d28e5111eb755aebb Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Mon, 14 Aug 2023 16:28:34 +0200
Subject: [PATCH 351/681] QPdfPageSelector: add missing \since 6.6

Found in API-review.

Change-Id: I1e92d098d38d5f2fcf7f1c8c9aed6e792a8deb2e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 760540d18fc4df52e328430fb7b14e67d386a2d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfwidgets/qpdfpageselector.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pdfwidgets/qpdfpageselector.cpp b/src/pdfwidgets/qpdfpageselector.cpp
index 7d7e7b11e88..542f79996c5 100644
--- a/src/pdfwidgets/qpdfpageselector.cpp
+++ b/src/pdfwidgets/qpdfpageselector.cpp
@@ -25,6 +25,7 @@ void QPdfPageSelectorPrivate::documentStatusChanged()
 /*!
     \class QPdfPageSelector
     \inmodule QtPdf
+    \since 6.6
     \brief A QSpinBox for selecting a PDF page.
 
     QPdfPageSelector is a QSpinBox specialized for selecting a page label

From 12d94defb0ec34e3caca01f4653c621c4a7d3caa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 27 Jul 2023 16:28:54 +0200
Subject: [PATCH 352/681] Output web engine process dSYM info to the builds lib
 directory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It is necessary to install the web engine process in a structure
that enables users to have their applications notarized after using
macdeployqt without deleting or moving the dSYM directory manually.

Depends on qtbase/ebb361ee3f02d677460fc2b55a47c6cd4bbbc489

Fixes: QTBUG-99555
Change-Id: Ia98187ecc2a3058c5c58131403c768784c1ba893
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit dd8268d5fbab092fbd936edb618d9d5b7546a431)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/process/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index 63783af696c..80cc238f903 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -88,7 +88,8 @@ if(isFramework)
         COMPONENT Runtime
     )
     qt_enable_separate_debug_info(${qtWebEngineProcessName}
-         "${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers" QT_EXECUTABLE
+        "${INSTALL_LIBDIR}" QT_EXECUTABLE
+        DSYM_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}"
     )
 else()
     qt_apply_rpaths(TARGET ${qtWebEngineProcessName} INSTALL_PATH "${INSTALL_LIBEXECDIR}" RELATIVE_RPATH)

From 7ad43ca5eb51e56d79201b2af323a506f8a0c113 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 14 Aug 2023 18:06:21 +0200
Subject: [PATCH 353/681] Replace string literals with already defined
 constants

CodeChecker gave us a friendly hint that our defined constants were not
used as they were intended to be.

Change-Id: I4d7ae374222000f97f4c4869c9d1e7f357e1cd5f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d65add56d146211c5ce53ab1e2fbdd8058f020d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/version_ui_qt.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/version_ui_qt.cpp b/src/core/version_ui_qt.cpp
index 252394e2b2e..0208299ebc3 100644
--- a/src/core/version_ui_qt.cpp
+++ b/src/core/version_ui_qt.cpp
@@ -17,7 +17,7 @@ const char kQtWebEngineChromiumSecurityPatchVersion[] =
         "qtwebengine_chromium_security_patch_version";
 const char kCommandLine[] = "command_line";
 const char kQtVersionCSS[] = "qt_version.css";
-const char kQtLogo[] = "images/qtlogo.png";
+const char kQtLogo[] = "images/qt.png";
 const char kQtWebEngineLogo[] = "images/qtwebengine.png";
 }
 
@@ -32,8 +32,8 @@ VersionUIQt::VersionUIQt(content::WebUI *web_ui) : content::WebUIController(web_
             "script-src chrome://resources 'self' 'unsafe-inline';");
     html_source->SetDefaultResource(IDR_VERSION_UI_QT_HTML);
     html_source->AddResourcePath(kQtVersionCSS, IDR_VERSION_UI_QT_CSS);
-    html_source->AddResourcePath("images/qt.png", IDR_QT_LOGO);
-    html_source->AddResourcePath("images/qtwebengine.png", IDR_QTWEBENGINE_LOGO);
+    html_source->AddResourcePath(kQtLogo, IDR_QT_LOGO);
+    html_source->AddResourcePath(kQtWebEngineLogo, IDR_QTWEBENGINE_LOGO);
 
     html_source->AddString(kQtWebEngineVersion, qWebEngineVersion());
     html_source->AddString(kQtWebEngineChromiumVersion, qWebEngineChromiumVersion());

From 7bd080150c0fca2ae83e931a9ba03af9b048d92e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 27 Jul 2023 16:28:54 +0200
Subject: [PATCH 354/681] Output web engine process dSYM info to the builds lib
 directory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It is necessary to install the web engine process in a structure
that enables users to have their applications notarized after using
macdeployqt without deleting or moving the dSYM directory manually.

Depends on qtbase/ebb361ee3f02d677460fc2b55a47c6cd4bbbc489

Fixes: QTBUG-99555
Change-Id: Ia98187ecc2a3058c5c58131403c768784c1ba893
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit dd8268d5fbab092fbd936edb618d9d5b7546a431)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/process/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index 63783af696c..80cc238f903 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -88,7 +88,8 @@ if(isFramework)
         COMPONENT Runtime
     )
     qt_enable_separate_debug_info(${qtWebEngineProcessName}
-         "${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers" QT_EXECUTABLE
+        "${INSTALL_LIBDIR}" QT_EXECUTABLE
+        DSYM_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}"
     )
 else()
     qt_apply_rpaths(TARGET ${qtWebEngineProcessName} INSTALL_PATH "${INSTALL_LIBEXECDIR}" RELATIVE_RPATH)

From c8dff0e574bddb9d12ab6cbde40ff945b65f60ea Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 8 Aug 2023 17:51:15 +0200
Subject: [PATCH 355/681] Add missing AltGr mapping in windowsKeyCodeForQtKey

Unknown windows_key_codes are calculated from
native key codes, breaking any remapping.
Although it is named windows_key_code it is used
on other platforms too.

Fixes: QTBUG-115844
Change-Id: I53956fd6c18a6b85afe97b82696ba4f49618008c
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 888afe6d733115c04d28cbc348a5c26ddd77d233)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_event_factory.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 71f8cf74d03..b2fb74016e8 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -558,6 +558,8 @@ static int windowsKeyCodeForQtKey(int qtKey, bool isKeypad)
         case Qt::Key_QuoteDbl:
             return VK_OEM_7; // case '\'': case '"': return 0xDE;
             // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
+        case Qt::Key_AltGr:
+            return 0xE1; // (E1) VK_OEM_AX = ui::VKEY_ALTGR see ui/events/keycodes/keyboard_codes_win.h
             // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
 
         case Qt::Key_AudioRewind:

From d326e29a38f812b48268d6e86a058f326808253e Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 8 Aug 2023 17:51:15 +0200
Subject: [PATCH 356/681] Add missing AltGr mapping in windowsKeyCodeForQtKey

Unknown windows_key_codes are calculated from
native key codes, breaking any remapping.
Although it is named windows_key_code it is used
on other platforms too.

Fixes: QTBUG-115844
Change-Id: I53956fd6c18a6b85afe97b82696ba4f49618008c
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 888afe6d733115c04d28cbc348a5c26ddd77d233)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_event_factory.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 3ccfcccb41a..f4b37e83844 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -558,6 +558,8 @@ static int windowsKeyCodeForQtKey(int qtKey, bool isKeypad)
         case Qt::Key_QuoteDbl:
             return VK_OEM_7; // case '\'': case '"': return 0xDE;
             // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
+        case Qt::Key_AltGr:
+            return 0xE1; // (E1) VK_OEM_AX = ui::VKEY_ALTGR see ui/events/keycodes/keyboard_codes_win.h
             // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
 
         case Qt::Key_AudioRewind:

From d111ed02cd3216e709f7afd1cd1d5712a8d141f8 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Thu, 10 Aug 2023 15:51:57 +0200
Subject: [PATCH 357/681] Fix close button in devtools

Handle CloseWindow call coming from DevtoolsUIBindings.

Fixes: QTBUG-115976
Change-Id: If58a96e3901234696c55c9c1402c645ba7a8576b
Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu>
(cherry picked from commit e4eb2dd213df10fb470279763f1ec64e41f26b56)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/devtools_frontend_qt.cpp | 5 +++++
 src/core/devtools_frontend_qt.h   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 4ef8b35de1f..a1b9ae91c71 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -204,4 +204,9 @@ void DevToolsFrontendQt::InspectedContentsClosing()
     web_contents()->ClosePage();
 }
 
+void DevToolsFrontendQt::CloseWindow()
+{
+    web_contents()->Close();
+}
+
 } // namespace QtWebEngineCore
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index a4f1726dbb8..9b739033a12 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -60,7 +60,7 @@ class DevToolsFrontendQt : public DevToolsUIBindings::Delegate, public content::
     void OnLoadCompleted() override;
 
     void InspectElementCompleted() override{};
-    void CloseWindow() override{};
+    void CloseWindow() override;
     void Inspect(scoped_refptr<content::DevToolsAgentHost>) override{};
     void SetInspectedPageBounds(const gfx::Rect &) override{};
     void SetIsDocked(bool) override{};

From fd3e73dda91f5e66796d6f30bfaa3ef7c39ae8d3 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Thu, 10 Aug 2023 15:51:57 +0200
Subject: [PATCH 358/681] Fix close button in devtools

Handle CloseWindow call coming from DevtoolsUIBindings.

Fixes: QTBUG-115976
Change-Id: If58a96e3901234696c55c9c1402c645ba7a8576b
Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu>
(cherry picked from commit e4eb2dd213df10fb470279763f1ec64e41f26b56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/devtools_frontend_qt.cpp | 5 +++++
 src/core/devtools_frontend_qt.h   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 8c537a6c72e..49fc0d3aab4 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -209,4 +209,9 @@ std::string DevToolsFrontendQt::GetId(content::WebContents *inspectedContents)
     return content::DevToolsAgentHost::GetOrCreateFor(inspectedContents)->GetId();
 }
 
+void DevToolsFrontendQt::CloseWindow()
+{
+    web_contents()->Close();
+}
+
 } // namespace QtWebEngineCore
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index a22bb05598f..ec7ccce838e 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -61,7 +61,7 @@ class DevToolsFrontendQt : public DevToolsUIBindings::Delegate, public content::
     void OnLoadCompleted() override;
 
     void InspectElementCompleted() override{};
-    void CloseWindow() override{};
+    void CloseWindow() override;
     void Inspect(scoped_refptr<content::DevToolsAgentHost>) override{};
     void SetInspectedPageBounds(const gfx::Rect &) override{};
     void SetIsDocked(bool) override{};

From 321e8a44d2a0846aa3ac768ae90976c23d7233a3 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 16 Aug 2023 11:41:10 +0200
Subject: [PATCH 359/681] Check for pkg-config dri module on Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: Ifebdbbead1882fa0aa3c3c253c16cea17bd32f09
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit f14eddb25ec9604f4e706db1577b8ce07d247c73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index 8f30b34466b..e69d88d4065 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -56,6 +56,7 @@ if(PkgConfig_FOUND)
     pkg_check_modules(VPX vpx>=1.10.0 IMPORTED_TARGET)
     pkg_check_modules(LIBPCI libpci)
     pkg_check_modules(LIBOPENJP2 libopenjp2)
+    pkg_check_modules(DRI dri)
 endif()
 
 if(Python3_EXECUTABLE)
@@ -536,7 +537,12 @@ add_check_for_support(
 add_check_for_support(
    MODULES QtWebEngine QtPdf
    CONDITION NOT LINUX OR PkgConfig_FOUND
-   MESSAGE "A pkg-config support is required."
+   MESSAGE "pkg-config support is required."
+)
+add_check_for_support(
+   MODULES QtWebEngine QtPdf
+   CONDITION NOT LINUX OR DRI_FOUND
+   MESSAGE "pkg-config(dri) is required."
 )
 add_check_for_support(
    MODULES QtWebEngine QtPdf

From 02f3d5874b3a4bdc62250320b98b0a376c54eb2f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 21 Aug 2023 15:53:48 +0000
Subject: [PATCH 360/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ib734e9399a01da68150ee072fdaffde1492fe1c2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0dfa8447471..2d818c8b112 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 644f7c4483f5f91e62d027d21c01e01134c647a9
+    ref: 1532119a063a8a37fd8f375f3e0ca649bd4cc5a5
     required: true
   ../qtpositioning:
-    ref: d1211a3d84954e6a643298d3b39507eb9f33bf38
+    ref: afd1284be4b7ff8b3cbbc806c428a86c70778ea2
     required: false
   ../qttools:
-    ref: 4088321c2e4c2668b8d51ec00d9e458b828dfd7e
+    ref: 276bf3c3f45867f2968cad6092f9848d931a6062
     required: false
   ../qtwebchannel:
-    ref: e4ccd6e33068cb95c84d201beb5a6b053a805f40
+    ref: 2b1690db40c1f35eb2d6bfdc0d71747c5c245bb6
     required: false

From 40e0695fd30977309e3cde4526431e4bf06f591c Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:01:36 +0200
Subject: [PATCH 361/681] Port away from QScopedPointer::take() - trivial case

This API was deprecated in Qt 6.0. Use std::unique_ptr instead.

Change-Id: I6bdb4db129b6a669eeb3fac6b4c0b097087ec082
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit f65a88d715a31a0902b1b96761babacf6b1e2f50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/clipboard_qt.cpp               | 8 +++++---
 src/core/net/qrc_url_scheme_handler.cpp | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index 009235a7228..fe56a5db167 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -27,6 +27,8 @@
 #include <QImageWriter>
 #include <QMimeData>
 
+#include <memory>
+
 namespace QtWebEngineCore {
 
 static void registerMetaTypes()
@@ -60,12 +62,12 @@ using namespace QtWebEngineCore;
 
 namespace {
 
-QScopedPointer<QMimeData> uncommittedData;
+std::unique_ptr<QMimeData> uncommittedData;
 QMimeData *getUncommittedData()
 {
     if (!uncommittedData)
         uncommittedData.reset(new QMimeData);
-    return uncommittedData.data();
+    return uncommittedData.get();
 }
 
 } // namespace
@@ -104,7 +106,7 @@ void ClipboardQt::WritePortableAndPlatformRepresentations(ui::ClipboardBuffer ty
 
     // Commit the accumulated data.
     if (uncommittedData)
-        QGuiApplication::clipboard()->setMimeData(uncommittedData.take(),
+        QGuiApplication::clipboard()->setMimeData(uncommittedData.release(),
                                                   type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard
                                                                                           : QClipboard::Selection);
 
diff --git a/src/core/net/qrc_url_scheme_handler.cpp b/src/core/net/qrc_url_scheme_handler.cpp
index ab66acac0d3..a8b4e4388a2 100644
--- a/src/core/net/qrc_url_scheme_handler.cpp
+++ b/src/core/net/qrc_url_scheme_handler.cpp
@@ -10,6 +10,8 @@
 #include <QMimeDatabase>
 #include <QMimeType>
 
+#include <memory>
+
 namespace QtWebEngineCore {
 
 void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
@@ -22,7 +24,7 @@ void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
 
     QUrl requestUrl = job->requestUrl();
     QString requestPath = requestUrl.path();
-    QScopedPointer<QFile> file(new QFile(':' + requestPath, job));
+    auto file = std::make_unique<QFile>(':' + requestPath, job);
     if (!file->exists() || file->size() == 0) {
         qWarning("QResource '%s' not found or is empty", qUtf8Printable(requestPath));
         job->fail(QWebEngineUrlRequestJob::UrlNotFound);
@@ -32,9 +34,9 @@ void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
     QMimeDatabase mimeDatabase;
     QMimeType mimeType = mimeDatabase.mimeTypeForFile(fileInfo);
     if (mimeType.name() == QStringLiteral("application/x-extension-html"))
-        job->reply("text/html", file.take());
+        job->reply("text/html", file.release());
     else
-        job->reply(mimeType.name().toUtf8(), file.take());
+        job->reply(mimeType.name().toUtf8(), file.release());
 }
 
 } // namespace QtWebEngineCore

From 3bc3d7c4463f36866b3c161250daddc6cee41cd4 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:14:02 +0200
Subject: [PATCH 362/681] Port away from QTouchEvent::touchPoints()

This API was deprecated in Qt 6.0. Use QPointerEvent::points() instead.

Change-Id: I04140ef4f45399c781b1ea5c479b97138237ac49
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ca737030c634285e2758c5baca1d8c1c386766e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt_delegate_client.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index 1b30e995332..b388ea6f5c4 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -528,7 +528,7 @@ void RenderWidgetHostViewQtDelegateClient::handleTouchEvent(QTouchEvent *event)
         m_eventsToNowDelta = (base::TimeTicks::Now() - eventTimestamp).InMicroseconds();
     eventTimestamp += base::Microseconds(m_eventsToNowDelta);
 
-    auto touchPoints = mapTouchPointIds(event->touchPoints());
+    auto touchPoints = mapTouchPointIds(event->points());
     // Make sure that POINTER_DOWN action is delivered before MOVE, and MOVE before POINTER_UP
     std::sort(touchPoints.begin(), touchPoints.end(), [] (const TouchPoint &l, const TouchPoint &r) {
         return l.second.state() < r.second.state();

From 9c549677a8218d9fd6ebfe8c764dab0fc84e6903 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:03:16 +0200
Subject: [PATCH 363/681] Port away from QLibraryInfo::location()

This API was deprecated in Qt 6.0. Use QLibraryInfo::path() instead.

Change-Id: I1e47b41386c1955307785690bccb19843b0dc4b5
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 6812131178efaeeaba26123c1671877ac3685034)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/content_client_qt.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index fab8a5abb0a..3d7a157bd06 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -61,7 +61,7 @@ static QString webenginePluginsPath()
 {
     // Look for plugins in /plugins/webengine or application dir.
     static bool initialized = false;
-    static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/webengine");
+    static QString potentialPluginsPath = QLibraryInfo::path(QLibraryInfo::PluginsPath) % QLatin1String("/webengine");
     if (!initialized) {
         initialized = true;
         if (!QFileInfo::exists(potentialPluginsPath))
@@ -105,7 +105,7 @@ static QString ppapiPluginsPath()
 {
     // Look for plugins in /plugins/ppapi or application dir.
     static bool initialized = false;
-    static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
+    static QString potentialPluginsPath = QLibraryInfo::path(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
     if (!initialized) {
         initialized = true;
         if (!QFileInfo::exists(potentialPluginsPath))

From 7999e7f3799de08f80b9f178c9564d4646033787 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:05:03 +0200
Subject: [PATCH 364/681] Port away from QVariant::canConvert(int)

This API was deprecated in Qt 6.0. Use QVariant::canConvert(QMetaType)
instead.

Change-Id: I96e387536384d984b4130875f13ec0e6d027e928
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 6e745ae1ec16efa000ee3512e5306dc09d4a0682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/file_picker_controller.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 6ec7258b9d3..9b452135865 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -136,7 +136,7 @@ void FilePickerController::accepted(const QVariant &files)
 {
     QStringList stringList;
 
-    if (files.canConvert(QMetaType::QStringList)) {
+    if (files.canConvert(QMetaType{QMetaType::QStringList})) {
         stringList = files.toStringList();
     } else if (files.canConvert<QList<QUrl> >()) {
         const QList<QUrl> urls = files.value<QList<QUrl>>();

From 033ab7181ccb43cad110f96782cddac53b09ab85 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 17:04:11 +0200
Subject: [PATCH 365/681] QWebEngineQuotaRequest: add deprecation guards

This class was marked as deprecated for Qt 6.5, but not everywhere.

This commit amends 8fd7140082e3a752ca80882a29128ffc12d12fa4.

Change-Id: I7253a88aae20519befbabf01e63bb7d49c37cef0
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ac946f96e1123f2e6ab1ecb883cbebb2d3898b5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.cpp                        | 2 ++
 src/webenginequick/api/qquickwebengineforeigntypes_p.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index dff2418b536..53930bc67df 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -103,7 +103,9 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
 {
     memset(actions, 0, sizeof(actions));
 
+#if QT_DEPRECATED_SINCE(6, 5)
     qRegisterMetaType<QWebEngineQuotaRequest>();
+#endif
     qRegisterMetaType<QWebEngineRegisterProtocolHandlerRequest>();
     qRegisterMetaType<QWebEngineFileSystemAccessRequest>();
     qRegisterMetaType<QWebEngineFindTextResult>();
diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index 08fac43d5c5..b5f3b3c22a8 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -148,6 +148,7 @@ struct ForeignWebEngineContextMenuRequest
     QML_UNCREATABLE("")
 };
 
+#if QT_DEPRECATED_SINCE(6, 5)
 struct ForeignWebEngineQuotaRequest
 {
     Q_GADGET
@@ -157,6 +158,7 @@ struct ForeignWebEngineQuotaRequest
     QML_EXTRA_VERSION(2, 0)
     QML_UNCREATABLE("")
 };
+#endif
 
 struct ForeignWebEngineRegisterProtocolHandlerRequest
 {

From c71f4b0d6fcd7b14c4c24141716a2e5fc9fdd246 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:01:36 +0200
Subject: [PATCH 366/681] Port away from QScopedPointer::take() - trivial case

This API was deprecated in Qt 6.0. Use std::unique_ptr instead.

Change-Id: I6bdb4db129b6a669eeb3fac6b4c0b097087ec082
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit f65a88d715a31a0902b1b96761babacf6b1e2f50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/clipboard_qt.cpp               | 8 +++++---
 src/core/net/qrc_url_scheme_handler.cpp | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index 009235a7228..fe56a5db167 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -27,6 +27,8 @@
 #include <QImageWriter>
 #include <QMimeData>
 
+#include <memory>
+
 namespace QtWebEngineCore {
 
 static void registerMetaTypes()
@@ -60,12 +62,12 @@ using namespace QtWebEngineCore;
 
 namespace {
 
-QScopedPointer<QMimeData> uncommittedData;
+std::unique_ptr<QMimeData> uncommittedData;
 QMimeData *getUncommittedData()
 {
     if (!uncommittedData)
         uncommittedData.reset(new QMimeData);
-    return uncommittedData.data();
+    return uncommittedData.get();
 }
 
 } // namespace
@@ -104,7 +106,7 @@ void ClipboardQt::WritePortableAndPlatformRepresentations(ui::ClipboardBuffer ty
 
     // Commit the accumulated data.
     if (uncommittedData)
-        QGuiApplication::clipboard()->setMimeData(uncommittedData.take(),
+        QGuiApplication::clipboard()->setMimeData(uncommittedData.release(),
                                                   type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard
                                                                                           : QClipboard::Selection);
 
diff --git a/src/core/net/qrc_url_scheme_handler.cpp b/src/core/net/qrc_url_scheme_handler.cpp
index ab66acac0d3..a8b4e4388a2 100644
--- a/src/core/net/qrc_url_scheme_handler.cpp
+++ b/src/core/net/qrc_url_scheme_handler.cpp
@@ -10,6 +10,8 @@
 #include <QMimeDatabase>
 #include <QMimeType>
 
+#include <memory>
+
 namespace QtWebEngineCore {
 
 void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
@@ -22,7 +24,7 @@ void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
 
     QUrl requestUrl = job->requestUrl();
     QString requestPath = requestUrl.path();
-    QScopedPointer<QFile> file(new QFile(':' + requestPath, job));
+    auto file = std::make_unique<QFile>(':' + requestPath, job);
     if (!file->exists() || file->size() == 0) {
         qWarning("QResource '%s' not found or is empty", qUtf8Printable(requestPath));
         job->fail(QWebEngineUrlRequestJob::UrlNotFound);
@@ -32,9 +34,9 @@ void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
     QMimeDatabase mimeDatabase;
     QMimeType mimeType = mimeDatabase.mimeTypeForFile(fileInfo);
     if (mimeType.name() == QStringLiteral("application/x-extension-html"))
-        job->reply("text/html", file.take());
+        job->reply("text/html", file.release());
     else
-        job->reply(mimeType.name().toUtf8(), file.take());
+        job->reply(mimeType.name().toUtf8(), file.release());
 }
 
 } // namespace QtWebEngineCore

From 60dd353e7ecdf70a0c85e081c365f505fdcaee9e Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 17:33:46 +0200
Subject: [PATCH 367/681] QPdfLinkModel: mark the destructor as override

... because it does.

Found during Qt 6.6 API Review.

Change-Id: Ia8f27d3ca1cca0141bd6de7874ba20225171fb63
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit bad7ed9a00cfec66cb246cb23fdf9e7849966d2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdflinkmodel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/qpdflinkmodel.h b/src/pdf/qpdflinkmodel.h
index 2923b81cd72..e5e5c83d9a9 100644
--- a/src/pdf/qpdflinkmodel.h
+++ b/src/pdf/qpdflinkmodel.h
@@ -32,7 +32,7 @@ class Q_PDF_EXPORT QPdfLinkModel : public QAbstractListModel
     };
     Q_ENUM(Role)
     explicit QPdfLinkModel(QObject *parent = nullptr);
-    ~QPdfLinkModel();
+    ~QPdfLinkModel() override;
 
     QPdfDocument *document() const;
 

From 38ff9a2d64bab74b1e6a3000ccc412a745c05ba7 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:14:02 +0200
Subject: [PATCH 368/681] Port away from QTouchEvent::touchPoints()

This API was deprecated in Qt 6.0. Use QPointerEvent::points() instead.

Change-Id: I04140ef4f45399c781b1ea5c479b97138237ac49
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ca737030c634285e2758c5baca1d8c1c386766e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt_delegate_client.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index ce31772b38a..b10fb38cc62 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -526,7 +526,7 @@ void RenderWidgetHostViewQtDelegateClient::handleTouchEvent(QTouchEvent *event)
         m_eventsToNowDelta = (base::TimeTicks::Now() - eventTimestamp).InMicroseconds();
     eventTimestamp += base::Microseconds(m_eventsToNowDelta);
 
-    auto touchPoints = mapTouchPointIds(event->touchPoints());
+    auto touchPoints = mapTouchPointIds(event->points());
     // Make sure that POINTER_DOWN action is delivered before MOVE, and MOVE before POINTER_UP
     std::sort(touchPoints.begin(), touchPoints.end(), [] (const TouchPoint &l, const TouchPoint &r) {
         return l.second.state() < r.second.state();

From 7ab6c9b5bfac36afb7a51d2e11d031daf440ada0 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:03:16 +0200
Subject: [PATCH 369/681] Port away from QLibraryInfo::location()

This API was deprecated in Qt 6.0. Use QLibraryInfo::path() instead.

Change-Id: I1e47b41386c1955307785690bccb19843b0dc4b5
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 6812131178efaeeaba26123c1671877ac3685034)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/content_client_qt.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 5d93e25ba6c..08db0920a94 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -63,7 +63,7 @@ static QString webenginePluginsPath()
 {
     // Look for plugins in /plugins/webengine or application dir.
     static bool initialized = false;
-    static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/webengine");
+    static QString potentialPluginsPath = QLibraryInfo::path(QLibraryInfo::PluginsPath) % QLatin1String("/webengine");
     if (!initialized) {
         initialized = true;
         if (!QFileInfo::exists(potentialPluginsPath))
@@ -107,7 +107,7 @@ static QString ppapiPluginsPath()
 {
     // Look for plugins in /plugins/ppapi or application dir.
     static bool initialized = false;
-    static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
+    static QString potentialPluginsPath = QLibraryInfo::path(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
     if (!initialized) {
         initialized = true;
         if (!QFileInfo::exists(potentialPluginsPath))

From 2909769d376f731522cdf829bf0365f84b165840 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:05:03 +0200
Subject: [PATCH 370/681] Port away from QVariant::canConvert(int)

This API was deprecated in Qt 6.0. Use QVariant::canConvert(QMetaType)
instead.

Change-Id: I96e387536384d984b4130875f13ec0e6d027e928
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 6e745ae1ec16efa000ee3512e5306dc09d4a0682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/file_picker_controller.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 6ec7258b9d3..9b452135865 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -136,7 +136,7 @@ void FilePickerController::accepted(const QVariant &files)
 {
     QStringList stringList;
 
-    if (files.canConvert(QMetaType::QStringList)) {
+    if (files.canConvert(QMetaType{QMetaType::QStringList})) {
         stringList = files.toStringList();
     } else if (files.canConvert<QList<QUrl> >()) {
         const QList<QUrl> urls = files.value<QList<QUrl>>();

From e705ed237c4d9755b2152e99cbed86077f0fba16 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 17:06:15 +0200
Subject: [PATCH 371/681] QQuickWebEngineView: move using declarations outside
 of QT_DEPRECATED_SINCE block

Because they are also used in the code which is not guarded by
the deprecation checks.

Change-Id: I42383ba0f11b08df5602bfa9e0d8d816d2b96be7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit c252bc6d47d325241a00258b3ce66b42a716d788)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineview.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index aafec7295d4..120c054e874 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -80,6 +80,8 @@ QT_BEGIN_NAMESPACE
 using namespace QtWebEngineCore;
 
 Q_STATIC_ASSERT(int(QQuickWebEngineView::WebActionCount) == int(QWebEnginePage::WebActionCount));
+using LoadStatus = QWebEngineLoadingInfo::LoadStatus;
+using ErrorDomain = QWebEngineLoadingInfo::ErrorDomain;
 #if QT_DEPRECATED_SINCE(6, 2)
 QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::AcceptRequest)            == static_cast<int>(QWebEngineNavigationRequest::AcceptRequest));
@@ -95,9 +97,6 @@ Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInWindow)
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInTab)             == static_cast<int>(QWebEngineNewWindowRequest::InNewTab));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInDialog)          == static_cast<int>(QWebEngineNewWindowRequest::InNewDialog));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInBackgroundTab)   == static_cast<int>(QWebEngineNewWindowRequest::InNewBackgroundTab));
-
-using LoadStatus = QWebEngineLoadingInfo::LoadStatus;
-using ErrorDomain = QWebEngineLoadingInfo::ErrorDomain;
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NoErrorDomain)          == static_cast<int>(ErrorDomain::NoErrorDomain));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::InternalErrorDomain)    == static_cast<int>(ErrorDomain::InternalErrorDomain));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::ConnectionErrorDomain)  == static_cast<int>(ErrorDomain::ConnectionErrorDomain));

From c9e8df38689056b6c28a0116ed38c7f21c146334 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 17:04:11 +0200
Subject: [PATCH 372/681] QWebEngineQuotaRequest: add deprecation guards

This class was marked as deprecated for Qt 6.5, but not everywhere.

This commit amends 8fd7140082e3a752ca80882a29128ffc12d12fa4.

Change-Id: I7253a88aae20519befbabf01e63bb7d49c37cef0
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ac946f96e1123f2e6ab1ecb883cbebb2d3898b5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.cpp                        | 2 ++
 src/webenginequick/api/qquickwebengineforeigntypes_p.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 37a0d9ff3d6..b548309c53e 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -103,7 +103,9 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
 {
     memset(actions, 0, sizeof(actions));
 
+#if QT_DEPRECATED_SINCE(6, 5)
     qRegisterMetaType<QWebEngineQuotaRequest>();
+#endif
     qRegisterMetaType<QWebEngineRegisterProtocolHandlerRequest>();
     qRegisterMetaType<QWebEngineFileSystemAccessRequest>();
     qRegisterMetaType<QWebEngineFindTextResult>();
diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index 08fac43d5c5..b5f3b3c22a8 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -148,6 +148,7 @@ struct ForeignWebEngineContextMenuRequest
     QML_UNCREATABLE("")
 };
 
+#if QT_DEPRECATED_SINCE(6, 5)
 struct ForeignWebEngineQuotaRequest
 {
     Q_GADGET
@@ -157,6 +158,7 @@ struct ForeignWebEngineQuotaRequest
     QML_EXTRA_VERSION(2, 0)
     QML_UNCREATABLE("")
 };
+#endif
 
 struct ForeignWebEngineRegisterProtocolHandlerRequest
 {

From 02b6c3965b1cde234dc97c944b9981a66b1d9d53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 15 Aug 2023 00:15:16 +0200
Subject: [PATCH 373/681] Update Chromium

Submodule src/3rdparty 4e6ef6da..53607d83:

  * [Backpport] Security bug 1429353 (2/2)
  * [Backport] Security bug 1429353 (1/2), dependency for CVE-2023-4077 and CVE-2023-4078
  * [Backport] Security bug 1454544
  * [Backport] Security bug 1465224
  * [Backport] Security bug 1464682
  * [Backport] CVE-2023-4073: Out of bounds memory access in ANGLE.
  * [Backport] CVE-2023-4071: Heap buffer overflow in Visuals
  * [Backport] CVE-2023-4076: Use after free in WebRTC
  * [Backport] CVE-2023-4074: Use after free in Blink Task Scheduling
  * [macOS] Do not subscribe to display callbacks when GPU is disabled

Task-number: QTBUG-115697
Fixes: QTBUG-114752
Change-Id: I426d8482dbb4be62bfa1ee4bdc46841c451a8240
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 4e6ef6da9ef..53607d83afe 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 4e6ef6da9efa4b482eec5e1be1df4a5a63b14311
+Subproject commit 53607d83afec30700cc460aa5b347ff79f7d77ef

From c33c60baba1f6d411e6ec5321e68f093cb50c097 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Mon, 21 Aug 2023 16:44:33 +0200
Subject: [PATCH 374/681] QPdfLinkModel::Role: do not specify an underlying
 type for enum class

The standard guarantees that int is a default type for enum class, so
no need to spell it out explicitly.

Found during Qt 6.6 API review

Change-Id: I4ec4eb443ffe5d54f24ab20ef1de43105a06bb6d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit bafbe16d60af9bd988c0e4eda1ce8e2367e5ef80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdflinkmodel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/qpdflinkmodel.h b/src/pdf/qpdflinkmodel.h
index e5e5c83d9a9..05151ef7914 100644
--- a/src/pdf/qpdflinkmodel.h
+++ b/src/pdf/qpdflinkmodel.h
@@ -21,7 +21,7 @@ class Q_PDF_EXPORT QPdfLinkModel : public QAbstractListModel
     Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
 
 public:
-    enum class Role : int {
+    enum class Role {
         Link = Qt::UserRole,
         Rectangle,
         Url,

From 84afe6f7b94496a32e000f64d5885a9586d93b4e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 22 Aug 2023 14:44:04 +0000
Subject: [PATCH 375/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I48dea24021bec98d9f371479472353dcf7ac9535
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index cc7ccaa6ff8..c9b1a36a3d0 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: e6d50b30e9fb19d83e2af44c2b1595bb6338d9c2
+    ref: 7f8ab80931c49a721a9d001421acd2e41bb6fcdb
     required: true
   ../qtpositioning:
-    ref: 0294cda48e6125ea18d077584b42eef05c54ac90
+    ref: c75bac86704748a3e5cd02335c4e9b9df5811729
     required: false
   ../qttools:
-    ref: cf0ca3708013b505db4c5b338673202b638a8b0b
+    ref: afb6ea539d25ae2e923b0c0188274e42bd272e57
     required: false
   ../qtwebchannel:
-    ref: efe2c32ac00abec4d809a707c642b22a09f7e631
+    ref: f0d09ad0a1cf44d467b141d6b6ffe3edd005d2e0
     required: false

From 7fb068504273b45323178217609d69a22c40b73f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 22 Aug 2023 17:02:10 +0000
Subject: [PATCH 376/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ida52d567a23341059a2565ed9ae02a5fbb47e94d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 2d818c8b112..cd9b1a0b2f2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 1532119a063a8a37fd8f375f3e0ca649bd4cc5a5
+    ref: 177f08049e7ebc81ebb07aeb9615563565ad3905
     required: true
   ../qtpositioning:
-    ref: afd1284be4b7ff8b3cbbc806c428a86c70778ea2
+    ref: 5f325536ce00ada73a2d16f5261f9e000fb51d41
     required: false
   ../qttools:
-    ref: 276bf3c3f45867f2968cad6092f9848d931a6062
+    ref: 387c97ad760e9b6367dae6210e56fe9c5a04bcc8
     required: false
   ../qtwebchannel:
-    ref: 2b1690db40c1f35eb2d6bfdc0d71747c5c245bb6
+    ref: ff41c8ec1f568115275323726f9e7d40148adfa9
     required: false

From 9c07d9f6eb10977058d7e7e5901be9e78920a0ff Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Thu, 17 Aug 2023 18:59:19 +0200
Subject: [PATCH 377/681] touchbrowser: remove a duplicate source file

It's not actually used, ../../touchbrowser/touchmockingapplication.cpp
is.

I actually started editing this file when I noticed that nothing was
changing. Do the next guy a favor and remove this stale file.

Amends c89fcec0bcb65aae737f2dd733790f74e4303114.

Task-number: QTBUG-100417
Change-Id: I4e08db66e62aaa1b7bcbfb61ea060881c16a48f2
Reviewed-by: Martin Negyokru <negyokru@inf.u-szeged.hu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit fbd6a3411fb8e7c64b2f11311f782b508a51f2f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../touchbrowser/touchmockingapplication.cpp  | 261 ------------------
 1 file changed, 261 deletions(-)
 delete mode 100644 tests/manual/quick/touchbrowser/touchmockingapplication.cpp

diff --git a/tests/manual/quick/touchbrowser/touchmockingapplication.cpp b/tests/manual/quick/touchbrowser/touchmockingapplication.cpp
deleted file mode 100644
index e958d21cd12..00000000000
--- a/tests/manual/quick/touchbrowser/touchmockingapplication.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-#include "touchmockingapplication.h"
-
-#include <qpa/qwindowsysteminterface.h>
-#include <QtQuick/QQuickItem>
-#include <QtQuick/QQuickView>
-#include <QInputDevice>
-
-static inline bool isTouchEvent(const QEvent* event)
-{
-    switch (event->type()) {
-    case QEvent::TouchBegin:
-    case QEvent::TouchUpdate:
-    case QEvent::TouchEnd:
-        return true;
-    default:
-        return false;
-    }
-}
-
-static inline bool isMouseEvent(const QEvent* event)
-{
-    switch (event->type()) {
-    case QEvent::MouseButtonPress:
-    case QEvent::MouseMove:
-    case QEvent::MouseButtonRelease:
-    case QEvent::MouseButtonDblClick:
-        return true;
-    default:
-        return false;
-    }
-}
-
-TouchMockingApplication::TouchMockingApplication(int& argc, char** argv)
-    : QGuiApplication(argc, argv)
-    , m_realTouchEventReceived(false)
-    , m_pendingFakeTouchEventCount(0)
-    , m_holdingControl(false)
-{
-}
-
-bool TouchMockingApplication::notify(QObject* target, QEvent* event)
-{
-    // We try to be smart, if we received real touch event, we are probably on a device
-    // with touch screen, and we should not have touch mocking.
-
-    if (!event->spontaneous() || m_realTouchEventReceived)
-        return QGuiApplication::notify(target, event);
-
-    if (isTouchEvent(event)) {
-        if (m_pendingFakeTouchEventCount)
-            --m_pendingFakeTouchEventCount;
-        else
-            m_realTouchEventReceived = true;
-        return QGuiApplication::notify(target, event);
-    }
-
-    QQuickView* window = qobject_cast<QQuickView*>(target);
-    if (!window)
-        return QGuiApplication::notify(target, event);
-
-    m_holdingControl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
-
-    if (event->type() == QEvent::KeyRelease && static_cast<QKeyEvent*>(event)->key() == Qt::Key_Control) {
-        foreach (int id, m_heldTouchPoints)
-            if (m_touchPoints.contains(id) && !QGuiApplication::mouseButtons().testFlag(Qt::MouseButton(id))) {
-                QMutableEventPoint::setState(m_touchPoints[id], QEventPoint::Released);
-                m_heldTouchPoints.remove(id);
-            } else
-                QMutableEventPoint::setState(m_touchPoints[id], QEventPoint::Stationary);
-
-        sendTouchEvent(window, m_heldTouchPoints.isEmpty() ? QEvent::TouchEnd : QEvent::TouchUpdate, static_cast<QKeyEvent*>(event)->timestamp());
-    }
-
-    if (isMouseEvent(event)) {
-        const QMouseEvent* const mouseEvent = static_cast<QMouseEvent*>(event);
-
-        QEventPoint touchPoint;
-        QMutableEventPoint::setPressure(touchPoint, 1);
-
-        QEvent::Type touchType = QEvent::None;
-
-        switch (mouseEvent->type()) {
-        case QEvent::MouseButtonPress:
-            QMutableEventPoint::setId(touchPoint, mouseEvent->button());
-            if (m_touchPoints.contains(touchPoint.id())) {
-                QMutableEventPoint::setState(touchPoint, QEventPoint::Updated);
-                touchType = QEvent::TouchUpdate;
-            } else {
-                QMutableEventPoint::setState(touchPoint, QEventPoint::Pressed);
-                // Check if more buttons are held down than just the event triggering one.
-                if (mouseEvent->buttons() > mouseEvent->button())
-                    touchType = QEvent::TouchUpdate;
-                else
-                    touchType = QEvent::TouchBegin;
-            }
-            break;
-        case QEvent::MouseMove:
-            if (!mouseEvent->buttons()) {
-                // We have to swallow the event instead of propagating it,
-                // since we avoid sending the mouse release events and if the
-                // Flickable is the mouse grabber it would receive the event
-                // and would move the content.
-                event->accept();
-                return true;
-            }
-            touchType = QEvent::TouchUpdate;
-            QMutableEventPoint::setId(touchPoint, mouseEvent->buttons());
-            QMutableEventPoint::setState(touchPoint, QEventPoint::Updated);
-            break;
-        case QEvent::MouseButtonRelease:
-            // Check if any buttons are still held down after this event.
-            if (mouseEvent->buttons())
-                touchType = QEvent::TouchUpdate;
-            else
-                touchType = QEvent::TouchEnd;
-            QMutableEventPoint::setId(touchPoint, mouseEvent->button());
-            QMutableEventPoint::setState(touchPoint, QEventPoint::Released);
-            break;
-        case QEvent::MouseButtonDblClick:
-            // Eat double-clicks, their accompanying press event is all we need.
-            event->accept();
-            return true;
-        default:
-            Q_ASSERT_X(false, "multi-touch mocking", "unhandled event type");
-        }
-
-        // A move can have resulted in multiple buttons, so we need check them individually.
-        if (touchPoint.id() & Qt::LeftButton)
-            updateTouchPoint(mouseEvent, touchPoint, Qt::LeftButton);
-        if (touchPoint.id() & Qt::MiddleButton)
-            updateTouchPoint(mouseEvent, touchPoint, Qt::MiddleButton);
-        if (touchPoint.id() & Qt::RightButton)
-            updateTouchPoint(mouseEvent, touchPoint, Qt::RightButton);
-
-        if (m_holdingControl && touchPoint.state() == QEventPoint::Released) {
-            // We avoid sending the release event because the Flickable is
-            // listening to mouse events and would start a bounce-back
-            // animation if it received a mouse release.
-            event->accept();
-            return true;
-        }
-
-        // Update states for all other touch-points
-        for (QHash<int, QEventPoint>::iterator it = m_touchPoints.begin(), end = m_touchPoints.end(); it != end; ++it) {
-            if (!(it.value().id() & touchPoint.id()))
-                QMutableEventPoint::setState(it.value(), QEventPoint::Stationary);
-        }
-
-        Q_ASSERT(touchType != QEvent::None);
-
-        if (!sendTouchEvent(window, touchType, mouseEvent->timestamp()))
-            return QGuiApplication::notify(target, event);
-
-        event->accept();
-        return true;
-    }
-
-    return QGuiApplication::notify(target, event);
-}
-
-void TouchMockingApplication::updateTouchPoint(const QMouseEvent* mouseEvent, QEventPoint touchPoint, Qt::MouseButton mouseButton)
-{
-    // Ignore inserting additional touch points if Ctrl isn't held because it produces
-    // inconsistent touch events and results in assers in the gesture recognizers.
-    if (!m_holdingControl && m_touchPoints.size() && !m_touchPoints.contains(mouseButton))
-        return;
-
-    if (m_holdingControl && touchPoint.state() == QEventPoint::Released) {
-        m_heldTouchPoints.insert(mouseButton);
-        return;
-    }
-
-    // Gesture recognition uses the screen position for the initial threshold
-    // but since the canvas translates touch events we actually need to pass
-    // the screen position as the scene position to deliver the appropriate
-    // coordinates to the target.
-    QMutableEventPoint::setPosition(touchPoint, mouseEvent->position());
-    QMutableEventPoint::setScenePosition(touchPoint, mouseEvent->globalPosition());
-
-    if (touchPoint.state() == QEventPoint::Pressed)
-        QMutableEventPoint::setScenePosition(touchPoint, mouseEvent->scenePosition());
-    else {
-        const QEventPoint& oldTouchPoint = m_touchPoints[mouseButton];
-        QMutableEventPoint::setGlobalLastPosition(touchPoint, oldTouchPoint.globalPosition());
-    }
-
-    // Update current touch-point.
-    QMutableEventPoint::setId(touchPoint, mouseButton);
-    m_touchPoints.insert(mouseButton, touchPoint);
-}
-
-bool TouchMockingApplication::sendTouchEvent(QQuickView* window, QEvent::Type type, ulong timestamp)
-{
-    static QPointingDevice* device = 0;
-    if (!device) {
-        device = new QPointingDevice(QStringLiteral("MockTouchDevice"), 1,
-                                     QPointingDevice::DeviceType::TouchScreen,
-                                     QPointingDevice::PointerType::AllPointerTypes,
-                                     QInputDevice::Capability::All, 3, 3,
-                                     QString(), QPointingDeviceUniqueId(), window->rootObject());
-
-        QWindowSystemInterface::registerInputDevice(device);
-    }
-
-    m_pendingFakeTouchEventCount++;
-
-    const QList<QEventPoint>& currentTouchPoints = m_touchPoints.values();
-    QEventPoint::States touchPointStates = QEventPoint::States();
-    foreach (const QEventPoint& touchPoint, currentTouchPoints)
-        touchPointStates |= touchPoint.state();
-
-    QTouchEvent event(type, device, Qt::NoModifier, currentTouchPoints);
-    event.setTimestamp(timestamp);
-    event.setAccepted(false);
-
-    QGuiApplication::notify(window, &event);
-
-    updateVisualMockTouchPoints(window, m_holdingControl ? currentTouchPoints : QList<QEventPoint>());
-
-    // Get rid of touch-points that are no longer valid
-    foreach (const QEventPoint& touchPoint, currentTouchPoints) {
-        if (touchPoint.state() == QEventPoint::Released)
-            m_touchPoints.remove(touchPoint.id());
-    }
-
-    return event.isAccepted();
-}
-
-void TouchMockingApplication::updateVisualMockTouchPoints(QQuickView* window,const QList<QEventPoint>& touchPoints)
-{
-    if (touchPoints.isEmpty()) {
-        // Hide all touch indicator items.
-        foreach (QQuickItem* item, m_activeMockComponents.values())
-            item->setProperty("pressed", false);
-
-        return;
-    }
-
-    foreach (const QEventPoint& touchPoint, touchPoints) {
-        QQuickItem* mockTouchPointItem = m_activeMockComponents.value(touchPoint.id());
-
-        if (!mockTouchPointItem) {
-            QQmlComponent touchMockPointComponent(window->engine(), QUrl("qrc:///MockTouchPoint.qml"));
-            mockTouchPointItem = qobject_cast<QQuickItem*>(touchMockPointComponent.create());
-            Q_ASSERT(mockTouchPointItem);
-            m_activeMockComponents.insert(touchPoint.id(), mockTouchPointItem);
-            mockTouchPointItem->setProperty("pointId", QVariant(touchPoint.id()));
-            mockTouchPointItem->setParent(window->rootObject());
-            mockTouchPointItem->setParentItem(window->rootObject());
-        }
-
-        mockTouchPointItem->setX(touchPoint.position().x());
-        mockTouchPointItem->setY(touchPoint.position().y());
-        mockTouchPointItem->setWidth(touchPoint.ellipseDiameters().width());
-        mockTouchPointItem->setHeight(touchPoint.ellipseDiameters().height());
-        mockTouchPointItem->setProperty("pressed", QVariant(touchPoint.state() != QEventPoint::Released));
-    }
-}

From a40468136d371cc0c084ba3a4083025e2f80d82e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 23 Aug 2023 15:35:07 +0000
Subject: [PATCH 378/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ic953f1aa873d8ae6ba1a47b5c83fb18ab2213ed3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index cd9b1a0b2f2..fb30bbe8f17 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 177f08049e7ebc81ebb07aeb9615563565ad3905
+    ref: d52110beeca5157cb2e53e3103752923345892db
     required: true
   ../qtpositioning:
-    ref: 5f325536ce00ada73a2d16f5261f9e000fb51d41
+    ref: 5056eb462ee42ae3a1ff7993ac1a7f1a9735910b
     required: false
   ../qttools:
-    ref: 387c97ad760e9b6367dae6210e56fe9c5a04bcc8
+    ref: ddd03fe0475e1d59df4758fdd8708fb5f6a333d4
     required: false
   ../qtwebchannel:
-    ref: ff41c8ec1f568115275323726f9e7d40148adfa9
+    ref: 40d550e4a7d05c0fc3f76fd05cca3a0291a469a0
     required: false

From d8ed05127056dd0dfeb0d9617bcbe0c29e3e8d8e Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Mon, 14 Aug 2023 16:28:34 +0200
Subject: [PATCH 379/681] QPdfPageSelector: port from is-a to has-a QSpinBox

Yes, the class needs to inherit from QSpinBox in order to override the
protected virtuals, but that doesn't mean a QPdfPageSelector should
model is-a QSpinBox. E.g. the range of the QPdfPageSelector is taken
from the QPdfDocument, and no good can come from a user changing it
through the use of QSpinBox API, esp. if one thinks about the class
being displayed as a native widget in QtDesigner.

In a similar vein, the inheritance from QSpinBox leaves users
wondering (and the docs didn't do anything to enlighten them) what
properties are pertinent to the task at hand. setValue() to set the
page index is ... meh, but still somewhat discoverable. But that
text() is only QPdfDocument::pageLabel() if no affixes are set takes
quite some digging.

Part of this could be fixed by providing domain-specific properties
like currentPage for value, but that would just increase the
confusion, because those two properties would must needs exist on the
same object.

Instead, fix by moving the old QPdfPageSelector as
QPdfPageSelectorSpinBox into qpdfpageselector_p.h, removing its pimpl
and having QPdfPageSelector inherit QWidget instead, aggregating a
QPdfPageSelectorSpinBox. This involves a few more objects (the widget,
the layout), but gives QPdfPageSelector full control over its
interface.

Add a few salient properties (more can be added if needed, by copying
them from QSpinBox or QAbstractSpinBox).

Note how well the new API rhymes with QPdfPageNavigator in the
connect() in pdfviewer example's MainWindow.

Since we still store everything in QPdfPageSelectorSpinBox, but don't
pimpl it anymore, QPdfPageSelectorPrivate can lose the q_ptr now, and
merely contains the pointer to its QPdfPageSelectorSpinBox. This
could be optimized further, by making QPdfPageSelectorSpinBox and
QPdfPageSelectorPrivate the same class, but that's neither BC- nor
SC-relevant anymore, and can be done later (or never, seeing as this
widget is unlikely to be used more than a few times per application).

Found in API-review.

As a drive-by, port to the std-compatible subset of the QPointer API.

Change-Id: I0d82d098d38d5f2fcf7f1c8c9aed6e792a8deb2d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 8b20e0636a89dc3e6b06d174286ee16aa427887a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/pdfwidgets/pdfviewer/mainwindow.cpp |   6 +-
 src/pdfwidgets/qpdfpageselector.cpp          | 145 +++++++++++++------
 src/pdfwidgets/qpdfpageselector.h            |  21 ++-
 src/pdfwidgets/qpdfpageselector_p.h          |  34 ++++-
 4 files changed, 145 insertions(+), 61 deletions(-)

diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.cpp b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
index 5c4554ca2ec..ce19359fc58 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.cpp
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
@@ -38,10 +38,10 @@ MainWindow::MainWindow(QWidget *parent)
     ui->mainToolBar->insertWidget(ui->actionZoom_In, m_zoomSelector);
 
     ui->mainToolBar->insertWidget(ui->actionForward, m_pageSelector);
-    connect(m_pageSelector, &QPdfPageSelector::valueChanged, this, &MainWindow::pageSelected);
+    connect(m_pageSelector, &QPdfPageSelector::currentPageChanged, this, &MainWindow::pageSelected);
     m_pageSelector->setDocument(m_document);
     auto nav = ui->pdfView->pageNavigator();
-    connect(nav, &QPdfPageNavigator::currentPageChanged, m_pageSelector, &QPdfPageSelector::setValue);
+    connect(nav, &QPdfPageNavigator::currentPageChanged, m_pageSelector, &QPdfPageSelector::setCurrentPage);
     connect(nav, &QPdfPageNavigator::backAvailableChanged, ui->actionBack, &QAction::setEnabled);
     connect(nav, &QPdfPageNavigator::forwardAvailableChanged, ui->actionForward, &QAction::setEnabled);
 
@@ -116,7 +116,7 @@ void MainWindow::pageSelected(int page)
     setWindowTitle(!documentTitle.isEmpty() ? documentTitle : QStringLiteral("PDF Viewer"));
     setWindowTitle(tr("%1: page %2 (%3 of %4)")
                    .arg(documentTitle.isEmpty() ? u"PDF Viewer"_qs : documentTitle,
-                        m_pageSelector->text(), QString::number(page + 1), QString::number(m_document->pageCount())));
+                        m_pageSelector->currentPageLabel(), QString::number(page + 1), QString::number(m_document->pageCount())));
 }
 
 void MainWindow::searchResultSelected(const QModelIndex &current, const QModelIndex &previous)
diff --git a/src/pdfwidgets/qpdfpageselector.cpp b/src/pdfwidgets/qpdfpageselector.cpp
index 542f79996c5..0c42573d8c8 100644
--- a/src/pdfwidgets/qpdfpageselector.cpp
+++ b/src/pdfwidgets/qpdfpageselector.cpp
@@ -6,30 +6,20 @@
 
 #include <QPdfDocument>
 
-QT_BEGIN_NAMESPACE
+#include <QtWidgets/qboxlayout.h>
 
-QPdfPageSelectorPrivate::QPdfPageSelectorPrivate(QPdfPageSelector *q)
-    : q_ptr(q)
-{
-}
+using namespace Qt::StringLiterals;
 
-void QPdfPageSelectorPrivate::documentStatusChanged()
-{
-    Q_Q(QPdfPageSelector);
-    if (!document.isNull() && document->status() == QPdfDocument::Status::Ready) {
-        q->setMaximum(document->pageCount());
-        q->setValue(0);
-    }
-}
+QT_BEGIN_NAMESPACE
 
 /*!
     \class QPdfPageSelector
     \inmodule QtPdf
     \since 6.6
-    \brief A QSpinBox for selecting a PDF page.
+    \brief A widget for selecting a PDF page.
 
-    QPdfPageSelector is a QSpinBox specialized for selecting a page label
-    from a QPdfDocument.
+    QPdfPageSelector is a widget for selecting a page label from a
+    QPdfDocument.
 
     \sa QPdfDocument::pageLabel()
 */
@@ -38,70 +28,138 @@ void QPdfPageSelectorPrivate::documentStatusChanged()
     Constructs a PDF page selector with parent widget \a parent.
 */
 QPdfPageSelector::QPdfPageSelector(QWidget *parent)
-    : QSpinBox(parent)
-    , d_ptr(new QPdfPageSelectorPrivate(this))
+    : QWidget(parent), d_ptr(new QPdfPageSelectorPrivate)
 {
+    Q_D(QPdfPageSelector);
+    d->spinBox = new QPdfPageSelectorSpinBox(this);
+    d->spinBox->setObjectName(u"_q_spinBox"_s);
+    auto vlay = new QVBoxLayout(this);
+    vlay->setContentsMargins({});
+    vlay->addWidget(d->spinBox);
+
+    connect(d->spinBox, &QPdfPageSelectorSpinBox::_q_documentChanged,
+            this, &QPdfPageSelector::documentChanged);
+    connect(d->spinBox, &QSpinBox::valueChanged, this, &QPdfPageSelector::currentPageChanged);
+    connect(d->spinBox, &QSpinBox::textChanged, this, &QPdfPageSelector::currentPageLabelChanged);
 }
 
 /*!
     Destroys the page selector.
 */
 QPdfPageSelector::~QPdfPageSelector()
-{
-}
+    = default;
 
 /*!
     \property QPdfPageSelector::document
 
     This property holds the document to be viewed.
 */
-void QPdfPageSelector::setDocument(QPdfDocument *document)
+
+void QPdfPageSelector::setDocument(QPdfDocument *doc)
 {
     Q_D(QPdfPageSelector);
+    d->spinBox->setDocument(doc);
+}
 
-    if (d->document == document)
-        return;
+QPdfDocument *QPdfPageSelector::document() const
+{
+    Q_D(const QPdfPageSelector);
+    return d->spinBox->document();
+}
 
-    if (d->document)
-        disconnect(d->documentStatusChangedConnection);
+/*!
+    \property QPdfPageSelector::currentPage
 
-    d->document = document;
-    emit documentChanged(d->document);
+    This property holds the index (\c{0}-based) of the current page in the
+    document.
+*/
 
-    if (d->document)
-        d->documentStatusChangedConnection =
-                connect(d->document.data(), &QPdfDocument::statusChanged, this,
-                        [d](){ d->documentStatusChanged(); });
+int QPdfPageSelector::currentPage() const
+{
+    Q_D(const QPdfPageSelector);
+    return d->spinBox->value();
+}
 
-    d->documentStatusChanged();
+void QPdfPageSelector::setCurrentPage(int index)
+{
+    Q_D(QPdfPageSelector);
+    d->spinBox->setValue(index);
 }
 
-QPdfDocument *QPdfPageSelector::document() const
+/*!
+    \property QPdfPageSelector::currentPageIndex
+
+    This property holds the page label corresponding to the current page index
+    in the document.
+
+    This is the text presented to the user.
+
+    \sa QPdfDocument::pageLabel()
+*/
+
+QString QPdfPageSelector::currentPageLabel() const
 {
     Q_D(const QPdfPageSelector);
+    return d->spinBox->text();
+}
 
-    return d->document;
+//
+// QPdfPageSelectorSpinBox:
+//
+
+void QPdfPageSelectorSpinBox::documentStatusChanged()
+{
+    if (m_document && m_document->status() == QPdfDocument::Status::Ready) {
+        setMaximum(m_document->pageCount());
+        setValue(0);
+    }
 }
 
-int QPdfPageSelector::valueFromText(const QString &text) const
+void QPdfPageSelectorSpinBox::setDocument(QPdfDocument *document)
 {
-    Q_D(const QPdfPageSelector);
-    if (d->document.isNull())
+    if (m_document == document)
+        return;
+
+    if (m_document)
+        disconnect(m_documentStatusChangedConnection);
+
+    m_document = document;
+    emit _q_documentChanged(document);
+
+    if (m_document) {
+        m_documentStatusChangedConnection =
+                connect(m_document.get(), &QPdfDocument::statusChanged,
+                        this, &QPdfPageSelectorSpinBox::documentStatusChanged);
+    }
+
+    documentStatusChanged();
+}
+
+QPdfPageSelectorSpinBox::QPdfPageSelectorSpinBox(QWidget *parent)
+    : QSpinBox(parent)
+{
+}
+
+QPdfPageSelectorSpinBox::~QPdfPageSelectorSpinBox()
+    = default;
+
+int QPdfPageSelectorSpinBox::valueFromText(const QString &text) const
+{
+    if (!m_document)
         return 0;
 
-    return d->document->pageIndexForLabel(text.trimmed());
+    return m_document->pageIndexForLabel(text.trimmed());
 }
 
-QString QPdfPageSelector::textFromValue(int value) const
+QString QPdfPageSelectorSpinBox::textFromValue(int value) const
 {
-    Q_D(const QPdfPageSelector);
-    if (d->document.isNull())
+    if (!m_document)
         return {};
 
-    return d->document->pageLabel(value);
+    return m_document->pageLabel(value);
 }
 
-QValidator::State QPdfPageSelector::validate(QString &text, int &pos) const
+QValidator::State QPdfPageSelectorSpinBox::validate(QString &text, int &pos) const
 {
     Q_UNUSED(pos);
     return valueFromText(text) >= 0 ? QValidator::Acceptable : QValidator::Intermediate;
@@ -109,4 +167,5 @@ QValidator::State QPdfPageSelector::validate(QString &text, int &pos) const
 
 QT_END_NAMESPACE
 
+#include "moc_qpdfpageselector_p.cpp"
 #include "moc_qpdfpageselector.cpp"
diff --git a/src/pdfwidgets/qpdfpageselector.h b/src/pdfwidgets/qpdfpageselector.h
index a2036be210d..d779f54cd3c 100644
--- a/src/pdfwidgets/qpdfpageselector.h
+++ b/src/pdfwidgets/qpdfpageselector.h
@@ -5,7 +5,8 @@
 #define QPDFPAGESELECTOR_H
 
 #include <QtPdfWidgets/qtpdfwidgetsglobal.h>
-#include <QtWidgets/qspinbox.h>
+
+#include <QtWidgets/qwidget.h>
 
 #include <memory>
 
@@ -14,12 +15,13 @@ QT_BEGIN_NAMESPACE
 class QPdfDocument;
 class QPdfPageSelectorPrivate;
 
-class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QSpinBox
+class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QWidget
 {
     Q_OBJECT
 
     Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
-
+    Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged USER true)
+    Q_PROPERTY(QString currentPageLabel READ currentPageLabel NOTIFY currentPageLabelChanged)
 public:
     QPdfPageSelector() : QPdfPageSelector(nullptr) {}
     explicit QPdfPageSelector(QWidget *parent);
@@ -28,13 +30,16 @@ class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QSpinBox
     void setDocument(QPdfDocument *document);
     QPdfDocument *document() const;
 
+    int currentPage() const;
+    QString currentPageLabel() const;
+
+public Q_SLOTS:
+    void setCurrentPage(int index);
+
 Q_SIGNALS:
     void documentChanged(QPdfDocument *document);
-
-protected:
-    int valueFromText(const QString &text) const override;
-    QString textFromValue(int value) const override;
-    QValidator::State validate(QString &text, int &pos) const override;
+    void currentPageChanged(int index);
+    void currentPageLabelChanged(const QString &label);
 
 private:
     Q_DECLARE_PRIVATE(QPdfPageSelector)
diff --git a/src/pdfwidgets/qpdfpageselector_p.h b/src/pdfwidgets/qpdfpageselector_p.h
index 6954f39cd16..8e961f1d287 100644
--- a/src/pdfwidgets/qpdfpageselector_p.h
+++ b/src/pdfwidgets/qpdfpageselector_p.h
@@ -17,22 +17,42 @@
 
 #include "qpdfpageselector.h"
 
+#include <QtWidgets/qspinbox.h>
+
 #include <QPointer>
 
 QT_BEGIN_NAMESPACE
 
-class QPdfPageSelectorPrivate
+class QPdfPageSelectorSpinBox : public QSpinBox
 {
-    Q_DECLARE_PUBLIC(QPdfPageSelector)
-
+    Q_OBJECT
 public:
-    QPdfPageSelectorPrivate(QPdfPageSelector *q);
+    QPdfPageSelectorSpinBox() : QPdfPageSelectorSpinBox(nullptr) {}
+    explicit QPdfPageSelectorSpinBox(QWidget *parent);
+    ~QPdfPageSelectorSpinBox();
+
+    void setDocument(QPdfDocument *document);
+    QPdfDocument *document() const { return m_document.get(); }
+
+Q_SIGNALS:
+    void _q_documentChanged(QPdfDocument *document);
 
+protected:
+    int valueFromText(const QString &text) const override;
+    QString textFromValue(int value) const override;
+    QValidator::State validate(QString &text, int &pos) const override;
+
+private:
     void documentStatusChanged();
+private:
+    QPointer<QPdfDocument> m_document;
+    QMetaObject::Connection m_documentStatusChangedConnection;
+};
 
-    QPdfPageSelector *q_ptr;
-    QPointer<QPdfDocument> document;
-    QMetaObject::Connection documentStatusChangedConnection;
+class QPdfPageSelectorPrivate
+{
+public:
+    QPdfPageSelectorSpinBox *spinBox;
 };
 
 QT_END_NAMESPACE

From b19f5a60e77772cfa86c25df857492bc4b1b7201 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 24 Aug 2023 08:00:05 +0000
Subject: [PATCH 380/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ife2f6cd42f759bebd6ab81336ef988a2c56c77f2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index fb30bbe8f17..4f1b7856aa7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d52110beeca5157cb2e53e3103752923345892db
+    ref: 7a4bc6c10b5582808e02fba931af44c6907f6566
     required: true
   ../qtpositioning:
-    ref: 5056eb462ee42ae3a1ff7993ac1a7f1a9735910b
+    ref: bd8e194aad8743d77c009dbc73df0a935a267b24
     required: false
   ../qttools:
-    ref: ddd03fe0475e1d59df4758fdd8708fb5f6a333d4
+    ref: 142b4a0e799c6ba38e00fda8322690b2abf516b9
     required: false
   ../qtwebchannel:
-    ref: 40d550e4a7d05c0fc3f76fd05cca3a0291a469a0
+    ref: c83d202d615f580b57f85787bea29f47ae7cc150
     required: false

From b67315d90b23a00a83c264ab72b075749f4cf1e1 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 24 Aug 2023 08:23:36 +0000
Subject: [PATCH 381/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I02d1957082caab27459db998bc6f3ecc6aa8b514
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c9b1a36a3d0..f787ddb301e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 7f8ab80931c49a721a9d001421acd2e41bb6fcdb
+    ref: cd90e054643d42526de0be977a60a8e01fcb8972
     required: true
   ../qtpositioning:
-    ref: c75bac86704748a3e5cd02335c4e9b9df5811729
+    ref: efae7ae2592cabe012c552ccc1ea1fd067bb08ab
     required: false
   ../qttools:
-    ref: afb6ea539d25ae2e923b0c0188274e42bd272e57
+    ref: a806b298928f0a3b15fa0eaab02e277028c3fdff
     required: false
   ../qtwebchannel:
-    ref: f0d09ad0a1cf44d467b141d6b6ffe3edd005d2e0
+    ref: af0fac412d147001f22df9416fd65b24ea4690d0
     required: false

From 6a41c69bec367f6511ebfc22fb441104788859ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 24 Aug 2023 13:23:58 +0200
Subject: [PATCH 382/681] Remove QWebEngineUrlResponseInterceptor API

It has been found to not have any real effect, therefore, we remove it
again to not release a non-functional API and create false expectations
in users.

This reverts commits
    3f5de5fab74e6c152cdf5d04f3d893feaa31790b
    ab21f39c6a54be331dd8a155d3374bfe790e0274 (parts)
    082eef1916a86d6d5e0c751d271c7c8a1a5e457d
    5e257fb57a211f95556ec387fe6f262a60cbb6fe

Task-number: QTBUG-61071
Change-Id: Ifb33e32128e77dfffed863a1a7501ba21796692d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 614c78c6385f6503dce597407c30fb63fa1de451)
---
 src/core/api/CMakeLists.txt                   |   2 -
 src/core/api/qwebenginepage.cpp               |  20 ---
 src/core/api/qwebenginepage.h                 |   2 -
 src/core/api/qwebengineprofile.cpp            |  24 +--
 src/core/api/qwebengineprofile.h              |   2 -
 src/core/api/qwebengineurlresponseinfo.cpp    |  79 ----------
 src/core/api/qwebengineurlresponseinfo.h      |  51 -------
 src/core/api/qwebengineurlresponseinfo_p.h    |  46 ------
 .../api/qwebengineurlresponseinterceptor.cpp  |  10 --
 .../api/qwebengineurlresponseinterceptor.h    |  26 ----
 .../src/qwebengineurlresponseinterceptor.qdoc |  45 ------
 .../net/proxying_url_loader_factory_qt.cpp    |  67 ---------
 src/core/profile_adapter.cpp                  |  10 --
 src/core/profile_adapter.h                    |   5 -
 src/core/web_contents_adapter.cpp             |  10 --
 src/core/web_contents_adapter.h               |   3 -
 .../api/qquickwebengineprofile.cpp            |  13 --
 .../api/qquickwebengineprofile.h              |   2 -
 tests/auto/core/CMakeLists.txt                |   1 -
 .../CMakeLists.txt                            |  12 --
 .../tst_qwebengineurlresponseinterceptor.cpp  | 140 ------------------
 21 files changed, 3 insertions(+), 567 deletions(-)
 delete mode 100644 src/core/api/qwebengineurlresponseinfo.cpp
 delete mode 100644 src/core/api/qwebengineurlresponseinfo.h
 delete mode 100644 src/core/api/qwebengineurlresponseinfo_p.h
 delete mode 100644 src/core/api/qwebengineurlresponseinterceptor.cpp
 delete mode 100644 src/core/api/qwebengineurlresponseinterceptor.h
 delete mode 100644 src/core/doc/src/qwebengineurlresponseinterceptor.qdoc
 delete mode 100644 tests/auto/core/qwebengineurlresponseinterceptor/CMakeLists.txt
 delete mode 100644 tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index d5c81ea4eea..a3cb53e176b 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -34,8 +34,6 @@ qt_internal_add_module(WebEngineCore
         qwebenginesettings.cpp qwebenginesettings.h
         qwebengineurlrequestinfo.cpp qwebengineurlrequestinfo.h qwebengineurlrequestinfo_p.h
         qwebengineurlrequestinterceptor.h qwebengineurlrequestinterceptor.cpp
-        qwebengineurlresponseinterceptor.h qwebengineurlresponseinterceptor.cpp
-        qwebengineurlresponseinfo.cpp qwebengineurlresponseinfo.h qwebengineurlresponseinfo_p.h
         qwebengineurlrequestjob.cpp qwebengineurlrequestjob.h
         qwebengineurlscheme.cpp qwebengineurlscheme.h
         qwebengineurlschemehandler.cpp qwebengineurlschemehandler.h
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index b548309c53e..96852c84906 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -1688,26 +1688,6 @@ void QWebEnginePage::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *i
     d->adapter->setRequestInterceptor(interceptor);
 }
 
-/*!
-    \since 6.6
-
-    Registers the response interceptor \a interceptor to intercept URL response headers.
-
-    The page does not take ownership of the pointer. This interceptor is called
-    after any interceptors on the profile, and unlike profile interceptors, only
-    URL responses to this page are intercepted.
-
-    To unset the response interceptor, set a \c nullptr.
-
-    \sa QWebEngineUrlResponseInterceptor, QWebEngineProfile::setUrlResponseInterceptor()
-*/
-
-void QWebEnginePage::setUrlResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor)
-{
-    Q_D(QWebEnginePage);
-    d->adapter->setResponseInterceptor(interceptor);
-}
-
 void QWebEnginePage::setFeaturePermission(const QUrl &securityOrigin, QWebEnginePage::Feature feature, QWebEnginePage::PermissionPolicy policy)
 {
     Q_D(QWebEnginePage);
diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
index c76cc0487e9..f52c493a0e3 100644
--- a/src/core/api/qwebenginepage.h
+++ b/src/core/api/qwebenginepage.h
@@ -40,7 +40,6 @@ class QWebEngineRegisterProtocolHandlerRequest;
 class QWebEngineScriptCollection;
 class QWebEngineSettings;
 class QWebEngineUrlRequestInterceptor;
-class QWebEngineUrlResponseInterceptor;
 
 class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
 {
@@ -289,7 +288,6 @@ class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
     QString devToolsId() const;
 
     void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-    void setUrlResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor);
 
     LifecycleState lifecycleState() const;
     void setLifecycleState(LifecycleState state);
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
index df447de339c..5b3605474b5 100644
--- a/src/core/api/qwebengineprofile.cpp
+++ b/src/core/api/qwebengineprofile.cpp
@@ -62,12 +62,9 @@ using QtWebEngineCore::ProfileAdapter;
     The default profile can be accessed by defaultProfile(). It is a built-in profile that all
     web pages not specifically created with another profile belong to.
 
-    You can implement interceptor interfaces for URL requests and responses and register them
-    on a profile to intercept, block, or modify URL requests before they reach the networking
-    stack of Chromium or response headers right after they come off the networking stack of
-    Chromium. For requests, implement QWebEngineUrlRequestInterceptor and register it via
-    setUrlRequestInterceptor(). For response headers, implement QWebEngineUrlResponseInterceptor
-    and register it via setUrlResponseInterceptor().
+    Implementing the QWebEngineUrlRequestInterceptor interface and registering the interceptor on a
+    profile by setUrlRequestInterceptor() enables intercepting, blocking, and modifying URL
+    requests (QWebEngineUrlRequestInfo) before they reach the networking stack of Chromium.
 
     A QWebEngineUrlSchemeHandler can be registered for a profile by installUrlSchemeHandler()
     to add support for custom URL schemes. Requests for the scheme are then issued to
@@ -605,21 +602,6 @@ void QWebEngineProfile::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor
     d->profileAdapter()->setRequestInterceptor(interceptor);
 }
 
-/*!
-    Registers a response interceptor singleton \a interceptor to intercept URL response headers.
-
-    The profile does not take ownership of the pointer.
-
-    \since 6.6
-    \sa QWebEngineUrlResponseInterceptor
-*/
-
-void QWebEngineProfile::setUrlResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor)
-{
-    Q_D(QWebEngineProfile);
-    d->profileAdapter()->setResponseInterceptor(interceptor);
-}
-
 /*!
     Clears all links from the visited links database.
 
diff --git a/src/core/api/qwebengineprofile.h b/src/core/api/qwebengineprofile.h
index bd051c7843a..9fb4c8e74bf 100644
--- a/src/core/api/qwebengineprofile.h
+++ b/src/core/api/qwebengineprofile.h
@@ -24,7 +24,6 @@ class QWebEngineProfilePrivate;
 class QWebEngineSettings;
 class QWebEngineScriptCollection;
 class QWebEngineUrlRequestInterceptor;
-class QWebEngineUrlResponseInterceptor;
 class QWebEngineUrlSchemeHandler;
 
 class Q_WEBENGINECORE_EXPORT QWebEngineProfile : public QObject
@@ -75,7 +74,6 @@ class Q_WEBENGINECORE_EXPORT QWebEngineProfile : public QObject
 
     QWebEngineCookieStore *cookieStore();
     void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-    void setUrlResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor);
 
     void clearAllVisitedLinks();
     void clearVisitedLinks(const QList<QUrl> &urls);
diff --git a/src/core/api/qwebengineurlresponseinfo.cpp b/src/core/api/qwebengineurlresponseinfo.cpp
deleted file mode 100644
index e904bc8cfc2..00000000000
--- a/src/core/api/qwebengineurlresponseinfo.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-#include "qwebengineurlresponseinfo.h"
-#include "qwebengineurlresponseinfo_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
-    \class QWebEngineUrlResponseInfo
-    \brief A utility type for the QWebEngineUrlResponseInterceptor.
-    \inmodule QtWebEngineCore
-    \since 6.6
-
-    Contains information about the request that has caused the response
-    intercepted by a QWebEngineUrlResponseInterceptor.
-
-    \sa QWebEngineUrlResponseInterceptor
-*/
-QWebEngineUrlResponseInfo::QWebEngineUrlResponseInfo(
-        const QUrl &requestUrl, const QMultiHash<QByteArray, QByteArray> &requestHeaders,
-        const QHash<QByteArray, QByteArray> &responseHeaders, QObject *p)
-    : QObject(p)
-    , d_ptr(new QWebEngineUrlResponseInfoPrivate(requestUrl, requestHeaders, responseHeaders))
-{
-}
-
-QWebEngineUrlResponseInfo::~QWebEngineUrlResponseInfo(){};
-
-/*!
-    \property QWebEngineUrlResponseInfo::requestUrl
-    \brief Holds the URL of the URL load request.
-*/
-QUrl QWebEngineUrlResponseInfo::requestUrl() const
-{
-    Q_D(const QWebEngineUrlResponseInfo);
-    return d->requestUrl;
-}
-
-/*!
-    \property QWebEngineUrlResponseInfo::requestHeaders
-    \brief Holds the request headers of the URL load request.
-*/
-QMultiHash<QByteArray, QByteArray> QWebEngineUrlResponseInfo::requestHeaders() const
-{
-    Q_D(const QWebEngineUrlResponseInfo);
-    return d->requestHeaders;
-}
-
-/*!
-    \property QWebEngineUrlResponseInfo::responseHeaders
-    \brief Holds the response headers of the URL load request.
-*/
-QHash<QByteArray, QByteArray> QWebEngineUrlResponseInfo::responseHeaders() const
-{
-    Q_D(const QWebEngineUrlResponseInfo);
-    return d->responseHeaders;
-}
-
-/*!
-    \brief Sets the response headers to \a newResponseHeaders.
-
-    Sets the response headers to \a newResponseHeaders. If \a newResponseHeaders
-    differ from the current response headers then
-    QWebEngineUrlResponseInfo::isModified() will now return \c true.
-*/
-void QWebEngineUrlResponseInfo::setResponseHeaders(
-        const QHash<QByteArray, QByteArray> &newResponseHeaders)
-{
-    Q_D(QWebEngineUrlResponseInfo);
-    if (d->responseHeaders != newResponseHeaders) {
-        d->responseHeaders = newResponseHeaders;
-        d->isModified = true;
-    }
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qwebengineurlresponseinfo.cpp"
diff --git a/src/core/api/qwebengineurlresponseinfo.h b/src/core/api/qwebengineurlresponseinfo.h
deleted file mode 100644
index 980c259288d..00000000000
--- a/src/core/api/qwebengineurlresponseinfo.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-#ifndef QWEBENGINEURLRESPONSEINFO_H
-#define QWEBENGINEURLRESPONSEINFO_H
-
-#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-
-#include <QtCore/QUrl>
-#include <QtCore/QHash>
-#include <QtCore/QObject>
-
-namespace QtWebEngineCore {
-class InterceptedRequest;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QWebEngineUrlResponseInfoPrivate;
-
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlResponseInfo : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(QUrl requestUrl READ requestUrl CONSTANT FINAL)
-    Q_PROPERTY(QMultiHash<QByteArray, QByteArray> requestHeaders READ requestHeaders CONSTANT FINAL)
-    Q_PROPERTY(QHash<QByteArray,QByteArray> responseHeaders READ responseHeaders WRITE
-                       setResponseHeaders)
-
-public:
-    ~QWebEngineUrlResponseInfo() override;
-
-    QUrl requestUrl() const;
-    QMultiHash<QByteArray, QByteArray> requestHeaders() const;
-    QHash<QByteArray, QByteArray> responseHeaders() const;
-
-    void setResponseHeaders(const QHash<QByteArray, QByteArray> &newResponseHeaders);
-
-private:
-    friend class QtWebEngineCore::InterceptedRequest;
-    Q_DECLARE_PRIVATE(QWebEngineUrlResponseInfo)
-    QWebEngineUrlResponseInfoPrivate *d_ptr;
-
-    explicit QWebEngineUrlResponseInfo(const QUrl &requestUrl,
-                                       const QMultiHash<QByteArray, QByteArray> &requestHeaders,
-                                       const QHash<QByteArray, QByteArray> &responseHeaders,
-                                       QObject *p = nullptr);
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEURLRESPONSEINFO_H
diff --git a/src/core/api/qwebengineurlresponseinfo_p.h b/src/core/api/qwebengineurlresponseinfo_p.h
deleted file mode 100644
index 162da2f8b84..00000000000
--- a/src/core/api/qwebengineurlresponseinfo_p.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-#ifndef QWEBENGINEURLRESPONSEINFO_P_H
-#define QWEBENGINEURLRESPONSEINFO_P_H
-
-//
-//  W A R N I N G
-//  -------------
-//
-// This file is not part of the Qt API.  It exists purely as an
-// implementation detail.  This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qtwebenginecoreglobal_p.h"
-
-#include <QtCore/QHash>
-#include <QtCore/QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineUrlResponseInfoPrivate
-{
-public:
-    QWebEngineUrlResponseInfoPrivate(const QUrl &requestUrl,
-                                     const QMultiHash<QByteArray, QByteArray> &requestHeaders,
-                                     const QHash<QByteArray, QByteArray> &responseHeaders)
-        : requestUrl(requestUrl)
-        , requestHeaders(requestHeaders)
-        , responseHeaders(responseHeaders)
-        , isModified(false)
-    {
-    }
-
-    QUrl requestUrl;
-    QMultiHash<QByteArray, QByteArray> requestHeaders;
-    QHash<QByteArray, QByteArray> responseHeaders;
-    bool isModified;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEURLRESPONSEINFO_P_H
diff --git a/src/core/api/qwebengineurlresponseinterceptor.cpp b/src/core/api/qwebengineurlresponseinterceptor.cpp
deleted file mode 100644
index 3c9c6f36bd0..00000000000
--- a/src/core/api/qwebengineurlresponseinterceptor.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-#include "qwebengineurlresponseinterceptor.h"
-
-QT_BEGIN_NAMESPACE
-
-QWebEngineUrlResponseInterceptor::~QWebEngineUrlResponseInterceptor() = default;
-
-QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlresponseinterceptor.h b/src/core/api/qwebengineurlresponseinterceptor.h
deleted file mode 100644
index d3526861b91..00000000000
--- a/src/core/api/qwebengineurlresponseinterceptor.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-#ifndef QWEBENGINEURLRESPONSEINTERCEPTOR_H
-#define QWEBENGINEURLRESPONSEINTERCEPTOR_H
-
-#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-
-#include <QtCore/QObject>
-
-QT_BEGIN_NAMESPACE
-
-class QWebEngineUrlResponseInfo;
-
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlResponseInterceptor : public QObject
-{
-    Q_OBJECT
-public:
-    explicit QWebEngineUrlResponseInterceptor(QObject *p = nullptr) : QObject(p) { }
-    ~QWebEngineUrlResponseInterceptor() override;
-    virtual void interceptResponseHeaders(QWebEngineUrlResponseInfo &info) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEURLRESPONSEINTERCEPTOR_H
diff --git a/src/core/doc/src/qwebengineurlresponseinterceptor.qdoc b/src/core/doc/src/qwebengineurlresponseinterceptor.qdoc
deleted file mode 100644
index cbbd88bcfdd..00000000000
--- a/src/core/doc/src/qwebengineurlresponseinterceptor.qdoc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-/*!
-    \class QWebEngineUrlResponseInterceptor
-    \since 6.6
-    \brief The QWebEngineUrlResponseInterceptor class provides an abstract base class for
-           URL response interception.
-
-    \inmodule QtWebEngineCore
-
-    Implementing the \l{QWebEngineUrlResponseInterceptor} interface and installing the
-    interceptor on the profile or the page enables intercepting, blocking, and modifying
-    URL responses right as they come off the networking stack. Currently, only the response
-    headers can be accessed and modified.
-
-    You can install the interceptor on a profile via
-    QWebEngineProfile::setUrlResponseInterceptor() or
-    QQuickWebEngineProfile::setUrlResponseInterceptor() and on a page via
-    QWebEnginePage::setUrlResponseInterceptor().
-
-    \sa QWebEngineUrlResponseInterceptor::interceptResponseHeaders(),
-        QWebEngineProfile::setUrlResponseInterceptor(),
-        QQuickWebEngineProfile::setUrlResponseInterceptor(),
-        QWebEnginePage::setUrlResponseInterceptor()
-*/
-
-/*!
-    \fn QWebEngineUrlResponseInterceptor::QWebEngineUrlResponseInterceptor(QObject *p = nullptr)
-
-    Creates a new response interceptor object with \a p as parent.
-*/
-
-/*!
-    \fn void QWebEngineUrlResponseInterceptor::interceptResponseHeaders(
-        QWebEngineUrlResponseInfo &info)
-
-    Reimplement this virtual function to intercept URL
-    response headers. This method stalls the URL load until handled.
-
-    \a info contains the request and response data. Call
-    info.setResponseHeaders() to modify the response headers.
-
-    \sa QWebEngineUrlResponseInfo
-*/
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 42e5d8bc14a..79e036566b1 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -20,14 +20,11 @@
 #include "url/url_util_qt.h"
 
 #include "api/qwebengineurlrequestinfo_p.h"
-#include "api/qwebengineurlresponseinfo_p.h"
 #include "type_conversion.h"
 #include "web_contents_adapter.h"
 #include "web_contents_adapter_client.h"
 #include "web_contents_view_qt.h"
 
-#include <QtWebEngineCore/QWebEngineUrlResponseInfo>
-
 // originally based on aw_proxying_url_loader_factory.cc:
 // Copyright 2018 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
@@ -151,11 +148,6 @@ class InterceptedRequest : public network::mojom::URLLoader
     content::WebContents* webContents();
     QWebEngineUrlRequestInterceptor* getProfileInterceptor();
     QWebEngineUrlRequestInterceptor* getPageInterceptor();
-    QWebEngineUrlResponseInterceptor *getProfileResponseInterceptor();
-    QWebEngineUrlResponseInterceptor *getPageResponseInterceptor();
-
-    void interceptResponseHeaders(QWebEngineUrlResponseInterceptor *const interceptor,
-                                  net::HttpResponseHeaders *const responseHeadersPtr);
 
     QPointer<ProfileAdapter> profile_adapter_;
     const int frame_tree_node_id_;
@@ -260,59 +252,6 @@ QWebEngineUrlRequestInterceptor* InterceptedRequest::getPageInterceptor()
     return nullptr;
 }
 
-QWebEngineUrlResponseInterceptor* InterceptedRequest::getProfileResponseInterceptor()
-{
-    return profile_adapter_ ? profile_adapter_->responseInterceptor() : nullptr;
-}
-
-QWebEngineUrlResponseInterceptor* InterceptedRequest::getPageResponseInterceptor()
-{
-    if (auto wc = webContents()) {
-        auto view = static_cast<content::WebContentsImpl *>(wc)->GetView();
-        if (WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client())
-            return client->webContentsAdapter()->responseInterceptor();
-    }
-    return nullptr;
-}
-
-void InterceptedRequest::interceptResponseHeaders(
-        QWebEngineUrlResponseInterceptor *const interceptor,
-        net::HttpResponseHeaders *const responseHeadersPtr)
-{
-    QHash<QByteArray, QByteArray> responseHeaders;
-    std::unordered_set<std::string> headersToRemove;
-    {
-        std::size_t iter = 0;
-        std::string name;
-        std::string value;
-        while (responseHeadersPtr->EnumerateHeaderLines(&iter, &name, &value)) {
-            responseHeaders.insert(QByteArray::fromStdString(name),
-                                   QByteArray::fromStdString(value));
-            headersToRemove.insert(name);
-        }
-    }
-
-    const QUrl requestUrl = QUrl::fromEncoded(QByteArray::fromStdString(request_.url.spec()));
-    const QMultiHash<QByteArray, QByteArray> requestHeaders =
-            [](const net::HttpRequestHeaders &headers) {
-                QMultiHash<QByteArray, QByteArray> result;
-                for (const auto &header : headers.GetHeaderVector()) {
-                    result.insert(QByteArray::fromStdString(header.key),
-                                  QByteArray::fromStdString(header.value));
-                }
-                return result;
-            }(request_.headers);
-
-    QWebEngineUrlResponseInfo info(requestUrl, requestHeaders, responseHeaders);
-    interceptor->interceptResponseHeaders(info);
-
-    if (info.d_ptr->isModified) {
-        responseHeadersPtr->RemoveHeaders(headersToRemove);
-        for (auto it = info.responseHeaders().cbegin(); it != info.responseHeaders().cend(); ++it)
-            responseHeadersPtr->AddHeader(it.key().toStdString(), it.value().toStdString());
-    }
-}
-
 void InterceptedRequest::Restart()
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -470,12 +409,6 @@ void InterceptedRequest::ContinueAfterIntercept()
 
 void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle handle, absl::optional<mojo_base::BigBuffer> buffer)
 {
-    QWebEngineUrlResponseInterceptor *const responseInterceptor = getProfileResponseInterceptor()
-            ? getProfileResponseInterceptor()
-            : getPageResponseInterceptor();
-    if (responseInterceptor)
-        interceptResponseHeaders(responseInterceptor, head->headers.get());
-
     current_response_ = head.Clone();
 
     target_client_->OnReceiveResponse(std::move(head), std::move(handle), std::move(buffer));
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 4747ac21b0e..42c419efc8e 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -191,16 +191,6 @@ void ProfileAdapter::setRequestInterceptor(QWebEngineUrlRequestInterceptor *inte
     m_requestInterceptor = interceptor;
 }
 
-QWebEngineUrlResponseInterceptor *ProfileAdapter::responseInterceptor()
-{
-    return m_responseInterceptor.data();
-}
-
-void ProfileAdapter::setResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor)
-{
-    m_responseInterceptor = interceptor;
-}
-
 void ProfileAdapter::addClient(ProfileAdapterClient *adapterClient)
 {
     m_clients.append(adapterClient);
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index a45a12e5c80..ab4622a4bf6 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -27,7 +27,6 @@
 #include <QtWebEngineCore/qwebengineclientcertificatestore.h>
 #include <QtWebEngineCore/qwebenginecookiestore.h>
 #include <QtWebEngineCore/qwebengineurlrequestinterceptor.h>
-#include <QtWebEngineCore/qwebengineurlresponseinterceptor.h>
 #include <QtWebEngineCore/qwebengineurlschemehandler.h>
 #include "net/qrc_url_scheme_handler.h"
 
@@ -65,9 +64,6 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
     QWebEngineUrlRequestInterceptor* requestInterceptor();
     void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
 
-    QWebEngineUrlResponseInterceptor *responseInterceptor();
-    void setResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor);
-
     QList<ProfileAdapterClient*> clients() { return m_clients; }
     void addClient(ProfileAdapterClient *adapterClient);
     void removeClient(ProfileAdapterClient *adapterClient);
@@ -213,7 +209,6 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
     QWebEngineClientCertificateStore *m_clientCertificateStore = nullptr;
 #endif
     QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor;
-    QPointer<QWebEngineUrlResponseInterceptor> m_responseInterceptor;
 
     QString m_dataPath;
     QString m_downloadPath;
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 515e5d4816a..7e13064b3be 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1013,16 +1013,6 @@ QWebEngineUrlRequestInterceptor* WebContentsAdapter::requestInterceptor() const
     return m_requestInterceptor;
 }
 
-void WebContentsAdapter::setResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor)
-{
-    m_responseInterceptor = interceptor;
-}
-
-QWebEngineUrlResponseInterceptor *WebContentsAdapter::responseInterceptor() const
-{
-    return m_responseInterceptor;
-}
-
 #if QT_CONFIG(accessibility)
 QAccessibleInterface *WebContentsAdapter::browserAccessible()
 {
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index 6a4e296a1fc..807806973bb 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -211,8 +211,6 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT WebContentsAdapter : public QEnableSharedFr
     void updateRecommendedState();
     void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
     QWebEngineUrlRequestInterceptor* requestInterceptor() const;
-    void setResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor);
-    QWebEngineUrlResponseInterceptor *responseInterceptor() const;
 
 private:
     Q_DISABLE_COPY(WebContentsAdapter)
@@ -254,7 +252,6 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT WebContentsAdapter : public QEnableSharedFr
     LifecycleState m_recommendedState = LifecycleState::Active;
     bool m_inspector = false;
     QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor;
-    QPointer<QWebEngineUrlResponseInterceptor> m_responseInterceptor;
 };
 
 } // namespace QtWebEngineCore
diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp
index 92ab9dc2586..4cf4dc78f1f 100644
--- a/src/webenginequick/api/qquickwebengineprofile.cpp
+++ b/src/webenginequick/api/qquickwebengineprofile.cpp
@@ -903,19 +903,6 @@ void QQuickWebEngineProfile::setUrlRequestInterceptor(QWebEngineUrlRequestInterc
     d->profileAdapter()->setRequestInterceptor(interceptor);
 }
 
-/*!
-    Registers a response interceptor singleton \a interceptor to intercept URL responses.
-
-    The profile does not take ownership of the pointer.
-
-    \sa QWebEngineUrlResponseInterceptor
-*/
-void QQuickWebEngineProfile::setUrlResponseInterceptor(
-        QWebEngineUrlResponseInterceptor *interceptor)
-{
-    Q_D(QQuickWebEngineProfile);
-    d->profileAdapter()->setResponseInterceptor(interceptor);
-}
 
 /*!
     Returns the custom URL scheme handler register for the URL scheme \a scheme.
diff --git a/src/webenginequick/api/qquickwebengineprofile.h b/src/webenginequick/api/qquickwebengineprofile.h
index fd6cdb4f892..29d6ee0b267 100644
--- a/src/webenginequick/api/qquickwebengineprofile.h
+++ b/src/webenginequick/api/qquickwebengineprofile.h
@@ -18,7 +18,6 @@ class QWebEngineClientCertificateStore;
 class QWebEngineCookieStore;
 class QWebEngineNotification;
 class QWebEngineUrlRequestInterceptor;
-class QWebEngineUrlResponseInterceptor;
 class QWebEngineUrlSchemeHandler;
 class QQuickWebEngineScriptCollection;
 class QQuickWebEngineProfilePrivate;
@@ -91,7 +90,6 @@ class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineProfile : public QObject {
     QWebEngineCookieStore *cookieStore() const;
 
     void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-    void setUrlResponseInterceptor(QWebEngineUrlResponseInterceptor *interceptor);
 
     const QWebEngineUrlSchemeHandler *urlSchemeHandler(const QByteArray &) const;
     void installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *);
diff --git a/tests/auto/core/CMakeLists.txt b/tests/auto/core/CMakeLists.txt
index 3dd8b720a79..fca52425463 100644
--- a/tests/auto/core/CMakeLists.txt
+++ b/tests/auto/core/CMakeLists.txt
@@ -6,7 +6,6 @@ add_subdirectory(qwebengineloadinginfo)
 add_subdirectory(qwebenginesettings)
 add_subdirectory(qwebengineglobalsettings)
 add_subdirectory(qwebengineurlrequestinterceptor)
-add_subdirectory(qwebengineurlresponseinterceptor)
 add_subdirectory(qwebengineurlrequestjob)
 add_subdirectory(origins)
 add_subdirectory(devtools)
diff --git a/tests/auto/core/qwebengineurlresponseinterceptor/CMakeLists.txt b/tests/auto/core/qwebengineurlresponseinterceptor/CMakeLists.txt
deleted file mode 100644
index 08a5b9699a9..00000000000
--- a/tests/auto/core/qwebengineurlresponseinterceptor/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (C) 2023 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-include(../../httpserver/httpserver.cmake)
-
-qt_internal_add_test(tst_qwebengineurlresponseinterceptor
-    SOURCES
-        tst_qwebengineurlresponseinterceptor.cpp
-    LIBRARIES
-        Qt::WebEngineCore
-        Test::HttpServer
-)
diff --git a/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp b/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp
deleted file mode 100644
index 6a46decf436..00000000000
--- a/tests/auto/core/qwebengineurlresponseinterceptor/tst_qwebengineurlresponseinterceptor.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#include <QtTest/QtTest>
-#include <QtWebEngineCore/QWebEngineUrlResponseInterceptor>
-#include <QtWebEngineCore/QWebEngineProfile>
-#include <QtWebEngineCore/QWebEnginePage>
-#include <QtWebEngineCore/QWebEngineLoadingInfo>
-#include <QtWebEngineCore/QWebEngineUrlResponseInfo>
-
-#include <httpserver.h>
-#include <httpreqrep.h>
-
-class tst_QWebEngineUrlResponseInterceptor : public QObject
-{
-    Q_OBJECT
-
-public:
-    tst_QWebEngineUrlResponseInterceptor() { }
-    ~tst_QWebEngineUrlResponseInterceptor() { }
-
-public Q_SLOTS:
-    void init() { }
-    void cleanup() { }
-
-private Q_SLOTS:
-    void initTestCase() { }
-    void cleanupTestCase() { }
-    void interceptRequest_data();
-    void interceptRequest();
-};
-
-Q_LOGGING_CATEGORY(lc, "qt.webengine.tests")
-
-class Interceptor : public QWebEngineUrlResponseInterceptor
-{
-    Q_OBJECT
-
-    QUrl m_receivedRequestUrl;
-    QMultiHash<QByteArray, QByteArray> m_receivedRequestHeaders;
-
-public:
-    void interceptResponseHeaders(QWebEngineUrlResponseInfo &info) override
-    {
-        m_receivedRequestUrl = info.requestUrl();
-        m_receivedRequestHeaders = info.requestHeaders();
-        QHash<QByteArray, QByteArray> responseHeaders = info.responseHeaders();
-
-        responseHeaders.insert(QByteArrayLiteral("ADDEDHEADER"), QByteArrayLiteral("ADDEDVALUE"));
-        *(responseHeaders.find(QByteArrayLiteral("content-length"))) = QByteArrayLiteral("57");
-
-        info.setResponseHeaders(responseHeaders);
-    }
-
-    void getReceivedRequest(QUrl *receivedRequestUrl,
-                            QMultiHash<QByteArray, QByteArray> *receivedRequestHeaders)
-    {
-        *receivedRequestUrl = m_receivedRequestUrl;
-        *receivedRequestHeaders = m_receivedRequestHeaders;
-    }
-};
-
-void tst_QWebEngineUrlResponseInterceptor::interceptRequest_data()
-{
-    QTest::addColumn<bool>("withProfileInterceptor");
-    QTest::newRow("with profile interceptor") << true;
-    QTest::newRow("with page interceptor") << false;
-}
-
-void tst_QWebEngineUrlResponseInterceptor::interceptRequest()
-{
-    QFETCH(bool, withProfileInterceptor);
-
-    HttpServer httpServer;
-    QObject::connect(&httpServer, &HttpServer::newRequest, this, [&](HttpReqRep *rr) {
-        if (rr->requestPath() == QByteArrayLiteral("/okay.html")) {
-            rr->setResponseBody(QByteArrayLiteral(
-                    "<html><script>console.log('hello world js!');</script></html>"));
-            rr->sendResponse();
-        }
-    });
-    QVERIFY(httpServer.start());
-
-    const QUrl requestUrl = httpServer.url(QStringLiteral("/okay.html"));
-
-    Interceptor interceptor;
-    QWebEngineProfile profile;
-    QWebEnginePage page(&profile);
-    if (withProfileInterceptor)
-        profile.setUrlResponseInterceptor(&interceptor);
-    else
-        page.setUrlResponseInterceptor(&interceptor);
-
-    QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
-
-    bool headersWereChanged = false;
-    QObject::connect(
-            &page, &QWebEnginePage::loadingChanged, this, [&](QWebEngineLoadingInfo loadingInfo) {
-                const QHash<QByteArray, QByteArray> responseHeaders = loadingInfo.responseHeaders();
-                bool contentLengthSizeChanged = false;
-                bool additionalHeaderAdded = false;
-                for (auto it = responseHeaders.constBegin(); it != responseHeaders.constEnd();
-                     ++it) {
-                    if (it.key() == QByteArrayLiteral("content-length")
-                        && it.value() == QByteArrayLiteral("57"))
-                        contentLengthSizeChanged = true;
-                    if (it.key() == QByteArrayLiteral("ADDEDHEADER")
-                        && it.value() == QByteArrayLiteral("ADDEDVALUE"))
-                        additionalHeaderAdded = true;
-                }
-
-                if (contentLengthSizeChanged && additionalHeaderAdded)
-                    headersWereChanged = true;
-            });
-
-    page.load(requestUrl);
-
-    QVERIFY(loadSpy.wait());
-
-    QUrl receivedRequestUrl;
-    QMultiHash<QByteArray, QByteArray> receivedRequestHeaders;
-    interceptor.getReceivedRequest(&receivedRequestUrl, &receivedRequestHeaders);
-
-    bool receivedRequestHeadersContainsQtWebEngine = false;
-    for (auto it = receivedRequestHeaders.cbegin(); it != receivedRequestHeaders.cend(); ++it) {
-        if (it.value().contains("QtWebEngine/")) {
-            receivedRequestHeadersContainsQtWebEngine = true;
-            break;
-        }
-    }
-
-    QVERIFY(headersWereChanged);
-    QCOMPARE_EQ(receivedRequestUrl, requestUrl);
-    QVERIFY(receivedRequestHeaders.size() != 0);
-    QVERIFY(receivedRequestHeadersContainsQtWebEngine);
-    QVERIFY(httpServer.stop());
-}
-
-QTEST_MAIN(tst_QWebEngineUrlResponseInterceptor)
-#include "tst_qwebengineurlresponseinterceptor.moc"

From a2cba379c4a6b29812573a85589a28fcd4249cec Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 25 Aug 2023 12:11:52 +0000
Subject: [PATCH 383/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ie767ef68a5bfb8d03511b3985317daf3eed61440
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 4f1b7856aa7..ba7d427eed7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 7a4bc6c10b5582808e02fba931af44c6907f6566
+    ref: 25f634b11cdaad24c5e2c20edf1c208a7b90d848
     required: true
   ../qtpositioning:
-    ref: bd8e194aad8743d77c009dbc73df0a935a267b24
+    ref: 9d5eef214c17bbad673d1c98e71d7499bacbeb6b
     required: false
   ../qttools:
-    ref: 142b4a0e799c6ba38e00fda8322690b2abf516b9
+    ref: ccb887f33b3acc3ade9ed17742899ef2afbcb5c7
     required: false
   ../qtwebchannel:
-    ref: c83d202d615f580b57f85787bea29f47ae7cc150
+    ref: 20f58a66f97f93ce9d68f831fd6dab60868ed58c
     required: false

From 1618662b55edfcb6dae2d813674f77b2cd9207dd Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 25 Aug 2023 11:50:39 +0000
Subject: [PATCH 384/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I9eda248a82866338c8f70f1993776cc03d663cef
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index f787ddb301e..cd5d20a06d6 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: cd90e054643d42526de0be977a60a8e01fcb8972
+    ref: ff4c80138dcb81fb844ecf681a9487e14f452066
     required: true
   ../qtpositioning:
-    ref: efae7ae2592cabe012c552ccc1ea1fd067bb08ab
+    ref: 840f1e2a34165d7a34b21b7ca0de28da7a4dde8d
     required: false
   ../qttools:
-    ref: a806b298928f0a3b15fa0eaab02e277028c3fdff
+    ref: b784764ef2749e826653ee09d0c5b0bf9e10dd3e
     required: false
   ../qtwebchannel:
-    ref: af0fac412d147001f22df9416fd65b24ea4690d0
+    ref: a5beffb60a6265aa3ef56738a3905ab59f26681f
     required: false

From 528935b19108787ad8d71e29aa4ef403f29346a6 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 25 Aug 2023 16:28:01 +0200
Subject: [PATCH 385/681] Disable not supported Picture-In-Picture feature

It was disabled once, but it disappeared from media switches. The new
place to set this is WebPreferences.

Change-Id: I4562db45d2d32a684266d0cb92523f9db0f4afd7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 754010362f2af7dbeb9b6fdd3888cd0190d8604a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_settings.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 1e1a3105dc0..23ba7a31ae5 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -323,6 +323,9 @@ void WebEngineSettings::doApply()
 
 void WebEngineSettings::applySettingsToWebPreferences(blink::web_pref::WebPreferences *prefs)
 {
+    // Not supported
+    prefs->picture_in_picture_enabled = false;
+
     // Override for now
     prefs->touch_event_feature_detection_enabled = isTouchEventsAPIEnabled();
 #if !QT_CONFIG(webengine_embedded_build)

From 476ea55f219724c6fe5a68dcfd62061281a0a494 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 28 Aug 2023 08:53:21 +0000
Subject: [PATCH 386/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I8531d64ff9414ebf6d003891876bac444360e6a2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index ba7d427eed7..3118a424893 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 25f634b11cdaad24c5e2c20edf1c208a7b90d848
+    ref: c4a5eb89f3c78df3ca310c0032a994ddcf7a1830
     required: true
   ../qtpositioning:
-    ref: 9d5eef214c17bbad673d1c98e71d7499bacbeb6b
+    ref: b64794db9b3e5a0b9a5eb8395fa618d2ff13431c
     required: false
   ../qttools:
-    ref: ccb887f33b3acc3ade9ed17742899ef2afbcb5c7
+    ref: e214939cc75a59e9d86350901e891f97f8013d17
     required: false
   ../qtwebchannel:
-    ref: 20f58a66f97f93ce9d68f831fd6dab60868ed58c
+    ref: 9deb349910a5d61b3209b493400c8a0f41c25e22
     required: false

From 78530d854f164202654989ad008a142f92108506 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 17:06:15 +0200
Subject: [PATCH 387/681] QQuickWebEngineView: move using declarations outside
 of QT_DEPRECATED_SINCE block

Because they are also used in the code which is not guarded by
the deprecation checks.

Change-Id: I42383ba0f11b08df5602bfa9e0d8d816d2b96be7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit c252bc6d47d325241a00258b3ce66b42a716d788)
---
 src/webenginequick/api/qquickwebengineview.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index 5e248327d32..cd73749c9c8 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -77,6 +77,8 @@
 QT_BEGIN_NAMESPACE
 using namespace QtWebEngineCore;
 
+using LoadStatus = QWebEngineLoadingInfo::LoadStatus;
+using ErrorDomain = QWebEngineLoadingInfo::ErrorDomain;
 #if QT_DEPRECATED_SINCE(6, 2)
 QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::AcceptRequest)            == static_cast<int>(QWebEngineNavigationRequest::AcceptRequest));
@@ -92,9 +94,6 @@ Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInWindow)
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInTab)             == static_cast<int>(QWebEngineNewWindowRequest::InNewTab));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInDialog)          == static_cast<int>(QWebEngineNewWindowRequest::InNewDialog));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInBackgroundTab)   == static_cast<int>(QWebEngineNewWindowRequest::InNewBackgroundTab));
-
-using LoadStatus = QWebEngineLoadingInfo::LoadStatus;
-using ErrorDomain = QWebEngineLoadingInfo::ErrorDomain;
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NoErrorDomain)          == static_cast<int>(ErrorDomain::NoErrorDomain));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::InternalErrorDomain)    == static_cast<int>(ErrorDomain::InternalErrorDomain));
 Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::ConnectionErrorDomain)  == static_cast<int>(ErrorDomain::ConnectionErrorDomain));

From 779418b5ee30ab36a74fb76f06a82f2a6e74067e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 28 Aug 2023 12:46:45 +0000
Subject: [PATCH 388/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I1ce21cd3ef26c007400a0c7f11b1984cc7192be9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index cd5d20a06d6..b3d05548c31 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: ff4c80138dcb81fb844ecf681a9487e14f452066
+    ref: 34e3b95961321b576a212a5320a040eb19a95260
     required: true
   ../qtpositioning:
-    ref: 840f1e2a34165d7a34b21b7ca0de28da7a4dde8d
+    ref: 407a881a12b265a232b8402c17beccc701c36fb7
     required: false
   ../qttools:
-    ref: b784764ef2749e826653ee09d0c5b0bf9e10dd3e
+    ref: 2fec255188a24973ad6a214790e741e274816550
     required: false
   ../qtwebchannel:
-    ref: a5beffb60a6265aa3ef56738a3905ab59f26681f
+    ref: a9ee41470c2514dabb746df999735bebafd0da8b
     required: false

From a7544f5ae8aa2d4016c779ebccec492a8beea1dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 15 Aug 2023 11:13:35 +0200
Subject: [PATCH 389/681] Update Chromium

Submodule src/3rdparty 2d71c20d..cfa9a71a:
  * Fix for QtWebEngine crash on Windows
  * FIXUP: Add minimal webrtcdesktopcapture api for hangout services extension
  * FIXUP: Jumbo build
  * [Backport] CVE-2023-4078: Inappropriate implementation in Extensions (2/2)
  * [Backport] CVE-2023-4077: Insufficient data validation in Extensions (3/3)
  * [Backport] CVE-2023-4077 (2/3) and CVE-2023-4078 (1/2)
  * [Backport] CVE-2023-4077: Insufficient data validation in Extensions (1/3)
  * [Backport] Security bug 1429353 (2/2)
  * [Backport] Security bug 1429353 (1/2), dependency for CVE-2023-4077 and CVE-2023-4078
  * [Backport] Security bug 1454544
  * [Backport] Security bug 1465224
  * [Backport] CVE-2023-4070: Type Confusion in V8
  * [Backport] CVE-2023-4073: Out of bounds memory access in ANGLE.
  * [Backport] CVE-2023-4071: Heap buffer overflow in Visuals
  * [Backport] CVE-2023-4076: Use after free in WebRTC
  * [Backport] CVE-2023-4074: Use after free in Blink Task Scheduling
  * [Backport] CVE-2023-4068: Type Confusion in V8
  * [Backport] Security bug 1464680
  * [Backport] Security bug 1464682
  * FIXUP: Fix build with enable_vulkan=false

Task-number: QTBUG-115470
Fixes: QTBUG-115703
Change-Id: I1478381717e2189f74041c9e3b62751bdd089d45
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit c4e1822f45a8d6a7941c908e72690fc2a578fef7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 55edfe57d4e..14d1a5775d6 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           115.0.5790.98
+Patched with security patches up to Chromium version:           115.0.5790.170
diff --git a/src/3rdparty b/src/3rdparty
index 2d71c20d894..cfa9a71a9ec 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 2d71c20d894b2d19ecbbd6b54901eb00e130253d
+Subproject commit cfa9a71a9ecb29af6c46f4ca2242c2dc9600b339
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 1a2847d3fbb..f6115b3ad7a 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -931,7 +931,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "115.0.5790.98"; // FIXME: Remember to update
+    return "115.0.5790.170"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 7d9419c54a86b6bd4e8708279793bd0ff9915592 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 25 Aug 2023 20:07:19 +0200
Subject: [PATCH 390/681] Update Chromium

Submodule src/3rdparty cfa9a71a..b02cdcee:
  * [Backport] CVE-2023-4430: Use after free in Vulkan
  * [Backport] CVE-2023-4431: Out of bounds memory access in Fonts
  * [Backport] CVE-2023-4428: Out of bounds memory access in CSS
  * [Backport] CVE-2023-4427: Out of bounds memory access in V8
  * [Backport] Security bug 1455619
  * [Backport] CVE-2023-4365: Inappropriate implementation in Fullscreen.
  * [Backport] CVE-2023-4362: Heap buffer overflow in Mojom IDL
  * [Backport] CVE-2023-4358: Use after free in DNS
  * [Backport] CVE-2023-4357: Insufficient validation of untrusted input in XML.
  * [Backport] CVE-2023-4356: Use after free in Audio
  * [Backport] CVE-2023-4355: Out of bounds memory access in V8.
  * [Backport] CVE-2023-4354: Heap buffer overflow in Skia
  * [Backport] CVE-2023-4353: Heap buffer overflow in ANGLE
  * [Backport] CVE-2023-4352: Type Confusion in V8
  * [Backport] CVE-2023-4351: Use after free in Network

Task-number: QTBUG-116501
Change-Id: Icd416a6218aac88ab0282233ca8f05267dc8f1f3
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit be9f659309f7d71253699d72b579204b885a6235)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index cfa9a71a9ec..b02cdceebb1 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit cfa9a71a9ecb29af6c46f4ca2242c2dc9600b339
+Subproject commit b02cdceebb1e7248f7e98f5ffb3eec10930ab947

From 63d9538c5a3df1cfdd0f2437a08dc898ac372981 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 29 Aug 2023 09:03:49 +0000
Subject: [PATCH 391/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I1cd69fba9555b461697b14d44c482dde7a48f523
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3118a424893..1fdd8414308 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: c4a5eb89f3c78df3ca310c0032a994ddcf7a1830
+    ref: 3fb3c737e714da77adb921581694cf553cda0743
     required: true
   ../qtpositioning:
-    ref: b64794db9b3e5a0b9a5eb8395fa618d2ff13431c
+    ref: ed0bfc2e1f329131b0c9d395f8047ef4c2f7df05
     required: false
   ../qttools:
-    ref: e214939cc75a59e9d86350901e891f97f8013d17
+    ref: 54ea32429e0515cb152943d4637766bd9d61f948
     required: false
   ../qtwebchannel:
-    ref: 9deb349910a5d61b3209b493400c8a0f41c25e22
+    ref: 6ab4b912008dffcf9c5fc64e8969c22a97764708
     required: false

From 8b4632b7204b6d17c58ad4d28b9fb5631d5bd1f9 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 29 Aug 2023 14:24:28 +0000
Subject: [PATCH 392/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I7ba5c8de5ee89f9c440aebf71bbd292b78a38765
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b3d05548c31..34b175e19d7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 34e3b95961321b576a212a5320a040eb19a95260
+    ref: d179cadd1f8d5e479efdac71dc54933f7b25d384
     required: true
   ../qtpositioning:
-    ref: 407a881a12b265a232b8402c17beccc701c36fb7
+    ref: c384feda26f3af019a2e463353e183b55d15eb56
     required: false
   ../qttools:
-    ref: 2fec255188a24973ad6a214790e741e274816550
+    ref: 9942084f870861d11b9cadbc4a83735d918a14f8
     required: false
   ../qtwebchannel:
-    ref: a9ee41470c2514dabb746df999735bebafd0da8b
+    ref: e29aece634abe1c3414800a37044ca7c396212db
     required: false

From 014ac76db7278d1bb224322ab8c74e3a2b67c087 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 28 Jun 2023 15:59:23 +0200
Subject: [PATCH 393/681] Make visual studio configure check last
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Check first for the compiler version as visual studio
test assumes the compiler is valid and the error message
can be misleading in a case the test fails.

Fixes: QTBUG-114875
Change-Id: Ie25185943845cbbfd0dc45334161fba245fb86ea
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 886c3fe8d5e7d9e4938943c04efb943660d4a96e)
---
 configure.cmake | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index 68c768440e6..c217175b09c 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -572,11 +572,6 @@ add_check_for_support(
    MESSAGE "Could not find all necessary libraries for qpa-xcb support.\
 ${xcbErrorMessage}"
 )
-add_check_for_support(
-   MODULES QtWebEngine QtPdf
-   CONDITION NOT WIN32 OR TEST_winversion
-   MESSAGE "Build requires Visual Studio 2019 or higher."
-)
 add_check_for_support(
    MODULES QtWebEngine QtPdf
    CONDITION
@@ -590,7 +585,6 @@ add_check_for_support(
        (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
    MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )
-
 if(WIN32)
     if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
         add_check_for_support(
@@ -609,6 +603,11 @@ if(WIN32)
         MESSAGE "Build requires Windows 10 SDK at least version 10.0.20348.0"
     )
 endif()
+add_check_for_support(
+   MODULES QtWebEngine QtPdf
+   CONDITION NOT MSVC OR TEST_winversion
+   MESSAGE "Build requires Visual Studio 2019 or higher."
+)
 
 #### Summary
 

From 2e62b359cbe3877844c3cb0f8dabdd1426809fd9 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 6 Apr 2023 11:54:55 +0200
Subject: [PATCH 394/681] Migrate hostcompiler test to cmake host project
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Check for 32-bit support in case of 64bit compiler and
cross-compilation. This is required as v8 context
generator needs same bit width as target one.

Change-Id: I921e9e657c9caa97d3c6b63f7c1c87ab1052c92f
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit b698955b933e20ef3cf83ed6c7bb8bbd7cce3aca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 config.tests/hostcompiler/hostcompiler.pro         |  9 ---------
 src/host/CMakeLists.txt                            | 14 ++++++++++++++
 src/host/config.tests/hostcompiler/CMakeLists.txt  | 11 +++++++++++
 .../host/config.tests}/hostcompiler/main.cpp       |  0
 4 files changed, 25 insertions(+), 9 deletions(-)
 delete mode 100644 config.tests/hostcompiler/hostcompiler.pro
 create mode 100644 src/host/config.tests/hostcompiler/CMakeLists.txt
 rename {config.tests => src/host/config.tests}/hostcompiler/main.cpp (100%)

diff --git a/config.tests/hostcompiler/hostcompiler.pro b/config.tests/hostcompiler/hostcompiler.pro
deleted file mode 100644
index 5a80246ab01..00000000000
--- a/config.tests/hostcompiler/hostcompiler.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-option(host_build)
-
-gcc:equals(QT_ARCH, "x86_64"):contains(QT_TARGET_ARCH, "arm"):!contains(QT_TARGET_ARCH, "arm64") {
-    QMAKE_CXXFLAGS += -m32
-    QMAKE_LFLAGS += -m32
-}
-
-SOURCES = main.cpp
-
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 0b423882138..6d327a330e8 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -52,3 +52,17 @@ if(QT_FEATURE_qtpdf_build)
     )
 endif()
 
+# TODO: this could be run as part of main configure with execute_process
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU AND TEST_architecture_arch STREQUAL "x86_64"
+AND GN_TARGET_CPU STREQUAL "arm")
+    try_compile(
+        has32HostCompiler
+        "${CMAKE_CURRENT_BINARY_DIR}/config.tests/hostcompiler"
+        "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/hostcompiler"
+        hostcompiler
+    )
+    if(NOT has32HostCompiler)
+        MESSAGE(FATAL_ERROR "Compiler does not support 32bit compilation")
+    endif()
+endif()
diff --git a/src/host/config.tests/hostcompiler/CMakeLists.txt b/src/host/config.tests/hostcompiler/CMakeLists.txt
new file mode 100644
index 00000000000..f36886d0a55
--- /dev/null
+++ b/src/host/config.tests/hostcompiler/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(arch LANGUAGES CXX)
+
+add_executable(host_compiler_test)
+set_property(TARGET host_compiler_test PROPERTY MACOSX_BUNDLE FALSE)
+target_sources(host_compiler_test PRIVATE main.cpp)
+target_compile_options(host_compiler_test PRIVATE -m32)
+target_link_options(host_compiler_test PRIVATE -m32)
diff --git a/config.tests/hostcompiler/main.cpp b/src/host/config.tests/hostcompiler/main.cpp
similarity index 100%
rename from config.tests/hostcompiler/main.cpp
rename to src/host/config.tests/hostcompiler/main.cpp

From 66d7a5b2bfbe1f92622e1186568ee36e85a3726e Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 22 Aug 2023 09:31:57 +0200
Subject: [PATCH 395/681] QtPdf: Fix memory leaks

In QPdfBookmarkModelPrivate::appendChildNode it was not necessary to
call FPDF_LoadPage() just to be able to call FPDF_GetPageHeight():
the BookmarkModel has the QPdfDocument which can do that for it,
using FPDF_GetPageSizeByIndex() instead.

7b8832ca2b84d549c9d374550c3c46b3d4d42a38 added
QQuickPdfDocument::carrierFile() returning a pointer that
QQuickPdfDocument continues to own. QQuickPdfDocument::setSource()
took care of deleting the existing one if we open a different
document, but the destructor did not delete it.

Task-number: QTBUG-114953
Change-Id: Ie8d9cea456cb91d9541deb575dac17db0d367ead
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8289e5935c0990a4a97afeb1234296ea00ad8054)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfbookmarkmodel.cpp      | 12 +-----------
 src/pdfquick/qquickpdfdocument.cpp |  5 ++++-
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index c9035f21ace..78d89cc9bd4 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -176,17 +176,7 @@ struct QPdfBookmarkModelPrivate
 
             const FPDF_DEST dest = FPDFBookmark_GetDest(document, bookmark);
             const int pageNumber = FPDFDest_GetDestPageIndex(document, dest);
-            double pageHeight = 11.69 * 72; // A4 height
-            {
-                // get actual page height
-                const QPdfMutexLocker lock;
-                FPDF_PAGE pdfPage = FPDF_LoadPage(document, pageNumber);
-                if (pdfPage)
-                    pageHeight = FPDF_GetPageHeight(pdfPage);
-                else
-                    qCWarning(qLcBM) << "failed to load page" << pageNumber;
-            }
-
+            const qreal pageHeight = m_document->pagePointSize(pageNumber).height();
             FPDF_BOOL hasX, hasY, hasZoom;
             FS_FLOAT x, y, zoom;
             bool ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom);
diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index 492c320d6ac..a9f0d196e13 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -36,7 +36,10 @@ QQuickPdfDocument::QQuickPdfDocument(QObject *parent)
 /*!
     \internal
 */
-QQuickPdfDocument::~QQuickPdfDocument() = default;
+QQuickPdfDocument::~QQuickPdfDocument()
+{
+    delete m_carrierFile;
+};
 
 void QQuickPdfDocument::classBegin()
 {

From 50944017746206a1280c15d46d732c58a2a4c94b Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 25 Aug 2023 12:32:03 +0100
Subject: [PATCH 396/681] Switch response headers to QMultiMap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

To allow duplicate key values and preserve order within multi key
duplicates

Change-Id: I8da0a3441255c9b72256d63f4ede10491c96c2dc
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit a6263a5e8d95dad6e3523f87d416a573e0420881)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineloadinginfo.cpp                   | 9 +++++----
 src/core/api/qwebengineloadinginfo.h                     | 8 ++++----
 src/core/web_contents_delegate_qt.cpp                    | 1 -
 src/core/web_contents_delegate_qt.h                      | 2 +-
 .../qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp  | 2 +-
 tests/auto/quick/publicapi/tst_publicapi.cpp             | 4 ++--
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/core/api/qwebengineloadinginfo.cpp b/src/core/api/qwebengineloadinginfo.cpp
index ed9618f494d..a72117e9d31 100644
--- a/src/core/api/qwebengineloadinginfo.cpp
+++ b/src/core/api/qwebengineloadinginfo.cpp
@@ -23,7 +23,7 @@ class QWebEngineLoadingInfo::QWebEngineLoadingInfoPrivate : public QSharedData {
 public:
     QWebEngineLoadingInfoPrivate(const QUrl& url, LoadStatus status, bool isErrorPage,
                                  const QString& errorString, int errorCode, ErrorDomain errorDomain,
-                                 const QHash<QByteArray,QByteArray>& responseHeaders)
+                                 const QMultiMap<QByteArray,QByteArray>& responseHeaders)
         : url(url)
         , status(status)
         , isErrorPage(isErrorPage)
@@ -40,7 +40,7 @@ class QWebEngineLoadingInfo::QWebEngineLoadingInfoPrivate : public QSharedData {
     QString errorString;
     int errorCode;
     ErrorDomain errorDomain;
-    QHash<QByteArray,QByteArray> responseHeaders;
+    QMultiMap<QByteArray,QByteArray> responseHeaders;
 };
 
 /*!
@@ -56,7 +56,7 @@ class QWebEngineLoadingInfo::QWebEngineLoadingInfoPrivate : public QSharedData {
 */
 QWebEngineLoadingInfo::QWebEngineLoadingInfo(const QUrl& url, LoadStatus status, bool isErrorPage,
                                              const QString& errorString, int errorCode, ErrorDomain errorDomain,
-                                             const QHash<QByteArray,QByteArray>& responseHeaders)
+                                             const QMultiMap<QByteArray,QByteArray>& responseHeaders)
     : d_ptr(new QWebEngineLoadingInfoPrivate(url, status, isErrorPage, errorString, errorCode, errorDomain,
                                              responseHeaders))
 {
@@ -164,11 +164,12 @@ int QWebEngineLoadingInfo::errorCode() const
 
 /*!
     \property QWebEngineLoadingInfo::responseHeaders
+    \since 6.6
     \brief Holds the response headers when \c QWebEngineLoadingInfo::status()
            is equal to \c QWebEngineLoadingInfo::LoadSucceededStatus or
            \c QWebEngineLoadingInfo::LoadFailedStatus.
 */
-QHash<QByteArray,QByteArray> QWebEngineLoadingInfo::responseHeaders() const
+QMultiMap<QByteArray,QByteArray> QWebEngineLoadingInfo::responseHeaders() const
 {
     Q_D(const QWebEngineLoadingInfo);
     return d->responseHeaders;
diff --git a/src/core/api/qwebengineloadinginfo.h b/src/core/api/qwebengineloadinginfo.h
index 86d9dba4635..5dce8879cc0 100644
--- a/src/core/api/qwebengineloadinginfo.h
+++ b/src/core/api/qwebengineloadinginfo.h
@@ -6,7 +6,7 @@
 
 #include <QtWebEngineCore/qtwebenginecoreglobal.h>
 
-#include <QtCore/qhash.h>
+#include <QtCore/qmap.h>
 #include <QtCore/qobject.h>
 #include <QtCore/qshareddata.h>
 #include <QtCore/qurl.h>
@@ -27,7 +27,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineLoadingInfo
     Q_PROPERTY(QString errorString READ errorString CONSTANT FINAL)
     Q_PROPERTY(ErrorDomain errorDomain READ errorDomain CONSTANT FINAL)
     Q_PROPERTY(int errorCode READ errorCode CONSTANT FINAL)
-    Q_PROPERTY(QHash<QByteArray,QByteArray> responseHeaders READ responseHeaders CONSTANT FINAL)
+    Q_PROPERTY(QMultiMap<QByteArray,QByteArray> responseHeaders READ responseHeaders CONSTANT FINAL)
 
 public:
     enum LoadStatus {
@@ -62,13 +62,13 @@ class Q_WEBENGINECORE_EXPORT QWebEngineLoadingInfo
     QString errorString() const;
     ErrorDomain errorDomain() const;
     int errorCode() const;
-    QHash<QByteArray,QByteArray> responseHeaders() const;
+    QMultiMap<QByteArray,QByteArray> responseHeaders() const;
 
 private:
     QWebEngineLoadingInfo(const QUrl &url, LoadStatus status, bool isErrorPage = false,
                           const QString &errorString = QString(), int errorCode = 0,
                           ErrorDomain errorDomain = NoErrorDomain,
-                          const QHash<QByteArray, QByteArray> &responseHeaders = {});
+                          const QMultiMap<QByteArray,QByteArray> &responseHeaders = {});
     class QWebEngineLoadingInfoPrivate;
     Q_DECLARE_PRIVATE(QWebEngineLoadingInfo)
     QExplicitlySharedDataPointer<QWebEngineLoadingInfoPrivate> d_ptr;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index ab41483a901..64ccd529d14 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -413,7 +413,6 @@ void WebContentsDelegateQt::DidFinishNavigation(content::NavigationHandle *navig
     }
 
     const net::HttpResponseHeaders * const responseHeaders = navigation_handle->GetResponseHeaders();
-    QHash<QByteArray, QByteArray> responseHeadersMap;
     if (responseHeaders != nullptr) {
         m_loadingInfo.responseHeaders.clear();
         std::size_t iter = 0;
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 68649eaa819..d49380471a0 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -201,7 +201,7 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
         int errorCode = 0, errorDomain = 0;
         QString errorDescription;
         bool triggersErrorPage = false;
-        QHash<QByteArray, QByteArray> responseHeaders;
+        QMultiMap<QByteArray, QByteArray> responseHeaders;
         void clear() { *this = LoadingInfo(); }
     } m_loadingInfo;
 
diff --git a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
index 65cc639862a..ccae7436bdd 100644
--- a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
+++ b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
@@ -11,7 +11,7 @@
 #include <httpserver.h>
 #include <httpreqrep.h>
 
-typedef QHash<QByteArray, QByteArray> Map;
+typedef QMultiMap<QByteArray, QByteArray> Map;
 
 class tst_QWebEngineLoadingInfo : public QObject
 {
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 1cffd55c738..d0e0fddba38 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -87,7 +87,7 @@ static const QStringList hardcodedTypes = QStringList()
     << "Qt::LayoutDirection"
     << "QQuickWebEngineScriptCollection*"
     << "QQmlComponent*"
-    << "QHash<QByteArray,QByteArray>";
+    << "QMultiMap<QByteArray,QByteArray>";
 
 static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineAction.text --> QString"
@@ -296,7 +296,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineJavaScriptDialogRequest.title --> QString"
     << "QQuickWebEngineJavaScriptDialogRequest.type --> QQuickWebEngineJavaScriptDialogRequest::DialogType"
     << "QWebEngineLoadingInfo.errorCode --> int"
-    << "QWebEngineLoadingInfo.responseHeaders --> QHash<QByteArray,QByteArray>"
+    << "QWebEngineLoadingInfo.responseHeaders --> QMultiMap<QByteArray,QByteArray>"
     << "QWebEngineLoadingInfo.errorDomain --> QWebEngineLoadingInfo::ErrorDomain"
     << "QWebEngineLoadingInfo.errorString --> QString"
     << "QWebEngineLoadingInfo.status --> QWebEngineLoadingInfo::LoadStatus"

From d4c2d8b9bea70d6dbce8539af31a89a745a39d29 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 30 Aug 2023 09:13:41 +0000
Subject: [PATCH 397/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I1490b936536e7e20ada2d32a97bdfdc5ed142c6b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 34b175e19d7..a43044008c3 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d179cadd1f8d5e479efdac71dc54933f7b25d384
+    ref: d3e3458a74005f1a3a819ba905da666bbec2ed82
     required: true
   ../qtpositioning:
-    ref: c384feda26f3af019a2e463353e183b55d15eb56
+    ref: 2b6ba945f7c040417b7d5623389b210b7285b2bd
     required: false
   ../qttools:
-    ref: 9942084f870861d11b9cadbc4a83735d918a14f8
+    ref: 1f6c197694a95f413c297b16e08a39db25cca912
     required: false
   ../qtwebchannel:
-    ref: e29aece634abe1c3414800a37044ca7c396212db
+    ref: eff57e9bba39afa2d7f64d50af20871c914a9f11
     required: false

From 720b3a27b582dfa7aab8e8d7b1999292cd458396 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Tue, 29 Aug 2023 11:01:05 +0200
Subject: [PATCH 398/681] QPdfView: remove unneeded includes from a public
 header

Include qpdfdocument.h in the private header instead.

Found during Qt 6.6 API review

Change-Id: Ia8bed2a789fb1cb5fc8a8bd6d67f3c4efbf0cf54
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 01745f99dddccdd3310ab1679f3a12d2d176a42a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfwidgets/qpdfview.h   | 2 --
 src/pdfwidgets/qpdfview_p.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/pdfwidgets/qpdfview.h b/src/pdfwidgets/qpdfview.h
index 548ee81cb69..7f1d014deba 100644
--- a/src/pdfwidgets/qpdfview.h
+++ b/src/pdfwidgets/qpdfview.h
@@ -5,8 +5,6 @@
 #ifndef QPDFVIEW_H
 #define QPDFVIEW_H
 
-#include <QtPdf/qpdfdocument.h>
-#include <QtPdf/qpdflink.h>
 #include <QtPdfWidgets/qtpdfwidgetsglobal.h>
 #include <QtWidgets/qabstractscrollarea.h>
 
diff --git a/src/pdfwidgets/qpdfview_p.h b/src/pdfwidgets/qpdfview_p.h
index 91f6583a353..ce9a8dba411 100644
--- a/src/pdfwidgets/qpdfview_p.h
+++ b/src/pdfwidgets/qpdfview_p.h
@@ -16,6 +16,7 @@
 //
 
 #include "qpdfview.h"
+#include "qpdfdocument.h"
 #include "qpdflinkmodel.h"
 
 #include <QHash>

From 3cdd12f66b523188913315dfbcfebc3d470415db Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Mon, 28 Aug 2023 12:34:24 +0200
Subject: [PATCH 399/681] QPdfSearchModel: remove onDocumentPageCountChanged()

This function was introduced in
d1347ebbe99b467799680bb6e3cee81932751df5 as a bugfix for QTBUG-111067.
The patch was also picked to 6.5, which is not really correct, because
we normally guarantee forward BC in patch releases.

Generally, there is no reason to expose this method to the API - we
could just use a lambda internally. Do it now.

Treat the exposed function as internal, and remove it completely
both from the API and the ABI.

Change-Id: I48b93767c341aca58135872f391fc731561b68d4
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 46531f2cae2d08b9c7e192ac5f657d0a7ad9996c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfsearchmodel.cpp | 10 +---------
 src/pdf/qpdfsearchmodel.h   |  1 -
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 3109430f0d6..90be76b8ea9 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -196,21 +196,13 @@ void QPdfSearchModel::setDocument(QPdfDocument *document)
 
     disconnect(d->documentConnection);
     d->documentConnection = connect(document, &QPdfDocument::pageCountChanged, this,
-                                    &QPdfSearchModel::onDocumentPageCountChanged);
+                                    [this]() { d_func()->clearResults(); });
 
     d->document = document;
     d->clearResults();
     emit documentChanged();
 }
 
-void QPdfSearchModel::onDocumentPageCountChanged(int count)
-{
-    Q_UNUSED(count);
-
-    Q_D(QPdfSearchModel);
-    d->clearResults();
-}
-
 void QPdfSearchModel::timerEvent(QTimerEvent *event)
 {
     Q_D(QPdfSearchModel);
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
index b1094b67b5b..c1e4e64ece6 100644
--- a/src/pdf/qpdfsearchmodel.h
+++ b/src/pdf/qpdfsearchmodel.h
@@ -55,7 +55,6 @@ public Q_SLOTS:
 protected:
     void updatePage(int page);
     void timerEvent(QTimerEvent *event) override;
-    void onDocumentPageCountChanged(int count);
 
 private:
     QHash<int, QByteArray> m_roleNames;

From 29b1fc140b02a5c528772da1af05569de57abf45 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Mon, 28 Aug 2023 12:34:24 +0200
Subject: [PATCH 400/681] QPdfSearchModel: remove onDocumentPageCountChanged()

This function was introduced in
d1347ebbe99b467799680bb6e3cee81932751df5 as a bugfix for QTBUG-111067.
The patch was also picked to 6.5, which is not really correct, because
we normally guarantee forward BC in patch releases.

Generally, there is no reason to expose this method to the API - we
could just use a lambda internally. Do it now.

Treat the exposed function as internal, and remove it completely
both from the API and the ABI.

Change-Id: I48b93767c341aca58135872f391fc731561b68d4
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 46531f2cae2d08b9c7e192ac5f657d0a7ad9996c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfsearchmodel.cpp | 10 +---------
 src/pdf/qpdfsearchmodel.h   |  1 -
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 3109430f0d6..90be76b8ea9 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -196,21 +196,13 @@ void QPdfSearchModel::setDocument(QPdfDocument *document)
 
     disconnect(d->documentConnection);
     d->documentConnection = connect(document, &QPdfDocument::pageCountChanged, this,
-                                    &QPdfSearchModel::onDocumentPageCountChanged);
+                                    [this]() { d_func()->clearResults(); });
 
     d->document = document;
     d->clearResults();
     emit documentChanged();
 }
 
-void QPdfSearchModel::onDocumentPageCountChanged(int count)
-{
-    Q_UNUSED(count);
-
-    Q_D(QPdfSearchModel);
-    d->clearResults();
-}
-
 void QPdfSearchModel::timerEvent(QTimerEvent *event)
 {
     Q_D(QPdfSearchModel);
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
index b1094b67b5b..c1e4e64ece6 100644
--- a/src/pdf/qpdfsearchmodel.h
+++ b/src/pdf/qpdfsearchmodel.h
@@ -55,7 +55,6 @@ public Q_SLOTS:
 protected:
     void updatePage(int page);
     void timerEvent(QTimerEvent *event) override;
-    void onDocumentPageCountChanged(int count);
 
 private:
     QHash<int, QByteArray> m_roleNames;

From c9732b1854407bef202b21511c68ff5e47af1041 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 30 Aug 2023 19:53:05 +0000
Subject: [PATCH 401/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I2863ee116cd300f49516ddabac2103ea447b8258
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 1fdd8414308..82ddf2366f1 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3fb3c737e714da77adb921581694cf553cda0743
+    ref: ab19b7d0d5e473d3757f7c2df8ffaf5cf8b863d6
     required: true
   ../qtpositioning:
-    ref: ed0bfc2e1f329131b0c9d395f8047ef4c2f7df05
+    ref: 7bd5d5c0e4954a3571c0bb568b33c5546a6b92c4
     required: false
   ../qttools:
-    ref: 54ea32429e0515cb152943d4637766bd9d61f948
+    ref: ff9f369b8d653745ba3f800914b487882db720b6
     required: false
   ../qtwebchannel:
-    ref: 6ab4b912008dffcf9c5fc64e8969c22a97764708
+    ref: c261e51578bdc0a74c3b726fd7b822d46aa360c4
     required: false

From 2b031670c8a62d10d4b5cf6ec71094ce9b91897b Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 22 Aug 2023 09:31:57 +0200
Subject: [PATCH 402/681] QtPdf: Fix memory leaks

In QPdfBookmarkModelPrivate::appendChildNode it was not necessary to
call FPDF_LoadPage() just to be able to call FPDF_GetPageHeight():
the BookmarkModel has the QPdfDocument which can do that for it,
using FPDF_GetPageSizeByIndex() instead.

7b8832ca2b84d549c9d374550c3c46b3d4d42a38 added
QQuickPdfDocument::carrierFile() returning a pointer that
QQuickPdfDocument continues to own. QQuickPdfDocument::setSource()
took care of deleting the existing one if we open a different
document, but the destructor did not delete it.

Task-number: QTBUG-114953
Change-Id: Ie8d9cea456cb91d9541deb575dac17db0d367ead
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8289e5935c0990a4a97afeb1234296ea00ad8054)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfbookmarkmodel.cpp      | 12 +-----------
 src/pdfquick/qquickpdfdocument.cpp |  5 ++++-
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index c9035f21ace..78d89cc9bd4 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -176,17 +176,7 @@ struct QPdfBookmarkModelPrivate
 
             const FPDF_DEST dest = FPDFBookmark_GetDest(document, bookmark);
             const int pageNumber = FPDFDest_GetDestPageIndex(document, dest);
-            double pageHeight = 11.69 * 72; // A4 height
-            {
-                // get actual page height
-                const QPdfMutexLocker lock;
-                FPDF_PAGE pdfPage = FPDF_LoadPage(document, pageNumber);
-                if (pdfPage)
-                    pageHeight = FPDF_GetPageHeight(pdfPage);
-                else
-                    qCWarning(qLcBM) << "failed to load page" << pageNumber;
-            }
-
+            const qreal pageHeight = m_document->pagePointSize(pageNumber).height();
             FPDF_BOOL hasX, hasY, hasZoom;
             FS_FLOAT x, y, zoom;
             bool ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom);
diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index 492c320d6ac..a9f0d196e13 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -36,7 +36,10 @@ QQuickPdfDocument::QQuickPdfDocument(QObject *parent)
 /*!
     \internal
 */
-QQuickPdfDocument::~QQuickPdfDocument() = default;
+QQuickPdfDocument::~QQuickPdfDocument()
+{
+    delete m_carrierFile;
+};
 
 void QQuickPdfDocument::classBegin()
 {

From de8f7e25aa4c27ff08ecea3e988b00ee5bbd8530 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 1 Sep 2023 08:38:31 +0000
Subject: [PATCH 403/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ifaabc4edc7b5def83141ed8c35a605fd6d3b4dda
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index a43044008c3..8176395678f 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d3e3458a74005f1a3a819ba905da666bbec2ed82
+    ref: 124839dcf91cab4772c355a0469fd35ab7645602
     required: true
   ../qtpositioning:
-    ref: 2b6ba945f7c040417b7d5623389b210b7285b2bd
+    ref: bf7183fdddef4feb9a7f03a2af2965b5683be66b
     required: false
   ../qttools:
-    ref: 1f6c197694a95f413c297b16e08a39db25cca912
+    ref: 3fc2893e5d6be07d5e9f999ca05ee015b373b079
     required: false
   ../qtwebchannel:
-    ref: eff57e9bba39afa2d7f64d50af20871c914a9f11
+    ref: 3aa2feaa117e4575cdcaf8c61f3fbd062328e76c
     required: false

From b0ea8794716a7d7b8dd10955fb3b9365e8d01018 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 1 Sep 2023 15:57:54 +0000
Subject: [PATCH 404/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I221a64f749acece9ad9727c8f6d82febe9fd6378
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 82ddf2366f1..e862662280e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: ab19b7d0d5e473d3757f7c2df8ffaf5cf8b863d6
+    ref: a774a9709a73facf0612db635899f0c558d98179
     required: true
   ../qtpositioning:
-    ref: 7bd5d5c0e4954a3571c0bb568b33c5546a6b92c4
+    ref: 4be8295c50875d526b13e4e751aa191a4ae8695b
     required: false
   ../qttools:
-    ref: ff9f369b8d653745ba3f800914b487882db720b6
+    ref: da2a518be570c5694026a3ba1e0a01ac18393cc7
     required: false
   ../qtwebchannel:
-    ref: c261e51578bdc0a74c3b726fd7b822d46aa360c4
+    ref: c4a9ccdd7f7f7c40ff47dafcb9c87f0ccbde0d1d
     required: false

From 2c665f1b65cec5b331ef9692b5838c1a46ceda91 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 25 Aug 2023 13:05:35 +0100
Subject: [PATCH 405/681] Switch additional response header to QMultiMap

For consistency with other response headers, even if it is going
to be inconsistent with existing request headers.

Change-Id: I9e9c36ac20982d9c833486171fa9944c9059f471
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 src/core/api/qwebengineurlrequestjob.cpp                      | 2 +-
 src/core/api/qwebengineurlrequestjob.h                        | 2 +-
 src/core/net/url_request_custom_job_delegate.cpp              | 2 +-
 src/core/net/url_request_custom_job_delegate.h                | 4 ++--
 src/core/net/url_request_custom_job_proxy.cpp                 | 4 ++--
 src/core/net/url_request_custom_job_proxy.h                   | 4 ++--
 .../qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp   | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp
index 099efef8e3d..6e978ef2879 100644
--- a/src/core/api/qwebengineurlrequestjob.cpp
+++ b/src/core/api/qwebengineurlrequestjob.cpp
@@ -118,7 +118,7 @@ QMap<QByteArray, QByteArray> QWebEngineUrlRequestJob::requestHeaders() const
     is called.
 */
 void QWebEngineUrlRequestJob::setAdditionalResponseHeaders(
-        const QMap<QByteArray, QByteArray> &additionalResponseHeaders) const
+        const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders) const
 {
     d_ptr->setAdditionalResponseHeaders(additionalResponseHeaders);
 }
diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h
index 75e065566f5..aa1bf893a5b 100644
--- a/src/core/api/qwebengineurlrequestjob.h
+++ b/src/core/api/qwebengineurlrequestjob.h
@@ -44,7 +44,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestJob : public QObject
     void fail(Error error);
     void redirect(const QUrl &url);
     void setAdditionalResponseHeaders(
-            const QMap<QByteArray, QByteArray> &additionalResponseHeaders) const;
+            const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders) const;
 
 private:
     QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate *);
diff --git a/src/core/net/url_request_custom_job_delegate.cpp b/src/core/net/url_request_custom_job_delegate.cpp
index 07a1de1ec5e..6319fb160e0 100644
--- a/src/core/net/url_request_custom_job_delegate.cpp
+++ b/src/core/net/url_request_custom_job_delegate.cpp
@@ -52,7 +52,7 @@ QMap<QByteArray, QByteArray> URLRequestCustomJobDelegate::requestHeaders() const
 }
 
 void URLRequestCustomJobDelegate::setAdditionalResponseHeaders(
-        const QMap<QByteArray, QByteArray> &additionalResponseHeaders)
+        const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders)
 {
     m_additionalResponseHeaders = additionalResponseHeaders;
 }
diff --git a/src/core/net/url_request_custom_job_delegate.h b/src/core/net/url_request_custom_job_delegate.h
index 6b6ee68cf25..6b860bea89e 100644
--- a/src/core/net/url_request_custom_job_delegate.h
+++ b/src/core/net/url_request_custom_job_delegate.h
@@ -49,7 +49,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT URLRequestCustomJobDelegate : public QObjec
     QMap<QByteArray, QByteArray> requestHeaders() const;
 
     void
-    setAdditionalResponseHeaders(const QMap<QByteArray, QByteArray> &additionalResponseHeaders);
+    setAdditionalResponseHeaders(const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders);
     void reply(const QByteArray &contentType, QIODevice *device);
     void redirect(const QUrl &url);
     void abort();
@@ -71,7 +71,7 @@ private Q_SLOTS:
     QByteArray m_method;
     QUrl m_initiatorOrigin;
     const QMap<QByteArray, QByteArray> m_requestHeaders;
-    QMap<QByteArray, QByteArray> m_additionalResponseHeaders;
+    QMultiMap<QByteArray, QByteArray> m_additionalResponseHeaders;
 };
 
 } // namespace
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index d548055b580..31c024a529a 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -41,7 +41,7 @@ void URLRequestCustomJobProxy::release()
 }
 
 void URLRequestCustomJobProxy::reply(std::string contentType, QIODevice *device,
-                                     QMap<QByteArray, QByteArray> additionalResponseHeaders)
+                                     QMultiMap<QByteArray, QByteArray> additionalResponseHeaders)
 {
     if (!m_client)
         return;
@@ -59,7 +59,7 @@ void URLRequestCustomJobProxy::reply(std::string contentType, QIODevice *device,
     }
     m_client->m_mimeType = qcontentType.trimmed().toStdString();
     m_client->m_device = device;
-    m_client->m_additionalResponseHeaders = additionalResponseHeaders;
+    m_client->m_additionalResponseHeaders = std::move(additionalResponseHeaders);
     if (m_client->m_device && !m_client->m_device->isReadable())
         m_client->m_device->open(QIODevice::ReadOnly);
 
diff --git a/src/core/net/url_request_custom_job_proxy.h b/src/core/net/url_request_custom_job_proxy.h
index 1f8c77da239..b02214f23f2 100644
--- a/src/core/net/url_request_custom_job_proxy.h
+++ b/src/core/net/url_request_custom_job_proxy.h
@@ -31,7 +31,7 @@ class URLRequestCustomJobProxy : public base::RefCountedThreadSafe<URLRequestCus
     public:
         std::string m_mimeType;
         std::string m_charset;
-        QMap<QByteArray, QByteArray> m_additionalResponseHeaders;
+        QMultiMap<QByteArray, QByteArray> m_additionalResponseHeaders;
         GURL m_redirect;
         QIODevice *m_device;
         int64_t m_firstBytePosition;
@@ -53,7 +53,7 @@ class URLRequestCustomJobProxy : public base::RefCountedThreadSafe<URLRequestCus
     // Called from URLRequestCustomJobDelegate via post:
     //void setReplyCharset(const std::string &);
     void reply(std::string mimeType, QIODevice *device,
-               QMap<QByteArray, QByteArray> additionalResponseHeaders);
+               QMultiMap<QByteArray, QByteArray> additionalResponseHeaders);
     void redirect(GURL url);
     void abort();
     void fail(int error);
diff --git a/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp b/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp
index 034bda2910e..6839eab06dd 100644
--- a/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp
+++ b/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp
@@ -22,7 +22,7 @@ class AdditionalResponseHeadersHandler : public QWebEngineUrlSchemeHandler
     {
         QCOMPARE(job->requestUrl(), QUrl(schemeName + ":about"));
 
-        QMap<QByteArray, QByteArray> additionalResponseHeaders;
+        QMultiMap<QByteArray, QByteArray> additionalResponseHeaders;
         if (m_addAdditionalResponseHeaders) {
             additionalResponseHeaders.insert(QByteArray::fromStdString("test1"),
                                              QByteArray::fromStdString("test1VALUE"));

From 6698b870a71cf9a86e974fed1545abea2d13bc59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 30 Aug 2023 10:11:48 +0200
Subject: [PATCH 406/681] Update Chromium

Submodule src/3rdparty b02cdcee..b295bd04:
  * FIXUP: Temporary fix for missing macOS 12.3 SDK
  * Temporary fix for missing macOS 12.3 SDK
  * Fix build with clang
  * Disable Windows IME for GPU thread

Task-number: QTBUG-73994
Fixes: QTBUG-116278
Change-Id: I9894f341a82b0c5887d38e9d2597ecc2bde11392
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 3e900b7a91a07fe356ffa9d5de8189cda93220a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 14d1a5775d6..7933480d13d 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           115.0.5790.170
+Patched with security patches up to Chromium version:           116.0.5845.110
diff --git a/src/3rdparty b/src/3rdparty
index b02cdceebb1..b295bd0409f 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit b02cdceebb1e7248f7e98f5ffb3eec10930ab947
+Subproject commit b295bd0409f7d8144879d9a047cda4919585b0fe
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index f6115b3ad7a..8ff1125109f 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -931,7 +931,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "115.0.5790.170"; // FIXME: Remember to update
+    return "116.0.5845.110"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 2fc29d6af2e6306acd7dc503a786e41f1e36d5e9 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 4 Sep 2023 20:29:58 +0000
Subject: [PATCH 407/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I63c9ad1bf9ce84841b4ad76a9669d56c0c38b7c1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8176395678f..8a3ef16ff3a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 124839dcf91cab4772c355a0469fd35ab7645602
+    ref: 3b85db07dc5c63bdd326a77670f92af885fdef73
     required: true
   ../qtpositioning:
-    ref: bf7183fdddef4feb9a7f03a2af2965b5683be66b
+    ref: 10b2446276989fd1a47284c43954f729b892ccc4
     required: false
   ../qttools:
-    ref: 3fc2893e5d6be07d5e9f999ca05ee015b373b079
+    ref: d4cc65ce52e1d0f189ba5403a6453c850e164402
     required: false
   ../qtwebchannel:
-    ref: 3aa2feaa117e4575cdcaf8c61f3fbd062328e76c
+    ref: 8fb91958ed586e317696b6ca611941416922f0cc
     required: false

From cff208025af7b1d450a4943c98e21608206bc582 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 4 Sep 2023 21:34:47 +0000
Subject: [PATCH 408/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I74492567cbe3a2d920c392ecdd93fc2b87105bc5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index e862662280e..96c6f139651 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a774a9709a73facf0612db635899f0c558d98179
+    ref: 49ba62311c3edab46d95e1e0dc03fcd5247531de
     required: true
   ../qtpositioning:
-    ref: 4be8295c50875d526b13e4e751aa191a4ae8695b
+    ref: 146e15e14539018077ae3463ab6426cd4095d5af
     required: false
   ../qttools:
-    ref: da2a518be570c5694026a3ba1e0a01ac18393cc7
+    ref: 5b1342ff2c391c3bb24bf349e9ebca0ca82862b4
     required: false
   ../qtwebchannel:
-    ref: c4a9ccdd7f7f7c40ff47dafcb9c87f0ccbde0d1d
+    ref: 71ac55f81cbe3872c059e060e193dbc35e76cbb0
     required: false

From 0358de120062759ee466fc4c6c34d571f35546cf Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 4 Sep 2023 09:39:13 +0200
Subject: [PATCH 409/681] Fix revisions of QML API

See QML API review

Change-Id: I8eaba74655cb73bac912a48964d86e647c7a854f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 1ea6ee7b4bb4eeec144cd5ffe3be5cd398d8ee8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineloadinginfo.h           | 2 +-
 src/webenginequick/api/qquickwebengineview_p.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/api/qwebengineloadinginfo.h b/src/core/api/qwebengineloadinginfo.h
index 5dce8879cc0..48d14601ab6 100644
--- a/src/core/api/qwebengineloadinginfo.h
+++ b/src/core/api/qwebengineloadinginfo.h
@@ -27,7 +27,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineLoadingInfo
     Q_PROPERTY(QString errorString READ errorString CONSTANT FINAL)
     Q_PROPERTY(ErrorDomain errorDomain READ errorDomain CONSTANT FINAL)
     Q_PROPERTY(int errorCode READ errorCode CONSTANT FINAL)
-    Q_PROPERTY(QMultiMap<QByteArray,QByteArray> responseHeaders READ responseHeaders CONSTANT FINAL)
+    Q_PROPERTY(QMultiMap<QByteArray,QByteArray> responseHeaders READ responseHeaders CONSTANT REVISION(6,6) FINAL)
 
 public:
     enum LoadStatus {
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index a040571461a..1deb57a4ce7 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -81,7 +81,7 @@ class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
 
     Q_PROPERTY(QQuickWebEngineView *inspectedView READ inspectedView WRITE setInspectedView NOTIFY inspectedViewChanged REVISION(1,7) FINAL)
     Q_PROPERTY(QQuickWebEngineView *devToolsView READ devToolsView WRITE setDevToolsView NOTIFY devToolsViewChanged REVISION(1,7) FINAL)
-    Q_PROPERTY(QString devToolsId READ devToolsId CONSTANT REVISION(0) FINAL)
+    Q_PROPERTY(QString devToolsId READ devToolsId CONSTANT REVISION(6,6) FINAL)
 
     Q_PROPERTY(LifecycleState lifecycleState READ lifecycleState WRITE setLifecycleState NOTIFY lifecycleStateChanged REVISION(1,10) FINAL)
     Q_PROPERTY(LifecycleState recommendedState READ recommendedState NOTIFY recommendedStateChanged REVISION(1,10) FINAL)

From 0a8f6c9dde77c17cd3cef053b850b94c9c0a5e80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Mon, 28 Aug 2023 13:25:38 +0200
Subject: [PATCH 410/681] Doc: Mark QPdfDocument::pageIndexForLabel() as new in
 6.6

Amends b8419577eb99c158

Change-Id: Ie60b418be63699cf1ff2baec5d867ccd85536f2b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4efc44c7ef44995cc64dc7c8c25513a2ab210417)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfdocument.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index e2309be9c22..6de2fbc6c11 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -828,6 +828,7 @@ QString QPdfDocument::pageLabel(int page)
     Returns the index of the page that has the \a label, or \c -1 if not found.
 
     \sa pageLabel()
+    \since 6.6
 */
 int QPdfDocument::pageIndexForLabel(const QString &label)
 {

From f4336cea9a7d2bf06221c952d90c5b3e4a98c7ed Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 6 Sep 2023 22:18:58 +0000
Subject: [PATCH 411/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I99947f9acce91f22045de7e7212e80eed6c26358
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 96c6f139651..208faba2e55 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 49ba62311c3edab46d95e1e0dc03fcd5247531de
+    ref: 797374448ae1cb83965229ccc385b3fa8cdad0f2
     required: true
   ../qtpositioning:
-    ref: 146e15e14539018077ae3463ab6426cd4095d5af
+    ref: b2536066407aad7aa166461906c823bb629a64e9
     required: false
   ../qttools:
-    ref: 5b1342ff2c391c3bb24bf349e9ebca0ca82862b4
+    ref: 32e55d45bdb8becc9f3991d7aec736474b145205
     required: false
   ../qtwebchannel:
-    ref: 71ac55f81cbe3872c059e060e193dbc35e76cbb0
+    ref: 75ee029342d323df0b22d16eac31a56e786549c5
     required: false

From 1d0ae93af571392312fd72d35f7745aefa740bb6 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 4 Sep 2023 09:40:41 +0200
Subject: [PATCH 412/681] Update qwebengineglobalsettings api

Do comments from api review:
* use static setDnsMode
* use struct for mode and server templates
* remove QObject
* do not use QScopedPointer
* use the namespace instead of the class

Change-Id: I766626330e4cc190a170fcd6b5e32b1f60ad675c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 09e224c57c085457dbc5c2896aacb868a19c2ce6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineglobalsettings.cpp     | 117 ++++++++++--------
 src/core/api/qwebengineglobalsettings.h       |  35 ++----
 src/core/api/qwebengineglobalsettings_p.h     |   5 +-
 .../net/system_network_context_manager.cpp    |   2 +-
 .../tst_qwebengineglobalsettings.cpp          |  26 ++--
 5 files changed, 95 insertions(+), 90 deletions(-)

diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
index 0f2472c47b8..5eeff9fc57d 100644
--- a/src/core/api/qwebengineglobalsettings.cpp
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -15,82 +15,90 @@
 
 QT_BEGIN_NAMESPACE
 
-ASSERT_ENUMS_MATCH(net::SecureDnsMode::kSecure, QWebEngineGlobalSettings::DnsMode::SecureOnly)
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kSecure, QWebEngineGlobalSettings::SecureDnsMode::SecureOnly)
 ASSERT_ENUMS_MATCH(net::SecureDnsMode::kAutomatic,
-                   QWebEngineGlobalSettings::DnsMode::SecureWithFallback)
-ASSERT_ENUMS_MATCH(net::SecureDnsMode::kOff, QWebEngineGlobalSettings::DnsMode::SystemOnly)
+                   QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback)
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kOff, QWebEngineGlobalSettings::SecureDnsMode::SystemOnly)
 
 /*!
-    \class QWebEngineGlobalSettings
-    \brief The QWebEngineGlobalSettings class configures global properties of the web engine.
+    \namespace QWebEngineGlobalSettings
+    \brief The QWebEngineGlobalSettings namespace holds global settings of the web engine.
     \since 6.6
     \inmodule QtWebEngineCore
 
-    The QWebEngineGlobalSettings class is a singleton that configures global properties
-    of the web engine.
+    The QWebEngineGlobalSettings namespace holds global properties of the web engine.
 
-    Invoke setDnsMode() and setDnsServerTemplates() to configure DNS-over-HTTPS.
+    Invoke setDnsMode() to configure DNS-over-HTTPS.
 
-    \sa QWebEngineGlobalSettings::setDnsMode(), QWebEngineGlobalSettings::setDnsServerTemplates()
+    \sa QWebEngineGlobalSettings::setDnsMode()
 */
 
-QWebEngineGlobalSettings::QWebEngineGlobalSettings(QObject *p)
-    : QObject(p), d_ptr(new QWebEngineGlobalSettingsPrivate)
-{
-}
+/*!
+    \enum QWebEngineGlobalSettings::SecureDnsMode
 
-QWebEngineGlobalSettings::~QWebEngineGlobalSettings() { }
+    This enum sets the DNS-over-HTTPS mode used by the DnsMode structure:
+
+    \value SystemOnly This is the default. Use the system DNS host resolution.
+    \value SecureWithFallback Enable DNS-over-HTTPS (DoH). DoH servers have to be
+    provided through \l {QWebEngineGlobalSettings::DnsMode::serverTemplates}{serverTemplates} in
+    the DnsMode structure. If a host cannot be resolved via the provided servers,
+    the system DNS host resolution is used.
+    \value SecureOnly Enable DNS-over-HTTPS and only allow hosts to be resolved
+    this way. DoH servers have to be provided through
+    \l {QWebEngineGlobalSettings::DnsMode::serverTemplates}{serverTemplates} in the DnsMode
+    structure. If the DNS-over-HTTPS resolution fails, there is no fallback and the DNS host
+    resolution fails completely.
+*/
 
 /*!
-    \fn QWebEngineGlobalSettings *QWebEngineGlobalSettings::GetInstance()
+    \class QWebEngineGlobalSettings::DnsMode
+    \brief The DnsMode struct provides means to specify the DNS host resolution mode.
+    \since 6.6
+    \inmodule QtWebEngineCore
 
-    Gets the global instance of QWebEngineGlobalSettings.
+    The QWebEngineGlobalSettings::DnsMode structure describes the DNS mode and
+    the associated DNS server template used for the DNS host resolution.
 */
-QWebEngineGlobalSettings *QWebEngineGlobalSettings::instance()
-{
-    static QWebEngineGlobalSettings settings;
-    return &settings;
-}
 
 /*!
-    \enum QWebEngineGlobalSettings::DnsMode
+    \variable QWebEngineGlobalSettings::DnsMode::secureMode
+    \brief The DNS mode used for the host resolution.
 
-    This enum sets the DNS-over-HTTPS mode:
+    Set \a secureMode to SecureDnsMode::SecureOnly to only allow DNS-over-HTTPS host resolution
+    using servers from \a serverTemplates.
 
-    \value SystemOnly This is the default. Use the system DNS host resolution.
-    \value SecureWithFallback Enable DNS-over-HTTPS (DoH). DoH servers have to be
-    provided through QWebEngineGlobalSettings::setDnsServerTemplates(). If a host can't be resolved
-    via the provided servers, the system DNS host resolution is used.
-    \value SecureOnly Enable DNS-over-HTTPS and only allow hosts to be resolved this way.
-    DoH servers have to be provided through QWebEngineGlobalSettings::setDnsServerTemplates().
-    If the DNS-over-HTTPS resolution fails, there is no fallback and DNS host resolution
-    fails completely.
+    Set \a secureMode to SecureDnsMode::SecureWithFallback to enable DNS-over-HTTPS host resolution
+    using servers from \a serverTemplates, with a fallback to the system DNS.
+
+    \sa QWebEngineGlobalSettings::SecureDnsMode
 */
 
 /*!
-    \fn void QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode, const QStringList
-    &dnsServerTemplates)
+    \variable QWebEngineGlobalSettings::DnsMode::serverTemplates
+    \brief A list of server URI templates used for secure DNS-over-HTTPS host resolution.
 
-    Set \a dnsMode to DnsMode::SystemOnly to use the system DNS resolution.
-
-    Set \a dnsMode to DnsMode::SecureOnly to only allow DNS-over-HTTPS host resolution using servers
-    from \a dnsServerTemplates.
+    The \c serverTemplates structure member lists
+    \l{https://datatracker.ietf.org/d7oc/html/rfc6570}{URI templates}.
+    An example of a URI template is https://dns.google/dns-query{?dns}.
+*/
 
-    Set \a dnsMode to DnsMode::SecureWithFallback to enable DNS-over-HTTPS host resolution using
-    servers from \a dnsServerTemplates,with a fallback to the system DNS.
+/*!
+    \fn void QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode)
 
-    A list \a dnsServerTemplates is a list of \l{https://datatracker.ietf.org/d7oc/html/rfc6570}{URI
-    templates}. One example URI template is https://dns.google/dns-query{?dns}.
+    Sets \a dnsMode for DNS-over-HTTPS host resolution.
 
-    This function returns \c false if the \a dnsServerTemplates list is empty or contains URI
-    templates that cannot be parsed for DnsMode::SecureOnly or DnsMode::SecureWithFallback.
-    Otherwise, it returns \c true meaning the DNS mode change is triggered.
+    This function returns \c false if the \l {QWebEngineGlobalSettings::DnsMode::serverTemplates}
+    {serverTemplates} list in the \l {QWebEngineGlobalSettings::DnsMode}{DnsMode} structure is empty
+    or contains URI templates that cannot be parsed for SecureDnsMode::SecureOnly or
+    SecureDnsMode::SecureWithFallback. Otherwise, it returns \c true meaning that the DNS mode
+    change is triggered.
 */
-bool QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode, const QStringList &dnsServerTemplates)
+
+bool QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode)
 {
-    Q_D(QWebEngineGlobalSettings);
-    if (dnsMode != DnsMode::SystemOnly) {
-        const QString servers = dnsServerTemplates.join(QChar::Space);
+    QWebEngineGlobalSettingsPrivate *d = QWebEngineGlobalSettingsPrivate::instance();
+    if (dnsMode.secureMode != SecureDnsMode::SystemOnly) {
+        const QString servers = dnsMode.serverTemplates.join(QChar::Space);
         const std::string templates = servers.toStdString();
         absl::optional<net::DnsOverHttpsConfig> dnsOverHttpsConfig =
                 net::DnsOverHttpsConfig::FromString(templates);
@@ -98,7 +106,7 @@ bool QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode, const QStringList &dn
             return false;
         d->dnsOverHttpsTemplates = templates;
     }
-    d->dnsMode = dnsMode;
+    d->dnsMode = dnsMode.secureMode;
     d->configureStubHostResolver();
     return true;
 }
@@ -106,6 +114,12 @@ bool QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode, const QStringList &dn
 /*!
     \internal
 */
+QWebEngineGlobalSettingsPrivate *QWebEngineGlobalSettingsPrivate::instance()
+{
+    static QWebEngineGlobalSettingsPrivate settings;
+    return &settings;
+}
+
 void QWebEngineGlobalSettingsPrivate::configureStubHostResolver()
 {
     if (content::GetNetworkServiceAvailability()
@@ -113,8 +127,9 @@ void QWebEngineGlobalSettingsPrivate::configureStubHostResolver()
         network::mojom::NetworkService *networkService = content::GetNetworkService();
         if (networkService) {
             qDebug() << "doh set to" << dnsOverHttpsTemplates << " -- "
-                     << (dnsMode == QWebEngineGlobalSettings::DnsMode::SecureOnly ? "SecureOnly"
-                                 : dnsMode == QWebEngineGlobalSettings::DnsMode::SystemOnly
+                     << (dnsMode == QWebEngineGlobalSettings::SecureDnsMode::SecureOnly
+                                 ? "SecureOnly"
+                                 : dnsMode == QWebEngineGlobalSettings::SecureDnsMode::SystemOnly
                                  ? "SystemOnly"
                                  : "SecureWithFallback");
             absl::optional<net::DnsOverHttpsConfig> dohConfig = dnsOverHttpsTemplates.empty()
diff --git a/src/core/api/qwebengineglobalsettings.h b/src/core/api/qwebengineglobalsettings.h
index deef5941f44..a9eff6d1255 100644
--- a/src/core/api/qwebengineglobalsettings.h
+++ b/src/core/api/qwebengineglobalsettings.h
@@ -4,37 +4,26 @@
 #ifndef QWEBENGINEGLOBALSETTINGS_H
 #define QWEBENGINEGLOBALSETTINGS_H
 
+#if 0
+#pragma qt_class(QWebEngineGlobalSettings)
+#endif
+
 #include <QtWebEngineCore/qtwebenginecoreglobal.h>
 #include <QtCore/QObject>
 #include <QtCore/QScopedPointer>
 
-namespace QtWebEngineCore {
-class SystemNetworkContextManager;
-}
-
 QT_BEGIN_NAMESPACE
 
-class QWebEngineGlobalSettingsPrivate;
-
-class Q_WEBENGINECORE_EXPORT QWebEngineGlobalSettings : public QObject
+namespace QWebEngineGlobalSettings {
+// Mapping net::SecureDnsMode
+enum class SecureDnsMode : quint8 { SystemOnly = 0, SecureWithFallback = 1, SecureOnly = 2 };
+struct DnsMode
 {
-    Q_OBJECT
-public:
-    static QWebEngineGlobalSettings *instance();
-
-    // Mapping net::SecureDnsMode
-    enum class DnsMode : quint8 { SystemOnly = 0, SecureWithFallback = 1, SecureOnly = 2 };
-    bool setDnsMode(DnsMode dnsMode, const QStringList &dnsServerTemplates);
-
-private:
-    QWebEngineGlobalSettings(QObject *p = nullptr);
-    ~QWebEngineGlobalSettings() override;
-
-    friend class QtWebEngineCore::SystemNetworkContextManager;
-    Q_DECLARE_PRIVATE(QWebEngineGlobalSettings)
-    // can't re-use base d_ptr: need to maintain compat with last Qt LTS
-    QScopedPointer<QWebEngineGlobalSettingsPrivate> d_ptr;
+    SecureDnsMode secureMode = SecureDnsMode::SystemOnly;
+    QStringList serverTemplates;
 };
+Q_WEBENGINECORE_EXPORT bool setDnsMode(DnsMode dnsMode);
+}
 
 QT_END_NAMESPACE
 
diff --git a/src/core/api/qwebengineglobalsettings_p.h b/src/core/api/qwebengineglobalsettings_p.h
index 412697c0f40..10ae502f014 100644
--- a/src/core/api/qwebengineglobalsettings_p.h
+++ b/src/core/api/qwebengineglobalsettings_p.h
@@ -25,12 +25,13 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineGlobalSettingsPrivate
 {
 public:
     QWebEngineGlobalSettingsPrivate()
-        : dnsMode(QWebEngineGlobalSettings::DnsMode::SystemOnly)
+        : dnsMode(QWebEngineGlobalSettings::SecureDnsMode::SystemOnly)
         , dnsOverHttpsTemplates("")
         , insecureDnsClientEnabled(false)
         , additionalInsecureDnsTypesEnabled(false){};
 
-    QWebEngineGlobalSettings::DnsMode dnsMode;
+    static QWebEngineGlobalSettingsPrivate *instance();
+    QWebEngineGlobalSettings::SecureDnsMode dnsMode;
     std::string dnsOverHttpsTemplates;
     const bool insecureDnsClientEnabled;
     const bool additionalInsecureDnsTypesEnabled;
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index ed676fcbc8d..65b5d9c970b 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -265,7 +265,7 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
     // resolver of the network service here, each time it is instantiated, with our global
     // DNS-Over-HTTPS settings. This ensures that the global settings don't get lost
     // on reinstantiation and are in effect upon initial instantiation.
-    QWebEngineGlobalSettings::instance()->d_ptr->configureStubHostResolver();
+    QWebEngineGlobalSettingsPrivate::instance()->configureStubHostResolver();
 }
 
 void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams(network::mojom::NetworkContextParams *network_context_params)
diff --git a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
index e3986674f04..0af85a7114e 100644
--- a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
+++ b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
@@ -34,23 +34,23 @@ Q_LOGGING_CATEGORY(lc, "qt.webengine.tests")
 
 void tst_QWebEngineGlobalSettings::dnsOverHttps_data()
 {
-    QTest::addColumn<QWebEngineGlobalSettings::DnsMode>("dnsMode");
+    QTest::addColumn<QWebEngineGlobalSettings::SecureDnsMode>("dnsMode");
     QTest::addColumn<QString>("uriTemplate");
     QTest::addColumn<bool>("isMockDnsServerCalledExpected");
     QTest::addColumn<bool>("isDnsResolutionSuccessExpected");
     QTest::addColumn<bool>("isConfigurationSuccessExpected");
     QTest::newRow("DnsMode::SystemOnly (no DoH server)")
-            << QWebEngineGlobalSettings::DnsMode::SystemOnly << QStringLiteral("") << false << true
-            << true;
+            << QWebEngineGlobalSettings::SecureDnsMode::SystemOnly << QStringLiteral("") << false
+            << true << true;
     QTest::newRow("DnsMode::SecureOnly (mock DoH server)")
-            << QWebEngineGlobalSettings::DnsMode::SecureOnly
+            << QWebEngineGlobalSettings::SecureDnsMode::SecureOnly
             << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << false << true;
     QTest::newRow("DnsMode::SecureOnly (real DoH server)")
-            << QWebEngineGlobalSettings::DnsMode::SecureOnly
+            << QWebEngineGlobalSettings::SecureDnsMode::SecureOnly
             << QStringLiteral("https://dns.google/dns-query{?dns}") << false << true << true;
     QTest::newRow("DnsMode::SecureOnly (Empty URI Templates)")
-            << QWebEngineGlobalSettings::DnsMode::SecureOnly << QStringLiteral("") << false << false
-            << false;
+            << QWebEngineGlobalSettings::SecureDnsMode::SecureOnly << QStringLiteral("") << false
+            << false << false;
     // Note: In the following test, we can't verify that the DoH server is called first and
     // afterwards insecure DNS is tried, because for the DoH server to ever be used when the DNS
     // mode is set to DnsMode::WithFallback, Chromium starts an asynchronous DoH server DnsProbe and
@@ -59,16 +59,16 @@ void tst_QWebEngineGlobalSettings::dnsOverHttps_data()
     // non-self-signed certificates are used for correct encryption. Instead of implementing
     // all of that, this test verifies that Chromium tries probing the configured DoH server only.
     QTest::newRow("DnsMode::SecureWithFallback (mock DoH server)")
-            << QWebEngineGlobalSettings::DnsMode::SecureWithFallback
+            << QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback
             << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << true << true;
     QTest::newRow("DnsMode::SecureWithFallback (Empty URI Templates)")
-            << QWebEngineGlobalSettings::DnsMode::SecureWithFallback << QStringLiteral("") << false
-            << false << false;
+            << QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback << QStringLiteral("")
+            << false << false << false;
 }
 
 void tst_QWebEngineGlobalSettings::dnsOverHttps()
 {
-    QFETCH(QWebEngineGlobalSettings::DnsMode, dnsMode);
+    QFETCH(QWebEngineGlobalSettings::SecureDnsMode, dnsMode);
     QFETCH(QString, uriTemplate);
     QFETCH(bool, isMockDnsServerCalledExpected);
     QFETCH(bool, isDnsResolutionSuccessExpected);
@@ -76,8 +76,8 @@ void tst_QWebEngineGlobalSettings::dnsOverHttps()
     bool isMockDnsServerCalled = false;
     bool isLoadSuccessful = false;
 
-    QWebEngineGlobalSettings *globalSettings = QWebEngineGlobalSettings::instance();
-    bool configurationSuccess = globalSettings->setDnsMode(dnsMode, QStringList() << uriTemplate);
+    bool configurationSuccess =
+            QWebEngineGlobalSettings::setDnsMode({ dnsMode, QStringList{ uriTemplate } });
     QCOMPARE(configurationSuccess, isConfigurationSuccessExpected);
 
     if (!configurationSuccess) {

From 57ace03579ee052a0d4b47aac0efd74e7f1f83d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 8 Sep 2023 15:13:41 +0200
Subject: [PATCH 413/681] Update Chromium

Submodule src/3rdparty 53607d83..6d2bb0d2:
  * [Backport] CVE-2023-4354: Heap buffer overflow in Skia
  * [Backport] CVE-2023-4355: Out of bounds memory access in V8
  * [Backport] Dependency for CVE-2023-4355
  * Bump V8_PATCH_LEVEL
  * [Backport] CVE-2023-4762: Type Confusion in V8
  * [Backport] CVE-2023-4763: Use after free in Networks
  * Disable Windows IME for GPU thread
  * [Backport] CVE-2023-4431: Out of bounds memory access in Fonts
  * [Backport] CVE-2023-4428: Out of bounds memory access in CSS
  * [Backport] CVE-2023-4427: Out of bounds memory access in V8
  * [Backport] Dependency for CVE-2023-4427
  * [Backport] Security bug 1455619
  * [Backport] CVE-2023-4365: Inappropriate implementation in Fullscreen.
  * [Backport] CVE-2023-4362: Heap buffer overflow in Mojom IDL
  * [Backport] CVE-2023-4357: Insufficient validation of untrusted input in XML.
  * [Backport] CVE-2023-4356: Use after free in Audio
  * [Backport] CVE-2023-4353: Heap buffer overflow in ANGLE
  * [Backport] CVE-2023-4352: Type Confusion in V8
  * [Backport] CVE-2023-4351: Use after free in Network
  * Fix build with clang

Task-number: QTBUG-116523
Fixes: QTBUG-115697
Change-Id: Ia6d8c5ac22de5c326b64874becf74607a7eb1115
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 586f452ee42..e3f273f2c29 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           113.0.5672.126
+Patched with security patches up to Chromium version:           116.0.5845.179
diff --git a/src/3rdparty b/src/3rdparty
index 53607d83afe..6d2bb0d22f5 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 53607d83afec30700cc460aa5b347ff79f7d77ef
+Subproject commit 6d2bb0d22f53dccf7d6d7686c90dd2da4a7f1fca
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index fab0501bed8..718a28ee8fe 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -937,7 +937,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "113.0.5672.126"; // FIXME: Remember to update
+    return "116.0.5845.179"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 4cde829ea111236e11319528034a901d42a729be Mon Sep 17 00:00:00 2001
From: Samuli Piippo <samuli.piippo@qt.io>
Date: Thu, 7 Sep 2023 16:29:13 +0300
Subject: [PATCH 414/681] Revert "Check for pkg-config dri module on Linux"

This reverts commit f14eddb25ec9604f4e706db1577b8ce07d247c73.
The DRI check was removed from chromium already, remove it
here as well.

Fixes: QTBUG-116839
Change-Id: I5195a4e4a278e3727b80dc5a9ba614b88f4dec3f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f8d9d32e20a63869bae4729efc6d3a26e9dff5dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index e69d88d4065..8f30b34466b 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -56,7 +56,6 @@ if(PkgConfig_FOUND)
     pkg_check_modules(VPX vpx>=1.10.0 IMPORTED_TARGET)
     pkg_check_modules(LIBPCI libpci)
     pkg_check_modules(LIBOPENJP2 libopenjp2)
-    pkg_check_modules(DRI dri)
 endif()
 
 if(Python3_EXECUTABLE)
@@ -537,12 +536,7 @@ add_check_for_support(
 add_check_for_support(
    MODULES QtWebEngine QtPdf
    CONDITION NOT LINUX OR PkgConfig_FOUND
-   MESSAGE "pkg-config support is required."
-)
-add_check_for_support(
-   MODULES QtWebEngine QtPdf
-   CONDITION NOT LINUX OR DRI_FOUND
-   MESSAGE "pkg-config(dri) is required."
+   MESSAGE "A pkg-config support is required."
 )
 add_check_for_support(
    MODULES QtWebEngine QtPdf

From a7b34c221d266e9b84077de90127d0e3ba252f5c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 11 Sep 2023 15:16:04 +0000
Subject: [PATCH 415/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I71ce53c62026f472dbd4df07bcf5e23c23f042a3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8a3ef16ff3a..3f37a84192a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3b85db07dc5c63bdd326a77670f92af885fdef73
+    ref: 6ad23dc4026b87b973ac2f2db208857105e14fea
     required: true
   ../qtpositioning:
-    ref: 10b2446276989fd1a47284c43954f729b892ccc4
+    ref: f29ffe49981d5071b9c16bd3894619432d2a30fd
     required: false
   ../qttools:
-    ref: d4cc65ce52e1d0f189ba5403a6453c850e164402
+    ref: 18f9224e7adc3565c0e451f149f6c03ecacc7035
     required: false
   ../qtwebchannel:
-    ref: 8fb91958ed586e317696b6ca611941416922f0cc
+    ref: ec6bad4664d0a82a84b48faa6e3b9776a79fe0af
     required: false

From 5dfbeb3ba072becab82445144f5fbdbad35b8537 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 12 Sep 2023 12:00:19 +0200
Subject: [PATCH 416/681] Update Chromium

Submodule src/3rdparty 6d2bb0d2..31f287a0:
  * [Backport] CVE-2023-4863: Heap buffer overflow in WebP

Fixes: QTBUG-116523
Change-Id: I0deb32f56639c1f9852fbbfcdb7ee653c5566c6a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index e3f273f2c29..5d8248fa5f2 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           116.0.5845.179
+Patched with security patches up to Chromium version:           116.0.5845.187
diff --git a/src/3rdparty b/src/3rdparty
index 6d2bb0d22f5..31f287a0142 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 6d2bb0d22f53dccf7d6d7686c90dd2da4a7f1fca
+Subproject commit 31f287a0142b6b78698504b528d35c9506dcdb43
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 718a28ee8fe..7bff7edca05 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -937,7 +937,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "116.0.5845.179"; // FIXME: Remember to update
+    return "116.0.5845.187"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 4ed36a52d0c67f5615ca97fa2107bce21613f59c Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:17:22 +0200
Subject: [PATCH 417/681] Port away from QScopedPointer::take() - non-trivial
 case
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The API was deprecated in Qt 6.0, so use std::unique_ptr instead.
The QWebEngineUrlRequestInfo's destructor is private, so create
a custom deleter struct which properly deletes the object.
This works, because InterceptedRequest is a friend of
QWebEngineUrlRequestInfo.

Pick-to: 6.5
Change-Id: I69e1b31360ec5ae4b32b6e7f0416b39aecb2f5f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 6bd52dc09c0b4d32833c6ffef690838b2cbc73e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/net/proxying_url_loader_factory_qt.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 79e036566b1..6743ff888df 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -126,8 +126,6 @@ class InterceptedRequest : public network::mojom::URLLoader
     void PauseReadingBodyFromNet() override;
     void ResumeReadingBodyFromNet() override;
 
-    static inline void cleanup(QWebEngineUrlRequestInfo *info) { delete info; }
-
 private:
     void InterceptOnUIThread();
     void ContinueAfterIntercept();
@@ -169,7 +167,13 @@ class InterceptedRequest : public network::mojom::URLLoader
 
     const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
 
-    QScopedPointer<QWebEngineUrlRequestInfo, InterceptedRequest> request_info_;
+    struct RequestInfoDeleter
+    {
+        void operator()(QWebEngineUrlRequestInfo *ptr) const
+        { delete ptr; }
+    };
+
+    std::unique_ptr<QWebEngineUrlRequestInfo, RequestInfoDeleter> request_info_;
 
     mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
     mojo::Remote<network::mojom::URLLoaderClient> target_client_;
@@ -354,7 +358,7 @@ void InterceptedRequest::ContinueAfterIntercept()
 
     if (request_info_) {
         // cleanup in scope because of delete this and it's not needed else where after
-        decltype(request_info_) scoped_request_info(request_info_.take());
+        const auto scoped_request_info = std::move(request_info_);
         QWebEngineUrlRequestInfoPrivate &info = *scoped_request_info->d_ptr;
 
         if (info.changed) {

From fd47a523d52f615379e940116a9fd09af81d3cd4 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Tue, 23 May 2023 13:31:47 +0000
Subject: [PATCH 418/681] Doc: Fix documentation for
 qWebEngineGetDomainAndRegistry()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Mention the argument 'url' by name and fix minor language issues.

Change-Id: I85e48c49fa258a2b4172fee6ec732726ad7009ef
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 80b18a8fdf6bbd0607f6ff876c389ea63b8fdcef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-global.qdoc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/doc/src/qtwebengine-global.qdoc b/src/core/doc/src/qtwebengine-global.qdoc
index d4bbef01ae6..8fb1f2d5e75 100644
--- a/src/core/doc/src/qtwebengine-global.qdoc
+++ b/src/core/doc/src/qtwebengine-global.qdoc
@@ -46,8 +46,8 @@
     \relates <qtwebenginecoreglobal.h>
     \since 6.6
 
-    Returns the domain of the host i.e. the effective top-level domain (eTLD)
-    plus the first domain below.
+    Returns the domain of the host, that is, the effective top-level domain
+    (eTLD) and the first domain below it, from \a url.
 
-    If the host is not a domain an empty string is returned.
+    If the host is not a domain, returns an empty string.
 */

From cb21b0950101a3e5f20075360003de3fd0b37e62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kimmo=20Leppa=CC=88la=CC=88?= <kimmo.leppala@qt.io>
Date: Mon, 26 Jun 2023 17:51:46 +0300
Subject: [PATCH 419/681] Remove recipebrowser and simplebrowser from
 Application Examples
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There's already nanobrowser in Application Examples so this removes the
other webengine examples from that category.

Change-Id: I1f6dc7be7cb0ad4b0ac8134eb438ac0a0db7a5d3
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 8b2d2cd8387808dc589eda9bfbc119cc84ca4633)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc    | 1 -
 .../webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc    | 1 -
 2 files changed, 2 deletions(-)

diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
index b862a906da1..0400fcecccd 100644
--- a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -4,7 +4,6 @@
 /*!
     \example webenginewidgets/recipebrowser
     \title Recipe Browser
-    \examplecategory {Application Examples}
     \meta tag {widgets, webengine, webchannel, webenginescript}
     \ingroup webengine-widgetexamples
     \brief Injecting custom stylsheets into web pages and providing a rich text preview
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index 87d326220cb..2c5fce10b52 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -3,7 +3,6 @@
 
 /*!
     \example webenginewidgets/simplebrowser
-    \examplecategory {Application Examples}
     \title WebEngine Widgets Simple Browser Example
     \ingroup webengine-widgetexamples
     \brief A simple browser based on \QWE Widgets.

From 015b5fb169d867ef6b453cd45b2c8a8be30c9fde Mon Sep 17 00:00:00 2001
From: Andreas Eliasson <andreas.eliasson@qt.io>
Date: Wed, 28 Jun 2023 12:21:11 +0200
Subject: [PATCH 420/681] Doc: Use \qml instead of \code for QML code snippet

Change-Id: I2025d77a15eca0b26096344c3f97f91138893378
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ae82cd21c55eacb940f90c084302db8fd21e198d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfquick/doc/src/qtquickpdf-module.qdoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pdfquick/doc/src/qtquickpdf-module.qdoc b/src/pdfquick/doc/src/qtquickpdf-module.qdoc
index 1d31f6148cb..a4ca0d9e8b0 100644
--- a/src/pdfquick/doc/src/qtquickpdf-module.qdoc
+++ b/src/pdfquick/doc/src/qtquickpdf-module.qdoc
@@ -12,7 +12,7 @@
 
     To use the types in this module, import the module with the following line:
 
-    \code
+    \qml
     import QtQuick.Pdf
-    \endcode
+    \endqml
 */

From 9a959bd6225b13eff75da8e759ccbffa574c1efd Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 28 Jun 2023 16:13:27 +0200
Subject: [PATCH 421/681] Fix invalid html in tst_touchinput

With the invalid 'width' attribute the input element
defaults to a size that depends on the system (charmap) settings.
It may result in failing tests that depend on the size of the element
e.g. tests that use 'elementCenter'.

Task-number: QTBUG-105342
Change-Id: I508d365fc4240d67d3e2240e8e33495c1de6ee4c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 17bafdc301a057ed4b28dc3acc9bd636183683d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 tests/auto/widgets/touchinput/tst_touchinput.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/widgets/touchinput/tst_touchinput.cpp b/tests/auto/widgets/touchinput/tst_touchinput.cpp
index 562ccfcef0e..de3712370a0 100644
--- a/tests/auto/widgets/touchinput/tst_touchinput.cpp
+++ b/tests/auto/widgets/touchinput/tst_touchinput.cpp
@@ -130,7 +130,7 @@ void TouchInputTest::initTestCase()
     view.setHtml("<html><head><style>.rect { min-width: 240px; min-height: 120px; }</style></head><body>"
                  "<p id='text' style='width: 150px;'>The Qt Company</p>"
                  "<div id='notext' style='width: 150px; height: 100px; background-color: #f00;'></div>"
-                 "<form><input id='input' width='150px' type='text' value='The Qt Company2' /></form>"
+                 "<form><input id='input' style='width: 150px;' type='text' value='The Qt Company2' /></form>"
                  "<button id='btn' type='button' onclick='alert(\"button clicked!\")'>Click Me!</button>"
                  "<select id='select' onchange='alert(\"option changed to: \" + this.value)'>"
                  "<option value='O1'>O1</option><option value='O2'>O2</option><option value='O3'>O3</option></select>"

From ad12349a41ada22ad7b24dc275b3e0dbe79a71f6 Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Mon, 21 Aug 2023 13:15:16 +0200
Subject: [PATCH 422/681] QtPdf: migrate to autogenerated cpp exports

This is a prerequisite for using QT_PDF_REMOVED_SINCE.

Change-Id: I46adece3ba1ff1a4c95218a1bc731dea05afc1f3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 34f93ea4294e2254c95478521fa9886dfed43910)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/CMakeLists.txt   |  2 ++
 src/pdf/qpdfdocument_p.h |  1 +
 src/pdf/qtpdfglobal.h    | 19 +------------------
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index f51e461acf6..8070eb39a51 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -38,6 +38,8 @@ qt_internal_add_module(Pdf
     PUBLIC_LIBRARIES
         Qt::Core
         Qt::Gui
+    GENERATE_CPP_EXPORTS
+    GENERATE_PRIVATE_CPP_EXPORTS
 )
 
 add_subdirectory(plugins/imageformats/pdf)
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
index d52aabe4bb1..4adbf695ed0 100644
--- a/src/pdf/qpdfdocument_p.h
+++ b/src/pdf/qpdfdocument_p.h
@@ -16,6 +16,7 @@
 //
 
 #include "qpdfdocument.h"
+#include "private/qtpdfexports_p.h"
 
 #include "third_party/pdfium/public/fpdfview.h"
 #include "third_party/pdfium/public/fpdf_dataavail.h"
diff --git a/src/pdf/qtpdfglobal.h b/src/pdf/qtpdfglobal.h
index d38eafaab24..2d0900029e6 100644
--- a/src/pdf/qtpdfglobal.h
+++ b/src/pdf/qtpdfglobal.h
@@ -5,24 +5,7 @@
 #define QTPDFGLOBAL_H
 
 #include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef Q_PDF_EXPORT
-#  ifndef QT_STATIC
-#    if defined(QT_BUILD_PDF_LIB)
-#      define Q_PDF_EXPORT Q_DECL_EXPORT
-#    else
-#      define Q_PDF_EXPORT Q_DECL_IMPORT
-#    endif
-#  else
-#    define Q_PDF_EXPORT
-#  endif
-#endif
-
-#define Q_PDF_PRIVATE_EXPORT Q_PDF_EXPORT
-
-QT_END_NAMESPACE
+#include <QtPdf/qtpdfexports.h>
 
 #endif // QTPDFGLOBAL_H
 

From 1e8aa52c7f1dc68b7594d091056c6976b33e433b Mon Sep 17 00:00:00 2001
From: Ivan Solovev <ivan.solovev@qt.io>
Date: Fri, 18 Aug 2023 16:17:22 +0200
Subject: [PATCH 423/681] Port away from QScopedPointer::take() - non-trivial
 case
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The API was deprecated in Qt 6.0, so use std::unique_ptr instead.
The QWebEngineUrlRequestInfo's destructor is private, so create
a custom deleter struct which properly deletes the object.
This works, because InterceptedRequest is a friend of
QWebEngineUrlRequestInfo.

Change-Id: I69e1b31360ec5ae4b32b6e7f0416b39aecb2f5f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 6bd52dc09c0b4d32833c6ffef690838b2cbc73e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4ed36a52d0c67f5615ca97fa2107bce21613f59c)
---
 src/core/net/proxying_url_loader_factory_qt.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 70ec61b34e4..2c61015e624 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -126,8 +126,6 @@ class InterceptedRequest : public network::mojom::URLLoader
     void PauseReadingBodyFromNet() override;
     void ResumeReadingBodyFromNet() override;
 
-    static inline void cleanup(QWebEngineUrlRequestInfo *info) { delete info; }
-
 private:
     void InterceptOnUIThread();
     void ContinueAfterIntercept();
@@ -169,7 +167,13 @@ class InterceptedRequest : public network::mojom::URLLoader
 
     const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
 
-    QScopedPointer<QWebEngineUrlRequestInfo, InterceptedRequest> request_info_;
+    struct RequestInfoDeleter
+    {
+        void operator()(QWebEngineUrlRequestInfo *ptr) const
+        { delete ptr; }
+    };
+
+    std::unique_ptr<QWebEngineUrlRequestInfo, RequestInfoDeleter> request_info_;
 
     mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
     mojo::Remote<network::mojom::URLLoaderClient> target_client_;
@@ -349,7 +353,7 @@ void InterceptedRequest::ContinueAfterIntercept()
 
     if (request_info_) {
         // cleanup in scope because of delete this and it's not needed else where after
-        decltype(request_info_) scoped_request_info(request_info_.take());
+        const auto scoped_request_info = std::move(request_info_);
         QWebEngineUrlRequestInfoPrivate &info = *scoped_request_info->d_ptr;
 
         if (info.changed) {

From 6a30d3aa5660a661d4262ca6214b778a507d6a9c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 12 Sep 2023 22:49:31 +0000
Subject: [PATCH 424/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I16fe05107491cd8bd2b26fba7c9ad060ec149557
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 208faba2e55..61e6f4b36b7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 797374448ae1cb83965229ccc385b3fa8cdad0f2
+    ref: b6676a4823e058572c9a6b199951ba8f7d4b6365
     required: true
   ../qtpositioning:
-    ref: b2536066407aad7aa166461906c823bb629a64e9
+    ref: be67afc8ca5901c7b2ee597b63727265e1a974cf
     required: false
   ../qttools:
-    ref: 32e55d45bdb8becc9f3991d7aec736474b145205
+    ref: d38892b2151b49aa7ca61e7709581b52d2e3b604
     required: false
   ../qtwebchannel:
-    ref: 75ee029342d323df0b22d16eac31a56e786549c5
+    ref: 280b32b1cbe7c259e29a5751e42ea70fc47ff7ba
     required: false

From e763db0fb23ec8c38b3423668da2a3d94a0157cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 11 Sep 2023 16:02:51 +0200
Subject: [PATCH 425/681] Update Chromium

Submodule src/3rdparty b295bd04..a71ba6ff:
  * [Backport] CVE-2023-4863: Heap buffer overflow in WebP
  * Bump V8_PATCH_LEVEL
  * [Backport] CVE-2023-4762: Type Confusion in V8
  * [Backport] CVE-2023-4763: Use after free in Networks
  * [Backport] blink::HTMLMediaElement::ShouldReusePlayer: avoid dereferencing a potentally NULL domWindow
  * FIXUP: Qt GN integration
  * Avoid using libdrm

Pick-to: 6.6.0
Fixes: QTBUG-115470
Fixes: QTBUG-116501
Change-Id: Ibeff96e0dca65b42ffe512627eab3c2f0f349c8c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit e4d73afd5464bd7f34063e08aab55e8f6b16aa22)
---
 CHROMIUM_VERSION                | 4 ++--
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 7933480d13d..1876305bd1a 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
-Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           116.0.5845.110
+Based on Chromium version:                                      112.0.5615.213
+Patched with security patches up to Chromium version:           116.0.5845.187
diff --git a/src/3rdparty b/src/3rdparty
index b295bd0409f..a71ba6ffc8e 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit b295bd0409f7d8144879d9a047cda4919585b0fe
+Subproject commit a71ba6ffc8e34033b93c0727e8d7eb17f7d6a25f
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 8ff1125109f..6c19428e5cf 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -931,7 +931,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "116.0.5845.110"; // FIXME: Remember to update
+    return "116.0.5845.187"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 07352bf1ca359cb6bd944537bbe80f3063f326cf Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 14 Sep 2023 08:55:57 +0000
Subject: [PATCH 426/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I33210228288fd30853967b07ca7d0402d558f1b0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 61e6f4b36b7..5845693a5ad 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b6676a4823e058572c9a6b199951ba8f7d4b6365
+    ref: 5b6a26a3a2fd02dce710d468165ff86fbc766d79
     required: true
   ../qtpositioning:
-    ref: be67afc8ca5901c7b2ee597b63727265e1a974cf
+    ref: 425795f74e2125711c5eedc28da09e9b7034aa31
     required: false
   ../qttools:
-    ref: d38892b2151b49aa7ca61e7709581b52d2e3b604
+    ref: 0d42e3dce73cfb4e744d8ff2b90ac33720611e99
     required: false
   ../qtwebchannel:
-    ref: 280b32b1cbe7c259e29a5751e42ea70fc47ff7ba
+    ref: 64301f789c07e40292d001a0c786b18fc3d8b172
     required: false

From c1c39f74bbac488b1d690c9005c90eec7d31a5a7 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Mon, 11 Sep 2023 11:05:35 +0000
Subject: [PATCH 427/681] Doc: QWebEnginePage: Use since-clause in enum \value
 commands

The \value command in QDoc now supports adding since information
in a bracketed argument. This enables listing new enum values
also in the top-level 'What's New in Qt' documentation.

Task-number: QTBUG-116843
Change-Id: I1cbaefe89b1b2311e10d10c6260d974412ecccbb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit b05da249eb3346fd6bf50132aaaf5299fbe3a240)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qwebenginepage_lgpl.qdoc | 139 +++++++++++-----------
 1 file changed, 68 insertions(+), 71 deletions(-)

diff --git a/src/core/doc/src/qwebenginepage_lgpl.qdoc b/src/core/doc/src/qwebenginepage_lgpl.qdoc
index fe84ff76bb7..cffc732469d 100644
--- a/src/core/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginepage_lgpl.qdoc
@@ -115,89 +115,86 @@
            should be enabled to get automatic focus.
     \value PasteAndMatchStyle Paste content from the clipboard with current style.
 
-    \value OpenLinkInThisWindow Open the current link in the current window. (Added in Qt 5.6)
-    \value OpenLinkInNewWindow Open the current link in a new window. Requires implementation of
-           \l createWindow() or \l newWindowRequested() (Added in Qt 5.6)
-    \value OpenLinkInNewTab Open the current link in a new tab. Requires implementation of
-           \l createWindow() or \l newWindowRequested(). (Added in Qt 5.6)
-    \value OpenLinkInNewBackgroundTab Open the current link in a new background tab. Requires
-           implementation of \l createWindow() or \l newWindowRequested(). (Added in Qt 5.7)
-    \value CopyLinkToClipboard Copy the current link to the clipboard. (Added in Qt 5.6)
-
-    \value CopyImageToClipboard Copy the clicked image to the clipboard. (Added in Qt 5.6)
-    \value CopyImageUrlToClipboard Copy the clicked image's URL to the clipboard. (Added in Qt 5.6)
-    \value CopyMediaUrlToClipboard Copy the hovered audio or video's URL to the clipboard. (Added in Qt 5.6)
-    \value ToggleMediaControls Toggle between showing and hiding the controls for the hovered audio
-           or video element. (Added in Qt 5.6)
-    \value ToggleMediaLoop Toggle whether the hovered audio or video should loop on completetion or
-           not. (Added in Qt 5.6)
-    \value ToggleMediaPlayPause Toggle the play/pause state of the hovered audio or video element.
-           (Added in Qt 5.6)
-    \value ToggleMediaMute Mute or unmute the hovered audio or video element. (Added in Qt 5.6)
-    \value DownloadLinkToDisk Download the current link to the disk. Requires a slot for
-           \l{QWebEngineProfile::}{downloadRequested()}. (Added in Qt 5.6)
-    \value DownloadImageToDisk Download the highlighted image to the disk. Requires a slot for
-           \l{QWebEngineProfile::}{downloadRequested()}. (Added in Qt 5.6)
-    \value DownloadMediaToDisk Download the hovered audio or video to the disk. Requires a slot for
-           \l{QWebEngineProfile::}{downloadRequested()}. (Added in Qt 5.6)
-
-    \value InspectElement Trigger any attached Web Inspector to inspect the highlighed element.
-           (Added in Qt 5.6)
-    \value ExitFullScreen Exit the fullscreen mode. (Added in Qt 5.6)
-    \value RequestClose Request to close the web page. If defined, the \c{window.onbeforeunload}
+    \value [since 5.6] OpenLinkInThisWindow Open the current link in the current window.
+    \value [since 5.6] OpenLinkInNewWindow Open the current link in a new window. Requires implementation of
+           \l createWindow() or \l newWindowRequested().
+    \value [since 5.6] OpenLinkInNewTab Open the current link in a new tab. Requires implementation of
+           \l createWindow() or \l newWindowRequested().
+    \value [since 5.7] OpenLinkInNewBackgroundTab Open the current link in a new background tab. Requires
+           implementation of \l createWindow() or \l newWindowRequested().
+    \value [since 5.6] CopyLinkToClipboard Copy the current link to the clipboard.
+
+    \value [since 5.6] CopyImageToClipboard Copy the clicked image to the clipboard.
+    \value [since 5.6] CopyImageUrlToClipboard Copy the clicked image's URL to the clipboard.
+    \value [since 5.6] CopyMediaUrlToClipboard Copy the hovered audio or video's URL to the clipboard.
+    \value [since 5.6] ToggleMediaControls Toggle between showing and hiding the controls for the hovered audio
+           or video element.
+    \value [since 5.6] ToggleMediaLoop Toggle whether the hovered audio or video should loop on completetion or
+           not.
+    \value [since 5.6] ToggleMediaPlayPause Toggle the play/pause state of the hovered audio or video element.
+    \value [since 5.6] ToggleMediaMute Mute or unmute the hovered audio or video element.
+    \value [since 5.6] DownloadLinkToDisk Download the current link to the disk. Requires a slot for
+           \l{QWebEngineProfile::}{downloadRequested()}.
+    \value [since 5.6] DownloadImageToDisk Download the highlighted image to the disk. Requires a slot for
+           \l{QWebEngineProfile::}{downloadRequested()}.
+    \value [since 5.6] DownloadMediaToDisk Download the hovered audio or video to the disk. Requires a slot for
+           \l{QWebEngineProfile::}{downloadRequested()}.
+
+    \value [since 5.6] InspectElement Trigger any attached Web Inspector to inspect the highlighed element.
+    \value [since 5.6] ExitFullScreen Exit the fullscreen mode.
+    \value [since 5.6] RequestClose Request to close the web page. If defined, the \c{window.onbeforeunload}
            handler is run, and the user can confirm or reject to close the page. If the close
-           request is confirmed, \c windowCloseRequested is emitted. (Added in Qt 5.6)
-    \value Unselect Clear the current selection. (Added in Qt 5.7)
-    \value SavePage Save the current page to disk. MHTML is the default format that is used to store
+           request is confirmed, \c windowCloseRequested is emitted.
+    \value [since 5.7] Unselect Clear the current selection.
+    \value [since 5.7] SavePage Save the current page to disk. MHTML is the default format that is used to store
            the web page on disk. Requires a slot for \l{QWebEngineProfile::}{downloadRequested()}.
-           (Added in Qt 5.7)
-    \value ViewSource Show the source of the current page in a new tab. Requires implementation of
-            \l createWindow() or \l newWindowRequested(). (Added in Qt 5.8)
+    \value [since 5.8] ViewSource Show the source of the current page in a new tab. Requires implementation of
+            \l createWindow() or \l newWindowRequested().
 
-    \value ToggleBold
+    \value [since 5.10] ToggleBold
            Toggles boldness for the selection or at the cursor position.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value ToggleItalic
+           Requires \c contenteditable="true".
+    \value [since 5.10] ToggleItalic
            Toggles italics for the selection or at the cursor position.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value ToggleUnderline
+           Requires \c contenteditable="true".
+    \value [since 5.10] ToggleUnderline
            Toggles underlining of the selection or at the cursor position.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value ToggleStrikethrough
+           Requires \c contenteditable="true".
+    \value [since 5.10] ToggleStrikethrough
            Toggles striking through the selection or at the cursor position.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
+           Requires \c contenteditable="true".
 
-    \value AlignLeft
+    \value [since 5.10] AlignLeft
            Aligns the lines containing the selection or the cursor to the left.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value AlignCenter
+           Requires \c contenteditable="true".
+    \value [since 5.10] AlignCenter
            Aligns the lines containing the selection or the cursor at the center.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value AlignRight
+           Requires \c contenteditable="true".
+    \value [since 5.10] AlignRight
            Aligns the lines containing the selection or the cursor to the right.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value AlignJustified
+           Requires \c contenteditable="true".
+    \value [since 5.10] AlignJustified
            Stretches the lines containing the selection or the cursor so that each
            line has equal width.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value Indent
+           Requires \c contenteditable="true".
+    \value [since 5.10] Indent
            Indents the lines containing the selection or the cursor.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value Outdent
+           Requires \c contenteditable="true".
+    \value [since 5.10] Outdent
            Outdents the lines containing the selection or the cursor.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
+           Requires \c contenteditable="true".
 
-    \value InsertOrderedList
+    \value [since 5.10] InsertOrderedList
            Inserts an ordered list at the current cursor position, deleting the current selection.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value InsertUnorderedList
+           Requires \c contenteditable="true".
+    \value [since 5.10] InsertUnorderedList
            Inserts an unordered list at the current cursor position,
            deleting the current selection.
-           Requires \c contenteditable="true". (Added in Qt 5.10)
-    \value ChangeTextDirectionLTR
-           Changes text direction to left-to-right in the focused input element. (Added in Qt 6.6)
-    \value ChangeTextDirectionRTL
-           Changes text direction to right-to-left in the focused input element. (Added in Qt 6.6)
+           Requires \c contenteditable="true".
+    \value [since 6.6] ChangeTextDirectionLTR
+           Changes text direction to left-to-right in the focused input element.
+    \value [since 6.6] ChangeTextDirectionRTL
+           Changes text direction to right-to-left in the focused input element.
     \omitvalue WebActionCount
 
 */
@@ -213,8 +210,8 @@
             A web browser tab.
     \value  WebDialog
             A window without decoration.
-    \value  WebBrowserBackgroundTab
-            A web browser tab without hiding the current visible WebEngineView. (Added in Qt 5.7)
+    \value [since 5.7] WebBrowserBackgroundTab
+            A web browser tab without hiding the current visible WebEngineView.
 */
 
 /*!
@@ -268,7 +265,7 @@
     \value NavigationTypeFormSubmitted The navigation request resulted from a form submission.
     \value NavigationTypeBackForward The navigation request resulted from a back or forward action.
     \value NavigationTypeReload The navigation request resulted from a reload action.
-    \value NavigationTypeRedirect The navigation request resulted from a content or server controlled redirect. This also includes automatic reloads. (Added in Qt 5.14)
+    \value [since 5.14] NavigationTypeRedirect The navigation request resulted from a content or server controlled redirect. This also includes automatic reloads.
     \value NavigationTypeOther The navigation request was triggered by other means not covered by the above.
 
     \sa acceptNavigationRequest()
@@ -293,11 +290,11 @@
     \value  MouseLock
             Mouse locking, which locks the mouse pointer to the web view and is typically used in
             games.
-    \value  DesktopVideoCapture
+    \value [since 5.10] DesktopVideoCapture
             Video output capture, that is, the capture of the user's display,
-            for screen sharing purposes for example. (Added in Qt 5.10)
-    \value  DesktopAudioVideoCapture
-            Both audio and video output capture. (Added in Qt 5.10)
+            for screen sharing purposes for example.
+    \value [since 5.10] DesktopAudioVideoCapture
+            Both audio and video output capture.
 
     \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), PermissionPolicy
 

From 2c3f6d70d4decf57da900ba374aa15cd7c4b126b Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Mon, 11 Sep 2023 11:37:43 +0000
Subject: [PATCH 428/681] Doc: QWebEngineUrlScheme: Add since information to
 Flag::FetchApiAllowed

This enum value is new in Qt 6.6.

Task-number: QTBUG-116843
Change-Id: Ia2525e7fb7ed51a5bde6b113a839c9e00ca6aff5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1e5bdadea48d1c9adb2b82adb3bf926fdc78adbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineurlscheme.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/qwebengineurlscheme.cpp b/src/core/api/qwebengineurlscheme.cpp
index 595d64e5c1c..3093c2b8edd 100644
--- a/src/core/api/qwebengineurlscheme.cpp
+++ b/src/core/api/qwebengineurlscheme.cpp
@@ -163,7 +163,7 @@ class QWebEngineUrlSchemePrivate : public QSharedData
   generated automatically by the QWebEngineUrlRequestJob class. By default only
   \c http and \c https are CORS enabled. (Added in Qt 5.14)
 
-  \value FetchApiAllowed
+  \value [since 6.6] FetchApiAllowed
   Enables a URL scheme to be used by the HTML5 fetch API and \c XMLHttpRequest.send with
   a body. By default only \c http and \c https can be send to using the Fetch API or with
   an XMLHttpRequest with a body.

From d8859277704306046c290777a37431b35a1a4ebd Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Wed, 30 Aug 2023 12:31:14 +0200
Subject: [PATCH 429/681] Delay the graphics API setup calls

- The initialization process sets up the graphics API before the main is invoked and hence the qputenv calls have no effect.
- Delayed the graphic API setup calls so that it will consider the value
  set by qputenv calls as well.

Fixes: QTBUG-116159
Change-Id: I1e9dde7f65c214a7d5963dbba12f41b8feba925f
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit f79f7a3b6d80a29baad5c5cb1bf68bb01045c7c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qtwebenginecoreglobal.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 8a02b1bec61..b9e2882a483 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -44,6 +44,14 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
 #ifdef Q_OS_WIN32
     qputenv("QT_D3DCREATE_MULTITHREADED", "1");
 #endif
+    auto api = QQuickWindow::graphicsApi();
+    if (api != QSGRendererInterface::OpenGL
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+        && api != QSGRendererInterface::Vulkan && api != QSGRendererInterface::Metal
+        && api != QSGRendererInterface::Direct3D11
+#endif
+    )
+        QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
     // No need to override the shared context if QApplication already set one (e.g with Qt::AA_ShareOpenGLContexts).
     if (!qt_gl_global_share_context()) {
 
@@ -105,14 +113,6 @@ static void initialize()
 #if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
     // QCoreApplication is not yet instantiated, ensuring the call will be deferred
     qAddPreRoutine(QtWebEngineCore::initialize);
-    auto api = QQuickWindow::graphicsApi();
-    if (api != QSGRendererInterface::OpenGL
-#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
-        && api != QSGRendererInterface::Vulkan
-        && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11
-#endif
-        )
-        QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
 #endif // QT_CONFIG(opengl)
 }
 

From 423bfd1b321813270086f279b24189ff70da1d61 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 8 Aug 2023 11:52:13 +0200
Subject: [PATCH 430/681] Chromium VAAPI support depends on Vulkan headers at
 the moment

Pick-to: 6.6.0
Fixes: QTBUG-115722
Change-Id: I34adbb379c62ea59299eafd97c9ae4754983269c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 56fa2aa75ad4d7a1e3386405794c43d23666cfbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index c19f1825151..ed92c12e8c4 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -162,7 +162,7 @@ qt_feature("webengine-vaapi" PRIVATE
     SECTION "WebEngine"
     LABEL "VA-API support"
     PURPOSE "Enables support for VA-API hardware acceleration"
-    AUTODETECT GBM_FOUND AND LIBVA_FOUND
+    AUTODETECT GBM_FOUND AND LIBVA_FOUND AND QT_FEATURE_vulkan
     CONDITION LINUX
 )
 # internal testing feature

From d8210fbbe171371bfcad4f8ecf534f59ad120e63 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Thu, 31 Aug 2023 10:35:49 +0200
Subject: [PATCH 431/681] Modify the file system access request window title
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Corrected the typo in the file system access window title.

Change-Id: I9667726527e90477f6602e9ac8acf1a68742abe7
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit df05221eaa33496aeb013ece3f4ce6a78aeb8c95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/webenginewidgets/simplebrowser/webview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index e024f9126fe..037c53ad198 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -325,7 +325,7 @@ void WebView::handleFileSystemAccessRequested(QWebEngineFileSystemAccessRequest
         Q_UNREACHABLE();
     }
 
-    auto answer = QMessageBox::question(window(), tr("File system access reques"),
+    auto answer = QMessageBox::question(window(), tr("File system access request"),
                                         tr("Give %1 %2 access to %3?")
                                                 .arg(request.origin().host())
                                                 .arg(accessType)

From 7dcdca265f4bf2a979d0ba10c29f5674375d10b7 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 13 Sep 2023 10:46:06 +0200
Subject: [PATCH 432/681] Improve tst_QQuickWebEngineView::savePage auto test

Use ScopedConnection to avoid "stack-use-after-return" address
sanitizer error.

Also reduce potential wait time in case of failure by waiting
for accepted and finished states individually (same as
tst_QWebEngineDownloadRequest tests).

Fixes: QTBUG-116738
Task-number: QTBUG-56093
Change-Id: I49a60c95a816ae1b4cb6b227501ff81ca9c6f82b
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9e8964001dcdc4c0dba4501ddcb599b86b5939e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../qquickwebengineview/tst_qquickwebengineview.cpp  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index f82c5826470..bf68fb04819 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -3,6 +3,7 @@
 
 #include "testwindow.h"
 #include "quickutil.h"
+#include "util.h"
 
 #include <QScopedPointer>
 #include <QtCore/qelapsedtimer.h>
@@ -1295,7 +1296,10 @@ void tst_QQuickWebEngineView::savePage()
     const QString filePath = tempDir.path() + "/saved_page.html";
 
     QQuickWebEngineView *view = webEngineView();
-    connect(view->profile(), &QQuickWebEngineProfile::downloadRequested,
+    int acceptedCount = 0;
+    int finishedCount = 0;
+    ScopedConnection sc1 = connect(
+            view->profile(), &QQuickWebEngineProfile::downloadRequested,
             [&](QQuickWebEngineDownloadRequest *downloadRequest) {
                 QCOMPARE(downloadRequest->state(),
                          QQuickWebEngineDownloadRequest::DownloadInProgress);
@@ -1320,8 +1324,9 @@ void tst_QQuickWebEngineView::savePage()
                                              .filePath(downloadRequest->downloadFileName()),
                                      filePath);
                             QCOMPARE(downloadRequest->url(), view->url());
-                            QTestEventLoop::instance().exitLoop();
+                            finishedCount++;
                         });
+                acceptedCount++;
             });
 
     const QString originalData = QStringLiteral("Basic page");
@@ -1333,7 +1338,8 @@ void tst_QQuickWebEngineView::savePage()
 
     // Save the loaded page as HTML.
     view->save(filePath, savePageFormat);
-    QTestEventLoop::instance().enterLoop(10);
+    QTRY_COMPARE(acceptedCount, 1);
+    QTRY_COMPARE(finishedCount, 1);
     QFile file(filePath);
     QVERIFY(file.exists());
 

From dafcaeca04a9aa6f6b46deef8df9b1b225c6988b Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 15 Sep 2023 07:50:17 +0000
Subject: [PATCH 433/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I960b0fd5112a58fb9e5e07f097d0247416ed62fb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3f37a84192a..f181f1ee07e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 6ad23dc4026b87b973ac2f2db208857105e14fea
+    ref: 3c17522b8f34f151e31c2f94070401f49cbc26ba
     required: true
   ../qtpositioning:
-    ref: f29ffe49981d5071b9c16bd3894619432d2a30fd
+    ref: 1a45be015d112f75649308342f4813fd803206b2
     required: false
   ../qttools:
-    ref: 18f9224e7adc3565c0e451f149f6c03ecacc7035
+    ref: b0344f32468078fb8a197483de978d3c2f8616c3
     required: false
   ../qtwebchannel:
-    ref: ec6bad4664d0a82a84b48faa6e3b9776a79fe0af
+    ref: 7f0a9357068345c23f2f1b9c3f7300806e68cf6e
     required: false

From 363fbb395b7002bf6ff0a0a3c221a1317196c82c Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Wed, 13 Sep 2023 11:33:11 +0300
Subject: [PATCH 434/681] Bump version to 6.6.1

Change-Id: Ifb18ab7930c14f08b3e61d17c6e484c750d11902
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index 59d249587ee..017a7f8906d 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,4 +1,4 @@
-set(QT_REPO_MODULE_VERSION "6.6.0")
+set(QT_REPO_MODULE_VERSION "6.6.1")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")
 set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")

From 0fbda774701fca4493657949353c46e59a0ef2bc Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Thu, 7 Sep 2023 08:01:44 +0200
Subject: [PATCH 435/681] QPdfLinkModel: don't re-use QObject::d_ptr

Policy in qtwebengine is to use a separate d-pointer to avoid tying
the module build to a particular upstream Qt release.

Pick-to: 6.6.0
Change-Id: I0be241ee379663721225484cda22d952942a95fd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit fa4a418ba62bd7243b1542bee7d1491e6d83b857)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdflinkmodel.cpp | 7 ++-----
 src/pdf/qpdflinkmodel.h   | 3 +++
 src/pdf/qpdflinkmodel_p.h | 6 ++++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp
index 819af708228..366b773446c 100644
--- a/src/pdf/qpdflinkmodel.cpp
+++ b/src/pdf/qpdflinkmodel.cpp
@@ -44,7 +44,8 @@ Q_LOGGING_CATEGORY(qLcLink, "qt.pdf.links")
     Constructs a new link model with parent object \a parent.
 */
 QPdfLinkModel::QPdfLinkModel(QObject *parent)
-    : QAbstractListModel(*(new QPdfLinkModelPrivate()), parent)
+    : QAbstractListModel(parent),
+      d_ptr{std::make_unique<QPdfLinkModelPrivate>(this)}
 {
     Q_D(QPdfLinkModel);
     QMetaEnum rolesMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role"));
@@ -166,10 +167,6 @@ QPdfLink QPdfLinkModel::linkAt(QPointF point) const
     return {};
 }
 
-QPdfLinkModelPrivate::QPdfLinkModelPrivate() : QAbstractItemModelPrivate()
-{
-}
-
 void QPdfLinkModelPrivate::update()
 {
     Q_Q(QPdfLinkModel);
diff --git a/src/pdf/qpdflinkmodel.h b/src/pdf/qpdflinkmodel.h
index 05151ef7914..be2ce890c19 100644
--- a/src/pdf/qpdflinkmodel.h
+++ b/src/pdf/qpdflinkmodel.h
@@ -10,6 +10,8 @@
 
 #include <QtCore/QAbstractListModel>
 
+#include <memory>
+
 QT_BEGIN_NAMESPACE
 
 class QPdfLinkModelPrivate;
@@ -57,6 +59,7 @@ private Q_SLOTS:
 
 private:
     Q_DECLARE_PRIVATE(QPdfLinkModel)
+    const std::unique_ptr<QPdfLinkModelPrivate> d_ptr;
 };
 
 QT_END_NAMESPACE
diff --git a/src/pdf/qpdflinkmodel_p.h b/src/pdf/qpdflinkmodel_p.h
index dbd420890e8..ba46a6e00a6 100644
--- a/src/pdf/qpdflinkmodel_p.h
+++ b/src/pdf/qpdflinkmodel_p.h
@@ -20,12 +20,14 @@
 
 QT_BEGIN_NAMESPACE
 
-class QPdfLinkModelPrivate: public QAbstractItemModelPrivate
+class QPdfLinkModelPrivate
 {
+    QPdfLinkModel *q_ptr;
     Q_DECLARE_PUBLIC(QPdfLinkModel)
 
 public:
-    QPdfLinkModelPrivate();
+    explicit QPdfLinkModelPrivate(QPdfLinkModel *qq)
+        : q_ptr(qq) {}
 
     void update();
 

From 045f42fb52dc3770cc31b7444d7c025f0f6fd421 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 18 Sep 2023 10:44:33 +0000
Subject: [PATCH 436/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ie3db6db5c77767688d6f4feba70cd7a7e1c38c6f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 5845693a5ad..bfccd1705a5 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 5b6a26a3a2fd02dce710d468165ff86fbc766d79
+    ref: 58b1d29fef5c086fe2c619e26ffb75cdc860a31c
     required: true
   ../qtpositioning:
-    ref: 425795f74e2125711c5eedc28da09e9b7034aa31
+    ref: fac956e8b8c540b24ea6fdcbeda350c6622d071d
     required: false
   ../qttools:
-    ref: 0d42e3dce73cfb4e744d8ff2b90ac33720611e99
+    ref: 0b9b11d21f90e4d308af441b2f52b8f0665ab403
     required: false
   ../qtwebchannel:
-    ref: 64301f789c07e40292d001a0c786b18fc3d8b172
+    ref: 345000d4d5e0c2ae5497680dbb9d1c523d3fd208
     required: false

From 6ddca2acb9c41504571ea9070e608b284d23bcc7 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 14 Sep 2023 16:40:40 +0200
Subject: [PATCH 437/681] Add ImAbsolutePosition input method query

cocoa qpa uses it.

Pick-to: 6.6.0 6.5 6.5.3
Fixes: QTBUG-115994
Change-Id: Ie9556169add96946b71299066b8db92bee23066e
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4522eef20ba636a78937fd58bf8c0a8a5aafe648)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/render_widget_host_view_qt_delegate_client.cpp  | 1 +
 tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index b10fb38cc62..a1fb81a29b5 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -344,6 +344,7 @@ QVariant RenderWidgetHostViewQtDelegateClient::inputMethodQuery(Qt::InputMethodQ
         }
         return QVariant();
     }
+    case Qt::ImAbsolutePosition:
     case Qt::ImCursorPosition:
         return m_cursorPosition;
     case Qt::ImAnchorPosition:
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index a0f93faac87..bd43a999cca 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -2966,6 +2966,7 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     }
 
     QInputMethodQueryEvent srrndTextQuery(Qt::ImSurroundingText);
+    QInputMethodQueryEvent absolutePosQuery(Qt::ImAbsolutePosition);
     QInputMethodQueryEvent cursorPosQuery(Qt::ImCursorPosition);
     QInputMethodQueryEvent anchorPosQuery(Qt::ImAnchorPosition);
 
@@ -2980,11 +2981,13 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
 
     QApplication::sendEvent(input, &srrndTextQuery);
+    QApplication::sendEvent(input, &absolutePosQuery);
     QApplication::sendEvent(input, &cursorPosQuery);
     QApplication::sendEvent(input, &anchorPosQuery);
     qApp->processEvents();
 
     QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString(""));
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
     QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
     QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
 
@@ -3000,11 +3003,13 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("composition"));
 
     QApplication::sendEvent(input, &srrndTextQuery);
+    QApplication::sendEvent(input, &absolutePosQuery);
     QApplication::sendEvent(input, &cursorPosQuery);
     QApplication::sendEvent(input, &anchorPosQuery);
     qApp->processEvents();
 
     QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition"));
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
     QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
     QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
 }

From b65512cafc2e8da767af2d798c73158a8598ca94 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 14 Sep 2023 14:28:03 +0200
Subject: [PATCH 438/681] Do not try to delete BrowserAccessibilityInterface
 twice

BrowserAccessibilityInterface is deleted when removing it from the
QAccessibleInterface cache. It is removed from the cache in the
BrowserAccessibilityQt destructor explicitly.

On exit, the QAccessibleInterface cache might be destructed earlier than
the corresponding BrowserAccessibilityQt and deletes all the cached
interfaces. Reset the interface pointer to nullptr to make sure that the
destructor doesn't try to delete an already deleted interface.

Pick-to: 6.6.0 6.5 6.5.3
Fixes: QTBUG-115753
Change-Id: Ide02a84d2230145a3441d9ade47eaa14af897477
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a931a1ed782b2069749dd316f51ca1044c21a61a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_qt.cpp | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index d1cdd4b2067..24c006dc5dc 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -25,10 +25,7 @@ class BrowserAccessibilityQt
     BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node);
     ~BrowserAccessibilityQt();
 
-    QtWebEngineCore::BrowserAccessibilityInterface *interface() const { return m_interface; }
-
-private:
-    QtWebEngineCore::BrowserAccessibilityInterface *m_interface = nullptr;
+    QtWebEngineCore::BrowserAccessibilityInterface *interface = nullptr;
 };
 
 class BrowserAccessibilityInterface
@@ -41,6 +38,7 @@ class BrowserAccessibilityInterface
 {
 public:
     BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface);
+    ~BrowserAccessibilityInterface() override;
 
     void destroy();
 
@@ -133,15 +131,17 @@ class BrowserAccessibilityInterface
     BrowserAccessibilityQt *q;
 };
 
-BrowserAccessibilityQt::BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node)
-    : content::BrowserAccessibility(manager, node),
-      m_interface(new BrowserAccessibilityInterface(this))
+BrowserAccessibilityQt::BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager,
+                                               ui::AXNode *node)
+    : content::BrowserAccessibility(manager, node)
+    , interface(new BrowserAccessibilityInterface(this))
 {
 }
 
 BrowserAccessibilityQt::~BrowserAccessibilityQt()
 {
-    m_interface->destroy();
+    if (interface)
+        interface->destroy();
 }
 
 BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface)
@@ -157,6 +157,11 @@ BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilit
     m_id = QAccessible::registerAccessibleInterface(this);
 }
 
+BrowserAccessibilityInterface::~BrowserAccessibilityInterface()
+{
+    q->interface = nullptr;
+}
+
 void BrowserAccessibilityInterface::destroy()
 {
     QAccessible::deleteAccessibleInterface(m_id);
@@ -1140,12 +1145,12 @@ std::unique_ptr<BrowserAccessibility> BrowserAccessibility::Create(BrowserAccess
 
 QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj)
 {
-    return static_cast<QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface();
+    return static_cast<QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
 }
 
 const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *obj)
 {
-    return static_cast<const QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface();
+    return static_cast<const QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
 }
 
 } // namespace content

From 6c8e7fa4ebf82160cdddb0ee61de454a4a090422 Mon Sep 17 00:00:00 2001
From: Amir Masoud Abdol <amir.abdol@qt.io>
Date: Tue, 9 May 2023 14:37:50 +0200
Subject: [PATCH 439/681] Use ABSOLUTE path if QT_ALLOW_SYMLINK_IN_PATHS is
 enabled

When building with symlink allowed, we shouldn't resolve the symlink,
and instead use ABSOLUTE path. The `qt_internal_get_filename_path_mode`
returns ABSOLUTE only if we are on macOS, and QT_ALLOW_SYMLINK_IN_PATHS
is enabled. Otherwise, path_mode will be REALPATH.

Pick-to: 6.5
Task-number: QTBUG-113463
Change-Id: I99b84004781ebf748cb1db2ba068d71a72d0daa4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 8dce6344c0f5f0ef3f747a7af819e71cf30cfb19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake       | 12 +++++++++---
 cmake/Gn.cmake              |  9 +++++++--
 src/CMakeLists.txt          |  7 +++++--
 src/core/api/CMakeLists.txt | 10 ++++++----
 src/gn/CMakeLists.txt       |  7 ++++++-
 src/process/CMakeLists.txt  |  4 +++-
 6 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 7145c6192e5..9fb4299c50d 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -222,10 +222,15 @@ function(configure_gn_target sourceDir inFilePath outFilePath)
     # FIXME: GN_CONFIG
     set(GN_CONFIG NOTUSED)
 
+    set(path_mode REALPATH)
+    if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
+        set(path_mode ABSOLUTE)
+    endif()
+
     # GN_SOURCES GN_HEADERS
     get_property(gnSources DIRECTORY PROPERTY GN_SOURCES)
     foreach(gnSourceFile ${gnSources})
-        get_filename_component(gnSourcePath ${sourceDir}/${gnSourceFile} REALPATH)
+        get_filename_component(gnSourcePath ${sourceDir}/${gnSourceFile} ${path_mode})
         list(APPEND sourceList \"${gnSourcePath}\")
     endforeach()
     set(GN_HEADERS ${sourceList})
@@ -245,7 +250,7 @@ function(configure_gn_target sourceDir inFilePath outFilePath)
     get_property(gnIncludes DIRECTORY PROPERTY GN_INCLUDES)
     list(REMOVE_DUPLICATES gnIncludes)
     foreach(gnInclude ${gnIncludes})
-        get_filename_component(gnInclude ${gnInclude} REALPATH)
+        get_filename_component(gnInclude ${gnInclude} ${path_mode})
         list(APPEND GN_ARGS_INCLUDES \"-I${gnInclude}\")
         list(APPEND GN_INCLUDE_DIRS \"${gnInclude}\")
     endforeach()
@@ -269,7 +274,7 @@ function(configure_gn_target sourceDir inFilePath outFilePath)
     list(REMOVE_DUPLICATES GN_CFLAGS_C)
 
     # GN_SOURCE_ROOT
-    get_filename_component(GN_SOURCE_ROOT "${sourceDir}" REALPATH)
+    get_filename_component(GN_SOURCE_ROOT "${sourceDir}" ${path_mode})
 
     if(APPLE) # this runs in scrpit mode without qt-cmake so on MACOS here
         recoverFrameworkBuild(GN_INCLUDE_DIRS GN_CFLAGS_C)
@@ -1242,6 +1247,7 @@ function(add_gn_command)
              -DQT_HOST_GN_PATH=${QT_HOST_GN_PATH}
              -DPython3_EXECUTABLE=${Python3_EXECUTABLE}
              -DGN_THREADS=$ENV{QTWEBENGINE_GN_THREADS}
+             -DQT_ALLOW_SYMLINK_IN_PATHS=${QT_ALLOW_SYMLINK_IN_PATHS}
              -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Gn.cmake
         WORKING_DIRECTORY ${WEBENGINE_ROOT_BUILD_DIR}
         COMMENT "Run gn for target ${arg_CMAKE_TARGET} in ${arg_BUILDDIR}"
diff --git a/cmake/Gn.cmake b/cmake/Gn.cmake
index 41dccc11b38..15b349e0898 100644
--- a/cmake/Gn.cmake
+++ b/cmake/Gn.cmake
@@ -9,8 +9,13 @@ if(NOT CMAKE_SCRIPT_MODE_FILE)
     return()
 endif()
 
-get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
-get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
+set(path_mode REALPATH)
+if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
+    set(path_mode ABSOLUTE)
+endif()
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ${path_mode})
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ${path_mode})
 
 include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
 include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 59eb27e73e8..1016216cc40 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,8 +5,10 @@
 #  MAIN CONFIGURE
 ##
 
-get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." REALPATH)
-get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${PROJECT_BINARY_DIR}" REALPATH)
+qt_internal_get_filename_path_mode(path_mode)
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." ${path_mode})
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${PROJECT_BINARY_DIR}" ${path_mode})
 
 # Note this is configure that does not belong to any module
 qt_feature_module_begin(ONLY_EVALUATE_FEATURES)
@@ -140,6 +142,7 @@ if(NOT Gn_FOUND)
                    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
                    -DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
                    -DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
+                   -DQT_ALLOW_SYMLINK_IN_PATHS=${QT_ALLOW_SYMLINK_IN_PATHS}
     )
     if(QT_FEATURE_qtwebengine_core_build)
         add_dependencies(run_core_GnReady gn)
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index a3cb53e176b..b1868c28885 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -124,6 +124,8 @@ set(resourceList qtwebengine_resources.pak
 
 set(stamps ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp)
 
+qt_internal_get_filename_path_mode(path_mode)
+
 if(QT_FEATURE_webengine_v8_context_snapshot)
     foreach(arch ${archs})
        foreach(config ${configs})
@@ -137,7 +139,7 @@ if(QT_FEATURE_webengine_v8_context_snapshot)
            else()
                unset(ext_debug)
            endif()
-          get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot${ext_arch}${ext_debug}.bin REALPATH)
+          get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot${ext_arch}${ext_debug}.bin ${path_mode})
           list(APPEND resourceFiles ${resSourcePath})
        endforeach()
        if(MACOS)
@@ -147,18 +149,18 @@ if(QT_FEATURE_webengine_v8_context_snapshot)
 endif()
 
 foreach(loc ${localeList})
-    get_filename_component(locSourcePath ${buildDir}/${config}/${arch}/qtwebengine_locales/${loc}.pak REALPATH)
+    get_filename_component(locSourcePath ${buildDir}/${config}/${arch}/qtwebengine_locales/${loc}.pak ${path_mode})
     list(APPEND localeFiles ${locSourcePath})
 endforeach()
 
 foreach(res ${resourceList})
-    get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/${res} REALPATH)
+    get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/${res} ${path_mode})
     list(APPEND resourceFiles ${resSourcePath})
 endforeach()
 
 
 if(NOT QT_FEATURE_webengine_system_icu)
-    get_filename_component(icuFile ${buildDir}/${config}/${arch}/icudtl.dat REALPATH)
+    get_filename_component(icuFile ${buildDir}/${config}/${arch}/icudtl.dat ${path_mode})
     list(APPEND resourceFiles ${icuFile})
     set_target_properties(WebEngineCore PROPERTIES ICUDTL_FILE ${icuFile})
 endif()
diff --git a/src/gn/CMakeLists.txt b/src/gn/CMakeLists.txt
index 60d4451f5e5..0fe3e4e05b8 100644
--- a/src/gn/CMakeLists.txt
+++ b/src/gn/CMakeLists.txt
@@ -11,7 +11,12 @@ project(Gn
 )
 
 if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
-    get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." REALPATH)
+    set(path_mode REALPATH)
+    if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
+        set(path_mode ABSOLUTE)
+    endif()
+
+    get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ${path_mode})
 endif()
 
 include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index 80cc238f903..455d5c41a4e 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -2,7 +2,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 
 if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
-    get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." REALPATH)
+    qt_internal_get_filename_path_mode(path_mode)
+
+    get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ${path_mode})
 endif()
 include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
 

From 0d03a6e2b1fc067f45c48a51634d2e6e283f9061 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 14 Sep 2023 14:28:03 +0200
Subject: [PATCH 440/681] Do not try to delete BrowserAccessibilityInterface
 twice

BrowserAccessibilityInterface is deleted when removing it from the
QAccessibleInterface cache. It is removed from the cache in the
BrowserAccessibilityQt destructor explicitly.

On exit, the QAccessibleInterface cache might be destructed earlier than
the corresponding BrowserAccessibilityQt and deletes all the cached
interfaces. Reset the interface pointer to nullptr to make sure that the
destructor doesn't try to delete an already deleted interface.

Pick-to: 6.5.3
Fixes: QTBUG-115753
Change-Id: Ide02a84d2230145a3441d9ade47eaa14af897477
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a931a1ed782b2069749dd316f51ca1044c21a61a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b65512cafc2e8da767af2d798c73158a8598ca94)
---
 src/core/browser_accessibility_qt.cpp | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index d1cdd4b2067..24c006dc5dc 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -25,10 +25,7 @@ class BrowserAccessibilityQt
     BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node);
     ~BrowserAccessibilityQt();
 
-    QtWebEngineCore::BrowserAccessibilityInterface *interface() const { return m_interface; }
-
-private:
-    QtWebEngineCore::BrowserAccessibilityInterface *m_interface = nullptr;
+    QtWebEngineCore::BrowserAccessibilityInterface *interface = nullptr;
 };
 
 class BrowserAccessibilityInterface
@@ -41,6 +38,7 @@ class BrowserAccessibilityInterface
 {
 public:
     BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface);
+    ~BrowserAccessibilityInterface() override;
 
     void destroy();
 
@@ -133,15 +131,17 @@ class BrowserAccessibilityInterface
     BrowserAccessibilityQt *q;
 };
 
-BrowserAccessibilityQt::BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node)
-    : content::BrowserAccessibility(manager, node),
-      m_interface(new BrowserAccessibilityInterface(this))
+BrowserAccessibilityQt::BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager,
+                                               ui::AXNode *node)
+    : content::BrowserAccessibility(manager, node)
+    , interface(new BrowserAccessibilityInterface(this))
 {
 }
 
 BrowserAccessibilityQt::~BrowserAccessibilityQt()
 {
-    m_interface->destroy();
+    if (interface)
+        interface->destroy();
 }
 
 BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface)
@@ -157,6 +157,11 @@ BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilit
     m_id = QAccessible::registerAccessibleInterface(this);
 }
 
+BrowserAccessibilityInterface::~BrowserAccessibilityInterface()
+{
+    q->interface = nullptr;
+}
+
 void BrowserAccessibilityInterface::destroy()
 {
     QAccessible::deleteAccessibleInterface(m_id);
@@ -1140,12 +1145,12 @@ std::unique_ptr<BrowserAccessibility> BrowserAccessibility::Create(BrowserAccess
 
 QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj)
 {
-    return static_cast<QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface();
+    return static_cast<QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
 }
 
 const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *obj)
 {
-    return static_cast<const QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface();
+    return static_cast<const QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
 }
 
 } // namespace content

From dd2707678bcc0384ed7df4baa3c2213d45244765 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 14 Sep 2023 16:40:40 +0200
Subject: [PATCH 441/681] Add ImAbsolutePosition input method query

cocoa qpa uses it.

Pick-to: 6.5.3
Fixes: QTBUG-115994
Change-Id: Ie9556169add96946b71299066b8db92bee23066e
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4522eef20ba636a78937fd58bf8c0a8a5aafe648)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6ddca2acb9c41504571ea9070e608b284d23bcc7)
---
 src/core/render_widget_host_view_qt_delegate_client.cpp  | 1 +
 tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index b388ea6f5c4..b66c53ceb54 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -346,6 +346,7 @@ QVariant RenderWidgetHostViewQtDelegateClient::inputMethodQuery(Qt::InputMethodQ
         }
         return QVariant();
     }
+    case Qt::ImAbsolutePosition:
     case Qt::ImCursorPosition:
         return m_cursorPosition;
     case Qt::ImAnchorPosition:
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index c242d240efb..a6739280131 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -2960,6 +2960,7 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     }
 
     QInputMethodQueryEvent srrndTextQuery(Qt::ImSurroundingText);
+    QInputMethodQueryEvent absolutePosQuery(Qt::ImAbsolutePosition);
     QInputMethodQueryEvent cursorPosQuery(Qt::ImCursorPosition);
     QInputMethodQueryEvent anchorPosQuery(Qt::ImAnchorPosition);
 
@@ -2974,11 +2975,13 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
 
     QApplication::sendEvent(input, &srrndTextQuery);
+    QApplication::sendEvent(input, &absolutePosQuery);
     QApplication::sendEvent(input, &cursorPosQuery);
     QApplication::sendEvent(input, &anchorPosQuery);
     qApp->processEvents();
 
     QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString(""));
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
     QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
     QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
 
@@ -2994,11 +2997,13 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("composition"));
 
     QApplication::sendEvent(input, &srrndTextQuery);
+    QApplication::sendEvent(input, &absolutePosQuery);
     QApplication::sendEvent(input, &cursorPosQuery);
     QApplication::sendEvent(input, &anchorPosQuery);
     qApp->processEvents();
 
     QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition"));
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
     QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
     QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
 }

From fd6a610d7713de27c898d1bab1d97fd75e14ccb7 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 19 Sep 2023 11:28:50 +0000
Subject: [PATCH 442/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ief385d3f593dbc75c5f56185e5dec069b9075e4b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index f181f1ee07e..298a5f3adb5 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3c17522b8f34f151e31c2f94070401f49cbc26ba
+    ref: 778192769046f1b741137c876c737d7dcb121cd2
     required: true
   ../qtpositioning:
-    ref: 1a45be015d112f75649308342f4813fd803206b2
+    ref: d2dc8bcfcc3a2fc9dabfc62bb6e273a84fdfed36
     required: false
   ../qttools:
-    ref: b0344f32468078fb8a197483de978d3c2f8616c3
+    ref: 01890b772ddeb553327ca3195de07ec3f6429d6d
     required: false
   ../qtwebchannel:
-    ref: 7f0a9357068345c23f2f1b9c3f7300806e68cf6e
+    ref: cbba79f8ed913d791e9b91578be1db6933bde5c9
     required: false

From 6648aff8ac96be8b68b0ec6e6f5deec0f957fb3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 19 Sep 2023 10:38:34 +0200
Subject: [PATCH 443/681] Update Chromium

Submodule src/3rdparty 31f287a0..ef090c47:
  * [Backport] Security bug 1427288 (2/2)
  * [Backport] Security bug 1427288 (1/2)
  * [Backport] Security bug 1449166
  * [Backport] CVE-2023-4909: Inappropriate implementation in Interstitials
  * [Backport] CVE-2023-4908: Inappropriate implementation in Picture in Picture
  * [Backport] CVE-2023-4902: Inappropriate implementation in Input
  * Fixup [Backport] CVE-2023-2724: Type Confusion in V8

Task-number: QTBUG-116934
Change-Id: Id747cab635a75215d52156c139b73e671c79380b
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                  | 2 +-
 src/3rdparty                      | 2 +-
 src/core/devtools_frontend_qt.cpp | 2 +-
 src/core/web_engine_context.cpp   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 5d8248fa5f2..ea03ba17327 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           116.0.5845.187
+Patched with security patches up to Chromium version:           117.0.5938.63
diff --git a/src/3rdparty b/src/3rdparty
index 31f287a0142..ef090c47d08 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 31f287a0142b6b78698504b528d35c9506dcdb43
+Subproject commit ef090c47d08c734ae2b3c1db508982aca0f3ee1e
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index a1b9ae91c71..3fddd341069 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -62,7 +62,7 @@ DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter>
             new DevToolsFrontendQt(frontendAdapter, inspectedContents);
 
     if (contents->GetURL() == GURL(GetFrontendURL())) {
-        contents->GetController().Reload(content::ReloadType::ORIGINAL_REQUEST_URL, false);
+        contents->GetController().LoadOriginalRequestURL();
     } else {
         content::NavigationController::LoadURLParams loadParams((GURL(GetFrontendURL())));
         loadParams.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_TOPLEVEL
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 7bff7edca05..be462a22d57 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -937,7 +937,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "116.0.5845.187"; // FIXME: Remember to update
+    return "117.0.5938.63"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 9f1757b30d867e554514d860a140c1b599f080f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 15 Sep 2023 14:44:53 +0200
Subject: [PATCH 444/681] Update Chromium

Submodule src/3rdparty a71ba6ff..14780aaa:
  * [Backport] Security bug 1427288 (2/2)
  * [Backport] Security bug 1427288 (1/2)
  * [Backport] Security bug 1449166
  * [Backport] Security bug 1469534
  * [Backport] CVE-2023-4909: Inappropriate implementation in Interstitials
  * [Backport] CVE-2023-4908: Inappropriate implementation in Picture in Picture
  * [Backport] CVE-2023-4902: Inappropriate implementation in Input

Task-number: QTBUG-117059
Change-Id: I22da560b291cb984fffe1599a5f9845192458107
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 17c036b2a20f55daf7edcdafaf603a77130b8b04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d44f6dc3427295f439eaa8fcaa70d9eb7f11fc88)
---
 CHROMIUM_VERSION                  | 2 +-
 src/3rdparty                      | 2 +-
 src/core/devtools_frontend_qt.cpp | 2 +-
 src/core/web_engine_context.cpp   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 1876305bd1a..a9ed5a33904 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           116.0.5845.187
+Patched with security patches up to Chromium version:           117.0.5938.63
diff --git a/src/3rdparty b/src/3rdparty
index a71ba6ffc8e..14780aaa6b0 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit a71ba6ffc8e34033b93c0727e8d7eb17f7d6a25f
+Subproject commit 14780aaa6b0f85a6912878b3874c18e63c99a5d9
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 49fc0d3aab4..047026826ce 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -62,7 +62,7 @@ DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter>
             new DevToolsFrontendQt(frontendAdapter, inspectedContents);
 
     if (contents->GetURL() == GURL(GetFrontendURL())) {
-        contents->GetController().Reload(content::ReloadType::ORIGINAL_REQUEST_URL, false);
+        contents->GetController().LoadOriginalRequestURL();
     } else {
         content::NavigationController::LoadURLParams loadParams((GURL(GetFrontendURL())));
         loadParams.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_TOPLEVEL
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 6c19428e5cf..545205de806 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -931,7 +931,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "116.0.5845.187"; // FIXME: Remember to update
+    return "117.0.5938.63"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 9690dbb17452c8797bda9841da76212f2f2ec0e7 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 19 Sep 2023 16:52:45 +0000
Subject: [PATCH 445/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I6c4369bd686dae8c429e3fe80e51ffe16e3c40e1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index bfccd1705a5..153caa043cc 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 58b1d29fef5c086fe2c619e26ffb75cdc860a31c
+    ref: d5ef095a22dec6a43db8c9977d1feff207eb2e9d
     required: true
   ../qtpositioning:
-    ref: fac956e8b8c540b24ea6fdcbeda350c6622d071d
+    ref: 55075b428554eb9adcbebd86cfb0290c5c5b3ace
     required: false
   ../qttools:
-    ref: 0b9b11d21f90e4d308af441b2f52b8f0665ab403
+    ref: 8d788182cb61392c7806d8be7a6840357b109c62
     required: false
   ../qtwebchannel:
-    ref: 345000d4d5e0c2ae5497680dbb9d1c523d3fd208
+    ref: 9e2bc2317dc0491d4338c10d7f00c350b701901e
     required: false

From b3f891fd0800ed46c9f275dc99eff0d0f0b8e68f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 20 Sep 2023 20:46:19 +0000
Subject: [PATCH 446/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Id5cbad0a55e0656061b69c7e3aa92b6efc5a95d7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 298a5f3adb5..c4ac9eda61f 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 778192769046f1b741137c876c737d7dcb121cd2
+    ref: 016f7af32b15503a3c2e075e6ac3a2ed10b721c5
     required: true
   ../qtpositioning:
-    ref: d2dc8bcfcc3a2fc9dabfc62bb6e273a84fdfed36
+    ref: 0554fcdd27c6aa70e30b9c9f55997d02e3f45946
     required: false
   ../qttools:
-    ref: 01890b772ddeb553327ca3195de07ec3f6429d6d
+    ref: a8655afb1924de1365fc6fec2f5cefdbde97b21e
     required: false
   ../qtwebchannel:
-    ref: cbba79f8ed913d791e9b91578be1db6933bde5c9
+    ref: f1ef008e19a7645d30a768d68e1e194c56579921
     required: false

From b8199c3b7a1677026a9e3d831a6a961cfd04e11f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 21 Sep 2023 08:18:42 +0000
Subject: [PATCH 447/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I944e8658ecf13a7aae481fbda9f699045b59c656
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 153caa043cc..60468f40fef 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: d5ef095a22dec6a43db8c9977d1feff207eb2e9d
+    ref: 85e63fa53d9da7104e5f70e5d1aec84b82fdc5f2
     required: true
   ../qtpositioning:
-    ref: 55075b428554eb9adcbebd86cfb0290c5c5b3ace
+    ref: cd51fbb60006fd8bdd438bd95fa5a3e8c2da6a2f
     required: false
   ../qttools:
-    ref: 8d788182cb61392c7806d8be7a6840357b109c62
+    ref: 845f555f6906683b9e9b3c9fd7ccf3ef0ddb2f99
     required: false
   ../qtwebchannel:
-    ref: 9e2bc2317dc0491d4338c10d7f00c350b701901e
+    ref: 76425182630dfc47c8bca0186098fd8353a909a5
     required: false

From 5932a58e11b382caae25dfa1d34751c8bc8ed797 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Tue, 11 Apr 2023 15:48:26 +0200
Subject: [PATCH 448/681] Fix print button of PDF viewer plugin

Do not try to start print preview automatically, just notify the
embedder via printRequested signal instead of crashing.
Also fix the signal name in WebEngineView docs.

Task-number: QTBUG-104610
Task-number: QTBUG-117382
Change-Id: I251e0b8f6f03a73236320a66a0d3c7690939d88b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3801a9244cb57bfb6b6b08be652f42a135b71142)
---
 src/core/printing/print_view_manager_qt.cpp        | 13 ++++++++++++-
 src/webenginequick/doc/src/webengineview_lgpl.qdoc |  5 +++--
 src/webenginewidgets/api/qwebengineview.cpp        |  3 ++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 7d8a796f773..892c9e40633 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -336,12 +336,23 @@ void PrintViewManagerQt::ShowScriptedPrintPreview(bool /*source_is_modifiable*/)
     // ignore for now
 }
 
-void PrintViewManagerQt::RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr /*params*/)
+void PrintViewManagerQt::RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr params)
 {
+    if (!m_printPreviewRfh && params->webnode_only) {
+        // The preview was requested by the print button of PDF viewer plugin. The code path ends up here, because
+        // Chromium automatically initiated a preview generation. We don't want that, just notify our embedder
+        // like we do in SetupScriptedPrintPreview() after window.print() and let them decide what to do.
+        content::WebContentsView *view = static_cast<content::WebContentsImpl*>(web_contents()->GetOutermostWebContents())->GetView();
+        if (WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client())
+            client->printRequested();
+        return;
+    }
+
     if (m_printSettings.empty()) {
         PrintPreviewDone();
         return;
     }
+
     mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> printRenderFrame;
     m_printPreviewRfh->GetRemoteAssociatedInterfaces()->GetInterface(&printRenderFrame);
     printRenderFrame->PrintPreview(m_printSettings.Clone());
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 6390c0c025c..358f8b1ddb3 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -1315,10 +1315,11 @@
 */
 
 /*!
-    \qmlsignal WebEngineView::printRequest
+    \qmlsignal WebEngineView::printRequested
     \since QtWebEngine 1.8
 
-    This signal is emitted when the JavaScript \c{window.print()} method is called.
+    This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+    button of PDF viewer plugin.
     Typically, the signal handler can simply call printToPdf().
 
     \sa printToPdf
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 35fb9813879..8d88726fac8 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -1379,7 +1379,8 @@ void QWebEngineView::printToPdf(const std::function<void(const QByteArray&)> &re
     \fn void QWebEngineView::printRequested()
     \since 6.2
 
-    This signal is emitted when the JavaScript \c{window.print()} method is called.
+    This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+    button of PDF viewer plugin.
     Typically, the signal handler can simply call print().
 
     \sa print()

From 24ad45f904ef7198f7c7f9d184625916e322fbb9 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 22 Sep 2023 10:25:52 +0000
Subject: [PATCH 449/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Idfc6ca93f50f3395dad409cd8214bb7f3982fb16
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c4ac9eda61f..e62d555afec 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 016f7af32b15503a3c2e075e6ac3a2ed10b721c5
+    ref: de5481c25c96ab7af5a51836a0f59733e6d0cadd
     required: true
   ../qtpositioning:
-    ref: 0554fcdd27c6aa70e30b9c9f55997d02e3f45946
+    ref: bfce8f643e38a56f8cfbf89cf651c836cfd135c7
     required: false
   ../qttools:
-    ref: a8655afb1924de1365fc6fec2f5cefdbde97b21e
+    ref: 05e39aacf67dba6b77254f248bcd3a3abdb695d1
     required: false
   ../qtwebchannel:
-    ref: f1ef008e19a7645d30a768d68e1e194c56579921
+    ref: eb9c0d2e9be729f534539a15220983bc14620a15
     required: false

From 8cb60c156012f31084fc6203d01b57dc5b9733ac Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 22 Sep 2023 12:45:10 +0000
Subject: [PATCH 450/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I85eb5fdc3a414b108a06b270a122f5cc47b209a7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 60468f40fef..374e0daf0bb 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 85e63fa53d9da7104e5f70e5d1aec84b82fdc5f2
+    ref: b00d6c447ccdeb482bab5951efcde4457bb0c151
     required: true
   ../qtpositioning:
-    ref: cd51fbb60006fd8bdd438bd95fa5a3e8c2da6a2f
+    ref: fa1904651b7e024299ff60461c6ce42e1907ff9b
     required: false
   ../qttools:
-    ref: 845f555f6906683b9e9b3c9fd7ccf3ef0ddb2f99
+    ref: 1c79fb14547d91d642d6aacd4668679050bb8401
     required: false
   ../qtwebchannel:
-    ref: 76425182630dfc47c8bca0186098fd8353a909a5
+    ref: 6f1401a2b2bcefd284afe0c565dbf81c8486da2c
     required: false

From fd3fd9ea0cb669c29382a473cb6f0e763205a8a7 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 7 Sep 2023 18:02:00 +0200
Subject: [PATCH 451/681] Band aid fix for crashing D3D11 Warp setup

Rhi can decide to run D3D11 with the software rendering
through the software adapter aka "Microsoft Basic Render Driver".
This unfortunately does not work well with ANGLE as it can
use another adapter and sharing resources between
qt and skia can fail.

Try to guess which adapter might be used by rhi support
or rhi backing store support classes and pass luid for ANGLE.

Unfortunately this solution is far from perfect as
it creates QRhi just to check what might be used later,
however the user can select something totally different with
QQuickGraphicsConfiguration.

At lest for now we respect QSG_RHI_PREFER_SOFTWARE_RENDERER
and QT_D3D_ADAPTER_INDEX. Moreover this patch should cover
the case when rhi retrys with DXGI_ADAPTER_FLAG_SOFTWARE adapter
if accelerated adapter fails.

This is just a band aid patch to support windows on vm
and we should come up with better solution.

Fixes: QTBUG-116445
Pick-to: 6.6.0 6.5 6.5.3
Change-Id: I416dd82d688726ce872dc276570fe455d733a48e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8cef10f4faa9f2a5982e3cb780100cbc62209b07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_context.cpp | 34 +++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 545205de806..74c0b16729a 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -4,6 +4,7 @@
 #include "web_engine_context.h"
 
 #include <math.h>
+#include <QtGui/private/qrhi_p.h>
 
 #include "base/base_switches.h"
 #include "base/functional/bind.h"
@@ -177,6 +178,31 @@ bool usingSoftwareDynamicGL()
 #endif
 }
 
+#if defined(Q_OS_WIN)
+static QString getAdapterLuid() {
+    static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
+    QRhiD3D11InitParams rhiParams;
+    QRhi::Flags flags;
+    if (preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+    }
+    QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
+    // mimic what QSGRhiSupport and QBackingStoreRhi does
+    if (!rhi && !preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+        rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
+    }
+    if (rhi) {
+        const QRhiD3D11NativeHandles *handles =
+                static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
+        Q_ASSERT(handles);
+        return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
+    } else {
+        return QString();
+    }
+}
+#endif
+
 static bool openGLPlatformSupport()
 {
     return QGuiApplicationPrivate::platformIntegration()->hasCapability(
@@ -721,6 +747,14 @@ WebEngineContext::WebEngineContext()
     }
 #endif
 
+#if defined(Q_OS_WIN)
+    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11) {
+        const QString luid = getAdapterLuid();
+        if (!luid.isEmpty())
+            parsedCommandLine->AppendSwitchASCII(switches::kUseAdapterLuid, luid.toStdString());
+    }
+#endif
+
     initializeFeatureList(parsedCommandLine, enableFeatures, disableFeatures);
 
     GLContextHelper::initialize();

From c526a8daa142b3a459cc357376a785b84abe5d0d Mon Sep 17 00:00:00 2001
From: Andreas Eliasson <andreas.eliasson@qt.io>
Date: Wed, 28 Jun 2023 12:21:11 +0200
Subject: [PATCH 452/681] Doc: Use \qml instead of \code for QML code snippet

Change-Id: I2025d77a15eca0b26096344c3f97f91138893378
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ae82cd21c55eacb940f90c084302db8fd21e198d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfquick/doc/src/qtquickpdf-module.qdoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pdfquick/doc/src/qtquickpdf-module.qdoc b/src/pdfquick/doc/src/qtquickpdf-module.qdoc
index 1d31f6148cb..a4ca0d9e8b0 100644
--- a/src/pdfquick/doc/src/qtquickpdf-module.qdoc
+++ b/src/pdfquick/doc/src/qtquickpdf-module.qdoc
@@ -12,7 +12,7 @@
 
     To use the types in this module, import the module with the following line:
 
-    \code
+    \qml
     import QtQuick.Pdf
-    \endcode
+    \endqml
 */

From 1e93e094d9eb9eb00f59be5936989fa0d76a3585 Mon Sep 17 00:00:00 2001
From: Joni Poikelin <joni.poikelin@qt.io>
Date: Tue, 4 Apr 2023 13:04:29 +0300
Subject: [PATCH 453/681] QPdfNavigator: emit forward/backAvailableChanged when
 jumping pages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

QPdfPageNavigator did not emit the page history signals when pages were
jumped.

This patch ensures correct signal emission in all cases.
It adds a new auto test class for QPdfPageNavigator.

Fixes: QTBUG-112614
Change-Id: I67af5a4d22a8e76b9c12c72c168fa5b3b4390f2c
Reviewed-by: Yigit Akcay <yigit.akcay@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 54ea7b5a2a1364b8fcdef859229ca58afe8d87ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfpagenavigator.cpp                 |   8 +-
 tests/auto/pdf/CMakeLists.txt                 |   4 +-
 .../auto/pdf/qpdfpagenavigator/CMakeLists.txt |  14 ++++
 .../pdf-sample.bookmarks_pages.pdf            | Bin 0 -> 27523 bytes
 .../tst_qpdfpagenavigator.cpp                 |  70 ++++++++++++++++++
 5 files changed, 91 insertions(+), 5 deletions(-)
 create mode 100644 tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt
 create mode 100644 tests/auto/pdf/qpdfpagenavigator/pdf-sample.bookmarks_pages.pdf
 create mode 100644 tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp

diff --git a/src/pdf/qpdfpagenavigator.cpp b/src/pdf/qpdfpagenavigator.cpp
index 253c1dff888..e077e21848f 100644
--- a/src/pdf/qpdfpagenavigator.cpp
+++ b/src/pdf/qpdfpagenavigator.cpp
@@ -207,9 +207,9 @@ void QPdfPageNavigator::jump(QPdfLink destination)
         emit currentLocationChanged(currentLocation());
     if (d->changing)
         return;
-    if (!backAvailableWas)
+    if (backAvailableWas != backAvailable())
         emit backAvailableChanged(backAvailable());
-    if (forwardAvailableWas)
+    if (forwardAvailableWas != forwardAvailable())
         emit forwardAvailableChanged(forwardAvailable());
     emit jumped(currentLink());
     qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << destination << "-> history" <<
@@ -263,9 +263,9 @@ void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom)
         emit currentLocationChanged(currentLocation());
     if (d->changing)
         return;
-    if (!backAvailableWas)
+    if (backAvailableWas != backAvailable())
         emit backAvailableChanged(backAvailable());
-    if (forwardAvailableWas)
+    if (forwardAvailableWas != forwardAvailable())
         emit forwardAvailableChanged(forwardAvailable());
     emit jumped(currentLink());
     qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << "page" << page
diff --git a/tests/auto/pdf/CMakeLists.txt b/tests/auto/pdf/CMakeLists.txt
index 8bda0c3c3a3..2f3f7396101 100644
--- a/tests/auto/pdf/CMakeLists.txt
+++ b/tests/auto/pdf/CMakeLists.txt
@@ -2,7 +2,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 
 add_subdirectory(qpdfbookmarkmodel)
-#add_subdirectory(qpdfpagenavigator)
+if (TARGET Qt::PdfWidgets)
+    add_subdirectory(qpdfpagenavigator)
+endif()
 add_subdirectory(qpdfpagerenderer)
 if(TARGET Qt::PrintSupport)
     add_subdirectory(qpdfdocument)
diff --git a/tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt b/tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt
new file mode 100644
index 00000000000..3e8b8f416f3
--- /dev/null
+++ b/tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qpdfpagenavigator.cpp
+    SOURCES
+        tst_qpdfpagenavigator.cpp
+    LIBRARIES
+        Qt::Gui
+        Qt::Network
+        Qt::Pdf
+        Qt::PdfWidgets
+    TESTDATA
+        pdf-sample.bookmarks_pages.pdf
+)
diff --git a/tests/auto/pdf/qpdfpagenavigator/pdf-sample.bookmarks_pages.pdf b/tests/auto/pdf/qpdfpagenavigator/pdf-sample.bookmarks_pages.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c4e1aa36e505aaa1636f7b5067cccb473f8cb58e
GIT binary patch
diff --git a/tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp b/tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp
new file mode 100644
index 00000000000..327a9f36a57
--- /dev/null
+++ b/tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+#include <QtTest/QtTest>
+
+#include <QPdfDocument>
+#include <QPdfView>
+#include <QPdfPageNavigator>
+
+class tst_QPdfPageNavigator: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void offScreenSignals();
+};
+
+void tst_QPdfPageNavigator::offScreenSignals()
+{
+    QPdfDocument document;
+    QPdfView pdfView;
+    QPdfPageNavigator *navigator = pdfView.pageNavigator();
+
+    QSignalSpy currentPageChanged(navigator, &QPdfPageNavigator::currentPageChanged);
+    QSignalSpy currentLocationChanged(navigator, &QPdfPageNavigator::currentLocationChanged);
+    QSignalSpy backAvailableChanged(navigator, &QPdfPageNavigator::backAvailableChanged);
+    QSignalSpy forwardAvailableChanged(navigator, &QPdfPageNavigator::forwardAvailableChanged);
+    QSignalSpy jumped(navigator, &QPdfPageNavigator::jumped);
+
+    QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks_pages.pdf")), QPdfDocument::Error::None);
+    QVERIFY2(document.pageCount() == 3, "Test document has changed! 3 pages expected.");
+    pdfView.setDocument(&document);
+
+    // Start with a clean history
+    QCOMPARE(forwardAvailableChanged.count(), 0);
+    QCOMPARE(backAvailableChanged.count(), 0);
+
+    navigator->jump(3, QPoint());
+    QCOMPARE(forwardAvailableChanged.count(), 0);
+    QCOMPARE(backAvailableChanged.count(), 1);
+    QCOMPARE(currentPageChanged.count(), 1);
+    QCOMPARE(currentLocationChanged.count(), 0);
+    QCOMPARE(jumped.count(), 1);
+
+    navigator->jump(1, QPoint());
+    QCOMPARE(forwardAvailableChanged.count(), 0);
+    QCOMPARE(backAvailableChanged.count(), 1);
+    QCOMPARE(currentPageChanged.count(), 2);
+    QCOMPARE(currentLocationChanged.count(), 0);
+    QCOMPARE(jumped.count(), 2);
+
+    navigator->back();
+    QCOMPARE(forwardAvailableChanged.count(), 1);
+    QCOMPARE(backAvailableChanged.count(), 1);
+    QCOMPARE(currentPageChanged.count(), 3);
+    QCOMPARE(currentLocationChanged.count(), 0);
+    QCOMPARE(jumped.count(), 3);
+
+    navigator->forward();
+    QCOMPARE(forwardAvailableChanged.count(), 2);
+    QCOMPARE(backAvailableChanged.count(), 1);
+    QCOMPARE(currentPageChanged.count(), 4);
+    QCOMPARE(currentLocationChanged.count(), 0);
+    QCOMPARE(jumped.count(), 4);
+}
+
+QTEST_MAIN(tst_QPdfPageNavigator)
+
+#include "tst_qpdfpagenavigator.moc"

From 4e273b2b305dcbf8967863af83e42c1a081a7d9c Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 7 Sep 2023 18:02:00 +0200
Subject: [PATCH 454/681] Band aid fix for crashing D3D11 Warp setup

Rhi can decide to run D3D11 with the software rendering
through the software adapter aka "Microsoft Basic Render Driver".
This unfortunately does not work well with ANGLE as it can
use another adapter and sharing resources between
qt and skia can fail.

Try to guess which adapter might be used by rhi support
or rhi backing store support classes and pass luid for ANGLE.

Unfortunately this solution is far from perfect as
it creates QRhi just to check what might be used later,
however the user can select something totally different with
QQuickGraphicsConfiguration.

At lest for now we respect QSG_RHI_PREFER_SOFTWARE_RENDERER
and QT_D3D_ADAPTER_INDEX. Moreover this patch should cover
the case when rhi retrys with DXGI_ADAPTER_FLAG_SOFTWARE adapter
if accelerated adapter fails.

This is just a band aid patch to support windows on vm
and we should come up with better solution.

Fixes: QTBUG-116445
Pick-to: 6.5.3
Change-Id: I416dd82d688726ce872dc276570fe455d733a48e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8cef10f4faa9f2a5982e3cb780100cbc62209b07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fd3fd9ea0cb669c29382a473cb6f0e763205a8a7)
---
 src/core/web_engine_context.cpp | 34 +++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index be462a22d57..973da88a708 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -4,6 +4,7 @@
 #include "web_engine_context.h"
 
 #include <math.h>
+#include <QtGui/private/qrhi_p.h>
 
 #include "base/base_switches.h"
 #include "base/bind.h"
@@ -177,6 +178,31 @@ bool usingSoftwareDynamicGL()
 #endif
 }
 
+#if defined(Q_OS_WIN)
+static QString getAdapterLuid() {
+    static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
+    QRhiD3D11InitParams rhiParams;
+    QRhi::Flags flags;
+    if (preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+    }
+    QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
+    // mimic what QSGRhiSupport and QBackingStoreRhi does
+    if (!rhi && !preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+        rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
+    }
+    if (rhi) {
+        const QRhiD3D11NativeHandles *handles =
+                static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
+        Q_ASSERT(handles);
+        return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
+    } else {
+        return QString();
+    }
+}
+#endif
+
 static bool openGLPlatformSupport()
 {
     return QGuiApplicationPrivate::platformIntegration()->hasCapability(
@@ -727,6 +753,14 @@ WebEngineContext::WebEngineContext()
     }
 #endif
 
+#if defined(Q_OS_WIN)
+    if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11) {
+        const QString luid = getAdapterLuid();
+        if (!luid.isEmpty())
+            parsedCommandLine->AppendSwitchASCII(switches::kUseAdapterLuid, luid.toStdString());
+    }
+#endif
+
     initializeFeatureList(parsedCommandLine, enableFeatures, disableFeatures);
 
     GLContextHelper::initialize();

From 886916e7b0a8b02198186117fd48945da40f108e Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Thu, 21 Sep 2023 13:45:32 +0200
Subject: [PATCH 455/681] Add some missing documentation

- Add docs of printRequested and fileSystemAccessRequested signals to
QWebEnginePage.
- HandleType and AccessFlags enums were missing from
QWebEngineFileSystemAccessRequest.

Pick-to: 6.5
Fixes: QTBUG-117119
Change-Id: Ib8057e9471830a09417924f34ef91a54de62c36d
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 50aafb2d4b6a0290987c725e3357386eb43790bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../api/qwebenginefilesystemaccessrequest.cpp | 19 ++++++++++++++++
 src/core/api/qwebenginepage.cpp               | 22 ++++++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/core/api/qwebenginefilesystemaccessrequest.cpp b/src/core/api/qwebenginefilesystemaccessrequest.cpp
index 6527e176650..3f901b671cf 100644
--- a/src/core/api/qwebenginefilesystemaccessrequest.cpp
+++ b/src/core/api/qwebenginefilesystemaccessrequest.cpp
@@ -27,6 +27,25 @@ QT_BEGIN_NAMESPACE
     either call accept() or reject().
 */
 
+/*!
+   \enum QWebEngineFileSystemAccessRequest::AccessFlag
+
+   This enum describes the type of the requested access: read, write or both. The options
+   can be OR-ed together from the following list:
+
+   \value Read
+   \value Write
+*/
+
+/*!
+   \enum QWebEngineFileSystemAccessRequest::HandleType
+
+   This enum describes the type of the requested file system entry.
+
+   \value File
+   \value Directory
+*/
+
 QWebEngineFileSystemAccessRequest::QWebEngineFileSystemAccessRequest(
         const QWebEngineFileSystemAccessRequest &other) = default;
 QWebEngineFileSystemAccessRequest &QWebEngineFileSystemAccessRequest::operator=(
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 96852c84906..bce5f1e89ae 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -613,6 +613,15 @@ void QWebEnginePagePrivate::runRegisterProtocolHandlerRequest(QWebEngineRegister
     Q_EMIT q->registerProtocolHandlerRequested(request);
 }
 
+/*!
+    \fn void QWebEnginePage::fileSystemAccessRequested(QWebEngineFileSystemAccessRequest request)
+    \since 6.4
+
+    This signal is emitted when the web page requests access to local files or directories.
+
+    The request object \a request can be used to accept or reject the request.
+*/
+
 void QWebEnginePagePrivate::runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest request)
 {
     Q_Q(QWebEnginePage);
@@ -1472,7 +1481,7 @@ void QWebEnginePagePrivate::contextMenuRequested(QWebEngineContextMenuRequest *d
 }
 
 /*!
-    \fn bool QWebEnginePage::navigationRequested(QWebEngineNavigationRequest &request)
+    \fn void QWebEnginePage::navigationRequested(QWebEngineNavigationRequest &request)
     \since 6.2
 
     This signal is emitted on navigation together with the call the acceptNavigationRequest().
@@ -1613,6 +1622,17 @@ void QWebEnginePagePrivate::setToolTip(const QString &toolTipText)
         view->setToolTip(toolTipText);
 }
 
+/*!
+    \fn void QWebEnginePage::printRequested()
+    \since 5.12
+
+    This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+    button of PDF viewer plugin.
+    Typically, the signal handler can simply call printToPdf().
+
+    \sa printToPdf()
+*/
+
 void QWebEnginePagePrivate::printRequested()
 {
     Q_Q(QWebEnginePage);

From b4ae631596d37b08aa57ca0e6d6ca889b69d7250 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 22 Sep 2023 13:04:46 +0200
Subject: [PATCH 456/681] Try stablizing tests

qmltests::WebEngineViewSingleFileUpload::test_acceptSingleFileSelection
and
tst_QWebEngineView::textSelectionOutOfInputField

Change-Id: Ica3e91f109ae2a43bff9cd25e0da7d363823a762
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit eeb5cdba78d0d64fd8bba4f0eb140f7e53ba6cfe)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 .../quick/qmltests/data/tst_filePicker.qml    | 12 ++++------
 .../qwebengineview/tst_qwebengineview.cpp     | 24 +++++++------------
 2 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 2d6a8870352..a7b59b2e9bb 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -11,7 +11,6 @@ TestWebEngineView {
     id: webEngineView
     width: 400
     height: 300
-    property var titleChanges: []
 
     function driveLetter() {
         if (Qt.platform.os !== "windows")
@@ -30,8 +29,6 @@ TestWebEngineView {
         signalName: "renderProcessTerminated"
     }
 
-    onTitleChanged: { titleChanges.push(webEngineView.title) }
-
     TestCase {
         id: testCase
         name: "WebEngineViewSingleFileUpload"
@@ -44,7 +41,6 @@ TestWebEngineView {
             FilePickerParams.nameFilters = []
             titleSpy.clear()
             terminationSpy.clear()
-            titleChanges = []
         }
 
         function cleanup() {
@@ -87,10 +83,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryCompare(FilePickerParams, "filePickerOpened", true);
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
 
 
             // Custom dialog
@@ -108,10 +104,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryVerify(function() { return finished; });
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
             webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
         }
 
@@ -242,10 +238,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryCompare(FilePickerParams, "filePickerOpened", true);
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
 
 
             // Custom dialog
@@ -263,10 +259,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryVerify(function() { return finished; });
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
             webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
         }
 
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index bd43a999cca..0e2e9d2bc3c 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -2316,22 +2316,19 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
 
     // Select text by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 1);
+    QTRY_COMPARE(selectionChangedSpy.size(), 1);
     QVERIFY(view.hasSelection());
     QCOMPARE(view.page()->selectedText(), QString("This is a text"));
 
     // Deselect text by mouse click
     QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 2);
+    QTRY_COMPARE(selectionChangedSpy.size(), 2);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 
     // Select text by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 3);
+    QTRY_COMPARE(selectionChangedSpy.size(), 3);
     QVERIFY(view.hasSelection());
     QCOMPARE(view.page()->selectedText(), QString("This is a text"));
 
@@ -2339,8 +2336,7 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
     view.hide();
     view.page()->setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
     view.show();
-    QVERIFY(loadFinishedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 4);
+    QTRY_COMPARE(selectionChangedSpy.size(), 4);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 
@@ -2363,31 +2359,27 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
 
     // Select the whole page by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 1);
+    QTRY_COMPARE(selectionChangedSpy.size(), 1);
     QVERIFY(view.hasSelection());
     QVERIFY(view.page()->selectedText().startsWith(QString("This is a text")));
 
     // Remove selection by clicking into an input field
     QPoint textInputCenter = elementCenter(view.page(), "input1");
     QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
-    QVERIFY(selectionChangedSpy.wait());
+    QTRY_COMPARE(selectionChangedSpy.size(), 2);
     QCOMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input1"));
-    QCOMPARE(selectionChangedSpy.size(), 2);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 
     // Select the content of the input field by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 3);
+    QTRY_COMPARE(selectionChangedSpy.size(), 3);
     QVERIFY(view.hasSelection());
     QCOMPARE(view.page()->selectedText(), QString("QtWebEngine"));
 
     // Deselect input field's text by mouse click
     QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 4);
+    QTRY_COMPARE(selectionChangedSpy.size(), 4);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 }

From 8e10131daddfda6560ff2863a418a411f1ff6581 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 25 Sep 2023 07:49:18 +0000
Subject: [PATCH 457/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I9cbdd464399d440cea93b2de8a1d7cda4184278f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index e62d555afec..1cfab95a61b 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: de5481c25c96ab7af5a51836a0f59733e6d0cadd
+    ref: 0210e74844d1d3d4fc1c26eb5c09d064b47279d9
     required: true
   ../qtpositioning:
-    ref: bfce8f643e38a56f8cfbf89cf651c836cfd135c7
+    ref: ac8a26f3eeb1a12b2b98621544a8b6f67517c8e9
     required: false
   ../qttools:
-    ref: 05e39aacf67dba6b77254f248bcd3a3abdb695d1
+    ref: 6bda3ea97d6e402ecd42cce0e197aa0f95d4ddc2
     required: false
   ../qtwebchannel:
-    ref: eb9c0d2e9be729f534539a15220983bc14620a15
+    ref: b9202819f0daaf5b2362e4c3b99ea5d20fbaabc1
     required: false

From ee0905b625e526e0474d3f28f9563258b23e2b7a Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Thu, 21 Sep 2023 13:45:32 +0200
Subject: [PATCH 458/681] Add some missing documentation

- Add docs of printRequested and fileSystemAccessRequested signals to
QWebEnginePage.
- HandleType and AccessFlags enums were missing from
QWebEngineFileSystemAccessRequest.

Fixes: QTBUG-117119
Change-Id: Ib8057e9471830a09417924f34ef91a54de62c36d
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 50aafb2d4b6a0290987c725e3357386eb43790bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 886916e7b0a8b02198186117fd48945da40f108e)
---
 .../api/qwebenginefilesystemaccessrequest.cpp | 19 ++++++++++++++++
 src/core/api/qwebenginepage.cpp               | 22 ++++++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/core/api/qwebenginefilesystemaccessrequest.cpp b/src/core/api/qwebenginefilesystemaccessrequest.cpp
index 6527e176650..3f901b671cf 100644
--- a/src/core/api/qwebenginefilesystemaccessrequest.cpp
+++ b/src/core/api/qwebenginefilesystemaccessrequest.cpp
@@ -27,6 +27,25 @@ QT_BEGIN_NAMESPACE
     either call accept() or reject().
 */
 
+/*!
+   \enum QWebEngineFileSystemAccessRequest::AccessFlag
+
+   This enum describes the type of the requested access: read, write or both. The options
+   can be OR-ed together from the following list:
+
+   \value Read
+   \value Write
+*/
+
+/*!
+   \enum QWebEngineFileSystemAccessRequest::HandleType
+
+   This enum describes the type of the requested file system entry.
+
+   \value File
+   \value Directory
+*/
+
 QWebEngineFileSystemAccessRequest::QWebEngineFileSystemAccessRequest(
         const QWebEngineFileSystemAccessRequest &other) = default;
 QWebEngineFileSystemAccessRequest &QWebEngineFileSystemAccessRequest::operator=(
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 53930bc67df..78021248cbc 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -510,6 +510,15 @@ void QWebEnginePagePrivate::runRegisterProtocolHandlerRequest(QWebEngineRegister
     Q_EMIT q->registerProtocolHandlerRequested(request);
 }
 
+/*!
+    \fn void QWebEnginePage::fileSystemAccessRequested(QWebEngineFileSystemAccessRequest request)
+    \since 6.4
+
+    This signal is emitted when the web page requests access to local files or directories.
+
+    The request object \a request can be used to accept or reject the request.
+*/
+
 void QWebEnginePagePrivate::runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest request)
 {
     Q_Q(QWebEnginePage);
@@ -1504,7 +1513,7 @@ void QWebEnginePagePrivate::contextMenuRequested(QWebEngineContextMenuRequest *d
 }
 
 /*!
-    \fn bool QWebEnginePage::navigationRequested(QWebEngineNavigationRequest &request)
+    \fn void QWebEnginePage::navigationRequested(QWebEngineNavigationRequest &request)
     \since 6.2
 
     This signal is emitted on navigation together with the call the acceptNavigationRequest().
@@ -1645,6 +1654,17 @@ void QWebEnginePagePrivate::setToolTip(const QString &toolTipText)
         view->setToolTip(toolTipText);
 }
 
+/*!
+    \fn void QWebEnginePage::printRequested()
+    \since 5.12
+
+    This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+    button of PDF viewer plugin.
+    Typically, the signal handler can simply call printToPdf().
+
+    \sa printToPdf()
+*/
+
 void QWebEnginePagePrivate::printRequested()
 {
     Q_Q(QWebEnginePage);

From 4dd9a070f66d92415eb2c8c4ff1cc61533e00ced Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 26 Sep 2023 07:24:31 +0000
Subject: [PATCH 459/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I3b4ec5aa435cf8a145c2348f4b41eaf4823453ea
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 1cfab95a61b..4e810b3060c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 0210e74844d1d3d4fc1c26eb5c09d064b47279d9
+    ref: 40023cfe37669e56b7bdaa4cce31b292d1229f21
     required: true
   ../qtpositioning:
-    ref: ac8a26f3eeb1a12b2b98621544a8b6f67517c8e9
+    ref: 835a621508ef9ae7f442231c5a8adb0bc25c0038
     required: false
   ../qttools:
-    ref: 6bda3ea97d6e402ecd42cce0e197aa0f95d4ddc2
+    ref: af1682ba4a982506bf0f8d08046909b3e55fe15d
     required: false
   ../qtwebchannel:
-    ref: b9202819f0daaf5b2362e4c3b99ea5d20fbaabc1
+    ref: 9490755d5224e05d35443dbd745baedcfa335bda
     required: false

From 439e01f7d1b27f9f5615dccb1f9028e4d0ec525b Mon Sep 17 00:00:00 2001
From: Jaishree Vyas <Jaishree.Vyas@qt.io>
Date: Wed, 6 Sep 2023 12:27:21 +0200
Subject: [PATCH 460/681] Doc: All overviews list categorization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The \generate list names are added for each categorized section with
some explanation. Here, calling the overviews as
explanations-(name of the section). The idea is to give general terms
instead of specific phrases like 'core' etc, for better understanding.

Task-number: QTBUG-115347
Change-Id: I6348c5c888d34503fe05c3975a129e98c0f04d0a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f256aff7948915009ced414ff03277612acf973d)
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
---
 src/core/doc/src/qtwebengine-deploying.qdoc | 1 +
 src/core/doc/src/qtwebengine-features.qdoc  | 1 +
 src/core/doc/src/qtwebengine-overview.qdoc  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index 7504965e30b..625570feee1 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -4,6 +4,7 @@
 /*!
     \page qtwebengine-deploying.html
     \title Deploying Qt WebEngine Applications
+    \ingroup explanations-webtechnologies
 
     The way to package and deploy applications varies between operating systems.
     For Windows and \macos, \l{The Windows Deployment Tool}{windeployqt} and
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 11de95d4440..29e7b0f061e 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -4,6 +4,7 @@
 /*!
     \page qtwebengine-features.html
     \title Qt WebEngine Features
+    \ingroup explanations-webtechnologies
 
     \brief Summarizes \QWE features.
 
diff --git a/src/core/doc/src/qtwebengine-overview.qdoc b/src/core/doc/src/qtwebengine-overview.qdoc
index b1e8ee3da6c..6eccc669e6a 100644
--- a/src/core/doc/src/qtwebengine-overview.qdoc
+++ b/src/core/doc/src/qtwebengine-overview.qdoc
@@ -4,6 +4,7 @@
 /*!
     \page qtwebengine-overview.html
     \title Qt WebEngine Overview
+    \ingroup explanations-webtechnologies
 
     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.

From b6dab34349405489f2adcf0cdcb42603e671233f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 27 Sep 2023 08:55:55 +0000
Subject: [PATCH 461/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Iaa76257c02fc3ec22a02c61adf44c5898571678b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 374e0daf0bb..f6b5fc5ecbf 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b00d6c447ccdeb482bab5951efcde4457bb0c151
+    ref: 2939750ba7cc9aebf94b8b0c7d5b8e0720aa3616
     required: true
   ../qtpositioning:
-    ref: fa1904651b7e024299ff60461c6ce42e1907ff9b
+    ref: 3674e2745dd3972f3e1e5a5e5fc708d0c6570861
     required: false
   ../qttools:
-    ref: 1c79fb14547d91d642d6aacd4668679050bb8401
+    ref: 96e35c08df354bcd5b1d21bc4ffab3ed34e50e05
     required: false
   ../qtwebchannel:
-    ref: 6f1401a2b2bcefd284afe0c565dbf81c8486da2c
+    ref: 527ab23eb1586264f8b0ad794c3506137671f3e8
     required: false

From 0f2ad606bac31f6fced47053a09f43bb051ece32 Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Mon, 25 Sep 2023 10:36:49 +0300
Subject: [PATCH 462/681] Bump version to 6.5.4

Change-Id: I6045117d15da45d5b4075a1bed93f89c2464239b
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index 2943a34cc2e..e710307cd33 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,3 +1,3 @@
-set(QT_REPO_MODULE_VERSION "6.5.3")
+set(QT_REPO_MODULE_VERSION "6.5.4")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")

From e0d15f313e6b9f03bceb39aba85acd9dbc5cbf91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Mon, 25 Sep 2023 16:37:54 +0200
Subject: [PATCH 463/681] Doc: Move PDF examples to UI Components category

Pick-to: 6.6.0 6.5
Change-Id: Id3279026fcc791a9bd5e3e51a7ba7dd3c4a6930c
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit d002a907b5c1016c166d1df0d027b4f391a7273b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 examples/pdf/multipage/doc/src/multipage.qdoc        | 2 +-
 examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/pdf/multipage/doc/src/multipage.qdoc b/examples/pdf/multipage/doc/src/multipage.qdoc
index b9fec15a9bd..fff8b0d11ab 100644
--- a/examples/pdf/multipage/doc/src/multipage.qdoc
+++ b/examples/pdf/multipage/doc/src/multipage.qdoc
@@ -5,7 +5,7 @@
     \example multipage
     \meta installpath pdf
     \ingroup qtpdf-examples
-    \examplecategory {Graphics & Multimedia}
+    \examplecategory {User Interface Components}
 
     \title PDF Multipage Viewer Example
     \brief A Qt Quick PDF viewer that allows scrolling through the pages.
diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index 0c9fa06a9ae..b56958a9f28 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -5,7 +5,7 @@
     \example pdfviewer
     \meta installpath pdfwidgets
     \ingroup qtpdf-examples
-    \examplecategory {Graphics & Multimedia}
+    \examplecategory {User Interface Components}
 
     \title PDF Viewer Widget Example
     \brief A widget-based PDF viewer that allows scrolling through the pages.

From 6558ebb7ecffd15d7a5856eeb4d39655d3dd0835 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 22 Sep 2023 13:04:46 +0200
Subject: [PATCH 464/681] Try stablizing tests

qmltests::WebEngineViewSingleFileUpload::test_acceptSingleFileSelection
and
tst_QWebEngineView::textSelectionOutOfInputField

Change-Id: Ica3e91f109ae2a43bff9cd25e0da7d363823a762
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit eeb5cdba78d0d64fd8bba4f0eb140f7e53ba6cfe)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b4ae631596d37b08aa57ca0e6d6ca889b69d7250)
---
 .../quick/qmltests/data/tst_filePicker.qml    | 12 ++++------
 .../qwebengineview/tst_qwebengineview.cpp     | 24 +++++++------------
 2 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 2d6a8870352..a7b59b2e9bb 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -11,7 +11,6 @@ TestWebEngineView {
     id: webEngineView
     width: 400
     height: 300
-    property var titleChanges: []
 
     function driveLetter() {
         if (Qt.platform.os !== "windows")
@@ -30,8 +29,6 @@ TestWebEngineView {
         signalName: "renderProcessTerminated"
     }
 
-    onTitleChanged: { titleChanges.push(webEngineView.title) }
-
     TestCase {
         id: testCase
         name: "WebEngineViewSingleFileUpload"
@@ -44,7 +41,6 @@ TestWebEngineView {
             FilePickerParams.nameFilters = []
             titleSpy.clear()
             terminationSpy.clear()
-            titleChanges = []
         }
 
         function cleanup() {
@@ -87,10 +83,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryCompare(FilePickerParams, "filePickerOpened", true);
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
 
 
             // Custom dialog
@@ -108,10 +104,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryVerify(function() { return finished; });
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
             webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
         }
 
@@ -242,10 +238,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryCompare(FilePickerParams, "filePickerOpened", true);
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
 
 
             // Custom dialog
@@ -263,10 +259,10 @@ TestWebEngineView {
 
             keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
             tryVerify(function() { return finished; });
+            tryCompare(webEngineView, "title", row.expected);
             webEngineView.url = Qt.resolvedUrl("about:blank");
             verify(webEngineView.waitForLoadSucceeded());
             tryCompare(webEngineView, "title", "about:blank");
-            compare(titleChanges[titleChanges.length-2], row.expected);
             webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
         }
 
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index a6739280131..3ee1a3644c8 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -2310,22 +2310,19 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
 
     // Select text by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 1);
+    QTRY_COMPARE(selectionChangedSpy.size(), 1);
     QVERIFY(view.hasSelection());
     QCOMPARE(view.page()->selectedText(), QString("This is a text"));
 
     // Deselect text by mouse click
     QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 2);
+    QTRY_COMPARE(selectionChangedSpy.size(), 2);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 
     // Select text by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 3);
+    QTRY_COMPARE(selectionChangedSpy.size(), 3);
     QVERIFY(view.hasSelection());
     QCOMPARE(view.page()->selectedText(), QString("This is a text"));
 
@@ -2333,8 +2330,7 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
     view.hide();
     view.page()->setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
     view.show();
-    QVERIFY(loadFinishedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 4);
+    QTRY_COMPARE(selectionChangedSpy.size(), 4);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 
@@ -2357,31 +2353,27 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
 
     // Select the whole page by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 1);
+    QTRY_COMPARE(selectionChangedSpy.size(), 1);
     QVERIFY(view.hasSelection());
     QVERIFY(view.page()->selectedText().startsWith(QString("This is a text")));
 
     // Remove selection by clicking into an input field
     QPoint textInputCenter = elementCenter(view.page(), "input1");
     QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
-    QVERIFY(selectionChangedSpy.wait());
+    QTRY_COMPARE(selectionChangedSpy.size(), 2);
     QCOMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input1"));
-    QCOMPARE(selectionChangedSpy.size(), 2);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 
     // Select the content of the input field by ctrl+a
     QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 3);
+    QTRY_COMPARE(selectionChangedSpy.size(), 3);
     QVERIFY(view.hasSelection());
     QCOMPARE(view.page()->selectedText(), QString("QtWebEngine"));
 
     // Deselect input field's text by mouse click
     QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
-    QVERIFY(selectionChangedSpy.wait());
-    QCOMPARE(selectionChangedSpy.size(), 4);
+    QTRY_COMPARE(selectionChangedSpy.size(), 4);
     QVERIFY(!view.hasSelection());
     QVERIFY(view.page()->selectedText().isEmpty());
 }

From a87695c8413890e06ea27abff84b15cd2a994754 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 21 Sep 2023 15:10:00 +0200
Subject: [PATCH 465/681] Fix Qt accessibility cache logging

The accessibility cache logging may crash:
- when logging an "insert" and the underlying Chromium accessibility
  objects are not yet created.
- when logging a "delete" and the underlying Chromium accessibility
  objects are already destructed.

BrowserAccessibilityManager::GetFromId() is not supposed to return
nullptr but it does with the QtWebEngine integration and it happens when
we try to access BrowserAccessibility too early or too late. Add check
to those BrowserAccessibilityInterface methods which use GetFromId().
These methods are called by the Qt logger on creation and destruction of
the BrowserAccessibilityInterface.

The logging can be enabled with the following environment variable:
QT_LOGGING_RULES="qt.accessibility.cache.debug=true"

Pick-to: 6.6.0 6.5
Change-Id: Ib97f0acb982b72a5602234bd5845749f69689e32
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3533fa83f4f3f3ee32dcd826dd16b625940e088d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_qt.cpp | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index 24c006dc5dc..adb6b873cc7 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -25,6 +25,8 @@ class BrowserAccessibilityQt
     BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node);
     ~BrowserAccessibilityQt();
 
+    bool isReady() const;
+
     QtWebEngineCore::BrowserAccessibilityInterface *interface = nullptr;
 };
 
@@ -144,6 +146,13 @@ BrowserAccessibilityQt::~BrowserAccessibilityQt()
         interface->destroy();
 }
 
+bool BrowserAccessibilityQt::isReady() const
+{
+    // FIXME: This is just a workaround, remove this when the commented out assert in
+    //        BrowserAccessibilityManager::GetFromID(int32_t id) gets fixed.
+    return manager()->GetFromID(node()->id()) != nullptr;
+}
+
 BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface)
     : q(chromiumInterface)
 {
@@ -169,6 +178,9 @@ void BrowserAccessibilityInterface::destroy()
 
 bool BrowserAccessibilityInterface::isValid() const
 {
+    if (!q->isReady())
+        return false;
+
     auto managerQt = static_cast<content::BrowserAccessibilityManagerQt *>(q->manager());
     return managerQt && managerQt->isValid();
 }
@@ -276,6 +288,9 @@ int BrowserAccessibilityInterface::indexOfChild(const QAccessibleInterface *ifac
 
 QString BrowserAccessibilityInterface::text(QAccessible::Text t) const
 {
+    if (!q->isReady())
+        return QString();
+
     switch (t) {
     case QAccessible::Name:
         return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kName));
@@ -297,7 +312,7 @@ void BrowserAccessibilityInterface::setText(QAccessible::Text t, const QString &
 
 QRect BrowserAccessibilityInterface::rect() const
 {
-    if (!q->manager()) // needed implicitly by GetScreenBoundsRect()
+    if (!q->manager() || !q->isReady()) // needed implicitly by GetScreenBoundsRect()
         return QRect();
     gfx::Rect bounds = q->GetUnclippedScreenBoundsRect();
     bounds = gfx::ScaleToRoundedRect(bounds, 1.f / q->manager()->device_scale_factor()); // FIXME: check
@@ -699,6 +714,11 @@ QAccessible::Role BrowserAccessibilityInterface::role() const
 QAccessible::State BrowserAccessibilityInterface::state() const
 {
     QAccessible::State state = QAccessible::State();
+    if (!q->isReady()) {
+        state.invalid = true;
+        return state;
+    }
+
     if (q->HasState(ax::mojom::State::kCollapsed))
         state.collapsed = true;
     if (q->HasState(ax::mojom::State::kDefault))

From 26429d10885e7203545d14878aa8619471b6b6a6 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 13 Sep 2023 10:54:18 +0200
Subject: [PATCH 466/681] Do more WE processing before returning to the Qt
 event-loop
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix a race-condition in our tests that the change exposed

Task-number: QTBUG-116478
Change-Id: Id21c6b0bc9934fdcb69bd85350f5f263a9b96914
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 .../api/qwebenginemessagepumpscheduler.cpp    |  9 +++++--
 .../api/qwebenginemessagepumpscheduler_p.h    |  3 ++-
 src/core/browser_main_parts_qt.cpp            | 10 +++++---
 .../qwebenginepage/tst_qwebenginepage.cpp     |  2 +-
 .../qwebengineview/tst_qwebengineview.cpp     | 24 +++++++++++--------
 5 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/src/core/api/qwebenginemessagepumpscheduler.cpp b/src/core/api/qwebenginemessagepumpscheduler.cpp
index 62244c787d7..a435e2c0c5a 100644
--- a/src/core/api/qwebenginemessagepumpscheduler.cpp
+++ b/src/core/api/qwebenginemessagepumpscheduler.cpp
@@ -11,9 +11,14 @@ QWebEngineMessagePumpScheduler::QWebEngineMessagePumpScheduler(std::function<voi
     : m_callback(std::move(callback))
 {}
 
-void QWebEngineMessagePumpScheduler::scheduleWork()
+void QWebEngineMessagePumpScheduler::scheduleImmediateWork()
 {
-    QCoreApplication::postEvent(this, new QTimerEvent(0));
+    QCoreApplication::postEvent(this, new QTimerEvent(0), Qt::NormalEventPriority);
+}
+
+void QWebEngineMessagePumpScheduler::scheduleIdleWork()
+{
+    QCoreApplication::postEvent(this, new QTimerEvent(0), Qt::LowEventPriority);
 }
 
 void QWebEngineMessagePumpScheduler::scheduleDelayedWork(int delay)
diff --git a/src/core/api/qwebenginemessagepumpscheduler_p.h b/src/core/api/qwebenginemessagepumpscheduler_p.h
index 7e84b4190af..4ec7ef1253e 100644
--- a/src/core/api/qwebenginemessagepumpscheduler_p.h
+++ b/src/core/api/qwebenginemessagepumpscheduler_p.h
@@ -28,7 +28,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QOb
     Q_OBJECT
 public:
     QWebEngineMessagePumpScheduler(std::function<void()> callback);
-    void scheduleWork();
+    void scheduleImmediateWork();
+    void scheduleIdleWork();
     void scheduleDelayedWork(int delay);
 
 protected:
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index e58822c29ce..93522d239dc 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -50,6 +50,7 @@
 #include "web_engine_context.h"
 #include "web_usb_detector_qt.h"
 
+#include <QDeadlineTimer>
 #include <QtGui/qtgui-config.h>
 #include <QStandardPaths>
 
@@ -120,7 +121,7 @@ class MessagePumpForUIQt : public base::MessagePump
     {
         // NOTE: This method may called from any thread at any time.
         ensureDelegate();
-        m_scheduler.scheduleWork();
+        m_scheduler.scheduleImmediateWork();
     }
 
     void ScheduleDelayedWork(const Delegate::NextWorkInfo &next_work_info) override
@@ -193,13 +194,16 @@ class MessagePumpForUIQt : public base::MessagePump
     {
         ScopedGLContextChecker glContextChecker;
 
+        QDeadlineTimer timer(std::chrono::milliseconds(2));
         base::MessagePump::Delegate::NextWorkInfo more_work_info = m_delegate->DoWork();
+        while (more_work_info.is_immediate() && !timer.hasExpired())
+            more_work_info = m_delegate->DoWork();
 
         if (more_work_info.is_immediate())
-            return ScheduleWork();
+            return m_scheduler.scheduleImmediateWork();
 
         if (m_delegate->DoIdleWork())
-            return ScheduleWork();
+            return m_scheduler.scheduleIdleWork();
 
         ScheduleDelayedWork(more_work_info.delayed_run_time);
     }
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index ba88fd99ebf..132cefb0480 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -3076,7 +3076,7 @@ void tst_QWebEnginePage::loadInSignalHandlers()
     URLSetter setter(m_page, signal, type, urlForSetter);
     QSignalSpy spy(&setter, &URLSetter::finished);
     m_page->load(url);
-    QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
+    QTRY_VERIFY_WITH_TIMEOUT(spy.size() >= 1, 20000);
     QCOMPARE(m_page->url(), urlForSetter);
 }
 
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 3ee1a3644c8..6dd75a7ebca 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -1354,18 +1354,20 @@ void tst_QWebEngineView::inputMethodsTextFormat_data()
 
 void tst_QWebEngineView::inputMethodsTextFormat()
 {
-    QWebEngineView view;
-    view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
-    QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
-
-    view.setHtml("<html><body>"
-                 " <input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>"
-                 "</body></html>");
+    QWebEnginePage page;
+    QWebEngineView view(&page);
+    page.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
+    QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+
+    page.setHtml(
+            "<html><body>"
+            " <input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>"
+            "</body></html>");
     QTRY_COMPARE(loadFinishedSpy.size(), 1);
 
-    evaluateJavaScriptSync(view.page(), "document.getElementById('input1').focus()");
     view.show();
     QVERIFY(QTest::qWaitForWindowExposed(&view));
+    evaluateJavaScriptSync(&page, "document.getElementById('input1').focus()");
 
     QFETCH(QString, string);
     QFETCH(int, start);
@@ -1389,8 +1391,10 @@ void tst_QWebEngineView::inputMethodsTextFormat()
     attrs.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format));
 
     QInputMethodEvent im(string, attrs);
-    QVERIFY(QApplication::sendEvent(view.focusProxy(), &im));
-    QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), string);
+    QApplication::sendEvent(view.focusProxy(), &im);
+    QTRY_COMPARE_WITH_TIMEOUT(
+            evaluateJavaScriptSync(&page, "document.getElementById('input1').value").toString(),
+            string, 20000);
 }
 
 void tst_QWebEngineView::keyboardEvents()

From ea1cb36bdad1a26e98f5909b5b13572114c48b52 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 26 Sep 2023 14:45:15 +0200
Subject: [PATCH 467/681] Handle initial NavigationEntries

Chromium introduced the Initial NavigationEntry that meant to
represent the initial empty document at FrameTree creation time.
It is just a placeholder entry put in the list of NavigationEntries
that gets replaced on the next navigation.
A side effect of this is that we have an extra entry in the list before
we load any page.

This change also reverts the history related tests modified by
106 Adaptations that introduced this behavior.

Fixes: QTBUG-117489
Pick-to: 6.5
Change-Id: I2738591b681082792544bd884f8ecec54ce9d72d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f19aa5e343db66e5baacacd3c360c4cb00a01c7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_contents_adapter.cpp             | 26 ++++++++++++++++---
 .../tst_qwebenginehistory.cpp                 |  4 +--
 .../qwebenginepage/tst_qwebenginepage.cpp     | 12 ++++-----
 3 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 7e13064b3be..fecafd4112d 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -210,10 +210,28 @@ static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsA
     return webContents;
 }
 
+static int navigationListSize(content::NavigationController &controller) {
+    // If we're currently on the initial NavigationEntry, no navigation has
+    // committed, so the initial NavigationEntry should not be part of the
+    // "Navigation List", and we should return 0 as the navigation list size.
+    if (controller.GetLastCommittedEntry()->IsInitialEntry())
+        return 0;
+    return controller.GetEntryCount();
+}
+
+static int navigationListCurrentIndex(content::NavigationController &controller) {
+    // If we're currently on the initial NavigationEntry, no navigation has
+    // committed, so the initial NavigationEntry should not be part of the
+    // "Navigation List", and we should return -1 as the current index.
+    if (controller.GetLastCommittedEntry()->IsInitialEntry())
+        return -1;
+    return controller.GetCurrentEntryIndex();
+}
+
 static void serializeNavigationHistory(content::NavigationController &controller, QDataStream &output)
 {
-    const int currentIndex = controller.GetCurrentEntryIndex();
-    const int count = controller.GetEntryCount();
+    const int currentIndex = navigationListCurrentIndex(controller);
+    const int count = navigationListSize(controller);
     const int pendingIndex = controller.GetPendingEntryIndex();
 
     output << kHistoryStreamVersion;
@@ -910,13 +928,13 @@ void WebContentsAdapter::navigateToOffset(int offset)
 int WebContentsAdapter::navigationEntryCount()
 {
     CHECK_INITIALIZED(0);
-    return m_webContents->GetController().GetEntryCount();
+    return navigationListSize(m_webContents->GetController());
 }
 
 int WebContentsAdapter::currentNavigationEntryIndex()
 {
     CHECK_INITIALIZED(0);
-    return m_webContents->GetController().GetCurrentEntryIndex();
+    return navigationListCurrentIndex(m_webContents->GetController());
 }
 
 QUrl WebContentsAdapter::getNavigationEntryOriginalUrl(int index)
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
index 6ddc031d5be..ad66e972c61 100644
--- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
+++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
@@ -487,9 +487,9 @@ void tst_QWebEngineHistory::clear()
 
     QWebEnginePage page2(this);
     QWebEngineHistory* hist2 = page2.history();
-    QCOMPARE(hist2->count(), 1);
+    QCOMPARE(hist2->count(), 0);
     hist2->clear();
-    QCOMPARE(hist2->count(), 1); // Do not change anything.
+    QCOMPARE(hist2->count(), 0); // Do not change anything.
 }
 
 void tst_QWebEngineHistory::historyItemFromDeletedPage()
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index c9bcb11bdb1..0c1fa5ae03a 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -2077,14 +2077,14 @@ void tst_QWebEnginePage::symmetricUrl()
 
     QVERIFY(view.url().isEmpty());
 
-    QCOMPARE(view.history()->count(), 1);
+    QCOMPARE(view.history()->count(), 0);
 
     QUrl dataUrl("data:text/html,<h1>Test");
 
     view.setUrl(dataUrl);
     view.show();
     QCOMPARE(view.url(), dataUrl);
-    QCOMPARE(view.history()->count(), 1);
+    QCOMPARE(view.history()->count(), 0);
 
     // loading is _not_ immediate, so the text isn't set just yet.
     QVERIFY(toPlainTextSync(view.page()).isEmpty());
@@ -2397,7 +2397,7 @@ void tst_QWebEnginePage::setHtmlWithBaseURL()
     QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128);
 
     // no history item has to be added.
-    QCOMPARE(m_view->page()->history()->count(), 1);
+    QCOMPARE(m_view->page()->history()->count(), 0);
 }
 
 class MyPage : public QWebEnginePage
@@ -2828,7 +2828,7 @@ void tst_QWebEnginePage::setUrlHistory()
     int expectedLoadFinishedCount = 0;
     QSignalSpy spy(m_page, SIGNAL(loadFinished(bool)));
 
-    QCOMPARE(m_page->history()->count(), 1);
+    QCOMPARE(m_page->history()->count(), 0);
 
     m_page->setUrl(QUrl());
     expectedLoadFinishedCount++;
@@ -2902,7 +2902,7 @@ void tst_QWebEnginePage::setUrlUsingStateObject()
     QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
     int expectedUrlChangeCount = 0;
 
-    QCOMPARE(m_page->history()->count(), 1);
+    QCOMPARE(m_page->history()->count(), 0);
 
     url = QUrl("qrc:/resources/test1.html");
     m_page->setUrl(url);
@@ -3712,7 +3712,7 @@ void tst_QWebEnginePage::openLinkInNewPage()
             QCOMPARE(page1.history()->count(), 1);
         else
             QCOMPARE(page1.history()->count(), 2);
-        QCOMPARE(page2.history()->count(), 1);
+        QCOMPARE(page2.history()->count(), 0);
         break;
     case Effect::LoadInOther:
         QTRY_COMPARE(page2.spy.size(), 1);

From 28b183a7623087e7a75d8d6b746d40467e894573 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Mon, 18 Sep 2023 15:56:57 +0200
Subject: [PATCH 468/681] Improve
 QWebEngineDownloadRequest::isSavePageDownload()

WebContentsImpl::IsSavable() decides which file formats are saveable,
but it allows this only for text-based files. All other files will go
around on the code path of downloading. MHTML (multipart) and PDF files
are saved like this, which means they aren't marked as isSavePageDownload.

Just simply set this flag if the save was requested by the user even if
it was a download.

This fixes the flag for saving MHTML and PDF files from context menu,
and leaves the flag false when a PDF download was initiated by the
button of the web UI.

Task-number: QTBUG-114859
Change-Id: Id65f26a96952c5a43876338ad37f40570e544f3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ba20f9e892746639ebf888ef2e86add8839c3631)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/download_manager_delegate_qt.cpp   | 38 +++++++++++++--------
 src/core/web_contents_adapter.cpp           |  2 +-
 src/core/web_contents_delegate_qt.h         |  6 ++--
 tests/auto/quick/qmltests/data/tst_save.qml | 21 ++++++++++++
 4 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 2838b59ff23..36551bc2995 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -102,10 +102,22 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
         return true;
     }
 
+    bool isSavePageDownload = false;
+    WebContentsAdapterClient *adapterClient = nullptr;
+    if (content::WebContents *webContents = content::DownloadItemUtils::GetWebContents(item)) {
+        WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate());
+        adapterClient = contentsDelegate->adapterClient();
+        if (contentsDelegate->savePageInfo()) {
+            // We end up here when saving non text-based files (MHTML, PDF or images)
+            isSavePageDownload = true;
+            // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
+            contentsDelegate->setSavePageInfo(nullptr);
+        }
+    }
+
     QString suggestedFilename = toQt(item->GetSuggestedFilename());
     QString mimeTypeString = toQt(item->GetMimeType());
 
-
     if (suggestedFilename.isEmpty())
         suggestedFilename = toQt(net::HttpContentDisposition(item->GetContentDisposition(), net::kCharsetLatin1).filename());
 
@@ -132,11 +144,6 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
     item->AddObserver(this);
     QList<ProfileAdapterClient*> clients = m_profileAdapter->clients();
     if (!clients.isEmpty()) {
-        content::WebContents *webContents = content::DownloadItemUtils::GetWebContents(item);
-        WebContentsAdapterClient *adapterClient = nullptr;
-        if (webContents)
-            adapterClient = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate())->adapterClient();
-
         Q_ASSERT(m_currentId == item->GetId());
         ProfileAdapterClient::DownloadItemInfo info = {
             item->GetId(),
@@ -150,7 +157,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
             false /* accepted */,
             false /* paused */,
             false /* done */,
-            false /* isSavePageDownload */,
+            isSavePageDownload,
             item->GetLastReason(),
             adapterClient,
             suggestedFilename,
@@ -220,12 +227,18 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
     if (clients.isEmpty())
         return;
 
+    bool acceptedByDefault = false;
+    QString suggestedFilePath;
+    ProfileAdapterClient::SavePageFormat suggestedSaveFormat = ProfileAdapterClient::UnknownSavePageFormat;
     WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(
             web_contents->GetDelegate());
-    const SavePageInfo &spi = contentsDelegate->savePageInfo();
+    if (SavePageInfo *spi = contentsDelegate->savePageInfo()) {
+        suggestedFilePath = spi->requestedFilePath;
+        suggestedSaveFormat = static_cast<ProfileAdapterClient::SavePageFormat>(spi->requestedFormat);
+        // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
+        contentsDelegate->setSavePageInfo(nullptr);
+    }
 
-    bool acceptedByDefault = false;
-    QString suggestedFilePath = spi.requestedFilePath;
     if (suggestedFilePath.isEmpty()) {
         suggestedFilePath = QFileInfo(toQt(suggested_path.AsUTF8Unsafe())).completeBaseName()
                 + QStringLiteral(".mhtml");
@@ -237,14 +250,9 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
         suggestedFilePath = downloadDir.absoluteFilePath(suggestedFilePath);
     }
 
-    ProfileAdapterClient::SavePageFormat suggestedSaveFormat
-            = static_cast<ProfileAdapterClient::SavePageFormat>(spi.requestedFormat);
     if (suggestedSaveFormat == ProfileAdapterClient::UnknownSavePageFormat)
         suggestedSaveFormat = ProfileAdapterClient::MimeHtmlSaveFormat;
 
-    // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
-    contentsDelegate->setSavePageInfo(SavePageInfo());
-
     WebContentsAdapterClient *adapterClient = nullptr;
     if (web_contents)
         adapterClient = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->adapterClient();
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index fecafd4112d..91a939bd2ab 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -772,7 +772,7 @@ void WebContentsAdapter::save(const QString &filePath, int savePageFormat)
 {
     CHECK_INITIALIZED();
     base::RecordAction(base::UserMetricsAction("SavePage"));
-    m_webContentsDelegate->setSavePageInfo(SavePageInfo(filePath, savePageFormat));
+    m_webContentsDelegate->setSavePageInfo(new SavePageInfo(filePath, savePageFormat));
     m_webContents->OnSavePage();
 }
 
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index d49380471a0..23115d1269d 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -139,8 +139,8 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
     void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture);
     FindTextHelper *findTextHelper();
 
-    void setSavePageInfo(const SavePageInfo &spi) { m_savePageInfo = spi; }
-    const SavePageInfo &savePageInfo() { return m_savePageInfo; }
+    void setSavePageInfo(SavePageInfo *spi) { m_savePageInfo.reset(spi); }
+    SavePageInfo *savePageInfo() { return m_savePageInfo.get(); }
 
     WebEngineSettings *webEngineSettings() const;
     WebContentsAdapter *webContentsAdapter() const;
@@ -180,7 +180,7 @@ class WebContentsDelegateQt : public content::WebContentsDelegate
 
     WebContentsAdapterClient *m_viewClient;
     QScopedPointer<FindTextHelper> m_findTextHelper;
-    SavePageInfo m_savePageInfo;
+    std::unique_ptr<SavePageInfo> m_savePageInfo;
     QSharedPointer<FilePickerController> m_filePickerController;
     LoadingState m_loadingState;
     FrameFocusedObserver m_frameFocusedObserver;
diff --git a/tests/auto/quick/qmltests/data/tst_save.qml b/tests/auto/quick/qmltests/data/tst_save.qml
index 9757f8fac6d..f07a5f212a2 100644
--- a/tests/auto/quick/qmltests/data/tst_save.qml
+++ b/tests/auto/quick/qmltests/data/tst_save.qml
@@ -14,6 +14,7 @@ TestWebEngineView {
     property int receivedBytes: 0
     property string downloadDir: ""
     property string downloadFileName: ""
+    property bool isSavePageDownload: false
     property var downloadState: []
     property int savePageFormat: WebEngineDownloadRequest.MimeHtmlSaveFormat;
 
@@ -42,6 +43,7 @@ TestWebEngineView {
             savePageFormat = download.savePageFormat
             downloadDir = download.downloadDirectory;
             downloadFileName = download.downloadFileName
+            isSavePageDownload = download.isSavePageDownload
         }
         onDownloadFinished: function(download) {
             receivedBytes = download.receivedBytes
@@ -73,6 +75,7 @@ TestWebEngineView {
             receivedBytes = 0
             downloadDir = ""
             downloadFileName = ""
+            isSavePageDownload = false
             downloadState = []
             downloadUrl = ""
         }
@@ -104,6 +107,7 @@ TestWebEngineView {
             compare(savePageFormat, saveFormat)
             compare(downloadDir, fileDir)
             compare(downloadFileName, fileName)
+            compare(isSavePageDownload, true)
             compare(downloadState[0], WebEngineDownloadRequest.DownloadInProgress)
             downloadFinishedSpy.wait()
             compare(downloadFinishedSpy.count, 1)
@@ -119,5 +123,22 @@ TestWebEngineView {
             verify(webEngineView.waitForLoadSucceeded())
             verify(verifyData())
         }
+
+        function test_saveImage() {
+            var fileDir = tempDir.path()
+            var fileName = "favicon.png"
+            var filePath = fileDir + "/"+ fileName
+
+            // Load an image
+            webEngineView.url = Qt.resolvedUrl("icons/favicon.png")
+            verify(webEngineView.waitForLoadSucceeded())
+
+            webEngineView.save(filePath)
+            downLoadRequestedSpy.wait()
+            compare(downLoadRequestedSpy.count, 1)
+            compare(downloadUrl, webEngineView.url)
+            compare(isSavePageDownload, true)
+            compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested)
+        }
     }
 }

From f235ebd6ff1a2c211df5453046c7a01d24e3fa18 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 13 Sep 2023 10:54:18 +0200
Subject: [PATCH 469/681] Do more WE processing before returning to the Qt
 event-loop

Fix a race-condition in our tests that the change exposed

Task-number: QTBUG-116478
Change-Id: Id21c6b0bc9934fdcb69bd85350f5f263a9b96914
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3cbb895954e0d22efc20700a1e66413a8a483124)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginemessagepumpscheduler.cpp   |  9 +++++++--
 src/core/api/qwebenginemessagepumpscheduler_p.h   |  3 ++-
 src/core/browser_main_parts_qt.cpp                | 10 +++++++---
 tests/auto/core/origins/tst_origins.cpp           |  8 ++++----
 .../widgets/qwebenginepage/tst_qwebenginepage.cpp |  4 ++--
 .../widgets/qwebengineview/tst_qwebengineview.cpp | 15 ++++++++-------
 6 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/src/core/api/qwebenginemessagepumpscheduler.cpp b/src/core/api/qwebenginemessagepumpscheduler.cpp
index 62244c787d7..a435e2c0c5a 100644
--- a/src/core/api/qwebenginemessagepumpscheduler.cpp
+++ b/src/core/api/qwebenginemessagepumpscheduler.cpp
@@ -11,9 +11,14 @@ QWebEngineMessagePumpScheduler::QWebEngineMessagePumpScheduler(std::function<voi
     : m_callback(std::move(callback))
 {}
 
-void QWebEngineMessagePumpScheduler::scheduleWork()
+void QWebEngineMessagePumpScheduler::scheduleImmediateWork()
 {
-    QCoreApplication::postEvent(this, new QTimerEvent(0));
+    QCoreApplication::postEvent(this, new QTimerEvent(0), Qt::NormalEventPriority);
+}
+
+void QWebEngineMessagePumpScheduler::scheduleIdleWork()
+{
+    QCoreApplication::postEvent(this, new QTimerEvent(0), Qt::LowEventPriority);
 }
 
 void QWebEngineMessagePumpScheduler::scheduleDelayedWork(int delay)
diff --git a/src/core/api/qwebenginemessagepumpscheduler_p.h b/src/core/api/qwebenginemessagepumpscheduler_p.h
index 7e84b4190af..4ec7ef1253e 100644
--- a/src/core/api/qwebenginemessagepumpscheduler_p.h
+++ b/src/core/api/qwebenginemessagepumpscheduler_p.h
@@ -28,7 +28,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QOb
     Q_OBJECT
 public:
     QWebEngineMessagePumpScheduler(std::function<void()> callback);
-    void scheduleWork();
+    void scheduleImmediateWork();
+    void scheduleIdleWork();
     void scheduleDelayedWork(int delay);
 
 protected:
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index 16952d7cdf9..9cdce0eeb6c 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -50,6 +50,7 @@
 #include "web_engine_context.h"
 #include "web_usb_detector_qt.h"
 
+#include <QDeadlineTimer>
 #include <QtGui/qtgui-config.h>
 #include <QStandardPaths>
 
@@ -121,7 +122,7 @@ class MessagePumpForUIQt : public base::MessagePump
     {
         // NOTE: This method may called from any thread at any time.
         ensureDelegate();
-        m_scheduler.scheduleWork();
+        m_scheduler.scheduleImmediateWork();
     }
 
     void ScheduleDelayedWork(const Delegate::NextWorkInfo &next_work_info) override
@@ -194,13 +195,16 @@ class MessagePumpForUIQt : public base::MessagePump
     {
         ScopedGLContextChecker glContextChecker;
 
+        QDeadlineTimer timer(std::chrono::milliseconds(2));
         base::MessagePump::Delegate::NextWorkInfo more_work_info = m_delegate->DoWork();
+        while (more_work_info.is_immediate() && !timer.hasExpired())
+            more_work_info = m_delegate->DoWork();
 
         if (more_work_info.is_immediate())
-            return ScheduleWork();
+            return m_scheduler.scheduleImmediateWork();
 
         if (m_delegate->DoIdleWork())
-            return ScheduleWork();
+            return m_scheduler.scheduleIdleWork();
 
         ScheduleDelayedWork(more_work_info.delayed_run_time);
     }
diff --git a/tests/auto/core/origins/tst_origins.cpp b/tests/auto/core/origins/tst_origins.cpp
index c77a4bc26a6..091ce865119 100644
--- a/tests/auto/core/origins/tst_origins.cpp
+++ b/tests/auto/core/origins/tst_origins.cpp
@@ -1692,11 +1692,11 @@ void tst_Origins::fetchApiCustomUrl()
     }
 
     page.load(url);
-    QVERIFY(loadSpy.wait());
+    QTRY_VERIFY(loadSpy.count() > 0);
     QTRY_COMPARE(handler.fetchWasAllowed, expectedFetchWasAllowed);
 
     if (fetchApiScheme == "fetchapi-not-allowed") {
-        QVERIFY(jsSpy.wait());
+        QTRY_VERIFY(jsSpy.count() > 0);
     }
 }
 
@@ -1722,8 +1722,8 @@ void tst_Origins::fetchApiHttpUrl()
             + httpServer.url("/somepage.html").toEncoded();
     page.load(QUrl(fullUrl));
 
-    QVERIFY(loadSpy.wait());
-    QVERIFY(jsSpy.wait());
+    QTRY_VERIFY(loadSpy.count() > 0);
+    QTRY_VERIFY(jsSpy.count() > 0);
     QVERIFY(httpServer.stop());
 }
 
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 0c1fa5ae03a..f3515b06002 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1362,7 +1362,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove_data()
 void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
 {
     QWebEngineView view;
-    Q_ASSERT(QGuiApplication::primaryScreen());
+    QTRY_VERIFY(QGuiApplication::primaryScreen());
     view.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft());
     view.resize(640, 480);
     view.show();
@@ -3081,7 +3081,7 @@ void tst_QWebEnginePage::loadInSignalHandlers()
     URLSetter setter(m_page, signal, type, urlForSetter);
     QSignalSpy spy(&setter, &URLSetter::finished);
     m_page->load(url);
-    QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
+    QTRY_VERIFY_WITH_TIMEOUT(spy.size() >= 1, 20000);
     QCOMPARE(m_page->url(), urlForSetter);
 }
 
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 0e2e9d2bc3c..47874c791c3 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -1360,18 +1360,19 @@ void tst_QWebEngineView::inputMethodsTextFormat_data()
 
 void tst_QWebEngineView::inputMethodsTextFormat()
 {
-    QWebEngineView view;
-    view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
-    QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
+    QWebEnginePage page;
+    QWebEngineView view(&page);
+    page.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
+    QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
 
-    view.setHtml("<html><body>"
+    page.setHtml("<html><body>"
                  " <input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>"
                  "</body></html>");
     QTRY_COMPARE(loadFinishedSpy.size(), 1);
 
-    evaluateJavaScriptSync(view.page(), "document.getElementById('input1').focus()");
     view.show();
     QVERIFY(QTest::qWaitForWindowExposed(&view));
+    evaluateJavaScriptSync(&page, "document.getElementById('input1').focus()");
 
     QFETCH(QString, string);
     QFETCH(int, start);
@@ -1395,8 +1396,8 @@ void tst_QWebEngineView::inputMethodsTextFormat()
     attrs.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format));
 
     QInputMethodEvent im(string, attrs);
-    QVERIFY(QApplication::sendEvent(view.focusProxy(), &im));
-    QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), string);
+    QApplication::sendEvent(view.focusProxy(), &im);
+    QTRY_COMPARE_WITH_TIMEOUT(evaluateJavaScriptSync(&page, "document.getElementById('input1').value").toString(), string, 20000);
 }
 
 void tst_QWebEngineView::keyboardEvents()

From 4db36749991a58b70c132a735bd98bff0616b4df Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 2 Oct 2023 17:14:04 +0000
Subject: [PATCH 470/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I721284f81b399d0bb2270c871398c3076181d3d9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 4e810b3060c..be67bd3275e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 40023cfe37669e56b7bdaa4cce31b292d1229f21
+    ref: 4231d46ae19f283b7b8e817098e82d39e680bf47
     required: true
   ../qtpositioning:
-    ref: 835a621508ef9ae7f442231c5a8adb0bc25c0038
+    ref: 78769e983e8e2dbdaadc75d2e2f48248d6e7eacc
     required: false
   ../qttools:
-    ref: af1682ba4a982506bf0f8d08046909b3e55fe15d
+    ref: 9f8d3abbaaeba2274ded4403e363c9c44ec9502a
     required: false
   ../qtwebchannel:
-    ref: 9490755d5224e05d35443dbd745baedcfa335bda
+    ref: 98085b09395d8dc35fa8e066d55af4962c457698
     required: false

From 4aaddd7fa20723efe5c9d50c580675a73373b06a Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 26 Sep 2023 14:45:15 +0200
Subject: [PATCH 471/681] Handle initial NavigationEntries

Chromium introduced the Initial NavigationEntry that meant to
represent the initial empty document at FrameTree creation time.
It is just a placeholder entry put in the list of NavigationEntries
that gets replaced on the next navigation.
A side effect of this is that we have an extra entry in the list before
we load any page.

This change also reverts the history related tests modified by
106 Adaptations that introduced this behavior.

Fixes: QTBUG-117489
Change-Id: I2738591b681082792544bd884f8ecec54ce9d72d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f19aa5e343db66e5baacacd3c360c4cb00a01c7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ea1cb36bdad1a26e98f5909b5b13572114c48b52)
---
 src/core/web_contents_adapter.cpp             | 26 ++++++++++++++++---
 .../tst_qwebenginehistory.cpp                 |  4 +--
 .../qwebenginepage/tst_qwebenginepage.cpp     | 12 ++++-----
 3 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 37f3b13aced..62fff5ad5b7 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -210,10 +210,28 @@ static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsA
     return webContents;
 }
 
+static int navigationListSize(content::NavigationController &controller) {
+    // If we're currently on the initial NavigationEntry, no navigation has
+    // committed, so the initial NavigationEntry should not be part of the
+    // "Navigation List", and we should return 0 as the navigation list size.
+    if (controller.GetLastCommittedEntry()->IsInitialEntry())
+        return 0;
+    return controller.GetEntryCount();
+}
+
+static int navigationListCurrentIndex(content::NavigationController &controller) {
+    // If we're currently on the initial NavigationEntry, no navigation has
+    // committed, so the initial NavigationEntry should not be part of the
+    // "Navigation List", and we should return -1 as the current index.
+    if (controller.GetLastCommittedEntry()->IsInitialEntry())
+        return -1;
+    return controller.GetCurrentEntryIndex();
+}
+
 static void serializeNavigationHistory(content::NavigationController &controller, QDataStream &output)
 {
-    const int currentIndex = controller.GetCurrentEntryIndex();
-    const int count = controller.GetEntryCount();
+    const int currentIndex = navigationListCurrentIndex(controller);
+    const int count = navigationListSize(controller);
     const int pendingIndex = controller.GetPendingEntryIndex();
 
     output << kHistoryStreamVersion;
@@ -909,13 +927,13 @@ void WebContentsAdapter::navigateToOffset(int offset)
 int WebContentsAdapter::navigationEntryCount()
 {
     CHECK_INITIALIZED(0);
-    return m_webContents->GetController().GetEntryCount();
+    return navigationListSize(m_webContents->GetController());
 }
 
 int WebContentsAdapter::currentNavigationEntryIndex()
 {
     CHECK_INITIALIZED(0);
-    return m_webContents->GetController().GetCurrentEntryIndex();
+    return navigationListCurrentIndex(m_webContents->GetController());
 }
 
 QUrl WebContentsAdapter::getNavigationEntryOriginalUrl(int index)
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
index 6ddc031d5be..ad66e972c61 100644
--- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
+++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
@@ -487,9 +487,9 @@ void tst_QWebEngineHistory::clear()
 
     QWebEnginePage page2(this);
     QWebEngineHistory* hist2 = page2.history();
-    QCOMPARE(hist2->count(), 1);
+    QCOMPARE(hist2->count(), 0);
     hist2->clear();
-    QCOMPARE(hist2->count(), 1); // Do not change anything.
+    QCOMPARE(hist2->count(), 0); // Do not change anything.
 }
 
 void tst_QWebEngineHistory::historyItemFromDeletedPage()
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 132cefb0480..c943f0199b5 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -2072,14 +2072,14 @@ void tst_QWebEnginePage::symmetricUrl()
 
     QVERIFY(view.url().isEmpty());
 
-    QCOMPARE(view.history()->count(), 1);
+    QCOMPARE(view.history()->count(), 0);
 
     QUrl dataUrl("data:text/html,<h1>Test");
 
     view.setUrl(dataUrl);
     view.show();
     QCOMPARE(view.url(), dataUrl);
-    QCOMPARE(view.history()->count(), 1);
+    QCOMPARE(view.history()->count(), 0);
 
     // loading is _not_ immediate, so the text isn't set just yet.
     QVERIFY(toPlainTextSync(view.page()).isEmpty());
@@ -2392,7 +2392,7 @@ void tst_QWebEnginePage::setHtmlWithBaseURL()
     QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128);
 
     // no history item has to be added.
-    QCOMPARE(m_view->page()->history()->count(), 1);
+    QCOMPARE(m_view->page()->history()->count(), 0);
 }
 
 class MyPage : public QWebEnginePage
@@ -2823,7 +2823,7 @@ void tst_QWebEnginePage::setUrlHistory()
     int expectedLoadFinishedCount = 0;
     QSignalSpy spy(m_page, SIGNAL(loadFinished(bool)));
 
-    QCOMPARE(m_page->history()->count(), 1);
+    QCOMPARE(m_page->history()->count(), 0);
 
     m_page->setUrl(QUrl());
     expectedLoadFinishedCount++;
@@ -2897,7 +2897,7 @@ void tst_QWebEnginePage::setUrlUsingStateObject()
     QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
     int expectedUrlChangeCount = 0;
 
-    QCOMPARE(m_page->history()->count(), 1);
+    QCOMPARE(m_page->history()->count(), 0);
 
     url = QUrl("qrc:/resources/test1.html");
     m_page->setUrl(url);
@@ -3722,7 +3722,7 @@ void tst_QWebEnginePage::openLinkInNewPage()
             QCOMPARE(page1.history()->count(), 1);
         else
             QCOMPARE(page1.history()->count(), 2);
-        QCOMPARE(page2.history()->count(), 1);
+        QCOMPARE(page2.history()->count(), 0);
         break;
     case Effect::LoadInOther:
         QTRY_COMPARE(page2.spy.size(), 1);

From 3982c41844ed26950000f6f3beb0e6e35a697836 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 29 Sep 2023 13:18:39 +0200
Subject: [PATCH 472/681] Support filePath argument of save() when saving
 non-HTML files

Currently the filePath argument of QWebEnginePage::save() is ignored
when the user tries to download anything but HTML; and the requested
download path is the Downloads folder of the OS.

Fix this and adjust the corresponding test case with checking path
and file name of the download request.

Task-number: QTBUG-117624
Change-Id: Ia1d3afc898b1aad223aab772b775724a50e88bd3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b8ee80acdadefff927ed2c2884e0e67c9c2fc9a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/download_manager_delegate_qt.cpp   | 18 +++++++++++++++---
 tests/auto/quick/qmltests/data/tst_save.qml |  2 ++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 36551bc2995..7ce5bdf4d13 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -102,22 +102,33 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
         return true;
     }
 
+    QString suggestedFilePath;
+    QString suggestedFilename;
     bool isSavePageDownload = false;
     WebContentsAdapterClient *adapterClient = nullptr;
     if (content::WebContents *webContents = content::DownloadItemUtils::GetWebContents(item)) {
         WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate());
         adapterClient = contentsDelegate->adapterClient();
-        if (contentsDelegate->savePageInfo()) {
+        if (SavePageInfo *spi = contentsDelegate->savePageInfo()) {
             // We end up here when saving non text-based files (MHTML, PDF or images)
+            suggestedFilePath = spi->requestedFilePath;
+            const QFileInfo fileInfo(suggestedFilePath);
+            if (fileInfo.isRelative()) {
+                const QDir downloadDir(m_profileAdapter->downloadPath());
+                suggestedFilePath = downloadDir.absoluteFilePath(suggestedFilePath);
+            }
+            suggestedFilename = fileInfo.fileName();
             isSavePageDownload = true;
             // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
             contentsDelegate->setSavePageInfo(nullptr);
         }
     }
 
-    QString suggestedFilename = toQt(item->GetSuggestedFilename());
     QString mimeTypeString = toQt(item->GetMimeType());
 
+    if (suggestedFilename.isEmpty())
+        suggestedFilename = toQt(item->GetSuggestedFilename());
+
     if (suggestedFilename.isEmpty())
         suggestedFilename = toQt(net::HttpContentDisposition(item->GetContentDisposition(), net::kCharsetLatin1).filename());
 
@@ -139,7 +150,8 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
 
     QDir defaultDownloadDirectory(m_profileAdapter->downloadPath());
 
-    QString suggestedFilePath = m_profileAdapter->determineDownloadPath(defaultDownloadDirectory.absolutePath(), suggestedFilename, item->GetStartTime().ToTimeT());
+    if (suggestedFilePath.isEmpty())
+        suggestedFilePath = m_profileAdapter->determineDownloadPath(defaultDownloadDirectory.absolutePath(), suggestedFilename, item->GetStartTime().ToTimeT());
 
     item->AddObserver(this);
     QList<ProfileAdapterClient*> clients = m_profileAdapter->clients();
diff --git a/tests/auto/quick/qmltests/data/tst_save.qml b/tests/auto/quick/qmltests/data/tst_save.qml
index f07a5f212a2..08d99022ae2 100644
--- a/tests/auto/quick/qmltests/data/tst_save.qml
+++ b/tests/auto/quick/qmltests/data/tst_save.qml
@@ -137,6 +137,8 @@ TestWebEngineView {
             downLoadRequestedSpy.wait()
             compare(downLoadRequestedSpy.count, 1)
             compare(downloadUrl, webEngineView.url)
+            compare(downloadDir, fileDir)
+            compare(downloadFileName, fileName)
             compare(isSavePageDownload, true)
             compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested)
         }

From e50e621d70af9cf5f8f8c9269199b719759107f7 Mon Sep 17 00:00:00 2001
From: Jaishree Vyas <Jaishree.Vyas@qt.io>
Date: Wed, 6 Sep 2023 12:27:21 +0200
Subject: [PATCH 473/681] Doc: All overviews list categorization

The \generate list names are added for each categorized section with
some explanation. Here, calling the overviews as
explanations-(name of the section). The idea is to give general terms
instead of specific phrases like 'core' etc, for better understanding.

Task-number: QTBUG-115347
Change-Id: I6348c5c888d34503fe05c3975a129e98c0f04d0a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
---
 src/core/doc/src/qtwebengine-deploying.qdoc | 1 +
 src/core/doc/src/qtwebengine-features.qdoc  | 1 +
 src/core/doc/src/qtwebengine-overview.qdoc  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index eb84708514c..035800d9d5b 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -4,6 +4,7 @@
 /*!
     \page qtwebengine-deploying.html
     \title Deploying Qt WebEngine Applications
+    \ingroup explanations-webtechnologies
 
     The way to package and deploy applications varies between operating systems.
     For Windows and \macos, \l{The Windows Deployment Tool}{windeployqt} and
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 3d6d0fea8c7..c55c5bbeffd 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -4,6 +4,7 @@
 /*!
     \page qtwebengine-features.html
     \title Qt WebEngine Features
+    \ingroup explanations-webtechnologies
 
     \brief Summarizes \QWE features.
 
diff --git a/src/core/doc/src/qtwebengine-overview.qdoc b/src/core/doc/src/qtwebengine-overview.qdoc
index b1e8ee3da6c..6eccc669e6a 100644
--- a/src/core/doc/src/qtwebengine-overview.qdoc
+++ b/src/core/doc/src/qtwebengine-overview.qdoc
@@ -4,6 +4,7 @@
 /*!
     \page qtwebengine-overview.html
     \title Qt WebEngine Overview
+    \ingroup explanations-webtechnologies
 
     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.

From fc20971f77e28415a0456dbc5eb401db7140fc83 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 4 Oct 2023 08:25:05 +0000
Subject: [PATCH 474/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I9c8e6e816b4374dd1b8118a329fa12f7bc6cf0ad
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index f6b5fc5ecbf..0dc1b083154 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 2939750ba7cc9aebf94b8b0c7d5b8e0720aa3616
+    ref: 3f3e7127861ee51916368073249450ef6f92ee18
     required: true
   ../qtpositioning:
-    ref: 3674e2745dd3972f3e1e5a5e5fc708d0c6570861
+    ref: 2ec5ee03ce22e4b1862fac9a7dd5809e6d1a1b2e
     required: false
   ../qttools:
-    ref: 96e35c08df354bcd5b1d21bc4ffab3ed34e50e05
+    ref: 3074a1fd98d542149a56574d3f0a846fc91d078a
     required: false
   ../qtwebchannel:
-    ref: 527ab23eb1586264f8b0ad794c3506137671f3e8
+    ref: 7a2de060c200820e16be88955912a1461caf6233
     required: false

From ff1fc8044f85b5a7c0c25eb219609a14678b0aad Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 3 Oct 2023 22:02:36 +0000
Subject: [PATCH 475/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ic706b5cc0048add67e901f0205e61f94d1162692
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index be67bd3275e..8e9b6296af9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4231d46ae19f283b7b8e817098e82d39e680bf47
+    ref: 8c5682fd59a3299da8c231a6e6ee88d0cf2bf1ba
     required: true
   ../qtpositioning:
-    ref: 78769e983e8e2dbdaadc75d2e2f48248d6e7eacc
+    ref: da7bc2544779f4bcfa021c4be884373100ed8886
     required: false
   ../qttools:
-    ref: 9f8d3abbaaeba2274ded4403e363c9c44ec9502a
+    ref: 5bab0570e6ec382e6b061658c9ab081563d011b3
     required: false
   ../qtwebchannel:
-    ref: 98085b09395d8dc35fa8e066d55af4962c457698
+    ref: 82094d14834b3acc0a99051d1aeae704dc53d29a
     required: false

From 2ada572d742d02e5f17005c1ad403236c203de67 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 29 Sep 2023 14:28:34 +0200
Subject: [PATCH 476/681] Support auto accepting non-HTML saves when a path was
 specified

Images and PDFs had to be explicitly accepted to download, even if a
filePath was given as argument of QWebEnginePage::save(). This behavior
was inconsistent with saving HTML pages (and the documentation).

Adjust the corresponding test case with verifying the download result
of an auto-accepted download, and add a new test case to make sure about
downloads are not accepted by default when there is no desired filePath.

Task-number: QTBUG-117624
Change-Id: I90f4cfa485da2831327bcb25571a0b69499d9006
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7406d087d4fb9bed86d3a79c1539edab7a0f8842)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/download_manager_delegate_qt.cpp   |  7 ++++++-
 tests/auto/quick/qmltests/data/tst_save.qml | 20 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 7ce5bdf4d13..1f66bbf5155 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -102,6 +102,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
         return true;
     }
 
+    bool acceptedByDefault = false;
     QString suggestedFilePath;
     QString suggestedFilename;
     bool isSavePageDownload = false;
@@ -118,7 +119,11 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
                 suggestedFilePath = downloadDir.absoluteFilePath(suggestedFilePath);
             }
             suggestedFilename = fileInfo.fileName();
+
+            if (!suggestedFilePath.isEmpty() && !suggestedFilename.isEmpty())
+                acceptedByDefault = true;
             isSavePageDownload = true;
+
             // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
             contentsDelegate->setSavePageInfo(nullptr);
         }
@@ -166,7 +171,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
             mimeTypeString,
             suggestedFilePath,
             ProfileAdapterClient::UnknownSavePageFormat,
-            false /* accepted */,
+            acceptedByDefault,
             false /* paused */,
             false /* done */,
             isSavePageDownload,
diff --git a/tests/auto/quick/qmltests/data/tst_save.qml b/tests/auto/quick/qmltests/data/tst_save.qml
index 08d99022ae2..e9e6d5d836a 100644
--- a/tests/auto/quick/qmltests/data/tst_save.qml
+++ b/tests/auto/quick/qmltests/data/tst_save.qml
@@ -140,6 +140,26 @@ TestWebEngineView {
             compare(downloadDir, fileDir)
             compare(downloadFileName, fileName)
             compare(isSavePageDownload, true)
+            compare(downloadState[0], WebEngineDownloadRequest.DownloadInProgress)
+            downloadFinishedSpy.wait()
+            compare(downloadFinishedSpy.count, 1)
+            compare(totalBytes, receivedBytes)
+            compare(downloadState[1], WebEngineDownloadRequest.DownloadCompleted)
+        }
+
+        function test_saveWebAction() {
+            // Load an image
+            webEngineView.url = Qt.resolvedUrl("icons/favicon.png")
+            verify(webEngineView.waitForLoadSucceeded())
+
+            // Saving without specifying path shouldn't be auto accepted
+            webEngineView.triggerWebAction(WebEngineView.SavePage)
+            downLoadRequestedSpy.wait()
+            compare(downLoadRequestedSpy.count, 1)
+            compare(downloadUrl, webEngineView.url)
+            compare(isSavePageDownload, true)
+            // The initial download request starts from DownloadRequested state,
+            // which means it wasn't automatically accepted.
             compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested)
         }
     }

From fd57d7be0df9a1e268c86d3fbfeed19f5ea96e06 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 5 Oct 2023 07:40:03 +0000
Subject: [PATCH 477/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I858ddfa5a8e39171ab94e6dacdac76879811d4ac
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 0dc1b083154..efcea06d901 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3f3e7127861ee51916368073249450ef6f92ee18
+    ref: 4528118ce16eb08034047bc3a2f13e1f97a7a224
     required: true
   ../qtpositioning:
-    ref: 2ec5ee03ce22e4b1862fac9a7dd5809e6d1a1b2e
+    ref: ab8c040388ad3477deb626b771a072014730fd3f
     required: false
   ../qttools:
-    ref: 3074a1fd98d542149a56574d3f0a846fc91d078a
+    ref: af150b81b276750a4c5a90bdd83b043361f5e769
     required: false
   ../qtwebchannel:
-    ref: 7a2de060c200820e16be88955912a1461caf6233
+    ref: bfe9c67e7a9d9b1265879f2e2b21538e11e334ed
     required: false

From d8e8c37fec30936e336d50871ffda2a42174a753 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 6 Oct 2023 08:05:02 +0000
Subject: [PATCH 478/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Iccef306f23ea7c46e6dc9f087b385a0691525574
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8e9b6296af9..7b4e31eb62a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 8c5682fd59a3299da8c231a6e6ee88d0cf2bf1ba
+    ref: c75fa21a9a2ee265440b1d8ed1c2f0d876715e4c
     required: true
   ../qtpositioning:
-    ref: da7bc2544779f4bcfa021c4be884373100ed8886
+    ref: 13194c7b20e9f824929b89d9f36d5ee5d75a380b
     required: false
   ../qttools:
-    ref: 5bab0570e6ec382e6b061658c9ab081563d011b3
+    ref: 48f991c2fd01d50a16a7aa7c69a762324889f155
     required: false
   ../qtwebchannel:
-    ref: 82094d14834b3acc0a99051d1aeae704dc53d29a
+    ref: fe557555770db98b4f445d547e72587a7b3c5e3e
     required: false

From a9909dc2cd6fa4221afc900ee8e960fda4475790 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 4 Oct 2023 15:59:50 +0200
Subject: [PATCH 479/681] Enable PipewireCapturer feature for webrtc_pipewire
 configs

There is no point in disabling it if we configure for using the feature.
This flag was added to chromium to pass the UI review.

Task-number: QTBUG-117673
Change-Id: Idafed808ceb0d0dafe0a55cd6e75f2e6fa6c5b85
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/web_engine_context.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 973da88a708..8a2cb42295d 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -720,6 +720,9 @@ WebEngineContext::WebEngineContext()
     enableFeatures.push_back(features::kNetworkServiceInProcess.name);
     enableFeatures.push_back(features::kTracingServiceInProcess.name);
 
+#if QT_CONFIG(webengine_webrtc_pipewire)
+    enableFeatures.push_back(features::kWebRtcPipeWireCapturer.name);
+#endif
     // When enabled, event.movement is calculated in blink instead of in browser.
     disableFeatures.push_back(features::kConsolidatedMovementXY.name);
 

From e67d542dfc16a4779609a22dfce9bca532632956 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Mon, 25 Sep 2023 16:37:54 +0200
Subject: [PATCH 480/681] Doc: Move PDF examples to UI Components category

Change-Id: Id3279026fcc791a9bd5e3e51a7ba7dd3c4a6930c
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit d002a907b5c1016c166d1df0d027b4f391a7273b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e0d15f313e6b9f03bceb39aba85acd9dbc5cbf91)
---
 examples/pdf/multipage/doc/src/multipage.qdoc        | 2 +-
 examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/pdf/multipage/doc/src/multipage.qdoc b/examples/pdf/multipage/doc/src/multipage.qdoc
index b9fec15a9bd..fff8b0d11ab 100644
--- a/examples/pdf/multipage/doc/src/multipage.qdoc
+++ b/examples/pdf/multipage/doc/src/multipage.qdoc
@@ -5,7 +5,7 @@
     \example multipage
     \meta installpath pdf
     \ingroup qtpdf-examples
-    \examplecategory {Graphics & Multimedia}
+    \examplecategory {User Interface Components}
 
     \title PDF Multipage Viewer Example
     \brief A Qt Quick PDF viewer that allows scrolling through the pages.
diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index 0c9fa06a9ae..b56958a9f28 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -5,7 +5,7 @@
     \example pdfviewer
     \meta installpath pdfwidgets
     \ingroup qtpdf-examples
-    \examplecategory {Graphics & Multimedia}
+    \examplecategory {User Interface Components}
 
     \title PDF Viewer Widget Example
     \brief A widget-based PDF viewer that allows scrolling through the pages.

From 9e188120593daa98751c4ef6a2fdf3e69e9cc219 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 9 Oct 2023 06:39:29 +0000
Subject: [PATCH 481/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Id3558397cf1997ad535e8ad033e0e2973bdb95ce
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index efcea06d901..9edac22045c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4528118ce16eb08034047bc3a2f13e1f97a7a224
+    ref: 43f2ec603c81848f8c0915f27b71ddd562d94f04
     required: true
   ../qtpositioning:
-    ref: ab8c040388ad3477deb626b771a072014730fd3f
+    ref: 806a9cb8a50fddeaf2cf4ee51c1d97e3c41a6497
     required: false
   ../qttools:
-    ref: af150b81b276750a4c5a90bdd83b043361f5e769
+    ref: 158f17eaca6f7060b2bac5434fc8b26672fa6203
     required: false
   ../qtwebchannel:
-    ref: bfe9c67e7a9d9b1265879f2e2b21538e11e334ed
+    ref: 9c7c08e038cdeb16bfcfb5d069e36246cec12af1
     required: false

From 5a6611d2b3cf930f89657ff3b667938f1ca3bca0 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 9 Oct 2023 13:35:46 +0000
Subject: [PATCH 482/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: If25a2b46cd235040f1212689c345c52b22e7ca68
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 7b4e31eb62a..fc64b475cab 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: c75fa21a9a2ee265440b1d8ed1c2f0d876715e4c
+    ref: 5053a1f3cef4211961401ed0b19e96ffe3885815
     required: true
   ../qtpositioning:
-    ref: 13194c7b20e9f824929b89d9f36d5ee5d75a380b
+    ref: f79b64cef8bcee8ff1d22c387ce6461c5f5fa74e
     required: false
   ../qttools:
-    ref: 48f991c2fd01d50a16a7aa7c69a762324889f155
+    ref: 3d22080051cf501828a76e71d97a675d5ac1eae4
     required: false
   ../qtwebchannel:
-    ref: fe557555770db98b4f445d547e72587a7b3c5e3e
+    ref: 8fbb38b7fb15065400fd70f6b8356b1f24cd71dc
     required: false

From de308f14b6a27f08642d67ed1ef4ee11a258dec2 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 10 Oct 2023 07:47:12 +0000
Subject: [PATCH 483/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: I9c477d8776637a5b4fd68a0693fa506af3aef8a5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 9edac22045c..fd6a3bdd078 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 43f2ec603c81848f8c0915f27b71ddd562d94f04
+    ref: 7441690e673400182556d0a5254383727affe38d
     required: true
   ../qtpositioning:
-    ref: 806a9cb8a50fddeaf2cf4ee51c1d97e3c41a6497
+    ref: ba951598dbad46e3e5d6014ea28ae0b01d9aa2ea
     required: false
   ../qttools:
-    ref: 158f17eaca6f7060b2bac5434fc8b26672fa6203
+    ref: 81a8c9b4745b65c7636c8adce715a94be0289728
     required: false
   ../qtwebchannel:
-    ref: 9c7c08e038cdeb16bfcfb5d069e36246cec12af1
+    ref: 74e2dd97950274ffd5b48e16170b144ce043b417
     required: false

From 76d917304a447e3b61b5dae6352956789633b2a7 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 12 Oct 2023 08:21:59 +0000
Subject: [PATCH 484/681] Update dependencies on '6.5' in qt/qtwebengine

Change-Id: Ida45894d103a7bd098256691046930258f9e2e82
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index fd6a3bdd078..5363e4c54b9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 7441690e673400182556d0a5254383727affe38d
+    ref: d7ba66128eb7e542ce6f2f1582b45e0149159d7f
     required: true
   ../qtpositioning:
-    ref: ba951598dbad46e3e5d6014ea28ae0b01d9aa2ea
+    ref: b9db9ab1ae59f6639fdf388d349c68609287c498
     required: false
   ../qttools:
-    ref: 81a8c9b4745b65c7636c8adce715a94be0289728
+    ref: 9712de2e27b0124fb79110a1075e54f4a986a85e
     required: false
   ../qtwebchannel:
-    ref: 74e2dd97950274ffd5b48e16170b144ce043b417
+    ref: 3e1a553f77d1fc412e13355274aabd504dc91d38
     required: false

From 5c442bb23f5953347e57f4a5e5a2ee9d35aab045 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 13 Sep 2023 13:54:12 +0200
Subject: [PATCH 485/681] Fix corrupted load/fetch state on start up in case of
 NoCache

The NoCache option on profile schedules clearHttpCache task. However,
this task will run later and BrowsingDataRemover will break
current network context mojo pipes. Network context will be recreated
eventually but all the load/request states are gone.

Do not delete explicitly cache on NoCache setting, which was
undocumented 'feature' anyway. Let the user take
care of that. Note doing reset network context on startup is fine as it
is not delayed.

[ChangeLog][WebEngineCore][WebEngineProfile] Switching profile to NoCache
do not longer implicitly removes cache from old data store.

Pick-to: 6.5
Task-number: QTBUG-116478
Change-Id: Ibd108d4ce7392349304df9f606738dc14dba36a0
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit f46e2f2d681f826c75637876e5df786664232ab1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebengineprofile.cpp | 5 ++++-
 src/core/profile_adapter.cpp       | 2 --
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
index 5b3605474b5..70051b3b472 100644
--- a/src/core/api/qwebengineprofile.cpp
+++ b/src/core/api/qwebengineprofile.cpp
@@ -495,7 +495,10 @@ QWebEngineProfile::HttpCacheType QWebEngineProfile::httpCacheType() const
 /*!
     Sets the HTTP cache type to \a httpCacheType.
 
-    \sa httpCacheType(), setCachePath()
+    \note Setting the \a httpCacheType to NoCache on the profile, which has already some cache
+    entries does not trigger the removal of those entries.
+
+    \sa httpCacheType(), setCachePath(), clearHttpCache()
 */
 void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCacheType)
 {
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 42c419efc8e..8767f4e0dfb 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -345,8 +345,6 @@ void ProfileAdapter::setHttpCacheType(ProfileAdapter::HttpCacheType newhttpCache
         return;
     if (!m_offTheRecord && !m_profile->m_profileIOData->isClearHttpCacheInProgress()) {
         m_profile->m_profileIOData->resetNetworkContext();
-        if (m_httpCacheType == NoCache)
-            clearHttpCache();
     }
 }
 

From f3014bcfafd48096e8ce9200703989fff5ca33a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 11 Oct 2023 11:06:19 +0200
Subject: [PATCH 486/681] Update Chromium

Submodule src/3rdparty 14780aaa..75a9a538:
  * [Backport] Add Intel Meteorlake GPU series type
  * Fix ffmpeg assembly with newer binutil
  * [Backport] Security bug 1447972 (2/2)
  * [Backport] Security bug 1447972 (1/2)
  * [Backport] Security bug 1479104
  * [Backport] Security bug 1480184
  * [Backport] CVE-2023-5217: Heap buffer overflow in vp8 encoding in libvpx
  * Zygote: Prevent leaking control socket to child processes
  * FIXUP: jumbo build
  * [Backport] Set ABSL_OPTION_USE_STD_ANY to 2
  * [Backport] Replace uses of re2::StringPiece::set().
  * [Backport] Make absl::string_view a typedef for std::string_view
  * Fix broken copy of non-BMP characters

Fixes: QTBUG-117653
Change-Id: I49b82a1f97ffda0f7ba2b3607217a178e51ee222
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 482839a0d315722f006cdd90a3e2eff97a991b2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index a9ed5a33904..19f3aa7a62f 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           117.0.5938.63
+Patched with security patches up to Chromium version:           117.0.5938.149
diff --git a/src/3rdparty b/src/3rdparty
index 14780aaa6b0..75a9a5388ff 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 14780aaa6b0f85a6912878b3874c18e63c99a5d9
+Subproject commit 75a9a5388ffe90c81e037ee19b2b28801e3a0156
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 74c0b16729a..05ce9d39c7b 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -965,7 +965,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "117.0.5938.63"; // FIXME: Remember to update
+    return "117.0.5938.149"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From c41c963ed1b4e11f5e99e1f3caf597a5b3d55b9e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 12 Oct 2023 13:04:36 +0000
Subject: [PATCH 487/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I0ed2456235131904fdf15917261db568f4f42f61
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index fc64b475cab..d6331d02f35 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 5053a1f3cef4211961401ed0b19e96ffe3885815
+    ref: c03ed947647255e8b3df560a6aa3c630e3ec5b46
     required: true
   ../qtpositioning:
-    ref: f79b64cef8bcee8ff1d22c387ce6461c5f5fa74e
+    ref: 2916983f6e5fa4e4cf3a033c8a0619d8b5872bbc
     required: false
   ../qttools:
-    ref: 3d22080051cf501828a76e71d97a675d5ac1eae4
+    ref: 70c3eb3e555c5eafcdfe794163e623e9149fa4f2
     required: false
   ../qtwebchannel:
-    ref: 8fbb38b7fb15065400fd70f6b8356b1f24cd71dc
+    ref: c49947f6c007d264fcbfacf5c258418b0b60e053
     required: false

From 3a44095235830c1ea54cfb4591d30018e964ff4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Fri, 29 Sep 2023 09:49:23 +0200
Subject: [PATCH 488/681] Highlight also Recipe Browser

Task-number: QTBUG-117224
Pick-to: 6.6.0 6.5
Change-Id: I80eb11577a46b8e26c4705b647eca855b1a4d933
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b9f4ee0a1a38eba55613b28e943e9aafdf47179d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/qtwebengine.qdocconf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
index 5cbe9e5007f..d322cc285f2 100644
--- a/src/core/doc/qtwebengine.qdocconf
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -31,7 +31,8 @@ qhp.QtWebEngine.subprojects.examples.selectors = doc:example
 qhp.QtWebEngine.subprojects.examples.sortPages = true
 
 manifestmeta.highlighted.names += "QtWebEngine/WebEngine Widgets Simple Browser Example" \
-                "QtWebEngine/WebEngine Quick Nano Browser"
+                "QtWebEngine/WebEngine Quick Nano Browser" \
+                "QtWebEngine/Recipe Browser"
 
 tagfile                 = ../../../doc/qtwebengine/qtwebengine.tags
 

From e1139a7f7b15298ab203677aebc13234fc811d4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Fri, 29 Sep 2023 09:49:23 +0200
Subject: [PATCH 489/681] Highlight also Recipe Browser

Task-number: QTBUG-117224
Change-Id: I80eb11577a46b8e26c4705b647eca855b1a4d933
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b9f4ee0a1a38eba55613b28e943e9aafdf47179d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3a44095235830c1ea54cfb4591d30018e964ff4f)
---
 src/core/doc/qtwebengine.qdocconf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
index 5cbe9e5007f..d322cc285f2 100644
--- a/src/core/doc/qtwebengine.qdocconf
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -31,7 +31,8 @@ qhp.QtWebEngine.subprojects.examples.selectors = doc:example
 qhp.QtWebEngine.subprojects.examples.sortPages = true
 
 manifestmeta.highlighted.names += "QtWebEngine/WebEngine Widgets Simple Browser Example" \
-                "QtWebEngine/WebEngine Quick Nano Browser"
+                "QtWebEngine/WebEngine Quick Nano Browser" \
+                "QtWebEngine/Recipe Browser"
 
 tagfile                 = ../../../doc/qtwebengine/qtwebengine.tags
 

From 30c141c647806be05e9724d82e101c2a1eb87b28 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 13 Sep 2023 13:54:12 +0200
Subject: [PATCH 490/681] Fix corrupted load/fetch state on start up in case of
 NoCache

The NoCache option on profile schedules clearHttpCache task. However,
this task will run later and BrowsingDataRemover will break
current network context mojo pipes. Network context will be recreated
eventually but all the load/request states are gone.

Do not delete explicitly cache on NoCache setting, which was
undocumented 'feature' anyway. Let the user take
care of that. Note doing reset network context on startup is fine as it
is not delayed.

[ChangeLog][WebEngineCore][WebEngineProfile] Switching profile to NoCache
do not longer implicitly removes cache from old data store.

Task-number: QTBUG-116478
Change-Id: Ibd108d4ce7392349304df9f606738dc14dba36a0
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit f46e2f2d681f826c75637876e5df786664232ab1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5c442bb23f5953347e57f4a5e5a2ee9d35aab045)
---
 src/core/api/qwebengineprofile.cpp | 5 ++++-
 src/core/profile_adapter.cpp       | 2 --
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
index ab873e345ee..2defebdaf0e 100644
--- a/src/core/api/qwebengineprofile.cpp
+++ b/src/core/api/qwebengineprofile.cpp
@@ -495,7 +495,10 @@ QWebEngineProfile::HttpCacheType QWebEngineProfile::httpCacheType() const
 /*!
     Sets the HTTP cache type to \a httpCacheType.
 
-    \sa httpCacheType(), setCachePath()
+    \note Setting the \a httpCacheType to NoCache on the profile, which has already some cache
+    entries does not trigger the removal of those entries.
+
+    \sa httpCacheType(), setCachePath(), clearHttpCache()
 */
 void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCacheType)
 {
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index e9e9aaedaf1..4ed45c020fb 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -345,8 +345,6 @@ void ProfileAdapter::setHttpCacheType(ProfileAdapter::HttpCacheType newhttpCache
         return;
     if (!m_offTheRecord && !m_profile->m_profileIOData->isClearHttpCacheInProgress()) {
         m_profile->m_profileIOData->resetNetworkContext();
-        if (m_httpCacheType == NoCache)
-            clearHttpCache();
     }
 }
 

From 35047cd0d5163f94faf63a20b975e6d87ea69beb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 11 Oct 2023 13:03:18 +0200
Subject: [PATCH 491/681] Update Chromium

Submodule src/3rdparty ef090c47..7a4d8d3c:
  * [Backport] Add Intel Meteorlake GPU series type
  * [Backport] Add Intel Raptorlake GPU series type
  * Fix ffmpeg assembly with newer binutil
  * [Backport] Security bug 1447972 (2/2)
  * [Backport] Security bug 1447972 (1/2)
  * [Backport] Security bug 1479104
  * [Backport] Security bug 1480184
  * [Backport] CVE-2023-5217: Heap buffer overflow in vp8 encoding in libvpx
  * [Backport] Make absl::string_view a typedef for std::string_view
  * [Backport] Replace uses of re2::StringPiece::set().
  * [Backport] Set ABSL_OPTION_USE_STD_ANY to 2
  * Pass python interpreter path to gn during license check
  * Fix broken copy of non-BMP characters

Fixes: QTBUG-117652
Change-Id: I3aef542eb56b4aa7e051632cbf6aa0d483107475
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index ea03ba17327..f1e99ae0553 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           117.0.5938.63
+Patched with security patches up to Chromium version:           117.0.5938.149
diff --git a/src/3rdparty b/src/3rdparty
index ef090c47d08..7a4d8d3c040 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit ef090c47d08c734ae2b3c1db508982aca0f3ee1e
+Subproject commit 7a4d8d3c040d4e6cb9ff6ea040eb50722239b31f
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 8a2cb42295d..26a3ede21be 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -974,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "117.0.5938.63"; // FIXME: Remember to update
+    return "117.0.5938.149"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 7ac98f3f23983d33e59805cdc6e50be52ed0e515 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 18 Oct 2023 05:22:59 +0000
Subject: [PATCH 492/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ie73a530c873c8ef10c8cc5c5736a45c9eb0d3162
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index d6331d02f35..c721325399a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: c03ed947647255e8b3df560a6aa3c630e3ec5b46
+    ref: e84082d503b629153f8b71f4819b93a7b6cdc23b
     required: true
   ../qtpositioning:
-    ref: 2916983f6e5fa4e4cf3a033c8a0619d8b5872bbc
+    ref: 6382459faded1affb6a55ee3ca118fa60d0a4c14
     required: false
   ../qttools:
-    ref: 70c3eb3e555c5eafcdfe794163e623e9149fa4f2
+    ref: e2cf50157b4be2eb09acf191db725f92e9245d14
     required: false
   ../qtwebchannel:
-    ref: c49947f6c007d264fcbfacf5c258418b0b60e053
+    ref: a2823d2aee35ccfd7b7290aaf1b14dcc41da94fe
     required: false

From 063f0128bb18001f12fd7ac759f1ede4d05775ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20K=C3=B6hne?= <kai.koehne@qt.io>
Date: Mon, 23 Oct 2023 13:06:02 +0200
Subject: [PATCH 493/681] Make sure CMake finds rights host compiler

Let CMake use the compiler that was set when configuring qtbase.
The QT_USE_ORIGINAL_COMPILER is now opt in (since qtbase commit
3aa6f0b3961322a40f046c)

Change-Id: Ia3f70153fc05eb2307f7565943692a1238b076e5
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit cf081e0245980fc0d129cd11ca0ac17226f1f229)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1016216cc40..a7935e7de0b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -173,6 +173,7 @@ if(CMAKE_CROSSCOMPILING AND NOT IOS AND NOT MACOS)
         USES_TERMINAL_BUILD TRUE
         EXCLUDE_FROM_ALL TRUE
         CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH_CMAKE_DIR}/Qt6/qt.toolchain.cmake
+                   -DQT_USE_ORIGINAL_COMPILER=ON
                    -DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
                    -DWEBENGINE_ROOT_SOURCE_DIR=${WEBENGINE_ROOT_SOURCE_DIR}
                    -DGN_TARGET_CPU=${TEST_architecture_arch}

From f62acaee6c1f0afe3c17c611e928252ca8975a27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 24 Oct 2023 11:07:53 +0200
Subject: [PATCH 494/681] Also stamp the v8_context_snapshot in debug and
 release builds on macOS

Even though debug-and-release builds on macOS are not the  recommeded
way anymore and ate not used in the CI they  are  currently still
supported and should continue working.

Fixes: QTBUG-118505
Change-Id: Ib15bcb9983bf3664bf10cb5038cb6a928ab51bf6
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
(cherry picked from commit 986e27565075e7b3cbfe5ab72de66691075d6742)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/CMakeLists.txt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index b1868c28885..2c36936ddb8 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -139,12 +139,12 @@ if(QT_FEATURE_webengine_v8_context_snapshot)
            else()
                unset(ext_debug)
            endif()
-          get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot${ext_arch}${ext_debug}.bin ${path_mode})
-          list(APPEND resourceFiles ${resSourcePath})
+           get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot${ext_arch}${ext_debug}.bin ${path_mode})
+           list(APPEND resourceFiles ${resSourcePath})
+           if(MACOS)
+               set(stamps ${stamps} ${buildDir}/${config}/${arch}/obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
+           endif()
        endforeach()
-       if(MACOS)
-           set(stamps ${stamps} ${buildDir}/${config}/${arch}/obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
-        endif()
     endforeach()
 endif()
 

From df00334b4ea26af82106973a3a6eadf2a5f23966 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Thu, 20 Jul 2023 16:03:37 +0200
Subject: [PATCH 495/681] Register missing pref for extensions

Chromium reads this list on pages that use
the hangout services extension.
This change fixes a crash on google hangouts.
Upstream change: https://crrev.com/c/4051124

Fixes: QTBUG-118157
Task-number: QTBUG-85731
Change-Id: I1698dfd689f8e78277513dc11ed8dde51990ed90
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7549daf002b1d941204c975d35438b22a55b7651)
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
---
 src/core/pref_service_adapter.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 9d18384a118..dcc7401c07d 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -111,6 +111,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
     registry->RegisterListPref(extensions::pref_names::kNativeMessagingBlocklist);
     registry->RegisterListPref(extensions::pref_names::kNativeMessagingAllowlist);
     registry->RegisterBooleanPref(extensions::pref_names::kNativeMessagingUserLevelHosts, true);
+    registry->RegisterListPref(extensions::pref_names::kExtendedBackgroundLifetimeForPortConnectionsToUrls);
 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
 
     // Media device salt id key

From fa62a53a6c6e084a5d66aa81feeee02769c64f70 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 27 Oct 2023 12:46:47 +0200
Subject: [PATCH 496/681] Skip comboBoxPopupPosition* tests on apple m1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We have constant crashes on apple m1 with those test,
skip it for now.

Verify window in comboBoxPopupPosition* tests.

Change-Id: I4b9744fbcae556bc8d17e7602d003f306f54c62d
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 889b236e4e2d6ec54d6750e970ef673c487bc18a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../qwebenginepage/tst_qwebenginepage.cpp     | 21 +++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index f3515b06002..5e540babeda 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -279,6 +279,9 @@ private Q_SLOTS:
 
     QWebEngineView* m_view;
     QWebEnginePage* m_page;
+    QScopedPointer<QPointingDevice> s_touchDevice =
+            QScopedPointer<QPointingDevice>(QTest::createTouchDevice());
+
     QString tmpDirPath() const
     {
         static QString tmpd = QDir::tempPath() + "/tst_qwebenginepage-"
@@ -286,13 +289,13 @@ private Q_SLOTS:
         return tmpd;
     }
 
-    QScopedPointer<QPointingDevice> s_touchDevice;
-    void makeClick(QWindow *window, bool withTouch = false, const QPoint &p = QPoint()) {
+    void makeClick(const QPointer<QWindow> window, bool withTouch = false,
+                   const QPoint &p = QPoint())
+    {
+        QVERIFY2(window, "window is gone");
         if (!withTouch) {
             QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), p);
         } else {
-            if (!s_touchDevice)
-                s_touchDevice.reset(QTest::createTouchDevice());
             QTest::touchEvent(window, s_touchDevice.get()).press(1, p);
             QTest::touchEvent(window, s_touchDevice.get()).release(1, p);
         }
@@ -1361,6 +1364,9 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove_data()
 
 void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
 {
+#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__))
+    QSKIP("This test crashes for Apple M1");
+#endif
     QWebEngineView view;
     QTRY_VERIFY(QGuiApplication::primaryScreen());
     view.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft());
@@ -1374,7 +1380,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
     QTRY_COMPARE(spyLoadFinished.size(), 1);
     const auto oldTlws = QGuiApplication::topLevelWindows();
     QFETCH(bool, withTouch);
-    QWindow *window = view.windowHandle();
+    QPointer<QWindow> window = view.windowHandle();
     auto pos = elementCenter(view.page(), "foo");
     makeClick(window, withTouch, pos);
     QWindow *popup = nullptr;
@@ -1424,6 +1430,9 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove_data()
 
 void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
 {
+#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__))
+    QSKIP("This test crashes for Apple M1");
+#endif
     QWidget mainWidget;
     mainWidget.setLayout(new QHBoxLayout);
 
@@ -1448,7 +1457,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
     const auto oldTlws = QGuiApplication::topLevelWindows();
 
     QFETCH(bool, withTouch);
-    QWindow *window = view.window()->windowHandle();
+    QPointer<QWindow> window = view.window()->windowHandle();
     makeClick(window, withTouch, view.mapTo(view.window(), elementCenter(view.page(), "foo")));
 
     QWindow *popup = nullptr;

From 79608ad27b0a79b36377cd118ff31654b84e2f98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 30 Aug 2023 14:55:57 +0200
Subject: [PATCH 497/681] Mention the need to use entitlements for
 QtWebEngineProcess on macOS

It was not listed among the steps and some users deploying manually
had some trouble with it.

Pick-to: 6.5
Task-number: QTBUG-116565
Change-Id: I7488b00c53d13f142d62869ea52376f5283df47a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ea52b98ec79576ed875a095790043844869e8865)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-deploying.qdoc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index 035800d9d5b..d75f8572eca 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -141,6 +141,10 @@
 
     \section2 \macos Specific Deployment Steps
 
+    To deploy a \QWE application on \maocs, you will need to ensure that the \QWE process is signed
+    with an entitlements file that at least contains the entitlements listed in
+    QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Resources/QtWebEngineProcess.entitlements.
+
     To deploy a \QWE application that accesses the microphone or camera
     on \macos, you will need to provide texts for the messages that will be shown to the user to
     explain why the application asks for permission to access to the camera or microphone.

From ea31d83ff79807fa72811d29fb53696a5da2bc8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 24 Oct 2023 10:49:36 +0200
Subject: [PATCH 498/681] Compile getAdapterLuid also with -no-opengl configs

It was not compiled in -no-opengl builds even though it should not
depend on OpenGL and was also used in non-OpenGL builds.

Pick-to: 6.5
Fixes: QTBUG-117751
Change-Id: I0bcb8496d25004573d1e00ffc276511f82e489bd
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 751c110031fe94efec108c8f61d41eeb496a0c03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_engine_context.cpp | 50 ++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 05ce9d39c7b..ddef165e84c 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -178,31 +178,6 @@ bool usingSoftwareDynamicGL()
 #endif
 }
 
-#if defined(Q_OS_WIN)
-static QString getAdapterLuid() {
-    static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
-    QRhiD3D11InitParams rhiParams;
-    QRhi::Flags flags;
-    if (preferSoftwareDevice) {
-        flags |= QRhi::PreferSoftwareRenderer;
-    }
-    QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
-    // mimic what QSGRhiSupport and QBackingStoreRhi does
-    if (!rhi && !preferSoftwareDevice) {
-        flags |= QRhi::PreferSoftwareRenderer;
-        rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
-    }
-    if (rhi) {
-        const QRhiD3D11NativeHandles *handles =
-                static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
-        Q_ASSERT(handles);
-        return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
-    } else {
-        return QString();
-    }
-}
-#endif
-
 static bool openGLPlatformSupport()
 {
     return QGuiApplicationPrivate::platformIntegration()->hasCapability(
@@ -273,6 +248,31 @@ static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu
 }
 #endif // QT_CONFIG(opengl)
 
+#if defined(Q_OS_WIN)
+static QString getAdapterLuid() {
+    static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
+    QRhiD3D11InitParams rhiParams;
+    QRhi::Flags flags;
+    if (preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+    }
+    QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
+    // mimic what QSGRhiSupport and QBackingStoreRhi does
+    if (!rhi && !preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+        rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
+    }
+    if (rhi) {
+        const QRhiD3D11NativeHandles *handles =
+                static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
+        Q_ASSERT(handles);
+        return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
+    } else {
+        return QString();
+    }
+}
+#endif
+
 #if QT_CONFIG(webengine_pepper_plugins)
 void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
 {

From 82bd69dffe10e5d894f2211167647e18b2f3050a Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 30 Oct 2023 16:48:13 +0000
Subject: [PATCH 499/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I596b611268531da17f377fc9cc526dc95600c6bc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c721325399a..15d21402e1c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: e84082d503b629153f8b71f4819b93a7b6cdc23b
+    ref: b4f7c4353c2b2d381468dec920af061e6231cf8d
     required: true
   ../qtpositioning:
-    ref: 6382459faded1affb6a55ee3ca118fa60d0a4c14
+    ref: e610bb90e4fac07155b60a7a5c8603d9de13e3e4
     required: false
   ../qttools:
-    ref: e2cf50157b4be2eb09acf191db725f92e9245d14
+    ref: d4c35e9ec44f41f6dc6d07c0b80ad77797f9ec9b
     required: false
   ../qtwebchannel:
-    ref: a2823d2aee35ccfd7b7290aaf1b14dcc41da94fe
+    ref: b23276d79a257a4138c3181cdae871dd4ecb28f0
     required: false

From cedfa5ed164ef868754438002db2558543de5cf0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 30 Oct 2023 11:39:06 +0100
Subject: [PATCH 500/681] Update Chromium

Submodule src/3rdparty 75a9a538..8146bf85:
  * [Backport] CVE-2023-5218: Use after free in Site Isolation
  * [Backport] CVE-2023-5476: Use after free in Blink History
  * [Backport] CVE-2023-5486: Inappropriate implementation in Input
  * [Backport] Dependency for CVE-2023-5486: Inappropriate implementation in Input
  * [Backport] CVE-2023-5474: Heap buffer overflow in PDF
  * [Backport] CVE-2023-5475: Inappropriate implementation in DevTools
  * [Backport] CVE-2023-5484: Inappropriate implementation in Navigation
  * [Backport] CVE-2023-5487: Inappropriate implementation in Fullscreen
  * [Backport] Security bug 1472368
  * [Backport] Security bug 1472365 and 1472366
  * [Backport] Security bug 1486316
  * Add shorter include paths workaround

Task-number: QTBUG-118480
Change-Id: I8968b249bdea9e234c925cbdacf50d92d5c2f4c6
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit d40ba15ec9cbc2e3c86d2cdf35aec6abd1d2a405)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 19f3aa7a62f..cbdb9d3bdff 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           117.0.5938.149
+Patched with security patches up to Chromium version:           118.0.5993.117
diff --git a/src/3rdparty b/src/3rdparty
index 75a9a5388ff..8146bf85433 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 75a9a5388ffe90c81e037ee19b2b28801e3a0156
+Subproject commit 8146bf8543363d4c48cbaf854909abccf84de020
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index ddef165e84c..5fe40641520 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -965,7 +965,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "117.0.5938.149"; // FIXME: Remember to update
+    return "118.0.5993.117"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From f3772c743ddae44ea80a896176c1f2504b88e70d Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 27 Oct 2023 12:46:47 +0200
Subject: [PATCH 501/681] Skip comboBoxPopupPosition* tests on apple m1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We have constant crashes on apple m1 with those test,
skip it for now.

Verify window in comboBoxPopupPosition* tests.

Change-Id: I4b9744fbcae556bc8d17e7602d003f306f54c62d
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 889b236e4e2d6ec54d6750e970ef673c487bc18a)
---
 .../qwebenginepage/tst_qwebenginepage.cpp     | 21 +++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index c943f0199b5..c5d4e2e5776 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -278,6 +278,9 @@ private Q_SLOTS:
 
     QWebEngineView* m_view;
     QWebEnginePage* m_page;
+    QScopedPointer<QPointingDevice> s_touchDevice =
+            QScopedPointer<QPointingDevice>(QTest::createTouchDevice());
+
     QString tmpDirPath() const
     {
         static QString tmpd = QDir::tempPath() + "/tst_qwebenginepage-"
@@ -285,13 +288,13 @@ private Q_SLOTS:
         return tmpd;
     }
 
-    QScopedPointer<QPointingDevice> s_touchDevice;
-    void makeClick(QWindow *window, bool withTouch = false, const QPoint &p = QPoint()) {
+    void makeClick(const QPointer<QWindow> window, bool withTouch = false,
+                   const QPoint &p = QPoint())
+    {
+        QVERIFY2(window, "window is gone");
         if (!withTouch) {
             QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), p);
         } else {
-            if (!s_touchDevice)
-                s_touchDevice.reset(QTest::createTouchDevice());
             QTest::touchEvent(window, s_touchDevice.get()).press(1, p);
             QTest::touchEvent(window, s_touchDevice.get()).release(1, p);
         }
@@ -1358,6 +1361,9 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove_data()
 
 void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
 {
+#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__))
+    QSKIP("This test crashes for Apple M1");
+#endif
     QWebEngineView view;
     view.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft());
     view.resize(640, 480);
@@ -1370,7 +1376,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
     QTRY_COMPARE(spyLoadFinished.size(), 1);
     const auto oldTlws = QGuiApplication::topLevelWindows();
     QFETCH(bool, withTouch);
-    QWindow *window = view.windowHandle();
+    QPointer<QWindow> window = view.windowHandle();
     auto pos = elementCenter(view.page(), "foo");
     makeClick(window, withTouch, pos);
     QWindow *popup = nullptr;
@@ -1420,6 +1426,9 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove_data()
 
 void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
 {
+#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__))
+    QSKIP("This test crashes for Apple M1");
+#endif
     QWidget mainWidget;
     mainWidget.setLayout(new QHBoxLayout);
 
@@ -1443,7 +1452,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
     const auto oldTlws = QGuiApplication::topLevelWindows();
 
     QFETCH(bool, withTouch);
-    QWindow *window = view.window()->windowHandle();
+    QPointer<QWindow> window = view.window()->windowHandle();
     makeClick(window, withTouch, view.mapTo(view.window(), elementCenter(view.page(), "foo")));
 
     QWindow *popup = nullptr;

From 5e4130fdb46c2faa630be8c2f7a0040f3e579e3c Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 31 Oct 2023 09:19:14 +0100
Subject: [PATCH 502/681] Add is_msvc parameter support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Branches dev and 6.6 have is_msvc parameter, which
came with mingw support in 6a99ecaaa4.

Add is_msvc parameter to 6.5 as it is required for
'shorter includes' patch.

Task-number: QTBUG-118410
Change-Id: I639a4f8d26f6075b516eabf2293e813841dbad02
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 cmake/Functions.cmake              | 4 +++-
 configure.cmake                    | 7 ++-----
 src/pdf/configure/BUILD.root.gn.in | 2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 73a06d59fbf..fa05bfbdf84 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -918,6 +918,8 @@ macro(append_compiler_linker_sdk_setup)
     endif()
 
     extend_gn_list(gnArgArg ARGS is_clang CONDITION CLANG)
+    extend_gn_list(gnArgArg ARGS is_msvc CONDITION MSVC)
+
     if(CLANG)
         if(MACOS)
             get_darwin_sdk_version(macSdkVersion)
@@ -976,7 +978,7 @@ macro(append_compiler_linker_sdk_setup)
         endif()
     endif()
 
-    if(WIN32)
+    if(MSVC)
         get_filename_component(windowsSdkPath $ENV{WINDOWSSDKDIR} ABSOLUTE)
         get_filename_component(visualStudioPath $ENV{VSINSTALLDIR} ABSOLUTE)
         list(APPEND gnArgArg
diff --git a/configure.cmake b/configure.cmake
index c217175b09c..83cc0e4c957 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -574,19 +574,16 @@ ${xcbErrorMessage}"
 )
 add_check_for_support(
    MODULES QtWebEngine QtPdf
-   CONDITION
+   CONDITION MSVC OR
        (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
        (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
-       (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL MSVC) OR
-       (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND
-          CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) OR
        (MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR
        (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR
        (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
    MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )
 if(WIN32)
-    if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
+    if(MSVC)
         add_check_for_support(
             MODULES QtWebEngine QtPdf
             CONDITION NOT MSVC_VERSION LESS 1929
diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in
index 3918c1e9f3e..333e541ab11 100644
--- a/src/pdf/configure/BUILD.root.gn.in
+++ b/src/pdf/configure/BUILD.root.gn.in
@@ -59,7 +59,7 @@ static_library("QtPdf") {
   deps = [
     "//third_party/pdfium"
   ]
-  if (is_win) {
+  if (is_msvc) {
     libs = [
       "dloadhelper.lib",
       "winmm.lib",

From ac2c9d445becd6d8b52eb04679a52f137ecc4dc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 30 Oct 2023 13:32:27 +0100
Subject: [PATCH 503/681] Update Chromium

Submodule src/3rdparty 7a4d8d3c..fdbad563:
  * [Backport] Security bug 1472365 and 1472366
  * [Backport] CVE-2023-5474: Heap buffer overflow in PDF
  * [Backport] CVE-2023-5475: Inappropriate implementation in DevTools
  * [Backport] CVE-2023-5484: Inappropriate implementation in Navigation
  * [Backport] CVE-2023-5487: Inappropriate implementation in Fullscreen
  * [Backport] Security bug 1472368
  * [Backport] Security bug 1486316
  * CVE-2023-5218: Use after free in Site Isolation
  * Add shorter include paths workaround

Task-number: QTBUG-118410
Change-Id: I4f277629039af212a81eaf7cbc059105a4da85e8
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 7a4d8d3c040..fdbad56331e 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 7a4d8d3c040d4e6cb9ff6ea040eb50722239b31f
+Subproject commit fdbad56331edfa46f841f1f1aa606a98c5fc6e7e

From 6799a384d1f16cfe27382915b9a6573c1bce91a4 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 31 Oct 2023 15:08:15 +0100
Subject: [PATCH 504/681] Set RendererPreferences::can_accept_load_drops
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The setting is duplicated, and the webpreference version will disappear
in the future.

Pick-to: 6.5
Change-Id: I8281d298a95b68bc7f3b421f8388a976da90baab
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 65d4600a6fb7db435f7fc91a2a54f98238e6e5d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/web_contents_adapter.cpp | 2 ++
 src/core/web_engine_settings.cpp  | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 91a939bd2ab..fe30206ce38 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -554,6 +554,8 @@ void WebContentsAdapter::initializeRenderPrefs()
                 ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly
                 : blink::kWebRTCIPHandlingDefault;
 #endif
+    rendererPrefs->can_accept_load_drops = m_adapterClient->webEngineSettings()->testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+
     // Set web-contents font settings to the default font settings as Chromium constantly overrides
     // the global font defaults with the font settings of the latest web-contents created.
     static const gfx::FontRenderParams params = gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr);
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 23ba7a31ae5..2dc7c5e32de 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -447,6 +447,11 @@ bool WebEngineSettings::applySettingsToRendererPreferences(blink::RendererPrefer
         }
     }
 #endif
+    bool canNavigateOnDrop = testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+    if (canNavigateOnDrop != prefs->can_accept_load_drops) {
+        prefs->can_accept_load_drops = canNavigateOnDrop;
+        changed = true;
+    }
     return changed;
 }
 

From e180153b03a4533018b3357e59a439d74ab03ac4 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 21 Sep 2023 15:10:00 +0200
Subject: [PATCH 505/681] Fix Qt accessibility cache logging

The accessibility cache logging may crash:
- when logging an "insert" and the underlying Chromium accessibility
  objects are not yet created.
- when logging a "delete" and the underlying Chromium accessibility
  objects are already destructed.

BrowserAccessibilityManager::GetFromId() is not supposed to return
nullptr but it does with the QtWebEngine integration and it happens when
we try to access BrowserAccessibility too early or too late. Add check
to those BrowserAccessibilityInterface methods which use GetFromId().
These methods are called by the Qt logger on creation and destruction of
the BrowserAccessibilityInterface.

The logging can be enabled with the following environment variable:
QT_LOGGING_RULES="qt.accessibility.cache.debug=true"

Change-Id: Ib97f0acb982b72a5602234bd5845749f69689e32
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3533fa83f4f3f3ee32dcd826dd16b625940e088d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a87695c8413890e06ea27abff84b15cd2a994754)
---
 src/core/browser_accessibility_qt.cpp | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index 24c006dc5dc..adb6b873cc7 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -25,6 +25,8 @@ class BrowserAccessibilityQt
     BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node);
     ~BrowserAccessibilityQt();
 
+    bool isReady() const;
+
     QtWebEngineCore::BrowserAccessibilityInterface *interface = nullptr;
 };
 
@@ -144,6 +146,13 @@ BrowserAccessibilityQt::~BrowserAccessibilityQt()
         interface->destroy();
 }
 
+bool BrowserAccessibilityQt::isReady() const
+{
+    // FIXME: This is just a workaround, remove this when the commented out assert in
+    //        BrowserAccessibilityManager::GetFromID(int32_t id) gets fixed.
+    return manager()->GetFromID(node()->id()) != nullptr;
+}
+
 BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface)
     : q(chromiumInterface)
 {
@@ -169,6 +178,9 @@ void BrowserAccessibilityInterface::destroy()
 
 bool BrowserAccessibilityInterface::isValid() const
 {
+    if (!q->isReady())
+        return false;
+
     auto managerQt = static_cast<content::BrowserAccessibilityManagerQt *>(q->manager());
     return managerQt && managerQt->isValid();
 }
@@ -276,6 +288,9 @@ int BrowserAccessibilityInterface::indexOfChild(const QAccessibleInterface *ifac
 
 QString BrowserAccessibilityInterface::text(QAccessible::Text t) const
 {
+    if (!q->isReady())
+        return QString();
+
     switch (t) {
     case QAccessible::Name:
         return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kName));
@@ -297,7 +312,7 @@ void BrowserAccessibilityInterface::setText(QAccessible::Text t, const QString &
 
 QRect BrowserAccessibilityInterface::rect() const
 {
-    if (!q->manager()) // needed implicitly by GetScreenBoundsRect()
+    if (!q->manager() || !q->isReady()) // needed implicitly by GetScreenBoundsRect()
         return QRect();
     gfx::Rect bounds = q->GetUnclippedScreenBoundsRect();
     bounds = gfx::ScaleToRoundedRect(bounds, 1.f / q->manager()->device_scale_factor()); // FIXME: check
@@ -699,6 +714,11 @@ QAccessible::Role BrowserAccessibilityInterface::role() const
 QAccessible::State BrowserAccessibilityInterface::state() const
 {
     QAccessible::State state = QAccessible::State();
+    if (!q->isReady()) {
+        state.invalid = true;
+        return state;
+    }
+
     if (q->HasState(ax::mojom::State::kCollapsed))
         state.collapsed = true;
     if (q->HasState(ax::mojom::State::kDefault))

From cfd600f6bbec585be623550f8a26e49346246252 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 2 Nov 2023 15:25:15 +0000
Subject: [PATCH 506/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Iea6589f2d41979be472a35b3c1cdb31741f7a1dd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 15d21402e1c..309d6bd86f8 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b4f7c4353c2b2d381468dec920af061e6231cf8d
+    ref: 43217be9bcc786bff6d0ed23e70a4077e069c29f
     required: true
   ../qtpositioning:
-    ref: e610bb90e4fac07155b60a7a5c8603d9de13e3e4
+    ref: 934cde1f45f8a1bb830c807beb7ca24e65cb123c
     required: false
   ../qttools:
-    ref: d4c35e9ec44f41f6dc6d07c0b80ad77797f9ec9b
+    ref: ff8ab8504c46f9e73d37809a8361de14e374a9a1
     required: false
   ../qtwebchannel:
-    ref: b23276d79a257a4138c3181cdae871dd4ecb28f0
+    ref: 46a4a1983fa8deb85517440a54dbbaee41d4b2a2
     required: false

From aa8cc4d0df7787e6a1777cd5cb1ab512bc1d8b8d Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 31 Oct 2023 15:08:15 +0100
Subject: [PATCH 507/681] Set RendererPreferences::can_accept_load_drops
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The setting is duplicated, and the webpreference version will disappear
in the future.

Change-Id: I8281d298a95b68bc7f3b421f8388a976da90baab
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 65d4600a6fb7db435f7fc91a2a54f98238e6e5d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6799a384d1f16cfe27382915b9a6573c1bce91a4)
---
 src/core/web_contents_adapter.cpp | 2 ++
 src/core/web_engine_settings.cpp  | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 62fff5ad5b7..83066e811b0 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -553,6 +553,8 @@ void WebContentsAdapter::initializeRenderPrefs()
                 ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly
                 : blink::kWebRTCIPHandlingDefault;
 #endif
+    rendererPrefs->can_accept_load_drops = m_adapterClient->webEngineSettings()->testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+
     // Set web-contents font settings to the default font settings as Chromium constantly overrides
     // the global font defaults with the font settings of the latest web-contents created.
     static const gfx::FontRenderParams params = gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr);
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 906f9fb7269..520bc6499a0 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -441,6 +441,11 @@ bool WebEngineSettings::applySettingsToRendererPreferences(blink::RendererPrefer
         }
     }
 #endif
+    bool canNavigateOnDrop = testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+    if (canNavigateOnDrop != prefs->can_accept_load_drops) {
+        prefs->can_accept_load_drops = canNavigateOnDrop;
+        changed = true;
+    }
     return changed;
 }
 

From c72382818f7114a3593d036e076b4f614ad13a4c Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Wed, 18 Oct 2023 01:05:23 +0200
Subject: [PATCH 508/681] Reinstall URLRequestInterceptors during new view
 adoptation

The pointer to the page interceptor is stored in WebContentsAdapter
and we lose it when recreating the adapter. Prevent this and add
auto test.

Fixes: QTBUG-117867
Change-Id: I5e79cdcc5996bdf2bb53c3016d4133f978ccfb39
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d2f119a94d27a98fd58a0c60bacfc8f91e028a34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.cpp               |  2 +
 .../qwebenginepage/tst_qwebenginepage.cpp     | 49 +++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index bce5f1e89ae..13f2f387ec1 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -456,6 +456,8 @@ bool QWebEnginePagePrivate::adoptWebContents(WebContentsAdapter *webContents)
 
     m_isBeingAdopted = true;
 
+    webContents->setRequestInterceptor(adapter->requestInterceptor());
+
     // This throws away the WebContentsAdapter that has been used until now.
     // All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter.
     WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis());
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 5e540babeda..538195854bb 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -65,6 +65,7 @@
 #include <qwebenginescript.h>
 #include <qwebenginescriptcollection.h>
 #include <qwebenginesettings.h>
+#include <qwebengineurlrequestinterceptor.h>
 #include <qwebengineurlrequestjob.h>
 #include <qwebengineurlscheme.h>
 #include <qwebengineurlschemehandler.h>
@@ -271,6 +272,7 @@ private Q_SLOTS:
     void childFrameInput();
     void openLinkInNewPageWithWebWindowType_data();
     void openLinkInNewPageWithWebWindowType();
+    void keepInterceptorAfterNewWindowRequested();
 
 private:
     static bool isFalseJavaScriptResult(QWebEnginePage *page, const QString &javaScript);
@@ -5328,6 +5330,53 @@ void tst_QWebEnginePage::openLinkInNewPageWithWebWindowType()
     QCOMPARE(page.windowType, webWindowType);
 }
 
+class DoNothingInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+    DoNothingInterceptor() { }
+
+    void interceptRequest(QWebEngineUrlRequestInfo &) override
+    {
+        ran = true;
+    }
+    bool ran = false;
+};
+
+void tst_QWebEnginePage::keepInterceptorAfterNewWindowRequested()
+{
+    DoNothingInterceptor interceptor;
+    QWebEnginePage page;
+    page.setUrlRequestInterceptor(&interceptor);
+    connect(&page, &QWebEnginePage::newWindowRequested, [&](QWebEngineNewWindowRequest &request) {
+        request.openIn(&page);
+    });
+    QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+
+    QWebEngineView view;
+    view.resize(500, 500);
+    view.setPage(&page);
+    view.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+    page.setHtml("<html><body>"
+                  "<a id='link' href='hello' target='_blank'>link</a>"
+                  "</body></html>");
+    QTRY_COMPARE(loadFinishedSpy.size(), 1);
+    QVERIFY(loadFinishedSpy.takeFirst().value(0).toBool());
+    QVERIFY(interceptor.ran);
+    interceptor.ran = false;
+
+    QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
+    QTRY_COMPARE(loadFinishedSpy.size(), 1);
+    QVERIFY(loadFinishedSpy.takeFirst().value(0).toBool());
+    QVERIFY(!interceptor.ran);
+
+    page.setHtml("<html><body></body></html>");
+    QTRY_COMPARE(loadFinishedSpy.size(), 1);
+    QVERIFY(loadFinishedSpy.takeFirst().value(0).toBool());
+    QVERIFY(interceptor.ran);
+}
+
 static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
 W_QTEST_MAIN(tst_QWebEnginePage, params)
 

From 0e7ef8f647e80ee0d2e477a0410b3cf0d7708e50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 2 Nov 2023 00:02:02 +0100
Subject: [PATCH 509/681] Update Chromium patch level version

Change-Id: Iea6afb09f56698ad82ffd4ee327c14f621613a44
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index f1e99ae0553..12f4aeda5cc 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           117.0.5938.149
+Patched with security patches up to Chromium version:           118.0.5993.117
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 26a3ede21be..81a22ff6cf0 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -974,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "117.0.5938.149"; // FIXME: Remember to update
+    return "118.0.5993.117"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From e6c7af122669d7ea4dc9bb163e200a571a08da7b Mon Sep 17 00:00:00 2001
From: Vladimir Belyavsky <belyavskyv@gmail.com>
Date: Sun, 22 Oct 2023 11:07:15 +0300
Subject: [PATCH 510/681] Compositor: fix potential nullptr access

Check m_binding under the mutex to avoid data race and potentially
crash on nullptr access.

Fixes: QTBUG-118455
Pick-to: 6.5
Change-Id: I169c90226616e14461875aae1c72bbba2b36de8c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 888f786ff054d2216ddb669992ffe5aeae7f82d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/compositor/compositor.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index 6bfb3140fef..4d0648e1aca 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -93,10 +93,8 @@ void Compositor::Observer::unbind()
 
 Compositor::Handle<Compositor> Compositor::Observer::compositor()
 {
-    if (!m_binding)
-        return nullptr;
     g_bindings.lock();
-    if (m_binding->compositor)
+    if (m_binding && m_binding->compositor)
         return m_binding->compositor; // delay unlock
     g_bindings.unlock();
     return nullptr;
@@ -127,10 +125,8 @@ void Compositor::unbind()
 
 Compositor::Handle<Compositor::Observer> Compositor::observer()
 {
-    if (!m_binding)
-        return nullptr;
     g_bindings.lock();
-    if (m_binding->observer)
+    if (m_binding && m_binding->observer)
         return m_binding->observer; // delay unlock
     g_bindings.unlock();
     return nullptr;

From 567a00c3d10c8abb198ad3b8f59c2e7e908b8348 Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Wed, 4 Oct 2023 12:59:49 +0200
Subject: [PATCH 511/681] Handle vaapi-libvxp incompability in config

We disable system libvpx in favor of vaapi at config time.
However the system lib is listed in the config message as enabled.
* Disable system libvpx by defautlt.
* Print a warning if both are explicitly enabled.
* Remove the hidden logic from cmake.

Fixes: QTBUG-117741
Change-Id: Ib5f4e5289827f5ae95a3899c132a85c1ef7d21dd
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 716aa4845a62137ad2840c87e5dd54e04a6ee736)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 configure.cmake              | 1 +
 src/core/CMakeLists.txt      | 9 +--------
 src/core/api/configure.cmake | 8 +++++++-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index 8f30b34466b..3d383fb50bc 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -347,6 +347,7 @@ qt_feature("webengine-system-ffmpeg" PRIVATE
 )
 qt_feature("webengine-system-libvpx" PRIVATE
     LABEL "libvpx"
+    AUTODETECT FALSE
     CONDITION UNIX AND TEST_vpx
 )
 qt_feature("webengine-system-snappy" PRIVATE
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 4153ce180d0..1416f1d2ba7 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -425,7 +425,7 @@ foreach(arch ${archs})
                 ozone_extra_path="${CMAKE_CURRENT_LIST_DIR}/ozone/ozone_extra.gni"
             )
             set(systemLibs libjpeg libpng freetype harfbuzz libevent libwebp libxml
-                opus snappy icu ffmpeg re2 lcms2 libopenjpeg2
+                opus snappy icu ffmpeg re2 lcms2 libopenjpeg2 libvpx
             )
             foreach(slib ${systemLibs})
                 extend_gn_list(gnArgArg
@@ -479,13 +479,6 @@ foreach(arch ${archs})
                 ARGS use_vaapi
                 CONDITION QT_FEATURE_webengine_vaapi
             )
-            if(NOT QT_FEATURE_webengine_vaapi)
-                # hardware accelerated encoding requires bundled libvpx
-                extend_gn_list(gnArgArg
-                    ARGS use_system_libvpx
-                    CONDITION QT_FEATURE_webengine_system_libvpx
-                )
-            endif()
             extend_gn_list(gnArgArg
                 ARGS ozone_platform_x11 use_xkbcommon
                 CONDITION QT_FEATURE_webengine_ozone_x11
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index ed92c12e8c4..df65aaa691e 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -163,7 +163,8 @@ qt_feature("webengine-vaapi" PRIVATE
     LABEL "VA-API support"
     PURPOSE "Enables support for VA-API hardware acceleration"
     AUTODETECT GBM_FOUND AND LIBVA_FOUND AND QT_FEATURE_vulkan
-    CONDITION LINUX
+    # hardware accelerated encoding requires bundled libvpx
+    CONDITION LINUX AND NOT QT_FEATURE_webengine_system_libvpx
 )
 # internal testing feature
 qt_feature("webengine-system-poppler" PRIVATE
@@ -226,3 +227,8 @@ qt_configure_add_report_entry(
     MESSAGE "WebRTC requires XDamage with qpa_xcb."
     CONDITION QT_FEATURE_webengine_ozone_x11 AND NOT XDAMAGE_FOUND
 )
+qt_configure_add_report_entry(
+    TYPE WARNING
+    MESSAGE "VA-API is incompatible with system libvpx."
+    CONDITION QT_FEATURE_webengine_system_libvpx AND QT_FEATURE_webengine_vaapi
+)

From f1ee7ca6f839dd2c2a0f95d5299f0cea947847f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 2 Nov 2023 22:26:33 +0100
Subject: [PATCH 512/681] Update Chromium

Submodule src/3rdparty fdbad563..059e30a8:
  * [Backport] CVE-2023-45853: Buffer overflow in MiniZip (2/2)
  * [Backport] CVE-2023-45853: Buffer overflow in MiniZip (1/2)
  * [Backport] Security bug 1471305
  * [Backport] CVE-2023-5482 and CVE-2023-5849
  * [Backport] Security bug 1478470

Fixes: QTBUG-118684
Change-Id: I285d764bfa562ca587a23d12486dd4e38942c222
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 12f4aeda5cc..92645a3a38f 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           118.0.5993.117
+Patched with security patches up to Chromium version:           119.0.6045.105
diff --git a/src/3rdparty b/src/3rdparty
index fdbad56331e..059e30a8c35 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit fdbad56331edfa46f841f1f1aa606a98c5fc6e7e
+Subproject commit 059e30a8c355bd0dfdf984a85aefdbf7965dadf0
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 81a22ff6cf0..e2d48f1fdb9 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -974,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "118.0.5993.117"; // FIXME: Remember to update
+    return "119.0.6045.105"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 63dd729511b5c4f05fc7994e7fd6ebf1f947ec28 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 3 Nov 2023 14:45:54 +0000
Subject: [PATCH 513/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Ib14c2499f40d30c5367404f7f6da0596463c3aa0
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
---
 dependencies.yaml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 5363e4c54b9..1c9408b525b 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
-  ../qtdeclarative:
-    ref: d7ba66128eb7e542ce6f2f1582b45e0149159d7f
+  ../tqtc-qtdeclarative:
+    ref: 3188012dcf48834492869c0b839eec0cc8f9bbd5
     required: true
-  ../qtpositioning:
-    ref: b9db9ab1ae59f6639fdf388d349c68609287c498
+  ../tqtc-qtpositioning:
+    ref: 68dd28890c724c24277017df6fc0eb2cb9c9e8ed
     required: false
-  ../qttools:
-    ref: 9712de2e27b0124fb79110a1075e54f4a986a85e
+  ../tqtc-qttools:
+    ref: b2cc3e83aa198601376e9c49e2d4aeda104aeb0a
     required: false
-  ../qtwebchannel:
-    ref: 3e1a553f77d1fc412e13355274aabd504dc91d38
+  ../tqtc-qtwebchannel:
+    ref: 52f929cf5b21f16b792bf1d1d9e27083aa610071
     required: false

From 62b3d795d2abfe9bc67f560c5e2e276092946455 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 3 Nov 2023 15:30:56 +0000
Subject: [PATCH 514/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ib55924c84554a2a2d0d247b0a03a56ba0c067278
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 309d6bd86f8..b2ada13db55 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 43217be9bcc786bff6d0ed23e70a4077e069c29f
+    ref: 7935b601f33a9b391a45d06e228959d633a950af
     required: true
   ../qtpositioning:
-    ref: 934cde1f45f8a1bb830c807beb7ca24e65cb123c
+    ref: 2724dcfd40c8e6d90ec3d42a7b5b41e404fbd38b
     required: false
   ../qttools:
-    ref: ff8ab8504c46f9e73d37809a8361de14e374a9a1
+    ref: c02a01b6f5ded6b5df198403b16ba9365aa2ff51
     required: false
   ../qtwebchannel:
-    ref: 46a4a1983fa8deb85517440a54dbbaee41d4b2a2
+    ref: 1ccac35c6ffe6d9599c8def06b32b8398d0b0457
     required: false

From 81e9907fcb976971003c5de16620d4ba4c556d88 Mon Sep 17 00:00:00 2001
From: Vladimir Belyavsky <belyavskyv@gmail.com>
Date: Sun, 22 Oct 2023 11:07:15 +0300
Subject: [PATCH 515/681] Compositor: fix potential nullptr access

Check m_binding under the mutex to avoid data race and potentially
crash on nullptr access.

Fixes: QTBUG-118455
Change-Id: I169c90226616e14461875aae1c72bbba2b36de8c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 888f786ff054d2216ddb669992ffe5aeae7f82d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e6c7af122669d7ea4dc9bb163e200a571a08da7b)
---
 src/core/compositor/compositor.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index c147f988b35..d576e09231c 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -94,10 +94,8 @@ void Compositor::Observer::unbind()
 
 Compositor::Handle<Compositor> Compositor::Observer::compositor()
 {
-    if (!m_binding)
-        return nullptr;
     g_bindings.lock();
-    if (m_binding->compositor)
+    if (m_binding && m_binding->compositor)
         return m_binding->compositor; // delay unlock
     g_bindings.unlock();
     return nullptr;
@@ -128,10 +126,8 @@ void Compositor::unbind()
 
 Compositor::Handle<Compositor::Observer> Compositor::observer()
 {
-    if (!m_binding)
-        return nullptr;
     g_bindings.lock();
-    if (m_binding->observer)
+    if (m_binding && m_binding->observer)
         return m_binding->observer; // delay unlock
     g_bindings.unlock();
     return nullptr;

From eeda31d09574ad46435085eda45547dbc3ad0779 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 29 Sep 2023 14:57:01 +0200
Subject: [PATCH 516/681] Remove WebEngineDownloadItem type from docs

It was renamed to WebEngineDownloadRequest.

Change-Id: Ibb00a0d10459110ceb7264631de5981f256f6c65
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4800edadf386ef317edc121ec7d2d93ac8e7cb05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/webenginequick/api/qquickwebengineprofile.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp
index 4cf4dc78f1f..270f9cd53bc 100644
--- a/src/webenginequick/api/qquickwebengineprofile.cpp
+++ b/src/webenginequick/api/qquickwebengineprofile.cpp
@@ -325,16 +325,16 @@ QQuickWebEngineScriptCollection *QQuickWebEngineProfilePrivate::getUserScripts()
 */
 
 /*!
-    \qmlsignal WebEngineProfile::downloadRequested(WebEngineDownloadItem download)
+    \qmlsignal WebEngineProfile::downloadRequested(WebEngineDownloadRequest download)
 
     This signal is emitted whenever a download has been triggered.
     The \a download argument holds the state of the download.
-    The download has to be explicitly accepted with WebEngineDownloadItem::accept() or the
+    The download has to be explicitly accepted with WebEngineDownloadRequest::accept() or the
     download will be cancelled by default.
 */
 
 /*!
-    \qmlsignal WebEngineProfile::downloadFinished(WebEngineDownloadItem download)
+    \qmlsignal WebEngineProfile::downloadFinished(WebEngineDownloadRequest download)
 
     This signal is emitted whenever downloading stops, because it finished successfully, was
     cancelled, or was interrupted (for example, because connectivity was lost).

From 78c30b625914123d541b9b2f0a538e5e0883531b Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 29 Sep 2023 16:08:34 +0200
Subject: [PATCH 517/681] Allow cancelling automatically accepted download
 requests

Calling QWebEngineDownloadRequest::cancel() had no effect if the download
request was accepted by default. These downloads had no corresponding
internal DownloadItem yet, but we tried to cancel them using the
DownloadManager. The safest option is to always check if the DownloadItem
exists in Chromium.

Task-number: QTBUG-117624
Change-Id: I8f92d45e00e088aea7d22d5b7271b5b09adf6cbb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 02675c653eb1b03ba84409e20a15f4a502b88bab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginedownloadrequest.cpp  | 18 ++++++++++-----
 src/core/download_manager_delegate_qt.cpp   |  7 ++++--
 src/core/download_manager_delegate_qt.h     |  2 +-
 src/core/profile_adapter.cpp                |  4 ++--
 src/core/profile_adapter.h                  |  2 +-
 tests/auto/quick/qmltests/data/tst_save.qml | 25 ++++++++++++++++++---
 6 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp
index e51fe7c0fd2..07ea3760090 100644
--- a/src/core/api/qwebenginedownloadrequest.cpp
+++ b/src/core/api/qwebenginedownloadrequest.cpp
@@ -219,16 +219,22 @@ void QWebEngineDownloadRequest::cancel()
 
     QWebEngineDownloadRequest::DownloadState state = d->downloadState;
 
-    if (state == QWebEngineDownloadRequest::DownloadCompleted
-            || state == QWebEngineDownloadRequest::DownloadCancelled)
+    if (state == QWebEngineDownloadRequest::DownloadCompleted)
         return;
 
-    // We directly cancel the download request if the user cancels
-    // before it even started, so no need to notify the profile here.
+    bool cancelled = state == QWebEngineDownloadRequest::DownloadCancelled;
+    if (cancelled)
+        return;
+
+    // Check if the download manager has a DownloadItem for this ID
+    // (network downloads or in progress page/resource saves)
     if (state == QWebEngineDownloadRequest::DownloadInProgress) {
         if (d->profileAdapter)
-            d->profileAdapter->cancelDownload(d->downloadId);
-    } else {
+            cancelled = d->profileAdapter->cancelDownload(d->downloadId);
+    }
+
+    // Not cancelled downloads are not even started yet at this point
+    if (!cancelled) {
         d->downloadState = QWebEngineDownloadRequest::DownloadCancelled;
         Q_EMIT stateChanged(d->downloadState);
         d->setFinished();
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 1f66bbf5155..c0fd0d3eeed 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -59,10 +59,13 @@ void DownloadManagerDelegateQt::cancelDownload(content::DownloadTargetCallback c
                             download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
 }
 
-void DownloadManagerDelegateQt::cancelDownload(quint32 downloadId)
+bool DownloadManagerDelegateQt::cancelDownload(quint32 downloadId)
 {
-    if (download::DownloadItem *download = findDownloadById(downloadId))
+    if (download::DownloadItem *download = findDownloadById(downloadId)) {
         download->Cancel(/* user_cancel */ true);
+        return true;
+    }
+    return false;
 }
 
 void DownloadManagerDelegateQt::pauseDownload(quint32 downloadId)
diff --git a/src/core/download_manager_delegate_qt.h b/src/core/download_manager_delegate_qt.h
index f807301d10b..cc6d49764f6 100644
--- a/src/core/download_manager_delegate_qt.h
+++ b/src/core/download_manager_delegate_qt.h
@@ -46,7 +46,7 @@ class DownloadManagerDelegateQt
                         bool can_save_as_complete,
                         content::SavePackagePathPickedCallback callback) override;
 
-    void cancelDownload(quint32 downloadId);
+    bool cancelDownload(quint32 downloadId);
     void pauseDownload(quint32 downloadId);
     void resumeDownload(quint32 downloadId);
     void removeDownload(quint32 downloadId);
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 8767f4e0dfb..fdb01d4edab 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -201,9 +201,9 @@ void ProfileAdapter::removeClient(ProfileAdapterClient *adapterClient)
     m_clients.removeOne(adapterClient);
 }
 
-void ProfileAdapter::cancelDownload(quint32 downloadId)
+bool ProfileAdapter::cancelDownload(quint32 downloadId)
 {
-    downloadManagerDelegate()->cancelDownload(downloadId);
+    return downloadManagerDelegate()->cancelDownload(downloadId);
 }
 
 void ProfileAdapter::pauseDownload(quint32 downloadId)
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index ab4622a4bf6..317364ac088 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -68,7 +68,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
     void addClient(ProfileAdapterClient *adapterClient);
     void removeClient(ProfileAdapterClient *adapterClient);
 
-    void cancelDownload(quint32 downloadId);
+    bool cancelDownload(quint32 downloadId);
     void pauseDownload(quint32 downloadId);
     void resumeDownload(quint32 downloadId);
     void removeDownload(quint32 downloadId);
diff --git a/tests/auto/quick/qmltests/data/tst_save.qml b/tests/auto/quick/qmltests/data/tst_save.qml
index e9e6d5d836a..3289dbd8b90 100644
--- a/tests/auto/quick/qmltests/data/tst_save.qml
+++ b/tests/auto/quick/qmltests/data/tst_save.qml
@@ -17,6 +17,7 @@ TestWebEngineView {
     property bool isSavePageDownload: false
     property var downloadState: []
     property int savePageFormat: WebEngineDownloadRequest.MimeHtmlSaveFormat;
+    property bool autoCancel: false
 
     TempDir {
         id: tempDir
@@ -44,6 +45,9 @@ TestWebEngineView {
             downloadDir = download.downloadDirectory;
             downloadFileName = download.downloadFileName
             isSavePageDownload = download.isSavePageDownload
+
+            if (autoCancel)
+                download.cancel()
         }
         onDownloadFinished: function(download) {
             receivedBytes = download.receivedBytes
@@ -78,6 +82,7 @@ TestWebEngineView {
             isSavePageDownload = false
             downloadState = []
             downloadUrl = ""
+            autoCancel = false
         }
 
         function test_savePage_data() {
@@ -124,7 +129,16 @@ TestWebEngineView {
             verify(verifyData())
         }
 
-        function test_saveImage() {
+        function test_saveImage_data() {
+            return [
+                   { tag: "Auto accept", autoCancel: false },
+                   { tag: "Cancel", autoCancel: true },
+            ];
+        }
+
+        function test_saveImage(row) {
+            autoCancel = row.autoCancel
+
             var fileDir = tempDir.path()
             var fileName = "favicon.png"
             var filePath = fileDir + "/"+ fileName
@@ -143,8 +157,13 @@ TestWebEngineView {
             compare(downloadState[0], WebEngineDownloadRequest.DownloadInProgress)
             downloadFinishedSpy.wait()
             compare(downloadFinishedSpy.count, 1)
-            compare(totalBytes, receivedBytes)
-            compare(downloadState[1], WebEngineDownloadRequest.DownloadCompleted)
+            if (autoCancel) {
+                compare(receivedBytes, 0)
+                compare(downloadState[1], WebEngineDownloadRequest.DownloadCancelled)
+            } else {
+                compare(totalBytes, receivedBytes)
+                compare(downloadState[1], WebEngineDownloadRequest.DownloadCompleted)
+            }
         }
 
         function test_saveWebAction() {

From be68bb20396c876fe08cfd794ed85fd163d02b80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 2 Nov 2023 22:19:37 +0100
Subject: [PATCH 518/681] Update Chromium

Submodule src/3rdparty 8146bf85..4253d879:
  * [Backport] CVE-2023-45853:  Buffer overflow in MiniZip (2/2)
  * [Backport] CVE-2023-45853:  Buffer overflow in MiniZip (1/2)
  * [Backport] Security bug 1471305
  * [Backport] CVE-2023-5482 and CVE-2023-5849
  * [Backport] Security bug 1478470

Fixes: QTBUG-118682
Change-Id: I067d1d9f7791d57d95a12a1f9762998d56ed4de2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ec27984cfb257e94a0ca6fdb2e40c278fdf94663)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index cbdb9d3bdff..fcd5df99e2b 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           118.0.5993.117
+Patched with security patches up to Chromium version:           119.0.6045.105
diff --git a/src/3rdparty b/src/3rdparty
index 8146bf85433..4253d879ba8 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 8146bf8543363d4c48cbaf854909abccf84de020
+Subproject commit 4253d879ba8a63bf70d87b80b286936456d1042e
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 5fe40641520..58ea3cc4501 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -965,7 +965,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "118.0.5993.117"; // FIXME: Remember to update
+    return "119.0.6045.105"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From c630b01dcc185ca164c1321488e3057e2b95e38f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 8 Nov 2023 00:12:40 +0000
Subject: [PATCH 519/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I621fdacd7cb8143d1441bb302104e64cef67a045
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 1c9408b525b..b8b63e15415 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 3188012dcf48834492869c0b839eec0cc8f9bbd5
+    ref: 44571f7c3d344750ee30b5e00c5e6516221156b8
     required: true
   ../tqtc-qtpositioning:
-    ref: 68dd28890c724c24277017df6fc0eb2cb9c9e8ed
+    ref: 057181a568dd9a0d3506d7dae4c6b1643e0ed676
     required: false
   ../tqtc-qttools:
-    ref: b2cc3e83aa198601376e9c49e2d4aeda104aeb0a
+    ref: 06b82d8a072f61749a4c94fd825da5a53bf1d289
     required: false
   ../tqtc-qtwebchannel:
-    ref: 52f929cf5b21f16b792bf1d1d9e27083aa610071
+    ref: 53579fd4c1b78fde4d0f183b743bde6628bfc1b7
     required: false

From e49507bc71b3595e73bef97b732dc602f3172c60 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 8 Nov 2023 23:31:00 +0000
Subject: [PATCH 520/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ib60c2dd1cbb1e7f720d45815930dbad37b8113af
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b2ada13db55..ab2425663d6 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 7935b601f33a9b391a45d06e228959d633a950af
+    ref: 8e65667896899652a6de89478d8e55f7c17e4097
     required: true
   ../qtpositioning:
-    ref: 2724dcfd40c8e6d90ec3d42a7b5b41e404fbd38b
+    ref: 6e9fbd960662651408853afbf73a5aa649647a9d
     required: false
   ../qttools:
-    ref: c02a01b6f5ded6b5df198403b16ba9365aa2ff51
+    ref: 80f9a69e0fff9b32f0f29f2e1846d2ff8be8b7ef
     required: false
   ../qtwebchannel:
-    ref: 1ccac35c6ffe6d9599c8def06b32b8398d0b0457
+    ref: 3544af678cffa9e9260fd63abb261df5d071f7db
     required: false

From 2459586ff50c5182244029ee661eecb669a6edb8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 7 Nov 2023 12:15:08 +0100
Subject: [PATCH 521/681] Update Chromium

Submodule src/3rdparty 059e30a8..208e83e1:
  * [Backport] CVE-2023-5996: Use after free in WebAudio
  * Fixup for [Backport] CVE-2023-5484: Inappropriate implementation in Navigation

Fixes: QTBUG-118893
Fixes: QTBUG-118850
Change-Id: I6b62d0f7ba31078ad39e527089a096adf85528b0
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 92645a3a38f..1778a8598dc 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           119.0.6045.105
+Patched with security patches up to Chromium version:           119.0.6045.123
diff --git a/src/3rdparty b/src/3rdparty
index 059e30a8c35..208e83e1f53 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 059e30a8c355bd0dfdf984a85aefdbf7965dadf0
+Subproject commit 208e83e1f53f596946304e072ec028866b1bdc3f
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index e2d48f1fdb9..519b5e6e7a0 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -974,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.105"; // FIXME: Remember to update
+    return "119.0.6045.123"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 1b7cb04904abca1796a9c1b169f7eada06c56c91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 6 Nov 2023 11:48:29 +0100
Subject: [PATCH 522/681] Mention the need to deploy v8 context snapshots for
 Qt WebEngine

It was missing from the documentation.

Fixes: QTBUG-118655
Change-Id: I4961cada70b51a9d243e69de42a037f29957214d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit bef1d20970298fc9a680288349298c32ffb7aae3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/doc/src/qtwebengine-deploying.qdoc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index d75f8572eca..08f7a6b1c26 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -98,6 +98,12 @@
         \li \c icudtl.dat provides support for International Components for
             Unicode (ICU). It is the Chromium version of ICU, which is not
             needed if \QWE was configured to use the system ICU.
+        \li \c v8_context_snapshot.bin contains a previously prepared snapshot
+            of a v8 context used to speed up initialization. Debug builds use
+            separate snapshots with the file name extension \c .debug.bin instead
+            of \c .bin. On \macos, there is a snapshot for each architecture named
+            accordingly, for example \c v8_context_snapshot.arm64.bin or
+            \c v8_context_snapshot.arm64.debug.bin.
     \endlist
 
     Resources are searched from the following locations:

From ff6fc24382cbe708ee53688171c9deee5ac6e68c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 9 Nov 2023 21:38:27 +0000
Subject: [PATCH 523/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I93b1c153c0b391bd3b0fc88092f817fb6f7888ee
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index b8b63e15415..692aff7e548 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 44571f7c3d344750ee30b5e00c5e6516221156b8
+    ref: 9fe7256c345a17af54112f378b9ecf5c2fca0ab3
     required: true
   ../tqtc-qtpositioning:
-    ref: 057181a568dd9a0d3506d7dae4c6b1643e0ed676
+    ref: 38fd39cda7eea48b7bf3c5ed0be86d01784fb449
     required: false
   ../tqtc-qttools:
-    ref: 06b82d8a072f61749a4c94fd825da5a53bf1d289
+    ref: e13f0f5a6ea65669d3b493305e35c0959442ac77
     required: false
   ../tqtc-qtwebchannel:
-    ref: 53579fd4c1b78fde4d0f183b743bde6628bfc1b7
+    ref: 0a9c095d81947c04302ccc277861e2e9031fc613
     required: false

From 609fe240e932e45ce630bb48954f951a01b92ce2 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 13 Oct 2023 14:45:44 +0200
Subject: [PATCH 524/681] Let page interceptor process requests with extra
 headers

If a QWebEngineUrlRequestInterceptor has added extra headers to
the request on profile level, later the request was not processed
by the page interceptor. Relax this rule and only prevent the
interception of blocked or redirected requests.

Add auto test and extend documentation.

Task-number: QTBUG-117752
Change-Id: I503bfc256a5e874a678be64c597c74e04e7ce966
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit eda7378655fa047007dcdb47aec3641b2a89d0de)
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
---
 src/core/api/qwebenginepage.cpp               |  4 +-
 src/core/api/qwebengineurlrequestinfo.cpp     |  2 -
 .../net/proxying_url_loader_factory_qt.cpp    | 17 +++---
 .../tst_qwebengineurlrequestinterceptor.cpp   | 61 ++++++++++++++++++-
 4 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 13f2f387ec1..71769714c22 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -1697,7 +1697,9 @@ void QWebEnginePagePrivate::visibleChanged(bool visible)
 
     The page does not take ownership of the pointer. This interceptor is called
     after any interceptors on the profile, and unlike profile interceptors, only
-    URL requests from this page are intercepted.
+    URL requests from this page are intercepted. If the original request was
+    already blocked or redirected by the profile interceptor, it will not be
+    intercepted by this.
 
     To unset the request interceptor, set a \c nullptr.
 
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index 162ae7daf4a..fa8870c09c2 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -285,8 +285,6 @@ void QWebEngineUrlRequestInfo::block(bool shouldBlock)
 
 void QWebEngineUrlRequestInfo::setHttpHeader(const QByteArray &name, const QByteArray &value)
 {
-    d_ptr->changed = true;
-
     // Headers are case insentive, so we need to compare manually
     for (auto it = d_ptr->extraHeaders.begin(); it != d_ptr->extraHeaders.end(); ++it) {
         if (it.key().compare(name, Qt::CaseInsensitive) == 0) {
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 6743ff888df..2478a363804 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -361,19 +361,18 @@ void InterceptedRequest::ContinueAfterIntercept()
         const auto scoped_request_info = std::move(request_info_);
         QWebEngineUrlRequestInfoPrivate &info = *scoped_request_info->d_ptr;
 
+        for (auto header = info.extraHeaders.constBegin(); header != info.extraHeaders.constEnd(); ++header) {
+            std::string h = header.key().toStdString();
+            if (base::EqualsCaseInsensitiveASCII(h, "referer"))
+                request_.referrer = GURL(header.value().toStdString());
+            else
+                request_.headers.SetHeader(h, header.value().toStdString());
+        }
+
         if (info.changed) {
             if (info.shouldBlockRequest)
                 return SendErrorAndCompleteImmediately(net::ERR_BLOCKED_BY_CLIENT);
 
-            for (auto header = info.extraHeaders.constBegin(); header != info.extraHeaders.constEnd(); ++header) {
-                std::string h = header.key().toStdString();
-                if (base::EqualsCaseInsensitiveASCII(h, "referer")) {
-                    request_.referrer = GURL(header.value().toStdString());
-                } else {
-                    request_.headers.SetHeader(h, header.value().toStdString());
-                }
-            }
-
             if (info.shouldRedirectRequest) {
                 net::RedirectInfo::FirstPartyURLPolicy first_party_url_policy =
                         request_.update_first_party_url_on_redirect ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index 73185837a16..6774a51f0b6 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -48,6 +48,8 @@ private Q_SLOTS:
     void replaceInterceptor();
     void replaceOnIntercept();
     void multipleRedirects();
+    void profilePreventsPageInterception_data();
+    void profilePreventsPageInterception();
 };
 
 tst_QWebEngineUrlRequestInterceptor::tst_QWebEngineUrlRequestInterceptor()
@@ -134,7 +136,7 @@ class TestRequestInterceptor : public QWebEngineUrlRequestInterceptor
 
         // MEMO avoid unintentionally changing request when it is not needed for test logic
         //      since api behavior depends on 'changed' state of the info object
-        Q_ASSERT(info.changed() == (block || redirect || !headers.empty()));
+        Q_ASSERT(info.changed() == (block || redirect));
     }
 
     bool shouldSkipRequest(const RequestInfo &requestInfo)
@@ -935,5 +937,62 @@ void tst_QWebEngineUrlRequestInterceptor::multipleRedirects()
     QTRY_COMPARE(multiInterceptor.requestInfos.size(), 2);
 }
 
+class PageOrProfileInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+    PageOrProfileInterceptor(const QString &profileAction)
+        : profileAction(profileAction)
+    {
+    }
+
+    void interceptRequest(QWebEngineUrlRequestInfo &info) override
+    {
+        if (profileAction == "block")
+            info.block(true);
+        else if (profileAction == "redirect")
+            info.redirect(QUrl("data:text/html,<p>redirected"));
+        else if (profileAction == "add header")
+            info.setHttpHeader("Custom-Header", "Value");
+        else
+            QVERIFY(info.httpHeaders().contains("Custom-Header"));
+        ran = true;
+    }
+
+    QString profileAction;
+    bool ran = false;
+};
+
+void tst_QWebEngineUrlRequestInterceptor::profilePreventsPageInterception_data()
+{
+    QTest::addColumn<QString>("profileAction");
+    QTest::addColumn<bool>("interceptInProfile");
+    QTest::addColumn<bool>("interceptInPage");
+    QTest::newRow("block") << "block" << true << false;
+    QTest::newRow("redirect") << "redirect" << true << false;
+    QTest::newRow("add header") << "add header" << true << true;
+}
+
+void tst_QWebEngineUrlRequestInterceptor::profilePreventsPageInterception()
+{
+    QFETCH(QString, profileAction);
+    QFETCH(bool, interceptInProfile);
+    QFETCH(bool, interceptInPage);
+
+    QWebEngineProfile profile;
+    PageOrProfileInterceptor profileInterceptor(profileAction);
+    profile.setUrlRequestInterceptor(&profileInterceptor);
+    profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+
+    QWebEnginePage page(&profile);
+    PageOrProfileInterceptor pageInterceptor("");
+    page.setUrlRequestInterceptor(&pageInterceptor);
+    QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+
+    page.load(QUrl("qrc:///resources/index.html"));
+    QTRY_COMPARE(loadSpy.size(), 1);
+    QCOMPARE(profileInterceptor.ran, interceptInProfile);
+    QCOMPARE(pageInterceptor.ran, interceptInPage);
+}
+
 QTEST_MAIN(tst_QWebEngineUrlRequestInterceptor)
 #include "tst_qwebengineurlrequestinterceptor.moc"

From 9a83f8027123a4700eb21a0fe0a05905cba6be8b Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 10 Nov 2023 18:24:13 +0000
Subject: [PATCH 525/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Idd0e5b25d149b69f9f2a3c542b09daba5768895d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index ab2425663d6..cccfc88618d 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 8e65667896899652a6de89478d8e55f7c17e4097
+    ref: b77c53d402d2c21cb48b965be1e3d68a16e4d3eb
     required: true
   ../qtpositioning:
-    ref: 6e9fbd960662651408853afbf73a5aa649647a9d
+    ref: f1e970b51dcd92730faa2fe911433999069e7e67
     required: false
   ../qttools:
-    ref: 80f9a69e0fff9b32f0f29f2e1846d2ff8be8b7ef
+    ref: e8e7c4386450d8c1aef05c4a3434f3f32fe8a605
     required: false
   ../qtwebchannel:
-    ref: 3544af678cffa9e9260fd63abb261df5d071f7db
+    ref: 1b4f094aa7dc92b1f2fe2272457b0a9bf98bd6bc
     required: false

From 5163615d6404ee4df5754f629298b1f2290514f3 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 10 Nov 2023 13:35:37 +0100
Subject: [PATCH 526/681] Fix accessibility crash on elements with cell role

Not only tables can have cell as a child.

Pick-to: 6.5
Fixes: QTBUG-119023
Task-number: QTBUG-113859
Change-Id: Ic997f752059f5ac3cac9a7d7cf1fefcecbc2ddd5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ea0682573613c1bad9d65b3e7d61f58708026c31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/browser_accessibility_qt.cpp         |  6 +--
 .../accessibility/tst_accessibility.cpp       | 53 +++++++++++++++++++
 2 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index adb6b873cc7..4b8e947c0d6 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -231,11 +231,7 @@ void *BrowserAccessibilityInterface::interface_cast(QAccessible::InterfaceType t
     }
     case QAccessible::TableCellInterface: {
         QAccessible::Role r = role();
-        if (r == QAccessible::Cell) {
-            Q_ASSERT(findTable());
-            return static_cast<QAccessibleTableCellInterface *>(this);
-        }
-        if (r == QAccessible::ListItem || r == QAccessible::TreeItem) {
+        if (r == QAccessible::Cell || r == QAccessible::ListItem || r == QAccessible::TreeItem) {
             if (findTable())
                 return static_cast<QAccessibleTableCellInterface *>(this);
         }
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp
index 9659cb8f7e3..1579b61e2fe 100644
--- a/tests/auto/widgets/accessibility/tst_accessibility.cpp
+++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp
@@ -51,6 +51,7 @@ private Q_SLOTS:
     void roles();
     void objectName();
     void crossTreeParent();
+    void tableCellInterface();
 };
 
 // This will be called before the first test function is executed.
@@ -606,6 +607,58 @@ void tst_Accessibility::crossTreeParent()
     QCOMPARE(p->object()->objectName(), QStringLiteral("my_id"));
 }
 
+void tst_Accessibility::tableCellInterface()
+{
+    QWebEngineView webView;
+    webView.resize(400, 400);
+    webView.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&webView));
+
+    QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
+    webView.setHtml(QLatin1String(
+            "<html><body>"
+            "  <ul>"
+            "    <li><a href='#link1' id='link1'>Link in ListItem</a></li>"
+            "  </ul>"
+            ""
+            "  <div role='rowgroup'>"
+            "    <div role='row'>"
+            "      <span role='cell'><a href='#link2' id='link2'>Link in Cell</a></span>"
+            "    </div>"
+            "  </div>"
+            "</body></html>"));
+    QTRY_COMPARE(spyFinished.size(), 1);
+
+    QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
+    QAccessibleInterface *document = view->child(0);
+    QTRY_COMPARE(document->childCount(), 2);
+
+    // ListItem without Table parent.
+    {
+        QAccessibleInterface *list = document->child(0);
+        QAccessibleInterface *listItem = list->child(0);
+        QVERIFY(!listItem->tableCellInterface());
+
+        // Should not crash.
+        QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link1"));
+        QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter);
+        QTRY_COMPARE(webView.url().fragment(), QLatin1String("link1"));
+    }
+
+    // Cell without Table parent.
+    {
+        QAccessibleInterface *rowgroup = document->child(1);
+        QAccessibleInterface *row = rowgroup->child(0);
+        QAccessibleInterface *cell = row->child(0);
+        QVERIFY(!cell->tableCellInterface());
+
+        // Should not crash.
+        QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link2"));
+        QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter);
+        QTRY_COMPARE(webView.url().fragment(), QLatin1String("link2"));
+    }
+}
+
 static QByteArrayList params = QByteArrayList()
     << "--force-renderer-accessibility"
     << "--enable-features=AccessibilityExposeARIAAnnotations"

From 4b564a587a699425145bbe10b40d453bcbdc91c9 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 10 Nov 2023 13:35:37 +0100
Subject: [PATCH 527/681] Fix accessibility crash on elements with cell role

Not only tables can have cell as a child.

Fixes: QTBUG-119023
Task-number: QTBUG-113859
Change-Id: Ic997f752059f5ac3cac9a7d7cf1fefcecbc2ddd5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ea0682573613c1bad9d65b3e7d61f58708026c31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5163615d6404ee4df5754f629298b1f2290514f3)
---
 src/core/browser_accessibility_qt.cpp         |  6 +--
 .../accessibility/tst_accessibility.cpp       | 53 +++++++++++++++++++
 2 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index adb6b873cc7..4b8e947c0d6 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -231,11 +231,7 @@ void *BrowserAccessibilityInterface::interface_cast(QAccessible::InterfaceType t
     }
     case QAccessible::TableCellInterface: {
         QAccessible::Role r = role();
-        if (r == QAccessible::Cell) {
-            Q_ASSERT(findTable());
-            return static_cast<QAccessibleTableCellInterface *>(this);
-        }
-        if (r == QAccessible::ListItem || r == QAccessible::TreeItem) {
+        if (r == QAccessible::Cell || r == QAccessible::ListItem || r == QAccessible::TreeItem) {
             if (findTable())
                 return static_cast<QAccessibleTableCellInterface *>(this);
         }
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp
index 68566c0827c..f2cd4d05d06 100644
--- a/tests/auto/widgets/accessibility/tst_accessibility.cpp
+++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp
@@ -50,6 +50,7 @@ private Q_SLOTS:
     void roles();
     void objectName();
     void crossTreeParent();
+    void tableCellInterface();
 };
 
 // This will be called before the first test function is executed.
@@ -605,6 +606,58 @@ void tst_Accessibility::crossTreeParent()
     QCOMPARE(p->object()->objectName(), QStringLiteral("my_id"));
 }
 
+void tst_Accessibility::tableCellInterface()
+{
+    QWebEngineView webView;
+    webView.resize(400, 400);
+    webView.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&webView));
+
+    QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
+    webView.setHtml(QLatin1String(
+            "<html><body>"
+            "  <ul>"
+            "    <li><a href='#link1' id='link1'>Link in ListItem</a></li>"
+            "  </ul>"
+            ""
+            "  <div role='rowgroup'>"
+            "    <div role='row'>"
+            "      <span role='cell'><a href='#link2' id='link2'>Link in Cell</a></span>"
+            "    </div>"
+            "  </div>"
+            "</body></html>"));
+    QTRY_COMPARE(spyFinished.size(), 1);
+
+    QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
+    QAccessibleInterface *document = view->child(0);
+    QTRY_COMPARE(document->childCount(), 2);
+
+    // ListItem without Table parent.
+    {
+        QAccessibleInterface *list = document->child(0);
+        QAccessibleInterface *listItem = list->child(0);
+        QVERIFY(!listItem->tableCellInterface());
+
+        // Should not crash.
+        QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link1"));
+        QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter);
+        QTRY_COMPARE(webView.url().fragment(), QLatin1String("link1"));
+    }
+
+    // Cell without Table parent.
+    {
+        QAccessibleInterface *rowgroup = document->child(1);
+        QAccessibleInterface *row = rowgroup->child(0);
+        QAccessibleInterface *cell = row->child(0);
+        QVERIFY(!cell->tableCellInterface());
+
+        // Should not crash.
+        QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link2"));
+        QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter);
+        QTRY_COMPARE(webView.url().fragment(), QLatin1String("link2"));
+    }
+}
+
 static QByteArrayList params = QByteArrayList()
     << "--force-renderer-accessibility"
     << "--enable-features=AccessibilityExposeARIAAnnotations";

From 2cbb620b2c62644d6aa849fbf2ef8d5ab763f16c Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Wed, 4 Oct 2023 08:53:35 +0200
Subject: [PATCH 528/681] NativeSkiaOutputDevice: handle errors on creating a
 shared texture

Avoid asserting or crashing on nullptr access after failure,.

Task-number: QTBUG-116445
Pick-to: 6.5
Change-Id: I75a99c97acfe07b4328be075b0f75df5f2357dbe
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 2ec0171d43e5377d9fe264d5f5c97e85a42e1191)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/compositor/native_skia_output_device.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
index ef38feeccbf..3067e14a7ec 100644
--- a/src/core/compositor/native_skia_output_device.cpp
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -17,6 +17,7 @@
 #include "ui/gl/gl_fence.h"
 
 #if defined(Q_OS_WIN)
+#include <QtCore/private/qsystemerror_p.h>
 #include <QtQuick/qsgtexture.h>
 #include <d3d11_1.h>
 #endif
@@ -413,7 +414,14 @@ QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureO
 
         ID3D11Texture2D *qtTexture;
         status = device->OpenSharedResource1(sharedHandle, __uuidof(ID3D11Texture2D), (void**)&qtTexture);
-        Q_ASSERT(status == S_OK);
+        if (status != S_OK) {
+            qWarning("Failed to share D3D11 texture (%s). This will result in failed rendering. Report the bug, and try restarting with QTWEBENGINE_CHROMIUM_FLAGS=--disble-gpu",
+                     qPrintable(QSystemError::windowsComString(status)));
+            ::CloseHandle(sharedHandle);
+            return nullptr;
+        }
+
+        Q_ASSERT(qtTexture);
 
         QQuickWindow::CreateTextureOptions texOpts(textureOptions);
         texture = QNativeInterface::QSGD3D11Texture::fromNative(qtTexture, win, size(), texOpts);

From c3055d618abaafada28bebe7b3b906506cc59153 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Fri, 13 Oct 2023 15:43:23 +0200
Subject: [PATCH 529/681] Add NOTIFY in QWebEnginePage property url definition

- Added missing NOTIFY in QWebEnginePage property url.

Fixes: QTBUG-117658
Pick-to: 6.5
Change-Id: I58c8161e41f02ab78c829fd9ef588506a55f6fd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 95c13aa9b551dd4ebd31710f42ced27e5078115e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginepage.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
index f52c493a0e3..61bc63e1976 100644
--- a/src/core/api/qwebenginepage.h
+++ b/src/core/api/qwebenginepage.h
@@ -49,7 +49,7 @@ class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
     Q_PROPERTY(QUrl requestedUrl READ requestedUrl)
     Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
     Q_PROPERTY(QString title READ title)
-    Q_PROPERTY(QUrl url READ url WRITE setUrl)
+    Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
     Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
     Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
     Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)

From 6bdd466d0396a208a652fcd3403dd83e570c6fed Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Mon, 18 Sep 2023 16:47:48 +0200
Subject: [PATCH 530/681] Provide the correct type information for
 WebEngineView
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

-Duplicate entries in the QML type file are created when exporting the type as a value and its enums within a namespace.
 Resolved this by introducing a derived class, and using it for exporting the Enums.

- Added namespace resolution to avoid type ambiguity

Fixes: QTBUG-117031
Change-Id: Ieea4492238843c3c781c8d9602ddc89207b61137
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit e96b6d58801f541f5e67330cf2dc6f9aa52522a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../api/qquickwebengineforeigntypes_p.h        | 18 ++++++++++++++++--
 src/webenginequick/api/qquickwebengineview.cpp |  2 +-
 src/webenginequick/api/qquickwebengineview_p.h | 17 +++++++++++------
 tests/auto/quick/publicapi/tst_publicapi.cpp   | 12 ++++++------
 4 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
index b5f3b3c22a8..e9a8c791c0f 100644
--- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -34,10 +34,17 @@
 
 QT_BEGIN_NAMESPACE
 
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineLoadingInfoDerived : public QWebEngineLoadingInfo
+{
+    Q_GADGET
+};
+
 namespace ForeignWebEngineLoadingInfoNamespace
 {
     Q_NAMESPACE
-    QML_FOREIGN_NAMESPACE(QWebEngineLoadingInfo)
+    QML_FOREIGN_NAMESPACE(QWebEngineLoadingInfoDerived)
     QML_NAMED_ELEMENT(WebEngineLoadingInfo)
     QML_ADDED_IN_VERSION(1, 1)
     QML_EXTRA_VERSION(2, 0)
@@ -199,10 +206,17 @@ struct ForeginWebEngineFileSystemAccessRequest
     QML_UNCREATABLE("")
 };
 
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineFileSystemAccessRequestDerived : public QWebEngineFileSystemAccessRequest
+{
+    Q_GADGET
+};
+
 namespace ForeginWebEngineFileSystemAccessRequestNamespace
 {
     Q_NAMESPACE
-    QML_FOREIGN_NAMESPACE(QWebEngineFileSystemAccessRequest)
+    QML_FOREIGN_NAMESPACE(QWebEngineFileSystemAccessRequestDerived)
     QML_NAMED_ELEMENT(WebEngineFileSystemAccessRequest)
     QML_ADDED_IN_VERSION(6, 4)
 };
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index 120c054e874..c14cfdda30d 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -594,7 +594,7 @@ bool QQuickWebEngineViewPrivate::isFullScreenMode() const
 void QQuickWebEngineViewPrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
 {
     Q_Q(QQuickWebEngineView);
-    if (q->receivers(SIGNAL(javaScriptConsoleMessage(JavaScriptConsoleMessageLevel,QString,int,QString))) > 0) {
+    if (q->receivers(SIGNAL(javaScriptConsoleMessage(QQuickWebEngineView::JavaScriptConsoleMessageLevel,QString,int,QString))) > 0) {
         Q_EMIT q->javaScriptConsoleMessage(static_cast<QQuickWebEngineView::JavaScriptConsoleMessageLevel>(level), message, lineNumber, sourceID);
         return;
     }
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index 1deb57a4ce7..c68dbc37a20 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -482,7 +482,7 @@ public Q_SLOTS:
     void stop();
     Q_REVISION(1,1) void findText(const QString &subString, FindFlags options = { }, const QJSValue &callback = QJSValue());
     Q_REVISION(1,1) void fullScreenCancelled();
-    Q_REVISION(1,1) void grantFeaturePermission(const QUrl &securityOrigin, Feature, bool granted);
+    Q_REVISION(1,1) void grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineView::Feature, bool granted);
     Q_REVISION(1,2) void setActiveFocusOnPress(bool arg);
     Q_REVISION(1,2) void triggerWebAction(WebAction action);
     Q_REVISION(1,3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
@@ -503,17 +503,22 @@ private Q_SLOTS:
     void loadProgressChanged();
     void linkHovered(const QUrl &hoveredUrl);
     void navigationRequested(QWebEngineNavigationRequest *request);
-    void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID);
+    void javaScriptConsoleMessage(QQuickWebEngineView::JavaScriptConsoleMessageLevel level,
+                                  const QString &message, int lineNumber, const QString &sourceID);
     Q_REVISION(1,1) void certificateError(const QWebEngineCertificateError &error);
     Q_REVISION(1,1) void fullScreenRequested(const QWebEngineFullScreenRequest &request);
     Q_REVISION(1,1) void isFullScreenChanged();
-    Q_REVISION(1,1) void featurePermissionRequested(const QUrl &securityOrigin, Feature feature);
+    Q_REVISION(1, 1)
+    void featurePermissionRequested(const QUrl &securityOrigin,
+                                    QQuickWebEngineView::Feature feature);
     Q_REVISION(1,1) void zoomFactorChanged(qreal arg);
     Q_REVISION(1,1) void profileChanged();
     Q_REVISION(1,1) void webChannelChanged();
     Q_REVISION(1,2) void activeFocusOnPressChanged(bool);
     Q_REVISION(1,2) void backgroundColorChanged();
-    Q_REVISION(1,2) void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
+    Q_REVISION(1, 2)
+    void renderProcessTerminated(QQuickWebEngineView::RenderProcessTerminationStatus terminationStatus,
+                            int exitCode);
     Q_REVISION(1,2) void windowCloseRequested();
     Q_REVISION(1,3) void contentsSizeChanged(const QSizeF& size);
     Q_REVISION(1,3) void scrollPositionChanged(const QPointF& position);
@@ -537,8 +542,8 @@ private Q_SLOTS:
     Q_REVISION(1,8) void printRequested();
     Q_REVISION(1,9) void selectClientCertificate(QQuickWebEngineClientCertificateSelection *clientCertSelection);
     Q_REVISION(1,10) void tooltipRequested(QQuickWebEngineTooltipRequest *request);
-    Q_REVISION(1,10) void lifecycleStateChanged(LifecycleState state);
-    Q_REVISION(1,10) void recommendedStateChanged(LifecycleState state);
+    Q_REVISION(1, 10) void lifecycleStateChanged(QQuickWebEngineView::LifecycleState state);
+    Q_REVISION(1, 10) void recommendedStateChanged(QQuickWebEngineView::LifecycleState state);
     Q_REVISION(1,10) void findTextFinished(const QWebEngineFindTextResult &result);
     Q_REVISION(1,11) void renderProcessPidChanged(qint64 pid);
     Q_REVISION(1,11) void canGoBackChanged();
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index d0e0fddba38..e3f9200dc37 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -694,7 +694,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.devToolsId --> QString"
     << "QQuickWebEngineView.devToolsView --> QQuickWebEngineView*"
     << "QQuickWebEngineView.devToolsViewChanged() --> void"
-    << "QQuickWebEngineView.featurePermissionRequested(QUrl,Feature) --> void"
+    << "QQuickWebEngineView.featurePermissionRequested(QUrl,QQuickWebEngineView::Feature) --> void"
     << "QQuickWebEngineView.fileDialogRequested(QQuickWebEngineFileDialogRequest*) --> void"
     << "QQuickWebEngineView.fileSystemAccessRequested(QWebEngineFileSystemAccessRequest) --> void"
     << "QQuickWebEngineView.findText(QString) --> void"
@@ -707,7 +707,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.goBack() --> void"
     << "QQuickWebEngineView.goBackOrForward(int) --> void"
     << "QQuickWebEngineView.goForward() --> void"
-    << "QQuickWebEngineView.grantFeaturePermission(QUrl,Feature,bool) --> void"
+    << "QQuickWebEngineView.grantFeaturePermission(QUrl,QQuickWebEngineView::Feature,bool) --> void"
     << "QQuickWebEngineView.history --> QWebEngineHistory*"
     << "QQuickWebEngineView.icon --> QUrl"
     << "QQuickWebEngineView.iconChanged() --> void"
@@ -715,10 +715,10 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.inspectedViewChanged() --> void"
     << "QQuickWebEngineView.isFullScreen --> bool"
     << "QQuickWebEngineView.isFullScreenChanged() --> void"
-    << "QQuickWebEngineView.javaScriptConsoleMessage(JavaScriptConsoleMessageLevel,QString,int,QString) --> void"
+    << "QQuickWebEngineView.javaScriptConsoleMessage(QQuickWebEngineView::JavaScriptConsoleMessageLevel,QString,int,QString) --> void"
     << "QQuickWebEngineView.javaScriptDialogRequested(QQuickWebEngineJavaScriptDialogRequest*) --> void"
     << "QQuickWebEngineView.lifecycleState --> QQuickWebEngineView::LifecycleState"
-    << "QQuickWebEngineView.lifecycleStateChanged(LifecycleState) --> void"
+    << "QQuickWebEngineView.lifecycleStateChanged(QQuickWebEngineView::LifecycleState) --> void"
     << "QQuickWebEngineView.linkHovered(QUrl) --> void"
     << "QQuickWebEngineView.loadHtml(QString) --> void"
     << "QQuickWebEngineView.loadHtml(QString,QUrl) --> void"
@@ -757,11 +757,11 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.renderProcessPid --> qlonglong"
     << "QQuickWebEngineView.renderProcessPidChanged(qlonglong) --> void"
     << "QQuickWebEngineView.recommendedState --> QQuickWebEngineView::LifecycleState"
-    << "QQuickWebEngineView.recommendedStateChanged(LifecycleState) --> void"
+    << "QQuickWebEngineView.recommendedStateChanged(QQuickWebEngineView::LifecycleState) --> void"
     << "QQuickWebEngineView.registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest) --> void"
     << "QQuickWebEngineView.reload() --> void"
     << "QQuickWebEngineView.reloadAndBypassCache() --> void"
-    << "QQuickWebEngineView.renderProcessTerminated(RenderProcessTerminationStatus,int) --> void"
+    << "QQuickWebEngineView.renderProcessTerminated(QQuickWebEngineView::RenderProcessTerminationStatus,int) --> void"
     << "QQuickWebEngineView.replaceMisspelledWord(QString) --> void"
     << "QQuickWebEngineView.runJavaScript(QString) --> void"
     << "QQuickWebEngineView.runJavaScript(QString,QJSValue) --> void"

From 65d5a2656ed191248c05a83a22d8b20d1b4174d4 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sun, 12 Nov 2023 20:35:27 +0000
Subject: [PATCH 531/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I5cd4826dc2a64f54ffb3a2f9e38a272b59483427
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 692aff7e548..301f06daeef 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 9fe7256c345a17af54112f378b9ecf5c2fca0ab3
+    ref: 1101d8035c95fcd72f5e330ae32e6302791b0d2a
     required: true
   ../tqtc-qtpositioning:
-    ref: 38fd39cda7eea48b7bf3c5ed0be86d01784fb449
+    ref: 8898c0a38ce094490fb1b126aaa41af716c0a9ea
     required: false
   ../tqtc-qttools:
-    ref: e13f0f5a6ea65669d3b493305e35c0959442ac77
+    ref: 6a78863534bffbcd0d50adc6ad9cd9f476f3c3aa
     required: false
   ../tqtc-qtwebchannel:
-    ref: 0a9c095d81947c04302ccc277861e2e9031fc613
+    ref: 9775a4c1acbe6607983fac198760f1954192f674
     required: false

From 2eb812f7ebb70bf50664f01846e3f73ad2c9bd38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 24 Oct 2023 10:49:36 +0200
Subject: [PATCH 532/681] Compile getAdapterLuid also with -no-opengl configs

It was not compiled in -no-opengl builds even though it should not
depend on OpenGL and was also used in non-OpenGL builds.

Fixes: QTBUG-117751
Change-Id: I0bcb8496d25004573d1e00ffc276511f82e489bd
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 751c110031fe94efec108c8f61d41eeb496a0c03)
---
 src/core/web_engine_context.cpp | 50 ++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 519b5e6e7a0..a6bee49acd0 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -178,31 +178,6 @@ bool usingSoftwareDynamicGL()
 #endif
 }
 
-#if defined(Q_OS_WIN)
-static QString getAdapterLuid() {
-    static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
-    QRhiD3D11InitParams rhiParams;
-    QRhi::Flags flags;
-    if (preferSoftwareDevice) {
-        flags |= QRhi::PreferSoftwareRenderer;
-    }
-    QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
-    // mimic what QSGRhiSupport and QBackingStoreRhi does
-    if (!rhi && !preferSoftwareDevice) {
-        flags |= QRhi::PreferSoftwareRenderer;
-        rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
-    }
-    if (rhi) {
-        const QRhiD3D11NativeHandles *handles =
-                static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
-        Q_ASSERT(handles);
-        return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
-    } else {
-        return QString();
-    }
-}
-#endif
-
 static bool openGLPlatformSupport()
 {
     return QGuiApplicationPrivate::platformIntegration()->hasCapability(
@@ -278,6 +253,31 @@ static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu
 }
 #endif // QT_CONFIG(opengl)
 
+#if defined(Q_OS_WIN)
+static QString getAdapterLuid() {
+    static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
+    QRhiD3D11InitParams rhiParams;
+    QRhi::Flags flags;
+    if (preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+    }
+    QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
+    // mimic what QSGRhiSupport and QBackingStoreRhi does
+    if (!rhi && !preferSoftwareDevice) {
+        flags |= QRhi::PreferSoftwareRenderer;
+        rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
+    }
+    if (rhi) {
+        const QRhiD3D11NativeHandles *handles =
+                static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
+        Q_ASSERT(handles);
+        return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
+    } else {
+        return QString();
+    }
+}
+#endif
+
 #if QT_CONFIG(webengine_pepper_plugins)
 void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
 {

From 15cfc1670e0bfa6c18fc6b5758b6980076839f69 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 14 Nov 2023 14:09:00 +0000
Subject: [PATCH 533/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Ifaa086970d21197099787fba7f0ab90dafa523ef
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 301f06daeef..3aa5e7fcf97 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 1101d8035c95fcd72f5e330ae32e6302791b0d2a
+    ref: b88a71361f843cd7a008470d598195d5644bdc15
     required: true
   ../tqtc-qtpositioning:
-    ref: 8898c0a38ce094490fb1b126aaa41af716c0a9ea
+    ref: 40848bb86277f4184c9617c772414ce83fe67215
     required: false
   ../tqtc-qttools:
-    ref: 6a78863534bffbcd0d50adc6ad9cd9f476f3c3aa
+    ref: bfdb4039980e12a3cea5cf852e3e847960c97c01
     required: false
   ../tqtc-qtwebchannel:
-    ref: 9775a4c1acbe6607983fac198760f1954192f674
+    ref: 67c36b5024b6aec740bf78bdce548ca6afc52c55
     required: false

From fc41826cb071ce23b2c72f4a6304672313e8f3b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 9 Nov 2023 16:45:47 +0100
Subject: [PATCH 534/681] Pass clang_version on macOS sanitizer builds

Chromium uses different clang_version numbers, which causes sanitizer builds
to look for dependencies in the wrong place.

Submodule src/3rdparty 208e83e1..e10a078e:
  * Do not remove the extension kiosk delegate from the build

Task-number: QTBUG-114865
Change-Id: I8f6028c550336a9eea3c598d00e7e53e74bbff3a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 cmake/Functions.cmake | 5 +++++
 src/3rdparty          | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index fa05bfbdf84..f8bcf9a9a36 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1053,6 +1053,11 @@ macro(append_sanitizer_setup)
             ARGS is_ubsan is_ubsan_vptr
             CONDITION undefined IN_LIST ECM_ENABLE_SANITIZERS
         )
+        if(MACOS)
+            list(APPEND gnArgArg
+                clang_version="${QT_COMPILER_VERSION_MAJOR}.${QT_COMPILER_VERSION_MINOR}.${QT_COMPILER_VERSION_PATCH}"
+            )
+        endif()
     endif()
 endmacro()
 
diff --git a/src/3rdparty b/src/3rdparty
index 208e83e1f53..e10a078e8ee 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 208e83e1f53f596946304e072ec028866b1bdc3f
+Subproject commit e10a078e8ee3ebbabcfc87c4f9f8475333faf5e0

From cff40bb7a5704d97b77bf096c80ce828a4303ca6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 9 Nov 2023 16:45:47 +0100
Subject: [PATCH 535/681] Pass clang_version on macOS sanitizer builds

Chromium uses different clang_version numbers, which causes sanitizer
builds to look for dependencies in the wrong place.

Pick-to: 6.5
Task-number: QTBUG-114865
Change-Id: I8f6028c550336a9eea3c598d00e7e53e74bbff3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9ea0c1e94f072794c568f4f82ed03a3997c8a2ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 9fb4299c50d..77be7359700 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1047,6 +1047,11 @@ macro(append_sanitizer_setup)
             ARGS is_ubsan is_ubsan_vptr
             CONDITION undefined IN_LIST ECM_ENABLE_SANITIZERS
         )
+        if(APPLE)
+            list(APPEND gnArgArg
+                clang_version=\"${QT_COMPILER_VERSION_MAJOR}.${QT_COMPILER_VERSION_MINOR}.${QT_COMPILER_VERSION_PATCH}\"
+            )
+        endif()
     endif()
 endmacro()
 

From 7126ed020dbfbc2b411c334a2af1d61f9a7a90a3 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 16 Nov 2023 03:23:05 +0000
Subject: [PATCH 536/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I5f7ab6dcfcdeda9760ccd57b6b7bd93b30aa4eb4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3aa5e7fcf97..47003c96567 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: b88a71361f843cd7a008470d598195d5644bdc15
+    ref: 9a3ae2c1f973895c2bc43417265108a5f32d735e
     required: true
   ../tqtc-qtpositioning:
-    ref: 40848bb86277f4184c9617c772414ce83fe67215
+    ref: fa205b6d68d4a0aa5fc036ba830e604cae76c53a
     required: false
   ../tqtc-qttools:
-    ref: bfdb4039980e12a3cea5cf852e3e847960c97c01
+    ref: 2de68d3ce23a035d3a20d408fc28a47fd00a567e
     required: false
   ../tqtc-qtwebchannel:
-    ref: 67c36b5024b6aec740bf78bdce548ca6afc52c55
+    ref: dc4c2d9ed4382556e769b8e03e7c7186a3337d64
     required: false

From a836b1295530b02260745b33e7536e6c7f089465 Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Wed, 15 Nov 2023 07:55:13 +0200
Subject: [PATCH 537/681] Bump version to 6.6.2

Change-Id: Id22fafce7ab5418eaa88eab087f7c9d53d1c2d2f
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index 017a7f8906d..4b327f94834 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,4 +1,4 @@
-set(QT_REPO_MODULE_VERSION "6.6.1")
+set(QT_REPO_MODULE_VERSION "6.6.2")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")
 set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")

From df1ec95de79df7680c3b3f8101e2cca9e16176ad Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 17 Nov 2023 20:17:55 +0000
Subject: [PATCH 538/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ia3545cec7c57880ae8e4cb34a9a969d0029a47f4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index cccfc88618d..8aa13db85a7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b77c53d402d2c21cb48b965be1e3d68a16e4d3eb
+    ref: a635d16301befa03e9dd3bf284f3cdb3936efb23
     required: true
   ../qtpositioning:
-    ref: f1e970b51dcd92730faa2fe911433999069e7e67
+    ref: d465c4622f112908b9f7ee2b2443fd1aaedafea0
     required: false
   ../qttools:
-    ref: e8e7c4386450d8c1aef05c4a3434f3f32fe8a605
+    ref: 31001fd896e73e4355e8901cec96bf651b6f4420
     required: false
   ../qtwebchannel:
-    ref: 1b4f094aa7dc92b1f2fe2272457b0a9bf98bd6bc
+    ref: 0b577958c093d2c23f7424e80c83661a2665a5d2
     required: false

From 877f8a10af6364d113d8bd72aca0f6d6aef7cdcb Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sat, 18 Nov 2023 01:16:06 +0000
Subject: [PATCH 539/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I83af217b7a387a8783c194c65095d45df8a8dc41
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 47003c96567..a629a9bd1c9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 9a3ae2c1f973895c2bc43417265108a5f32d735e
+    ref: 3aa816c2ae596150bf3b44b567880604f9943d87
     required: true
   ../tqtc-qtpositioning:
-    ref: fa205b6d68d4a0aa5fc036ba830e604cae76c53a
+    ref: 889dfa3e05c7bd9adf201faf24df43a14c2350a8
     required: false
   ../tqtc-qttools:
-    ref: 2de68d3ce23a035d3a20d408fc28a47fd00a567e
+    ref: c85d88df34bcedd84de8cb2d60db24bb89ad9489
     required: false
   ../tqtc-qtwebchannel:
-    ref: dc4c2d9ed4382556e769b8e03e7c7186a3337d64
+    ref: ac306913840b21d37fe05af077a97e5be0e99c34
     required: false

From 3f9fbd142d1ff4688874e621e2b5117e816ecf33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 17 Nov 2023 10:48:02 +0100
Subject: [PATCH 540/681] Update Chromium

Submodule src/3rdparty 4253d879..772cb04f:
  * Add android on windows build support
  * [Backport] CVE-2023-5996: Use after free in WebAudio
  * Do not require android support libs for 32bits

Fixes: QTBUG-118891
Change-Id: Ic93d91df7365de9c8bc1b3c5b667c2537e9da6b1
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 71b4ebbf035d7a08184a43b896c4d51e1391421a)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit c7d0da165e45aea19ef0f8331b18ebbeaa85b00c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index fcd5df99e2b..d3bb2115001 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           119.0.6045.105
+Patched with security patches up to Chromium version:           119.0.6045.123
diff --git a/src/3rdparty b/src/3rdparty
index 4253d879ba8..772cb04f511 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 4253d879ba8a63bf70d87b80b286936456d1042e
+Subproject commit 772cb04f511b9a1b98a4e155ed62efdfd971e5fb
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 58ea3cc4501..20899c3e6cd 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -965,7 +965,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.105"; // FIXME: Remember to update
+    return "119.0.6045.123"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 458166040c52f4a509f6e1f55a85a0c39e8d38b8 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 20 Nov 2023 08:58:09 +0000
Subject: [PATCH 541/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Idbc993779ec30b08d1df9a27bc234643c3fa3c97
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index a629a9bd1c9..c94e5cbb008 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 3aa816c2ae596150bf3b44b567880604f9943d87
+    ref: 9f2174ae612c3aacf9aaf016f79f4d28e6caeb8b
     required: true
   ../tqtc-qtpositioning:
-    ref: 889dfa3e05c7bd9adf201faf24df43a14c2350a8
+    ref: 550d031f88f181adaeeeaf17d9b2ea6065327966
     required: false
   ../tqtc-qttools:
-    ref: c85d88df34bcedd84de8cb2d60db24bb89ad9489
+    ref: b167aed464a10799cde6d68773687f40cddd7741
     required: false
   ../tqtc-qtwebchannel:
-    ref: ac306913840b21d37fe05af077a97e5be0e99c34
+    ref: 8218260bc19a2d9f69ca70de0ab1154ac39883f4
     required: false

From 487eba0b13afb2b53f30d88611b6970d4b28f523 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 20 Nov 2023 13:49:33 +0100
Subject: [PATCH 542/681] Update Chromium

Submodule src/3rdparty e10a078e..8dd78575:
  * [Backport] CVE-2023-6112: Use after free in Navigation
  * [Backport] CVE-2023-5997: Use after free in Garbage Collection

Fixes: QTBUG-119157
Change-Id: Ie3a916a7cecdaf0e080510d37b08c959262d216a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 1778a8598dc..1f719d08515 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           119.0.6045.123
+Patched with security patches up to Chromium version:           119.0.6045.160
diff --git a/src/3rdparty b/src/3rdparty
index e10a078e8ee..8dd785756cb 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit e10a078e8ee3ebbabcfc87c4f9f8475333faf5e0
+Subproject commit 8dd785756cbbdf1be217b0c776a123ca3bb1d21b
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index a6bee49acd0..6526b8180ed 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -974,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.123"; // FIXME: Remember to update
+    return "119.0.6045.160"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 8bc4ecb60808b148cd9c7bb5705b1c2810134ce5 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 21 Nov 2023 06:25:52 +0000
Subject: [PATCH 543/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I6ecce4d62f79e971567fbf60ff739afe89cba0c3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c94e5cbb008..6b33d07f9dc 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 9f2174ae612c3aacf9aaf016f79f4d28e6caeb8b
+    ref: ee05413e7cd7ac293a2e1cad6f6f0c8bd491ead3
     required: true
   ../tqtc-qtpositioning:
-    ref: 550d031f88f181adaeeeaf17d9b2ea6065327966
+    ref: e9dcd4b9976326bd664182cd6dec1af40720dcc2
     required: false
   ../tqtc-qttools:
-    ref: b167aed464a10799cde6d68773687f40cddd7741
+    ref: ca4eb849251633ea1c17537be250114273438f7d
     required: false
   ../tqtc-qtwebchannel:
-    ref: 8218260bc19a2d9f69ca70de0ab1154ac39883f4
+    ref: fa43d7aa1a01e3a83fba099c95300a5428156f0b
     required: false

From bf13665748119456ab480ec0f1c3b0d06d8c71cc Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 21 Nov 2023 13:39:55 +0000
Subject: [PATCH 544/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I83f9aa35712ac0d6c488094c20a6486ee44ae193
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8aa13db85a7..5252fde36c0 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: a635d16301befa03e9dd3bf284f3cdb3936efb23
+    ref: 1de896077ad54921f092302929ad7f7440e4befe
     required: true
   ../qtpositioning:
-    ref: d465c4622f112908b9f7ee2b2443fd1aaedafea0
+    ref: 8e3751505db877ab61804d7193df050fc2f3a999
     required: false
   ../qttools:
-    ref: 31001fd896e73e4355e8901cec96bf651b6f4420
+    ref: ed38793f3cc869731c793ae926d5a41fc33ee877
     required: false
   ../qtwebchannel:
-    ref: 0b577958c093d2c23f7424e80c83661a2665a5d2
+    ref: 7d3c98663c64583aaadea17f06fbea081afaf121
     required: false

From 4f496b08b9128fddd15816ed72335c9e32657e0c Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 21 Nov 2023 13:31:24 +0100
Subject: [PATCH 545/681] tst_QQuickWebEngineViewGraphics crash in Debug mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- DCHECK hit while running tst_QQuickWebEngineViewGraphics test.
- Added qWaitForWindowExposed() to wait for the windows, and then perform the verification.

Change-Id: Ia5c2dba5f1c38ae06e7aac24f0f6d5f3d6f5859d
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f3322daf3782edf7204c1ee7fd6dbeacfa369430)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../tst_qquickwebengineviewgraphics.cpp                          | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
index 71c3a1cf2ff..3644ac48187 100644
--- a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
+++ b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
@@ -124,6 +124,7 @@ void tst_QQuickWebEngineViewGraphics::reparentToOtherWindow()
 
     m_view->rootObject()->setParentItem(window.contentItem());
     window.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&window));
     verifyGreenSquare(&window);
 }
 

From 31f7bef974e371dfeaefdd9c96dcf1296d65856c Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sat, 25 Nov 2023 00:56:55 +0000
Subject: [PATCH 546/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I9d6a5e1f247d2415a481f3d22591fc80aa50c37a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 6b33d07f9dc..a8cb5d67677 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: ee05413e7cd7ac293a2e1cad6f6f0c8bd491ead3
+    ref: b29c1f2f9efdc60b6b9f992912516e3bd9bfbbf3
     required: true
   ../tqtc-qtpositioning:
-    ref: e9dcd4b9976326bd664182cd6dec1af40720dcc2
+    ref: 02d017a570881bde4a62b09fa2b073b080971fa0
     required: false
   ../tqtc-qttools:
-    ref: ca4eb849251633ea1c17537be250114273438f7d
+    ref: 4c1d3014d20aa63aa2259f381f4f6740510f1380
     required: false
   ../tqtc-qtwebchannel:
-    ref: fa43d7aa1a01e3a83fba099c95300a5428156f0b
+    ref: 03ec4670fcdb8994cd81cb3f787e5c20e5c1f772
     required: false

From c4b77d1f138e8fbfe9c4038dfe716de289217b98 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 24 Nov 2023 20:36:34 +0100
Subject: [PATCH 547/681] Minor. Cleanup cmake STREQUAL and add missing
 quotation marks

Add quotation marks to STREQUAL, as cmake uses
variable expansion in first place.

Note bogus statements like:
if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC) where already
fixed in previous commits.

Change-Id: I00d30b2bdf493d4b92b0d45b2804f4132946cfdc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit af370e659dece8d2dc40ecf1e6e01f2606668060)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake |  8 ++++----
 configure.cmake       | 24 ++++++++++++------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 77be7359700..e32037fd5bd 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -49,7 +49,7 @@ function(add_check_for_support)
             set(${module}_SUPPORT ON)
         endif()
         if(${module}_SUPPORT)
-            if("x${arg_CONDITION}" STREQUAL x)
+            if("x${arg_CONDITION}" STREQUAL "x")
                 set(arg_CONDITION ON)
             endif()
             qt_evaluate_config_expression(result ${arg_CONDITION})
@@ -188,7 +188,7 @@ function(extend_gn_target target)
     cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "CONDITION;${elements}")
     _qt_internal_validate_all_args_are_parsed(GN)
 
-    if("x${GN_CONDITION}" STREQUAL x)
+    if("x${GN_CONDITION}" STREQUAL "x")
         set(GN_CONDITION ON)
     endif()
     qt_evaluate_config_expression(result ${GN_CONDITION})
@@ -202,7 +202,7 @@ function(extend_gn_list outList)
     cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARGS;CONDITION")
     _qt_internal_validate_all_args_are_parsed(GN)
 
-    if("x${GN_CONDITION}" STREQUAL x)
+    if("x${GN_CONDITION}" STREQUAL "x")
         set(GN_CONDITION ON)
     endif()
     qt_evaluate_config_expression(result ${GN_CONDITION})
@@ -910,7 +910,7 @@ macro(append_compiler_linker_sdk_setup)
     extend_gn_list(gnArgArg ARGS is_clang CONDITION CLANG)
     extend_gn_list(gnArgArg ARGS is_mingw CONDITION MINGW)
     extend_gn_list(gnArgArg ARGS is_msvc CONDITION MSVC)
-    extend_gn_list(gnArgArg ARGS is_gcc CONDITION LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU)
+    extend_gn_list(gnArgArg ARGS is_gcc CONDITION LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
 
     if(CLANG)
         if(MACOS)
diff --git a/configure.cmake b/configure.cmake
index 3d383fb50bc..7cd82581679 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -504,9 +504,9 @@ add_check_for_support(
 )
 add_check_for_support(
     MODULES QtWebEngine
-    CONDITION NOT (Nodejs_ARCH STREQUAL ia32) AND
-              NOT (Nodejs_ARCH STREQUAL x86) AND
-              NOT (Nodejs_ARCH STREQUAL arm)
+    CONDITION NOT (Nodejs_ARCH STREQUAL "ia32") AND
+              NOT (Nodejs_ARCH STREQUAL "x86") AND
+              NOT (Nodejs_ARCH STREQUAL "arm")
     MESSAGE "32bit version of Nodejs is not supported."
 )
 add_check_for_support(
@@ -587,9 +587,9 @@ ${xcbErrorMessage}"
 add_check_for_support(
    MODULES QtWebEngine
    CONDITION MSVC OR
-       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
-       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
-       (MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
+       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
+       (MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
    MESSAGE
        "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )
@@ -597,12 +597,12 @@ add_check_for_support(
 add_check_for_support(
    MODULES QtPdf
    CONDITION MSVC OR
-       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
-       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
-       (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR
-       (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
-       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
-       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+       (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
+       (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR
+       (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
+       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+       (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    MESSAGE
        "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
 )

From 498e62eeb3e5db6eef60e7513ba14847d01acfae Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 28 Nov 2023 22:14:30 +0000
Subject: [PATCH 548/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I894beec5208a5850d6e2345883881213de8bc60f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index a8cb5d67677..7e5d33ad66c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: b29c1f2f9efdc60b6b9f992912516e3bd9bfbbf3
+    ref: d6f0b20113d419492b687400b3219fb06dfe8d20
     required: true
   ../tqtc-qtpositioning:
-    ref: 02d017a570881bde4a62b09fa2b073b080971fa0
+    ref: 0185910d38cad157567641f17fa1e9fdb0fa6a6f
     required: false
   ../tqtc-qttools:
-    ref: 4c1d3014d20aa63aa2259f381f4f6740510f1380
+    ref: 4eaf0df29ff5c858afcbc4ea8b5c12792be26778
     required: false
   ../tqtc-qtwebchannel:
-    ref: 03ec4670fcdb8994cd81cb3f787e5c20e5c1f772
+    ref: f3127a0c6cacccaaea67e9428e2321fefa7af26d
     required: false

From 919dceb72f5a61397abbae06b1d2b9053d213350 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 30 Aug 2023 14:55:57 +0200
Subject: [PATCH 549/681] Mention the need to use entitlements for
 QtWebEngineProcess on macOS

It was not listed among the steps and some users deploying manually
had some trouble with it.

Task-number: QTBUG-116565
Change-Id: I7488b00c53d13f142d62869ea52376f5283df47a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ea52b98ec79576ed875a095790043844869e8865)
---
 src/core/doc/src/qtwebengine-deploying.qdoc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index 625570feee1..502bffe9d39 100644
--- a/src/core/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -141,6 +141,10 @@
 
     \section2 \macos Specific Deployment Steps
 
+    To deploy a \QWE application on \maocs, you will need to ensure that the \QWE process is signed
+    with an entitlements file that at least contains the entitlements listed in
+    QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Resources/QtWebEngineProcess.entitlements.
+
     To deploy a \QWE application that accesses the microphone or camera
     on \macos, you will need to provide texts for the messages that will be shown to the user to
     explain why the application asks for permission to access to the camera or microphone.

From d4d14b19963aacc23319c588f071d8d4d5ba6f2e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 27 Nov 2023 07:01:11 +0000
Subject: [PATCH 550/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I4f17d936780b9a8c61881c6a2524093687a0d271
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 5252fde36c0..8b07d49e73a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 1de896077ad54921f092302929ad7f7440e4befe
+    ref: b56fe517961f777297c79cebea5eab66f3282cce
     required: true
   ../qtpositioning:
-    ref: 8e3751505db877ab61804d7193df050fc2f3a999
+    ref: f278ca707db003e523d147bb82326cad3539713c
     required: false
   ../qttools:
-    ref: ed38793f3cc869731c793ae926d5a41fc33ee877
+    ref: 4157566f9b802c712755a2a1d29266af8107e8ff
     required: false
   ../qtwebchannel:
-    ref: 7d3c98663c64583aaadea17f06fbea081afaf121
+    ref: a90141f6514e2f6d33fd01109c488d0276c5b41b
     required: false

From 3cb46a5fcda08386aca8de53451509e0ff81bea2 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 29 Nov 2023 09:50:16 +0100
Subject: [PATCH 551/681] Fix compilation arm64

Add missing header include.
Do not compile global setting tests as it tests so far
only doh and requires ssl.

Fixes: QTBUG-119525
Change-Id: I011cd3b0ed6e9d5e55e1fc80a102cc7a388681f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
---
 src/core/web_contents_delegate_qt.h | 1 +
 tests/auto/core/CMakeLists.txt      | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 23115d1269d..51004878d65 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -12,6 +12,7 @@
 #include "web_contents_adapter_client.h"
 
 #include <QtCore/qlist.h>
+#include <QtCore/qmap.h>
 
 namespace blink {
     namespace web_pref {
diff --git a/tests/auto/core/CMakeLists.txt b/tests/auto/core/CMakeLists.txt
index fca52425463..4ed41d94755 100644
--- a/tests/auto/core/CMakeLists.txt
+++ b/tests/auto/core/CMakeLists.txt
@@ -4,7 +4,10 @@
 add_subdirectory(qwebenginecookiestore)
 add_subdirectory(qwebengineloadinginfo)
 add_subdirectory(qwebenginesettings)
-add_subdirectory(qwebengineglobalsettings)
+if(QT_FEATURE_ssl)
+    # only tests doh, and requires ssl
+    add_subdirectory(qwebengineglobalsettings)
+endif()
 add_subdirectory(qwebengineurlrequestinterceptor)
 add_subdirectory(qwebengineurlrequestjob)
 add_subdirectory(origins)

From df1a94b2f81e0a236c7f5f6d20438af532dcb042 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 30 Nov 2023 19:58:24 +0000
Subject: [PATCH 552/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I1bedff59826d927b0c40d193d38dce709bd4a8b1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 7e5d33ad66c..07864d5141d 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: d6f0b20113d419492b687400b3219fb06dfe8d20
+    ref: 35b4ee4c7b4d8ae773089a956435e94665919349
     required: true
   ../tqtc-qtpositioning:
-    ref: 0185910d38cad157567641f17fa1e9fdb0fa6a6f
+    ref: 1af002e3312593057ed440830d6145b17f47b680
     required: false
   ../tqtc-qttools:
-    ref: 4eaf0df29ff5c858afcbc4ea8b5c12792be26778
+    ref: 022bfcb1532c5dda31dc9962dd4e612edd7a1943
     required: false
   ../tqtc-qtwebchannel:
-    ref: f3127a0c6cacccaaea67e9428e2321fefa7af26d
+    ref: bc5e0f12ae2515221b9ec0af9ed3edff32ab7868
     required: false

From 180dbea2d8f8a016762520eed9738bef4c76bb4e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 1 Dec 2023 12:06:27 +0000
Subject: [PATCH 553/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I84d8ac44ea22bc836da2d6df8f57283cf6c0b7d9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8b07d49e73a..6c91a07877e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: b56fe517961f777297c79cebea5eab66f3282cce
+    ref: ae071058e85526f5b2df2ccbe5ae1d4e556bddcb
     required: true
   ../qtpositioning:
-    ref: f278ca707db003e523d147bb82326cad3539713c
+    ref: 0f5d6c73ed59c84763911d1da44a6bb2a154644a
     required: false
   ../qttools:
-    ref: 4157566f9b802c712755a2a1d29266af8107e8ff
+    ref: ba637cd74c3265b50cf1e6763e233444791fb75b
     required: false
   ../qtwebchannel:
-    ref: a90141f6514e2f6d33fd01109c488d0276c5b41b
+    ref: 1a47ba4dbef95f49584a1c8d6dc166df10bd4af8
     required: false

From 172939db794a39b11c9be9263fcdf55bb00a4464 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 9 Oct 2023 12:12:43 +0200
Subject: [PATCH 554/681] Support pkg-config on mac

The user can compile qt with pkg-config support on mac,
in this case and only in this case we should also use pkg-config
in qtwebengine.

Use pkg-config feature from core. Add missing ldir flags to linker.

Fixes: QTBUG-115357
Change-Id: I401949a50c8199a7d400455db5fbbb4e0de652b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7cb5bf9a3da8f445cd18d84d2ee0f90958feb2c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 cmake/Functions.cmake        | 2 +-
 src/core/api/configure.cmake | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index e32037fd5bd..7bbf8e75964 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -476,7 +476,7 @@ function(add_linker_options target buildDir completeStatic)
         if(NOT completeStatic)
             target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${archives_rsp}>")
         endif()
-        target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${libs_rsp}>")
+        target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${ldir_rsp}>" "$<$<CONFIG:${config}>:@${libs_rsp}>")
     endif()
     if(WIN32)
         get_copy_of_response_file(objects_rsp ${target} objects)
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index df65aaa691e..762f4bdd6cc 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -7,7 +7,7 @@ if(NOT QT_CONFIGURE_RUNNING)
     find_package(GLIB2 COMPONENTS GIO)
     find_package(GSSAPI)
     find_package(PkgConfig)
-    if(PkgConfig_FOUND)
+    if(PkgConfig_FOUND AND QT_FEATURE_pkg_config)
         pkg_check_modules(ALSA alsa IMPORTED_TARGET)
         pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
         pkg_check_modules(XDAMAGE xdamage)

From 8f2e6569fe157f010cea0bf5112185ff47ef5f5f Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 1 Dec 2023 21:53:25 -0700
Subject: [PATCH 555/681] doc: Add the QPdfBookmarkModel::document property

Fixes: QTBUG-119536
Pick-to: 6.5
Change-Id: I31028e19c2d376133f0fcd6c06ecc295163f1747
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a96693c65e376aea3417aaec1d7a54c09a9a3995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/qpdfbookmarkmodel.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index 78d89cc9bd4..93dbf5d1f9a 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -260,6 +260,10 @@ QPdfDocument* QPdfBookmarkModel::document() const
     return d->m_document;
 }
 
+/*!
+    \property QPdfBookmarkModel::document
+    \brief the PDF document in which bookmarks are to be found.
+*/
 void QPdfBookmarkModel::setDocument(QPdfDocument *document)
 {
     if (d->m_document == document)

From 09751a084117e49890d9e240e17ee6b7198c2b01 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 1 Dec 2023 21:53:25 -0700
Subject: [PATCH 556/681] doc: Add the QPdfBookmarkModel::document property

Fixes: QTBUG-119536
Change-Id: I31028e19c2d376133f0fcd6c06ecc295163f1747
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a96693c65e376aea3417aaec1d7a54c09a9a3995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8f2e6569fe157f010cea0bf5112185ff47ef5f5f)
---
 src/pdf/qpdfbookmarkmodel.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index 78d89cc9bd4..93dbf5d1f9a 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -260,6 +260,10 @@ QPdfDocument* QPdfBookmarkModel::document() const
     return d->m_document;
 }
 
+/*!
+    \property QPdfBookmarkModel::document
+    \brief the PDF document in which bookmarks are to be found.
+*/
 void QPdfBookmarkModel::setDocument(QPdfDocument *document)
 {
     if (d->m_document == document)

From 4f93abe9b7de7d72b42faac69bf0650c417855bd Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Wed, 15 Nov 2023 10:50:08 +0100
Subject: [PATCH 557/681] [DevTools]:Add --remote-allow-origin to chromium
 launch flag
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- This is required due to the recent changes in chromium
https://chromium-review.googlesource.com/c/chromium/src/+/4106102

- As per this change , it will reject all debugging web socket connections with a defined Origin  header, unless the browser is started with a new flag `--remote-allow-origins=<origin>[,<origin>, ...]`. The star origin `*`  which allows all origins.

Fixes: QTBUG-118995
Change-Id: I53169cd401988155bac5797b4c56e7456a2c742a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5558ce40bf40c7982fa04755680b9d39a5e4d7c3)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/core/doc/src/qtwebengine-debugging.qdoc |  6 ++++++
 src/core/doc/src/qtwebengine-features.qdoc  |  8 +++++++-
 src/core/web_engine_context.cpp             | 17 +++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/core/doc/src/qtwebengine-debugging.qdoc b/src/core/doc/src/qtwebengine-debugging.qdoc
index 3bb6a702996..3dd4d9276c3 100644
--- a/src/core/doc/src/qtwebengine-debugging.qdoc
+++ b/src/core/doc/src/qtwebengine-debugging.qdoc
@@ -49,6 +49,12 @@
     interface on, so that you can access the developer tools from a remote
     device.
 
+    To avoid WebSocket errors during remote debugging, add an additional command-line
+    argument \c {--remote-allow-origins=<origin>[,<origin>, ...]}, where \c <origin> refers to the request origin.
+    Use \c {--remote-allow-origins=*} to allow connections from all origins. If nothing is specified,
+    \QWE will add \c {--remote-allow-origins=*} to command-line arguments when remote-debugging is enabled,
+    thereby allowing requests from all origins.
+
     For a detailed explanation of the capabilities of developer tools, see the
     \l {Chrome DevTools} page.
 
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index c55c5bbeffd..b4befe48ea1 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -83,7 +83,7 @@
 
     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
+    the environment variable \c QTWEBENGINE_REMOTE_DEBUGGING and then using a
     Chromium based browser (such as \l{WebEngine Widgets Simple Browser Example}
     {Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}) to connect
     to \c {http://localhost:[your-port]}.
@@ -96,6 +96,12 @@
     --webEngineArgs --remote-debugging-port=5000
     \endcode
 
+    To avoid WebSocket errors during remote debugging, add an additional command-line argument
+    \c {--remote-allow-origins=<origin>[,<origin>, ...]}, where \c <origin> refers to the request origin.
+    Use \c {--remote-allow-origins=*} to allow connections from all origins. If nothing is specified,
+    \QWE will add \c {--remote-allow-origins=*} to command-line arguments when remote-debugging is enabled,
+    thereby allowing requests from all origins.
+
     The Chromium DevTools page can also be shown within the application. To set
     this up, you can call either QWebEnginePage::setInspectedPage() to the page
     to be inspected, which implicitly loads the DevTools into the \c this page,
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 20899c3e6cd..c17b0b54e0d 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -105,6 +105,7 @@
 #include <qopenglcontext_platform.h>
 #endif
 #include <QQuickWindow>
+#include <QRegularExpression>
 #include <QStringList>
 #include <QSurfaceFormat>
 #include <QNetworkProxy>
@@ -926,6 +927,22 @@ base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
     appArgs.removeAll(QStringLiteral("--disable-embedded-switches"));
     appArgs.removeAll(QStringLiteral("--enable-embedded-switches"));
 
+    bool isRemoteDebugPort =
+            (-1
+             != appArgs.indexOf(QRegularExpression(QStringLiteral("--remote-debugging-port=.*"),
+                                                   QRegularExpression::CaseInsensitiveOption)))
+            || !qEnvironmentVariable("QTWEBENGINE_REMOTE_DEBUGGING").isEmpty();
+    bool isRemoteAllowOrigins =
+            (-1
+             != appArgs.indexOf(QRegularExpression(QStringLiteral("--remote-allow-origins=.*"),
+                                                   QRegularExpression::CaseInsensitiveOption)));
+
+    if (isRemoteDebugPort && !isRemoteAllowOrigins) {
+        appArgs.append(QStringLiteral("--remote-allow-origins=*"));
+        qWarning("Added {--remote-allow-origins=*} to command-line arguments "
+                 "to avoid web socket connection errors during remote debugging.");
+    }
+
     base::CommandLine::StringVector argv;
     argv.resize(appArgs.size());
 #if defined(Q_OS_WIN)

From d7eac0cfbc70100ea89d4b7191d4466ab51e9d37 Mon Sep 17 00:00:00 2001
From: Samuli Piippo <samuli.piippo@qt.io>
Date: Fri, 1 Dec 2023 11:48:00 +0200
Subject: [PATCH 558/681] Fix use of system zlib for qtpdf

third_party zlib got pulled into build and we need also
use_system_zlib flag set accordingly.

Pick-to: 6.5
Task-number: QTBUG-116595
Change-Id: Iee4c91ec240512e23fe7ab612658320b0537920c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 84d85b67507cdd380ec854b63ee0d72c16025c3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 8070eb39a51..25618044135 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -196,7 +196,7 @@ foreach(arch ${archs})
             CONDITION QT_FEATURE_pdf_xfa_tiff
         )
         extend_gn_list(gnArgArg
-            ARGS pdfium_use_system_zlib
+            ARGS pdfium_use_system_zlib use_system_zlib
             CONDITION QT_FEATURE_webengine_system_zlib
         )
         extend_gn_list(gnArgArg

From 7aae80478095051fd97f7e189de1de9f1c5d558a Mon Sep 17 00:00:00 2001
From: Samuli Piippo <samuli.piippo@qt.io>
Date: Fri, 1 Dec 2023 11:48:00 +0200
Subject: [PATCH 559/681] Fix use of system zlib for qtpdf

third_party zlib got pulled into build and we need also
use_system_zlib flag set accordingly.

Task-number: QTBUG-116595
Change-Id: Iee4c91ec240512e23fe7ab612658320b0537920c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 84d85b67507cdd380ec854b63ee0d72c16025c3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d7eac0cfbc70100ea89d4b7191d4466ab51e9d37)
---
 src/pdf/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index e79bbd85e06..a752a7c07ed 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -189,7 +189,7 @@ foreach(arch ${archs})
             CONDITION QT_FEATURE_pdf_xfa_tiff
         )
         extend_gn_list(gnArgArg
-            ARGS pdfium_use_system_zlib
+            ARGS pdfium_use_system_zlib use_system_zlib
             CONDITION QT_FEATURE_webengine_system_zlib
         )
         extend_gn_list(gnArgArg

From 8e61b968b4cb05902b3f0813969766489b01f2d7 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 12 Sep 2023 11:06:37 +0200
Subject: [PATCH 560/681] Rename QtWebEngineProcess exe in debug mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Windeployqt is searching for QtWebEngineProcessd.exe in debug mode.
As per current implementation CMAKE_DEBUG_POSTFIX is append to QtWebEngineProcess name
only when the configuration is debug and release, leading to errors when deploying
application using windeployqt.
- Appended CMAKE_DEBUG_POSTFIX to QtWebEngineProcess in dbeug mode.

Change-Id: I43c25eb7a29e2442475f025b2daf360fd7aaffae
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 39b97d903a0cacea0faf468c91e222c7f09a3e71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/CMakeLists.txt    |  2 +-
 src/process/CMakeLists.txt | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1416f1d2ba7..5700558401c 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -48,7 +48,7 @@ foreach(arch ${archs})
         get_forward_declaration_macro(forwardDeclarationMacro)
         get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME)
 
-        if(QT_FEATURE_debug_and_release AND ("${config}" STREQUAL "Debug"))
+        if("${config}" STREQUAL "Debug")
             set(qtWebEngineProcessName "${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}")
         endif()
 
diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index 455d5c41a4e..bbe47431fc5 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -59,13 +59,13 @@ foreach(config ${configs})
     set_target_properties(${qtWebEngineProcessName} PROPERTIES
         RUNTIME_OUTPUT_DIRECTORY_${config_upper} "${outputPath}"
     )
-endforeach()
 
-if(QT_FEATURE_debug_and_release)
-    set_target_properties(${qtWebEngineProcessName} PROPERTIES
-        OUTPUT_NAME_DEBUG ${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}
-    )
-endif()
+    if("${config}" STREQUAL "Debug")
+        set_target_properties(${qtWebEngineProcessName} PROPERTIES
+            OUTPUT_NAME_DEBUG ${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}
+        )
+    endif()
+endforeach()
 
 if(isFramework)
     set_target_properties(${qtWebEngineProcessName} PROPERTIES

From 3d73d285516b04cb083730616423f06a546f9903 Mon Sep 17 00:00:00 2001
From: Jaishree Vyas <Jaishree.Vyas@qt.io>
Date: Mon, 10 Jul 2023 15:30:24 +0200
Subject: [PATCH 561/681] Doc: Remove \ingroup all-examples command from the
 docs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Task-number: QTBUG-115044
Pick-to: 6.5
Change-Id: I83314f3b7955e1ef9c857bcc96c07f6f90b2f875
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 70e019c76088102df7cb0446e239c2be31de2865)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdf/doc/src/qtpdf-examples.qdoc                           | 1 -
 src/webenginequick/doc/src/qtwebengine-examples.qdoc          | 1 -
 src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc | 1 -
 3 files changed, 3 deletions(-)

diff --git a/src/pdf/doc/src/qtpdf-examples.qdoc b/src/pdf/doc/src/qtpdf-examples.qdoc
index 0ebad3c825c..02dc23dc210 100644
--- a/src/pdf/doc/src/qtpdf-examples.qdoc
+++ b/src/pdf/doc/src/qtpdf-examples.qdoc
@@ -3,7 +3,6 @@
 
 /*!
     \group qtpdf-examples
-    \ingroup all-examples
 
     \title Qt PDF Examples
     \brief Using the classes and types in the Qt PDF module.
diff --git a/src/webenginequick/doc/src/qtwebengine-examples.qdoc b/src/webenginequick/doc/src/qtwebengine-examples.qdoc
index b3eb548e58a..eebf18ba110 100644
--- a/src/webenginequick/doc/src/qtwebengine-examples.qdoc
+++ b/src/webenginequick/doc/src/qtwebengine-examples.qdoc
@@ -5,7 +5,6 @@
     \group webengine-examples
     \title Qt WebEngine Quick Examples
     \brief Examples demonstrating the \QWE usage.
-    \ingroup all-examples
 
     These examples and demonstrations show a range of different uses for \l{Qt WebEngine},
     from displaying Web pages within a QML user interface to an implementation of
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
index 15f6d08f4da..c9bd76bf4e3 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
@@ -5,7 +5,6 @@
     \group webengine-widgetexamples
     \title Qt WebEngine Widgets Examples
     \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.

From 900071275913539e29934ca93ae78b12ef6bf479 Mon Sep 17 00:00:00 2001
From: Jaishree Vyas <Jaishree.Vyas@qt.io>
Date: Mon, 10 Jul 2023 15:30:24 +0200
Subject: [PATCH 562/681] Doc: Remove \ingroup all-examples command from the
 docs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Task-number: QTBUG-115044
Change-Id: I83314f3b7955e1ef9c857bcc96c07f6f90b2f875
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 70e019c76088102df7cb0446e239c2be31de2865)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3d73d285516b04cb083730616423f06a546f9903)
---
 src/pdf/doc/src/qtpdf-examples.qdoc                           | 1 -
 src/webenginequick/doc/src/qtwebengine-examples.qdoc          | 1 -
 src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc | 1 -
 3 files changed, 3 deletions(-)

diff --git a/src/pdf/doc/src/qtpdf-examples.qdoc b/src/pdf/doc/src/qtpdf-examples.qdoc
index 0ebad3c825c..02dc23dc210 100644
--- a/src/pdf/doc/src/qtpdf-examples.qdoc
+++ b/src/pdf/doc/src/qtpdf-examples.qdoc
@@ -3,7 +3,6 @@
 
 /*!
     \group qtpdf-examples
-    \ingroup all-examples
 
     \title Qt PDF Examples
     \brief Using the classes and types in the Qt PDF module.
diff --git a/src/webenginequick/doc/src/qtwebengine-examples.qdoc b/src/webenginequick/doc/src/qtwebengine-examples.qdoc
index b3eb548e58a..eebf18ba110 100644
--- a/src/webenginequick/doc/src/qtwebengine-examples.qdoc
+++ b/src/webenginequick/doc/src/qtwebengine-examples.qdoc
@@ -5,7 +5,6 @@
     \group webengine-examples
     \title Qt WebEngine Quick Examples
     \brief Examples demonstrating the \QWE usage.
-    \ingroup all-examples
 
     These examples and demonstrations show a range of different uses for \l{Qt WebEngine},
     from displaying Web pages within a QML user interface to an implementation of
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
index 15f6d08f4da..c9bd76bf4e3 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
@@ -5,7 +5,6 @@
     \group webengine-widgetexamples
     \title Qt WebEngine Widgets Examples
     \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.

From 1e79c97db487c3f14dd8966dbfc3e322b2e4b441 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 20 Nov 2023 15:18:38 +0100
Subject: [PATCH 563/681] Update Chromium

Submodule src/3rdparty 772cb04f..6c805bf7:
  * [Backport] CVE-2023-6112: Use after free in Navigation
  * [Backport] CVE-2023-5997: Use after free in Garbage Collection

Fixes: QTBUG-119158
Change-Id: I59ceb253adbe0ea03ee2c4757d510f1e8bd50a8d
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index d3bb2115001..4acb523e7ae 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           119.0.6045.123
+Patched with security patches up to Chromium version:           119.0.6045.160
diff --git a/src/3rdparty b/src/3rdparty
index 772cb04f511..6c805bf7507 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 772cb04f511b9a1b98a4e155ed62efdfd971e5fb
+Subproject commit 6c805bf7507997616d826f20c7c901739ed3b431
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index c17b0b54e0d..66d565c5497 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.123"; // FIXME: Remember to update
+    return "119.0.6045.160"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 0aad55db5c1df97539c992f2ee92a3daa78c8a5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 6 Dec 2023 10:40:31 +0100
Subject: [PATCH 564/681] Fix unconditional pointer access in
 QWebEngineDownloadRequest::page

The adapterClient pointer in QWebEngineDownloadRequestPrivate can be
initialized to a nullptr in some scenarios, but was used without
checking if the pointer is actually set.

Pick-to: 6.5
Task-number: QTBUG-119763
Change-Id: I7a8653e7f0f5d920dbe69785fb3ce3518c96cc24
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3c6056d062c3b94ff9031cb4931a59de06137d1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/core/api/qwebenginedownloadrequest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp
index 07ea3760090..cbf46b4481b 100644
--- a/src/core/api/qwebenginedownloadrequest.cpp
+++ b/src/core/api/qwebenginedownloadrequest.cpp
@@ -607,7 +607,7 @@ QString QWebEngineDownloadRequest::interruptReasonString() const
 QWebEnginePage *QWebEngineDownloadRequest::page() const
 {
     Q_D(const QWebEngineDownloadRequest);
-    if (d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
+    if (d->adapterClient && d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
         return const_cast<QWebEnginePage *>(static_cast<const QWebEnginePage *>(d->adapterClient->holdingQObject()));
     return nullptr;
 }

From 6c7ddcfd6f183399f93cbd3ea1c9ac2e7e7916b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 6 Dec 2023 10:40:31 +0100
Subject: [PATCH 565/681] Fix unconditional pointer access in
 QWebEngineDownloadRequest::page

The adapterClient pointer in QWebEngineDownloadRequestPrivate can be
initialized to a nullptr in some scenarios, but was used without
checking if the pointer is actually set.

Task-number: QTBUG-119763
Change-Id: I7a8653e7f0f5d920dbe69785fb3ce3518c96cc24
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3c6056d062c3b94ff9031cb4931a59de06137d1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0aad55db5c1df97539c992f2ee92a3daa78c8a5e)
---
 src/core/api/qwebenginedownloadrequest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp
index e51fe7c0fd2..29740514aba 100644
--- a/src/core/api/qwebenginedownloadrequest.cpp
+++ b/src/core/api/qwebenginedownloadrequest.cpp
@@ -601,7 +601,7 @@ QString QWebEngineDownloadRequest::interruptReasonString() const
 QWebEnginePage *QWebEngineDownloadRequest::page() const
 {
     Q_D(const QWebEngineDownloadRequest);
-    if (d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
+    if (d->adapterClient && d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
         return const_cast<QWebEnginePage *>(static_cast<const QWebEnginePage *>(d->adapterClient->holdingQObject()));
     return nullptr;
 }

From 45444b7c82494a36fd65f2cf504459b1cdffdf80 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 8 Dec 2023 08:28:20 +0000
Subject: [PATCH 566/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Iac3c225c09d07bfa8709b4e2b5c50efeb05b4875
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 6c91a07877e..2ddad90b270 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: ae071058e85526f5b2df2ccbe5ae1d4e556bddcb
+    ref: 506329863b29ffba23453abbbb51ae123ec41abd
     required: true
   ../qtpositioning:
-    ref: 0f5d6c73ed59c84763911d1da44a6bb2a154644a
+    ref: 222b029360b2e5df751ddc1a7c2bf0b05ecceb30
     required: false
   ../qttools:
-    ref: ba637cd74c3265b50cf1e6763e233444791fb75b
+    ref: 13bd64e58ecde3f6ad530fac5c0ab7cc89e68f5c
     required: false
   ../qtwebchannel:
-    ref: 1a47ba4dbef95f49584a1c8d6dc166df10bd4af8
+    ref: d8db3e27020b5fa7e544a9810e407279d86765bb
     required: false

From c978b9b27920dbde909c44bf29faafd985bb7a89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 29 Nov 2023 20:25:22 +0100
Subject: [PATCH 567/681] Update Chromium

Submodule src/3rdparty 772cb04f..148f3965:
  * [Backport] CVE-2023-6346: Use after free in WebAudio
  * [Backport] CVE-2023-6347: Use after free in Mojo
  * [Backport] CVE-2023-6345: Integer overflow in Skia (2/2)
  * [Backport] CVE-2023-6345: Integer overflow in Skia (1/2)
  * [Backport] Check nullity of web preferences
  * Use pkg-config on mac if found
  * Fix compilation with mingw 13.1

Fixes: QTBUG-119568
Change-Id: Ib8369cd948bb541c81f7dfff0b37aec695cea4f9
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 4acb523e7ae..a928175d7bd 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           119.0.6045.160
+Patched with security patches up to Chromium version:           119.0.6045.199
diff --git a/src/3rdparty b/src/3rdparty
index 6c805bf7507..148f39658c9 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 6c805bf7507997616d826f20c7c901739ed3b431
+Subproject commit 148f39658c9977dcdfe8a51e212ce936f246dcfc
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 66d565c5497..9d48c90e156 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.160"; // FIXME: Remember to update
+    return "119.0.6045.199"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 858f585b4bffcbaa581828cbdc9916dce4460592 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 7 Dec 2023 11:20:35 +0100
Subject: [PATCH 568/681] Fix typo in test_window_open

Apparently didnt affect test results though

Change-Id: I86809e6287ba7ca80209146c73a0cc0d523756ac
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit d443984a4e575dc176783886a732409f32a3b790)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../widgets/qwebenginescript/resources/test_window_open.html    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/widgets/qwebenginescript/resources/test_window_open.html b/tests/auto/widgets/qwebenginescript/resources/test_window_open.html
index 3f72d176de1..3ceafc49dc3 100644
--- a/tests/auto/widgets/qwebenginescript/resources/test_window_open.html
+++ b/tests/auto/widgets/qwebenginescript/resources/test_window_open.html
@@ -3,7 +3,7 @@
     <head>
         <title>window.open</title>
         <script>
-            window.open("qrc:/resource/test_iframe_main.html", "iframe_main");
+            window.open("qrc:/resources/test_iframe_main.html", "iframe_main");
         </script>
     </head>
     <body></body>

From d752f18a68f51486ed5b7175b6986d285edf7736 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 12 Dec 2023 01:04:53 +0000
Subject: [PATCH 569/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Icdcc78339728223f803b9c62bcee365c76c95a6c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 07864d5141d..fb57228fd92 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 35b4ee4c7b4d8ae773089a956435e94665919349
+    ref: 49f5db1ecebd26a29f3f0321c00a8a44dc25f219
     required: true
   ../tqtc-qtpositioning:
-    ref: 1af002e3312593057ed440830d6145b17f47b680
+    ref: ce1285dd8bd83ebeb80330e1b8240f219c4c63e0
     required: false
   ../tqtc-qttools:
-    ref: 022bfcb1532c5dda31dc9962dd4e612edd7a1943
+    ref: 875fea445591966068eec09d07bf22ff41524bba
     required: false
   ../tqtc-qtwebchannel:
-    ref: bc5e0f12ae2515221b9ec0af9ed3edff32ab7868
+    ref: 12fad554d317d4b6babc45d7270ed76dd5d47a07
     required: false

From 3ab9f8f2fe43fba9db69f4ce6efa7d06223b6298 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 6 Dec 2023 10:08:17 +0100
Subject: [PATCH 570/681] Update Chromium

Submodule src/3rdparty 8dd78575..21bb29b9:
  * [Backport] CVE-2023-6347: Use after free in Mojo
  * [Backport] CVE-2023-6345: Integer overflow in Skia (2/2)
  * [Backport] CVE-2023-6345: Integer overflow in Skia (1/2)

Fixes: QTBUG-119554
Change-Id: I55984706693029abb82bac338ec754b12d0aa470
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 1f719d08515..21a6b0c46e6 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      108.0.5359.181
-Patched with security patches up to Chromium version:           119.0.6045.160
+Patched with security patches up to Chromium version:           119.0.6045.199
diff --git a/src/3rdparty b/src/3rdparty
index 8dd785756cb..21bb29b9b73 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 8dd785756cbbdf1be217b0c776a123ca3bb1d21b
+Subproject commit 21bb29b9b730cc215ee7dfb3cf343139a9be9522
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 6526b8180ed..52be749c243 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -974,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.160"; // FIXME: Remember to update
+    return "119.0.6045.199"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 54b4fad5fef21aa44b2a42304944f8ad3de50a38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lucie=20G=C3=A9rard?= <lucie.gerard@qt.io>
Date: Tue, 5 Sep 2023 15:09:02 +0200
Subject: [PATCH 571/681] Modify copyright format in qt_attribution.json
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Multiline copyright entries are entered via string array.

Task-number: QTBUG-111873
Pick-to: 6.5
Change-Id: I1b90e5333505227db66bc25d3baba8311afda37d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 80a24bb47ce7a18afeb23a23d4845ada8e5d873d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../icons/3rdparty/qt_attribution.json         | 18 +++++++++---------
 .../cookiebrowser/3rdparty/qt_attribution.json | 18 +++++++++---------
 .../data/3rdparty/qt_attribution.json          | 18 +++++++++---------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
index 681223b1297..d8d85d6f153 100644
--- a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
@@ -12,13 +12,13 @@
     "LicenseId": "urn:dje:license:public-domain",
     "License": "Public Domain",
     "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+    "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+    "Steven Garrity <sgarrity@silverorange.com>",
+    "Lapo Calamandrei <calamandrei@gmail.com>",
+    "Ryan Collier <rcollier@novell.com>",
+    "Rodney Dawes <dobey@novell.com>",
+    "Andreas Nilsson <nisses.mail@home.se>",
+    "Tuomas Kuosmanen <tigert@tigert.com>",
+    "Garrett LeSage <garrett@novell.com>",
+    "Jakub Steiner <jimmac@novell.com>"]
 }
diff --git a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
index 4cb51436e2e..35d9cf0d7ad 100644
--- a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
@@ -12,13 +12,13 @@
     "LicenseId": "urn:dje:license:public-domain",
     "License": "Public Domain",
     "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+    "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+    "Steven Garrity <sgarrity@silverorange.com>",
+    "Lapo Calamandrei <calamandrei@gmail.com>",
+    "Ryan Collier <rcollier@novell.com>",
+    "Rodney Dawes <dobey@novell.com>",
+    "Andreas Nilsson <nisses.mail@home.se>",
+    "Tuomas Kuosmanen <tigert@tigert.com>",
+    "Garrett LeSage <garrett@novell.com>",
+    "Jakub Steiner <jimmac@novell.com>"]
 }
diff --git a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
index d81f5bf2351..fbc96416ee1 100644
--- a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
@@ -12,13 +12,13 @@
     "LicenseId": "urn:dje:license:public-domain",
     "License": "Public Domain",
     "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+    "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+    "Steven Garrity <sgarrity@silverorange.com>",
+    "Lapo Calamandrei <calamandrei@gmail.com>",
+    "Ryan Collier <rcollier@novell.com>",
+    "Rodney Dawes <dobey@novell.com>",
+    "Andreas Nilsson <nisses.mail@home.se>",
+    "Tuomas Kuosmanen <tigert@tigert.com>",
+    "Garrett LeSage <garrett@novell.com>",
+    "Jakub Steiner <jimmac@novell.com>"]
 }

From db01dac90533cf56133085610b49af78788d2ee4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lucie=20G=C3=A9rard?= <lucie.gerard@qt.io>
Date: Tue, 5 Sep 2023 15:09:02 +0200
Subject: [PATCH 572/681] Modify copyright format in qt_attribution.json
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Multiline copyright entries are entered via string array.

Task-number: QTBUG-111873
Change-Id: I1b90e5333505227db66bc25d3baba8311afda37d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 80a24bb47ce7a18afeb23a23d4845ada8e5d873d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 54b4fad5fef21aa44b2a42304944f8ad3de50a38)
---
 .../icons/3rdparty/qt_attribution.json         | 18 +++++++++---------
 .../cookiebrowser/3rdparty/qt_attribution.json | 18 +++++++++---------
 .../data/3rdparty/qt_attribution.json          | 18 +++++++++---------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
index 681223b1297..d8d85d6f153 100644
--- a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
@@ -12,13 +12,13 @@
     "LicenseId": "urn:dje:license:public-domain",
     "License": "Public Domain",
     "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+    "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+    "Steven Garrity <sgarrity@silverorange.com>",
+    "Lapo Calamandrei <calamandrei@gmail.com>",
+    "Ryan Collier <rcollier@novell.com>",
+    "Rodney Dawes <dobey@novell.com>",
+    "Andreas Nilsson <nisses.mail@home.se>",
+    "Tuomas Kuosmanen <tigert@tigert.com>",
+    "Garrett LeSage <garrett@novell.com>",
+    "Jakub Steiner <jimmac@novell.com>"]
 }
diff --git a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
index 4cb51436e2e..35d9cf0d7ad 100644
--- a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
@@ -12,13 +12,13 @@
     "LicenseId": "urn:dje:license:public-domain",
     "License": "Public Domain",
     "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+    "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+    "Steven Garrity <sgarrity@silverorange.com>",
+    "Lapo Calamandrei <calamandrei@gmail.com>",
+    "Ryan Collier <rcollier@novell.com>",
+    "Rodney Dawes <dobey@novell.com>",
+    "Andreas Nilsson <nisses.mail@home.se>",
+    "Tuomas Kuosmanen <tigert@tigert.com>",
+    "Garrett LeSage <garrett@novell.com>",
+    "Jakub Steiner <jimmac@novell.com>"]
 }
diff --git a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
index d81f5bf2351..fbc96416ee1 100644
--- a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
@@ -12,13 +12,13 @@
     "LicenseId": "urn:dje:license:public-domain",
     "License": "Public Domain",
     "LicenseFile": "COPYING",
-    "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+    "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+    "Steven Garrity <sgarrity@silverorange.com>",
+    "Lapo Calamandrei <calamandrei@gmail.com>",
+    "Ryan Collier <rcollier@novell.com>",
+    "Rodney Dawes <dobey@novell.com>",
+    "Andreas Nilsson <nisses.mail@home.se>",
+    "Tuomas Kuosmanen <tigert@tigert.com>",
+    "Garrett LeSage <garrett@novell.com>",
+    "Jakub Steiner <jimmac@novell.com>"]
 }

From 699399f1f6112c6713acd652781d6ed5fd41a65f Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 27 Nov 2023 15:51:38 +0100
Subject: [PATCH 573/681] Fix required msvc versions

In 3d4ac6d06 we added back msvc2019 support, however
required version are not correct.

For 2019 we should require version at least 19.29, however
for 2022 19.36.

Change-Id: Ia15f2d68c109ff507f32b49c24c333a4a3e2c6ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9aeda15eba80ea424519fe7868a668953ae4e152)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5f7e2217590637392142aa3a592c19bdc897ebbe)
---
 configure.cmake | 37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index 7cd82581679..60a8de530db 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -197,18 +197,6 @@ int main(void) {
 }"
 )
 
-qt_config_compile_test(winversion
-    LABEL "winversion"
-    CODE
-"
-#if !defined(__clang__) && _MSC_VER < 1922
-#error unsupported Visual Studio version
-#endif
-int main(void){
-    return 0;
-}"
-)
-
 qt_config_compile_test(libavformat
     LABEL "libavformat"
     LIBRARIES
@@ -608,11 +596,21 @@ add_check_for_support(
 )
 if(WIN32)
     if(MSVC)
-        add_check_for_support(
-            MODULES QtWebEngine QtPdf
-            CONDITION NOT MSVC_VERSION LESS 1922
-            MESSAGE "VS compiler version must be at least 14.22"
-        )
+        if(MSVC_TOOLSET_VERSION EQUAL 142) # VS 2019 (16.0)
+            add_check_for_support(
+                MODULES QtWebEngine QtPdf
+                CONDITION NOT MSVC_VERSION LESS 1929
+                MESSAGE "VS compiler version must be at least 14.29"
+            )
+        elseif(MSVC_TOOLSET_VERSION EQUAL 143) # VS 2022 (17.0)
+            add_check_for_support(
+                MODULES QtWebEngine QtPdf
+                CONDITION NOT MSVC_VERSION LESS 1936
+                MESSAGE "VS compiler version must be at least 14.36"
+            )
+        else()
+            message(FATAL_ERROR "Build requires Visual Studio 2019 or higher.")
+        endif()
     endif()
     set(windowsSdkVersion $ENV{WindowsSDKVersion})
     string(REGEX REPLACE "([0-9.]+).*" "\\1" windowsSdkVersion "${windowsSdkVersion}")
@@ -624,11 +622,6 @@ if(WIN32)
         MESSAGE "Build requires Windows 11 SDK at least version 10.0.22621.0"
     )
 endif()
-add_check_for_support(
-   MODULES QtWebEngine QtPdf
-   CONDITION NOT MSVC OR TEST_winversion
-   MESSAGE "Build requires Visual Studio 2019 or higher."
-)
 
 #### Summary
 

From feaaab365c35b2984b12bc53bc65ba702f47edfe Mon Sep 17 00:00:00 2001
From: Karolina Sofia Bang <karolina.bang@qt.io>
Date: Tue, 12 Dec 2023 13:50:53 +0100
Subject: [PATCH 574/681] Redesign printMe example

Fixes: QTBUG-119732
Change-Id: Ia034b8a1566cd2858ccfe1313d73b503b10d752b
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 996a87802f6c65c5dd2ad294978be67323bb30d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 30f2d5ccfcdd00af27364520cbe9b28d3db6c7a9)
---
 .../webenginewidgets/printme/CMakeLists.txt   |   1 -
 .../webenginewidgets/printme/data/data.qrc    |   1 -
 .../webenginewidgets/printme/data/icon.svg    |  24 ----
 .../webenginewidgets/printme/data/index.html  |   2 +-
 .../webenginewidgets/printme/data/style.css   | 104 +++++++++---------
 .../printme/doc/images/printme-example.png    | Bin 42074 -> 29055 bytes
 6 files changed, 54 insertions(+), 78 deletions(-)
 delete mode 100644 examples/webenginewidgets/printme/data/icon.svg

diff --git a/examples/webenginewidgets/printme/CMakeLists.txt b/examples/webenginewidgets/printme/CMakeLists.txt
index 013ba48ca16..368d79bfecb 100644
--- a/examples/webenginewidgets/printme/CMakeLists.txt
+++ b/examples/webenginewidgets/printme/CMakeLists.txt
@@ -33,7 +33,6 @@ target_link_libraries(printme PUBLIC
 
 # Resources:
 set(data_resource_files
-    "data/icon.svg"
     "data/index.html"
     "data/style.css"
 )
diff --git a/examples/webenginewidgets/printme/data/data.qrc b/examples/webenginewidgets/printme/data/data.qrc
index a9c76cc7eed..b5e0b1fe0f1 100644
--- a/examples/webenginewidgets/printme/data/data.qrc
+++ b/examples/webenginewidgets/printme/data/data.qrc
@@ -2,6 +2,5 @@
     <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
deleted file mode 100644
index b90ff26ddec..00000000000
--- a/examples/webenginewidgets/printme/data/icon.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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
index cf286e85a67..865152c1d17 100644
--- a/examples/webenginewidgets/printme/data/index.html
+++ b/examples/webenginewidgets/printme/data/index.html
@@ -12,13 +12,13 @@
    </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>
+         </div>
       </form>
    </body>
 </html>
diff --git a/examples/webenginewidgets/printme/data/style.css b/examples/webenginewidgets/printme/data/style.css
index cf6a2b7bfc1..af8b70fda3a 100644
--- a/examples/webenginewidgets/printme/data/style.css
+++ b/examples/webenginewidgets/printme/data/style.css
@@ -1,72 +1,74 @@
+@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
+* {
+  padding: 0;
+  margin: 0;
+  box-sizing: border-box;
+}
+
 html,body {
-     height:100%;
-     width:100%;
-     margin:0;
+     height: 100%;
+     width: 100%;
 }
+
  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);
-    }
+     display: flex;
 }
+
  .header {
      display: inline
 }
+
  .form {
-     width: 480px;
-     height: 170px;
-     background: -webkit-linear-gradient(bottom, #ddd, #fff);
-     border: 1px solid #999;
-     border-radius: 12px;
+     width: 50%;
+     background: #fff;
+     border: 0.5px solid #999;
+     border-radius: 8px;
      color: #46a;
-     font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
-     font-size: 14px;
-     font-style: italic;
-     font-weight: bold;
+     font-family: 'Titillium Web', sans-serif;
+     font-size: 1rem;
      margin: auto;
-     padding: 10px;
+     padding: 1.5rem;
      position: relative;
-     line-height: 26px;
      text-decoration: none;
-     -webkit-box-shadow: 0px 0px 5px #444;
 }
- h1 {
-     padding-left:40px;
-     color: #46a2da;
+
+h1 {
+    color: #00414A;
+    font-size: 2.5rem;
+    font-weight: 700;
+    margin-top: -0.85rem;
+    margin-bottom: 2rem;
 }
- h2 {
-     color: #80c342;
-     font-size: 13px;
-     margin-top: -20px;
-}
- span {
-     margin-left: 20px;
+
+h2 {
+    color: #00414A;
+    font-size: 1.125rem;
+    font-weight: 400;
+    font-style: italic;
+    margin-bottom: 1rem;
 }
+
  .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;
+     display: flex;
+     align-items: center;
+     justify-content: center;
+     padding: 0.4444em 0.8889em;
+     height: 2.4em;
+     cursor: pointer;
+     background: #00414A;
+     color: #fff;
+     border-radius: 4px;
+     margin-top: 2rem;
+     font-family: 'Titillium Web', sans-serif;
+     font-size: 1.125rem;
+     font-weight: 400;
+     transition: color 300ms ease-out, border 300ms ease-out;
 }
+
  .button:hover {
-    background-color: #46a200
+    background: #19545C;
 }
+
  .button:active {
-     background-color: #3e8e41;
+     background-color: #19545C;
 }
diff --git a/examples/webenginewidgets/printme/doc/images/printme-example.png b/examples/webenginewidgets/printme/doc/images/printme-example.png
index a636972fd5a1539ec41965305420d1810c92b86c..dac4e61e62729f2f7861873c047e82be33b84d18 100644
GIT binary patch

From 7405289e9108316e8fcf925eb0d3624d3d42b5c5 Mon Sep 17 00:00:00 2001
From: Sze Howe Koh <szehowe.koh@gmail.com>
Date: Fri, 13 Oct 2023 11:06:28 +0800
Subject: [PATCH 575/681] [Doc] Port QWebEnginePage::findText() snippet to Qt 6

Pick-to: 6.5
Change-Id: I70452ca18264e1914606ba043af913b3c032f4bb
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a527c6aa2f6480302bbbf99586b0aa94f654e4b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d3540f37afd4252f961131a2623ba7f8b313a664)
---
 src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
index 309ad8233a8..c362f402e3d 100644
--- a/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
+++ b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
@@ -5,8 +5,8 @@ void wrapInFunction()
 {
 
 //! [0]
-    m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](bool found) {
-        if (!found) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found"));
+    m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](const QWebEngineFindTextResult &result) {
+        if (result.numberOfMatches() == 0) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found"));
     });
 //! [0]
 

From b574f56824a343af735cb8d47e5adf911f575f98 Mon Sep 17 00:00:00 2001
From: Sze Howe Koh <szehowe.koh@gmail.com>
Date: Fri, 24 Nov 2023 09:55:24 +0800
Subject: [PATCH 576/681] [Doc] Bump required version of Node.js to v14

Chromium 112 requires Node.js 14 or newer

Amends 96abe0c83c7399cf771eb5155998c706a2243f0e

Change-Id: I61941d2aa127f7bccd0fa337ff18d772d5909af3
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a4567b28c9e921a0369338185f70a298e9cdfffd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 46cfa3ddc1ec7c3e9a1b8aa4bc3575eace4b3a8f)
---
 src/core/doc/src/qtwebengine-platform-notes.qdoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index 3b143b0945a..33bac101a08 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -39,7 +39,7 @@
         \li \l Python 3 with html5lib library
         \li Bison, Flex
         \li GPerf
-        \li Node.js version 12 or later
+        \li Node.js version 14 or later
     \endlist
 
     \section2 Windows

From 525fd7082c7721ee1b108b792f3d2f0d426fcf06 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 18 Dec 2023 09:43:58 +0100
Subject: [PATCH 577/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty 148f3965..028cbdb7:
* [Backport] Ensure CheckedContiguousIterator satisfies C++20 Concept
* [Backport] Disable usage of `__is_cpp17_contiguous_iterator` until libc++ rolls.
* [Backport] Make CheckedContiguousIterator work correctly for libstdc++.
* Fix building with system libxml2

Change-Id: I14493fcd0605cf989bafbdd52b26c546edd4e73a
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 148f39658c9..028cbdb7a0d 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 148f39658c9977dcdfe8a51e212ce936f246dcfc
+Subproject commit 028cbdb7a0d37dfe0eea8cf3a2dad94c7ffdda0f

From f48c5e265fdca50a139aa3124207e015b80fa38f Mon Sep 17 00:00:00 2001
From: Sze Howe Koh <szehowe.koh@gmail.com>
Date: Fri, 13 Oct 2023 11:06:28 +0800
Subject: [PATCH 578/681] [Doc] Port QWebEnginePage::findText() snippet to Qt 6

Change-Id: I70452ca18264e1914606ba043af913b3c032f4bb
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a527c6aa2f6480302bbbf99586b0aa94f654e4b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d3540f37afd4252f961131a2623ba7f8b313a664)
(cherry picked from commit 7405289e9108316e8fcf925eb0d3624d3d42b5c5)
---
 src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
index 309ad8233a8..c362f402e3d 100644
--- a/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
+++ b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
@@ -5,8 +5,8 @@ void wrapInFunction()
 {
 
 //! [0]
-    m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](bool found) {
-        if (!found) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found"));
+    m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](const QWebEngineFindTextResult &result) {
+        if (result.numberOfMatches() == 0) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found"));
     });
 //! [0]
 

From 5718655831539f346ff91f659e6873828544512b Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 19 Dec 2023 14:40:42 +0000
Subject: [PATCH 579/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: If1bb971ef77e289b3d69148e1e66f16830e155b6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 2ddad90b270..12176449f79 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 506329863b29ffba23453abbbb51ae123ec41abd
+    ref: 3732fde7c84587681e8b831c5ce685e6c523ff84
     required: true
   ../qtpositioning:
-    ref: 222b029360b2e5df751ddc1a7c2bf0b05ecceb30
+    ref: 9f740e9b262eec5ec1421fd894c8dc6320a74afc
     required: false
   ../qttools:
-    ref: 13bd64e58ecde3f6ad530fac5c0ab7cc89e68f5c
+    ref: b9a333ddc89b27ac42895b25fc07e23652b39d5c
     required: false
   ../qtwebchannel:
-    ref: d8db3e27020b5fa7e544a9810e407279d86765bb
+    ref: 1d0290d74a30bda4a3fdff6e4f610a733f30422f
     required: false

From cebe50498b26c2677337f97ebf0548c025c64be6 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Fri, 15 Dec 2023 13:37:19 +0100
Subject: [PATCH 580/681] Forward unhandled mouse wheel events to the parent
 widget
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- All mouse wheel events are forwarded to Chromium.
- Forward unhandled wheel events by Chromium to the parent widget.
- Impersonated QSpontaneKeyEvent in Qt WebEngine to set
  spontaneous flag and forwarded the event as spontaneous.

Fixes: QTBUG-118398
Pick-to: 6.5
Change-Id: I4ec831b0077edc3d833fdd7ae8d31a5535b0c05b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 5654e6c45c4c0aee8d2d6f4e344b4c8c9dd3d74e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ebaed0fa4c336eaa328b6bf011c5d028fa2a20e3)
---
 .../render_widget_host_view_qt_delegate_item.cpp |  6 ++----
 .../render_widget_host_view_qt_delegate_item.h   |  1 +
 src/webenginewidgets/api/qwebengineview.cpp      | 16 ++++++++++++++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index 1ad664a1fa3..78ec06bb8ce 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -449,10 +449,8 @@ void RenderWidgetHostViewQtDelegateItem::updateAdapterClientIfNeeded(WebContents
 
 void RenderWidgetHostViewQtDelegateItem::unhandledWheelEvent(QWheelEvent *ev)
 {
-    if (QWindow *w = Window()) {
-        if (QWindow *p = w->parent())
-            qApp->sendEvent(p, ev);
-    }
+    if (m_widgetDelegate)
+        m_widgetDelegate->unhandledWheelEvent(ev);
 }
 
 } // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt_delegate_item.h b/src/core/render_widget_host_view_qt_delegate_item.h
index 082bd77911e..55f243eab59 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.h
+++ b/src/core/render_widget_host_view_qt_delegate_item.h
@@ -35,6 +35,7 @@ class WidgetDelegate
     virtual void Destroy() = 0;
     virtual void Resize(int, int) { }
     virtual QWindow *Window() { return nullptr; }
+    virtual void unhandledWheelEvent(QWheelEvent *) { }
 };
 
 // Useful information keyboard and mouse QEvent propagation.
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 8d88726fac8..65474506c67 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -68,6 +68,14 @@
 #include <QThread>
 #endif
 
+QT_BEGIN_NAMESPACE
+class QSpontaneKeyEvent
+{
+public:
+    static inline void makeSpontaneous(QEvent *ev) { ev->setSpontaneous(); }
+};
+QT_END_NAMESPACE
+
 namespace QtWebEngineCore {
 class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
 {
@@ -172,6 +180,14 @@ class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
             return root->windowHandle();
         return nullptr;
     }
+    void unhandledWheelEvent(QWheelEvent *ev) override
+    {
+        auto parentWidget = QQuickWidget::parentWidget();
+        if (parentWidget) {
+            QSpontaneKeyEvent::makeSpontaneous(ev);
+            qApp->notify(parentWidget, ev);
+        }
+    }
 
 protected:
     void closeEvent(QCloseEvent *event) override

From b009e9b51eab36494bdadbacae0bf1484bc43e86 Mon Sep 17 00:00:00 2001
From: Karolina Sofia Bang <karolina.bang@qt.io>
Date: Tue, 5 Dec 2023 13:28:37 +0100
Subject: [PATCH 581/681] Redesign spellchecker example

Fixes: QTBUG-119732
Change-Id: Ibfdc2989cea704a05fa5f6ed038c2b08498285e7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 42193e1ee934dabbe5f653c016756f08e3d99c81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0fcc4e584662742cf6a797ca0c9b7d475aa75eaf)
---
 .../spellchecker/CMakeLists.txt               |   1 -
 .../spellchecker/data/icon.svg                |  24 ---
 .../spellchecker/data/index.html              |  47 +++---
 .../spellchecker/data/spellchecker.qrc        |   1 -
 .../spellchecker/data/style.css               | 145 +++++++++++-------
 .../doc/images/spellchecker-example.png       | Bin 15978 -> 28507 bytes
 .../webenginewidgets/spellchecker/main.cpp    |   2 +-
 7 files changed, 112 insertions(+), 108 deletions(-)
 delete mode 100644 examples/webenginewidgets/spellchecker/data/icon.svg

diff --git a/examples/webenginewidgets/spellchecker/CMakeLists.txt b/examples/webenginewidgets/spellchecker/CMakeLists.txt
index 74cb626e164..6e6277d8e78 100644
--- a/examples/webenginewidgets/spellchecker/CMakeLists.txt
+++ b/examples/webenginewidgets/spellchecker/CMakeLists.txt
@@ -32,7 +32,6 @@ target_link_libraries(spellchecker PUBLIC
 
 # Resources:
 set(spellchecker_resource_files
-    "data/icon.svg"
     "data/index.html"
     "data/style.css"
 )
diff --git a/examples/webenginewidgets/spellchecker/data/icon.svg b/examples/webenginewidgets/spellchecker/data/icon.svg
deleted file mode 100644
index b90ff26ddec..00000000000
--- a/examples/webenginewidgets/spellchecker/data/icon.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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/spellchecker/data/index.html b/examples/webenginewidgets/spellchecker/data/index.html
index b6cec5fe036..f68d64bc4ea 100644
--- a/examples/webenginewidgets/spellchecker/data/index.html
+++ b/examples/webenginewidgets/spellchecker/data/index.html
@@ -6,28 +6,29 @@
       <link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body>
-      <form class="form">
-         <img class="logo" src="icon.svg" alt="qtwebengine">
-         <div class="header">
-            <h1>Contact us</h1>
-            <h2>We are here to help</h2>
-         </div>
-         <label>
-         <span>First Name:</span><input id="firstname" type="text" name="name" />
-         </label>
-         <label>
-         <span>Last Name:</span><input id="lastName" type="text" name="name" />
-         </label>
-         <label>
-         <span>Email Address:</span><input id="email" type="text" name="email" />
-         </label>
-         <label>
-         <span>Subject:</span><input id="subject" type="text" name="subject" />
-         </label>
-         <label>
-         <span>Message:</span><textarea id="feedback" name="feedback"></textarea>
-         </label>
-         <input type="submit" value="Send" />
-      </form>
+        <main>
+          <form class="form">
+             <div class="header">
+                <h1>Contact us</h1>
+                <h2>We are here to help</h2>
+             </div>
+             <label>
+             <span>First Name</span><input id="firstname" type="text" name="name" />
+             </label>
+             <label>
+             <span>Last Name</span><input id="lastName" type="text" name="name" />
+             </label>
+             <label>
+             <span>Email</span><input id="email" type="text" name="email" />
+             </label>
+             <label>
+             <span>Subject</span><input id="subject" type="text" name="subject" />
+             </label>
+             <label>
+             <span>Message</span><textarea id="feedback" name="feedback"></textarea>
+             </label>
+             <input type="submit" value="Send" />
+          </form>
+      </main>
    </body>
 </html>
diff --git a/examples/webenginewidgets/spellchecker/data/spellchecker.qrc b/examples/webenginewidgets/spellchecker/data/spellchecker.qrc
index a9c76cc7eed..b5e0b1fe0f1 100644
--- a/examples/webenginewidgets/spellchecker/data/spellchecker.qrc
+++ b/examples/webenginewidgets/spellchecker/data/spellchecker.qrc
@@ -2,6 +2,5 @@
     <qresource prefix="/">
         <file>index.html</file>
         <file>style.css</file>
-        <file>icon.svg</file>
     </qresource>
 </RCC>
diff --git a/examples/webenginewidgets/spellchecker/data/style.css b/examples/webenginewidgets/spellchecker/data/style.css
index 7b6736f1f7c..38873c5a013 100644
--- a/examples/webenginewidgets/spellchecker/data/style.css
+++ b/examples/webenginewidgets/spellchecker/data/style.css
@@ -1,90 +1,119 @@
-.logo {
- width: 50px;
- height: 50px;
- float: left;
- margin: 20px 20px 0px 20px;
- -webkit-animation:spin 8s linear infinite;
+@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
+* {
+  padding: 0;
+  margin: 0;
+  box-sizing: border-box;
+}
+
+
+body {
+    width: 100%;
+    padding: 0px;
+    margin: 0px;
 }
-@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
 
 .header {
- display: inline
+    display: inline;
+}
+
+.main {
+    max-width: 100%;
 }
 
 .form {
-  width: 450px;
-  height: 600px;
-  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;
+    width: 100%;
+    height: 100%;
+    background: #fff;
+    border: 0px solid #999;
+    border-radius: 8px;
+    color: #46a;
+    font-family: 'Titillium Web', sans-serif;
+    font-size: 1rem;
+    margin: auto;
+    padding: 40px;
+    position: relative;
+    line-height: 26px;
+    text-decoration: none;
 }
 
 h1 {
- padding-left:40px;
- color: #46a2da;
+    padding-left: 20px;
+    color: #00414A;
+    font-size: 2.5rem;
+    font-weight: 700;
+    margin-bottom: 1rem;
 }
 
 h2 {
- color: #80c342;
- font-size: 13px;
- margin-top: -20px;
+    padding-left: 20px;
+    color: #00414A;
+    font-size: 1.125rem;
+    font-weight: 400;
+    font-style: italic;
+    margin-bottom: 1.75rem;
 }
 
 span {
-  margin-left: 20px;
+    font-size: 1.5rem;
+    margin-left: 20px;
+    color: #00414A;
+    font-weight: 700;
 }
 
 input {
-  width: 400px;
-  display: block;
-  border: 1px solid #999;
-  height: 25px;
-  margin-left: 20px;
-  margin-bottom: 10px;
-  padding-left: 10px;
-  -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
+    width: 90%;
+    display: block;
+    height: 2.25rem;
+    margin-left: 20px;
+    margin-right: 20px;
+    margin-bottom: 8px;
+    padding-left: 10px;
+    box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.15);
+    border-radius: var(--radius-radius-minimal, 0.25rem);
+    border: 1px solid var(--color-background-normal, #CCC);
+    background: var(--color-text-input-background, #FFF);
 }
 
 textarea {
-  width: 400px;
-  max-width: 400px;
-  height: 180px;
-  max-height: 400px;
-  display: block;
-  margin-left: 20px;
-  padding-left: 10px;
-  padding-right: 10px;
-  -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
+    width: 90%;
+    max-width: 90%;
+    height: 10rem;
+    max-height: 14rem;
+    display: block;
+    margin-left: 20px;
+    margin-right: 20px;
+    padding-left: 10px;
+    padding-top: 10px;
+    box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.15);
+    border-radius: var(--radius-radius-minimal, 0.25rem);
+    border: 1px solid var(--color-background-normal, #CCC);
+    background: var(--color-text-input-background, #FFF);
 }
 
 input:focus, textarea:focus {
- outline:none;
- border: 1px solid #46a2da;
+    outline: none;
+    border: 1px solid #00414A;
 }
 
 input[type=submit] {
-  width: 100px;
-  left: 170px;
-  bottom: 10px;
-  background: #46a2da;
-  color: #fff;
-  height: 30px;
-  position: absolute;
-  border-radius: 14px;
+    display: flex;
+    align-items: center;
+    justify-content: center; /* Add this to horizontally center the content */
+    padding: 0.4444em 0.8889em;
+    height: 2.4em;
+    cursor: pointer;
+    width: 6.5rem;
+    background: #00414A;
+    color: #fff;
+    border-radius: 4px;
+    margin-top: 28px;
+    font-family: 'Titillium Web', sans-serif;
+    font-size: 1.125rem;
+    font-weight: 400;
+    transition: color 300ms ease-out, border 300ms ease-out;
 }
 
 input[type=submit]:hover {
-  background: #80c342;
+    background: #19545C;
 }
 
diff --git a/examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.png b/examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.png
index cc4e74946ae37aad9892c9c839bc8a5265227386..1cbe9e6d3eff00bda31b2166afe00e32a9d78225 100644
GIT binary patch
diff --git a/examples/webenginewidgets/spellchecker/main.cpp b/examples/webenginewidgets/spellchecker/main.cpp
index 63cccb6ea1a..55e06a87480 100644
--- a/examples/webenginewidgets/spellchecker/main.cpp
+++ b/examples/webenginewidgets/spellchecker/main.cpp
@@ -11,7 +11,7 @@ int main(int argc, char *argv[])
 
     WebView view;
     view.setUrl(QUrl(QStringLiteral("qrc:/index.html")));
-    view.resize(500, 640);
+    view.resize(500, 750);
     view.show();
 
     return app.exec();

From 231e3436739a0eea828dd78d1aac4e783b3b22bd Mon Sep 17 00:00:00 2001
From: Matthias Rauter <matthias.rauter@qt.io>
Date: Thu, 14 Dec 2023 14:45:08 +0100
Subject: [PATCH 582/681] Add icons to recipebrowser example

Also fixed the qrc file.

Fixes: QTBUG-119738
Change-Id: I97e981260fff90e6f9ef3a1ea661d9cf47e6ee45
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 12c5da65fd5195279878add7dd1523672f1f152e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 470621789a73825769d0f83b7c9905e73b99c35a)
---
 .../recipebrowser/CMakeLists.txt              |   5 +++
 .../recipebrowser/assets/icons/add.svg        |   4 +++
 .../recipebrowser/assets/icons/edit.svg       |   4 +++
 .../recipebrowser/assets/icons/remove.svg     |   4 +++
 .../assets/icons/stylesheets.svg              |   4 +++
 .../recipebrowser/assets/icons/view.svg       |   4 +++
 .../doc/images/recipebrowser.webp             | Bin 34058 -> 31140 bytes
 .../recipebrowser/mainwindow.cpp              |   2 ++
 .../recipebrowser/mainwindow.ui               |  12 ++++++-
 .../recipebrowser/recipebrowser.qrc           |  34 ++++++++++++------
 .../recipebrowser/stylesheetdialog.ui         |  12 ++++++-
 11 files changed, 72 insertions(+), 13 deletions(-)
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/icons/add.svg
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/icons/edit.svg
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/icons/remove.svg
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg
 create mode 100644 examples/webenginewidgets/recipebrowser/assets/icons/view.svg

diff --git a/examples/webenginewidgets/recipebrowser/CMakeLists.txt b/examples/webenginewidgets/recipebrowser/CMakeLists.txt
index d10409c0940..41a3a5c6f6d 100644
--- a/examples/webenginewidgets/recipebrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/recipebrowser/CMakeLists.txt
@@ -53,6 +53,11 @@ set(recipebrowser_resource_files
     "assets/pages/skewers.html"
     "assets/pages/soup.html"
     "assets/pages/steak.html"
+    "assets/icons/edit.svg"
+    "assets/icons/stylesheets.svg"
+    "assets/icons/add.svg"
+    "assets/icons/remove.svg"
+    "assets/icons/view.svg"
 )
 
 qt_add_resources(recipebrowser "recipebrowser"
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/add.svg b/examples/webenginewidgets/recipebrowser/assets/icons/add.svg
new file mode 100644
index 00000000000..b5ecf9ae283
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/add.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 15C11 15.5523 11.4477 16 12 16C12.5523 16 13 15.5523 13 15V13H15C15.5523 13 16 12.5523 16 12C16 11.4477 15.5523 11 15 11H13V9C13 8.44772 12.5523 8 12 8C11.4477 8 11 8.44772 11 9V11H9C8.44772 11 8 11.4477 8 12C8 12.5523 8.44772 13 9 13H11V15Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/edit.svg b/examples/webenginewidgets/recipebrowser/assets/icons/edit.svg
new file mode 100644
index 00000000000..fe61445dc88
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/edit.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 5C2 3.34315 3.34315 2 5 2H11C11.5523 2 12 2.44772 12 3C12 3.55228 11.5523 4 11 4H5C4.44772 4 4 4.44772 4 5V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V13.125C20 12.5727 20.4477 12.125 21 12.125C21.5523 12.125 22 12.5727 22 13.125V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M19.1974 4C18.9845 4 18.7803 4.08457 18.6298 4.23509L18.1941 4.6708L19.3116 5.82359L19.7649 5.37021C19.9155 5.21969 20 5.01553 20 4.80265C20 4.58978 19.9155 4.38562 19.7649 4.23509C19.6144 4.08457 19.4102 4 19.1974 4ZM17.8972 7.23797L16.7797 6.08518L10.7528 12.1121L10.3744 13.6256L11.8879 13.2473L17.8972 7.23797ZM17.2156 2.82088C17.7412 2.29528 18.4541 2 19.1974 2C19.9407 2 20.6535 2.29528 21.1791 2.82088C21.7047 3.34648 22 4.05934 22 4.80265C22 5.54596 21.7047 6.25883 21.1791 6.78443L13.1062 14.8573C12.9781 14.9855 12.8175 15.0764 12.6417 15.1204L9.24256 15.9701C8.90178 16.0553 8.54129 15.9555 8.29291 15.7071C8.04453 15.4587 7.94468 15.0982 8.02988 14.7575L8.87966 11.3583C8.92362 11.1825 9.01453 11.0219 9.14269 10.8938L17.2156 2.82088Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/remove.svg b/examples/webenginewidgets/recipebrowser/assets/icons/remove.svg
new file mode 100644
index 00000000000..3a5a420ac16
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/remove.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8 12C8 11.4477 8.44772 11 9 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H9C8.44772 13 8 12.5523 8 12Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg b/examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg
new file mode 100644
index 00000000000..e108265b7b6
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="#0D0D0D"/>
+<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22V2Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/view.svg b/examples/webenginewidgets/recipebrowser/assets/icons/view.svg
new file mode 100644
index 00000000000..d2c0c474d9e
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/view.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.08086 11.6061C2.99143 9.48143 5.39011 4 12 4C15.2544 4 17.4247 5.25776 18.9399 6.87988C20.1459 8.17094 20.9403 9.71187 21.5334 10.8623C21.657 11.102 21.7719 11.3248 21.8799 11.5249L22.1676 12.0576L21.8289 12.5595C21.6963 12.7559 21.5424 13 21.3672 13.2781C20.7396 14.2738 19.8378 15.7048 18.6548 16.9413C17.1043 18.5619 14.9479 20 12 20C9.06156 20 6.9144 18.6096 5.36163 17.0026C4.11775 15.7152 3.19708 14.2194 2.55058 13.1691C2.40657 12.9351 2.27617 12.7233 2.15883 12.5408L1.8717 12.0941L2.08086 11.6061ZM4.12801 11.9149C4.18383 12.0048 4.24056 12.0967 4.29832 12.1903C4.94628 13.2397 5.72401 14.4993 6.79992 15.6128C8.10869 16.9673 9.76922 18 12 18C14.2213 18 15.8899 16.9381 17.2097 15.5587C18.2362 14.4858 18.9795 13.3089 19.6021 12.323C19.6836 12.194 19.7631 12.0682 19.8408 11.9464C19.7982 11.8645 19.7554 11.782 19.7124 11.6989C19.1185 10.5529 18.4761 9.31319 17.4784 8.24512C16.308 6.99224 14.6533 6 12 6C7.15387 6 5.13812 9.64957 4.12801 11.9149Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10ZM8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp b/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp
index 8446bcde340939f8e16ccd5b07cd97a260139ed7..7e711c661729598b7487f592a2bf4e2ae024606b 100644
GIT binary patch
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.cpp b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
index 79cd3bb6b3c..7eedab4806f 100644
--- a/examples/webenginewidgets/recipebrowser/mainwindow.cpp
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
@@ -143,10 +143,12 @@ void MainWindow::toggleEditView()
         ui->textEdit->show();
 
         ui->editViewButton->setText(QStringLiteral("View"));
+        ui->editViewButton->setIcon(QIcon(":/icons/view.svg"));
     } else {
         ui->textEdit->hide();
         ui->webEngineView->show();
 
         ui->editViewButton->setText(QStringLiteral("Edit"));
+        ui->editViewButton->setIcon(QIcon(":/icons/edit.svg"));
     }
 }
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.ui b/examples/webenginewidgets/recipebrowser/mainwindow.ui
index b7c29f1b81c..9c2539fd552 100644
--- a/examples/webenginewidgets/recipebrowser/mainwindow.ui
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.ui
@@ -45,6 +45,10 @@
             <property name="text">
              <string>Edit</string>
             </property>
+            <property name="icon">
+             <iconset resource="recipebrowser.qrc">
+              <normaloff>:/icons/edit.svg</normaloff>:/icons/edit.svg</iconset>
+            </property>
            </widget>
           </item>
           <item>
@@ -58,6 +62,10 @@
             <property name="text">
              <string>Stylesheets</string>
             </property>
+            <property name="icon">
+             <iconset resource="recipebrowser.qrc">
+              <normaloff>:/icons/stylesheets.svg</normaloff>:/icons/stylesheets.svg</iconset>
+            </property>
            </widget>
           </item>
          </layout>
@@ -101,6 +109,8 @@
    <container>1</container>
   </customwidget>
  </customwidgets>
- <resources/>
+ <resources>
+  <include location="recipebrowser.qrc"/>
+ </resources>
  <connections/>
 </ui>
diff --git a/examples/webenginewidgets/recipebrowser/recipebrowser.qrc b/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
index 2dc003f308f..c1eb909a7e1 100644
--- a/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
+++ b/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
@@ -1,15 +1,27 @@
 <RCC>
     <qresource prefix="/">
-        <file>assets/3rdparty/markdown.css</file>
-        <file>assets/3rdparty/marked.js</file>
-        <file>assets/custom.js</file>
-        <file>assets/custom.css</file>
-        <file>assets/pages/burger.html</file>
-        <file>assets/pages/cupcakes.html</file>
-        <file>assets/pages/pasta.html</file>
-        <file>assets/pages/pizza.html</file>
-        <file>assets/pages/skewers.html</file>
-        <file>assets/pages/soup.html</file>
-        <file>assets/pages/steak.html</file>
+        <file alias="3rdparty/markdown.css">assets/3rdparty/markdown.css</file>
+        <file alias="3rdparty/marked.js">assets/3rdparty/marked.js</file>
+        <file alias="custom.js">assets/custom.js</file>
+        <file alias="custom.css">assets/custom.css</file>
+        <file alias="pages/images/burger.jpg">assets/pages/images/burger.jpg</file>
+        <file alias="pages/images/cupcakes.jpg">assets/pages/images/cupcakes.jpg</file>
+        <file alias="pages/images/pasta.jpg">assets/pages/images/pasta.jpg</file>
+        <file alias="pages/images/pizza.jpg">assets/pages/images/pizza.jpg</file>
+        <file alias="pages/images/skewers.jpg">assets/pages/images/skewers.jpg</file>
+        <file alias="pages/images/soup.jpg">assets/pages/images/soup.jpg</file>
+        <file alias="pages/images/steak.jpg">assets/pages/images/steak.jpg</file>
+        <file alias="pages/burger.html">assets/pages/burger.html</file>
+        <file alias="pages/cupcakes.html">assets/pages/cupcakes.html</file>
+        <file alias="pages/pasta.html">assets/pages/pasta.html</file>
+        <file alias="pages/pizza.html">assets/pages/pizza.html</file>
+        <file alias="pages/skewers.html">assets/pages/skewers.html</file>
+        <file alias="pages/soup.html">assets/pages/soup.html</file>
+        <file alias="pages/steak.html">assets/pages/steak.html</file>
+        <file alias="icons/edit.svg">assets/icons/edit.svg</file>
+        <file alias="icons/stylesheets.svg">assets/icons/stylesheets.svg</file>
+        <file alias="icons/add.svg">assets/icons/add.svg</file>
+        <file alias="icons/remove.svg">assets/icons/remove.svg</file>
+        <file alias="icons/view.svg">assets/icons/view.svg</file>
     </qresource>
 </RCC>
diff --git a/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui b/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
index 19db267e8da..6ef389195ad 100644
--- a/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
+++ b/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
@@ -68,6 +68,10 @@
           <property name="text">
            <string>Add</string>
           </property>
+          <property name="icon">
+           <iconset resource="recipebrowser.qrc">
+            <normaloff>:/icons/add.svg</normaloff>:/icons/add.svg</iconset>
+          </property>
          </widget>
         </item>
         <item>
@@ -75,6 +79,10 @@
           <property name="text">
            <string>Remove</string>
           </property>
+          <property name="icon">
+           <iconset resource="recipebrowser.qrc">
+            <normaloff>:/icons/remove.svg</normaloff>:/icons/remove.svg</iconset>
+          </property>
          </widget>
         </item>
        </layout>
@@ -84,7 +92,9 @@
    </item>
   </layout>
  </widget>
- <resources/>
+ <resources>
+  <include location="recipebrowser.qrc"/>
+ </resources>
  <connections>
   <connection>
    <sender>buttonBox</sender>

From fe843e52ad784779f7ac6449e41ee13628356c90 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@qt.io>
Date: Mon, 20 Nov 2023 10:30:49 +0100
Subject: [PATCH 583/681] CMake: Fix deployment of QtWebEngine projects on
 Linux

This adds a deployment hook for the generic deployment tool, which deploys
- QtWebEngineProcess to QT_DEPLOY_PREFIX/libexec
- resources to QT_DEPLOY_DATA_DIR/resources
- locales to QT_DEPLOY_TRANSLATIONS_DIR/qtwebengine_locales

Since we're picking this to lower branches, we cannot expect that
QT_DEPLOY_LIBEXEC_DIR is set. Therefore, we initialize it if it doesn't
exist.

Pick-to: 6.5
Task-number: QTBUG-119077
Change-Id: I39fde919044d011376d8beb7e892dc9b5205c028
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 73d58b489e8f4f900042f0ab6c1104e6431752e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 371514b97fa5c4d6f607892469cd3ae9a486ecd7)
---
 CMakeLists.txt                                |   1 -
 src/core/api/CMakeLists.txt                   |   2 +
 .../api/Qt6WebEngineCoreDeploySupport.cmake   | 176 ++++++++++++++++++
 src/core/api/Qt6WebEngineCoreMacros.cmake     |   6 +
 4 files changed, 184 insertions(+), 1 deletion(-)
 create mode 100644 src/core/api/Qt6WebEngineCoreDeploySupport.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index faa9b1a51b0..8f505967b24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,6 @@ cmake_minimum_required(VERSION 3.16)
 include(.cmake.conf)
 include(ExternalProject)
 include(cmake/Functions.cmake)
-include(src/core/api/Qt6WebEngineCoreMacros.cmake)
 
 project(QtWebEngineDummy)
 find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core)
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index 2c36936ddb8..da587119d07 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -55,6 +55,8 @@ qt_internal_add_module(WebEngineCore
         Qt::Gui
         Qt::Network
         Qt::Quick
+    EXTRA_CMAKE_FILES
+        "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}WebEngineCoreDeploySupport.cmake"
 )
 
 set_target_properties(WebEngineCore PROPERTIES QTWEBENGINEPROCESS_NAME ${qtWebEngineProcessName})
diff --git a/src/core/api/Qt6WebEngineCoreDeploySupport.cmake b/src/core/api/Qt6WebEngineCoreDeploySupport.cmake
new file mode 100644
index 00000000000..856a54f17c7
--- /dev/null
+++ b/src/core/api/Qt6WebEngineCoreDeploySupport.cmake
@@ -0,0 +1,176 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# NOTE: This code should only ever be executed in script mode. It expects to be
+#       used either as part of an install(CODE) call or called by a script
+#       invoked via cmake -P as a POST_BUILD step. It would not normally be
+#       included directly, it should be pulled in automatically by the deploy
+#       support set up by qtbase.
+
+cmake_minimum_required(VERSION 3.16...3.21)
+
+_qt_internal_add_deployment_hook(_qt_internal_webenginecore_deploy_hook)
+
+if(NOT QT_DEPLOY_WEBENGINECORE_RESOURCES_DIR)
+    set(QT_DEPLOY_WEBENGINECORE_RESOURCES_DIR "resources")
+endif()
+
+function(_qt_internal_webenginecore_status_message)
+    if(__QT_DEPLOY_VERBOSE)
+        message(STATUS ${ARGV})
+    endif()
+endfunction()
+
+function(_qt_internal_webenginecore_deploy_hook)
+    set(no_value_options "")
+    set(single_value_options "")
+    set(multi_value_options RESOLVED_DEPENDENCIES)
+    cmake_parse_arguments(PARSE_ARGV 0 arg
+        "${no_value_options}" "${single_value_options}" "${multi_value_options}"
+    )
+
+    set(webenginecore_dependency_found FALSE)
+    foreach(dependency IN LISTS arg_RESOLVED_DEPENDENCIES)
+        if(dependency MATCHES "/libQt[0-9]+WebEngineCore[^/]+")
+            set(webenginecore_dependency_found TRUE)
+            break()
+        endif()
+    endforeach()
+
+    if(NOT webenginecore_dependency_found)
+        _qt_internal_webenginecore_status_message(
+            "No QtWebEngineCore dependency found. "
+            "Skipping deployment of QtWebEngine assets."
+        )
+        return()
+    endif()
+
+    _qt_internal_deploy_webenginecore()
+endfunction()
+
+function(_qt_internal_deploy_webenginecore)
+    _qt_internal_deploy_webenginecore_binary()
+    _qt_internal_deploy_webenginecore_data()
+    _qt_internal_deploy_webenginecore_translations()
+endfunction()
+
+function(_qt_internal_deploy_webenginecore_binary)
+    _qt_internal_webenginecore_status_message("Deploying the WebEngineCore process binary")
+
+    set(candidates "QtWebEngineProcess")
+    if(__QT_DEPLOY_ACTIVE_CONFIG STREQUAL "Debug" AND __QT_DEPLOY_SYSTEM_NAME STREQUAL "Windows")
+        list(PREPEND candidates "QtWebEngineProcessd")
+    endif()
+
+    list(TRANSFORM candidates
+        PREPEND "${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_LIBEXECS}/"
+    )
+
+    set(process_path "")
+    foreach(file_path IN LISTS candidates)
+        if(EXISTS "${file_path}")
+            set(process_path "${file_path}")
+            break()
+        endif()
+    endforeach()
+
+    set(install_destination "${QT_DEPLOY_PREFIX}/")
+    if(__QT_DEPLOY_SYSTEM_NAME STREQUAL "Windows")
+        string(APPEND install_destination "${QT_DEPLOY_BIN_DIR}")
+    else()
+        if(NOT DEFINED QT_DEPLOY_LIBEXEC_DIR)
+            set(QT_DEPLOY_LIBEXEC_DIR "libexec")
+        endif()
+        string(APPEND install_destination "${QT_DEPLOY_LIBEXEC_DIR}")
+    endif()
+    file(INSTALL "${process_path}" DESTINATION "${install_destination}")
+
+    get_filename_component(process_file_name "${process_path}" NAME)
+    if(CMAKE_VERSION GREATER_EQUAL "3.19")
+        file(CHMOD "${install_destination}/${process_file_name}"
+            PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
+                        GROUP_EXECUTE GROUP_READ
+                        WORLD_EXECUTE WORLD_READ
+        )
+    else()
+        execute_process(
+            COMMAND chmod 0755 "${install_destination}/${process_file_name}"
+        )
+    endif()
+endfunction()
+
+function(_qt_internal_deploy_webenginecore_data)
+    _qt_internal_webenginecore_status_message("Deploying the WebEngineCore data files")
+    set(data_files
+        icudtl.dat
+        qtwebengine_devtools_resources.pak
+        qtwebengine_resources.pak
+        qtwebengine_resources_100p.pak
+        qtwebengine_resources_200p.pak
+    )
+    get_filename_component(resources_dir "resources" ABSOLUTE
+        BASE_DIR "${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_DATA}"
+    )
+
+    _qt_internal_webenginecore_find_v8_context_snapshot(
+        snapshot_file
+        RESOURCES_DIR "${resources_dir}"
+    )
+    if(NOT snapshot_file STREQUAL "")
+        list(APPEND data_files "${snapshot_file}")
+    endif()
+
+    get_filename_component(install_destination "${QT_DEPLOY_WEBENGINECORE_RESOURCES_DIR}" ABSOLUTE
+        BASE_DIR "${QT_DEPLOY_PREFIX}/${QT_DEPLOY_DATA_DIR}"
+    )
+    foreach(data_file IN LISTS data_files)
+        file(INSTALL "${resources_dir}/${data_file}" DESTINATION "${install_destination}")
+    endforeach()
+endfunction()
+
+# The V8 snapshot file comes as debug or release build. Multi-config builds have both, a self-built
+# Qt might only have the debug one.
+#
+# This function returns the file name of the V8 context snapshot file in ${out_var}.
+# If no snapshot could be found, ${out_var} is the empty string.
+function(_qt_internal_webenginecore_find_v8_context_snapshot out_var)
+     set(no_value_options "")
+     set(single_value_options RESOURCES_DIR)
+     set(multi_value_options "")
+     cmake_parse_arguments(PARSE_ARGV 1 arg
+         "${no_value_options}" "${single_value_options}" "${multi_value_options}"
+     )
+
+    set(result "")
+    set(candidates
+        v8_context_snapshot.bin
+        v8_context_snapshot.debug.bin
+    )
+    if(__QT_DEPLOY_QT_IS_MULTI_CONFIG_BUILD_WITH_DEBUG
+            AND __QT_DEPLOY_ACTIVE_CONFIG STREQUAL "Debug")
+        # Favor the debug version of the snapshot.
+        list(REVERSE candidates)
+    endif()
+    foreach(candidate IN LISTS candidates)
+        if(EXISTS "${arg_RESOURCES_DIR}/${candidate}")
+            set(result "${candidate}")
+            break()
+        endif()
+    endforeach()
+    set("${out_var}" "${result}" PARENT_SCOPE)
+endfunction()
+
+function(_qt_internal_deploy_webenginecore_translations)
+    _qt_internal_webenginecore_status_message("Deploying the WebEngineCore translations")
+
+    get_filename_component(locales_dir "qtwebengine_locales" ABSOLUTE
+        BASE_DIR "${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_TRANSLATIONS}"
+    )
+    get_filename_component(install_destination "qtwebengine_locales" ABSOLUTE
+        BASE_DIR "${QT_DEPLOY_PREFIX}/${QT_DEPLOY_TRANSLATIONS_DIR}"
+    )
+    file(GLOB locale_files "${locales_dir}/*.pak")
+    foreach(locale_file IN LISTS locale_files)
+        file(INSTALL "${locale_file}" DESTINATION "${install_destination}")
+    endforeach()
+endfunction()
diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake
index 7e23f377ec3..a5f80f7b435 100644
--- a/src/core/api/Qt6WebEngineCoreMacros.cmake
+++ b/src/core/api/Qt6WebEngineCoreMacros.cmake
@@ -1,6 +1,12 @@
 # Copyright (C) 2022 The Qt Company Ltd.
 # SPDX-License-Identifier: BSD-3-Clause
 
+# Install support uses the CMAKE_INSTALL_xxxDIR variables. Include this here
+# so that it is more likely to get pulled in earlier at a higher level, and also
+# to avoid re-including it many times later
+include(GNUInstallDirs)
+_qt_internal_add_deploy_support("${CMAKE_CURRENT_LIST_DIR}/Qt6WebEngineCoreDeploySupport.cmake")
+
 function(qt6_add_webengine_dictionary)
     set(options)
     set(oneValueArgs TARGET SOURCE OUTPUT_DIRECTORY)

From 0ea8f4803af76032359c11d11c135049f2f26fe2 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 25 Dec 2023 07:06:15 +0000
Subject: [PATCH 584/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ibeb71a59310bd44f1392632a462481317d704a46
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 12176449f79..bedb89b340e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3732fde7c84587681e8b831c5ce685e6c523ff84
+    ref: 27aceebe22ec207c3bb3c7f90fd71c28540b33bc
     required: true
   ../qtpositioning:
-    ref: 9f740e9b262eec5ec1421fd894c8dc6320a74afc
+    ref: 758851c396a1e442bc4d9eec3f68e6f6fd3e5981
     required: false
   ../qttools:
-    ref: b9a333ddc89b27ac42895b25fc07e23652b39d5c
+    ref: c73d137dcc7ba8ce0688f61b3c6632db2f121abc
     required: false
   ../qtwebchannel:
-    ref: 1d0290d74a30bda4a3fdff6e4f610a733f30422f
+    ref: 828fdb792baa956582ca96d3026ce9acc19c5e28
     required: false

From 98af985794047d8e48325923292099e411f95fab Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Fri, 15 Dec 2023 13:37:19 +0100
Subject: [PATCH 585/681] Forward unhandled mouse wheel events to the parent
 widget
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- All mouse wheel events are forwarded to Chromium.
- Forward unhandled wheel events by Chromium to the parent widget.
- Impersonated QSpontaneKeyEvent in Qt WebEngine to set
  spontaneous flag and forwarded the event as spontaneous.

Fixes: QTBUG-118398
Change-Id: I4ec831b0077edc3d833fdd7ae8d31a5535b0c05b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 5654e6c45c4c0aee8d2d6f4e344b4c8c9dd3d74e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ebaed0fa4c336eaa328b6bf011c5d028fa2a20e3)
(cherry picked from commit cebe50498b26c2677337f97ebf0548c025c64be6)
---
 .../render_widget_host_view_qt_delegate_item.cpp |  6 ++----
 .../render_widget_host_view_qt_delegate_item.h   |  1 +
 src/webenginewidgets/api/qwebengineview.cpp      | 16 ++++++++++++++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
index 9723fcf2ce6..95b4c511b18 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -449,10 +449,8 @@ void RenderWidgetHostViewQtDelegateItem::updateAdapterClientIfNeeded(WebContents
 
 void RenderWidgetHostViewQtDelegateItem::unhandledWheelEvent(QWheelEvent *ev)
 {
-    if (QWindow *w = Window()) {
-        if (QWindow *p = w->parent())
-            qApp->sendEvent(p, ev);
-    }
+    if (m_widgetDelegate)
+        m_widgetDelegate->unhandledWheelEvent(ev);
 }
 
 } // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt_delegate_item.h b/src/core/render_widget_host_view_qt_delegate_item.h
index 6af81fea38b..d4dd4295c6a 100644
--- a/src/core/render_widget_host_view_qt_delegate_item.h
+++ b/src/core/render_widget_host_view_qt_delegate_item.h
@@ -35,6 +35,7 @@ class WidgetDelegate
     virtual void Destroy() = 0;
     virtual void Resize(int, int) { }
     virtual QWindow *Window() { return nullptr; }
+    virtual void unhandledWheelEvent(QWheelEvent *) { }
 };
 
 // Useful information keyboard and mouse QEvent propagation.
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 8d88726fac8..65474506c67 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -68,6 +68,14 @@
 #include <QThread>
 #endif
 
+QT_BEGIN_NAMESPACE
+class QSpontaneKeyEvent
+{
+public:
+    static inline void makeSpontaneous(QEvent *ev) { ev->setSpontaneous(); }
+};
+QT_END_NAMESPACE
+
 namespace QtWebEngineCore {
 class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
 {
@@ -172,6 +180,14 @@ class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
             return root->windowHandle();
         return nullptr;
     }
+    void unhandledWheelEvent(QWheelEvent *ev) override
+    {
+        auto parentWidget = QQuickWidget::parentWidget();
+        if (parentWidget) {
+            QSpontaneKeyEvent::makeSpontaneous(ev);
+            qApp->notify(parentWidget, ev);
+        }
+    }
 
 protected:
     void closeEvent(QCloseEvent *event) override

From 72c167ff52c497f80269c2a1d6c9fd4b9c120f0a Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 29 Dec 2023 10:08:48 -0700
Subject: [PATCH 586/681] Harden QPdfSearchModel::resultAtIndex() against OOB
 index

Fixes: QTBUG-119776
Pick-to: 6.5 6.2
Change-Id: Id7addc15c15b78451d7f8b989335d12976426a30
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0dbc2de4a7dc20627a7382776d6b896fdd094e61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7ce8149bf136f27802a3a3ba9d9adf4f2e0cba76)
---
 src/pdf/qpdfsearchmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 90be76b8ea9..78dfe06fa52 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -173,7 +173,7 @@ QPdfLink QPdfSearchModel::resultAtIndex(int index) const
 {
     Q_D(const QPdfSearchModel);
     const auto pi = const_cast<QPdfSearchModelPrivate*>(d)->pageAndIndexForResult(index);
-    if (pi.page < 0)
+    if (pi.page < 0 || index < 0)
         return {};
     return d->searchResults[pi.page][pi.index];
 }

From dbf2cfefa5f7f4bb1a7e492d058fb4048ab17f10 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 29 Dec 2023 12:27:55 -0700
Subject: [PATCH 587/681] Fix crash in QQuickPdfSearchModel::setCurrentPage()

Found while testing the single-page example with a fix for QTBUG-119776:
m_quickDocument is null until we open a document.

Pick-to: 6.5 6.2
Task-number: QTBUG-119776
Change-Id: I548d549d4fc63d1a40b141f728c0c58d3db1178d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a21be3a9fe6747e6d4da762a4350ff024f94547c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ede8d4b6e4ea6ce1f4352346b672e54c3b695a5b)
---
 src/pdfquick/qquickpdfsearchmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdfquick/qquickpdfsearchmodel.cpp b/src/pdfquick/qquickpdfsearchmodel.cpp
index ca33a6dc624..21fa1a70bb5 100644
--- a/src/pdfquick/qquickpdfsearchmodel.cpp
+++ b/src/pdfquick/qquickpdfsearchmodel.cpp
@@ -199,7 +199,7 @@ QList<QPolygonF> QQuickPdfSearchModel::boundingPolygonsOnPage(int page)
 */
 void QQuickPdfSearchModel::setCurrentPage(int currentPage)
 {
-    if (m_currentPage == currentPage)
+    if (m_currentPage == currentPage || !document())
         return;
 
     const auto pageCount = document()->document()->pageCount();

From c472a0f7ba2756b64990e5a814a4d6b274d5f90a Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 19 Dec 2023 09:40:12 +0100
Subject: [PATCH 588/681] Fix for crash in tst_multipageview
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes: QTBUG-104766
Fixes: QTBUG-120245
Change-Id: If79f4bef1d6b42e2df3537482613d977c86d90dd
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 54c61c7912c163ad1153dfca360565fdf107e666)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 src/pdfquick/qquickpdfdocument.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index a9f0d196e13..9770900db57 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -72,7 +72,8 @@ void QQuickPdfDocument::setSource(QUrl source)
 
     m_source = source;
     m_maxPageWidthHeight = QSizeF();
-    m_carrierFile->deleteLater();
+    if (m_carrierFile)
+        m_carrierFile->deleteLater();
     m_carrierFile = nullptr;
     emit sourceChanged();
     const QQmlContext *context = qmlContext(this);

From 67f61eed87fa400d20a66cdae1ca84489392179e Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 19 Dec 2023 09:40:12 +0100
Subject: [PATCH 589/681] Fix for crash in tst_multipageview
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes: QTBUG-104766
Fixes: QTBUG-120245
Change-Id: If79f4bef1d6b42e2df3537482613d977c86d90dd
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 54c61c7912c163ad1153dfca360565fdf107e666)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 src/pdfquick/qquickpdfdocument.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index a9f0d196e13..9770900db57 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -72,7 +72,8 @@ void QQuickPdfDocument::setSource(QUrl source)
 
     m_source = source;
     m_maxPageWidthHeight = QSizeF();
-    m_carrierFile->deleteLater();
+    if (m_carrierFile)
+        m_carrierFile->deleteLater();
     m_carrierFile = nullptr;
     emit sourceChanged();
     const QQmlContext *context = qmlContext(this);

From f1ba00acba45f6715249f492a16250315515a2d9 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 29 Dec 2023 12:27:55 -0700
Subject: [PATCH 590/681] Fix crash in QQuickPdfSearchModel::setCurrentPage()

Found while testing the single-page example with a fix for QTBUG-119776:
m_quickDocument is null until we open a document.

Pick-to: 6.2
Task-number: QTBUG-119776
Change-Id: I548d549d4fc63d1a40b141f728c0c58d3db1178d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a21be3a9fe6747e6d4da762a4350ff024f94547c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ede8d4b6e4ea6ce1f4352346b672e54c3b695a5b)
(cherry picked from commit dbf2cfefa5f7f4bb1a7e492d058fb4048ab17f10)
---
 src/pdfquick/qquickpdfsearchmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdfquick/qquickpdfsearchmodel.cpp b/src/pdfquick/qquickpdfsearchmodel.cpp
index ca33a6dc624..21fa1a70bb5 100644
--- a/src/pdfquick/qquickpdfsearchmodel.cpp
+++ b/src/pdfquick/qquickpdfsearchmodel.cpp
@@ -199,7 +199,7 @@ QList<QPolygonF> QQuickPdfSearchModel::boundingPolygonsOnPage(int page)
 */
 void QQuickPdfSearchModel::setCurrentPage(int currentPage)
 {
-    if (m_currentPage == currentPage)
+    if (m_currentPage == currentPage || !document())
         return;
 
     const auto pageCount = document()->document()->pageCount();

From c7755c93f2ecd54136d669e4f910642df0988b17 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 29 Dec 2023 10:08:48 -0700
Subject: [PATCH 591/681] Harden QPdfSearchModel::resultAtIndex() against OOB
 index

Fixes: QTBUG-119776
Pick-to: 6.2
Change-Id: Id7addc15c15b78451d7f8b989335d12976426a30
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0dbc2de4a7dc20627a7382776d6b896fdd094e61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7ce8149bf136f27802a3a3ba9d9adf4f2e0cba76)
(cherry picked from commit 72c167ff52c497f80269c2a1d6c9fd4b9c120f0a)
---
 src/pdf/qpdfsearchmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 90be76b8ea9..78dfe06fa52 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -173,7 +173,7 @@ QPdfLink QPdfSearchModel::resultAtIndex(int index) const
 {
     Q_D(const QPdfSearchModel);
     const auto pi = const_cast<QPdfSearchModelPrivate*>(d)->pageAndIndexForResult(index);
-    if (pi.page < 0)
+    if (pi.page < 0 || index < 0)
         return {};
     return d->searchResults[pi.page][pi.index];
 }

From 0ada5385d4020479f511179f0fcd605cbe8296a4 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 2 Jan 2024 11:04:49 +0100
Subject: [PATCH 592/681] Add missing cmake include

Without the include module build with BUILD_TESTS=ON
is broken as cmake function call for dictionary setup is not
found.

This commit amends 73d58b489e8f4f900042f0ab6c1104e6431752e1.

Pick-to: 6.5
Change-Id: I2c02317b92e1b5726963d120bf97dff1a12c7375
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b50731bffae31729b1c5c43ad7f869b5cc65e81b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3b038efa3762a8e7603529c7882d99b1d92fe6e8)
---
 tests/auto/widgets/spellchecking/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/auto/widgets/spellchecking/CMakeLists.txt b/tests/auto/widgets/spellchecking/CMakeLists.txt
index 8c538377d60..d0c7656c1e9 100644
--- a/tests/auto/widgets/spellchecking/CMakeLists.txt
+++ b/tests/auto/widgets/spellchecking/CMakeLists.txt
@@ -2,6 +2,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 
 include(../../util/util.cmake)
+include(../../../../src/core/api/Qt6WebEngineCoreMacros.cmake)
 
 qt_internal_add_test(tst_spellchecking
     SOURCES

From d9cf674ed9fe682d4b3bec8eff81e381c7251d68 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 29 Dec 2023 12:54:32 -0700
Subject: [PATCH 593/681] PDF Quick examples: select text in search field when
 pressing Ctrl-F

It's better for usability in case the user is doing repeated searches:
press control-F and start typing to search for different text, rather
than needing to do something else to select or delete the existing
text in the search field.

Fixes: QTBUG-120447
Pick-to: 6.5 6.2
Change-Id: I8d5a519a631c406dff91198b23a022856609fa4c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 140edbd6c887c0ae26a054d8c859041c68f06fd7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 274fb4698fa06cf513ce48b71a4f59d3e1608a3c)
---
 examples/pdf/multipage/viewer.qml | 5 ++++-
 examples/pdf/pdfviewer/viewer.qml | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index d0b0a726354..9a3ca6bad4a 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -127,7 +127,10 @@ ApplicationWindow {
             }
             Shortcut {
                 sequence: StandardKey.Find
-                onActivated: searchField.forceActiveFocus()
+                onActivated: {
+                    searchField.forceActiveFocus()
+                    searchField.selectAll()
+                }
             }
             Shortcut {
                 sequence: StandardKey.Quit
diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml
index a6203516627..1745b70d94d 100644
--- a/examples/pdf/pdfviewer/viewer.qml
+++ b/examples/pdf/pdfviewer/viewer.qml
@@ -129,7 +129,10 @@ ApplicationWindow {
             }
             Shortcut {
                 sequence: StandardKey.Find
-                onActivated: searchField.forceActiveFocus()
+                onActivated: {
+                    searchField.forceActiveFocus()
+                    searchField.selectAll()
+                }
             }
             Shortcut {
                 sequence: StandardKey.Quit

From d41ca8eedee20409bd38b2668ead2d420ba38fdb Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 15 Dec 2023 17:28:37 +0100
Subject: [PATCH 594/681] Fix wrong dictionary file layout

The MACOSX_BUNDLE can be always set despite of the platform,
so check if we are on mac (or ios for completeness)

Change-Id: I808afbad4b1dac565049eca084bef187e93e6fd0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 290a93bcf4ebb3ae6582e3cae8cb4b2f4bd7c38b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 85de311ce282ee513d28874f14ae00a4b77f33ef)
---
 src/core/api/Qt6WebEngineCoreMacros.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake
index a5f80f7b435..6c335aad1df 100644
--- a/src/core/api/Qt6WebEngineCoreMacros.cmake
+++ b/src/core/api/Qt6WebEngineCoreMacros.cmake
@@ -29,7 +29,7 @@ function(qt6_add_webengine_dictionary)
         set(copyCommand COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_OUTPUT_DIRECTORY}/dict
            ${ARGS_OUTPUT_DIRECTORY}/$<CONFIG>
         )
-    elseif(isBundle)
+    elseif((MACOS OR IOS) AND isBundle)
         get_target_property(outputName ${ARGS_TARGET} OUTPUT_NAME)
         if(NOT outputName)
            set(outputName ${ARGS_TARGET})

From 49b27ea6cacca36ded754f0340af8a74c6630d39 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 2 Jan 2024 16:44:21 +0100
Subject: [PATCH 595/681] Fix the background color issue in cookiebrowser

In cookiebrowser example, all new cookie widgets are added at position
0. Background color of the newly added widget is set based on the
color of last inserted cookie widget.

Fixes: QTBUG-120446
Pick-to: 6.5
Change-Id: I76fe3ae83b31489365396a2ebcd31d840b2fa857
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 285dfce3c0f8e61228784ef557844c66d44feb1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9eb97b4b3bfefb9c475e3aa5056a8641aa4b102d)
---
 .../webenginewidgets/cookiebrowser/mainwindow.cpp  | 14 ++++++++++++--
 .../webenginewidgets/cookiebrowser/mainwindow.h    |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/webenginewidgets/cookiebrowser/mainwindow.cpp b/examples/webenginewidgets/cookiebrowser/mainwindow.cpp
index bf65870f861..67454a9f16a 100644
--- a/examples/webenginewidgets/cookiebrowser/mainwindow.cpp
+++ b/examples/webenginewidgets/cookiebrowser/mainwindow.cpp
@@ -59,6 +59,7 @@ CookieWidget::CookieWidget(const QNetworkCookie &cookie, QWidget *parent): QWidg
 
 void CookieWidget::setHighlighted(bool enabled)
 {
+    m_isHighlighted = enabled;
     QPalette p = palette();
     p.setColor(backgroundRole(), enabled ? p.alternateBase().color() : p.base().color());
     setPalette(p);
@@ -112,9 +113,18 @@ void MainWindow::handleCookieAdded(const QNetworkCookie &cookie)
         return;
 
     CookieWidget *widget = new CookieWidget(cookie);
-    widget->setHighlighted(m_cookies.count() % 2);
     m_cookies.append(cookie);
-    m_layout->insertWidget(0,widget);
+    // Check whether the first widget in the layout is highlighted.
+    // if it is highlighted, then do not highlight the new item.
+    CookieWidget *firstWidget = m_layout->count()
+            ? qobject_cast<CookieWidget *>(m_layout->itemAt(0)->widget())
+            : nullptr;
+    if (firstWidget) {
+        widget->setHighlighted(!firstWidget->isHighlighted());
+    } else {
+        widget->setHighlighted(false);
+    }
+    m_layout->insertWidget(0, widget);
 
     connect(widget, &CookieWidget::deleteClicked, [this, cookie, widget]() {
         m_store->deleteCookie(cookie);
diff --git a/examples/webenginewidgets/cookiebrowser/mainwindow.h b/examples/webenginewidgets/cookiebrowser/mainwindow.h
index 76fd7de3edc..da0d438cab6 100644
--- a/examples/webenginewidgets/cookiebrowser/mainwindow.h
+++ b/examples/webenginewidgets/cookiebrowser/mainwindow.h
@@ -29,9 +29,13 @@ class CookieWidget : public QWidget,  public Ui_CookieWidget
 public:
     CookieWidget(const QNetworkCookie &cookie, QWidget *parent = nullptr);
     void setHighlighted(bool enabled);
+    bool isHighlighted() { return m_isHighlighted; }
 signals:
     void deleteClicked();
     void viewClicked();
+
+private:
+    bool m_isHighlighted = false;
 };
 
 class MainWindow : public QMainWindow, public Ui_MainWindow

From 38c44866200b393608c4cfc14910191fd3459945 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Wed, 6 Dec 2023 14:04:24 +0100
Subject: [PATCH 596/681] Add default styled icons to actions

- Added a default icon to action using the newly introduced  QWebEngineViewPrivate::webActionIcon()

Fixes: QTBUG-119722
Change-Id: I4ee9b4380ead80d991756147bfef40f0f17c0849
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit a25d6fb7da7287dfe6c9d86e917013ea262a9ac1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5c0c7c7e966e56c0489780fa45679ac909dfa668)
---
 src/core/doc/src/qwebenginepage_lgpl.qdoc     |  3 +
 src/webenginewidgets/api/qwebengineview.cpp   | 65 +++++++++++--------
 src/webenginewidgets/api/qwebengineview_p.h   |  2 +-
 .../doc/src/qwebengineview_lgpl.qdoc          |  1 +
 4 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/src/core/doc/src/qwebenginepage_lgpl.qdoc b/src/core/doc/src/qwebenginepage_lgpl.qdoc
index cffc732469d..8f8f5096852 100644
--- a/src/core/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginepage_lgpl.qdoc
@@ -452,6 +452,9 @@
     The action is owned by the QWebEnginePage but you can customize the look by
     changing its properties.
 
+    \l{QWebEnginePage::action(WebAction action)} does not have a default styled icon.
+    Use \l{QWebEngineView::pageAction()} to have an action with a default styled icon.
+
     QWebEnginePage also takes care of implementing the action, so that upon
     triggering the corresponding action is performed on the page.
 
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 65474506c67..952ebe7cd4c 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -747,9 +747,9 @@ void QWebEngineViewPrivate::bindPageAndWidget(QWebEnginePagePrivate *pagePrivate
     }
 }
 
-QIcon QWebEngineViewPrivate::webActionIcon(QWebEnginePage::WebAction action)
+QIcon QWebEngineViewPrivate::webActionIcon(QWebEnginePage::WebAction action) const
 {
-    Q_Q(QWebEngineView);
+    Q_Q(const QWebEngineView);
     QIcon icon;
     QStyle *style = q->style();
 
@@ -1121,7 +1121,16 @@ QString QWebEngineView::selectedText() const
 #if QT_CONFIG(action)
 QAction* QWebEngineView::pageAction(QWebEnginePage::WebAction action) const
 {
-    return page()->action(action);
+    Q_D(const QWebEngineView);
+    QAction *pageAction = page()->action(action);
+
+    if (pageAction->icon().isNull()) {
+        auto icon = d->webActionIcon(action);
+        if (!icon.isNull())
+            pageAction->setIcon(icon);
+    }
+
+    return pageAction;
 }
 #endif
 
@@ -1479,79 +1488,79 @@ void QContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
 
     switch (menuItem) {
     case ContextMenuItem::Back:
-        action = thisRef->action(QWebEnginePage::Back);
+        action = m_view->pageAction(QWebEnginePage::Back);
         break;
     case ContextMenuItem::Forward:
-        action = thisRef->action(QWebEnginePage::Forward);
+        action = m_view->pageAction(QWebEnginePage::Forward);
         break;
     case ContextMenuItem::Reload:
-        action = thisRef->action(QWebEnginePage::Reload);
+        action = m_view->pageAction(QWebEnginePage::Reload);
         break;
     case ContextMenuItem::Cut:
-        action = thisRef->action(QWebEnginePage::Cut);
+        action = m_view->pageAction(QWebEnginePage::Cut);
         break;
     case ContextMenuItem::Copy:
-        action = thisRef->action(QWebEnginePage::Copy);
+        action = m_view->pageAction(QWebEnginePage::Copy);
         break;
     case ContextMenuItem::Paste:
-        action = thisRef->action(QWebEnginePage::Paste);
+        action = m_view->pageAction(QWebEnginePage::Paste);
         break;
     case ContextMenuItem::Undo:
-        action = thisRef->action(QWebEnginePage::Undo);
+        action = m_view->pageAction(QWebEnginePage::Undo);
         break;
     case ContextMenuItem::Redo:
-        action = thisRef->action(QWebEnginePage::Redo);
+        action = m_view->pageAction(QWebEnginePage::Redo);
         break;
     case ContextMenuItem::SelectAll:
-        action = thisRef->action(QWebEnginePage::SelectAll);
+        action = m_view->pageAction(QWebEnginePage::SelectAll);
         break;
     case ContextMenuItem::PasteAndMatchStyle:
-        action = thisRef->action(QWebEnginePage::PasteAndMatchStyle);
+        action = m_view->pageAction(QWebEnginePage::PasteAndMatchStyle);
         break;
     case ContextMenuItem::OpenLinkInNewWindow:
-        action = thisRef->action(QWebEnginePage::OpenLinkInNewWindow);
+        action = m_view->pageAction(QWebEnginePage::OpenLinkInNewWindow);
         break;
     case ContextMenuItem::OpenLinkInNewTab:
-        action = thisRef->action(QWebEnginePage::OpenLinkInNewTab);
+        action = m_view->pageAction(QWebEnginePage::OpenLinkInNewTab);
         break;
     case ContextMenuItem::CopyLinkToClipboard:
-        action = thisRef->action(QWebEnginePage::CopyLinkToClipboard);
+        action = m_view->pageAction(QWebEnginePage::CopyLinkToClipboard);
         break;
     case ContextMenuItem::DownloadLinkToDisk:
-        action = thisRef->action(QWebEnginePage::DownloadLinkToDisk);
+        action = m_view->pageAction(QWebEnginePage::DownloadLinkToDisk);
         break;
     case ContextMenuItem::CopyImageToClipboard:
-        action = thisRef->action(QWebEnginePage::CopyImageToClipboard);
+        action = m_view->pageAction(QWebEnginePage::CopyImageToClipboard);
         break;
     case ContextMenuItem::CopyImageUrlToClipboard:
-        action = thisRef->action(QWebEnginePage::CopyImageUrlToClipboard);
+        action = m_view->pageAction(QWebEnginePage::CopyImageUrlToClipboard);
         break;
     case ContextMenuItem::DownloadImageToDisk:
-        action = thisRef->action(QWebEnginePage::DownloadImageToDisk);
+        action = m_view->pageAction(QWebEnginePage::DownloadImageToDisk);
         break;
     case ContextMenuItem::CopyMediaUrlToClipboard:
-        action = thisRef->action(QWebEnginePage::CopyMediaUrlToClipboard);
+        action = m_view->pageAction(QWebEnginePage::CopyMediaUrlToClipboard);
         break;
     case ContextMenuItem::ToggleMediaControls:
-        action = thisRef->action(QWebEnginePage::ToggleMediaControls);
+        action = m_view->pageAction(QWebEnginePage::ToggleMediaControls);
         break;
     case ContextMenuItem::ToggleMediaLoop:
-        action = thisRef->action(QWebEnginePage::ToggleMediaLoop);
+        action = m_view->pageAction(QWebEnginePage::ToggleMediaLoop);
         break;
     case ContextMenuItem::DownloadMediaToDisk:
-        action = thisRef->action(QWebEnginePage::DownloadMediaToDisk);
+        action = m_view->pageAction(QWebEnginePage::DownloadMediaToDisk);
         break;
     case ContextMenuItem::InspectElement:
-        action = thisRef->action(QWebEnginePage::InspectElement);
+        action = m_view->pageAction(QWebEnginePage::InspectElement);
         break;
     case ContextMenuItem::ExitFullScreen:
-        action = thisRef->action(QWebEnginePage::ExitFullScreen);
+        action = m_view->pageAction(QWebEnginePage::ExitFullScreen);
         break;
     case ContextMenuItem::SavePage:
-        action = thisRef->action(QWebEnginePage::SavePage);
+        action = m_view->pageAction(QWebEnginePage::SavePage);
         break;
     case ContextMenuItem::ViewSource:
-        action = thisRef->action(QWebEnginePage::ViewSource);
+        action = m_view->pageAction(QWebEnginePage::ViewSource);
         break;
     case ContextMenuItem::SpellingSuggestions:
         for (int i = 0; i < m_contextData->spellCheckerSuggestions().size() && i < 4; i++) {
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index 7c0f3fe60c2..9d5a0ad219a 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -85,7 +85,7 @@ class QWebEngineViewPrivate : public PageView
     static void bindPageAndView(QWebEnginePage *page, QWebEngineView *view);
     static void bindPageAndWidget(QWebEnginePagePrivate *pagePrivate,
                                   QtWebEngineCore::WebEngineQuickWidget *widget);
-    QIcon webActionIcon(QWebEnginePage::WebAction action);
+    QIcon webActionIcon(QWebEnginePage::WebAction action) const;
     void unhandledKeyEvent(QKeyEvent *event) override;
     void focusContainer() override;
     bool passOnFocus(bool reverse) override;
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 9b8ee29eb91..03489640a47 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -210,6 +210,7 @@
 /*!
     \fn QAction *QWebEngineView::pageAction(QWebEnginePage::WebAction action) const
     Returns a pointer to a QAction that encapsulates the specified web action \a action.
+    This function will also set a default styled icon to the QAction if it lacks one.
 */
 
 /*!

From 6ba530da27a7359d7d39b36d0792a7d929d5b274 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Thu, 4 Jan 2024 11:06:22 -0700
Subject: [PATCH 597/681] QQuickPdfPageImage::load(): fall back to base class
 impl to avoid crash

Plain Image is ok for loading one PDF page at a time, except that the
pdf plugin has to create its own PDF document object if it cannot reuse
an instance that is already open. So PdfPageImage was created just as an
optimization, with the expectation that the document will be given to
the document property. But in case someone doesn't understand and tries
to set only the inherited Image.source property instead, fall back to
QQuickImageBase::load() to avoid crashing. Amends
7b8832ca2b84d549c9d374550c3c46b3d4d42a38

If both the document and source properties are set, prefer the document
(for the sake of performance).

Add test coverage of other combinations of properties, while we're at it.

Pick-to: 6.5
Fixes: QTBUG-104767
Task-number: QTBUG-77506
Change-Id: I1ee0d0bb2a6c5f399234ddddd969be02e7a6c020
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b60c00f4adec9ea4b75af0226b04a7125e166ae2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2180ce8901ac1caddf5b7b5cd73ba67d2d08349a)
---
 src/pdfquick/qquickpdfpageimage.cpp           |  14 +-
 tests/auto/pdfquick/CMakeLists.txt            |   1 +
 .../auto/pdfquick/pdfpageimage/CMakeLists.txt |  30 ++++
 .../pdfpageimage/data/bookmarksAndLinks.pdf   | Bin 0 -> 4259 bytes
 .../pdfpageimage/data/pdfPageImage.qml        |  16 +++
 .../pdfpageimage/tst_pdfpageimage.cpp         | 131 ++++++++++++++++++
 6 files changed, 191 insertions(+), 1 deletion(-)
 create mode 100644 tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
 create mode 100644 tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf
 create mode 100644 tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
 create mode 100644 tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp

diff --git a/src/pdfquick/qquickpdfpageimage.cpp b/src/pdfquick/qquickpdfpageimage.cpp
index 2ea8ebc12ca..f2da067f1b5 100644
--- a/src/pdfquick/qquickpdfpageimage.cpp
+++ b/src/pdfquick/qquickpdfpageimage.cpp
@@ -76,6 +76,18 @@ QQuickPdfDocument *QQuickPdfPageImage::document() const
 void QQuickPdfPageImage::load()
 {
     Q_D(QQuickPdfPageImage);
+    QUrl url = source();
+    if (!d->doc || !d->doc->carrierFile()) {
+        if (!url.isEmpty()) {
+            qmlWarning(this) << "document property not set: falling back to inefficient loading of " << url;
+            QQuickImageBase::load();
+        }
+        return;
+    }
+    if (url != d->doc->resolvedSource()) {
+        url = d->doc->resolvedSource();
+        qmlWarning(this) << "document and source properties in conflict: preferring document source " << url;
+    }
     auto carrierFile = d->doc->carrierFile();
     static int thisRequestProgress = -1;
     static int thisRequestFinished = -1;
@@ -86,7 +98,7 @@ void QQuickPdfPageImage::load()
             QQuickImageBase::staticMetaObject.indexOfSlot("requestFinished()");
     }
 
-    d->pix.loadImageFromDevice(qmlEngine(this), carrierFile, d->url,
+    d->pix.loadImageFromDevice(qmlEngine(this), carrierFile, url,
                                d->sourceClipRect.toRect(), d->sourcesize * d->devicePixelRatio,
                                QQuickImageProviderOptions(), d->currentFrame, d->frameCount);
 
diff --git a/tests/auto/pdfquick/CMakeLists.txt b/tests/auto/pdfquick/CMakeLists.txt
index 9f79459b2be..e6a3a460c32 100644
--- a/tests/auto/pdfquick/CMakeLists.txt
+++ b/tests/auto/pdfquick/CMakeLists.txt
@@ -1 +1,2 @@
 add_subdirectory(multipageview)
+add_subdirectory(pdfpageimage)
diff --git a/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt b/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
new file mode 100644
index 00000000000..da67d872100
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Collect test data
+file(GLOB_RECURSE test_data_glob
+    RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+    data/*)
+list(APPEND test_data ${test_data_glob})
+
+qt_internal_add_test(tst_pdfpageimage
+    SOURCES
+        tst_pdfpageimage.cpp
+        ../shared/util.cpp ../shared/util.h
+    LIBRARIES
+        Qt::Gui
+        Qt::Quick
+        Qt::PdfQuickPrivate
+    TESTDATA ${test_data}
+)
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(tst_pdfpageimage CONDITION ANDROID OR IOS
+    DEFINES
+        QT_QMLTEST_DATADIR=":/data"
+)
+
+qt_internal_extend_target(tst_pdfpageimage CONDITION NOT ANDROID AND NOT IOS
+    DEFINES
+        QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
+)
+
diff --git a/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf b/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..aa0b9903982736fe617267c0843c8ec977dc0c6b
GIT binary patch
diff --git a/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml b/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
new file mode 100644
index 00000000000..a268bf14b96
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
@@ -0,0 +1,16 @@
+import QtQuick
+import QtQuick.Pdf
+
+Item {
+    width: 320
+    height: 320
+
+    PdfDocument {
+        id: doc
+        source: "bookmarksAndLinks.pdf"
+    }
+
+    PdfPageImage {
+        anchors.centerIn: parent
+    }
+}
diff --git a/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp b/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp
new file mode 100644
index 00000000000..d2c9c8709f6
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp
@@ -0,0 +1,131 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QRegularExpression>
+#include <QSignalSpy>
+#include <QTest>
+#include <QtQuick/QQuickView>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+#include <QtPdfQuick/private/qquickpdfpageimage_p.h>
+#include "../shared/util.h"
+
+using namespace Qt::StringLiterals;
+
+Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests")
+
+// #define DEBUG_WRITE_OUTPUT
+
+class tst_PdfPageImage : public QQuickDataTest
+{
+    Q_OBJECT
+
+private Q_SLOTS:
+    void settableProperties_data();
+    void settableProperties();
+
+public:
+    enum Property {
+        Source = 0x01,
+        Document = 0x02,
+        SourceSize = 0x04,
+        SourceClipRect = 0x08,
+        MipMap = 0x10,
+        AutoTransform = 0x20,
+        Asynchronous = 0x40,
+        NoCache = 0x80,
+        Mirror = 0x100,
+        MirrorVertically = 0x200,
+        ColorSpace = 0x400,
+    };
+    Q_DECLARE_FLAGS(Properties, Property)
+    Q_FLAG(Properties)
+
+private:
+#ifdef DEBUG_WRITE_OUTPUT
+    QTemporaryDir m_tmpDir;
+#endif
+};
+
+void tst_PdfPageImage::settableProperties_data()
+{
+    QTest::addColumn<tst_PdfPageImage::Properties>("toSet");
+    QTest::addColumn<QSize>("expectedSize");
+    QTest::addColumn<QRegularExpression>("expectedWarning");
+
+    const QRegularExpression NoWarning;
+    const qreal dpr = qGuiApp->devicePixelRatio();
+
+    QTest::newRow("source") << Properties(Source) << (QSizeF(600, 790) * dpr).toSize()
+        << QRegularExpression("document property not set: falling back to inefficient loading"); // QTBUG-104767
+    QTest::newRow("document") << Properties(Document) << QSize(600, 790) << NoWarning;
+    QTest::newRow("source and document") << Properties(Source | Document) << QSize(600, 790)
+        << QRegularExpression("document and source properties in conflict");
+    QTest::newRow("document and sourceSize") << Properties(Document | SourceSize) << QSize(100, 100) << NoWarning;
+    QTest::newRow("document and sourceClipRect") << Properties(Document | SourceClipRect) << QSize(100, 100) << NoWarning;
+    QTest::newRow("document and autoTransform") << Properties(Document | AutoTransform) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and async") << Properties(Document | Asynchronous) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and nocache") << Properties(Document | NoCache) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and mirror") << Properties(Document | Mirror) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and mirrorVertically") << Properties(Document | MirrorVertically) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and colorSpace") << Properties(Document | ColorSpace) << QSize(600, 790) << NoWarning;
+}
+
+void tst_PdfPageImage::settableProperties()
+{
+    QFETCH(tst_PdfPageImage::Properties, toSet);
+    QFETCH(QSize, expectedSize);
+    QFETCH(QRegularExpression, expectedWarning);
+
+    QQuickView window;
+    if (!expectedWarning.pattern().isEmpty())
+        QTest::ignoreMessage(QtWarningMsg, expectedWarning);
+    QVERIFY(showView(window, testFileUrl("pdfPageImage.qml")));
+    QQuickPdfPageImage *pdfImage = window.rootObject()->findChild<QQuickPdfPageImage *>();
+    QVERIFY(pdfImage);
+    QQuickPdfDocument *doc = window.rootObject()->findChild<QQuickPdfDocument *>();
+    QVERIFY(doc);
+    if (toSet.testFlag(Document))
+        pdfImage->setDocument(doc);
+    if (toSet.testFlag(Source))
+        pdfImage->setSource(doc->source());
+    if (toSet.testFlag(SourceSize))
+        pdfImage->setSourceSize({100, 100});
+    if (toSet.testFlag(SourceClipRect))
+        pdfImage->setSourceClipRect({100, 100, 100, 100});
+    if (toSet.testFlag(MipMap))
+        pdfImage->setMipmap(true);
+    if (toSet.testFlag(AutoTransform))
+        pdfImage->setAutoTransform(true);
+    if (toSet.testFlag(Asynchronous)) {
+        QCOMPARE(pdfImage->asynchronous(), false);
+        // test the opposite of the default
+        pdfImage->setAsynchronous(true);
+    }
+    if (toSet.testFlag(NoCache)) {
+        QCOMPARE(pdfImage->cache(), true);
+        // test the opposite of the default
+        pdfImage->setCache(false);
+    }
+    if (toSet.testFlag(Mirror)) {
+        QCOMPARE(pdfImage->mirror(), false);
+        pdfImage->setMirror(true);
+    }
+    if (toSet.testFlag(MirrorVertically)) {
+        QCOMPARE(pdfImage->mirrorVertically(), false);
+        pdfImage->setMirrorVertically(true);
+    }
+    if (toSet.testFlag(ColorSpace))
+        pdfImage->setColorSpace(QColorSpace::ProPhotoRgb);
+    QTRY_COMPARE(pdfImage->status(), QQuickPdfPageImage::Ready);
+    const QImage img = pdfImage->image();
+    QCOMPARE(img.size(), expectedSize);
+#ifdef DEBUG_WRITE_OUTPUT
+    m_tmpDir.setAutoRemove(false);
+    const auto path = m_tmpDir.filePath(QString::fromLocal8Bit(QTest::currentDataTag()) + ".png");
+    qCDebug(lcTests) << "saving to" << path;
+    img.save(path);
+#endif
+}
+
+QTEST_MAIN(tst_PdfPageImage)
+#include "tst_pdfpageimage.moc"

From be142ad895c0edb07f567e47fc331c4b241e112f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 8 Jan 2024 21:08:52 +0000
Subject: [PATCH 598/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ibcc1349869417d09bb06114972c8cdc6372e5d2a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index bedb89b340e..27897fd14c2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 27aceebe22ec207c3bb3c7f90fd71c28540b33bc
+    ref: abbbcb3f149418b945f6cddf24d90cc7fb091da8
     required: true
   ../qtpositioning:
-    ref: 758851c396a1e442bc4d9eec3f68e6f6fd3e5981
+    ref: a82edeb0ce6e22ce04783de4164b5b900ff4bb8f
     required: false
   ../qttools:
-    ref: c73d137dcc7ba8ce0688f61b3c6632db2f121abc
+    ref: d48e450b401679c9fbfbd49ca0620b8716f43eb9
     required: false
   ../qtwebchannel:
-    ref: 828fdb792baa956582ca96d3026ce9acc19c5e28
+    ref: 95561846ea597600a6f47486ff3f168e7419bcc5
     required: false

From 974dc636e7400ca5098259b202f97139b940a912 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 8 Jan 2024 21:30:21 +0000
Subject: [PATCH 599/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Iccd20c03352c08462cd4305f1144b4d4f07940c2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index fb57228fd92..4511891b834 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 49f5db1ecebd26a29f3f0321c00a8a44dc25f219
+    ref: a3c383d2382be02dcde736181fd8db31829a8053
     required: true
   ../tqtc-qtpositioning:
-    ref: ce1285dd8bd83ebeb80330e1b8240f219c4c63e0
+    ref: 3f42427db45c4a4faf3c412929f99873462e9ca7
     required: false
   ../tqtc-qttools:
-    ref: 875fea445591966068eec09d07bf22ff41524bba
+    ref: 6f8e64d1183e7a9eb400394c2e5538649879e568
     required: false
   ../tqtc-qtwebchannel:
-    ref: 12fad554d317d4b6babc45d7270ed76dd5d47a07
+    ref: 7b59b87967ad4eb99f3141b871f2d62665dfaf62
     required: false

From a05a0e259ea9582c56815950ebf3e13de230e1f5 Mon Sep 17 00:00:00 2001
From: Tarja Sundqvist <tarja.sundqvist@qt.io>
Date: Thu, 11 Jan 2024 18:15:22 +0200
Subject: [PATCH 600/681] Bump version to 6.5.5

Change-Id: I30f6f1d7fa4c4800b963ab05f2e0e2181fd2780c
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index e710307cd33..bbd1ec6de6b 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,3 +1,3 @@
-set(QT_REPO_MODULE_VERSION "6.5.4")
+set(QT_REPO_MODULE_VERSION "6.5.5")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")

From b889838bfdf5a16fa66cda999e86b1e633974473 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 12 Jan 2024 10:10:44 +0000
Subject: [PATCH 601/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Ib609061169c6fb7748e0d967ce5560487f37dd08
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 4511891b834..2b312eb4410 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: a3c383d2382be02dcde736181fd8db31829a8053
+    ref: 02370fbc76ed78d277997e369c40e1d92ab4c370
     required: true
   ../tqtc-qtpositioning:
-    ref: 3f42427db45c4a4faf3c412929f99873462e9ca7
+    ref: 4c8275ad1058c997c6d12e45252fd2263cac4f91
     required: false
   ../tqtc-qttools:
-    ref: 6f8e64d1183e7a9eb400394c2e5538649879e568
+    ref: aa5c90670040859d569397cdb9fb7df3d6f02380
     required: false
   ../tqtc-qtwebchannel:
-    ref: 7b59b87967ad4eb99f3141b871f2d62665dfaf62
+    ref: e261b80c02ed6e50049ccc41bab147fdcb23fcdd
     required: false

From 8e30d44d3ba9d9db1d1a8b8b01d169abe85480e8 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 15 Dec 2023 14:12:46 +0100
Subject: [PATCH 602/681] Clean up and fix typos in cmake files

Change-Id: I68e46ec382c4c63c106c545cf6815777954a6afc
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit e6e82804a009394fdccee4e5f37195c9383f2d5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9fd9cec7056116688eb924ab8c06f26573dbd232)
---
 cmake/Functions.cmake        | 48 +-----------------------------------
 src/core/CMakeLists.txt      |  4 +--
 src/core/api/configure.cmake |  2 +-
 src/pdf/CMakeLists.txt       |  2 +-
 4 files changed, 5 insertions(+), 51 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 7bbf8e75964..9cee302da25 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -24,18 +24,6 @@ function(assertTargets)
     endforeach()
 endfunction()
 
-#TODO: remove me
-function(add_implicit_dependencies target)
-    if(TARGET ${target})
-        list(REMOVE_ITEM ARGN ${target})
-        foreach(qtTarget IN ITEMS ${ARGN})
-            if(TARGET Qt::${qtTarget})
-                add_dependencies(${target} Qt::${qtTarget})
-            endif()
-        endforeach()
-    endif()
-endfunction()
-
 # TODO: this should be idealy in qtbase
 function(add_check_for_support)
     cmake_parse_arguments(PARSE_ARGV 0 arg
@@ -65,23 +53,6 @@ function(add_check_for_support)
     endforeach()
 endfunction()
 
-function(get_qt_features outList module)
-    get_cmake_property(variableList VARIABLES)
-    set(_featureList "")
-    foreach (variableKey ${variableList})
-        unset(FOUND)
-        string(REGEX MATCH QT_FEATURE_${module} FOUND ${variableKey})
-        if(FOUND)
-            list(APPEND _featureList "${variableKey}=${${variableKey}}")
-        endif()
-    endforeach()
-    if("${${outList}}" STREQUAL "")
-        set(${outList} ${_featureList} PARENT_SCOPE)
-    else()
-        set(${outList} "${${outList}}" "${_featureList}" PARENT_SCOPE)
-    endif()
-endfunction()
-
 function(create_cxx_config cmakeTarget arch configFileName)
     if(NOT QT_SUPERBUILD AND QT_WILL_INSTALL)
         get_target_property(mocFilePath Qt6::moc IMPORTED_LOCATION)
@@ -325,13 +296,6 @@ function(get_install_config result)
     endif()
 endfunction()
 
-macro(assertRunAsTopLevelBuild)
-    if(NOT DEFINED WEBENGINE_REPO_BUILD)
-        message(FATAL_ERROR "This cmake file should run as top level build.")
-        return()
-    endif()
-endmacro()
-
 # we need to pass -F or -iframework in case of frameworks builds, which gn treats as
 # compiler flag and cmake as include dir, so swap it.
 function(recoverFrameworkBuild includeDirs compilerFlags)
@@ -1154,7 +1118,7 @@ function(get_architectures result)
     set(${result} ${${result}} PARENT_SCOPE)
 endfunction()
 
-function(add_gn_build_aritfacts_to_target)
+function(add_gn_build_artifacts_to_target)
     cmake_parse_arguments(PARSE_ARGV 0 arg
         "" "CMAKE_TARGET;NINJA_TARGET;BUILDDIR;MODULE;COMPLETE_STATIC;NINJA_STAMP;NINJA_DATA_STAMP" ""
     )
@@ -1304,16 +1268,6 @@ function(addCopyCommand target src dst)
     )
 endfunction()
 
-function(addCopyDirCommand target src dst)
-    add_custom_command(
-        POST_BUILD
-        COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${dst}
-        TARGET ${target}
-        DEPENDS ${src}
-        USES_TERMINAL
-    )
-endfunction()
-
 function(check_for_ulimit)
     message("-- Checking 'ulimit -n'")
     execute_process(COMMAND bash -c "ulimit -n"
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 5700558401c..629130c9a04 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -566,7 +566,7 @@ if(QT_FEATURE_webengine_v8_context_snapshot)
     set(dataStamp obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
 endif()
 
-add_gn_build_aritfacts_to_target(
+add_gn_build_artifacts_to_target(
     CMAKE_TARGET WebEngineCore
     NINJA_TARGET QtWebEngineCore
     MODULE core
@@ -616,7 +616,7 @@ if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
         ../3rdparty/chromium/third_party/boringssl/src/include
         ${buildDir}/$<CONFIG>/${arch}/gen
     )
-    add_gn_build_aritfacts_to_target(
+    add_gn_build_artifacts_to_target(
         CMAKE_TARGET ${dict_target_name}
         NINJA_TARGET convert_dict
         MODULE core
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index 762f4bdd6cc..48f7cacc002 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -168,7 +168,7 @@ qt_feature("webengine-vaapi" PRIVATE
 )
 # internal testing feature
 qt_feature("webengine-system-poppler" PRIVATE
-    LABEL "popler"
+    LABEL "poppler"
     CONDITION UNIX AND TEST_poppler
 )
 qt_configure_add_summary_section(NAME "Qt WebEngineCore")
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 25618044135..7c9b4160184 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -245,7 +245,7 @@ endforeach()
 get_architectures(archs)
 list(GET archs 0 arch)
 target_include_directories(Pdf PRIVATE ${buildDir}/$<CONFIG>/${arch}/gen)
-add_gn_build_aritfacts_to_target(
+add_gn_build_artifacts_to_target(
     CMAKE_TARGET Pdf
     NINJA_TARGET QtPdf
     MODULE pdf

From 493ce021bd9535ff057cdad72d6b9cfe1d8b9308 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 16 Oct 2023 15:33:10 +0200
Subject: [PATCH 603/681] Fix mac build with x86_64h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We do not not really support x86_64h on mac with gn,
so in case of "-DCMAKE_OSX_ARCHITECTURES=x86_64h"
do x86_64 build anyway.

Make arch test most strict as we did not really
control the outcome. Add some architectures names as
they were missing. Fix leaking cpu setting.

Clean up toolchain setup which differs based on
target os (win,linux,mac,ios,android).

Note for some platforms we generate toolchain, for
some we used gn provided ones.

Fixes: QTBUG-118120
Change-Id: Ia6fa8a59f55c1ebf37c10e469172520505214d38
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 3e4bc31ade660878a5040cc39e66687476524774)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 79febc044da9663d9cf03fdd1b9012e47df65f14)
---
 cmake/Functions.cmake       | 87 +++++++++++++++++++++----------------
 configure.cmake             |  5 ++-
 src/core/CMakeLists.txt     |  3 +-
 src/core/api/CMakeLists.txt |  4 ++
 src/host/CMakeLists.txt     |  8 ++--
 5 files changed, 64 insertions(+), 43 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 9cee302da25..923f78dbdfc 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -434,6 +434,7 @@ function(add_linker_options target buildDir completeStatic)
          target_link_libraries(${cmakeTarget} PRIVATE
              "$<1:-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${ldir_rsp}> $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings>"
          )
+         unset(cpu)
     endif()
     if(MACOS)
         target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
@@ -612,46 +613,50 @@ function(qt_internal_add_external_project_dependency_to_root_project name)
     cmake_policy(POP)
 endfunction()
 
+# Function maps TEST_architecture_arch or CMAKE_SYSTEM_PROCESSOR into gn architecture
 function(get_gn_arch result arch)
-    if(arch STREQUAL "i386")
+    set(armList arm armv7-a)
+    set(mips64List mips64 mipsel64)
+    set(x86List i386 i686)
+    set(x64List x86_64 AMD64 x86_64h aarch64)
+    if(arch IN_LIST x86List)
         set(${result} "x86" PARENT_SCOPE)
-    elseif(arch STREQUAL "x86_64")
+    elseif(arch IN_LIST x64List)
         set(${result} "x64" PARENT_SCOPE)
-    elseif(arch STREQUAL "arm")
+    elseif(arch IN_LIST armList)
         set(${result} "arm" PARENT_SCOPE)
     elseif(arch STREQUAL "arm64")
         set(${result} "arm64" PARENT_SCOPE)
     elseif(arch STREQUAL "mipsel")
         set(${result} "mipsel" PARENT_SCOPE)
-    elseif(arch STREQUAL "mipsel64")
+    elseif(arch IN_LIST mipsList)
         set(${result} "mips64el" PARENT_SCOPE)
     elseif(arch STREQUAL "riscv64")
         set(${result} "riscv64" PARENT_SCOPE)
     else()
-        message(DEBUG "Unsupported architecture: ${arch}")
+        message(FATAL_ERROR "Unknown architecture: ${arch}")
     endif()
 endfunction()
 
+# Function maps gn architecture for v8
 function(get_v8_arch result targetArch hostArch)
-    set(list32 i386 arm mipsel)
+    set(list32 x86 arm mipsel riscv32)
     if(hostArch STREQUAL targetArch)
         set(${result} "${targetArch}" PARENT_SCOPE)
     elseif(targetArch IN_LIST list32)
         # 32bit target which needs a 32bit compatible host
-        if(hostArch STREQUAL "x86_64")
-            set(${result} "i386" PARENT_SCOPE)
+        if(hostArch STREQUAL "x64")
+            set(${result} "x86" PARENT_SCOPE)
         elseif(hostArch STREQUAL "arm64")
             set(${result} "arm" PARENT_SCOPE)
-        elseif(hostArch STREQUAL "mips64")
-            set(${result} "mipsel" PARENT_SCOPE)
-        elseif(hostArch STREQUAL "mipsel64")
+        elseif(hostArch STREQUAL "mips64el")
             set(${result} "mipsel" PARENT_SCOPE)
         elseif(hostArch STREQUAL "riscv64")
-            set(${result} "riscv64" PARENT_SCOPE)
+            set(${result} "riscv32" PARENT_SCOPE)
         elseif(hostArch IN_LIST list32)
             set(${result} "${hostArch}" PARENT_SCOPE)
         else()
-            message(FATAL_ERROR "Unsupported architecture: ${hostArch}")
+            message(FATAL_ERROR "Unknown architecture: ${hostArch}")
         endif()
     else()
         # assume 64bit target which matches 64bit host
@@ -694,12 +699,12 @@ function(get_ios_sysroot result arch)
     set(${result} ${sysroot} PARENT_SCOPE)
 endfunction()
 
-function(configure_gn_toolchain name binTargetCpu v8TargetCpu toolchainIn toolchainOut)
+function(configure_gn_toolchain name cpu v8Cpu toolchainIn toolchainOut)
     set(GN_TOOLCHAIN ${name})
     get_gn_os(GN_OS)
     get_gn_is_clang(GN_IS_CLANG)
-    get_gn_arch(GN_CPU ${binTargetCpu})
-    get_gn_arch(GN_V8_CPU ${v8TargetCpu})
+    set(GN_CPU ${cpu})
+    set(GN_V8_CPU ${v8Cpu})
     configure_file(${toolchainIn} ${toolchainOut}/BUILD.gn @ONLY)
 endfunction()
 
@@ -781,17 +786,19 @@ macro(create_pkg_config_host_wrapper buildDir)
 endmacro()
 
 macro(setup_toolchains)
+    get_gn_arch(gn_arch ${TEST_architecture_arch})
     if(NOT CMAKE_CROSSCOMPILING) # delivered by hostBuild project
-        configure_gn_toolchain(host ${TEST_architecture_arch} ${TEST_architecture_arch}
+        configure_gn_toolchain(host ${gn_arch} ${gn_arch}
             ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
             ${buildDir}/host_toolchain)
-        configure_gn_toolchain(v8 ${TEST_architecture_arch} ${TEST_architecture_arch}
+        configure_gn_toolchain(v8 ${gn_arch} ${gn_arch}
             ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
             ${buildDir}/v8_toolchain)
     endif()
-    configure_gn_toolchain(target ${TEST_architecture_arch} ${TEST_architecture_arch}
+    configure_gn_toolchain(target ${gn_arch} ${gn_arch}
         ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
         ${buildDir}/target_toolchain)
+    unset(gn_arch)
 endmacro()
 
 macro(append_build_type_setup)
@@ -991,6 +998,7 @@ macro(append_compiler_linker_sdk_setup)
         ARGS use_lld
         CONDITION QT_FEATURE_use_lld_linker
     )
+    unset(cpu)
 endmacro()
 
 macro(append_sanitizer_setup)
@@ -1020,20 +1028,24 @@ macro(append_sanitizer_setup)
 endmacro()
 
 macro(append_toolchain_setup)
-    if(MINGW)
-        list(APPEND gnArgArg
-            # note '/' prefix
-            custom_toolchain="/${buildDir}/target_toolchain:target"
-            host_toolchain="/${buildDir}/host_toolchain:host"
-        )
-        list(APPEND gnArgArg host_cpu="${cpu}")
-    endif()
-    if(LINUX)
+    if(WIN32)
+        get_gn_arch(cpu ${arch})
+        list(APPEND gnArgArg target_cpu="${cpu}")
+        if(MINGW)
+            get_gn_arch(cpu ${TEST_architecture_arch})
+            list(APPEND gnArgArg
+                # note '/' prefix
+                custom_toolchain="/${buildDir}/target_toolchain:target"
+                host_toolchain="/${buildDir}/host_toolchain:host"
+                host_cpu="${cpu}"
+            )
+        endif()
+    elseif(LINUX)
+        get_gn_arch(cpu ${TEST_architecture_arch})
         list(APPEND gnArgArg
             custom_toolchain="${buildDir}/target_toolchain:target"
             host_toolchain="${buildDir}/host_toolchain:host"
         )
-        get_gn_arch(cpu ${TEST_architecture_arch})
         if(CMAKE_CROSSCOMPILING)
             list(APPEND gnArgArg
                 v8_snapshot_toolchain="${buildDir}/v8_toolchain:v8"
@@ -1045,17 +1057,18 @@ macro(append_toolchain_setup)
         if(CMAKE_SYSROOT)
             list(APPEND gnArgArg target_sysroot="${CMAKE_SYSROOT}")
         endif()
-    else()
+    elseif(MACOS)
         get_gn_arch(cpu ${arch})
         list(APPEND gnArgArg target_cpu="${cpu}")
-        if(IOS)
-            get_ios_sysroot(sysroot ${arch})
-            list(APPEND gnArgArg target_sysroot="${sysroot}" target_os="ios")
-        endif()
-    endif()
-    if(ANDROID)
-        list(APPEND gnArgArg target_os="android")
+    elseif(IOS)
+        get_gn_arch(cpu ${arch})
+        get_ios_sysroot(sysroot ${arch})
+        list(APPEND gnArgArg target_cpu="${cpu}" target_sysroot="${sysroot}" target_os="ios")
+    elseif(ANDROID)
+        get_gn_arch(cpu ${TEST_architecture_arch})
+        list(APPEND gnArgArg target_os="android" target_cpu="${cpu}")
     endif()
+    unset(cpu)
 endmacro()
 
 
diff --git a/configure.cmake b/configure.cmake
index 60a8de530db..bcbcd175aa4 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -473,12 +473,13 @@ add_check_for_support(
    MESSAGE "Build can be done only on Linux, Windows, macO, iOS and Android(on non-Windows hosts only)."
 )
 if(LINUX AND CMAKE_CROSSCOMPILING)
-   get_gn_arch(testArch ${TEST_architecture_arch})
+   set(supportedTargets "arm" "arm64" "armv7-a")
    add_check_for_support(
        MODULES QtWebEngine QtPdf
-       CONDITION testArch
+       CONDITION TEST_architecture_arch IN_LIST supportedTargets
        MESSAGE "Cross compiling is not supported for ${TEST_architecture_arch}."
    )
+   unset(supportedTargets)
 endif()
 add_check_for_support(
    MODULES QtWebEngine
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 629130c9a04..75a41d6a67e 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -497,7 +497,7 @@ foreach(arch ${archs})
                      external_gssapi_include_dir="${GSSAPI_INCLUDE_DIRS}/gssapi"
                 )
             endif()
-
+            get_gn_arch(cpu ${TEST_architecture_arch})
             if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
                 check_thumb(armThumb)
                 if(NOT armThumb AND NOT QT_FEATURE_webengine_system_ffmpeg)
@@ -514,6 +514,7 @@ foreach(arch ${archs})
                     )
                 endif()
             endif()
+            unset(cpu)
         endif()
 
         if(MACOS)
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index da587119d07..5bd8b9e2f94 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -133,6 +133,10 @@ if(QT_FEATURE_webengine_v8_context_snapshot)
        foreach(config ${configs})
            if(MACOS)
                set(ext_arch ".${arch}")
+               # QTBUG-118120 gn does not support x86_64h
+               if(ext_arch STREQUAL "x86_64h")
+                   set(ext_arch "x86_64")
+               endif()
            else()
                unset(ext_arch)
            endif()
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index d90c6dea2ec..0c1362ab679 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -21,14 +21,16 @@ project(QtWebEngineConfigure
 
 find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
 qt_internal_project_setup()
+get_gn_arch(target_arch ${GN_TARGET_CPU})
+get_gn_arch(host_arch ${TEST_architecture_arch})
+get_v8_arch(v8_arch ${target_arch} ${host_arch})
 
 set(buildDir ${CMAKE_CURRENT_BINARY_DIR})
-configure_gn_toolchain(host ${TEST_architecture_arch} ${TEST_architecture_arch}
+configure_gn_toolchain(host ${host_arch} ${host_arch}
     ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
     ${buildDir}/host_toolchain
 )
-get_v8_arch(GN_V8_HOST_CPU ${GN_TARGET_CPU} ${TEST_architecture_arch})
-configure_gn_toolchain(v8 ${GN_V8_HOST_CPU} ${GN_TARGET_CPU}
+configure_gn_toolchain(v8 ${v8_arch} ${target_arch}
     ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
     ${buildDir}/v8_toolchain)
 

From 3a5ebfa97260ae7e19e4b78a7345ec39163bcc2f Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Thu, 11 Jan 2024 12:03:49 +0100
Subject: [PATCH 604/681] Remove DOH debug message

Change-Id: I79ef6363772c484989dadda76ce18fb285a6ea64
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 738fa8b626b1155cae101d3de7f6e6fd7331c1f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 59e9b1a5812d4e95742257237a369c714d388493)
---
 src/core/api/qwebengineglobalsettings.cpp | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
index 5eeff9fc57d..95138516bc0 100644
--- a/src/core/api/qwebengineglobalsettings.cpp
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -3,7 +3,6 @@
 
 #include "qwebengineglobalsettings.h"
 #include "qwebengineglobalsettings_p.h"
-#include <QDebug>
 
 #ifdef signals
 #undef signals
@@ -126,12 +125,6 @@ void QWebEngineGlobalSettingsPrivate::configureStubHostResolver()
         != content::NetworkServiceAvailability::NOT_CREATED) {
         network::mojom::NetworkService *networkService = content::GetNetworkService();
         if (networkService) {
-            qDebug() << "doh set to" << dnsOverHttpsTemplates << " -- "
-                     << (dnsMode == QWebEngineGlobalSettings::SecureDnsMode::SecureOnly
-                                 ? "SecureOnly"
-                                 : dnsMode == QWebEngineGlobalSettings::SecureDnsMode::SystemOnly
-                                 ? "SystemOnly"
-                                 : "SecureWithFallback");
             absl::optional<net::DnsOverHttpsConfig> dohConfig = dnsOverHttpsTemplates.empty()
                     ? net::DnsOverHttpsConfig()
                     : net::DnsOverHttpsConfig::FromString(dnsOverHttpsTemplates);

From 62735b0857a11689bc18f8047112cae42bb05985 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Thu, 11 Jan 2024 13:14:33 +0100
Subject: [PATCH 605/681] Fix printing from PDF plugin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Update the plugin finder logic everywhere to match with Chrome. This
comes with a small cleanup: collect PDF-related helper functions
scattered around WebEngine in one pdf_util_qt implementation.

Add auto test to catch this recurring issue earlier.

Task-number: QTBUG-119878
Change-Id: I03b2bd62bebf5b38afc572e0629db106d024e89d
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit e09cf6e7a1f582d06f86ff2c166b7c2269fd4b47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a1ffdacd23c13d97793b87f098e3ec7ab8ff1de6)
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
---
 src/core/CMakeLists.txt                       |  1 +
 .../pdf_iframe_navigation_throttle_qt.cpp     |  8 +-
 src/core/pdf_util_qt.cpp                      | 92 +++++++++++++++++++
 src/core/pdf_util_qt.h                        | 34 +++++++
 .../pdf_web_contents_helper_client_qt.cpp     | 30 +-----
 src/core/printing/print_view_manager_qt.cpp   |  7 +-
 .../print_web_view_helper_delegate_qt.cpp     | 30 ++----
 src/core/web_contents_adapter.cpp             |  3 +-
 tests/auto/widgets/printing/tst_printing.cpp  | 46 ++++++++++
 9 files changed, 193 insertions(+), 58 deletions(-)
 create mode 100644 src/core/pdf_util_qt.cpp
 create mode 100644 src/core/pdf_util_qt.h

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 75a41d6a67e..c4e4133510a 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -152,6 +152,7 @@ foreach(arch ${archs})
                 ozone/platform_window_qt.cpp ozone/platform_window_qt.h
                 ozone/surface_factory_qt.cpp ozone/surface_factory_qt.h
                 permission_manager_qt.cpp permission_manager_qt.h
+                pdf_util_qt.cpp pdf_util_qt.h
                 platform_notification_service_qt.cpp platform_notification_service_qt.h
                 pointer_device_qt.cpp
                 pref_service_adapter.cpp pref_service_adapter.h
diff --git a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
index 9b6b38a52bb..9a2feb8165d 100644
--- a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
+++ b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
@@ -26,12 +26,12 @@
 #include "ui/base/webui/jstemplate_builder.h"
 #include "ui/base/webui/web_ui_util.h"
 
+#include "pdf_util_qt.h"
+
 #include <QtGlobal>
 
 namespace extensions {
 
-constexpr char kPDFMimeType[] = "application/pdf";
-
 // Used to scope the posted navigation task to the lifetime of |web_contents|.
 class PdfWebContentsLifetimeHelper : public content::WebContentsUserData<PdfWebContentsLifetimeHelper>
 {
@@ -76,7 +76,7 @@ bool IsPDFPluginEnabled(content::NavigationHandle *navigation_handle, bool *is_s
                 process_id, routing_id,
                 navigation_handle->GetWebContents()->GetBrowserContext(),
                 navigation_handle->GetURL(),
-                kPDFMimeType, false /* allow_wildcard */,
+                QtWebEngineCore::kPDFMimeType, false /* allow_wildcard */,
                 is_stale, &plugin_info, nullptr /* actual_mime_type */);
 }
 
@@ -119,7 +119,7 @@ content::NavigationThrottle::ThrottleCheckResult PDFIFrameNavigationThrottleQt::
 
     std::string mime_type;
     response_headers->GetMimeType(&mime_type);
-    if (mime_type != kPDFMimeType)
+    if (mime_type != QtWebEngineCore::kPDFMimeType)
         return content::NavigationThrottle::PROCEED;
 
     // We MUST download responses marked as attachments rather than showing
diff --git a/src/core/pdf_util_qt.cpp b/src/core/pdf_util_qt.cpp
new file mode 100644
index 00000000000..9503f59109f
--- /dev/null
+++ b/src/core/pdf_util_qt.cpp
@@ -0,0 +1,92 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+
+#include "pdf_util_qt.h"
+
+#include <QtGlobal>
+
+#include "base/check.h"
+#include "chrome/common/webui_url_constants.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
+#include "extensions/buildflags/buildflags.h"
+#include "url/gurl.h"
+#include "url/origin.h"
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
+#include "extensions/common/constants.h"
+#endif  // BUILDFLAG(ENABLE_EXTENSIONS)
+
+namespace QtWebEngineCore {
+
+bool IsPdfExtensionOrigin(const url::Origin &origin)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+    return origin.scheme() == extensions::kExtensionScheme
+        && origin.host() == extension_misc::kPdfExtensionId;
+#else
+    Q_UNUSED(origin);
+    return false;
+#endif
+}
+
+bool IsPdfInternalPluginAllowedOrigin(const url::Origin &origin)
+{
+    if (IsPdfExtensionOrigin(origin))
+        return true;
+
+    // Allow embedding the internal PDF plugin in chrome://print.
+    if (origin == url::Origin::Create(GURL(chrome::kChromeUIPrintURL)))
+        return true;
+
+    // Only allow the PDF plugin in the known, trustworthy origins that are
+    // allowlisted above.  See also https://crbug.com/520422 and
+    // https://crbug.com/1027173.
+    return false;
+}
+
+content::RenderFrameHost *GetFullPagePlugin(content::WebContents *contents)
+{
+    content::RenderFrameHost *full_page_plugin = nullptr;
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+    contents->ForEachRenderFrameHostWithAction([&full_page_plugin](content::RenderFrameHost *rfh) {
+        auto* guest_view = extensions::MimeHandlerViewGuest::FromRenderFrameHost(rfh);
+        if (guest_view && guest_view->is_full_page_plugin()) {
+            DCHECK_EQ(guest_view->GetGuestMainFrame(), rfh);
+            full_page_plugin = rfh;
+            return content::RenderFrameHost::FrameIterationAction::kStop;
+        }
+        return content::RenderFrameHost::FrameIterationAction::kContinue;
+    });
+#endif  // BUILDFLAG(ENABLE_EXTENSIONS)
+    return full_page_plugin;
+}
+
+content::RenderFrameHost *FindPdfChildFrame(content::RenderFrameHost *rfh)
+{
+    if (!rfh)
+        return nullptr;
+
+    if (!IsPdfExtensionOrigin(rfh->GetLastCommittedOrigin()))
+        return nullptr;
+
+    content::RenderFrameHost *pdf_rfh = nullptr;
+    rfh->ForEachRenderFrameHost([&pdf_rfh](content::RenderFrameHost *rfh) {
+        if (!rfh->GetProcess()->IsPdf())
+            return;
+
+        DCHECK(IsPdfExtensionOrigin(rfh->GetParent()->GetLastCommittedOrigin()));
+        DCHECK(!pdf_rfh);
+        pdf_rfh = rfh;
+    });
+
+    return pdf_rfh;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/pdf_util_qt.h b/src/core/pdf_util_qt.h
new file mode 100644
index 00000000000..5ee211800d1
--- /dev/null
+++ b/src/core/pdf_util_qt.h
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+
+#ifndef PDF_UTIL_QT_H
+#define PDF_UTIL_QT_H
+
+namespace content {
+class RenderFrameHost;
+class WebContents;
+}  // namespace content
+
+namespace url {
+class Origin;
+}  // namespace url
+
+namespace QtWebEngineCore {
+
+// from chrome/common/pdf_util.cc:
+constexpr char kPDFMimeType[] = "application/pdf";
+
+bool IsPdfExtensionOrigin(const url::Origin &origin);
+bool IsPdfInternalPluginAllowedOrigin(const url::Origin &origin);
+
+// from chrome/browser/pdf/pdf_frame_util.cc:
+content::RenderFrameHost *GetFullPagePlugin(content::WebContents *contents);
+content::RenderFrameHost *FindPdfChildFrame(content::RenderFrameHost *rfh);
+
+} // namespace QtWebEngineCore
+
+#endif // PDF_UTIL_QT_H
diff --git a/src/core/printing/pdf_web_contents_helper_client_qt.cpp b/src/core/printing/pdf_web_contents_helper_client_qt.cpp
index 4deb398c6ee..0ff7499c353 100644
--- a/src/core/printing/pdf_web_contents_helper_client_qt.cpp
+++ b/src/core/printing/pdf_web_contents_helper_client_qt.cpp
@@ -9,33 +9,7 @@
 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
 #include "extensions/common/constants.h"
 
-namespace {
-bool IsPdfExtensionOrigin(const url::Origin &origin)
-{
-    return origin.scheme() == extensions::kExtensionScheme &&
-           origin.host() == extension_misc::kPdfExtensionId;
-}
-
-// from chrome/browser/pdf/pdf_frame_util.cc:
-content::RenderFrameHost *FindPdfChildFrame(content::RenderFrameHost *rfh)
-{
-    if (!IsPdfExtensionOrigin(rfh->GetLastCommittedOrigin()))
-        return nullptr;
-
-    content::RenderFrameHost *pdf_rfh = nullptr;
-    rfh->ForEachRenderFrameHost(
-                    [&pdf_rfh](content::RenderFrameHost *rfh) {
-                        if (!rfh->GetProcess()->IsPdf())
-                            return;
-
-                        DCHECK(IsPdfExtensionOrigin(rfh->GetParent()->GetLastCommittedOrigin()));
-                        DCHECK(!pdf_rfh);
-                        pdf_rfh = rfh;
-                    });
-
-    return pdf_rfh;
-}
-}  // namespace
+#include "pdf_util_qt.h"
 
 PDFWebContentsHelperClientQt::PDFWebContentsHelperClientQt() = default;
 PDFWebContentsHelperClientQt::~PDFWebContentsHelperClientQt() = default;
@@ -43,7 +17,7 @@ PDFWebContentsHelperClientQt::~PDFWebContentsHelperClientQt() = default;
 content::RenderFrameHost *PDFWebContentsHelperClientQt::FindPdfFrame(content::WebContents *contents)
 {
     content::RenderFrameHost *main_frame = contents->GetPrimaryMainFrame();
-    content::RenderFrameHost *pdf_frame = FindPdfChildFrame(main_frame);
+    content::RenderFrameHost *pdf_frame = QtWebEngineCore::FindPdfChildFrame(main_frame);
     return pdf_frame ? pdf_frame : main_frame;
 }
 
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 892c9e40633..060417e5b78 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -8,6 +8,7 @@
 
 #include "print_view_manager_qt.h"
 
+#include "pdf_util_qt.h"
 #include "type_conversion.h"
 #include "web_contents_adapter_client.h"
 #include "web_contents_view_qt.h"
@@ -238,7 +239,11 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout,
     if (web_contents()->IsCrashed())
         return false;
 
-    content::RenderFrameHost* rfh = web_contents()->GetPrimaryMainFrame();
+    content::RenderFrameHost *rfh = web_contents()->GetPrimaryMainFrame();
+    // Use the plugin frame for printing if web_contents() is a PDF viewer guest
+    content::RenderFrameHost *full_page_plugin = GetFullPagePlugin(web_contents());
+    if (content::RenderFrameHost *pdf_rfh = FindPdfChildFrame(full_page_plugin ? full_page_plugin : rfh))
+        rfh = pdf_rfh;
     GetPrintRenderFrame(rfh)->InitiatePrintPreview(mojo::PendingAssociatedRemote<printing::mojom::PrintRenderer>(), false);
 
     DCHECK(!m_printPreviewRfh);
diff --git a/src/core/renderer/print_web_view_helper_delegate_qt.cpp b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
index f77b6fbbc2c..f01568e6584 100644
--- a/src/core/renderer/print_web_view_helper_delegate_qt.cpp
+++ b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
@@ -15,8 +15,10 @@
 #include "chrome/common/webui_url_constants.h"
 #include "extensions/common/constants.h"
 #include "third_party/blink/public/web/web_document.h"
+#include "extensions/renderer/guest_view/mime_handler_view/post_message_support.h"
 #endif  // BUILDFLAG(ENABLE_EXTENSIONS)
 
+#include "pdf_util_qt.h"
 #include "print_web_view_helper_delegate_qt.h"
 #include "web_engine_library_info.h"
 
@@ -24,33 +26,13 @@ namespace QtWebEngineCore {
 
 PrintWebViewHelperDelegateQt::~PrintWebViewHelperDelegateQt() {}
 
-bool IsPdfExtensionOrigin(const url::Origin& origin)
-{
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-    return origin.scheme() == extensions::kExtensionScheme
-        && origin.host() == extension_misc::kPdfExtensionId;
-#else
-    Q_UNUSED(origin);
-    return false;
-#endif
-}
-
 blink::WebElement PrintWebViewHelperDelegateQt::GetPdfElement(blink::WebLocalFrame *frame)
 {
 #if BUILDFLAG(ENABLE_EXTENSIONS)
-    const url::Origin origin = frame->GetDocument().GetSecurityOrigin();
-    bool inside_print_preview = origin == url::Origin::Create(GURL(chrome::kChromeUIPrintURL));
-    bool inside_pdf_extension = IsPdfExtensionOrigin(origin);
-    if (inside_print_preview || inside_pdf_extension) {
-        // <object> with id="plugin" is created in
-        // chrome/browser/resources/pdf/pdf_viewer_base.js.
-        auto viewer_element = frame->GetDocument().GetElementById("viewer");
-        if (!viewer_element.IsNull() && !viewer_element.ShadowRoot().IsNull()) {
-            auto plugin_element = viewer_element.ShadowRoot().QuerySelector("#plugin");
-            if (!plugin_element.IsNull())
-                return plugin_element;
-        }
-        NOTREACHED();
+    if (frame->Parent() && IsPdfInternalPluginAllowedOrigin(frame->Parent()->GetSecurityOrigin())) {
+        auto plugin_element = frame->GetDocument().QuerySelector("embed");
+        DCHECK(!plugin_element.IsNull());
+        return plugin_element;
     }
 #endif  // BUILDFLAG(ENABLE_EXTENSIONS)
     return blink::WebElement();
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index fe30206ce38..f4467517183 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -15,6 +15,7 @@
 #include "favicon_service_factory_qt.h"
 #include "find_text_helper.h"
 #include "media_capture_devices_dispatcher.h"
+#include "pdf_util_qt.h"
 #include "profile_adapter.h"
 #include "profile_qt.h"
 #include "qwebengineloadinginfo.h"
@@ -1974,7 +1975,7 @@ WebContentsAdapter::LifecycleState WebContentsAdapter::determineRecommendedState
     // Do not discard PDFs as they might contain entry that is not saved and they
     // don't remember their scrolling positions. See crbug.com/547286 and
     // crbug.com/65244.
-    if (m_webContents->GetContentsMimeType() == "application/pdf")
+    if (m_webContents->GetContentsMimeType() == kPDFMimeType)
         return LifecycleState::Frozen;
 
     return LifecycleState::Discarded;
diff --git a/tests/auto/widgets/printing/tst_printing.cpp b/tests/auto/widgets/printing/tst_printing.cpp
index 1f9b5059c58..605fb57b5c7 100644
--- a/tests/auto/widgets/printing/tst_printing.cpp
+++ b/tests/auto/widgets/printing/tst_printing.cpp
@@ -3,6 +3,7 @@
 
 #include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
 #include <QtWebEngineCore/qtwebenginecore-config.h>
+#include <QWebEngineSettings>
 #include <QWebEngineView>
 #include <QTemporaryDir>
 #include <QTest>
@@ -22,6 +23,7 @@ private slots:
     void printRequest();
 #if QT_CONFIG(webengine_system_poppler)
     void printToPdfPoppler();
+    void printFromPdfViewer();
 #endif
     void interruptPrinting();
 };
@@ -116,6 +118,50 @@ void tst_Printing::printToPdfPoppler()
     QVERIFY2(pdfPage->search(ustring::from_latin1("Hello Paper World"), rect, page::search_from_top,
                      case_sensitive ), "Could not find text");
 }
+
+void tst_Printing::printFromPdfViewer()
+{
+    using namespace poppler;
+
+    QWebEngineView view;
+    view.page()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
+    view.page()->settings()->setAttribute(QWebEngineSettings::PdfViewerEnabled, true);
+
+    // Load a basic HTML
+    QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+    view.load(QUrl("qrc:///resources/basic_printing_page.html"));
+    QTRY_COMPARE(spy.size(), 1);
+
+    // Create a PDF
+    QTemporaryDir tempDir(QDir::tempPath() + "/tst_printing-XXXXXX");
+    QVERIFY(tempDir.isValid());
+    QString path = tempDir.path() + "/basic_page.pdf";
+    QSignalSpy savePdfSpy(view.page(), &QWebEnginePage::pdfPrintingFinished);
+    view.page()->printToPdf(path);
+    QTRY_COMPARE(savePdfSpy.size(), 1);
+
+    // Open the new file with the PDF viewer plugin
+    view.load(QUrl("file://" + path));
+    QTRY_COMPARE(spy.size(), 2);
+
+    // Print from the plugin
+    // loadFinished signal is not reliable when loading a PDF file, because it has multiple phases.
+    // Workaround: Try to print it a couple of times until the result matches the expected.
+    CallbackSpy<QByteArray> resultSpy;
+    bool ok = QTest::qWaitFor([&]() -> bool {
+        view.printToPdf(resultSpy.ref());
+        QByteArray data = resultSpy.waitForResult();
+
+        // Check if the result contains text from the original basic HTML
+        // This catches all the typical issues: empty result or printing the WebUI without PDF content.
+        QScopedPointer<document> pdf(document::load_from_raw_data(data.constData(), data.length()));
+        QScopedPointer<page> pdfPage(pdf->create_page(0));
+        rectf rect;
+        return pdfPage->search(ustring::from_latin1("Hello Paper World"), rect, page::search_from_top,
+                            case_sensitive);
+    }, 10000);
+    QVERIFY(ok);
+}
 #endif
 
 void tst_Printing::interruptPrinting()

From 3484a9bb1213d4b808215f0e2c0e54a7397a340a Mon Sep 17 00:00:00 2001
From: Martin Negyokru <negyokru@inf.u-szeged.hu>
Date: Tue, 21 Nov 2023 15:45:51 +0100
Subject: [PATCH 606/681] Fix text formatting in JS Dialogs

Use plain text instead of escaped html to match
other browsers behavior.
Also set the text format for qml dialogs.

Fixes: QTBUG-119245
Task-number: QTBUG-83338
Change-Id: Icb2c9fd21f27487418835372d6afda96a6812cc3
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 3fcf62c0c19e89abbd154bc5f1fc8d84099aa58e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b9c8cfba0154a260ec618df53c3d8e030a544662)
---
 src/webenginequick/ui/AlertDialog.qml         |  1 +
 .../ui/AuthenticationDialog.qml               |  1 +
 src/webenginequick/ui/ConfirmDialog.qml       |  1 +
 src/webenginequick/ui/PromptDialog.qml        |  1 +
 src/webenginewidgets/api/qwebengineview.cpp   | 32 +++++++++++++------
 5 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/webenginequick/ui/AlertDialog.qml b/src/webenginequick/ui/AlertDialog.qml
index 53911f0bca3..e4c17b05621 100644
--- a/src/webenginequick/ui/AlertDialog.qml
+++ b/src/webenginequick/ui/AlertDialog.qml
@@ -49,6 +49,7 @@ Dialog {
                 id: message
                 Layout.fillWidth: true
                 color: palette.windowText
+                textFormat: Text.PlainText
             }
         }
         Item {
diff --git a/src/webenginequick/ui/AuthenticationDialog.qml b/src/webenginequick/ui/AuthenticationDialog.qml
index f9de8d79fc3..d0611b84f51 100644
--- a/src/webenginequick/ui/AuthenticationDialog.qml
+++ b/src/webenginequick/ui/AuthenticationDialog.qml
@@ -50,6 +50,7 @@ Dialog {
         Label {
             id: message
             color: palette.windowText
+            textFormat: Text.PlainText
         }
         GridLayout {
             columns: 2
diff --git a/src/webenginequick/ui/ConfirmDialog.qml b/src/webenginequick/ui/ConfirmDialog.qml
index 7b5f1f5cf75..cfffe7c4d54 100644
--- a/src/webenginequick/ui/ConfirmDialog.qml
+++ b/src/webenginequick/ui/ConfirmDialog.qml
@@ -55,6 +55,7 @@ Dialog {
                 id: message
                 Layout.fillWidth: true
                 color: palette.windowText
+                textFormat: Text.PlainText
             }
         }
         Item {
diff --git a/src/webenginequick/ui/PromptDialog.qml b/src/webenginequick/ui/PromptDialog.qml
index f3a15d48d16..275deace862 100644
--- a/src/webenginequick/ui/PromptDialog.qml
+++ b/src/webenginequick/ui/PromptDialog.qml
@@ -52,6 +52,7 @@ Dialog {
             id: message
             Layout.fillWidth: true
             color: palette.windowText
+            textFormat: Text.PlainText
         }
         TextField {
             id:field
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 952ebe7cd4c..c4a0da4d92a 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -553,8 +553,10 @@ bool QWebEngineViewPrivate::showAuthorizationDialog(const QString &title, const
 {
 #if QT_CONFIG(messagebox)
     Q_Q(QWebEngineView);
-    return QMessageBox::question(q, title, message, QMessageBox::Yes, QMessageBox::No)
-            == QMessageBox::Yes;
+    QMessageBox msgBox(QMessageBox::Question, title, message, QMessageBox::Yes | QMessageBox::No,
+                       q, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
+    msgBox.setTextFormat(Qt::PlainText);
+    return msgBox.exec() == QMessageBox::Yes;
 #else
     return false;
 #endif // QT_CONFIG(messagebox)
@@ -564,8 +566,12 @@ void QWebEngineViewPrivate::javaScriptAlert(const QUrl &url, const QString &msg)
 {
 #if QT_CONFIG(messagebox)
     Q_Q(QWebEngineView);
-    QMessageBox::information(q, QStringLiteral("Javascript Alert - %1").arg(url.toString()),
-                             msg.toHtmlEscaped());
+    QMessageBox msgBox(QMessageBox::Information,
+                       QStringLiteral("Javascript Alert - %1").arg(url.toString()),
+                       msg, QMessageBox::Ok, q,
+                       Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
+    msgBox.setTextFormat(Qt::PlainText);
+    msgBox.exec();
 #else
     Q_UNUSED(msg);
 #endif // QT_CONFIG(messagebox)
@@ -575,10 +581,12 @@ bool QWebEngineViewPrivate::javaScriptConfirm(const QUrl &url, const QString &ms
 {
 #if QT_CONFIG(messagebox)
     Q_Q(QWebEngineView);
-    return (QMessageBox::information(q,
-                                     QStringLiteral("Javascript Confirm - %1").arg(url.toString()),
-                                     msg.toHtmlEscaped(), QMessageBox::Ok, QMessageBox::Cancel)
-            == QMessageBox::Ok);
+    QMessageBox msgBox(QMessageBox::Information,
+                       QStringLiteral("Javascript Confirm - %1").arg(url.toString()),
+                       msg, QMessageBox::Ok | QMessageBox::Cancel, q,
+                       Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
+    msgBox.setTextFormat(Qt::PlainText);
+    return msgBox.exec() == QMessageBox::Ok;
 #else
     Q_UNUSED(msg);
     return false;
@@ -591,10 +599,16 @@ bool QWebEngineViewPrivate::javaScriptPrompt(const QUrl &url, const QString &msg
 #if QT_CONFIG(inputdialog)
     Q_Q(QWebEngineView);
     bool ret = false;
+
+    // Workaround: Do not interpret text as Qt::RichText
+    // QInputDialog uses Qt::AutoText that interprets the text string as
+    // Qt::RichText if Qt::mightBeRichText() returns true, otherwise as Qt::PlainText.
+    const QString message = Qt::mightBeRichText(msg) ? msg.toHtmlEscaped() : msg;
+
     if (result)
         *result = QInputDialog::getText(
                 q, QStringLiteral("Javascript Prompt - %1").arg(url.toString()),
-                msg.toHtmlEscaped(), QLineEdit::Normal, defaultValue.toHtmlEscaped(), &ret);
+                message, QLineEdit::Normal, defaultValue, &ret);
     return ret;
 #else
     Q_UNUSED(msg);

From 6776ebf39c406e236026cd3ad2e52e603b554bac Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sun, 14 Jan 2024 00:19:06 +0000
Subject: [PATCH 607/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I555903f00c3a3449d317da7e8e297f1a50f4e5f3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 2b312eb4410..f97eaf33fd5 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 02370fbc76ed78d277997e369c40e1d92ab4c370
+    ref: 5308558432c6fe34c852f82ae7b5e73e0172b4a6
     required: true
   ../tqtc-qtpositioning:
-    ref: 4c8275ad1058c997c6d12e45252fd2263cac4f91
+    ref: cfecdadbfbf2a9225efce8a35462ee475e2264f1
     required: false
   ../tqtc-qttools:
-    ref: aa5c90670040859d569397cdb9fb7df3d6f02380
+    ref: 5657fe0d0a021b93d7841a4e9d03f7d7f8db7b03
     required: false
   ../tqtc-qtwebchannel:
-    ref: e261b80c02ed6e50049ccc41bab147fdcb23fcdd
+    ref: 4c2ee43c73be6b05bbcc04e6cec7ba06ed7dde39
     required: false

From 704bef325126d78a55b3c8b61183a69df76be8e3 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 10 Jan 2024 11:43:28 +0100
Subject: [PATCH 608/681] Add x86_64 cross compilation target to whitelist
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some builds do x64 bit cross-compilation to x64 bit.

Task-number: QTBUG-120692
Change-Id: Id2d0c76c21484dd4ea8cc08430dca6a61b0c50ef
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
(cherry picked from commit 295d056aa0c1a4cf520109dddec09b84c2782c04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 409056595012ddd27c63f661d730d56d85d1a071)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.cmake b/configure.cmake
index bcbcd175aa4..a6c76b4f7a4 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -473,7 +473,7 @@ add_check_for_support(
    MESSAGE "Build can be done only on Linux, Windows, macO, iOS and Android(on non-Windows hosts only)."
 )
 if(LINUX AND CMAKE_CROSSCOMPILING)
-   set(supportedTargets "arm" "arm64" "armv7-a")
+   set(supportedTargets "arm" "arm64" "armv7-a" "x86_64")
    add_check_for_support(
        MODULES QtWebEngine QtPdf
        CONDITION TEST_architecture_arch IN_LIST supportedTargets

From eafa9d9ace2eaa8eefcfe9a1cab0dfc148a737e0 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 17 Jan 2024 12:24:22 +0000
Subject: [PATCH 609/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Ic7fbff3e5d9402fa0c8267f69a1cc0cba70485f6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 27897fd14c2..d7df2fb9ef7 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: abbbcb3f149418b945f6cddf24d90cc7fb091da8
+    ref: 45e24489171adf2f3379424079728852522f3424
     required: true
   ../qtpositioning:
-    ref: a82edeb0ce6e22ce04783de4164b5b900ff4bb8f
+    ref: 47c2bf056b95ca70226a6c14568e8924bc742975
     required: false
   ../qttools:
-    ref: d48e450b401679c9fbfbd49ca0620b8716f43eb9
+    ref: 23b09a4f0781483d7f7b0d86376b5f467bca68e9
     required: false
   ../qtwebchannel:
-    ref: 95561846ea597600a6f47486ff3f168e7419bcc5
+    ref: 2df22279b14a2aca4f25c37369fb8714955371a5
     required: false

From aad66aed638396a8a97c07e461847ecf1ca57090 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 15 Jan 2024 13:21:48 +0100
Subject: [PATCH 610/681] Update Chromium

Submodule src/3rdparty 028cbdb7..38bef0cb:
  * FIXUP: FIXUP Do not include xproto when no x11
  * [Backport] Security bug 1511689
  * Fixup: [Backport] Security bug 1488199
  * [Backport] CVE-2024-0222: Use after free in ANGLE
  * [Backport] CVE-2024-0223: Heap buffer overflow in ANGLE (3/3)
  * [Backport] CVE-2024-0223: Heap buffer overflow in ANGLE (2/3)
  * [Backport] CVE-2024-0223: Heap buffer overflow in ANGLE (1/3)
  * [Backport] CVE-2024-0224: Use after free in WebAudio
  * [Backport] CVE-2024-0225: Use after free in WebGPU
  * [Backport] CVE-2024-0333: Insufficient data validation in Extensions
  * [Backport] CVE-2023-7024: Heap buffer overflow in WebRTC
  * FIXUP: Fix compilation with system ICU
  * [Backport] Replace imp.load_source with importlib equivalent.
  * Do not include xproto when no x11
  * [Backport] Security bug 1488199 (3/3)
  * [Backport] Security bug 1488199 (2/3)
  * [Backport] Security bug 1488199 (1/3)
  * Bump V8_PATCH_LEVEL
  * [Backport] Security bug 1505632
  * [Backport] Security bug 1506726
  * [Backport] CVE-2023-6706: Use after free in FedCM
  * [Backport] CVE-2023-6705: Use after free in WebRTC
  * [Backport] CVE-2023-6703: Use after free in Blink
  * [Backport] CVE-2023-6702: Type Confusion in V8
  * FIXUP: Add missing pkg_config calls for system libs
  * Add missing pkg_config calls for system libs
  * [Backport] Security bug 1485266
  * [Backport] CVE-2023-6510: Use after free in Media Capture

Fixes: QTBUG-119857
Fixes: QTBUG-121003
Fixes: QTBUG-121004
Fixes: QTBUG-121005
Fixes: QTBUG-121006
Change-Id: Ic71d208d6f4cd285a60092936fb6a4ffc4620e6f
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index a928175d7bd..022f5fcd021 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           119.0.6045.199
+Patched with security patches up to Chromium version:           120.0.6099.216
diff --git a/src/3rdparty b/src/3rdparty
index 028cbdb7a0d..38bef0cb5eb 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 028cbdb7a0d37dfe0eea8cf3a2dad94c7ffdda0f
+Subproject commit 38bef0cb5eb91b6e1eb979b7b669b86dbe050c4b
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 9d48c90e156..a37262f8bc5 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "119.0.6045.199"; // FIXME: Remember to update
+    return "120.0.6099.216"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From b2a4eb8a9acce21fe8916a6f620f379b16f48748 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 9 Jan 2024 12:44:50 +0100
Subject: [PATCH 611/681] Speculative fix for missing licenses for qtpdf on
 doc.qt.io
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When executing 'ninja docs' documentation is generated locally with
code attributions for qtwebengine and qtpdf, however it is missing on
doc.qt.io in case of qtpdf.

Make 'ninja prepare_docs' target to already generate pdf_attributions,
hopefully it fixes the issue as it is unknown how those docs are
generated in the end, moreover this is the only difference between
qtwebengine and qpdf doc target setup.

This amends 98c84d8d7a4ef4a308b1a75f90ff075135995c60

Fixes: QTBUG-120663
Change-Id: Id1b371209ead987460fabb53c3bc35070dbedb35
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit bd33e00c54bdfc5ff3c25eefe7a13638d189369e)
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 src/pdf/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 7c9b4160184..1775d598c1c 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -65,7 +65,7 @@ add_code_attributions_target(
     BUILDDIR ${buildDir}/${config}/${arch}
 )
 add_dependencies(generate_pdf_attributions run_pdf_GnDone)
-add_dependencies(docs generate_pdf_attributions)
+add_dependencies(prepare_docs_Pdf generate_pdf_attributions)
 
 ##
 #   TOOLCHAIN SETUP

From 9ce01681c8dad081f4f4555d977181a7e659cfaa Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Mon, 8 Jan 2024 16:29:18 +0100
Subject: [PATCH 612/681] Fix required version for core and core in host
 project
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

During compile or cross compilation against core qt
(or core qt in host) with lower version. As we 'support'
compiling against latest LTS so currently 6.5

Change-Id: I62596e73fcd7265a85edf4048f82e1a060615e7f
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 8eba10d3b7db7e456f736417f90f84d460ead4f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a1b0579555d91f34f452c4b94fe77f71e9448b7b)
---
 CMakeLists.txt          | 2 +-
 src/host/CMakeLists.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f505967b24..b3c486870fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ include(ExternalProject)
 include(cmake/Functions.cmake)
 
 project(QtWebEngineDummy)
-find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core)
+find_package(Qt6 6.5 CONFIG REQUIRED COMPONENTS BuildInternals Core)
 
 project(QtWebEngine
     VERSION ${Qt6Core_VERSION}
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 0c1362ab679..db8e0054927 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -19,7 +19,7 @@ project(QtWebEngineConfigure
     VERSION "${QT_REPO_MODULE_VERSION}"
     LANGUAGES CXX C)
 
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+find_package(Qt6 6.5 CONFIG REQUIRED COMPONENTS BuildInternals Core)
 qt_internal_project_setup()
 get_gn_arch(target_arch ${GN_TARGET_CPU})
 get_gn_arch(host_arch ${TEST_architecture_arch})

From 37d6cd62dc85d85137245baacfc39884f12efc8d Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 18 Jan 2024 22:01:22 +0000
Subject: [PATCH 613/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I81688266fd731fa23bfccbe5ebab8c94670c0e57
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index d7df2fb9ef7..29a907d35fe 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 45e24489171adf2f3379424079728852522f3424
+    ref: 4dd42a7de97e5b0fb50fe4a0d44f98626c7d75c2
     required: true
   ../qtpositioning:
-    ref: 47c2bf056b95ca70226a6c14568e8924bc742975
+    ref: 40c6b2cf7968cf157b87c39330df5009ea33bb77
     required: false
   ../qttools:
-    ref: 23b09a4f0781483d7f7b0d86376b5f467bca68e9
+    ref: 91e9f79a612780d7e8c0c0816a42ab180077de3b
     required: false
   ../qtwebchannel:
-    ref: 2df22279b14a2aca4f25c37369fb8714955371a5
+    ref: 5ea462f7ac9891d22a8d945566718451875b387d
     required: false

From 0c0dbea8dbe71c9ac4c51b7af2b6a2f1cdc6a337 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 19 Jan 2024 02:38:12 +0000
Subject: [PATCH 614/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I9d2b9ccb4580533e5cf6baf918b3c3eae0424369
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index f97eaf33fd5..067994866e2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 5308558432c6fe34c852f82ae7b5e73e0172b4a6
+    ref: bc6bc514f06b37f599547e4a2d6089f42a1a7ff7
     required: true
   ../tqtc-qtpositioning:
-    ref: cfecdadbfbf2a9225efce8a35462ee475e2264f1
+    ref: cb3666bfa5bae63ffbaa738514696b261aaf6d3c
     required: false
   ../tqtc-qttools:
-    ref: 5657fe0d0a021b93d7841a4e9d03f7d7f8db7b03
+    ref: 9c8c7e99dee73561122b2386896ac920889428c3
     required: false
   ../tqtc-qtwebchannel:
-    ref: 4c2ee43c73be6b05bbcc04e6cec7ba06ed7dde39
+    ref: 14f251b43d6a9bac5141527f620180763d8d061c
     required: false

From c674260f7d3bf9295e6310f3b5de528f7364630b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 18 Jan 2024 22:31:55 +0100
Subject: [PATCH 615/681] Update Chromium

Submodule src/3rdparty 38bef0c..7b40abeb:
  * [Backport] Security bug 1506535
  * [Backport] CVE-2024-0518: Type Confusion in V8
  * [Backport] CVE-2024-0519: Out of bounds memory access in V8
  * Fix compilation without webrtc
  * Speculative fix for jumbo builds on windows

Fixes: QTBUG-121229
Change-Id: I106c80206bc84c592d2fe1df770c391883d587df
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 022f5fcd021..1124c6f9c85 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           120.0.6099.216
+Patched with security patches up to Chromium version:           120.0.6099.225
diff --git a/src/3rdparty b/src/3rdparty
index 38bef0cb5eb..7b40abebdec 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 38bef0cb5eb91b6e1eb979b7b669b86dbe050c4b
+Subproject commit 7b40abebdec3e2931c88010fedc96c49fbba1731
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index a37262f8bc5..4f9bc8a6782 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "120.0.6099.216"; // FIXME: Remember to update
+    return "120.0.6099.225"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From ec15a072faad0420cc4e1ca35d647c806f961de9 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Fri, 8 Dec 2023 12:06:47 +0100
Subject: [PATCH 616/681] Fix compilation error with -no-feature-accessibility
 option

- At present, there is no option to disable accessibility in Chromium during build time.
- Added the missing definition for BrowserAccessibility::Create() to resolve the compilation issue.
- This approach is similar to the BrowserAccessibilityManager::Create() function.

Fixes: QTBUG-119789
Pick-to: 6.5
Change-Id: I87a0a3653fa18aa3d32d5620a18f89e9403c92ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 39e437f0bc990cf292defff0d77790d27b31df32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6fc5eff5cef36ae86704a5f2e05b58c1f5e82a62)
---
 src/core/CMakeLists.txt               |  2 +-
 src/core/browser_accessibility_qt.cpp | 10 ++++++++++
 src/core/browser_accessibility_qt.h   |  4 +++-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index c4e4133510a..20ef91637f9 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -78,6 +78,7 @@ foreach(arch ${archs})
                 ${gnCxxCompileOptions}
             SOURCES
                 accessibility_tree_formatter_qt.cpp
+                browser_accessibility_qt.cpp browser_accessibility_qt.h
                 authentication_dialog_controller.cpp authentication_dialog_controller.h authentication_dialog_controller_p.h
                 autofill_client_qt.cpp autofill_client_qt.h
                 autofill_popup_controller.cpp autofill_popup_controller.h autofill_popup_controller_p.h
@@ -202,7 +203,6 @@ foreach(arch ${archs})
         extend_gn_target(${buildGn} CONDITION QT_FEATURE_accessibility
             SOURCES
                 accessibility_activation_observer.cpp accessibility_activation_observer.h
-                browser_accessibility_qt.cpp browser_accessibility_qt.h
         )
 
         extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_ozone_x11
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index 4b8e947c0d6..de3347df36d 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -10,6 +10,7 @@
 #include "qtwebenginecoreglobal_p.h"
 #include "type_conversion.h"
 
+#if QT_CONFIG(accessibility)
 #include "content/browser/accessibility/browser_accessibility.h"
 #include "ui/accessibility/ax_enums.mojom.h"
 
@@ -1151,14 +1152,22 @@ void BrowserAccessibilityInterface::modelChange(QAccessibleTableModelChangeEvent
 
 } // namespace QtWebEngineCore
 
+#endif // QT_CONFIG(accessibility)
 namespace content {
 
 // static
 std::unique_ptr<BrowserAccessibility> BrowserAccessibility::Create(BrowserAccessibilityManager *man, ui::AXNode *node)
 {
+#if QT_CONFIG(accessibility)
     return std::unique_ptr<BrowserAccessibility>(new QtWebEngineCore::BrowserAccessibilityQt(man, node));
+#else
+    Q_UNUSED(man);
+    Q_UNUSED(node);
+    return nullptr;
+#endif // #if QT_CONFIG(accessibility)
 }
 
+#if QT_CONFIG(accessibility)
 QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj)
 {
     return static_cast<QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
@@ -1168,5 +1177,6 @@ const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *o
 {
     return static_cast<const QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
 }
+#endif // #if QT_CONFIG(accessibility)
 
 } // namespace content
diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index 45547824728..598aa3ef52d 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -4,8 +4,9 @@
 #ifndef BROWSER_ACCESSIBILITY_QT_H
 #define BROWSER_ACCESSIBILITY_QT_H
 
-#include <QtCore/qtconfigmacros.h>
+#include <QtGui/qtguiglobal.h>
 
+#if QT_CONFIG(accessibility)
 QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
 
 namespace content {
@@ -15,5 +16,6 @@ QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj);
 const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *obj);
 
 } // namespace content
+#endif // QT_CONFIG(accessibility)
 
 #endif // BROWSER_ACCESSIBILITY_QT_H

From d516c5e48b97ffb1afb2d4a9b7ccac27319895c1 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Fri, 12 Jan 2024 15:31:12 +0100
Subject: [PATCH 617/681] Fix printing when page ranges are specified

Page ranges are applied at the PDF generation phase and it's incorrect
to do it again in PrinterWorker. Simplify it to print all available
pages.

Fixes: QTBUG-119991
Change-Id: Iaaf435ba2a93ea4480dc1d2f5500844138ea1b53
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ad26c851700de5ee0962a944d6fc02b58004de1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2463c13ae64701e7c18495eb7dd63e0dc7a129b3)
---
 src/core/printing/printer_worker.cpp | 38 +++++-----------------------
 1 file changed, 7 insertions(+), 31 deletions(-)

diff --git a/src/core/printing/printer_worker.cpp b/src/core/printing/printer_worker.cpp
index da71656236d..6032f221118 100644
--- a/src/core/printing/printer_worker.cpp
+++ b/src/core/printing/printer_worker.cpp
@@ -27,22 +27,8 @@ void PrinterWorker::print()
 
     PdfiumDocumentWrapperQt pdfiumWrapper(m_data->constData(), m_data->size());
 
-    const QPageRanges ranges = m_device->pageRanges();
-    int toPage = ranges.firstPage();
-    int fromPage = ranges.lastPage();
-    bool ascendingOrder = true;
-
-    if (fromPage == 0 && toPage == 0) {
-        fromPage = 1;
-        toPage = pdfiumWrapper.pageCount();
-    }
-    fromPage = qMax(1, fromPage);
-    toPage = qMin(pdfiumWrapper.pageCount(), toPage);
-
-    if (!m_firstPageFirst) {
-        qSwap(fromPage, toPage);
-        ascendingOrder = false;
-    }
+    const int fromPage = m_firstPageFirst ? 0 : pdfiumWrapper.pageCount() - 1;
+    const int toPage = m_firstPageFirst ? pdfiumWrapper.pageCount() : -1;
 
     int pageCopies = 1;
     if (m_collateCopies) {
@@ -58,10 +44,8 @@ void PrinterWorker::print()
         if (printedDocuments > 0)
             m_device->newPage();
 
-        int currentPageIndex = fromPage;
-
-        for (int i = 0; true; i++) {
-            QSizeF documentSize = (pdfiumWrapper.pageSize(currentPageIndex - 1) * resolution);
+        for (int i = fromPage; i != toPage; m_firstPageFirst ? i++ : i--) {
+            QSizeF documentSize = (pdfiumWrapper.pageSize(i) * resolution);
             bool isLandscape = documentSize.width() > documentSize.height();
             m_device->setPageOrientation(isLandscape ? QPageLayout::Landscape
                                                       : QPageLayout::Portrait);
@@ -77,29 +61,21 @@ void PrinterWorker::print()
                 return;
             }
 
-            if (i > 0)
+            if (i != fromPage)
                 m_device->newPage();
 
             for (int printedPages = 0; printedPages < pageCopies; printedPages++) {
                 if (printedPages > 0)
                     m_device->newPage();
 
-                QImage currentImage = pdfiumWrapper.pageAsQImage(
-                        currentPageIndex - 1, documentSize.width(), documentSize.height());
+                QImage currentImage =
+                        pdfiumWrapper.pageAsQImage(i, documentSize.width(), documentSize.height());
                 if (currentImage.isNull()) {
                     Q_EMIT resultReady(false);
                     return;
                 }
                 painter.drawImage(0, 0, currentImage);
             }
-
-            if (currentPageIndex == toPage)
-                break;
-
-            if (ascendingOrder)
-                currentPageIndex++;
-            else
-                currentPageIndex--;
         }
     }
     painter.end();

From fe6dc77fe0e80b0917cbe5eea2295ee845d4ae30 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 12 Dec 2023 16:35:44 +0100
Subject: [PATCH 618/681] Fix cursor position during composition

During input composition, the cursor is set to the starting position of
the string being edited and refrain from updating it throughout the
composition process. Once the string is committed, it is set to the last
position of the committed string. The modified code is designed to
exhibit the same behavior as the widget and quickwidget.

Fixes: QTBUG-118746
Pick-to: 6.5
Change-Id: I9adb7a9bea9493457a1d9d4b32338cdba30920a1
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit c9550388b9ab1d82454d0c59eaaf7e640d83d750)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 266c9a5605e05166c0b6e9113e19595856149bd2)
---
 src/core/render_widget_host_view_qt.cpp       |  8 ++-
 .../tst_qquickwebengineview.cpp               |  4 +-
 .../qwebengineview/tst_qwebengineview.cpp     | 65 ++++++++++++++++---
 3 files changed, 64 insertions(+), 13 deletions(-)

diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 7561c5d7974..4e52041d4ae 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -683,9 +683,11 @@ void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputMana
 
     // In case of text selection, the update is expected in RenderWidgetHostViewQt::selectionChanged().
     if (GetSelectedText().empty()) {
-        // At this point it is unknown whether the text input state has been updated due to a text selection.
-        // Keep the cursor position updated for cursor movements too.
-        delegateClient()->setCursorPosition(state->selection.start());
+        if (state->composition.has_value()) {
+            delegateClient()->setCursorPosition(state->composition->start());
+        } else {
+            delegateClient()->setCursorPosition(state->selection.start());
+        }
         m_delegate->inputMethodStateChanged(type != ui::TEXT_INPUT_TYPE_NONE, type == ui::TEXT_INPUT_TYPE_PASSWORD);
     }
 
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index bf68fb04819..1e79466a3ce 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -693,8 +693,8 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
         QGuiApplication::sendEvent(qApp->focusObject(), &event);
     }
     QTRY_COMPARE(testContext.infos.size(), 1);
-    QCOMPARE(testContext.infos[0].cursorPosition, 3);
-    QCOMPARE(testContext.infos[0].anchorPosition, 3);
+    QCOMPARE(testContext.infos[0].cursorPosition, 0);
+    QCOMPARE(testContext.infos[0].anchorPosition, 0);
     QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
     QCOMPARE(testContext.infos[0].selectedText, QStringLiteral(""));
     QCOMPARE(evaluateJavaScriptSync(view, "document.getElementById('input1').value").toString(), QStringLiteral("123QtWebEngine!"));
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 47874c791c3..4331a5e3684 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -2062,8 +2062,8 @@ void tst_QWebEngineView::inputContextQueryInput()
         QApplication::sendEvent(view.focusProxy(), &event);
     }
     QTRY_COMPARE(testContext.infos.size(), 1);
-    QCOMPARE(testContext.infos[0].cursorPosition, 3);
-    QCOMPARE(testContext.infos[0].anchorPosition, 3);
+    QCOMPARE(testContext.infos[0].cursorPosition, 0);
+    QCOMPARE(testContext.infos[0].anchorPosition, 0);
     QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
     QCOMPARE(testContext.infos[0].selectedText, QStringLiteral(""));
     QCOMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QStringLiteral("123QtWebEngine!"));
@@ -2659,8 +2659,8 @@ void tst_QWebEngineView::imeComposition()
         QApplication::sendEvent(view.focusProxy(), &event);
     }
     QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString(""));
-    QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
-    QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 11);
+    QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
+    QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 0);
     QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
     QCOMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QString("QtWebEngine"));
 
@@ -2971,7 +2971,7 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
         qApp->processEvents();
     }
     QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QString("composition"));
-    QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
+    QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
 
     QApplication::sendEvent(input, &srrndTextQuery);
     QApplication::sendEvent(input, &absolutePosQuery);
@@ -2980,9 +2980,9 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     qApp->processEvents();
 
     QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString(""));
-    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
-    QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
-    QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 0);
+    QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 0);
+    QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 0);
 
     // Send commit
     {
@@ -3005,6 +3005,55 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
     QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
     QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
     QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
+
+    // Test another composition to ensure that the cursor position is set correctly.
+    // In this case cursor will be at position 11 during input composition.
+    {
+        QList<QInputMethodEvent::Attribute> attributes;
+        QInputMethodEvent event("123", attributes);
+        QApplication::sendEvent(input, &event);
+        qApp->processEvents();
+    }
+    QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value")
+                         .toString(),
+                 QString("composition123"));
+    QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
+
+    QApplication::sendEvent(input, &srrndTextQuery);
+    QApplication::sendEvent(input, &absolutePosQuery);
+    QApplication::sendEvent(input, &cursorPosQuery);
+    QApplication::sendEvent(input, &anchorPosQuery);
+    qApp->processEvents();
+
+    QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition"));
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
+    QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
+    QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
+
+    // Send commit
+    {
+        QList<QInputMethodEvent::Attribute> attributes;
+        QInputMethodEvent event("", attributes);
+        event.setCommitString("123");
+        QApplication::sendEvent(input, &event);
+        qApp->processEvents();
+    }
+
+    QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value")
+                         .toString(),
+                 QString("composition123"));
+    QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 14);
+
+    QApplication::sendEvent(input, &srrndTextQuery);
+    QApplication::sendEvent(input, &absolutePosQuery);
+    QApplication::sendEvent(input, &cursorPosQuery);
+    QApplication::sendEvent(input, &anchorPosQuery);
+    qApp->processEvents();
+
+    QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition123"));
+    QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 14);
+    QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 14);
+    QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 14);
 }
 
 #if QT_CONFIG(clipboard)

From 124856884f034486a728e4b0c5981a6b0f5cb348 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 22 Jan 2024 10:49:09 +0000
Subject: [PATCH 619/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: I10ca844ae7ba7df62aa176ef5e1073ce7ccc66b3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 29a907d35fe..41bb052cdf6 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 4dd42a7de97e5b0fb50fe4a0d44f98626c7d75c2
+    ref: 3397d18191a21d284462aade8df0764de65d9dda
     required: true
   ../qtpositioning:
-    ref: 40c6b2cf7968cf157b87c39330df5009ea33bb77
+    ref: 19ac00b9cb08ba9787b5130ec8baef40dd62d811
     required: false
   ../qttools:
-    ref: 91e9f79a612780d7e8c0c0816a42ab180077de3b
+    ref: 40eb7aa14a68a9393dcacd971464689b5073f4a4
     required: false
   ../qtwebchannel:
-    ref: 5ea462f7ac9891d22a8d945566718451875b387d
+    ref: 07c396efb1d29ad61d86aab3d82cd6f4d95cd5e7
     required: false

From 8bdaa2506e73d6081c49200dd3ee1652ed624c69 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 22 Jan 2024 17:32:25 +0000
Subject: [PATCH 620/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Ic4561e83cd9d1339f8b83fdb8912d50d43623653
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 067994866e2..dfdc5eb6bf9 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: bc6bc514f06b37f599547e4a2d6089f42a1a7ff7
+    ref: 1245fb8cad50a79e53c5c95380c6bf5809c3e973
     required: true
   ../tqtc-qtpositioning:
-    ref: cb3666bfa5bae63ffbaa738514696b261aaf6d3c
+    ref: 0236acaa0895ffb82b6e693c2ec30b608c93be1f
     required: false
   ../tqtc-qttools:
-    ref: 9c8c7e99dee73561122b2386896ac920889428c3
+    ref: dac0111b090f71e8c9c2b6c90b47ec432e65e088
     required: false
   ../tqtc-qtwebchannel:
-    ref: 14f251b43d6a9bac5141527f620180763d8d061c
+    ref: ffd4c7eb8526892de8ab7c3b28c428bec0f087d3
     required: false

From 44661cfecf510295bf619ebebcc785cf97a92b36 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 17 Jan 2024 15:37:29 -0700
Subject: [PATCH 621/681] Fix high-dpi scaling in PdfScrollablePageView

Amends 85f82185ef5102a2dbe3b2e437b9723e1652ce57

In PdfScrollablePageView.qml, a property like

  property size pagePointSize: document.pagePointSize(pageNavigator.currentPage)

would get evaluated too early (QPdfDocument::pagePointSize() returns a
default-constructed QSize if d->doc is still null). We need to call
pagePointSize() directly in bindings that need it, so that the function
will be called again each time some other binding dependency changes,
to get the size of the current page in the current document. Perhaps
a binding to the result of a function call does not get invalidated
when the function argument changes; or perhaps behavior changed now
that the QML files tend to be compiled rather than runtime-interpreted
resources.

We also need PdfPageImage's width and height to be bound (as they are in
PdfMultiPageView.qml), to avoid automatically scaling up to sourceSize.

So now we get high-dpi page images again in the single-page example.

Task-number: QTBUG-86948
Pick-to: 6.5
Change-Id: I44e8df15c18bd0b752dccc899028e7e7900f6ffb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3093ddfa8fb22db9295bc76a07207e6da0a3e995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bb514314f924e7f94ac48f4d2283a254cff4cd83)
---
 src/pdfquick/PdfScrollablePageView.qml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/pdfquick/PdfScrollablePageView.qml b/src/pdfquick/PdfScrollablePageView.qml
index 5295db7f8c5..afebdd080a6 100644
--- a/src/pdfquick/PdfScrollablePageView.qml
+++ b/src/pdfquick/PdfScrollablePageView.qml
@@ -302,9 +302,6 @@ Flickable {
     }
 
     onRenderScaleChanged: {
-        image.sourceSize.width = document.pagePointSize(pageNavigator.currentPage).width *
-                renderScale * Screen.devicePixelRatio
-        image.sourceSize.height = 0
         paper.scale = 1
         const currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
                                          (root.contentY + root.height / 2) / root.renderScale)
@@ -365,6 +362,10 @@ Flickable {
             rotation: root.pageRotation
             anchors.centerIn: parent
             property real pageScale: image.paintedWidth / document.pagePointSize(pageNavigator.currentPage).width
+            width: document.pagePointSize(pageNavigator.currentPage).width * root.renderScale
+            height: document.pagePointSize(pageNavigator.currentPage).height * root.renderScale
+            sourceSize.width: width * Screen.devicePixelRatio
+            sourceSize.height: 0
 
             Shape {
                 anchors.fill: parent

From 213a569e99488755b398b487bd7f2c2883451b65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 19 Dec 2023 12:38:08 +0100
Subject: [PATCH 622/681] Correct PrintedPageSizeId to match
 QPageSize::PageSizeId

With Qt 6, QPageSize::PageSizeId enum was cleaned up and some values
were reordered, but the WebEngineQuick part was not changed accordingly.

Pick-to: 6.5
Fixes: QTBUG-120218
Change-Id: I7e4c419750d30a64193e68b0b217ebbccce07d87
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 199730bd41219c5484fb1c4c61b637ab9ceec0c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8f017c2d9d015b9d72a7f1f36e53747bad6c3bfa)
---
 .../api/qquickwebengineview.cpp               | 128 ++++++++++++++++++
 .../api/qquickwebengineview_p.h               |  12 +-
 .../doc/src/webengineview_lgpl.qdoc           |   2 -
 tests/auto/quick/publicapi/tst_publicapi.cpp  |   6 +-
 4 files changed, 135 insertions(+), 13 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index c14cfdda30d..416c90cfe8d 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -111,6 +111,134 @@ Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LoadSucceededStatus) == st
 QT_WARNING_POP
 #endif
 
+#if QT_CONFIG(webengine_printing_and_pdf)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Letter, QQuickWebEngineView::PrintedPageSizeId::Letter)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Legal, QQuickWebEngineView::PrintedPageSizeId::Legal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Executive, QQuickWebEngineView::PrintedPageSizeId::Executive)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A0, QQuickWebEngineView::PrintedPageSizeId::A0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A1, QQuickWebEngineView::PrintedPageSizeId::A1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A2, QQuickWebEngineView::PrintedPageSizeId::A2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A3, QQuickWebEngineView::PrintedPageSizeId::A3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4, QQuickWebEngineView::PrintedPageSizeId::A4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A5, QQuickWebEngineView::PrintedPageSizeId::A5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A6, QQuickWebEngineView::PrintedPageSizeId::A6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A7, QQuickWebEngineView::PrintedPageSizeId::A7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A8, QQuickWebEngineView::PrintedPageSizeId::A8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A9, QQuickWebEngineView::PrintedPageSizeId::A9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A10, QQuickWebEngineView::PrintedPageSizeId::A10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B0, QQuickWebEngineView::PrintedPageSizeId::B0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B1, QQuickWebEngineView::PrintedPageSizeId::B1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B2, QQuickWebEngineView::PrintedPageSizeId::B2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B3, QQuickWebEngineView::PrintedPageSizeId::B3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B4, QQuickWebEngineView::PrintedPageSizeId::B4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B5, QQuickWebEngineView::PrintedPageSizeId::B5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B6, QQuickWebEngineView::PrintedPageSizeId::B6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B7, QQuickWebEngineView::PrintedPageSizeId::B7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B8, QQuickWebEngineView::PrintedPageSizeId::B8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B9, QQuickWebEngineView::PrintedPageSizeId::B9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B10, QQuickWebEngineView::PrintedPageSizeId::B10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::C5E, QQuickWebEngineView::PrintedPageSizeId::C5E)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Comm10E, QQuickWebEngineView::PrintedPageSizeId::Comm10E)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::DLE, QQuickWebEngineView::PrintedPageSizeId::DLE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Folio, QQuickWebEngineView::PrintedPageSizeId::Folio)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Ledger, QQuickWebEngineView::PrintedPageSizeId::Ledger)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Tabloid, QQuickWebEngineView::PrintedPageSizeId::Tabloid)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Custom, QQuickWebEngineView::PrintedPageSizeId::Custom)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A3Extra, QQuickWebEngineView::PrintedPageSizeId::A3Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Extra, QQuickWebEngineView::PrintedPageSizeId::A4Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Plus, QQuickWebEngineView::PrintedPageSizeId::A4Plus)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Small, QQuickWebEngineView::PrintedPageSizeId::A4Small)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A5Extra, QQuickWebEngineView::PrintedPageSizeId::A5Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B5Extra, QQuickWebEngineView::PrintedPageSizeId::B5Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB0, QQuickWebEngineView::PrintedPageSizeId::JisB0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB1, QQuickWebEngineView::PrintedPageSizeId::JisB1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB2, QQuickWebEngineView::PrintedPageSizeId::JisB2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB3, QQuickWebEngineView::PrintedPageSizeId::JisB3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB4, QQuickWebEngineView::PrintedPageSizeId::JisB4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB5, QQuickWebEngineView::PrintedPageSizeId::JisB5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB6, QQuickWebEngineView::PrintedPageSizeId::JisB6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB7, QQuickWebEngineView::PrintedPageSizeId::JisB7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB8, QQuickWebEngineView::PrintedPageSizeId::JisB8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB9, QQuickWebEngineView::PrintedPageSizeId::JisB9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB10, QQuickWebEngineView::PrintedPageSizeId::JisB10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiC, QQuickWebEngineView::PrintedPageSizeId::AnsiC)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiD, QQuickWebEngineView::PrintedPageSizeId::AnsiD)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiE, QQuickWebEngineView::PrintedPageSizeId::AnsiE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LegalExtra, QQuickWebEngineView::PrintedPageSizeId::LegalExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterExtra, QQuickWebEngineView::PrintedPageSizeId::LetterExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterPlus, QQuickWebEngineView::PrintedPageSizeId::LetterPlus)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterSmall, QQuickWebEngineView::PrintedPageSizeId::LetterSmall)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::TabloidExtra, QQuickWebEngineView::PrintedPageSizeId::TabloidExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchA, QQuickWebEngineView::PrintedPageSizeId::ArchA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchB, QQuickWebEngineView::PrintedPageSizeId::ArchB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchC, QQuickWebEngineView::PrintedPageSizeId::ArchC)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchD, QQuickWebEngineView::PrintedPageSizeId::ArchD)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchE, QQuickWebEngineView::PrintedPageSizeId::ArchE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial7x9, QQuickWebEngineView::PrintedPageSizeId::Imperial7x9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial8x10, QQuickWebEngineView::PrintedPageSizeId::Imperial8x10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial9x11, QQuickWebEngineView::PrintedPageSizeId::Imperial9x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial9x12, QQuickWebEngineView::PrintedPageSizeId::Imperial9x12)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x11, QQuickWebEngineView::PrintedPageSizeId::Imperial10x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x13, QQuickWebEngineView::PrintedPageSizeId::Imperial10x13)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x14, QQuickWebEngineView::PrintedPageSizeId::Imperial10x14)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial12x11, QQuickWebEngineView::PrintedPageSizeId::Imperial12x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial15x11, QQuickWebEngineView::PrintedPageSizeId::Imperial15x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ExecutiveStandard, QQuickWebEngineView::PrintedPageSizeId::ExecutiveStandard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Note, QQuickWebEngineView::PrintedPageSizeId::Note)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Quarto, QQuickWebEngineView::PrintedPageSizeId::Quarto)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Statement, QQuickWebEngineView::PrintedPageSizeId::Statement)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::SuperA, QQuickWebEngineView::PrintedPageSizeId::SuperA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::SuperB, QQuickWebEngineView::PrintedPageSizeId::SuperB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Postcard, QQuickWebEngineView::PrintedPageSizeId::Postcard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::DoublePostcard, QQuickWebEngineView::PrintedPageSizeId::DoublePostcard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc16K, QQuickWebEngineView::PrintedPageSizeId::Prc16K)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc32K, QQuickWebEngineView::PrintedPageSizeId::Prc32K)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc32KBig, QQuickWebEngineView::PrintedPageSizeId::Prc32KBig)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldUS, QQuickWebEngineView::PrintedPageSizeId::FanFoldUS)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldGerman, QQuickWebEngineView::PrintedPageSizeId::FanFoldGerman)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldGermanLegal, QQuickWebEngineView::PrintedPageSizeId::FanFoldGermanLegal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB5, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB6, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC0, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC1, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC2, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC6, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC65, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC65)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC7, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope9, QQuickWebEngineView::PrintedPageSizeId::Envelope9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope11, QQuickWebEngineView::PrintedPageSizeId::Envelope11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope12, QQuickWebEngineView::PrintedPageSizeId::Envelope12)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope14, QQuickWebEngineView::PrintedPageSizeId::Envelope14)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeMonarch, QQuickWebEngineView::PrintedPageSizeId::EnvelopeMonarch)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePersonal, QQuickWebEngineView::PrintedPageSizeId::EnvelopePersonal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeChou3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeChou3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeChou4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeChou4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeInvite, QQuickWebEngineView::PrintedPageSizeId::EnvelopeInvite)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeItalian, QQuickWebEngineView::PrintedPageSizeId::EnvelopeItalian)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeKaku2, QQuickWebEngineView::PrintedPageSizeId::EnvelopeKaku2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeKaku3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeKaku3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc1, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc2, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc3, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc4, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc5, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc6, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc7, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc8, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc9, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc10, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeYou4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeYou4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LastPageSize, QQuickWebEngineView::PrintedPageSizeId::LastPageSize)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiA, QQuickWebEngineView::PrintedPageSizeId::AnsiA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiB, QQuickWebEngineView::PrintedPageSizeId::AnsiB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC5, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeDL, QQuickWebEngineView::PrintedPageSizeId::EnvelopeDL)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope10, QQuickWebEngineView::PrintedPageSizeId::Envelope10)
+#endif
+
 class WebEngineQuickWidgetDelegate : public QtWebEngineCore::WidgetDelegate
 {
 public:
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index c68dbc37a20..7e982094e74 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -266,8 +266,6 @@ QT_WARNING_POP
     // must match QPageSize::PageSizeId
     enum PrintedPageSizeId {
         // Existing Qt sizes
-        A4,
-        B5,
         Letter,
         Legal,
         Executive,
@@ -275,21 +273,24 @@ QT_WARNING_POP
         A1,
         A2,
         A3,
+        A4,
         A5,
         A6,
         A7,
         A8,
         A9,
+        A10,
         B0,
         B1,
-        B10,
         B2,
         B3,
         B4,
+        B5,
         B6,
         B7,
         B8,
         B9,
+        B10,
         C5E,
         Comm10E,
         DLE,
@@ -299,7 +300,6 @@ QT_WARNING_POP
         Custom,
 
         // New values derived from PPD standard
-        A10,
         A3Extra,
         A4Extra,
         A4Plus,
@@ -402,10 +402,8 @@ QT_WARNING_POP
         EnvelopePrc10,
         EnvelopeYou4,
 
-        // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
+        // Last item
         LastPageSize = EnvelopeYou4,
-        NPageSize = LastPageSize,
-        NPaperSize = LastPageSize,
 
         // Convenience overloads for naming consistency
         AnsiA = Letter,
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 8ba247d35b3..5f4297cb894 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -1001,8 +1001,6 @@
     \value WebEngineView.EnvelopePrc10
     \value WebEngineView.EnvelopeYou4
     \value WebEngineView.LastPageSize = \c EnvelopeYou4
-    \omitvalue NPageSize
-    \omitvalue NPaperSize
 
     \sa WebEngineView::printToPdf()
 */
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index e3f9200dc37..12733b89085 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -469,7 +469,6 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.action(WebAction) --> QQuickWebEngineAction*"
     << "QQuickWebEngineView.A0 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A1 --> PrintedPageSizeId"
-    << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A2 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A3 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A3Extra --> PrintedPageSizeId"
@@ -483,6 +482,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.A7 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A8 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A9 --> PrintedPageSizeId"
+    << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.AbnormalTerminationStatus --> RenderProcessTerminationStatus"
     << "QQuickWebEngineView.AlignCenter --> WebAction"
     << "QQuickWebEngineView.AlignJustified --> WebAction"
@@ -500,7 +500,6 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.ArchE --> PrintedPageSizeId"
     << "QQuickWebEngineView.B0 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B1 --> PrintedPageSizeId"
-    << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B2 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B3 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B4 --> PrintedPageSizeId"
@@ -510,6 +509,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.B7 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B8 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B9 --> PrintedPageSizeId"
+    << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.Back --> WebAction"
     << "QQuickWebEngineView.C5E --> PrintedPageSizeId"
     << "QQuickWebEngineView.CertificateErrorDomain --> ErrorDomain"
@@ -630,8 +630,6 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.MediaAudioCapture --> Feature"
     << "QQuickWebEngineView.MediaAudioVideoCapture --> Feature"
     << "QQuickWebEngineView.MediaVideoCapture --> Feature"
-    << "QQuickWebEngineView.NPageSize --> PrintedPageSizeId"
-    << "QQuickWebEngineView.NPaperSize --> PrintedPageSizeId"
     << "QQuickWebEngineView.NoErrorDomain --> ErrorDomain"
     << "QQuickWebEngineView.Notifications --> Feature"
     << "QQuickWebEngineView.NoWebAction --> WebAction"

From 0114f20b78e9e1d2bc05f3a03b0a041fb10125bb Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sat, 27 Jan 2024 16:24:31 +0000
Subject: [PATCH 623/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Idb80fcf55e98b688744a36b1ba9489e9ab7423b9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index dfdc5eb6bf9..79886bbf12c 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 1245fb8cad50a79e53c5c95380c6bf5809c3e973
+    ref: e52edaf1ba9c31491d7fe7e650dd5668bb313695
     required: true
   ../tqtc-qtpositioning:
-    ref: 0236acaa0895ffb82b6e693c2ec30b608c93be1f
+    ref: bf67714ecc876daa3ce9570337a020694391a286
     required: false
   ../tqtc-qttools:
-    ref: dac0111b090f71e8c9c2b6c90b47ec432e65e088
+    ref: 8db8b986ceebe77eaa309dc38cfb0d531166699d
     required: false
   ../tqtc-qtwebchannel:
-    ref: ffd4c7eb8526892de8ab7c3b28c428bec0f087d3
+    ref: 4ed8e49ccf36c8f0c4ac9b08e25f01f8a2216fbe
     required: false

From e3af0e8ae86151214a1e285c7f3bd7d24efbdd35 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 25 Jul 2023 15:44:50 +0200
Subject: [PATCH 624/681] Fix discontinuity with successive pinch-zoom in
 PdfMultiPageView

pinch.persistentScale is settable since 6.5 (qtdeclarative
a432970b258edb9ff041d221b2155df30cad4799): we need that to tell
PinchHandler to start over from 1 after we have also set the rendered
scale back to 1, because PinchHandler does not read the scale property
for itself.

This cherry-pick includes 48ebac59b1ec5bbafa1c64adbdbc44b0cf3f302a
to avoid a crash on exit by waiting for the rendering to be done, and
a4e64baef027fb407b8c1491c444ed58edd15529 to disable touch compression.

Fixes: QTBUG-115502
Task-number: QTBUG-120245
Task-number: QTBUG-121502
Fixes: QTBUG-121564
Pick-to: 6.5
Change-Id: I21951c447bf33e5942b6a1635488d5474ec8f293
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c0524da14d92a957b4607fb5867dba5d23eea6d9)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 8c27ae33f80440d20f578fa404c454c8d7bfdf19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 src/pdfquick/PdfMultiPageView.qml             |  6 +-
 .../multipageview/tst_multipageview.cpp       | 75 +++++++++++++++++++
 2 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
index 10683f55dee..84c3e31812b 100644
--- a/src/pdfquick/PdfMultiPageView.qml
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -408,12 +408,16 @@ Item {
                             const centroidInFlickable = tableView.mapFromItem(paper, pinch.centroid.position.x, pinch.centroid.position.y)
                             const newSourceWidth = image.sourceSize.width * paper.scale
                             const ratio = newSourceWidth / image.sourceSize.width
-                            console.log(lcMPV, "pinch ended on page", index, "with centroid", pinch.centroid.position, centroidInPoints, "wrt flickable", centroidInFlickable,
+                            console.log(lcMPV, "pinch ended on page", index,
+                                        "with scale", paper.scale.toFixed(3), "ratio", ratio.toFixed(3),
+                                        "centroid", pinch.centroid.position, centroidInPoints,
+                                        "wrt flickable", centroidInFlickable,
                                         "page at", pageHolder.x.toFixed(2), pageHolder.y.toFixed(2),
                                         "contentX/Y were", tableView.contentX.toFixed(2), tableView.contentY.toFixed(2))
                             if (ratio > 1.1 || ratio < 0.9) {
                                 const centroidOnPage = Qt.point(centroidInPoints.x * root.renderScale * ratio, centroidInPoints.y * root.renderScale * ratio)
                                 paper.scale = 1
+                                pinch.persistentScale = 1
                                 paper.x = 0
                                 paper.y = 0
                                 root.renderScale *= ratio
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index 9cd8e3e2d8b..9067fdbe3af 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -6,6 +6,7 @@
 #include <QtCore/QLoggingCategory>
 #include <QtGui/QClipboard>
 #include <QtGui/QPointingDevice>
+#include <QtGui/QStyleHints>
 #include <QtQuick/QQuickView>
 #include <QtPdfQuick/private/qquickpdflinkmodel_p.h>
 #include <QtPdfQuick/private/qquickpdfsearchmodel_p.h>
@@ -28,6 +29,7 @@ private Q_SLOTS:
     void password();
     void selectionAndClipboard();
     void search();
+    void pinchDragPinch();
 
 public:
     enum NavigationAction {
@@ -355,5 +357,78 @@ void tst_MultiPageView::search()
     QVERIFY(movements > 4);
 }
 
+void tst_MultiPageView::pinchDragPinch()
+{
+    qputenv("QML_NO_TOUCH_COMPRESSION", "1");
+    QQuickView window;
+    QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+    QQuickItem *pdfView = window.rootObject();
+    QVERIFY(pdfView);
+    pdfView->setProperty("source", testFileUrl("bookmarksAndLinks.pdf"));
+    QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+    QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
+    QVERIFY(table);
+    QQuickItem *firstPage = tableViewItemAtCell(table, 0, 0);
+    QVERIFY(firstPage);
+    QQuickItem *paper = firstPage->childAt(10, 10);
+    QVERIFY(paper);
+    QQuickPdfPageImage *image = firstPage->findChild<QQuickPdfPageImage *>();
+    QVERIFY(image);
+
+    auto pinch = [&window, paper, this]() {
+        const int threshold = QGuiApplication::styleHints()->startDragDistance();
+        const int movement = 100;
+        QCOMPARE_GT(movement, threshold);
+        const qreal initialScale = paper->scale();
+        QPoint p0(100, 200);
+        QPoint p1(200, 200);
+        QTest::QTouchEventSequence seq = QTest::touchEvent(&window, touchscreen.get());
+        seq.press(0, p0, &window).commit();
+        seq.stationary(0).press(1, p1, &window).commit();
+        p1.setX(p1.x() + movement);
+        QSignalSpy frameSwappedSpy(&window, &QQuickWindow::frameSwapped);
+        seq.stationary(0).move(1, p1, &window).commit();
+        // after a frame is rendered, the PinchHandler ought to be active
+        // (but verifying it would require private API)
+        QTRY_VERIFY(frameSwappedSpy.size() > 0);
+        QTRY_COMPARE(paper->scale(), initialScale);
+
+        for (int i = 1; i <= 2; ++i) {
+            p1.setX(p1.x() + movement);
+            seq.stationary(0).move(1, p1, &window).commit();
+            QTRY_COMPARE(paper->scale(), initialScale + i * 0.5);
+        }
+        seq.release(0, p0, &window).release(1, p1, &window).commit();
+    };
+
+    auto drag = [&window, table, this]() {
+        const int movement = 100;
+        QPoint p0(200, 200);
+        QTest::QTouchEventSequence seq = QTest::touchEvent(&window, touchscreen.get());
+        seq.press(0, p0, &window).commit();
+        p0.setY(p0.y() + movement);
+        seq.move(0, p0, &window).commit();
+        p0.setY(p0.y() + movement);
+        seq.move(0, p0, &window).commit();
+        seq.release(0, p0, &window).commit();
+        QTRY_COMPARE(table->property("moving"), false);
+    };
+
+    pinch();
+    qCDebug(lcTests) << "new scale" << pdfView->property("renderScale").toReal();
+    QTRY_COMPARE(pdfView->property("renderScale").toReal(), 2);
+
+    drag();
+    QCOMPARE(pdfView->property("renderScale").toReal(), 2);
+
+    pinch();
+    qCDebug(lcTests) << "new scale" << pdfView->property("renderScale").toReal();
+    QTRY_COMPARE(pdfView->property("renderScale").toReal(), 4);
+
+    // wait for rendering to be done before we exit: if we delete the document
+    // prematurely, QPdfIOHandler might access a dangling pointer
+    QTRY_COMPARE(image->status(), QQuickPdfPageImage::Ready);
+}
+
 QTEST_MAIN(tst_MultiPageView)
 #include "tst_multipageview.moc"

From 7b65afccc97194da47736141560a6fb6e38bba96 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 23 Jan 2024 13:21:08 -0700
Subject: [PATCH 625/681] Delay PdfMultiPageView.goTo[Page|Location] if called
 too early

PdfMultiPageView does not expose a property alias to TableView.rows;
we could call it pageCount, but we don't want to mislead users into
thinking that the view is the "source of truth" for how many pages
it's going to show. The document's pageCount is populated earlier,
and that's a problem only in such a case when it's too early to ask
the view to go to a particular page. So we work around it in the
view by treating these goTo functions as requests to be satisfied
as soon as it becomes possible.

Fixes: QTBUG-119416
Pick-to: 6.5
Change-Id: Ie2377fe6f2983b72e871b1be2afe4d0878f60841
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e9a5b6e514996c059d52a857a5aef624afb80a0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d63c4dacd2b4ffa2608965ed7e49303b75c722ad)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
 src/pdfquick/PdfMultiPageView.qml             | 22 +++++++++++++++++++
 .../data/jumpOnDocumentReady.qml              | 18 +++++++++++++++
 .../multipageview/tst_multipageview.cpp       | 12 ++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml

diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
index 84c3e31812b..cfc19c28ba8 100644
--- a/src/pdfquick/PdfMultiPageView.qml
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -159,6 +159,13 @@ Item {
         \sa PdfPageNavigator::jump(), currentPage
     */
     function goToLocation(page, location, zoom) {
+        if (tableView.rows === 0) {
+            // save this request for later
+            tableView.pendingRow = page
+            tableView.pendingLocation = location
+            tableView.pendingZoom = zoom
+            return
+        }
         if (zoom > 0) {
             pageNavigator.jumping = true // don't call pageNavigator.update() because we will jump() instead
             root.renderScale = zoom
@@ -309,6 +316,21 @@ Item {
         property real pageHolderWidth: Math.max(root.width, ((rot90 ? document?.maxPageHeight : document?.maxPageWidth) ?? 0) * root.renderScale)
         columnWidthProvider: function(col) { return document ? pageHolderWidth + vscroll.width + 2 : 0 }
         rowHeightProvider: function(row) { return (rot90 ? document.pagePointSize(row).width : document.pagePointSize(row).height) * root.renderScale }
+
+        // delayed-jump feature in case the user called goToPage() or goToLocation() too early
+        property int pendingRow: -1
+        property point pendingLocation
+        property real pendingZoom: -1
+        onRowsChanged: {
+            if (rows > 0 && tableView.pendingRow >= 0) {
+                console.log(lcMPV, "initiating delayed jump to page", tableView.pendingRow, "loc", tableView.pendingLocation, "zoom", tableView.pendingZoom)
+                root.goToLocation(tableView.pendingRow, tableView.pendingLocation, tableView.pendingZoom)
+                tableView.pendingRow = -1
+                tableView.pendingLocation = Qt.point(-1, -1)
+                tableView.pendingZoom = -1
+            }
+        }
+
         delegate: Rectangle {
             id: pageHolder
             color: tableView.debug ? "beige" : "transparent"
diff --git a/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml b/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml
new file mode 100644
index 00000000000..ce74f5ed82c
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml
@@ -0,0 +1,18 @@
+import QtQuick
+import QtQuick.Pdf
+
+PdfMultiPageView {
+    id: view
+    width: 480
+    height: 480
+
+    document: PdfDocument {
+        id: document
+        onStatusChanged: {
+            if(status === PdfDocument.Ready)
+                view.goToPage(2)
+        }
+    }
+
+    Component.onCompleted: document.source = "bookmarksAndLinks.pdf"
+}
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index 9067fdbe3af..b64cd47b1b2 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -30,6 +30,7 @@ private Q_SLOTS:
     void selectionAndClipboard();
     void search();
     void pinchDragPinch();
+    void jumpOnDocumentReady();
 
 public:
     enum NavigationAction {
@@ -430,5 +431,16 @@ void tst_MultiPageView::pinchDragPinch()
     QTRY_COMPARE(image->status(), QQuickPdfPageImage::Ready);
 }
 
+void tst_MultiPageView::jumpOnDocumentReady() // QTBUG-119416
+{
+    QQuickView window;
+    QVERIFY(showView(window, testFileUrl("jumpOnDocumentReady.qml")));
+    QQuickItem *pdfView = window.rootObject();
+    QVERIFY(pdfView);
+
+    // QML calls view.goToPage(2): verify that it eventually happens
+    QTRY_COMPARE(pdfView->property("currentPage").toInt(), 2);
+}
+
 QTEST_MAIN(tst_MultiPageView)
 #include "tst_multipageview.moc"

From db59042dc7350eae6708a57fcef94068a2dfda79 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 25 Jul 2023 15:44:50 +0200
Subject: [PATCH 626/681] Fix discontinuity with successive pinch-zoom in
 PdfMultiPageView

pinch.persistentScale is settable since 6.5 (qtdeclarative
a432970b258edb9ff041d221b2155df30cad4799): we need that to tell
PinchHandler to start over from 1 after we have also set the rendered
scale back to 1, because PinchHandler does not read the scale property
for itself.

This cherry-pick includes 48ebac59b1ec5bbafa1c64adbdbc44b0cf3f302a
to avoid a crash on exit by waiting for the rendering to be done, and
a4e64baef027fb407b8c1491c444ed58edd15529 to disable touch compression.

Fixes: QTBUG-115502
Task-number: QTBUG-120245
Task-number: QTBUG-121502
Fixes: QTBUG-121564
Change-Id: I21951c447bf33e5942b6a1635488d5474ec8f293
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c0524da14d92a957b4607fb5867dba5d23eea6d9)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 8c27ae33f80440d20f578fa404c454c8d7bfdf19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e3af0e8ae86151214a1e285c7f3bd7d24efbdd35)
---
 src/pdfquick/PdfMultiPageView.qml             |  6 +-
 .../multipageview/tst_multipageview.cpp       | 75 +++++++++++++++++++
 2 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
index 10683f55dee..84c3e31812b 100644
--- a/src/pdfquick/PdfMultiPageView.qml
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -408,12 +408,16 @@ Item {
                             const centroidInFlickable = tableView.mapFromItem(paper, pinch.centroid.position.x, pinch.centroid.position.y)
                             const newSourceWidth = image.sourceSize.width * paper.scale
                             const ratio = newSourceWidth / image.sourceSize.width
-                            console.log(lcMPV, "pinch ended on page", index, "with centroid", pinch.centroid.position, centroidInPoints, "wrt flickable", centroidInFlickable,
+                            console.log(lcMPV, "pinch ended on page", index,
+                                        "with scale", paper.scale.toFixed(3), "ratio", ratio.toFixed(3),
+                                        "centroid", pinch.centroid.position, centroidInPoints,
+                                        "wrt flickable", centroidInFlickable,
                                         "page at", pageHolder.x.toFixed(2), pageHolder.y.toFixed(2),
                                         "contentX/Y were", tableView.contentX.toFixed(2), tableView.contentY.toFixed(2))
                             if (ratio > 1.1 || ratio < 0.9) {
                                 const centroidOnPage = Qt.point(centroidInPoints.x * root.renderScale * ratio, centroidInPoints.y * root.renderScale * ratio)
                                 paper.scale = 1
+                                pinch.persistentScale = 1
                                 paper.x = 0
                                 paper.y = 0
                                 root.renderScale *= ratio
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index 9cd8e3e2d8b..9067fdbe3af 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -6,6 +6,7 @@
 #include <QtCore/QLoggingCategory>
 #include <QtGui/QClipboard>
 #include <QtGui/QPointingDevice>
+#include <QtGui/QStyleHints>
 #include <QtQuick/QQuickView>
 #include <QtPdfQuick/private/qquickpdflinkmodel_p.h>
 #include <QtPdfQuick/private/qquickpdfsearchmodel_p.h>
@@ -28,6 +29,7 @@ private Q_SLOTS:
     void password();
     void selectionAndClipboard();
     void search();
+    void pinchDragPinch();
 
 public:
     enum NavigationAction {
@@ -355,5 +357,78 @@ void tst_MultiPageView::search()
     QVERIFY(movements > 4);
 }
 
+void tst_MultiPageView::pinchDragPinch()
+{
+    qputenv("QML_NO_TOUCH_COMPRESSION", "1");
+    QQuickView window;
+    QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+    QQuickItem *pdfView = window.rootObject();
+    QVERIFY(pdfView);
+    pdfView->setProperty("source", testFileUrl("bookmarksAndLinks.pdf"));
+    QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+    QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
+    QVERIFY(table);
+    QQuickItem *firstPage = tableViewItemAtCell(table, 0, 0);
+    QVERIFY(firstPage);
+    QQuickItem *paper = firstPage->childAt(10, 10);
+    QVERIFY(paper);
+    QQuickPdfPageImage *image = firstPage->findChild<QQuickPdfPageImage *>();
+    QVERIFY(image);
+
+    auto pinch = [&window, paper, this]() {
+        const int threshold = QGuiApplication::styleHints()->startDragDistance();
+        const int movement = 100;
+        QCOMPARE_GT(movement, threshold);
+        const qreal initialScale = paper->scale();
+        QPoint p0(100, 200);
+        QPoint p1(200, 200);
+        QTest::QTouchEventSequence seq = QTest::touchEvent(&window, touchscreen.get());
+        seq.press(0, p0, &window).commit();
+        seq.stationary(0).press(1, p1, &window).commit();
+        p1.setX(p1.x() + movement);
+        QSignalSpy frameSwappedSpy(&window, &QQuickWindow::frameSwapped);
+        seq.stationary(0).move(1, p1, &window).commit();
+        // after a frame is rendered, the PinchHandler ought to be active
+        // (but verifying it would require private API)
+        QTRY_VERIFY(frameSwappedSpy.size() > 0);
+        QTRY_COMPARE(paper->scale(), initialScale);
+
+        for (int i = 1; i <= 2; ++i) {
+            p1.setX(p1.x() + movement);
+            seq.stationary(0).move(1, p1, &window).commit();
+            QTRY_COMPARE(paper->scale(), initialScale + i * 0.5);
+        }
+        seq.release(0, p0, &window).release(1, p1, &window).commit();
+    };
+
+    auto drag = [&window, table, this]() {
+        const int movement = 100;
+        QPoint p0(200, 200);
+        QTest::QTouchEventSequence seq = QTest::touchEvent(&window, touchscreen.get());
+        seq.press(0, p0, &window).commit();
+        p0.setY(p0.y() + movement);
+        seq.move(0, p0, &window).commit();
+        p0.setY(p0.y() + movement);
+        seq.move(0, p0, &window).commit();
+        seq.release(0, p0, &window).commit();
+        QTRY_COMPARE(table->property("moving"), false);
+    };
+
+    pinch();
+    qCDebug(lcTests) << "new scale" << pdfView->property("renderScale").toReal();
+    QTRY_COMPARE(pdfView->property("renderScale").toReal(), 2);
+
+    drag();
+    QCOMPARE(pdfView->property("renderScale").toReal(), 2);
+
+    pinch();
+    qCDebug(lcTests) << "new scale" << pdfView->property("renderScale").toReal();
+    QTRY_COMPARE(pdfView->property("renderScale").toReal(), 4);
+
+    // wait for rendering to be done before we exit: if we delete the document
+    // prematurely, QPdfIOHandler might access a dangling pointer
+    QTRY_COMPARE(image->status(), QQuickPdfPageImage::Ready);
+}
+
 QTEST_MAIN(tst_MultiPageView)
 #include "tst_multipageview.moc"

From 9de2fddc1d834c2d40306afb97806706f4de389f Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 17 Jan 2024 15:37:29 -0700
Subject: [PATCH 627/681] Fix high-dpi scaling in PdfScrollablePageView

Amends 85f82185ef5102a2dbe3b2e437b9723e1652ce57

In PdfScrollablePageView.qml, a property like

  property size pagePointSize: document.pagePointSize(pageNavigator.currentPage)

would get evaluated too early (QPdfDocument::pagePointSize() returns a
default-constructed QSize if d->doc is still null). We need to call
pagePointSize() directly in bindings that need it, so that the function
will be called again each time some other binding dependency changes,
to get the size of the current page in the current document. Perhaps
a binding to the result of a function call does not get invalidated
when the function argument changes; or perhaps behavior changed now
that the QML files tend to be compiled rather than runtime-interpreted
resources.

We also need PdfPageImage's width and height to be bound (as they are in
PdfMultiPageView.qml), to avoid automatically scaling up to sourceSize.

So now we get high-dpi page images again in the single-page example.

Task-number: QTBUG-86948
Change-Id: I44e8df15c18bd0b752dccc899028e7e7900f6ffb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3093ddfa8fb22db9295bc76a07207e6da0a3e995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bb514314f924e7f94ac48f4d2283a254cff4cd83)
(cherry picked from commit 44661cfecf510295bf619ebebcc785cf97a92b36)
---
 src/pdfquick/PdfScrollablePageView.qml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/pdfquick/PdfScrollablePageView.qml b/src/pdfquick/PdfScrollablePageView.qml
index 5295db7f8c5..afebdd080a6 100644
--- a/src/pdfquick/PdfScrollablePageView.qml
+++ b/src/pdfquick/PdfScrollablePageView.qml
@@ -302,9 +302,6 @@ Flickable {
     }
 
     onRenderScaleChanged: {
-        image.sourceSize.width = document.pagePointSize(pageNavigator.currentPage).width *
-                renderScale * Screen.devicePixelRatio
-        image.sourceSize.height = 0
         paper.scale = 1
         const currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
                                          (root.contentY + root.height / 2) / root.renderScale)
@@ -365,6 +362,10 @@ Flickable {
             rotation: root.pageRotation
             anchors.centerIn: parent
             property real pageScale: image.paintedWidth / document.pagePointSize(pageNavigator.currentPage).width
+            width: document.pagePointSize(pageNavigator.currentPage).width * root.renderScale
+            height: document.pagePointSize(pageNavigator.currentPage).height * root.renderScale
+            sourceSize.width: width * Screen.devicePixelRatio
+            sourceSize.height: 0
 
             Shape {
                 anchors.fill: parent

From b2f230cb04a4b440dcaa156052adab69dbc0f9b1 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 29 Dec 2023 12:54:32 -0700
Subject: [PATCH 628/681] PDF Quick examples: select text in search field when
 pressing Ctrl-F

It's better for usability in case the user is doing repeated searches:
press control-F and start typing to search for different text, rather
than needing to do something else to select or delete the existing
text in the search field.

Fixes: QTBUG-120447
Pick-to: 6.2
Change-Id: I8d5a519a631c406dff91198b23a022856609fa4c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 140edbd6c887c0ae26a054d8c859041c68f06fd7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 274fb4698fa06cf513ce48b71a4f59d3e1608a3c)
(cherry picked from commit d9cf674ed9fe682d4b3bec8eff81e381c7251d68)
---
 examples/pdf/multipage/viewer.qml | 5 ++++-
 examples/pdf/pdfviewer/viewer.qml | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index d0b0a726354..9a3ca6bad4a 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -127,7 +127,10 @@ ApplicationWindow {
             }
             Shortcut {
                 sequence: StandardKey.Find
-                onActivated: searchField.forceActiveFocus()
+                onActivated: {
+                    searchField.forceActiveFocus()
+                    searchField.selectAll()
+                }
             }
             Shortcut {
                 sequence: StandardKey.Quit
diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml
index a6203516627..1745b70d94d 100644
--- a/examples/pdf/pdfviewer/viewer.qml
+++ b/examples/pdf/pdfviewer/viewer.qml
@@ -129,7 +129,10 @@ ApplicationWindow {
             }
             Shortcut {
                 sequence: StandardKey.Find
-                onActivated: searchField.forceActiveFocus()
+                onActivated: {
+                    searchField.forceActiveFocus()
+                    searchField.selectAll()
+                }
             }
             Shortcut {
                 sequence: StandardKey.Quit

From 913f49b81731ded2633ed661cc842c401790d2d9 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Thu, 4 Jan 2024 11:06:22 -0700
Subject: [PATCH 629/681] QQuickPdfPageImage::load(): fall back to base class
 impl to avoid crash

Plain Image is ok for loading one PDF page at a time, except that the
pdf plugin has to create its own PDF document object if it cannot reuse
an instance that is already open. So PdfPageImage was created just as an
optimization, with the expectation that the document will be given to
the document property. But in case someone doesn't understand and tries
to set only the inherited Image.source property instead, fall back to
QQuickImageBase::load() to avoid crashing. Amends
7b8832ca2b84d549c9d374550c3c46b3d4d42a38

If both the document and source properties are set, prefer the document
(for the sake of performance).

Add test coverage of other combinations of properties, while we're at it.

Fixes: QTBUG-104767
Task-number: QTBUG-77506
Change-Id: I1ee0d0bb2a6c5f399234ddddd969be02e7a6c020
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b60c00f4adec9ea4b75af0226b04a7125e166ae2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2180ce8901ac1caddf5b7b5cd73ba67d2d08349a)
(cherry picked from commit 6ba530da27a7359d7d39b36d0792a7d929d5b274)
---
 src/pdfquick/qquickpdfpageimage.cpp           |  14 +-
 tests/auto/pdfquick/CMakeLists.txt            |   1 +
 .../auto/pdfquick/pdfpageimage/CMakeLists.txt |  30 ++++
 .../pdfpageimage/data/bookmarksAndLinks.pdf   | Bin 0 -> 4259 bytes
 .../pdfpageimage/data/pdfPageImage.qml        |  16 +++
 .../pdfpageimage/tst_pdfpageimage.cpp         | 131 ++++++++++++++++++
 6 files changed, 191 insertions(+), 1 deletion(-)
 create mode 100644 tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
 create mode 100644 tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf
 create mode 100644 tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
 create mode 100644 tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp

diff --git a/src/pdfquick/qquickpdfpageimage.cpp b/src/pdfquick/qquickpdfpageimage.cpp
index 2ea8ebc12ca..f2da067f1b5 100644
--- a/src/pdfquick/qquickpdfpageimage.cpp
+++ b/src/pdfquick/qquickpdfpageimage.cpp
@@ -76,6 +76,18 @@ QQuickPdfDocument *QQuickPdfPageImage::document() const
 void QQuickPdfPageImage::load()
 {
     Q_D(QQuickPdfPageImage);
+    QUrl url = source();
+    if (!d->doc || !d->doc->carrierFile()) {
+        if (!url.isEmpty()) {
+            qmlWarning(this) << "document property not set: falling back to inefficient loading of " << url;
+            QQuickImageBase::load();
+        }
+        return;
+    }
+    if (url != d->doc->resolvedSource()) {
+        url = d->doc->resolvedSource();
+        qmlWarning(this) << "document and source properties in conflict: preferring document source " << url;
+    }
     auto carrierFile = d->doc->carrierFile();
     static int thisRequestProgress = -1;
     static int thisRequestFinished = -1;
@@ -86,7 +98,7 @@ void QQuickPdfPageImage::load()
             QQuickImageBase::staticMetaObject.indexOfSlot("requestFinished()");
     }
 
-    d->pix.loadImageFromDevice(qmlEngine(this), carrierFile, d->url,
+    d->pix.loadImageFromDevice(qmlEngine(this), carrierFile, url,
                                d->sourceClipRect.toRect(), d->sourcesize * d->devicePixelRatio,
                                QQuickImageProviderOptions(), d->currentFrame, d->frameCount);
 
diff --git a/tests/auto/pdfquick/CMakeLists.txt b/tests/auto/pdfquick/CMakeLists.txt
index 9f79459b2be..e6a3a460c32 100644
--- a/tests/auto/pdfquick/CMakeLists.txt
+++ b/tests/auto/pdfquick/CMakeLists.txt
@@ -1 +1,2 @@
 add_subdirectory(multipageview)
+add_subdirectory(pdfpageimage)
diff --git a/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt b/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
new file mode 100644
index 00000000000..da67d872100
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Collect test data
+file(GLOB_RECURSE test_data_glob
+    RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+    data/*)
+list(APPEND test_data ${test_data_glob})
+
+qt_internal_add_test(tst_pdfpageimage
+    SOURCES
+        tst_pdfpageimage.cpp
+        ../shared/util.cpp ../shared/util.h
+    LIBRARIES
+        Qt::Gui
+        Qt::Quick
+        Qt::PdfQuickPrivate
+    TESTDATA ${test_data}
+)
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(tst_pdfpageimage CONDITION ANDROID OR IOS
+    DEFINES
+        QT_QMLTEST_DATADIR=":/data"
+)
+
+qt_internal_extend_target(tst_pdfpageimage CONDITION NOT ANDROID AND NOT IOS
+    DEFINES
+        QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
+)
+
diff --git a/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf b/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..aa0b9903982736fe617267c0843c8ec977dc0c6b
GIT binary patch
diff --git a/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml b/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
new file mode 100644
index 00000000000..a268bf14b96
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
@@ -0,0 +1,16 @@
+import QtQuick
+import QtQuick.Pdf
+
+Item {
+    width: 320
+    height: 320
+
+    PdfDocument {
+        id: doc
+        source: "bookmarksAndLinks.pdf"
+    }
+
+    PdfPageImage {
+        anchors.centerIn: parent
+    }
+}
diff --git a/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp b/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp
new file mode 100644
index 00000000000..d2c9c8709f6
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp
@@ -0,0 +1,131 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QRegularExpression>
+#include <QSignalSpy>
+#include <QTest>
+#include <QtQuick/QQuickView>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+#include <QtPdfQuick/private/qquickpdfpageimage_p.h>
+#include "../shared/util.h"
+
+using namespace Qt::StringLiterals;
+
+Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests")
+
+// #define DEBUG_WRITE_OUTPUT
+
+class tst_PdfPageImage : public QQuickDataTest
+{
+    Q_OBJECT
+
+private Q_SLOTS:
+    void settableProperties_data();
+    void settableProperties();
+
+public:
+    enum Property {
+        Source = 0x01,
+        Document = 0x02,
+        SourceSize = 0x04,
+        SourceClipRect = 0x08,
+        MipMap = 0x10,
+        AutoTransform = 0x20,
+        Asynchronous = 0x40,
+        NoCache = 0x80,
+        Mirror = 0x100,
+        MirrorVertically = 0x200,
+        ColorSpace = 0x400,
+    };
+    Q_DECLARE_FLAGS(Properties, Property)
+    Q_FLAG(Properties)
+
+private:
+#ifdef DEBUG_WRITE_OUTPUT
+    QTemporaryDir m_tmpDir;
+#endif
+};
+
+void tst_PdfPageImage::settableProperties_data()
+{
+    QTest::addColumn<tst_PdfPageImage::Properties>("toSet");
+    QTest::addColumn<QSize>("expectedSize");
+    QTest::addColumn<QRegularExpression>("expectedWarning");
+
+    const QRegularExpression NoWarning;
+    const qreal dpr = qGuiApp->devicePixelRatio();
+
+    QTest::newRow("source") << Properties(Source) << (QSizeF(600, 790) * dpr).toSize()
+        << QRegularExpression("document property not set: falling back to inefficient loading"); // QTBUG-104767
+    QTest::newRow("document") << Properties(Document) << QSize(600, 790) << NoWarning;
+    QTest::newRow("source and document") << Properties(Source | Document) << QSize(600, 790)
+        << QRegularExpression("document and source properties in conflict");
+    QTest::newRow("document and sourceSize") << Properties(Document | SourceSize) << QSize(100, 100) << NoWarning;
+    QTest::newRow("document and sourceClipRect") << Properties(Document | SourceClipRect) << QSize(100, 100) << NoWarning;
+    QTest::newRow("document and autoTransform") << Properties(Document | AutoTransform) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and async") << Properties(Document | Asynchronous) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and nocache") << Properties(Document | NoCache) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and mirror") << Properties(Document | Mirror) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and mirrorVertically") << Properties(Document | MirrorVertically) << QSize(600, 790) << NoWarning;
+    QTest::newRow("document and colorSpace") << Properties(Document | ColorSpace) << QSize(600, 790) << NoWarning;
+}
+
+void tst_PdfPageImage::settableProperties()
+{
+    QFETCH(tst_PdfPageImage::Properties, toSet);
+    QFETCH(QSize, expectedSize);
+    QFETCH(QRegularExpression, expectedWarning);
+
+    QQuickView window;
+    if (!expectedWarning.pattern().isEmpty())
+        QTest::ignoreMessage(QtWarningMsg, expectedWarning);
+    QVERIFY(showView(window, testFileUrl("pdfPageImage.qml")));
+    QQuickPdfPageImage *pdfImage = window.rootObject()->findChild<QQuickPdfPageImage *>();
+    QVERIFY(pdfImage);
+    QQuickPdfDocument *doc = window.rootObject()->findChild<QQuickPdfDocument *>();
+    QVERIFY(doc);
+    if (toSet.testFlag(Document))
+        pdfImage->setDocument(doc);
+    if (toSet.testFlag(Source))
+        pdfImage->setSource(doc->source());
+    if (toSet.testFlag(SourceSize))
+        pdfImage->setSourceSize({100, 100});
+    if (toSet.testFlag(SourceClipRect))
+        pdfImage->setSourceClipRect({100, 100, 100, 100});
+    if (toSet.testFlag(MipMap))
+        pdfImage->setMipmap(true);
+    if (toSet.testFlag(AutoTransform))
+        pdfImage->setAutoTransform(true);
+    if (toSet.testFlag(Asynchronous)) {
+        QCOMPARE(pdfImage->asynchronous(), false);
+        // test the opposite of the default
+        pdfImage->setAsynchronous(true);
+    }
+    if (toSet.testFlag(NoCache)) {
+        QCOMPARE(pdfImage->cache(), true);
+        // test the opposite of the default
+        pdfImage->setCache(false);
+    }
+    if (toSet.testFlag(Mirror)) {
+        QCOMPARE(pdfImage->mirror(), false);
+        pdfImage->setMirror(true);
+    }
+    if (toSet.testFlag(MirrorVertically)) {
+        QCOMPARE(pdfImage->mirrorVertically(), false);
+        pdfImage->setMirrorVertically(true);
+    }
+    if (toSet.testFlag(ColorSpace))
+        pdfImage->setColorSpace(QColorSpace::ProPhotoRgb);
+    QTRY_COMPARE(pdfImage->status(), QQuickPdfPageImage::Ready);
+    const QImage img = pdfImage->image();
+    QCOMPARE(img.size(), expectedSize);
+#ifdef DEBUG_WRITE_OUTPUT
+    m_tmpDir.setAutoRemove(false);
+    const auto path = m_tmpDir.filePath(QString::fromLocal8Bit(QTest::currentDataTag()) + ".png");
+    qCDebug(lcTests) << "saving to" << path;
+    img.save(path);
+#endif
+}
+
+QTEST_MAIN(tst_PdfPageImage)
+#include "tst_pdfpageimage.moc"

From a98f34f8105b9d3390e5f2a3973a0b482d799b33 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 23 Jan 2024 13:21:08 -0700
Subject: [PATCH 630/681] Delay PdfMultiPageView.goTo[Page|Location] if called
 too early

PdfMultiPageView does not expose a property alias to TableView.rows;
we could call it pageCount, but we don't want to mislead users into
thinking that the view is the "source of truth" for how many pages
it's going to show. The document's pageCount is populated earlier,
and that's a problem only in such a case when it's too early to ask
the view to go to a particular page. So we work around it in the
view by treating these goTo functions as requests to be satisfied
as soon as it becomes possible.

Fixes: QTBUG-119416
Change-Id: Ie2377fe6f2983b72e871b1be2afe4d0878f60841
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e9a5b6e514996c059d52a857a5aef624afb80a0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d63c4dacd2b4ffa2608965ed7e49303b75c722ad)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 7b65afccc97194da47736141560a6fb6e38bba96)
---
 src/pdfquick/PdfMultiPageView.qml             | 22 +++++++++++++++++++
 .../data/jumpOnDocumentReady.qml              | 18 +++++++++++++++
 .../multipageview/tst_multipageview.cpp       | 12 ++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml

diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
index 84c3e31812b..cfc19c28ba8 100644
--- a/src/pdfquick/PdfMultiPageView.qml
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -159,6 +159,13 @@ Item {
         \sa PdfPageNavigator::jump(), currentPage
     */
     function goToLocation(page, location, zoom) {
+        if (tableView.rows === 0) {
+            // save this request for later
+            tableView.pendingRow = page
+            tableView.pendingLocation = location
+            tableView.pendingZoom = zoom
+            return
+        }
         if (zoom > 0) {
             pageNavigator.jumping = true // don't call pageNavigator.update() because we will jump() instead
             root.renderScale = zoom
@@ -309,6 +316,21 @@ Item {
         property real pageHolderWidth: Math.max(root.width, ((rot90 ? document?.maxPageHeight : document?.maxPageWidth) ?? 0) * root.renderScale)
         columnWidthProvider: function(col) { return document ? pageHolderWidth + vscroll.width + 2 : 0 }
         rowHeightProvider: function(row) { return (rot90 ? document.pagePointSize(row).width : document.pagePointSize(row).height) * root.renderScale }
+
+        // delayed-jump feature in case the user called goToPage() or goToLocation() too early
+        property int pendingRow: -1
+        property point pendingLocation
+        property real pendingZoom: -1
+        onRowsChanged: {
+            if (rows > 0 && tableView.pendingRow >= 0) {
+                console.log(lcMPV, "initiating delayed jump to page", tableView.pendingRow, "loc", tableView.pendingLocation, "zoom", tableView.pendingZoom)
+                root.goToLocation(tableView.pendingRow, tableView.pendingLocation, tableView.pendingZoom)
+                tableView.pendingRow = -1
+                tableView.pendingLocation = Qt.point(-1, -1)
+                tableView.pendingZoom = -1
+            }
+        }
+
         delegate: Rectangle {
             id: pageHolder
             color: tableView.debug ? "beige" : "transparent"
diff --git a/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml b/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml
new file mode 100644
index 00000000000..ce74f5ed82c
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml
@@ -0,0 +1,18 @@
+import QtQuick
+import QtQuick.Pdf
+
+PdfMultiPageView {
+    id: view
+    width: 480
+    height: 480
+
+    document: PdfDocument {
+        id: document
+        onStatusChanged: {
+            if(status === PdfDocument.Ready)
+                view.goToPage(2)
+        }
+    }
+
+    Component.onCompleted: document.source = "bookmarksAndLinks.pdf"
+}
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index 9067fdbe3af..b64cd47b1b2 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -30,6 +30,7 @@ private Q_SLOTS:
     void selectionAndClipboard();
     void search();
     void pinchDragPinch();
+    void jumpOnDocumentReady();
 
 public:
     enum NavigationAction {
@@ -430,5 +431,16 @@ void tst_MultiPageView::pinchDragPinch()
     QTRY_COMPARE(image->status(), QQuickPdfPageImage::Ready);
 }
 
+void tst_MultiPageView::jumpOnDocumentReady() // QTBUG-119416
+{
+    QQuickView window;
+    QVERIFY(showView(window, testFileUrl("jumpOnDocumentReady.qml")));
+    QQuickItem *pdfView = window.rootObject();
+    QVERIFY(pdfView);
+
+    // QML calls view.goToPage(2): verify that it eventually happens
+    QTRY_COMPARE(pdfView->property("currentPage").toInt(), 2);
+}
+
 QTEST_MAIN(tst_MultiPageView)
 #include "tst_multipageview.moc"

From d2a8584340c01a94a93b40f8fa27a57a4aa6350b Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Tue, 23 Jan 2024 08:24:05 +0200
Subject: [PATCH 631/681] Bump version to 6.6.3

Change-Id: Ie66e22f3fecc4b9dbf53e181a97699ee99a59c04
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index 4b327f94834..38ee7e9846f 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,4 +1,4 @@
-set(QT_REPO_MODULE_VERSION "6.6.2")
+set(QT_REPO_MODULE_VERSION "6.6.3")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")
 set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")

From 5ed8d711773fed1c4ae9c541e755d0e68455d9eb Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 29 Jan 2024 11:46:19 +0000
Subject: [PATCH 632/681] Update dependencies on '6.6' in qt/qtwebengine

Change-Id: Idb38d9a59c7ea3dc3a293e75a642b2a32e666308
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 41bb052cdf6..55fcaa07585 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../qtdeclarative:
-    ref: 3397d18191a21d284462aade8df0764de65d9dda
+    ref: 85e308885d568364b76a600c532243027c3366e8
     required: true
   ../qtpositioning:
-    ref: 19ac00b9cb08ba9787b5130ec8baef40dd62d811
+    ref: 3c5d7021f218180ac3c5d96a618990ccc31de7c9
     required: false
   ../qttools:
-    ref: 40eb7aa14a68a9393dcacd971464689b5073f4a4
+    ref: 4be03918a2cd32a0341a69b2c7b4ae2f6467d4e3
     required: false
   ../qtwebchannel:
-    ref: 07c396efb1d29ad61d86aab3d82cd6f4d95cd5e7
+    ref: d66aa92a1dd24fe5d4a3202ebf4cf9efbcb852c8
     required: false

From b61e8a3d75aae1c08fd54ca3a613084446cb59de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 19 Dec 2023 12:38:08 +0100
Subject: [PATCH 633/681] Correct PrintedPageSizeId to match
 QPageSize::PageSizeId

With Qt 6, QPageSize::PageSizeId enum was cleaned up and some values
were reordered, but the WebEngineQuick part was not changed accordingly.

Fixes: QTBUG-120218
Change-Id: I7e4c419750d30a64193e68b0b217ebbccce07d87
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 199730bd41219c5484fb1c4c61b637ab9ceec0c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8f017c2d9d015b9d72a7f1f36e53747bad6c3bfa)
(cherry picked from commit 213a569e99488755b398b487bd7f2c2883451b65)
---
 .../api/qquickwebengineview.cpp               | 128 ++++++++++++++++++
 .../api/qquickwebengineview_p.h               |  12 +-
 .../doc/src/webengineview_lgpl.qdoc           |   2 -
 tests/auto/quick/publicapi/tst_publicapi.cpp  |   6 +-
 4 files changed, 135 insertions(+), 13 deletions(-)

diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
index cd73749c9c8..367cff58786 100644
--- a/src/webenginequick/api/qquickwebengineview.cpp
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -108,6 +108,134 @@ Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LoadSucceededStatus) == st
 QT_WARNING_POP
 #endif
 
+#if QT_CONFIG(webengine_printing_and_pdf)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Letter, QQuickWebEngineView::PrintedPageSizeId::Letter)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Legal, QQuickWebEngineView::PrintedPageSizeId::Legal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Executive, QQuickWebEngineView::PrintedPageSizeId::Executive)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A0, QQuickWebEngineView::PrintedPageSizeId::A0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A1, QQuickWebEngineView::PrintedPageSizeId::A1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A2, QQuickWebEngineView::PrintedPageSizeId::A2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A3, QQuickWebEngineView::PrintedPageSizeId::A3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4, QQuickWebEngineView::PrintedPageSizeId::A4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A5, QQuickWebEngineView::PrintedPageSizeId::A5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A6, QQuickWebEngineView::PrintedPageSizeId::A6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A7, QQuickWebEngineView::PrintedPageSizeId::A7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A8, QQuickWebEngineView::PrintedPageSizeId::A8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A9, QQuickWebEngineView::PrintedPageSizeId::A9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A10, QQuickWebEngineView::PrintedPageSizeId::A10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B0, QQuickWebEngineView::PrintedPageSizeId::B0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B1, QQuickWebEngineView::PrintedPageSizeId::B1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B2, QQuickWebEngineView::PrintedPageSizeId::B2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B3, QQuickWebEngineView::PrintedPageSizeId::B3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B4, QQuickWebEngineView::PrintedPageSizeId::B4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B5, QQuickWebEngineView::PrintedPageSizeId::B5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B6, QQuickWebEngineView::PrintedPageSizeId::B6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B7, QQuickWebEngineView::PrintedPageSizeId::B7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B8, QQuickWebEngineView::PrintedPageSizeId::B8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B9, QQuickWebEngineView::PrintedPageSizeId::B9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B10, QQuickWebEngineView::PrintedPageSizeId::B10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::C5E, QQuickWebEngineView::PrintedPageSizeId::C5E)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Comm10E, QQuickWebEngineView::PrintedPageSizeId::Comm10E)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::DLE, QQuickWebEngineView::PrintedPageSizeId::DLE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Folio, QQuickWebEngineView::PrintedPageSizeId::Folio)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Ledger, QQuickWebEngineView::PrintedPageSizeId::Ledger)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Tabloid, QQuickWebEngineView::PrintedPageSizeId::Tabloid)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Custom, QQuickWebEngineView::PrintedPageSizeId::Custom)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A3Extra, QQuickWebEngineView::PrintedPageSizeId::A3Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Extra, QQuickWebEngineView::PrintedPageSizeId::A4Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Plus, QQuickWebEngineView::PrintedPageSizeId::A4Plus)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Small, QQuickWebEngineView::PrintedPageSizeId::A4Small)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A5Extra, QQuickWebEngineView::PrintedPageSizeId::A5Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B5Extra, QQuickWebEngineView::PrintedPageSizeId::B5Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB0, QQuickWebEngineView::PrintedPageSizeId::JisB0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB1, QQuickWebEngineView::PrintedPageSizeId::JisB1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB2, QQuickWebEngineView::PrintedPageSizeId::JisB2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB3, QQuickWebEngineView::PrintedPageSizeId::JisB3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB4, QQuickWebEngineView::PrintedPageSizeId::JisB4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB5, QQuickWebEngineView::PrintedPageSizeId::JisB5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB6, QQuickWebEngineView::PrintedPageSizeId::JisB6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB7, QQuickWebEngineView::PrintedPageSizeId::JisB7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB8, QQuickWebEngineView::PrintedPageSizeId::JisB8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB9, QQuickWebEngineView::PrintedPageSizeId::JisB9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB10, QQuickWebEngineView::PrintedPageSizeId::JisB10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiC, QQuickWebEngineView::PrintedPageSizeId::AnsiC)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiD, QQuickWebEngineView::PrintedPageSizeId::AnsiD)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiE, QQuickWebEngineView::PrintedPageSizeId::AnsiE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LegalExtra, QQuickWebEngineView::PrintedPageSizeId::LegalExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterExtra, QQuickWebEngineView::PrintedPageSizeId::LetterExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterPlus, QQuickWebEngineView::PrintedPageSizeId::LetterPlus)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterSmall, QQuickWebEngineView::PrintedPageSizeId::LetterSmall)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::TabloidExtra, QQuickWebEngineView::PrintedPageSizeId::TabloidExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchA, QQuickWebEngineView::PrintedPageSizeId::ArchA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchB, QQuickWebEngineView::PrintedPageSizeId::ArchB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchC, QQuickWebEngineView::PrintedPageSizeId::ArchC)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchD, QQuickWebEngineView::PrintedPageSizeId::ArchD)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchE, QQuickWebEngineView::PrintedPageSizeId::ArchE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial7x9, QQuickWebEngineView::PrintedPageSizeId::Imperial7x9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial8x10, QQuickWebEngineView::PrintedPageSizeId::Imperial8x10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial9x11, QQuickWebEngineView::PrintedPageSizeId::Imperial9x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial9x12, QQuickWebEngineView::PrintedPageSizeId::Imperial9x12)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x11, QQuickWebEngineView::PrintedPageSizeId::Imperial10x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x13, QQuickWebEngineView::PrintedPageSizeId::Imperial10x13)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x14, QQuickWebEngineView::PrintedPageSizeId::Imperial10x14)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial12x11, QQuickWebEngineView::PrintedPageSizeId::Imperial12x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial15x11, QQuickWebEngineView::PrintedPageSizeId::Imperial15x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ExecutiveStandard, QQuickWebEngineView::PrintedPageSizeId::ExecutiveStandard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Note, QQuickWebEngineView::PrintedPageSizeId::Note)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Quarto, QQuickWebEngineView::PrintedPageSizeId::Quarto)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Statement, QQuickWebEngineView::PrintedPageSizeId::Statement)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::SuperA, QQuickWebEngineView::PrintedPageSizeId::SuperA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::SuperB, QQuickWebEngineView::PrintedPageSizeId::SuperB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Postcard, QQuickWebEngineView::PrintedPageSizeId::Postcard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::DoublePostcard, QQuickWebEngineView::PrintedPageSizeId::DoublePostcard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc16K, QQuickWebEngineView::PrintedPageSizeId::Prc16K)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc32K, QQuickWebEngineView::PrintedPageSizeId::Prc32K)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc32KBig, QQuickWebEngineView::PrintedPageSizeId::Prc32KBig)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldUS, QQuickWebEngineView::PrintedPageSizeId::FanFoldUS)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldGerman, QQuickWebEngineView::PrintedPageSizeId::FanFoldGerman)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldGermanLegal, QQuickWebEngineView::PrintedPageSizeId::FanFoldGermanLegal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB5, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB6, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC0, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC1, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC2, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC6, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC65, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC65)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC7, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope9, QQuickWebEngineView::PrintedPageSizeId::Envelope9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope11, QQuickWebEngineView::PrintedPageSizeId::Envelope11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope12, QQuickWebEngineView::PrintedPageSizeId::Envelope12)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope14, QQuickWebEngineView::PrintedPageSizeId::Envelope14)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeMonarch, QQuickWebEngineView::PrintedPageSizeId::EnvelopeMonarch)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePersonal, QQuickWebEngineView::PrintedPageSizeId::EnvelopePersonal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeChou3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeChou3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeChou4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeChou4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeInvite, QQuickWebEngineView::PrintedPageSizeId::EnvelopeInvite)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeItalian, QQuickWebEngineView::PrintedPageSizeId::EnvelopeItalian)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeKaku2, QQuickWebEngineView::PrintedPageSizeId::EnvelopeKaku2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeKaku3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeKaku3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc1, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc2, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc3, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc4, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc5, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc6, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc7, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc8, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc9, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc10, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeYou4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeYou4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LastPageSize, QQuickWebEngineView::PrintedPageSizeId::LastPageSize)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiA, QQuickWebEngineView::PrintedPageSizeId::AnsiA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiB, QQuickWebEngineView::PrintedPageSizeId::AnsiB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC5, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeDL, QQuickWebEngineView::PrintedPageSizeId::EnvelopeDL)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope10, QQuickWebEngineView::PrintedPageSizeId::Envelope10)
+#endif
+
 class WebEngineQuickWidgetDelegate : public QtWebEngineCore::WidgetDelegate
 {
 public:
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
index 906e7c3fde7..d6781e04fa7 100644
--- a/src/webenginequick/api/qquickwebengineview_p.h
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -260,8 +260,6 @@ QT_WARNING_POP
     // must match QPageSize::PageSizeId
     enum PrintedPageSizeId {
         // Existing Qt sizes
-        A4,
-        B5,
         Letter,
         Legal,
         Executive,
@@ -269,21 +267,24 @@ QT_WARNING_POP
         A1,
         A2,
         A3,
+        A4,
         A5,
         A6,
         A7,
         A8,
         A9,
+        A10,
         B0,
         B1,
-        B10,
         B2,
         B3,
         B4,
+        B5,
         B6,
         B7,
         B8,
         B9,
+        B10,
         C5E,
         Comm10E,
         DLE,
@@ -293,7 +294,6 @@ QT_WARNING_POP
         Custom,
 
         // New values derived from PPD standard
-        A10,
         A3Extra,
         A4Extra,
         A4Plus,
@@ -396,10 +396,8 @@ QT_WARNING_POP
         EnvelopePrc10,
         EnvelopeYou4,
 
-        // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
+        // Last item
         LastPageSize = EnvelopeYou4,
-        NPageSize = LastPageSize,
-        NPaperSize = LastPageSize,
 
         // Convenience overloads for naming consistency
         AnsiA = Letter,
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 358f8b1ddb3..511512868ca 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -996,8 +996,6 @@
     \value WebEngineView.EnvelopePrc10
     \value WebEngineView.EnvelopeYou4
     \value WebEngineView.LastPageSize = \c EnvelopeYou4
-    \omitvalue NPageSize
-    \omitvalue NPaperSize
 
     \sa WebEngineView::printToPdf()
 */
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 0cd03194012..432edd3b614 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -463,7 +463,6 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.action(WebAction) --> QQuickWebEngineAction*"
     << "QQuickWebEngineView.A0 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A1 --> PrintedPageSizeId"
-    << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A2 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A3 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A3Extra --> PrintedPageSizeId"
@@ -477,6 +476,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.A7 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A8 --> PrintedPageSizeId"
     << "QQuickWebEngineView.A9 --> PrintedPageSizeId"
+    << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.AbnormalTerminationStatus --> RenderProcessTerminationStatus"
     << "QQuickWebEngineView.AlignCenter --> WebAction"
     << "QQuickWebEngineView.AlignJustified --> WebAction"
@@ -494,7 +494,6 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.ArchE --> PrintedPageSizeId"
     << "QQuickWebEngineView.B0 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B1 --> PrintedPageSizeId"
-    << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B2 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B3 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B4 --> PrintedPageSizeId"
@@ -504,6 +503,7 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.B7 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B8 --> PrintedPageSizeId"
     << "QQuickWebEngineView.B9 --> PrintedPageSizeId"
+    << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
     << "QQuickWebEngineView.Back --> WebAction"
     << "QQuickWebEngineView.C5E --> PrintedPageSizeId"
     << "QQuickWebEngineView.CertificateErrorDomain --> ErrorDomain"
@@ -622,8 +622,6 @@ static const QStringList expectedAPI = QStringList()
     << "QQuickWebEngineView.MediaAudioCapture --> Feature"
     << "QQuickWebEngineView.MediaAudioVideoCapture --> Feature"
     << "QQuickWebEngineView.MediaVideoCapture --> Feature"
-    << "QQuickWebEngineView.NPageSize --> PrintedPageSizeId"
-    << "QQuickWebEngineView.NPaperSize --> PrintedPageSizeId"
     << "QQuickWebEngineView.NoErrorDomain --> ErrorDomain"
     << "QQuickWebEngineView.Notifications --> Feature"
     << "QQuickWebEngineView.NoWebAction --> WebAction"

From 57774a5eba87bc1ba181effefe9dc614f2d3330c Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 26 Jan 2024 20:34:46 -0700
Subject: [PATCH 634/681] QPdfView: use per-page scale factors to render search
 result rectangles

In FitToWidth and FitInView zoomModes, each page could potentially be a
different size; so QPdfViewPrivate::calculateDocumentLayout() loops over
all pages, calculating each pageSize and offset on the fly. m_zoomFactor
doesn't get updated; but QPdfViewPrivate::updateDocumentLayout() stores
the per-page zoom factors in m_documentLayout.pageGeometryAndScale.
screenScaleTransform() takes the page index as an argument, looks up the
per-page scale factor in those zoom modes, and QPdfView::paintEvent()
uses the per-page transform to paint the rectangles.

Pick-to: 6.5
Task-number: QTBUG-120764
Change-Id: I86308c8963ffadd2fdb6f36cf9f4696f75f550ed
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2b96bbb922c1500b8d3b12cf2eb3052ded41c5c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 427c1e114ab2969bfb51b24d0401f7e0286b5873)
---
 src/pdfwidgets/qpdfview.cpp | 68 +++++++++++++++++++++++--------------
 src/pdfwidgets/qpdfview_p.h |  4 +--
 2 files changed, 44 insertions(+), 28 deletions(-)

diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index 8f4934eae4a..a67667fedb8 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -106,8 +106,9 @@ void QPdfViewPrivate::setViewport(QRect viewport)
         const QRect currentPageLine(m_viewport.x(), m_viewport.y() + m_viewport.height() * 0.4, m_viewport.width(), 2);
 
         int currentPage = 0;
-        for (auto it = m_documentLayout.pageGeometries.cbegin(); it != m_documentLayout.pageGeometries.cend(); ++it) {
-            const QRect pageGeometry = it.value();
+        for (auto it = m_documentLayout.pageGeometryAndScale.cbegin();
+             it != m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+            const QRect pageGeometry = it.value().first;
             if (pageGeometry.intersects(currentPageLine)) {
                 currentPage = it.key();
                 break;
@@ -182,7 +183,7 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
     if (!m_document || m_document->status() != QPdfDocument::Status::Ready)
         return documentLayout;
 
-    QHash<int, QRect> pageGeometries;
+    QHash<int, QPair<QRect, qreal>> pageGeometryAndScale;
 
     const int pageCount = m_document->pageCount();
 
@@ -194,24 +195,28 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
     // calculate page sizes
     for (int page = startPage; page < endPage; ++page) {
         QSize pageSize;
+        qreal pageScale = m_zoomFactor;
         if (m_zoomMode == QPdfView::ZoomMode::Custom) {
             pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution * m_zoomFactor).toSize();
         } else if (m_zoomMode == QPdfView::ZoomMode::FitToWidth) {
             pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution).toSize();
-            const qreal factor = (qreal(m_viewport.width() - m_documentMargins.left() - m_documentMargins.right()) /
-                                  qreal(pageSize.width()));
-            pageSize *= factor;
+            pageScale = (qreal(m_viewport.width() - m_documentMargins.left() - m_documentMargins.right()) /
+                         qreal(pageSize.width()));
+            pageSize *= pageScale;
         } else if (m_zoomMode == QPdfView::ZoomMode::FitInView) {
             const QSize viewportSize(m_viewport.size() +
                                      QSize(-m_documentMargins.left() - m_documentMargins.right(), -m_pageSpacing));
 
             pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution).toSize();
-            pageSize = pageSize.scaled(viewportSize, Qt::KeepAspectRatio);
+            QSize scaledSize = pageSize.scaled(viewportSize, Qt::KeepAspectRatio);
+            // because of KeepAspectRatio, the ratio of widths should be the same as the ratio of heights
+            pageScale = qreal(scaledSize.width()) / qreal(pageSize.width());
+            pageSize = scaledSize;
         }
 
         totalWidth = qMax(totalWidth, pageSize.width());
 
-        pageGeometries[page] = QRect(QPoint(0, 0), pageSize);
+        pageGeometryAndScale[page] = {QRect(QPoint(0, 0), pageSize), pageScale};
     }
 
     totalWidth += m_documentMargins.left() + m_documentMargins.right();
@@ -220,19 +225,19 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
 
     // calculate page positions
     for (int page = startPage; page < endPage; ++page) {
-        const QSize pageSize = pageGeometries[page].size();
+        const QSize pageSize = pageGeometryAndScale[page].first.size();
 
         // center horizontal inside the viewport
         const int pageX = (qMax(totalWidth, m_viewport.width()) - pageSize.width()) / 2;
 
-        pageGeometries[page].moveTopLeft(QPoint(pageX, pageY));
+        pageGeometryAndScale[page].first.moveTopLeft(QPoint(pageX, pageY));
 
         pageY += pageSize.height() + m_pageSpacing;
     }
 
     pageY += m_documentMargins.bottom();
 
-    documentLayout.pageGeometries = pageGeometries;
+    documentLayout.pageGeometryAndScale = pageGeometryAndScale;
 
     // calculate overall document size
     documentLayout.documentSize = QSize(totalWidth, pageY);
@@ -242,16 +247,25 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
 
 qreal QPdfViewPrivate::yPositionForPage(int pageNumber) const
 {
-    const auto it = m_documentLayout.pageGeometries.constFind(pageNumber);
-    if (it == m_documentLayout.pageGeometries.cend())
+    const auto it = m_documentLayout.pageGeometryAndScale.constFind(pageNumber);
+    if (it == m_documentLayout.pageGeometryAndScale.cend())
         return 0.0;
 
-    return (*it).y();
+    return (*it).first.y();
 }
 
-QTransform QPdfViewPrivate::screenScaleTransform() const
+QTransform QPdfViewPrivate::screenScaleTransform(int page) const
 {
-    const qreal scale = m_screenResolution * m_zoomFactor;
+    qreal scale = m_screenResolution * m_zoomFactor;
+    switch (m_zoomMode) {
+    case QPdfView::ZoomMode::FitToWidth:
+    case QPdfView::ZoomMode::FitInView:
+        scale = m_screenResolution * m_documentLayout.pageGeometryAndScale[page].second;
+        break;
+    default:
+        break;
+    }
+
     return QTransform::fromScale(scale, scale);
 }
 
@@ -573,9 +587,9 @@ void QPdfView::paintEvent(QPaintEvent *event)
     painter.fillRect(event->rect(), palette().brush(QPalette::Dark));
     painter.translate(-d->m_viewport.x(), -d->m_viewport.y());
 
-    for (auto it = d->m_documentLayout.pageGeometries.cbegin();
-         it != d->m_documentLayout.pageGeometries.cend(); ++it) {
-        const QRect pageGeometry = it.value();
+    for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+         it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+        const QRect pageGeometry = it.value().first;
         if (pageGeometry.intersects(d->m_viewport)) { // page needs to be painted
             painter.fillRect(pageGeometry, Qt::white);
 
@@ -588,7 +602,7 @@ void QPdfView::paintEvent(QPaintEvent *event)
                 d->m_pageRenderer->requestPage(page, pageGeometry.size() * devicePixelRatioF());
             }
 
-            const QTransform scaleTransform = d->screenScaleTransform();
+            const QTransform scaleTransform = d->screenScaleTransform(page);
 #ifdef DEBUG_LINKS
             const QString fmt = u"page %1 @ %2, %3"_s;
             d->m_linkModel.setPage(page);
@@ -656,10 +670,11 @@ void QPdfView::mousePressEvent(QMouseEvent *event)
 void QPdfView::mouseMoveEvent(QMouseEvent *event)
 {
     Q_D(QPdfView);
-    const QTransform screenInvTransform = d->screenScaleTransform().inverted();
-    for (auto it = d->m_documentLayout.pageGeometries.cbegin(); it != d->m_documentLayout.pageGeometries.cend(); ++it) {
+    for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+         it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
         const int page = it.key();
-        const QRect pageGeometry = it.value();
+        const QTransform screenInvTransform = d->screenScaleTransform(page).inverted();
+        const QRect pageGeometry = it.value().first;
         if (pageGeometry.contains(event->position().toPoint())) {
             const QPointF posInPoints = screenInvTransform.map(event->position() - pageGeometry.topLeft());
             d->m_linkModel.setPage(page);
@@ -674,10 +689,11 @@ void QPdfView::mouseMoveEvent(QMouseEvent *event)
 void QPdfView::mouseReleaseEvent(QMouseEvent *event)
 {
     Q_D(QPdfView);
-    const QTransform screenInvTransform = d->screenScaleTransform().inverted();
-    for (auto it = d->m_documentLayout.pageGeometries.cbegin(); it != d->m_documentLayout.pageGeometries.cend(); ++it) {
+    for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+         it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
         const int page = it.key();
-        const QRect pageGeometry = it.value();
+        const QTransform screenInvTransform = d->screenScaleTransform(page).inverted();
+        const QRect pageGeometry = it.value().first;
         if (pageGeometry.contains(event->position().toPoint())) {
             const QPointF posInPoints = screenInvTransform.map(event->position() - pageGeometry.topLeft());
             d->m_linkModel.setPage(page);
diff --git a/src/pdfwidgets/qpdfview_p.h b/src/pdfwidgets/qpdfview_p.h
index ce9a8dba411..d349cc2eee8 100644
--- a/src/pdfwidgets/qpdfview_p.h
+++ b/src/pdfwidgets/qpdfview_p.h
@@ -46,12 +46,12 @@ class QPdfViewPrivate
 
     qreal yPositionForPage(int page) const;
 
-    QTransform screenScaleTransform() const; // points to pixels
+    QTransform screenScaleTransform(int page) const; // points to pixels
 
     struct DocumentLayout
     {
         QSize documentSize;
-        QHash<int, QRect> pageGeometries;
+        QHash<int, QPair<QRect, qreal>> pageGeometryAndScale;
     };
 
     DocumentLayout calculateDocumentLayout() const;

From fb8b5abb4cf6859323e4eef9e3c00b301d8ce7d0 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Thu, 25 Jan 2024 22:18:02 -0700
Subject: [PATCH 635/681] QPdfIOHandler: Ensure QPdfDocument still exists
 before rendering

If a PDF-viewing application is unceremoniously exited while
QQuickPixmapReader::processJobs() still has PDF rendering jobs
queued up, it could be that the shared QPdfDocument instance
is deleted just as QPdfIOHandler::read() starts the rendering.
Use a QPointer to avoid that.

Fixes: QTBUG-121502
Pick-to: 6.5
Change-Id: I5d0674ca77ab5015b710df49b3842064e65d4adc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ed49163c8fef019be18475b86694263801c3a8ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 77d2e9ad33a12dbc3e8ddc3ce40498b28029147f)
---
 src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp | 10 ++++++----
 src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
index 19575902864..bb3e7c92930 100644
--- a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
@@ -62,7 +62,7 @@ int QPdfIOHandler::imageCount() const
 bool QPdfIOHandler::read(QImage *image)
 {
     if (load(device())) {
-        if (m_page >= m_doc->pageCount())
+        if (m_doc.isNull() || m_page >= m_doc->pageCount())
             return false;
         if (m_page < 0)
             m_page = 0;
@@ -110,9 +110,11 @@ bool QPdfIOHandler::read(QImage *image)
             options.setScaledSize(pageSize);
             image->fill(m_backColor.rgba());
             QPainter p(image);
-            QImage pageImage = m_doc->render(m_page, finalSize, options);
-            p.drawImage(0, 0, pageImage);
-            p.end();
+            if (!m_doc.isNull()) {
+                QImage pageImage = m_doc->render(m_page, finalSize, options);
+                p.drawImage(0, 0, pageImage);
+                p.end();
+            }
         }
         return true;
     }
diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
index 5918c03282b..c4d8e0f9a26 100644
--- a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
@@ -41,7 +41,7 @@ class QPdfIOHandler : public QImageIOHandler
     bool load(QIODevice *device);
 
 private:
-    QPdfDocument *m_doc = nullptr;
+    QPointer<QPdfDocument> m_doc;
     int m_page = -1;
 
     QRect m_clipRect;

From f8798de92e0bd22ffa299cb301ac2f3f292d55de Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Fri, 26 Jan 2024 20:34:46 -0700
Subject: [PATCH 636/681] QPdfView: use per-page scale factors to render search
 result rectangles

In FitToWidth and FitInView zoomModes, each page could potentially be a
different size; so QPdfViewPrivate::calculateDocumentLayout() loops over
all pages, calculating each pageSize and offset on the fly. m_zoomFactor
doesn't get updated; but QPdfViewPrivate::updateDocumentLayout() stores
the per-page zoom factors in m_documentLayout.pageGeometryAndScale.
screenScaleTransform() takes the page index as an argument, looks up the
per-page scale factor in those zoom modes, and QPdfView::paintEvent()
uses the per-page transform to paint the rectangles.

Task-number: QTBUG-120764
Change-Id: I86308c8963ffadd2fdb6f36cf9f4696f75f550ed
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2b96bbb922c1500b8d3b12cf2eb3052ded41c5c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 427c1e114ab2969bfb51b24d0401f7e0286b5873)
(cherry picked from commit 57774a5eba87bc1ba181effefe9dc614f2d3330c)
---
 src/pdfwidgets/qpdfview.cpp | 68 +++++++++++++++++++++++--------------
 src/pdfwidgets/qpdfview_p.h |  4 +--
 2 files changed, 44 insertions(+), 28 deletions(-)

diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index 8f4934eae4a..a67667fedb8 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -106,8 +106,9 @@ void QPdfViewPrivate::setViewport(QRect viewport)
         const QRect currentPageLine(m_viewport.x(), m_viewport.y() + m_viewport.height() * 0.4, m_viewport.width(), 2);
 
         int currentPage = 0;
-        for (auto it = m_documentLayout.pageGeometries.cbegin(); it != m_documentLayout.pageGeometries.cend(); ++it) {
-            const QRect pageGeometry = it.value();
+        for (auto it = m_documentLayout.pageGeometryAndScale.cbegin();
+             it != m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+            const QRect pageGeometry = it.value().first;
             if (pageGeometry.intersects(currentPageLine)) {
                 currentPage = it.key();
                 break;
@@ -182,7 +183,7 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
     if (!m_document || m_document->status() != QPdfDocument::Status::Ready)
         return documentLayout;
 
-    QHash<int, QRect> pageGeometries;
+    QHash<int, QPair<QRect, qreal>> pageGeometryAndScale;
 
     const int pageCount = m_document->pageCount();
 
@@ -194,24 +195,28 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
     // calculate page sizes
     for (int page = startPage; page < endPage; ++page) {
         QSize pageSize;
+        qreal pageScale = m_zoomFactor;
         if (m_zoomMode == QPdfView::ZoomMode::Custom) {
             pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution * m_zoomFactor).toSize();
         } else if (m_zoomMode == QPdfView::ZoomMode::FitToWidth) {
             pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution).toSize();
-            const qreal factor = (qreal(m_viewport.width() - m_documentMargins.left() - m_documentMargins.right()) /
-                                  qreal(pageSize.width()));
-            pageSize *= factor;
+            pageScale = (qreal(m_viewport.width() - m_documentMargins.left() - m_documentMargins.right()) /
+                         qreal(pageSize.width()));
+            pageSize *= pageScale;
         } else if (m_zoomMode == QPdfView::ZoomMode::FitInView) {
             const QSize viewportSize(m_viewport.size() +
                                      QSize(-m_documentMargins.left() - m_documentMargins.right(), -m_pageSpacing));
 
             pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution).toSize();
-            pageSize = pageSize.scaled(viewportSize, Qt::KeepAspectRatio);
+            QSize scaledSize = pageSize.scaled(viewportSize, Qt::KeepAspectRatio);
+            // because of KeepAspectRatio, the ratio of widths should be the same as the ratio of heights
+            pageScale = qreal(scaledSize.width()) / qreal(pageSize.width());
+            pageSize = scaledSize;
         }
 
         totalWidth = qMax(totalWidth, pageSize.width());
 
-        pageGeometries[page] = QRect(QPoint(0, 0), pageSize);
+        pageGeometryAndScale[page] = {QRect(QPoint(0, 0), pageSize), pageScale};
     }
 
     totalWidth += m_documentMargins.left() + m_documentMargins.right();
@@ -220,19 +225,19 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
 
     // calculate page positions
     for (int page = startPage; page < endPage; ++page) {
-        const QSize pageSize = pageGeometries[page].size();
+        const QSize pageSize = pageGeometryAndScale[page].first.size();
 
         // center horizontal inside the viewport
         const int pageX = (qMax(totalWidth, m_viewport.width()) - pageSize.width()) / 2;
 
-        pageGeometries[page].moveTopLeft(QPoint(pageX, pageY));
+        pageGeometryAndScale[page].first.moveTopLeft(QPoint(pageX, pageY));
 
         pageY += pageSize.height() + m_pageSpacing;
     }
 
     pageY += m_documentMargins.bottom();
 
-    documentLayout.pageGeometries = pageGeometries;
+    documentLayout.pageGeometryAndScale = pageGeometryAndScale;
 
     // calculate overall document size
     documentLayout.documentSize = QSize(totalWidth, pageY);
@@ -242,16 +247,25 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
 
 qreal QPdfViewPrivate::yPositionForPage(int pageNumber) const
 {
-    const auto it = m_documentLayout.pageGeometries.constFind(pageNumber);
-    if (it == m_documentLayout.pageGeometries.cend())
+    const auto it = m_documentLayout.pageGeometryAndScale.constFind(pageNumber);
+    if (it == m_documentLayout.pageGeometryAndScale.cend())
         return 0.0;
 
-    return (*it).y();
+    return (*it).first.y();
 }
 
-QTransform QPdfViewPrivate::screenScaleTransform() const
+QTransform QPdfViewPrivate::screenScaleTransform(int page) const
 {
-    const qreal scale = m_screenResolution * m_zoomFactor;
+    qreal scale = m_screenResolution * m_zoomFactor;
+    switch (m_zoomMode) {
+    case QPdfView::ZoomMode::FitToWidth:
+    case QPdfView::ZoomMode::FitInView:
+        scale = m_screenResolution * m_documentLayout.pageGeometryAndScale[page].second;
+        break;
+    default:
+        break;
+    }
+
     return QTransform::fromScale(scale, scale);
 }
 
@@ -573,9 +587,9 @@ void QPdfView::paintEvent(QPaintEvent *event)
     painter.fillRect(event->rect(), palette().brush(QPalette::Dark));
     painter.translate(-d->m_viewport.x(), -d->m_viewport.y());
 
-    for (auto it = d->m_documentLayout.pageGeometries.cbegin();
-         it != d->m_documentLayout.pageGeometries.cend(); ++it) {
-        const QRect pageGeometry = it.value();
+    for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+         it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+        const QRect pageGeometry = it.value().first;
         if (pageGeometry.intersects(d->m_viewport)) { // page needs to be painted
             painter.fillRect(pageGeometry, Qt::white);
 
@@ -588,7 +602,7 @@ void QPdfView::paintEvent(QPaintEvent *event)
                 d->m_pageRenderer->requestPage(page, pageGeometry.size() * devicePixelRatioF());
             }
 
-            const QTransform scaleTransform = d->screenScaleTransform();
+            const QTransform scaleTransform = d->screenScaleTransform(page);
 #ifdef DEBUG_LINKS
             const QString fmt = u"page %1 @ %2, %3"_s;
             d->m_linkModel.setPage(page);
@@ -656,10 +670,11 @@ void QPdfView::mousePressEvent(QMouseEvent *event)
 void QPdfView::mouseMoveEvent(QMouseEvent *event)
 {
     Q_D(QPdfView);
-    const QTransform screenInvTransform = d->screenScaleTransform().inverted();
-    for (auto it = d->m_documentLayout.pageGeometries.cbegin(); it != d->m_documentLayout.pageGeometries.cend(); ++it) {
+    for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+         it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
         const int page = it.key();
-        const QRect pageGeometry = it.value();
+        const QTransform screenInvTransform = d->screenScaleTransform(page).inverted();
+        const QRect pageGeometry = it.value().first;
         if (pageGeometry.contains(event->position().toPoint())) {
             const QPointF posInPoints = screenInvTransform.map(event->position() - pageGeometry.topLeft());
             d->m_linkModel.setPage(page);
@@ -674,10 +689,11 @@ void QPdfView::mouseMoveEvent(QMouseEvent *event)
 void QPdfView::mouseReleaseEvent(QMouseEvent *event)
 {
     Q_D(QPdfView);
-    const QTransform screenInvTransform = d->screenScaleTransform().inverted();
-    for (auto it = d->m_documentLayout.pageGeometries.cbegin(); it != d->m_documentLayout.pageGeometries.cend(); ++it) {
+    for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+         it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
         const int page = it.key();
-        const QRect pageGeometry = it.value();
+        const QTransform screenInvTransform = d->screenScaleTransform(page).inverted();
+        const QRect pageGeometry = it.value().first;
         if (pageGeometry.contains(event->position().toPoint())) {
             const QPointF posInPoints = screenInvTransform.map(event->position() - pageGeometry.topLeft());
             d->m_linkModel.setPage(page);
diff --git a/src/pdfwidgets/qpdfview_p.h b/src/pdfwidgets/qpdfview_p.h
index ce9a8dba411..d349cc2eee8 100644
--- a/src/pdfwidgets/qpdfview_p.h
+++ b/src/pdfwidgets/qpdfview_p.h
@@ -46,12 +46,12 @@ class QPdfViewPrivate
 
     qreal yPositionForPage(int page) const;
 
-    QTransform screenScaleTransform() const; // points to pixels
+    QTransform screenScaleTransform(int page) const; // points to pixels
 
     struct DocumentLayout
     {
         QSize documentSize;
-        QHash<int, QRect> pageGeometries;
+        QHash<int, QPair<QRect, qreal>> pageGeometryAndScale;
     };
 
     DocumentLayout calculateDocumentLayout() const;

From 56319fbe0624f346e937e775921e917ae71fdc3e Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Thu, 25 Jan 2024 22:18:02 -0700
Subject: [PATCH 637/681] QPdfIOHandler: Ensure QPdfDocument still exists
 before rendering

If a PDF-viewing application is unceremoniously exited while
QQuickPixmapReader::processJobs() still has PDF rendering jobs
queued up, it could be that the shared QPdfDocument instance
is deleted just as QPdfIOHandler::read() starts the rendering.
Use a QPointer to avoid that.

Fixes: QTBUG-121502
Change-Id: I5d0674ca77ab5015b710df49b3842064e65d4adc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ed49163c8fef019be18475b86694263801c3a8ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 77d2e9ad33a12dbc3e8ddc3ce40498b28029147f)
(cherry picked from commit fb8b5abb4cf6859323e4eef9e3c00b301d8ce7d0)
---
 src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp | 10 ++++++----
 src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
index 19575902864..bb3e7c92930 100644
--- a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
@@ -62,7 +62,7 @@ int QPdfIOHandler::imageCount() const
 bool QPdfIOHandler::read(QImage *image)
 {
     if (load(device())) {
-        if (m_page >= m_doc->pageCount())
+        if (m_doc.isNull() || m_page >= m_doc->pageCount())
             return false;
         if (m_page < 0)
             m_page = 0;
@@ -110,9 +110,11 @@ bool QPdfIOHandler::read(QImage *image)
             options.setScaledSize(pageSize);
             image->fill(m_backColor.rgba());
             QPainter p(image);
-            QImage pageImage = m_doc->render(m_page, finalSize, options);
-            p.drawImage(0, 0, pageImage);
-            p.end();
+            if (!m_doc.isNull()) {
+                QImage pageImage = m_doc->render(m_page, finalSize, options);
+                p.drawImage(0, 0, pageImage);
+                p.end();
+            }
         }
         return true;
     }
diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
index 5918c03282b..c4d8e0f9a26 100644
--- a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
@@ -41,7 +41,7 @@ class QPdfIOHandler : public QImageIOHandler
     bool load(QIODevice *device);
 
 private:
-    QPdfDocument *m_doc = nullptr;
+    QPointer<QPdfDocument> m_doc;
     int m_page = -1;
 
     QRect m_clipRect;

From edf286f39d6fae7db53484d7c4b521f03129a054 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 30 Jan 2024 18:31:28 +0100
Subject: [PATCH 638/681] Update Chromium

Submodule src/3rdparty 7b40abeb..e257d651:
  * [Backport] Security bug 1407197 (2/2)
  * [Backport] Security bug 1407197 (1/2)
  * [Backport] CVE-2024-0810: Insufficient policy enforcement in DevTools
  * [Backport] Security bug 1511389 (2/2)
  * [Backport] Dependency for security bug 1511389 (1/1)
  * [Backport] Security bug 1511389 (1/2)
  * [Backport] CVE-2024-0807: Use after free in WebAudio
  * [Backport] CVE-2024-0808: Integer underflow in WebUI

Task-number: QTBUG-121685
Change-Id: Ie8e7a70265b142b65cea5bd89c9afa45fb0dec6c
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 935caecbbff5ac79d2c43d6bdcd81fe7d83baedf)
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 1124c6f9c85..c481f19c81c 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           120.0.6099.225
+Patched with security patches up to Chromium version:           121.0.6167.85
diff --git a/src/3rdparty b/src/3rdparty
index 7b40abebdec..e257d651392 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 7b40abebdec3e2931c88010fedc96c49fbba1731
+Subproject commit e257d6513927fa24df48075bce9b33c4b5f546ff
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 4f9bc8a6782..d3868c38d31 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "120.0.6099.225"; // FIXME: Remember to update
+    return "121.0.6167.85"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 2afbd483fe1a1d94a92b3f7ce1272107b47e9ce1 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Sat, 10 Feb 2024 20:30:57 +0000
Subject: [PATCH 639/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I8900718d76c96c012c14342aaeab3b21313399d2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 79886bbf12c..3e2a9262b67 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: e52edaf1ba9c31491d7fe7e650dd5668bb313695
+    ref: a3a142255b1de9daab84bdf124091e664f7fab22
     required: true
   ../tqtc-qtpositioning:
-    ref: bf67714ecc876daa3ce9570337a020694391a286
+    ref: 633b40fd9df2c1dd97f757b85dd89fdeadc9285b
     required: false
   ../tqtc-qttools:
-    ref: 8db8b986ceebe77eaa309dc38cfb0d531166699d
+    ref: 4da129f8228afaefee68ed6b078da8f7c5cb9973
     required: false
   ../tqtc-qtwebchannel:
-    ref: 4ed8e49ccf36c8f0c4ac9b08e25f01f8a2216fbe
+    ref: 9652993572b1284b386cdc9c150a96a17c4e3922
     required: false

From b220617e1d13f43d22670d89f21df2cb4098752c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 12 Feb 2024 12:08:58 +0100
Subject: [PATCH 640/681] Remove outdated test for Windows version

It silently remained in during the auto-merge and was causing the MSVC-
builds to be non-fatally skipped.

Change-Id: I73c82f59efc2107ec66cad5017e14990d0a77d0d
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 configure.cmake | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index 033315d5d2d..0b3e3e42bbe 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -643,11 +643,6 @@ if(WIN32)
         MESSAGE "Build requires Windows 11 SDK at least version 10.0.22621.0"
     )
 endif()
-add_check_for_support(
-   MODULES QtWebEngine QtPdf
-   CONDITION NOT MSVC OR TEST_winversion
-   MESSAGE "Build requires Visual Studio 2019 or higher."
-)
 
 #### Summary
 

From 6cf392bceebaccfe8f04f62c11b3d449430affce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 7 Feb 2024 15:08:50 +0100
Subject: [PATCH 641/681] Update Chromium

Submodule src/3rdparty e257d651..707f4e7c:
  * [Backport] CVE-2024-1284: Use after free in Mojo
  * [Backport] CVE-2024-1283: Heap buffer overflow in Skia
  * [Backport] CVE-2024-1059: Use after free in WebRTC
  * Fixup: [Backport] Security bug 1407197
  * [Backport] Use raw strings for regexps in Python code.
  * [Backport] CVE-2024-1077: Use after free in Network
  * [Backport] CVE-2024-1060: Use after free in Canvas
  * [Backport] Security bug 1519980
  * FIXUP: Fix build with VS Toolset 17.8
  * Fix build with VS Toolset 17.8
  * Remove unused python import
  * [Backport] Update vendored copy of six to 1.16.0.

Fixes: QTBUG-121845
Fixes: QTBUG-122095
Change-Id: Ice00b6537b19d2a7af7787b5f2989283c89130b7
(cherry picked from commit 8b521bfccd0ed6fe084bc0bf5b41ec04c31dc83b)
(cherry picked from commit 278edc41fbacd169b5ffce7cb7c91fe9a8355fe6)
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index c481f19c81c..76c045625d1 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           121.0.6167.85
+Patched with security patches up to Chromium version:           121.0.6167.160
diff --git a/src/3rdparty b/src/3rdparty
index e257d651392..707f4e7c011 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit e257d6513927fa24df48075bce9b33c4b5f546ff
+Subproject commit 707f4e7c0110c33df3d36a1942ad1b0ea2cb997b
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index fb183bea18b..ae85bb2d6c2 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -985,7 +985,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "121.0.6167.85"; // FIXME: Remember to update
+    return "121.0.6167.160"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 7e154541309458183ca886afa31421cecb4974d6 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 15 Feb 2024 08:22:06 +0000
Subject: [PATCH 642/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Id712156182e1656595b895c17799e0df1a1eaec9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3e2a9262b67..402ce004f75 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: a3a142255b1de9daab84bdf124091e664f7fab22
+    ref: dcf4fa09f3c4163c6ee5be0762f77f70e8c07394
     required: true
   ../tqtc-qtpositioning:
-    ref: 633b40fd9df2c1dd97f757b85dd89fdeadc9285b
+    ref: ecccc4af6bc120d88ac7ba9fc85e735bc91c9622
     required: false
   ../tqtc-qttools:
-    ref: 4da129f8228afaefee68ed6b078da8f7c5cb9973
+    ref: 0ff1d691c9cd4e2f5f47fa80f36aa891df036610
     required: false
   ../tqtc-qtwebchannel:
-    ref: 9652993572b1284b386cdc9c150a96a17c4e3922
+    ref: 0c9be0b8925822d9528fdccbfe44eaf70a8e5c72
     required: false

From f08b503f680e8a6d4021d2fd21d2386f8e60da24 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 22 Feb 2024 15:00:17 +0000
Subject: [PATCH 643/681] Update dependencies on 'tqtc/lts-6.5.5' in
 qt/tqtc-qtwebengine

Change-Id: Ic9969ada77ea6e286894ddbcc28d2d25b506ab97
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 402ce004f75..5803efcaf87 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: dcf4fa09f3c4163c6ee5be0762f77f70e8c07394
+    ref: 3760c04fdea95b6e6d6ccac7c594993f063096fd
     required: true
   ../tqtc-qtpositioning:
-    ref: ecccc4af6bc120d88ac7ba9fc85e735bc91c9622
+    ref: 90db41d5271c38c141fef3deb8012469279a83db
     required: false
   ../tqtc-qttools:
-    ref: 0ff1d691c9cd4e2f5f47fa80f36aa891df036610
+    ref: 8923c9a51e2b1da324d6d02235a1c37f2e59f669
     required: false
   ../tqtc-qtwebchannel:
-    ref: 0c9be0b8925822d9528fdccbfe44eaf70a8e5c72
+    ref: 588848bb0bfe4fff393d7a1eca27cf253ac6c59a
     required: false

From 76b77f2293c5eb38aa50ed22242e5eb5fc78dc91 Mon Sep 17 00:00:00 2001
From: Tarja Sundqvist <tarja.sundqvist@qt.io>
Date: Sun, 3 Mar 2024 01:29:10 +0200
Subject: [PATCH 644/681] Bump version to 6.5.6

Change-Id: Ic47d869313af4b84a0e6554950ab4bea3bfebcab
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
---
 .cmake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cmake.conf b/.cmake.conf
index 2991fa83b0b..185995ba180 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1,4 +1,4 @@
-set(QT_REPO_MODULE_VERSION "6.5.5")
+set(QT_REPO_MODULE_VERSION "6.5.6")
 set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
 set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")
 set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")

From dc542c329c9849882adaf68c188ee0024796e34e Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 5 Mar 2024 13:05:53 +0000
Subject: [PATCH 645/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I8761ea2d50ed22db4293eec69298c1ab640a0432
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 402ce004f75..2618b043f7a 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: dcf4fa09f3c4163c6ee5be0762f77f70e8c07394
+    ref: 6fa6b97eb837fc98001f517fb2f79067831734e6
     required: true
   ../tqtc-qtpositioning:
-    ref: ecccc4af6bc120d88ac7ba9fc85e735bc91c9622
+    ref: eac8586510c72733485e6d5739e020c1caec8a8b
     required: false
   ../tqtc-qttools:
-    ref: 0ff1d691c9cd4e2f5f47fa80f36aa891df036610
+    ref: fa3ba1b430ff5a717944fc601c147eab9b93f124
     required: false
   ../tqtc-qtwebchannel:
-    ref: 0c9be0b8925822d9528fdccbfe44eaf70a8e5c72
+    ref: 61b791859a63dd216fc6ce5aed93c243f20ec3f6
     required: false

From 310078ac8390e8babd3d5cd1daee10bcbc4cc127 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 6 Mar 2024 19:42:09 +0000
Subject: [PATCH 646/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Idc97315b2b3bd1ded68b7d6ef2a8e6d7d4e3a6c7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 2618b043f7a..c74f4bbf886 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 6fa6b97eb837fc98001f517fb2f79067831734e6
+    ref: 0903fe2ff794f389d8282d487d02c4b4c130381d
     required: true
   ../tqtc-qtpositioning:
-    ref: eac8586510c72733485e6d5739e020c1caec8a8b
+    ref: b0935d6674a7a62e1b17e61c6172b7011b5d2d66
     required: false
   ../tqtc-qttools:
-    ref: fa3ba1b430ff5a717944fc601c147eab9b93f124
+    ref: 9a8c0e40597f51c0c3782e46d6cfd04f0ee13996
     required: false
   ../tqtc-qtwebchannel:
-    ref: 61b791859a63dd216fc6ce5aed93c243f20ec3f6
+    ref: 9b1c69f1dfbec9f806838a59747b3752b9c6b533
     required: false

From 5a3b84e3f74dc3d7f1aa4d6e9624ac789ab7b953 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 18 Mar 2024 22:36:58 +0000
Subject: [PATCH 647/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I248bda80c95098e57dae94ec3de91f913623f129
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c74f4bbf886..82f0fdd8450 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 0903fe2ff794f389d8282d487d02c4b4c130381d
+    ref: 99563030dadef890ee09052321762e8601bea943
     required: true
   ../tqtc-qtpositioning:
-    ref: b0935d6674a7a62e1b17e61c6172b7011b5d2d66
+    ref: cd5eacc6713cda5554a073e7c917a68ca167f2d5
     required: false
   ../tqtc-qttools:
-    ref: 9a8c0e40597f51c0c3782e46d6cfd04f0ee13996
+    ref: bd3e48ebeeeaca0a88d7c6414a4e09fbf2228cc6
     required: false
   ../tqtc-qtwebchannel:
-    ref: 9b1c69f1dfbec9f806838a59747b3752b9c6b533
+    ref: b08df64b083fce34d2436163bbefc0fa6cbca816
     required: false

From 4a414ae40f01ac4afa55a660147ccccf555ab3f0 Mon Sep 17 00:00:00 2001
From: Toni Saario <toni.saario@qt.io>
Date: Mon, 21 Nov 2022 12:15:01 +0200
Subject: [PATCH 648/681] Coin: Add alias to non tqtc module

This changes the module name in Coin to match what is run
in qt5 integration and allows reuse of artifacts.

Change-Id: Iad9218fbba968414991f45d301c11e68c3038b57
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
(cherry picked from commit 5c32981e6d2ef96deabb888eba798ccfd502ade5)
Reviewed-by: Toni Saario <toni.saario@qt.io>
---
 coin/module_config.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coin/module_config.yaml b/coin/module_config.yaml
index f1d69a2778f..61ce9a52591 100644
--- a/coin/module_config.yaml
+++ b/coin/module_config.yaml
@@ -1,4 +1,5 @@
 version: 2
+alias: qtwebengine
 accept_configuration:
   condition: property
   property: features

From c80cdf43bbff44eec45f43529e348bbf44650637 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 21 Mar 2024 05:09:47 +0000
Subject: [PATCH 649/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I38ee7a1f9221a20203fbc276597e5d2014d37b8c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 82f0fdd8450..c641933fe02 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 99563030dadef890ee09052321762e8601bea943
+    ref: fbaae45edaef8ee283da75ec941d0f213a785e34
     required: true
   ../tqtc-qtpositioning:
-    ref: cd5eacc6713cda5554a073e7c917a68ca167f2d5
+    ref: 88576d56971ab4397abd7d96fd9534280413bbfa
     required: false
   ../tqtc-qttools:
-    ref: bd3e48ebeeeaca0a88d7c6414a4e09fbf2228cc6
+    ref: 38686c6987e03268be4c963c945e757fbafff8e5
     required: false
   ../tqtc-qtwebchannel:
-    ref: b08df64b083fce34d2436163bbefc0fa6cbca816
+    ref: cd30d1a63b62b6c325c30791513a829b639bbc55
     required: false

From 2b23b56deeb3683a07dde434f144f213b8189b74 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 22 Mar 2024 13:07:47 +0000
Subject: [PATCH 650/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I8effbef4271cf276ae0fc0636cee49e3f2726818
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index c641933fe02..49632f4fd22 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: fbaae45edaef8ee283da75ec941d0f213a785e34
+    ref: 90e4f5678247601ed8ce6e13604547b159c7be0f
     required: true
   ../tqtc-qtpositioning:
-    ref: 88576d56971ab4397abd7d96fd9534280413bbfa
+    ref: ed75a7dfc5f61983fe190ee558f35ce47ac40a03
     required: false
   ../tqtc-qttools:
-    ref: 38686c6987e03268be4c963c945e757fbafff8e5
+    ref: d284135b2cd611656850992e14c8fddc0786bc92
     required: false
   ../tqtc-qtwebchannel:
-    ref: cd30d1a63b62b6c325c30791513a829b639bbc55
+    ref: e0a0003554545c511a180bd7ca0b36c24d7e1203
     required: false

From 5c9e95003dc40604714286bd6d0a1325667ce036 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 25 Mar 2024 10:45:25 +0000
Subject: [PATCH 651/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I7c15fcd36ed91008c0d4ae45924a8349521b29a6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 49632f4fd22..46255c9a463 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 90e4f5678247601ed8ce6e13604547b159c7be0f
+    ref: 91cff4fa7a357885752d141b0b04a9ad30a3ccb6
     required: true
   ../tqtc-qtpositioning:
-    ref: ed75a7dfc5f61983fe190ee558f35ce47ac40a03
+    ref: 463039ae1a228cbc9d77d1c74810a7f9d9a710dd
     required: false
   ../tqtc-qttools:
-    ref: d284135b2cd611656850992e14c8fddc0786bc92
+    ref: 61fd9cba1599472a204a31c7b12a0168422be7b3
     required: false
   ../tqtc-qtwebchannel:
-    ref: e0a0003554545c511a180bd7ca0b36c24d7e1203
+    ref: f37861ee6b231f670bdf1ee10f35b39ab743bf26
     required: false

From 7425db362cecc9b63db4b611fbd2cb24a186dd38 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 11 Apr 2024 05:11:42 +0000
Subject: [PATCH 652/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I12e8b3b5d17c6a0416b0f98e7111ff06451fbc32
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 46255c9a463..ccafefdc04b 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 91cff4fa7a357885752d141b0b04a9ad30a3ccb6
+    ref: 08596ea035ed636637e382f25f5191c3c04139aa
     required: true
   ../tqtc-qtpositioning:
-    ref: 463039ae1a228cbc9d77d1c74810a7f9d9a710dd
+    ref: 429baffb180dc6484124ac369d9e9773982906ed
     required: false
   ../tqtc-qttools:
-    ref: 61fd9cba1599472a204a31c7b12a0168422be7b3
+    ref: e4cb3326070b63a6012eab98e4dab65c7a4da398
     required: false
   ../tqtc-qtwebchannel:
-    ref: f37861ee6b231f670bdf1ee10f35b39ab743bf26
+    ref: b3c458406ec4ed273fa3a84e50b9b18ed16b938e
     required: false

From 1be980a640fadd202ac1c96321dcd3b531bc589f Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Mon, 15 Apr 2024 23:05:23 +0000
Subject: [PATCH 653/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I07f577123bbaaa7f392937dc2d9678d2f9527179
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index ccafefdc04b..d32b5852d97 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 08596ea035ed636637e382f25f5191c3c04139aa
+    ref: 525ee238573fa9b0f4baa5217eb07702d190cde7
     required: true
   ../tqtc-qtpositioning:
-    ref: 429baffb180dc6484124ac369d9e9773982906ed
+    ref: aa6b2a3ca7e6dafaccf21a191a5e89bf3d65f50b
     required: false
   ../tqtc-qttools:
-    ref: e4cb3326070b63a6012eab98e4dab65c7a4da398
+    ref: 781eb9dc46ec758adc9cf0014c8f2f00abf115f6
     required: false
   ../tqtc-qtwebchannel:
-    ref: b3c458406ec4ed273fa3a84e50b9b18ed16b938e
+    ref: 8c08fe361b416eefef8ae4c7a8b437ae45d0b400
     required: false

From 4163d2ed0291364aa4ceccdbc32ad4284b844b28 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 19 Apr 2024 21:25:06 +0000
Subject: [PATCH 654/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Id80eb22b4acec7cc97cf931fe9cd551b2ee87496
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index d32b5852d97..8322af315e0 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 525ee238573fa9b0f4baa5217eb07702d190cde7
+    ref: 5123c82512e21c46d30f47c5fcb4374018206d86
     required: true
   ../tqtc-qtpositioning:
-    ref: aa6b2a3ca7e6dafaccf21a191a5e89bf3d65f50b
+    ref: 668a33393a217222e47d753a0a7449adc3117961
     required: false
   ../tqtc-qttools:
-    ref: 781eb9dc46ec758adc9cf0014c8f2f00abf115f6
+    ref: e355135c948f3609d54932dce646b6e6ab460de6
     required: false
   ../tqtc-qtwebchannel:
-    ref: 8c08fe361b416eefef8ae4c7a8b437ae45d0b400
+    ref: f96b7af84a33bf556969162c16bb3105ad90d5eb
     required: false

From d7eca28855e12f426c027b5c2c7efe43c3001fe9 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 6 Feb 2024 16:01:24 +0100
Subject: [PATCH 655/681] Fix for view displaying blank content with
 transparent background
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For transparent background color, QtWebEngine will set the attribute
Qt::WA_AlwaysStackOnTop to true. This change necessitates triggering an
update on the top-level window. The code has been adjusted to invoke an
update on the parent widget if one is present. Additionally, update is
disabled while widget attributes are being updated, and re-enabled once
all attributes are properly set. This prevents unnecessary updates and
ensures the widget updates only after all values are set.

Fixes: QTBUG-120273
Fixes: QTBUG-121227
Change-Id: Id2a103a59e9dfeb98ac2245ec274360e3c65f239
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Moss Heim <moss.heim@qt.io>
(cherry picked from commit 5c73b7f5719b61aad1d7709fee3f810732bb3fba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 97394380fdd20a88b6e8fe4308d7a56134963d83)
(cherry picked from commit 4cb86b16d0914369c99c35c8bd6acbb0ef74fd2f)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/webenginewidgets/api/qwebengineview.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index c4a0da4d92a..5aeeeb6382a 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -156,6 +156,7 @@ class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
     }
     void SetClearColor(const QColor &color) override
     {
+        setUpdatesEnabled(false);
         QQuickWidget::setClearColor(color);
         // QQuickWidget is usually blended by punching holes into widgets
         // above it to simulate the visual stacking order. If we want it to be
@@ -164,7 +165,8 @@ class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
         bool isTranslucent = color.alpha() < 255;
         setAttribute(Qt::WA_AlwaysStackOnTop, isTranslucent);
         setAttribute(Qt::WA_OpaquePaintEvent, !isTranslucent);
-        update();
+        setUpdatesEnabled(true);
+        window()->update();
     }
     void MoveWindow(const QPoint &screenPos) override
     {

From 8836ceb7370a4dc313f5749b95df27c3657c14b8 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 20 Mar 2024 21:16:11 -0700
Subject: [PATCH 656/681] Convert search result bounds to account for PDF
 transforms

As a drive-by, remove unneeded includes.

QPdfDocumentPrivate::convertPageRect() will be useful for fixing
related bugs. If PDF files can contain arbitrary transforms, and
"page coordinates" returned from pdfium functions are not already
converted, then it's never ok to just subtract from page height to
invert the y's.

Fixes: QTBUG-120764
Change-Id: Iffce528c0c5e66c499e7147078b7b8718f7610ce
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fccbc33d95c17b0911fd4cbd97998acfc8e6320f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 541b00830fdd12f91a9da5426536abc4787f4859)
(cherry picked from commit 496b935279e3dfd94b3c4bf5e01bb70ef91a3138)
---
 src/pdf/qpdfdocument.cpp    | 18 ++++++++++++++++++
 src/pdf/qpdfdocument_p.h    |  1 +
 src/pdf/qpdfsearchmodel.cpp | 12 +++++++-----
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 6de2fbc6c11..11d886dc4db 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -474,6 +474,24 @@ QRectF QPdfDocumentPrivate::getCharBox(FPDF_TEXTPAGE textPage, double pageHeight
     return QRectF(l, pageHeight - t, r - l, t - b);
 }
 
+/*! \internal
+    Convert the bounding box defined by \a left \a top \a right and \a bottom
+    to the usual 1x (pixels = points) 4th-quadrant "view" coordinate system
+    that we use for rendering things on top of the page image.
+    Some PDF files have internal transforms that make this coordinate
+    system different from "page coordinates", so we cannot just
+    subtract from page height to invert the y coordinates, in general.
+ */
+QRectF QPdfDocumentPrivate::mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom)
+{
+    const auto pageHeight = FPDF_GetPageHeight(pdfPage);
+    const auto pageWidth = FPDF_GetPageWidth(pdfPage);
+    int xfmLeft, xfmTop, xfmRight, xfmBottom;
+    FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, left, top, &xfmLeft, &xfmTop);
+    FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, right, bottom, &xfmRight, &xfmBottom);
+    return QRectF(xfmLeft, xfmTop, xfmRight - xfmLeft, xfmBottom - xfmTop);
+}
+
 QPdfDocumentPrivate::TextPosition QPdfDocumentPrivate::hitTest(int page, QPointF position)
 {
     const QPdfMutexLocker lock;
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
index 4adbf695ed0..5ec48501219 100644
--- a/src/pdf/qpdfdocument_p.h
+++ b/src/pdf/qpdfdocument_p.h
@@ -81,6 +81,7 @@ class Q_PDF_PRIVATE_EXPORT QPdfDocumentPrivate: public FPDF_FILEACCESS, public F
     QString getText(FPDF_TEXTPAGE textPage, int startIndex, int count);
     QPointF getCharPosition(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
     QRectF getCharBox(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
+    QRectF mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom);
 
     // FPDF takes the rotation parameter as an int.
     // This enum is mapping the int values defined in fpdfview.h:956.
diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 78dfe06fa52..abe0122bfc2 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -3,12 +3,11 @@
 
 #include "qpdfdocument_p.h"
 #include "qpdflink.h"
-#include "qpdflink_p.h"
 #include "qpdfsearchmodel.h"
 #include "qpdfsearchmodel_p.h"
 
-#include "third_party/pdfium/public/fpdf_doc.h"
 #include "third_party/pdfium/public/fpdf_text.h"
+#include "third_party/pdfium/public/fpdfview.h"
 
 #include <QtCore/qelapsedtimer.h>
 #include <QtCore/qloggingcategory.h>
@@ -251,7 +250,6 @@ bool QPdfSearchModelPrivate::doSearch(int page)
         qWarning() << "failed to load page" << page;
         return false;
     }
-    double pageHeight = FPDF_GetPageHeight(pdfPage);
     FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
     if (!textPage) {
         qWarning() << "failed to load text of page" << page;
@@ -269,9 +267,12 @@ bool QPdfSearchModelPrivate::doSearch(int page)
         int startIndex = -1;
         int endIndex = -1;
         for (int r = 0; r < rectCount; ++r) {
+            // get bounding box of search result in page coordinates
             double left, top, right, bottom;
             FPDFText_GetRect(textPage, r, &left, &top, &right, &bottom);
-            rects << QRectF(left, pageHeight - top, right - left, top - bottom);
+            // deal with any internal PDF transforms and
+            // convert to the 1x (pixels = points) 4th-quadrant coordinate system
+            rects << document->d->mapPageToView(pdfPage, left, top, right, bottom);
             if (r == 0) {
                 startIndex = FPDFText_GetCharIndexAtPos(textPage, left, top,
                         CharacterHitTolerance, CharacterHitTolerance);
@@ -280,7 +281,8 @@ bool QPdfSearchModelPrivate::doSearch(int page)
                 endIndex = FPDFText_GetCharIndexAtPos(textPage, right, top,
                         CharacterHitTolerance, CharacterHitTolerance);
             }
-            qCDebug(qLcS) << rects.last() << "char idx" << startIndex << "->" << endIndex;
+            qCDebug(qLcS) << rects.last() << "char idx" << startIndex << "->" << endIndex
+                          << "from page rect" << left << top << right << bottom;
         }
         QString contextBefore, contextAfter;
         if (startIndex >= 0 || endIndex >= 0) {

From b9591cd637e97903d9f4608bbbe7d64f470f6cba Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 20 Mar 2024 22:15:43 -0700
Subject: [PATCH 657/681] Convert "page" <-> "view" coordinates for
 PdfSelection and LinkModel

Use FPDF_PageToDevice() rather than subtracting from page height,
in all the remaining places where we were doing that.
Also use FPDF_DeviceToPage() to convert coordinates coming from
the view, for hit-testing links and for selecting ranges of text.
Mark the private utility functions that we're modifying const
while we're at it.

Task-number: QTBUG-100630
Fixes: QTBUG-106565
Change-Id: Ide4f73b80888a0e08381c6e4995f69ebeaa2d12f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b78c78349d786b294ee0845717ad5db38ae2565a)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 5642f33e17aa82fd361b972cd8ac88ba83604273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 61a65ca969aca620da334de4af14616433ee66a9)
---
 src/pdf/qpdfdocument.cpp                      |  91 ++++++++++++------
 src/pdf/qpdfdocument_p.h                      |  10 +-
 src/pdf/qpdflinkmodel.cpp                     |   8 +-
 tests/auto/pdf/qpdfdocument/CMakeLists.txt    |   2 +
 tests/auto/pdf/qpdfdocument/rotated_text.pdf  | Bin 0 -> 1010 bytes
 .../pdf/qpdfdocument/tagged_mcr_multipage.pdf | Bin 0 -> 1635 bytes
 .../pdf/qpdfdocument/tst_qpdfdocument.cpp     |  84 ++++++++++++++++
 .../multipageview/tst_multipageview.cpp       |   2 +-
 8 files changed, 157 insertions(+), 40 deletions(-)
 create mode 100644 tests/auto/pdf/qpdfdocument/rotated_text.pdf
 create mode 100644 tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf

diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 11d886dc4db..17fdb29b98e 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -446,7 +446,7 @@ void QPdfDocumentPrivate::fpdf_AddSegment(_FX_DOWNLOADHINTS *pThis, size_t offse
     Q_UNUSED(size);
 }
 
-QString QPdfDocumentPrivate::getText(FPDF_TEXTPAGE textPage, int startIndex, int count)
+QString QPdfDocumentPrivate::getText(FPDF_TEXTPAGE textPage, int startIndex, int count) const
 {
     QList<ushort> buf(count + 1);
     // TODO is that enough space in case one unicode character is more than one in utf-16?
@@ -455,23 +455,38 @@ QString QPdfDocumentPrivate::getText(FPDF_TEXTPAGE textPage, int startIndex, int
     return QString::fromUtf16(reinterpret_cast<const char16_t *>(buf.constData()), len - 1);
 }
 
-QPointF QPdfDocumentPrivate::getCharPosition(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex)
+QPointF QPdfDocumentPrivate::getCharPosition(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const
 {
     double x, y;
-    int count = FPDFText_CountChars(textPage);
-    bool ok = FPDFText_GetCharOrigin(textPage, qMin(count - 1, charIndex), &x, &y);
-    if (!ok)
-        return QPointF();
-    return QPointF(x, pageHeight - y);
+    const int count = FPDFText_CountChars(textPage);
+    if (FPDFText_GetCharOrigin(textPage, qMin(count - 1, charIndex), &x, &y))
+        return mapPageToView(pdfPage, x, y);
+    return {};
 }
 
-QRectF QPdfDocumentPrivate::getCharBox(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex)
+QRectF QPdfDocumentPrivate::getCharBox(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const
 {
     double l, t, r, b;
-    bool ok = FPDFText_GetCharBox(textPage, charIndex, &l, &r, &b, &t);
-    if (!ok)
-        return QRectF();
-    return QRectF(l, pageHeight - t, r - l, t - b);
+    if (FPDFText_GetCharBox(textPage, charIndex, &l, &r, &b, &t))
+        return mapPageToView(pdfPage, l, t, r, b);
+    return {};
+}
+
+/*! \internal
+    Convert the point \a x , \a y to the usual 1x (pixels = points)
+    4th-quadrant "view" coordinate system relative to the top-left corner of
+    the rendered page. Some PDF files have internal transforms that make this
+    coordinate system different from "page coordinates", so we cannot just
+    subtract from page height to invert the y coordinates, in general.
+ */
+QPointF QPdfDocumentPrivate::mapPageToView(FPDF_PAGE pdfPage, double x, double y) const
+{
+    const auto pageHeight = FPDF_GetPageHeight(pdfPage);
+    const auto pageWidth = FPDF_GetPageWidth(pdfPage);
+    int rx, ry;
+    if (FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, x, y, &rx, &ry))
+        return QPointF(rx, ry);
+    return {};
 }
 
 /*! \internal
@@ -482,14 +497,31 @@ QRectF QPdfDocumentPrivate::getCharBox(FPDF_TEXTPAGE textPage, double pageHeight
     system different from "page coordinates", so we cannot just
     subtract from page height to invert the y coordinates, in general.
  */
-QRectF QPdfDocumentPrivate::mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom)
+QRectF QPdfDocumentPrivate::mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom) const
 {
     const auto pageHeight = FPDF_GetPageHeight(pdfPage);
     const auto pageWidth = FPDF_GetPageWidth(pdfPage);
     int xfmLeft, xfmTop, xfmRight, xfmBottom;
-    FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, left, top, &xfmLeft, &xfmTop);
-    FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, right, bottom, &xfmRight, &xfmBottom);
-    return QRectF(xfmLeft, xfmTop, xfmRight - xfmLeft, xfmBottom - xfmTop);
+    if ( FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, left, top, &xfmLeft, &xfmTop) &&
+         FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, right, bottom, &xfmRight, &xfmBottom) )
+        return QRectF(xfmLeft, xfmTop, xfmRight - xfmLeft, xfmBottom - xfmTop);
+    return {};
+}
+
+/*! \internal
+    Convert the point \a x , \a y \a from the usual 1x (pixels = points)
+    4th-quadrant "view" coordinate system relative to the top-left corner of
+    the rendered page, to "page coordinates" suited to the given \a pdfPage,
+    which may have arbitrary internal transforms.
+ */
+QPointF QPdfDocumentPrivate::mapViewToPage(FPDF_PAGE pdfPage, QPointF position) const
+{
+    const auto pageHeight = FPDF_GetPageHeight(pdfPage);
+    const auto pageWidth = FPDF_GetPageWidth(pdfPage);
+    double rx, ry;
+    if (FPDF_DeviceToPage(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, position.x(), position.y(), &rx, &ry))
+        return QPointF(rx, ry);
+    return {};
 }
 
 QPdfDocumentPrivate::TextPosition QPdfDocumentPrivate::hitTest(int page, QPointF position)
@@ -498,14 +530,14 @@ QPdfDocumentPrivate::TextPosition QPdfDocumentPrivate::hitTest(int page, QPointF
 
     TextPosition result;
     FPDF_PAGE pdfPage = FPDF_LoadPage(doc, page);
-    double pageHeight = FPDF_GetPageHeight(pdfPage);
     FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
-    int hitIndex = FPDFText_GetCharIndexAtPos(textPage, position.x(), pageHeight - position.y(),
+    const QPointF pagePos = mapViewToPage(pdfPage, position);
+    int hitIndex = FPDFText_GetCharIndexAtPos(textPage, pagePos.x(), pagePos.y(),
                                               CharacterHitTolerance, CharacterHitTolerance);
     if (hitIndex >= 0) {
-        QPointF charPos = getCharPosition(textPage, pageHeight, hitIndex);
+        QPointF charPos = getCharPosition(pdfPage, textPage, hitIndex);
         if (!charPos.isNull()) {
-            QRectF charBox = getCharBox(textPage, pageHeight, hitIndex);
+            QRectF charBox = getCharBox(pdfPage, textPage, hitIndex);
             // If the given position is past the end of the line, i.e. if the right edge of the found character's
             // bounding box is closer to it than the left edge is, we say that we "hit" the next character index after
             if (qAbs(charBox.right() - position.x()) < qAbs(charPos.x() - position.x())) {
@@ -949,11 +981,12 @@ QPdfSelection QPdfDocument::getSelection(int page, QPointF start, QPointF end)
 {
     const QPdfMutexLocker lock;
     FPDF_PAGE pdfPage = FPDF_LoadPage(d->doc, page);
-    double pageHeight = FPDF_GetPageHeight(pdfPage);
+    const QPointF pageStart = d->mapViewToPage(pdfPage, start);
+    const QPointF pageEnd = d->mapViewToPage(pdfPage, end);
     FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
-    int startIndex = FPDFText_GetCharIndexAtPos(textPage, start.x(), pageHeight - start.y(),
+    int startIndex = FPDFText_GetCharIndexAtPos(textPage, pageStart.x(), pageStart.y(),
                                                 CharacterHitTolerance, CharacterHitTolerance);
-    int endIndex = FPDFText_GetCharIndexAtPos(textPage, end.x(), pageHeight - end.y(),
+    int endIndex = FPDFText_GetCharIndexAtPos(textPage, pageEnd.x(), pageEnd.y(),
                                               CharacterHitTolerance, CharacterHitTolerance);
 
     QPdfSelection result;
@@ -964,7 +997,7 @@ QPdfSelection QPdfDocument::getSelection(int page, QPointF start, QPointF end)
 
         // If the given end position is past the end of the line, i.e. if the right edge of the last character's
         // bounding box is closer to it than the left edge is, then extend the char range by one
-        QRectF endCharBox = d->getCharBox(textPage, pageHeight, endIndex);
+        QRectF endCharBox = d->getCharBox(pdfPage, textPage, endIndex);
         if (qAbs(endCharBox.right() - end.x()) < qAbs(endCharBox.x() - end.x()))
             ++endIndex;
 
@@ -976,7 +1009,7 @@ QPdfSelection QPdfDocument::getSelection(int page, QPointF start, QPointF end)
         for (int i = 0; i < rectCount; ++i) {
             double l, r, b, t;
             FPDFText_GetRect(textPage, i, &l, &t, &r, &b);
-            QRectF rect(l, pageHeight - t, r - l, t - b);
+            const QRectF rect = d->mapPageToView(pdfPage, l, t, r, b);
             if (hull.isNull())
                 hull = rect;
             else
@@ -1006,7 +1039,6 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma
         return {};
     const QPdfMutexLocker lock;
     FPDF_PAGE pdfPage = FPDF_LoadPage(d->doc, page);
-    double pageHeight = FPDF_GetPageHeight(pdfPage);
     FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
     int pageCount = FPDFText_CountChars(textPage);
     if (startIndex >= pageCount)
@@ -1021,7 +1053,7 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma
         for (int i = 0; i < rectCount; ++i) {
             double l, r, b, t;
             FPDFText_GetRect(textPage, i, &l, &t, &r, &b);
-            QRectF rect(l, pageHeight - t, r - l, t - b);
+            const QRectF rect = d->mapPageToView(pdfPage, l, t, r, b);
             if (hull.isNull())
                 hull = rect;
             else
@@ -1030,7 +1062,7 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma
         }
     }
     if (bounds.isEmpty())
-        hull = QRectF(d->getCharPosition(textPage, pageHeight, startIndex), QSizeF());
+        hull = QRectF(d->getCharPosition(pdfPage, textPage, startIndex), QSizeF());
     qCDebug(qLcDoc) << "on page" << page << "at index" << startIndex << "maxLength" << maxLength
                     << "got" << text.size() << "chars," << rectCount << "rects within" << hull;
 
@@ -1047,7 +1079,6 @@ QPdfSelection QPdfDocument::getAllText(int page)
 {
     const QPdfMutexLocker lock;
     FPDF_PAGE pdfPage = FPDF_LoadPage(d->doc, page);
-    double pageHeight = FPDF_GetPageHeight(pdfPage);
     FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
     int count = FPDFText_CountChars(textPage);
     if (count < 1)
@@ -1059,7 +1090,7 @@ QPdfSelection QPdfDocument::getAllText(int page)
     for (int i = 0; i < rectCount; ++i) {
         double l, r, b, t;
         FPDFText_GetRect(textPage, i, &l, &t, &r, &b);
-        QRectF rect(l, pageHeight - t, r - l, t - b);
+        const QRectF rect = d->mapPageToView(pdfPage, l, t, r, b);
         if (hull.isNull())
             hull = rect;
         else
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
index 5ec48501219..12092c4ad26 100644
--- a/src/pdf/qpdfdocument_p.h
+++ b/src/pdf/qpdfdocument_p.h
@@ -78,10 +78,12 @@ class Q_PDF_PRIVATE_EXPORT QPdfDocumentPrivate: public FPDF_FILEACCESS, public F
     static int fpdf_GetBlock(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
     static void fpdf_AddSegment(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
     void updateLastError();
-    QString getText(FPDF_TEXTPAGE textPage, int startIndex, int count);
-    QPointF getCharPosition(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
-    QRectF getCharBox(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
-    QRectF mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom);
+    QString getText(FPDF_TEXTPAGE textPage, int startIndex, int count) const;
+    QPointF getCharPosition(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const;
+    QRectF getCharBox(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const;
+    QPointF mapPageToView(FPDF_PAGE pdfPage, double x, double y) const;
+    QRectF mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom) const;
+    QPointF mapViewToPage(FPDF_PAGE pdfPage, QPointF position) const;
 
     // FPDF takes the rotation parameter as an int.
     // This enum is mapping the int values defined in fpdfview.h:956.
diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp
index 366b773446c..645dff21a4d 100644
--- a/src/pdf/qpdflinkmodel.cpp
+++ b/src/pdf/qpdflinkmodel.cpp
@@ -179,7 +179,6 @@ void QPdfLinkModelPrivate::update()
         qCWarning(qLcLink) << "failed to load page" << page;
         return;
     }
-    double pageHeight = FPDF_GetPageHeight(pdfPage);
     q->beginResetModel();
     links.clear();
 
@@ -204,8 +203,7 @@ void QPdfLinkModelPrivate::update()
             std::swap(rect.bottom, rect.top);
 
         QPdfLink linkData;
-        linkData.d->rects << QRectF(rect.left, pageHeight - rect.top,
-                               rect.right - rect.left, rect.top - rect.bottom);
+        linkData.d->rects << document->d->mapPageToView(pdfPage, rect.left, rect.top, rect.right, rect.bottom);
         FPDF_DEST dest = FPDFLink_GetDest(doc, linkAnnot);
         FPDF_ACTION action = FPDFLink_GetAction(linkAnnot);
         switch (FPDFAction_GetType(action)) {
@@ -224,7 +222,7 @@ void QPdfLinkModelPrivate::update()
                 break; // at least we got a page number, so the link will jump there
             }
             if (hasX && hasY)
-                linkData.d->location = QPointF(x, pageHeight - y);
+                linkData.d->location = document->d->mapPageToView(pdfPage, x, y);
             if (hasZoom)
                 linkData.d->zoom = zoom;
             break;
@@ -287,7 +285,7 @@ void QPdfLinkModelPrivate::update()
                     double left, top, right, bottom;
                     bool success = FPDFLink_GetRect(webLinks, i, r, &left, &top, &right, &bottom);
                     if (success) {
-                        linkData.d->rects << QRectF(left, pageHeight - top, right - left, top - bottom);
+                        linkData.d->rects << document->d->mapPageToView(pdfPage, left, top, right, bottom);
                         links << linkData;
                     }
                 }
diff --git a/tests/auto/pdf/qpdfdocument/CMakeLists.txt b/tests/auto/pdf/qpdfdocument/CMakeLists.txt
index aadc192b384..b8300ef27e7 100644
--- a/tests/auto/pdf/qpdfdocument/CMakeLists.txt
+++ b/tests/auto/pdf/qpdfdocument/CMakeLists.txt
@@ -12,5 +12,7 @@ qt_internal_add_test(tst_qpdfdocument
     TESTDATA
         pdf-sample.protected.pdf
         pdf-sample.metadata.pdf
+        rotated_text.pdf
+        tagged_mcr_multipage.pdf
         test.pdf
 )
diff --git a/tests/auto/pdf/qpdfdocument/rotated_text.pdf b/tests/auto/pdf/qpdfdocument/rotated_text.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d6d8db84ed34c7a5e08602a745734b8e3b276bf3
GIT binary patch
diff --git a/tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf b/tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..fcc5fafda4d226585b943a98ba0697a6c73fe8ab
GIT binary patch
diff --git a/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp b/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp
index 6bb007e7fbd..d222bff0cd2 100644
--- a/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp
+++ b/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp
@@ -36,6 +36,10 @@ private slots:
     void passwordClearedOnClose();
     void metaData();
     void pageLabels();
+    void getSelection_data();
+    void getSelection();
+    void getSelectionAtIndex_data();
+    void getSelectionAtIndex();
 
 private:
     void consistencyCheck(QPdfDocument &doc) const;
@@ -394,6 +398,86 @@ void tst_QPdfDocument::pageLabels()
     QCOMPARE(doc.pageLabel(2), "i"); // i of the tiger!
 }
 
+void tst_QPdfDocument::getSelection_data()
+{
+    QTest::addColumn<QString>("pdfPath");
+    QTest::addColumn<int>("page");
+    QTest::addColumn<QPointF>("start");
+    QTest::addColumn<QPointF>("end");
+    QTest::addColumn<QString>("expectedText");
+    QTest::addColumn<int>("expectedStartIndex");
+    QTest::addColumn<int>("expectedEndIndex");
+    QTest::addColumn<QRect>("expectedBounds");
+    QTest::addColumn<int>("expectedPolygonCount");
+
+    QTest::newRow("raid") << QFINDTESTDATA("test.pdf")
+            << 1 << QPointF(316.4, 206) << QPointF(339, 201)
+            << "raid" << 80 << 84 << QRect(316, 201, 21, 12) << 1;
+    QTest::newRow("rotated text") << QFINDTESTDATA("rotated_text.pdf")
+            << 0 << QPointF(102, 94) << QPointF(125, 73)
+            << "world!" << 25 << 31 << QRect(98, 70, 26, 28) << 1;
+}
+
+void tst_QPdfDocument::getSelection()
+{
+    QFETCH(QString, pdfPath);
+    QFETCH(int, page);
+    QFETCH(QPointF, start);
+    QFETCH(QPointF, end);
+    QFETCH(QString, expectedText);
+    QFETCH(int, expectedStartIndex);
+    QFETCH(int, expectedEndIndex);
+    QFETCH(QRect, expectedBounds);
+    QFETCH(int, expectedPolygonCount);
+
+    QPdfDocument doc;
+    QCOMPARE(doc.load(pdfPath), QPdfDocument::Error::None);
+
+    QPdfSelection sel = doc.getSelection(page, start, end);
+    QCOMPARE(sel.text(), expectedText);
+    QCOMPARE(sel.startIndex(), expectedStartIndex);
+    QCOMPARE(sel.endIndex(), expectedEndIndex);
+    QCOMPARE(sel.boundingRectangle().toRect(), expectedBounds);
+    QCOMPARE(sel.bounds().size(), expectedPolygonCount);
+}
+
+void tst_QPdfDocument::getSelectionAtIndex_data()
+{
+    QTest::addColumn<QString>("pdfPath");
+    QTest::addColumn<int>("page");
+    QTest::addColumn<int>("start");
+    QTest::addColumn<int>("maxLen");
+    QTest::addColumn<QString>("expectedText");
+    QTest::addColumn<QRect>("expectedBounds");
+    QTest::addColumn<int>("expectedPolygonCount");
+
+    QTest::newRow("raid") << QFINDTESTDATA("test.pdf")
+            << 1 << 80 << 4 << "raid" << QRect(316, 201, 21, 12) << 1;
+    QTest::newRow("rotated text") << QFINDTESTDATA("rotated_text.pdf")
+            << 0 << 7 << 6 << "world!" << QRect(76, 102, 26, 28) << 1;
+    QTest::newRow("displaced text") << QFINDTESTDATA("tagged_mcr_multipage.pdf")
+            << 0 << 0 << 10 << "1" << QRect(34, 22, 3, 8) << 1;
+}
+
+void tst_QPdfDocument::getSelectionAtIndex()
+{
+    QFETCH(QString, pdfPath);
+    QFETCH(int, page);
+    QFETCH(int, start);
+    QFETCH(int, maxLen);
+    QFETCH(QString, expectedText);
+    QFETCH(QRect, expectedBounds);
+    QFETCH(int, expectedPolygonCount);
+
+    QPdfDocument doc;
+    QCOMPARE(doc.load(pdfPath), QPdfDocument::Error::None);
+
+    QPdfSelection sel = doc.getSelectionAtIndex(page, start, maxLen);
+    QCOMPARE(sel.text(), expectedText);
+    QCOMPARE(sel.boundingRectangle().toRect(), expectedBounds);
+    QCOMPARE(sel.bounds().size(), expectedPolygonCount);
+}
+
 QTEST_MAIN(tst_QPdfDocument)
 
 #include "tst_qpdfdocument.moc"
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
index b64cd47b1b2..c5e0b30dbba 100644
--- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -62,7 +62,7 @@ void tst_MultiPageView::internalLink_data()
     QTest::addColumn<qreal>("expectedZoom");
     QTest::addColumn<QPoint>("expectedScroll");
 
-    QTest::newRow("first link") << 0 << 1 << qreal(1) << QPoint(134, 1276);
+    QTest::newRow("first link") << 0 << 1 << qreal(1) << QPoint(134, 1286);
     // TODO fails because it zooms out, and the view leaves gaps between pages currently
 //    QTest::newRow("second link") << 1 << 2 << qreal(0.5) << QPoint(0, 717);
 }

From b6501a857c30a097ebb59d73aee554440df143bc Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Fri, 26 Apr 2024 19:45:12 +0000
Subject: [PATCH 658/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: I1ab1c5e3ba5255359a1b8ebffe6ed0200a9ce540
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 8322af315e0..3a24c391f06 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 5123c82512e21c46d30f47c5fcb4374018206d86
+    ref: 031d87a1b14194462de018697ee0b6762cf3299e
     required: true
   ../tqtc-qtpositioning:
-    ref: 668a33393a217222e47d753a0a7449adc3117961
+    ref: f54e2f3a64ba2488c90f244473ae7d1c9ebdbd67
     required: false
   ../tqtc-qttools:
-    ref: e355135c948f3609d54932dce646b6e6ab460de6
+    ref: 1e96761ce66cff08a01269b4bc5c5f8ab11346c7
     required: false
   ../tqtc-qtwebchannel:
-    ref: f96b7af84a33bf556969162c16bb3105ad90d5eb
+    ref: 261a502397205b534f733723ee58627d98286377
     required: false

From 1dfa734f1a940a9322b21a42e223fbea8ff02f15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Tue, 5 Mar 2024 09:02:25 +0100
Subject: [PATCH 659/681] Force use of classic linker on AppleClang 15
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The new linker ld_prime became the default option, but has issues when
building large libraries such as Qt WebEngine. Use the temporary work-
around of forcing the classic linker until the issue has been resolved
in AppleClang.

Task-number: QTBUG-122655
Change-Id: I1c21d6b1ac9f1fb89878bf8cc9786d24fe1c94da
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit df40c77a9a2bb2da90c5367f2ed217f027106e8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8a5a1a7beb785c6c15c537f4da5f09c38664e952)
(cherry picked from commit 3f576486d25ff4581f2590e9b2aebaba6f5ac7e2)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 cmake/Functions.cmake | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index f22e96056c2..95b25227794 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1192,6 +1192,15 @@ function(add_gn_build_artifacts_to_target)
         endforeach()
         list(GET archs 0 arch)
         set(target ${arg_NINJA_TARGET}_${config}_${arch})
+        # Work around for broken builds with new Apple linker ld_prime. Force
+        # use of the classic linker until this has been fixed.
+        # TODO: remove once this has been fixed by Apple. See issue FB13667242
+        # or QTBUG-122655 for details.
+        if(APPLECLANG)
+            if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0.0")
+                target_link_options(${arg_CMAKE_TARGET} PRIVATE -ld_classic)
+            endif()
+        endif()
         if(QT_IS_MACOS_UNIVERSAL)
             add_lipo_command(${target} ${arg_BUILDDIR}/${config})
         endif()

From 4dd872ffa5bd1ab63b64d957861041d0dea954bc Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 2 Feb 2024 19:09:43 +0100
Subject: [PATCH 660/681] Minor. Set autodetect for v8 snapshots for cross
 compilation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We do not compile v8 snapshots on ci as this doubles
amount of tasks and ends in much longer compile times.
However, they can be enabled otherwise.

Change-Id: Ie59492af2bf01cdecf9525e708c642249a1ae681
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 6518a973b6c6644403a7d3a2f3d5eacfe0749f72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8cdca960d672b56fd3df13075ca15774f1841920)
(cherry picked from commit b469cb9394d2c211d71295d2358ba3bc6057ce2c)
---
 src/core/api/configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index 48f7cacc002..cf679f72aad 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -66,7 +66,7 @@ qt_feature("webengine-system-alsa" PRIVATE
 )
 qt_feature("webengine-v8-context-snapshot" PRIVATE
     LABEL "Use v8 context snapshot"
-    CONDITION NOT CMAKE_CROSSCOMPILING
+    AUTODETECT NOT CMAKE_CROSSCOMPILING
 )
 qt_feature("webengine-geolocation" PUBLIC
     LABEL "Geolocation"

From d3a798762764a64097b8872444dae9fd53c586b7 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 2 Feb 2024 18:21:05 +0100
Subject: [PATCH 661/681] Use only 'pdbpagesize' linker option for
 webenginecore debug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Using 'pdbpagesize' allows to create larger pdbfiles and
it is needed for debug builds for qwebenginecore as
it gets over 4Gb. However, these files are not yet well
supported by older tooling therefore use the setting
only for webengine debug build.

This allows qtpdf debug builds and webenginecore/qtpdf
release with debug info have functional pdb files
with older tooling like cdb on windows.

Task-number: QTCREATORBUG-30308
Change-Id: Icd79a0d36b2f4b7f767d17ed79de3a4cbf96f1b4
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 2af8c8c0b35bd37ba8df591d928720d2b894e816)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0d1439fdf9b3b437f7bbf0876c92a3b2212175c1)
(cherry picked from commit 90db5b974201b9061ec2238f9c4e89698150d118)
---
 cmake/Functions.cmake | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 95b25227794..40554ad6b9a 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -458,8 +458,10 @@ function(add_linker_options target buildDir completeStatic)
             target_link_options(${cmakeTarget}
                 PRIVATE /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /DELAYLOAD:mfreadwrite.dll /DELAYLOAD:winmm.dll
             )
-            # enable larger PDBs
-            target_link_options(${cmakeTarget} PRIVATE "/pdbpagesize:8192")
+            # enable larger PDBs if webenginecore debug build
+            if(cmakeTarget STREQUAL "WebEngineCore")
+                target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:Debug>:/pdbpagesize:8192>")
+            endif()
         endif()
         target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
         if(NOT completeStatic)

From d2cc5ec12264163341842db483ad609a0f539d57 Mon Sep 17 00:00:00 2001
From: Kaloyan Chehlarski <kaloyan.chehlarski@qt.io>
Date: Tue, 16 Jan 2024 13:29:33 +0100
Subject: [PATCH 662/681] Expand helper process stack to 8MB on Windows
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Chromium on Windows is built with a linker flag that ensures an
initial stack size of 8MB, whereas a QtWebEngine build never sets one.
The result is that on Windows the helper process only gets the default
1MB stack, which can cause stack overflows in pages with nested
elements (see issue QTBUG-120420). This change makes sure the relevant
linker flag is added when a Windows build is detected, and the stack
size matches the one in Chromium.

Task-number: QTBUG-120420
Change-Id: I42ff397f1b90c4455188b5711d5b3e9c1780db23
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e604b302882d4ca4e8b6d311df31d4e958c9073c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f153e8e695c267137130752bfde722a7e9467910)
(cherry picked from commit 07734b927d912f88164001422aa27a507db7be6d)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/process/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index bbe47431fc5..630ba42a8b0 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -25,7 +25,7 @@ if(WIN32)
     set_property(TARGET ${qtWebEngineProcessName} PROPERTY WIN32_EXECUTABLE TRUE)
     # get libs rsp file, since cmake is not aware of PUBLIC libs for WebEngineCore
     get_target_property(libs_rsp WebEngineCore LIBS_RSP)
-    target_link_options(${qtWebEngineProcessName} PRIVATE "@${libs_rsp}")
+    target_link_options(${qtWebEngineProcessName} PRIVATE "@${libs_rsp}" "/STACK:0x800000")
 endif()
 
 if(MACOS)

From 5370c9c82833d7a5585569cac95026a3f59cafbe Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Thu, 25 Jan 2024 16:46:30 +0100
Subject: [PATCH 663/681] Fix misleading warning

This is only relevant for OpenGL or backends that needs to be forced
to OpenGL

Change-Id: Idd96e41c2ca2a87d1dd916e2fadf8945ee25805f
Fixes: QTBUG-99446
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit aeea3674f6aa364ec1b4ee17a2e2c8c03127072b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a057682017e45cb470581a066c0f3ed616ccb8be)
(cherry picked from commit 423f3a98d54c4a722df8078dc480be5eab30e13e)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/webenginequick/api/qtwebenginequickglobal.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/webenginequick/api/qtwebenginequickglobal.cpp b/src/webenginequick/api/qtwebenginequickglobal.cpp
index f8f520a05cb..e24ef643b01 100644
--- a/src/webenginequick/api/qtwebenginequickglobal.cpp
+++ b/src/webenginequick/api/qtwebenginequickglobal.cpp
@@ -37,16 +37,19 @@ namespace QtWebEngineQuick {
 */
 void initialize()
 {
+    auto api = QQuickWindow::graphicsApi();
     if (!QCoreApplication::startingUp()) {
-        qWarning("QtWebEngineQuick::initialize() called with QCoreApplication object already created and should be call before. "\
-                 "This is depreciated and may fail in the future.");
+        if (api == QSGRendererInterface::OpenGL || (api != QSGRendererInterface::Vulkan
+                && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)) {
+            qWarning("QtWebEngineQuick::initialize() called with QCoreApplication object already created and should be call before. "\
+                     "This is depreciated and may fail in the future.");
+        }
         QtWebEngineCore::initialize();
         return;
     }
 
     // call initialize the same way as widgets do
     qAddPreRoutine(QtWebEngineCore::initialize);
-    auto api = QQuickWindow::graphicsApi();
     if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan
             && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)
         QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);

From ae9fbb5bf05af524feaea083d49fa9060b0dceb6 Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Thu, 25 Jan 2024 13:15:45 +0100
Subject: [PATCH 664/681] Keep page's background color when loading new URLs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Whenever a new URL is loaded, the background color is reset to white,
even if the user has explicitly set the background color to a different
value. Therefore, it needs to be reapplied when a new render widget is
created.

Fixes: QTBUG-112013
Fixes: QTBUG-120926
Change-Id: I6663008ee038f30ea6f5df8ab7d8ce7356b152a1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 85bfaa5274b5d47437d6e0634746f70a6646bd4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 603c969421b98a9a285128c589b2c32fded21033)
(cherry picked from commit 798574d834610a80009192631e6720a00b57968d)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/core/web_contents_delegate_qt.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 64ccd529d14..d00f66335c2 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -311,6 +311,9 @@ void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *, con
         Q_ASSERT(rwhv->delegate());
         rwhv->delegate()->adapterClientChanged(m_viewClient);
         m_viewClient->zoomUpdateIsNeeded();
+        auto backgroundColor = m_viewClient->backgroundColor();
+        if (backgroundColor != Qt::white)
+            m_viewClient->webContentsAdapter()->setBackgroundColor(backgroundColor);
     }
 }
 

From c12852b3294409530994fcd33b81df3d6d3ae60a Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Mon, 19 Feb 2024 13:57:45 +0100
Subject: [PATCH 665/681] Retain focus while loading URLs into the  page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

While loading URLs, QtWebEngine will remove the old widget from the
layout and then add the new widget. If the old widget is the focused
widget, while deleting the widget, it will clear its focus, thereby
causing QtWebEngine to lose focus. Therefore, if the old widget has
focus, set focus to the new widget.

Fixes: QTBUG-122153
Change-Id: I095a654ae80ad8089758eb785d4186a9708064a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 0a8962b40de96ca87663938427a410ce65f3a8a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ff9fd8806248973f6fdf92190f11b11af0319437)
(cherry picked from commit d452147ca742ac77f22efd2aa1653a41baad88fe)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/webenginewidgets/api/qwebengineview.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 5aeeeb6382a..e28f70b5f5f 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -1,6 +1,7 @@
 // Copyright (C) 2021 The Qt Company Ltd.
 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 
+#include "qapplication.h"
 #include "qwebenginenotificationpresenter_p.h"
 #include "qwebengineview.h"
 #include "qwebengineview_p.h"
@@ -443,6 +444,8 @@ void QWebEngineViewPrivate::widgetChanged(QtWebEngineCore::WebEngineQuickWidget
 #endif
         q->layout()->addWidget(newWidget);
         q->setFocusProxy(newWidget);
+        if (oldWidget && oldWidget == QApplication::focusWidget())
+            newWidget->setFocus();
         newWidget->show();
     }
 }

From 57e5d9d47cfc9612fb7bdc77aa08dc143d550a10 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 15 Feb 2024 12:31:43 +0100
Subject: [PATCH 666/681] Fix enable_plugins gn parameter use

In 106-based adaptations enable_plugins use was
changed and it means enabling support for handing plugins,
but does not include support for loading plugins using specific
technology like Pepper.

Moreover, enable_pdf requires plugin support, but it  does not
require Pepper support (enable_ppapi).

Fixes: QTBUG-122137
Change-Id: I75cf611e54d0a47e2b96e7831c1fe1d20b6254b5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d66a5433e08bce11f905b14c8a03f3a5e1db2b9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9dc04234d372c43300f013444a56fee30999a83b)
(cherry picked from commit 7d6b43b7bc05ec17111836cc890f6692888f0c1c)
---
 src/core/CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 20ef91637f9..3b2e21d9bfa 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -356,9 +356,14 @@ foreach(arch ${archs})
         )
         extend_gn_list(gnArgArg
             ARGS enable_plugins
-            CONDITION QT_FEATURE_webengine_pepper_plugins
+            CONDITION QT_FEATURE_webengine_printing_and_pdf OR
+            QT_FEATURE_webengine_pepper_plugins
         )
         extend_gn_list(gnArgArg
+            ARGS enable_ppapi
+            CONDITION QT_FEATURE_webengine_pepper_plugins
+        )
+         extend_gn_list(gnArgArg
             ARGS enable_spellcheck
             CONDITION QT_FEATURE_webengine_spellchecker
         )

From 3a3a04de97ccb2672e1d2d5b35cd9a112c6872a1 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Wed, 21 Feb 2024 11:31:21 +0100
Subject: [PATCH 667/681] Fix outdated qwebenginesettings docs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Old webkit's QWebSettings::setUserStyleSheetUrl is not ported
to QWebEngineSettings, therefore do not mention it.

Change-Id: Ibbc804d1c58657a1d641935a2341132cc723cd82
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 084e6675d7d678b3850ba992dae57f8391aca911)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 198a4334129f5754eed413134272eeb76f15435c)
(cherry picked from commit edfef09c0f99996cff4e07c948ea848182e6ff2a)
---
 src/core/doc/src/qwebenginesettings_lgpl.qdoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/doc/src/qwebenginesettings_lgpl.qdoc b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
index 63e9c97102e..d98cef8c9d9 100644
--- a/src/core/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
@@ -15,8 +15,8 @@
     \inmodule QtWebEngineCore
 
     QWebEngineSettings allows configuration of browser properties, such as font sizes and
-    families, the location of a custom style sheet, and generic attributes, such as JavaScript
-    support. Individual attributes are set using the setAttribute() function. The
+    families, and generic attributes, such as JavaScript support.
+    Individual attributes are set using the setAttribute() function. The
     \l{QWebEngineSettings::WebAttribute}{WebAttribute} enum further describes each attribute.
 
     Each QWebEnginePage object has its own QWebEngineSettings object, which configures the

From 9c946eac6ccc4187f1e8c3bb0c27bb267cce9b04 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 29 Feb 2024 15:44:46 +0100
Subject: [PATCH 668/681] Set minimum required VA-API version to 1.14
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Chromium uses av1 encode DDI which has been added to VA-API in version
1.14. Older versions break the build.

Note that the pkg-config returns the VA-API version (1.14) instead of
the libva version (2.14).

Change-Id: I4f206305fd8d9e8bd67385fbd3d3f267cae9b67d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9064c51ae98d339ec89c1ccc0e7c06f9485fecb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bebb06a890fbb4066320ffa2487bd33e39ea044a)
(cherry picked from commit dd541669ed53fffcdb0552019388080a4e594bd0)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/core/api/configure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index cf679f72aad..49ad00ed8b7 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -13,7 +13,7 @@ if(NOT QT_CONFIGURE_RUNNING)
         pkg_check_modules(XDAMAGE xdamage)
         pkg_check_modules(POPPLER_CPP poppler-cpp IMPORTED_TARGET)
         pkg_check_modules(GBM gbm)
-        pkg_check_modules(LIBVA libva)
+        pkg_check_modules(LIBVA libva>=1.14)
         if(NOT GIO_FOUND)
             pkg_check_modules(GIO gio-2.0)
         endif()

From b0b6b7c443769f3bfd8a2f592ff00460788c6fe8 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Thu, 15 Feb 2024 07:52:09 +0100
Subject: [PATCH 669/681] Fix pure wayland builds with vaapi
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add missing build flag checks.

This amends 1b7aaf1c7d98482cd6dc3d80aa0140fe9dd2c7d3.

Task-number: QTBUG-118035
Fixes: QTBUG-121589
Change-Id: I7dc6aae9898133e893b544e392076dc421a51f17
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit fd1946fc90ec75582aa64bcf8f89940e2fc82120)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c732837107e3d4fb172ce0a7d4cf4831b312922e)
(cherry picked from commit 9ec316d79aac27af073bfa31c950012604bdbf9f)
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/core/configure/BUILD.root.gn.in  | 10 +++++++---
 src/core/ozone/ozone_platform_qt.cpp |  5 +++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 7b61ff4ef0f..fe4f306b019 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -356,20 +356,24 @@ source_set("qtwebengine_sources") {
     "//components/embedder_support/user_agent_utils.cc",
     "//components/embedder_support/user_agent_utils.h",
   ]
-  if (use_ozone && use_vaapi) {
+  if (use_vaapi_x11) {
     deps += [
       "//ui/base/x:gl",
       "//ui/gfx/linux:gpu_memory_buffer_support_x11",
     ]
     sources += [
-      "//ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc",
-      "//ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.h",
       "//ui/ozone/platform/x11/gl_egl_utility_x11.cc",
       "//ui/ozone/platform/x11/gl_egl_utility_x11.h",
       "//ui/ozone/platform/x11/native_pixmap_glx_binding.cc",
       "//ui/ozone/platform/x11/native_pixmap_glx_binding.h",
     ]
   }
+  if (use_vaapi) {
+    sources += [
+      "//ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc",
+      "//ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.h",
+    ]
+  }
   if (enable_extensions) {
     deps += [
       ":qtwebengine_extensions_features",
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp
index 8dcb56446fc..12a204f20b0 100644
--- a/src/core/ozone/ozone_platform_qt.cpp
+++ b/src/core/ozone/ozone_platform_qt.cpp
@@ -70,13 +70,14 @@ class OzonePlatformQt : public OzonePlatform {
         static OzonePlatform::PlatformRuntimeProperties properties;
 #if BUILDFLAG(USE_VAAPI)
         if (has_initialized_gpu()) {
+#if BUILDFLAG(USE_VAAPI_X11)
             if (GetQtXDisplay()) {
                 // This property is set when the GetPlatformRuntimeProperties is
                 // called on the gpu process side.
                 properties.supports_native_pixmaps = ui::GpuMemoryBufferSupportX11::GetInstance()->has_gbm_device();
-            } else {
+            } else
+#endif
                 properties.supports_native_pixmaps = true; // buffer_manager_->GetGbmDevice() != nullptr
-            }
         }
 #endif
         return properties;

From 9601fe97d2d839e59d9a0fec58f9a302f0ec548b Mon Sep 17 00:00:00 2001
From: Anu Aliyas <anu.aliyas@qt.io>
Date: Tue, 5 Mar 2024 17:13:49 +0100
Subject: [PATCH 670/681] Correct the dictionary path for spell checking on
 macOS

The Spellchecker built using QtCreator didn't work because it didn't
copy dictionary files to the application bundle's resource folder.
To address this, used 'APPLE' instead of 'MACOS' as the value, since
'MACOS' was false when compiling in QtCreator

Fixes: QTBUG-122997
Change-Id: I86a45b3c3622239873a7745e7b1fed5efbf696d8
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 2a85e96a685b36501dee35e8d70522be239d006d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e1430db3a32c30b3f6c03f26f34b4d86bbbc48b5)
(cherry picked from commit b0173f804599735ddae8c8ac699bd6e1ebd5893d)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/api/Qt6WebEngineCoreMacros.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake
index 6c335aad1df..8bb73154841 100644
--- a/src/core/api/Qt6WebEngineCoreMacros.cmake
+++ b/src/core/api/Qt6WebEngineCoreMacros.cmake
@@ -29,7 +29,7 @@ function(qt6_add_webengine_dictionary)
         set(copyCommand COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_OUTPUT_DIRECTORY}/dict
            ${ARGS_OUTPUT_DIRECTORY}/$<CONFIG>
         )
-    elseif((MACOS OR IOS) AND isBundle)
+    elseif(APPLE AND isBundle)
         get_target_property(outputName ${ARGS_TARGET} OUTPUT_NAME)
         if(NOT outputName)
            set(outputName ${ARGS_TARGET})

From d364c5c63bc0c6cc2eefcb6437819f57289824f6 Mon Sep 17 00:00:00 2001
From: Moss Heim <moss.heim@qt.io>
Date: Fri, 26 Jan 2024 11:51:56 +0100
Subject: [PATCH 671/681] Clarify meaning of baseUrl argument in setContent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The previous wording made it sound as if baseUrl must always be
non-empty, however this only affects external content relative URLs.

Fixes: QTBUG-90927
Change-Id: I0dff3368dec60b5734c1b12bbfe3f4aefc240e14
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 2d52d1544e85b8bd15ea23c42872961b9f9249ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 48e08af384ff42f08106449a07e272195123cc5f)
(cherry picked from commit 1826c6d6d4c708fae14da64d566f303461de5b30)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/doc/src/qwebenginepage_lgpl.qdoc             | 1 +
 src/webenginequick/doc/src/webengineview_lgpl.qdoc    | 5 ++---
 src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc | 7 +++----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/core/doc/src/qwebenginepage_lgpl.qdoc b/src/core/doc/src/qwebenginepage_lgpl.qdoc
index 8f8f5096852..a8a31da113d 100644
--- a/src/core/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginepage_lgpl.qdoc
@@ -710,6 +710,7 @@
     is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
 
     External objects referenced in the content are located relative to \a baseUrl.
+    For external objects with relative URLs to be loaded, \c baseUrl cannot be empty.
 
     The \a data is loaded immediately; external objects are loaded asynchronously.
 
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index 5f4297cb894..cbbec9fd80d 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -356,9 +356,8 @@
     This method offers a lower-level alternative to the \c{url} property,
     which references HTML pages via URL.
 
-    External objects, such as stylesheets or images referenced in the HTML
-    document, should be located relative to \a baseUrl. For external objects to
-    be loaded, \c baseUrl cannot be empty. For example, if \a html
+    \a baseUrl is optional and used to resolve relative URLs in the document,
+    such as referenced images or stylesheets. For example, if \a html
     is retrieved from \c http://www.example.com/documents/overview.html, which
     is the base URL, then an image referenced with the relative URL, \c diagram.png,
     should be at \c{http://www.example.com/documents/diagram.png}.
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 03489640a47..3153ec95223 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -108,9 +108,8 @@
     \fn void QWebEngineView::setHtml(const QString &html, const QUrl &baseUrl)
     Sets the content of the web view to the specified \a html content.
 
-    External objects, such as stylesheets or images referenced in the HTML
-    document, are located relative to \a baseUrl. For external objects to
-    be loaded, \c baseUrl cannot be empty. For example, if \a html
+    \a baseUrl is optional and used to resolve relative URLs in the document,
+    such as referenced images or stylesheets. For example, if \a html
     is retrieved from \c http://www.example.com/documents/overview.html, which
     is the base URL, then an image referenced with the relative URL, \c diagram.png,
     should be at \c{http://www.example.com/documents/diagram.png}.
@@ -144,7 +143,7 @@
     is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
 
     External objects referenced in the content are located relative to \a baseUrl.
-    For external objects to be loaded, \c baseUrl cannot be empty.
+    For external objects with relative URLs to be loaded, \c baseUrl cannot be empty.
 
     The data is loaded immediately; external objects are loaded asynchronously.
 

From 7fc135fa38180f048dcd524207b08353ebaa71e3 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Fri, 15 Dec 2023 17:26:02 +0100
Subject: [PATCH 672/681] Fix error message when dictionary not found
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When there is no existing candidate still return something
so error message can be thrown.

Change-Id: Iab71e089fec8ab88e36395474b6e5d4ecfa1ff4c
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit d86ddb74877342d82c36cb9f47cccb53bf339e23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 49bdd5486dd962fa3bc0c7cba30737c36ddfdff0)
(cherry picked from commit 4e76b8dee87b94a693b0ad118785e2bca018573e)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/web_engine_library_info.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index c03c9a3b232..e7115389962 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -284,6 +284,12 @@ QString dictionariesPath()
                 break;
             }
         }
+
+        if (potentialDictionariesPath.isEmpty()) {
+            // return path for error message
+            potentialDictionariesPath = QCoreApplication::applicationDirPath() % QDir::separator()
+                    % QLatin1String("qtwebengine_dictionaries");
+        }
     }
 
     return potentialDictionariesPath;

From 7970f02aabe725399eb36bb1e0100eca182b433e Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 22 Apr 2024 10:41:03 +0200
Subject: [PATCH 673/681] Disable single threaded mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It deadlocks on startup and qtwayland enabled it for NVidia, which breaks us.

Fixes: QTBUG-124174
Change-Id: Ia87b8c9794c08f99500f21d0fcaeddf19ee08d50
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/core/web_engine_context.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index ae85bb2d6c2..d6c928e589f 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -601,9 +601,6 @@ const static char kDisableInProcGpuThread[] = "QTWEBENGINE_DISABLE_GPU_THREAD";
 bool WebEngineContext::isGpuServiceOnUIThread()
 {
     static bool threadedGpu =
-#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
-            QOpenGLContext::supportsThreadedOpenGL() &&
-#endif
             !qEnvironmentVariableIsSet(kDisableInProcGpuThread);
     return !threadedGpu;
 }

From 5ae4b1a174a952302d155b57063962269438de48 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Wed, 1 May 2024 22:04:49 +0000
Subject: [PATCH 674/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Ib3d6166ae5ff3da7606e539388848851fa5287e5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 3a24c391f06..664c528fbc2 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 031d87a1b14194462de018697ee0b6762cf3299e
+    ref: 2ea97cd53498a0ae9eb6a82fdc8fd4916557940e
     required: true
   ../tqtc-qtpositioning:
-    ref: f54e2f3a64ba2488c90f244473ae7d1c9ebdbd67
+    ref: 229b864efa612725de6a78b0054b0ae5949abdfb
     required: false
   ../tqtc-qttools:
-    ref: 1e96761ce66cff08a01269b4bc5c5f8ab11346c7
+    ref: 6011015dede85d24db190dcea4e6fb7d4c3facee
     required: false
   ../tqtc-qtwebchannel:
-    ref: 261a502397205b534f733723ee58627d98286377
+    ref: 1b1e9578729595f11bfbeaf7b0cbc12306663e2a
     required: false

From 44b4727d97c1d5bb6e7f828fb5fdc5ac22ef8f29 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Thu, 2 May 2024 21:35:51 +0000
Subject: [PATCH 675/681] Update dependencies on 'tqtc/lts-6.5' in
 qt/tqtc-qtwebengine

Change-Id: Ib4d599dd82c538f867c3203109339d27b2007432
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 664c528fbc2..2e4ef78ff70 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: 2ea97cd53498a0ae9eb6a82fdc8fd4916557940e
+    ref: a45270eda3e7ca475ffce2d8d341d2a4a7568f22
     required: true
   ../tqtc-qtpositioning:
-    ref: 229b864efa612725de6a78b0054b0ae5949abdfb
+    ref: ec4299b6cb89b343e596c7811eac77aca8a1cf50
     required: false
   ../tqtc-qttools:
-    ref: 6011015dede85d24db190dcea4e6fb7d4c3facee
+    ref: aa52954aeae42f287f0bc99d984694901e8c787f
     required: false
   ../tqtc-qtwebchannel:
-    ref: 1b1e9578729595f11bfbeaf7b0cbc12306663e2a
+    ref: a4b7953c17a9bfb094f99917cc6de88b29ed4394
     required: false

From 642a4de9b85505889f6de5fcdcb2489b54f87312 Mon Sep 17 00:00:00 2001
From: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Date: Tue, 7 May 2024 19:09:45 +0000
Subject: [PATCH 676/681] Update dependencies on 'tqtc/lts-6.5.6' in
 qt/tqtc-qtwebengine

Change-Id: I6b1122c6f465c5bfc867eca191efa4a49ed346f0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
---
 dependencies.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dependencies.yaml b/dependencies.yaml
index 2e4ef78ff70..21b73a6c7f5 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
 dependencies:
   ../tqtc-qtdeclarative:
-    ref: a45270eda3e7ca475ffce2d8d341d2a4a7568f22
+    ref: 0bbb1c4e12e7d027b452a946652049f353a41132
     required: true
   ../tqtc-qtpositioning:
-    ref: ec4299b6cb89b343e596c7811eac77aca8a1cf50
+    ref: 384e6155a739c96be5f07a29ac4953463405d960
     required: false
   ../tqtc-qttools:
-    ref: aa52954aeae42f287f0bc99d984694901e8c787f
+    ref: b4920210050c18913531ac237f294e2632a2edda
     required: false
   ../tqtc-qtwebchannel:
-    ref: a4b7953c17a9bfb094f99917cc6de88b29ed4394
+    ref: 951929518a183f9dd254603140a33be1fc9f35f6
     required: false

From f0492da76a58da526cf2463dc9c51fcda9c490b7 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 7 May 2024 11:31:04 +0200
Subject: [PATCH 677/681] Update Chromium

Submodule src/3rdparty 707f4e7c0..221f2bc6e:
  > FIXUP [Backport] Security bug 40940917
  > [Backport] CVE-2024-4331: Use after free in Picture In Picture
  > [Backport] Security bug 323898565
  > [Backport] CVE-2024-3914: Use after free in V8 (2/2)
  > [Backport] CVE-2024-3914: Use after free in V8 (1/2)
  > [Backport] Security bug 326498393
  > [Backport] Dependency for security bug 326498393 (3/3)
  > [Backport] Dependency for security bug 326498393 (2/3)
  > [Backport] Dependency for security bug 326498393 (1/3)
  > [Backport] Security bug 327698060
  > [Backport] CVE-2024-4058: Type Confusion in ANGLE
  > [Backport] Security bug 40940917
  > [Backport] CVE-2024-3837: Use after free in QUIC
  > [Backport] CVE-2024-3839: Out of bounds read in Fonts
  > [Backport] Security bug 326521449
  > [Backport] CVE-2024-3516: Heap buffer overflow in ANGLE
  > [Backport] CVE-2024-3157: Out of bounds write in Compositing
  > [Backport] Security bug 329674887 (2/2)
  > [Backport] Security bug 329674887 (1/2)
  > [Backport] Security bug 326349405
  > [Backport] CVE-2024-2626: Out of bounds read in Swiftshader (2/2)
  > [Backport] CVE-2024-2626: Out of bounds read in Swiftshader (1/2)
  > [Backport] CVE-2024-2625: Object lifecycle issue in V8
  > [Backport] CVE-2024-3159: Out of bounds memory access in V8
  > [Backport] Security bug 327183408
  > [Backport] CVE-2024-2887: Type Confusion in WebAssembly
  > [Backport] Security bug 41495984
  > Fix OOM crash when doing arm64 builds with old gcc-10
  > Fix windows build with newest compiler
  > Fix build race condition for ozone build flags
  > [Backport] Fix build with newer libc++
  > [Backport] Fix crash when printing on Windows debug builds
  > Fix python warning in gen.py
  > CVE-2023-7104
  > [Backport] Security bug 325296797
  > [Backport] CVE-2024-25062 / Security bug 325094430
  > [Backport] CVE-2024-1671: Inappropriate implementation in Site Isolation (2/2)
  > [Backport] CVE-2024-1671: Inappropriate implementation in Site Isolation (1/2)
  > [Backport] CVE-2024-1676: Inappropriate implementation in Navigation
  > [Backport] CVE-2024-1672: Inappropriate implementation in Content Security Policy.
  > [Backport] CVE-2024-1670: Use after free in Mojo
  > [Backport] Security bug 1504473 / 40945008
  > [Backport] Security bug 1508758 / 41481379
  > [Backport] Security bug 1518994
  > Do not assert when ozone uses qt platform with vaapi

Change-Id: I0d8ea7cfed252bd583e54552dcae96c79f5b8b69
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 485c695c5c9154059c0c599c572a78c6e3b856e9)
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 707f4e7c011..221f2bc6e71 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 707f4e7c0110c33df3d36a1942ad1b0ea2cb997b
+Subproject commit 221f2bc6e7199b53ddab406fe23c6c3f8c9feba4

From 72b07746858ccfc040f43ace5f751000b4e70449 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 10 May 2024 17:01:44 +0200
Subject: [PATCH 678/681] Update Chromium security patch level version

Pick-to: tqtc/lts-6.5
Change-Id: Id16ca84ecd1158f1684f00fa67ce34a2b9996674
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 76c045625d1..bbefae18606 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           121.0.6167.160
+Patched with security patches up to Chromium version:           124.0.6367.118
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index d6c928e589f..42f97f075ee 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "121.0.6167.160"; // FIXME: Remember to update
+    return "124.0.6367.118"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From 3822f4dc78f2dd693bf7ffd9cc490eb86a0300d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Mon, 13 May 2024 11:19:51 +0200
Subject: [PATCH 679/681] Update Chromium

Submodule src/3rdparty 221f2bc6..055b74f5:
  * [Backport] Security bug 339458194 (CVE-2024-4761)
  * [Backport] CVE-2024-4558: Use after free in ANGLE
  * [Backport] CVE-2024-4671: Use after free in Visuals
  * [Backport] Security bug 332724843
  * [Backport] CVE-2024-3840: Insufficient policy enforcement in Site Isolation

Fixes: QTBUG-125264
Fixes: QTBUG-125265
Fixes: QTBUG-125294
Pick-to: tqtc/lts-6.5
Change-Id: I6f6be98131dc66be00d156e178dad29d3103eb13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 CHROMIUM_VERSION                | 2 +-
 src/3rdparty                    | 2 +-
 src/core/web_engine_context.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index bbefae18606..0361e1449db 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
 
 Based on Chromium version:                                      112.0.5615.213
-Patched with security patches up to Chromium version:           124.0.6367.118
+Patched with security patches up to Chromium version:           124.0.6367.208
diff --git a/src/3rdparty b/src/3rdparty
index 221f2bc6e71..055b74f5564 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 221f2bc6e7199b53ddab406fe23c6c3f8c9feba4
+Subproject commit 055b74f55646f0955506d3bf7d42c31e706ed0ad
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 42f97f075ee..81de7833fdf 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -982,7 +982,7 @@ const char *qWebEngineChromiumVersion() noexcept
 
 const char *qWebEngineChromiumSecurityPatchVersion() noexcept
 {
-    return "124.0.6367.118"; // FIXME: Remember to update
+    return "124.0.6367.208"; // FIXME: Remember to update
 }
 
 QT_END_NAMESPACE

From a5c877a572ba00331203b96f03c08ec826ce5242 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Fri, 17 May 2024 09:24:00 +0200
Subject: [PATCH 680/681] Blacklist flaky favicon qml tests on macos

Pick-to: tqtc/lts-6.5
Change-Id: If21058458c01019cfd227cf27d42343e8a4fab1c
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
---
 tests/auto/quick/qmltests/BLACKLIST | 33 +++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index fc8f9f0d8bd..ef580a636cb 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -4,6 +4,39 @@ macos
 [WebEngineViewContextMenu::test_contextMenuLinkAndSelectedText]
 macos
 
+[WebEngineFavicon::test_bestFavicon]
+macos
+
+[WebEngineFavicon::test_dynamicFavicon]
+macos
+
+[WebEngineFavicon::test_faviconLoad]
+macos
+
+[WebEngineFavicon::test_faviconLoadAfterHistoryNavigation]
+macos
+
+[WebEngineFavicon::test_faviconLoadEncodedUrl]
+macos
+
+[WebEngineFavicon::test_faviconLoadPushState]
+macos
+
+[WebEngineFavicon::test_multiIcon]
+macos
+
+[WebEngineFavicon::test_touchIcon]
+macos
+
+[WebEngineFavicon::test_touchIconWithSameURL]
+macos
+
+[WebEngineFaviconDatabase::test_iconDatabase]
+macos
+
+[WebEngineFaviconDatabase::test_iconDatabaseMultiView]
+macos
+
 [CertificateError::test_fatalError]
 *
 

From 0efae85f199a61fd6919703cfbb74d680d9a9443 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Thu, 16 May 2024 09:40:42 +0200
Subject: [PATCH 681/681] Update Chromium
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Submodule src/3rdparty 055b74f5..be3ba7a0:
  * [Backport] Security bug 340221135

Pick-to: tqtc/lts-6.5
Task-number: QTBUG-125391
Change-Id: I9a6d91bce9e797969b58e1ec384af86e7da35c4f
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 src/3rdparty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty b/src/3rdparty
index 055b74f5564..be3ba7a0ebb 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 055b74f55646f0955506d3bf7d42c31e706ed0ad
+Subproject commit be3ba7a0ebb340b9498e82c3506cf46ec5ddbee6
