public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jimi Huotari" <chiitoo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/qt:master commit in: dev-qt/qtwebengine/, dev-qt/qtwebengine/files/
Date: Mon, 20 Jun 2022 18:03:27 +0000 (UTC)	[thread overview]
Message-ID: <1655748124.5202ae3dc355b004b9996c7efa96652337bc6be5.chiitoo@gentoo> (raw)

commit:     5202ae3dc355b004b9996c7efa96652337bc6be5
Author:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 14:02:45 2022 +0000
Commit:     Jimi Huotari <chiitoo <AT> gentoo <DOT> 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 <chiitoo <AT> 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 <allan.jensen@qt.io>
+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 <michal.klocek@qt.io>
+(cherry picked from commit 2ba1f04b4589e5883a399b022b7795266c4d4646)
+Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
+---
+ 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("<html><body><a href='remote://test.html' id='link'>Click link</a></body></html>");
++        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 <kirill.burtsev@qt.io>
 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}]"


             reply	other threads:[~2022-06-20 18:03 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 18:03 Jimi Huotari [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-11 20:43 [gentoo-commits] proj/qt:master commit in: dev-qt/qtwebengine/, dev-qt/qtwebengine/files/ Andreas Sturmlechner
2024-11-21 15:58 Andreas Sturmlechner
2024-11-21 15:58 Andreas Sturmlechner
2024-11-21 15:58 Andreas Sturmlechner
2024-05-30 12:56 Andreas Sturmlechner
2023-04-10 21:41 Andreas Sturmlechner
2022-04-26 15:03 Jimi Huotari
2022-04-05 17:07 Andreas Sturmlechner
2022-04-01 18:23 Andreas Sturmlechner
2021-12-24 23:57 Andreas Sturmlechner
2021-12-24 23:57 Andreas Sturmlechner
2021-11-16  0:55 Jimi Huotari
2021-09-30 11:35 Andreas Sturmlechner
2021-09-30 11:35 Andreas Sturmlechner
2021-09-30 11:35 Andreas Sturmlechner
2021-03-25 23:49 Andreas Sturmlechner
2020-02-08 20:35 Andreas Sturmlechner
2019-10-28 21:23 Andreas Sturmlechner
2019-10-28 21:23 Andreas Sturmlechner
2019-10-23 23:38 Andreas Sturmlechner
2019-10-19 22:43 Andreas Sturmlechner
2019-09-11 12:44 Andreas Sturmlechner
2019-05-01  9:26 Michael Palimaka
2019-03-06 20:55 Jimi Huotari
2018-12-18 18:55 Andreas Sturmlechner
2018-11-13 17:52 Andreas Sturmlechner
2018-10-17 16:21 Jimi Huotari
2018-08-24 22:58 Jimi Huotari
2018-08-16 12:20 Jimi Huotari
2018-07-25 19:22 Jimi Huotari
2018-07-25 11:55 Jimi Huotari
2018-06-20 15:29 Andreas Sturmlechner
2018-06-20 15:29 Andreas Sturmlechner
2018-06-20 15:29 Andreas Sturmlechner
2018-06-19 20:12 Jimi Huotari
2018-06-16 18:04 Andreas Sturmlechner
2018-02-09 10:46 Michael Palimaka
2018-02-07 10:30 Michael Palimaka
2017-12-10  1:48 Michael Palimaka
2017-12-05 11:25 Michael Palimaka
2017-06-04 11:55 Michael Palimaka
2017-06-01 14:16 Michael Palimaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1655748124.5202ae3dc355b004b9996c7efa96652337bc6be5.chiitoo@gentoo \
    --to=chiitoo@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox