From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2263D158097 for ; Mon, 20 Jun 2022 18:03:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 606C7E0B9D; Mon, 20 Jun 2022 18:03:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 41F00E0B9D for ; Mon, 20 Jun 2022 18:03:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4880F34140E for ; Mon, 20 Jun 2022 18:03:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7C96F514 for ; Mon, 20 Jun 2022 18:03:27 +0000 (UTC) From: "Jimi Huotari" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jimi Huotari" Message-ID: <1655748124.5202ae3dc355b004b9996c7efa96652337bc6be5.chiitoo@gentoo> Subject: [gentoo-commits] proj/qt:master commit in: dev-qt/qtwebengine/, dev-qt/qtwebengine/files/ X-VCS-Repository: proj/qt X-VCS-Files: dev-qt/qtwebengine/files/qtwebengine-6.3.0-fix-user-navigation.patch dev-qt/qtwebengine/files/qtwebengine-6.3.0-system-icu.patch dev-qt/qtwebengine/qtwebengine-6.3.0.ebuild X-VCS-Directories: dev-qt/qtwebengine/ dev-qt/qtwebengine/files/ X-VCS-Committer: chiitoo X-VCS-Committer-Name: Jimi Huotari X-VCS-Revision: 5202ae3dc355b004b9996c7efa96652337bc6be5 X-VCS-Branch: master Date: Mon, 20 Jun 2022 18:03:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cf734db5-14ff-447f-b352-c041f61b94a5 X-Archives-Hash: d6f7dcdeba13ca95eef64419f9f10609 commit: 5202ae3dc355b004b9996c7efa96652337bc6be5 Author: Jimi Huotari gentoo org> AuthorDate: Thu Jun 9 14:02:45 2022 +0000 Commit: Jimi Huotari gentoo org> CommitDate: Mon Jun 20 18:02:04 2022 +0000 URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=5202ae3d dev-qt/qtwebengine: add/adjust patches for qt6 Add a bug link to the system-icu fix, and an additional patch to first QTBUG-103778 [1]. 1. https://bugreports.qt.io/browse/QTBUG-103778 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Jimi Huotari gentoo.org> .../qtwebengine-6.3.0-fix-user-navigation.patch | 146 +++++++++++++++++++++ .../files/qtwebengine-6.3.0-system-icu.patch | 4 + dev-qt/qtwebengine/qtwebengine-6.3.0.ebuild | 5 +- 3 files changed, 154 insertions(+), 1 deletion(-) diff --git a/dev-qt/qtwebengine/files/qtwebengine-6.3.0-fix-user-navigation.patch b/dev-qt/qtwebengine/files/qtwebengine-6.3.0-fix-user-navigation.patch new file mode 100644 index 00000000..4afc39a9 --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-6.3.0-fix-user-navigation.patch @@ -0,0 +1,146 @@ +Retrieved from: + +- https://code.qt.io/cgit/qt/qtwebengine.git/patch/?id=8d0bd4b1 +- https://bugreports.qt.io/browse/QTBUG-103778 + +From 8d0bd4b1a18ff886f360e71942f95858b5995ba3 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen +Date: Tue, 24 May 2022 16:56:41 +0200 +Subject: Fix local->remote user navigation + +Specifically allow user initiated navigation of the mainframe. + +Fixes: QTBUG-103778 +Change-Id: I4e3d6b4fb606bd0c3cf66e090fba3c97c8c535b4 +Reviewed-by: Michal Klocek +(cherry picked from commit 2ba1f04b4589e5883a399b022b7795266c4d4646) +Reviewed-by: Qt Cherry-pick Bot +--- + src/core/net/proxying_url_loader_factory_qt.cpp | 19 ++++++- + .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 65 ++++++++++++++++++++++ + 2 files changed, 81 insertions(+), 3 deletions(-) + +diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp +index 39630cf2d..ba2051d60 100644 +--- a/src/core/net/proxying_url_loader_factory_qt.cpp ++++ b/src/core/net/proxying_url_loader_factory_qt.cpp +@@ -280,10 +280,23 @@ void InterceptedRequest::Restart() + + // Check if non-local access is allowed + if (!allow_remote_ && remote_access_) { +- target_client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_NETWORK_ACCESS_DENIED)); +- delete this; +- return; ++ bool granted_special_access = false; ++ switch (ui::PageTransition(request_.transition_type)) { ++ case ui::PAGE_TRANSITION_LINK: ++ case ui::PAGE_TRANSITION_TYPED: ++ if (blink::mojom::ResourceType(request_.resource_type) == blink::mojom::ResourceType::kMainFrame && request_.has_user_gesture) ++ granted_special_access = true; // allow normal explicit navigation ++ break; ++ default: ++ break; ++ } ++ if (!granted_special_access) { ++ target_client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_NETWORK_ACCESS_DENIED)); ++ delete this; ++ return; ++ } + } ++ + // Check if local access is allowed + if (!allow_local_ && local_access_) { + bool granted_special_access = false; +diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +index 227f33c17..32f866810 100644 +--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp ++++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +@@ -257,6 +257,8 @@ private Q_SLOTS: + void testChooseFilesParameters(); + void fileSystemAccessDialog(); + ++ void localToRemoteNavigation(); ++ + private: + static QPoint elementCenter(QWebEnginePage *page, const QString &id); + static bool isFalseJavaScriptResult(QWebEnginePage *page, const QString &javaScript); +@@ -328,6 +330,14 @@ void tst_QWebEnginePage::initTestCase() + QWebEngineUrlScheme echo("echo"); + echo.setSyntax(QWebEngineUrlScheme::Syntax::Path); + QWebEngineUrlScheme::registerScheme(echo); ++ ++ QWebEngineUrlScheme local("local"); ++ local.setFlags(QWebEngineUrlScheme::LocalScheme); ++ QWebEngineUrlScheme::registerScheme(local); ++ ++ QWebEngineUrlScheme remote("remote"); ++ remote.setFlags(QWebEngineUrlScheme::CorsEnabled); ++ QWebEngineUrlScheme::registerScheme(remote); + } + + void tst_QWebEnginePage::cleanupTestCase() +@@ -5010,6 +5020,61 @@ void tst_QWebEnginePage::isSafeRedirect() + spy.clear(); + } + ++class LocalRemoteUrlSchemeHandler : public QWebEngineUrlSchemeHandler ++{ ++public: ++ LocalRemoteUrlSchemeHandler(QObject *parent = nullptr) ++ : QWebEngineUrlSchemeHandler(parent) ++ { ++ } ++ ~LocalRemoteUrlSchemeHandler() = default; ++ ++ void requestStarted(QWebEngineUrlRequestJob *job) override ++ { ++ QBuffer *buffer = new QBuffer(job); ++ buffer->setData("Click link"); ++ job->reply("text/html", buffer); ++ loaded = true; ++ } ++ bool loaded = false; ++}; ++ ++void tst_QWebEnginePage::localToRemoteNavigation() ++{ ++ LocalRemoteUrlSchemeHandler local; ++ LocalRemoteUrlSchemeHandler remote; ++ QWebEngineProfile profile; ++ profile.installUrlSchemeHandler("local", &local); ++ profile.installUrlSchemeHandler("remote", &remote); ++ ++ QWebEnginePage page(&profile); ++ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); ++ QWebEngineView view; ++ view.resize(640, 480); ++ view.show(); ++ view.setPage(&page); ++ page.setUrl(QUrl("local://test.html")); ++ QVERIFY(QTest::qWaitForWindowExposed(&view)); ++ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000); ++ QVERIFY(local.loaded); ++ ++ // Should navigate: ++ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link")); ++ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 2, 20000); ++ QVERIFY(remote.loaded); ++ local.loaded = false; ++ remote.loaded = false; ++ ++ page.setUrl(QUrl("local://test.html")); ++ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 3, 20000); ++ QVERIFY(local.loaded && !remote.loaded); ++ ++ // Should not navigate: ++ page.runJavaScript(QStringLiteral("document.getElementById(\"link\").click()")); ++ QTest::qWait(500); ++ QVERIFY(!remote.loaded); ++} ++ + static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")}; + W_QTEST_MAIN(tst_QWebEnginePage, params) + +-- +cgit v1.2.1 + diff --git a/dev-qt/qtwebengine/files/qtwebengine-6.3.0-system-icu.patch b/dev-qt/qtwebengine/files/qtwebengine-6.3.0-system-icu.patch index 1cb94de2..5cf41a25 100644 --- a/dev-qt/qtwebengine/files/qtwebengine-6.3.0-system-icu.patch +++ b/dev-qt/qtwebengine/files/qtwebengine-6.3.0-system-icu.patch @@ -1,3 +1,7 @@ +Retrieved from: + +- https://bugs.gentoo.org/show_bug.cgi?id=838742 + From 75f0f4eb1e4f2823c39fe27137f78ac2c10bc293 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Thu, 31 Mar 2022 19:45:39 +0200 diff --git a/dev-qt/qtwebengine/qtwebengine-6.3.0.ebuild b/dev-qt/qtwebengine/qtwebengine-6.3.0.ebuild index 23eed817..26784071 100644 --- a/dev-qt/qtwebengine/qtwebengine-6.3.0.ebuild +++ b/dev-qt/qtwebengine/qtwebengine-6.3.0.ebuild @@ -87,7 +87,10 @@ DEPEND="${RDEPEND} media-libs/libglvnd " -PATCHES=( "${FILESDIR}/${PN}-6.3.0-system-icu.patch" ) # https://bugs.gentoo.org/838742 +PATCHES=( + "${FILESDIR}/${PN}-6.3.0-system-icu.patch" # https://bugs.gentoo.org/838742 + "${FILESDIR}/${PN}-6.3.0-fix-user-navigation.patch" # https://bugreports.qt.io/browse/QTBUG-103778 +) python_check_deps() { has_version "dev-python/html5lib[${PYTHON_USEDEP}]"