[WinCairo][MiniBrowser] Pull down menu "Disable JavaScript" doesn't work.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 08:00:41 +0000 (08:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 08:00:41 +0000 (08:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196727

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-04-10
Reviewed by Fujii Hironori.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244106 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/MiniBrowser/win/WebKitBrowserWindow.cpp

index aa0eafa..2a03dbc 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-10  Takashi Komori  <Takashi.Komori@sony.com>
+
+        [WinCairo][MiniBrowser] Pull down menu "Disable JavaScript" doesn't work.
+        https://bugs.webkit.org/show_bug.cgi?id=196727
+
+        Reviewed by Fujii Hironori.
+
+        * MiniBrowser/win/WebKitBrowserWindow.cpp:
+        (WebKitBrowserWindow::create):
+
 2019-04-09  Aakash Jain  <aakash_jain@apple.com>
 
         [ews-build] Add unit tests for PrintConfiguration
index 85de446..5a6e92c 100644 (file)
@@ -106,16 +106,21 @@ WKRetainPtr<WKURLRef> createWKURL(const std::wstring& str)
 
 Ref<BrowserWindow> WebKitBrowserWindow::create(HWND mainWnd, HWND urlBarWnd, bool, bool)
 {
-    auto conf = WKPageConfigurationCreate();
+    auto conf = adoptWK(WKPageConfigurationCreate());
 
-    auto prefs = WKPreferencesCreate();
-    WKPreferencesSetDeveloperExtrasEnabled(prefs, true);
-    WKPageConfigurationSetPreferences(conf, prefs);
+    auto prefs = adoptWK(WKPreferencesCreate());
 
-    auto context = WKContextCreateWithConfiguration(nullptr);
-    WKPageConfigurationSetContext(conf, context);
+    auto pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(createWKString("WinMiniBrowser").get()));
+    WKPageConfigurationSetPageGroup(conf.get(), pageGroup.get());
+    WKPageGroupSetPreferences(pageGroup.get(), prefs.get());
 
-    return adoptRef(*new WebKitBrowserWindow(conf, mainWnd, urlBarWnd));
+    WKPreferencesSetDeveloperExtrasEnabled(prefs.get(), true);
+    WKPageConfigurationSetPreferences(conf.get(), prefs.get());
+
+    auto context =adoptWK(WKContextCreateWithConfiguration(nullptr));
+    WKPageConfigurationSetContext(conf.get(), context.get());
+
+    return adoptRef(*new WebKitBrowserWindow(conf.get(), mainWnd, urlBarWnd));
 }
 
 WebKitBrowserWindow::WebKitBrowserWindow(WKPageConfigurationRef conf, HWND mainWnd, HWND urlBarWnd)