summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/web_contents_adapter.cpp9
-rw-r--r--src/core/web_contents_delegate_qt.cpp11
-rw-r--r--src/core/web_contents_delegate_qt.h1
-rw-r--r--tests/auto/widgets/qwebenginesettings/BLACKLIST2
4 files changed, 9 insertions, 14 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 4ebed8fc9..63cda7fa1 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1052,6 +1052,15 @@ void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & we
Q_D(WebContentsAdapter);
CHECK_INITIALIZED();
d->webContents->GetRenderViewHost()->UpdateWebkitPreferences(webPreferences);
+
+ // In case of updating preferences during navigation, there might be a pending RVH what will
+ // be active on successful navigation.
+ content::RenderFrameHost *pendingRFH = (static_cast<content::WebContentsImpl*>(d->webContents.get()))->GetPendingMainFrame();
+ if (pendingRFH) {
+ content::RenderViewHost *pendingRVH = pendingRFH->GetRenderViewHost();
+ Q_ASSERT(pendingRVH);
+ pendingRVH->UpdateWebkitPreferences(webPreferences);
+ }
}
void WebContentsAdapter::download(const QUrl &url, const QString &suggestedFileName,
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 7f3ced8aa..aae7f4a43 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -527,17 +527,6 @@ void WebContentsDelegateQt::ActivateContents(content::WebContents* contents)
contents->Focus();
}
-void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *old_host, content::RenderViewHost *new_host)
-{
- Q_ASSERT(new_host);
-
- // The old RVH can be nullptr if it was shut down.
- if (!old_host)
- return;
-
- new_host->UpdateWebkitPreferences(old_host->GetWebkitPreferences());
-}
-
void WebContentsDelegateQt::RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target)
{
Q_UNUSED(user_gesture);
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 43badf60e..2ef87ccd8 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -139,7 +139,6 @@ public:
void WasShown() override;
void DidFirstVisuallyNonEmptyPaint() override;
void ActivateContents(content::WebContents* contents) override;
- void RenderViewHostChanged(content::RenderViewHost *old_host, content::RenderViewHost *new_host) override;
void didFailLoad(const QUrl &url, int errorCode, const QString &errorDescription);
void overrideWebPreferences(content::WebContents *, content::WebPreferences*);
diff --git a/tests/auto/widgets/qwebenginesettings/BLACKLIST b/tests/auto/widgets/qwebenginesettings/BLACKLIST
deleted file mode 100644
index 81226540d..000000000
--- a/tests/auto/widgets/qwebenginesettings/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[setInAcceptNavigationRequest]
-*