Title: [293507] trunk
Revision
293507
Author
commit-qu...@webkit.org
Date
2022-04-27 06:16:03 -0700 (Wed, 27 Apr 2022)

Log Message

[GLib] Make WebKitSettings XSS auditor functions no-op
https://bugs.webkit.org/show_bug.cgi?id=239651

Patch by Michael Catanzaro <mcatanz...@gnome.org> on 2022-04-27
Reviewed by Adrian Perez de Castro.

Let's deprecate these functions.

Also, do not print warnings because they are called during init by the property setters.

* Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_get_enable_xss_auditor):
(webkit_settings_set_enable_xss_auditor):
* Source/WebKit/UIProcess/API/gtk/WebKitSettings.h:
* Source/WebKit/UIProcess/API/wpe/WebKitSettings.h:

Canonical link: https://commits.webkit.org/250038@main

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (293506 => 293507)


--- trunk/Source/WebKit/ChangeLog	2022-04-27 13:12:28 UTC (rev 293506)
+++ trunk/Source/WebKit/ChangeLog	2022-04-27 13:16:03 UTC (rev 293507)
@@ -1,3 +1,21 @@
+2022-04-26  Michael Catanzaro  <mcatanz...@redhat.com>
+
+        [GLib] Make WebKitSettings XSS auditor functions no-op
+        https://bugs.webkit.org/show_bug.cgi?id=239651
+        <rdar://problem/92304443>
+
+        Reviewed by Adrian Perez de Castro.
+
+        Let's deprecate these functions.
+
+        Also, do not print warnings because they are called during init by the property setters.
+
+        * UIProcess/API/glib/WebKitSettings.cpp:
+        (webkit_settings_get_enable_xss_auditor):
+        (webkit_settings_set_enable_xss_auditor):
+        * UIProcess/API/gtk/WebKitSettings.h:
+        * UIProcess/API/wpe/WebKitSettings.h:
+
 2022-04-27  Youenn Fablet  <you...@apple.com>
 
         service worker update should refresh imported scripts in addition to the main script

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp (293506 => 293507)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp	2022-04-27 13:12:28 UTC (rev 293506)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp	2022-04-27 13:16:03 UTC (rev 293507)
@@ -1813,16 +1813,16 @@
  * webkit_settings_get_enable_xss_auditor:
  * @settings: a #WebKitSettings
  *
- * Get the #WebKitSettings:enable-xss-auditor property.
+ * The XSS auditor has been removed. This function returns %FALSE.
  *
- * Returns: %TRUE If XSS auditing is enabled or %FALSE otherwise.
+ * Returns: %FALSE
+ *
+ * Deprecated: 2.38. This function does nothing.
  */
 gboolean webkit_settings_get_enable_xss_auditor(WebKitSettings* settings)
 {
     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
 
-    g_warning("webkit_settings_get_enable_xss_auditor is deprecated and always returns FALSE. XSS auditor is no longer supported.");
-
     return FALSE;
 }
 
@@ -1831,14 +1831,13 @@
  * @settings: a #WebKitSettings
  * @enabled: Value to be set
  *
- * Set the #WebKitSettings:enable-xss-auditor property.
+ * The XSS auditor has been removed. This function does nothing.
+ *
+ * Deprecated: 2.38. This function does nothing.
  */
 void webkit_settings_set_enable_xss_auditor(WebKitSettings* settings, gboolean enabled)
 {
     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
-
-    if (enabled)
-        g_warning("webkit_settings_set_enable_xss_auditor is deprecated and does nothing. XSS auditor is no longer supported.");
 }
 
 /**

Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitSettings.h (293506 => 293507)


--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitSettings.h	2022-04-27 13:12:28 UTC (rev 293506)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitSettings.h	2022-04-27 13:16:03 UTC (rev 293507)
@@ -135,10 +135,10 @@
 WEBKIT_API void
 webkit_settings_set_enable_html5_database                      (WebKitSettings *settings,
                                                                 gboolean        enabled);
-WEBKIT_API gboolean
+WEBKIT_DEPRECATED gboolean
 webkit_settings_get_enable_xss_auditor                         (WebKitSettings *settings);
 
-WEBKIT_API void
+WEBKIT_DEPRECATED void
 webkit_settings_set_enable_xss_auditor                         (WebKitSettings *settings,
                                                                 gboolean        enabled);
 

Modified: trunk/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h (293506 => 293507)


--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h	2022-04-27 13:12:28 UTC (rev 293506)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h	2022-04-27 13:16:03 UTC (rev 293507)
@@ -119,10 +119,10 @@
 WEBKIT_API void
 webkit_settings_set_enable_html5_database                      (WebKitSettings *settings,
                                                                 gboolean        enabled);
-WEBKIT_API gboolean
+WEBKIT_DEPRECATED gboolean
 webkit_settings_get_enable_xss_auditor                         (WebKitSettings *settings);
 
-WEBKIT_API void
+WEBKIT_DEPRECATED void
 webkit_settings_set_enable_xss_auditor                         (WebKitSettings *settings,
                                                                 gboolean        enabled);
 

Modified: trunk/Tools/ChangeLog (293506 => 293507)


--- trunk/Tools/ChangeLog	2022-04-27 13:12:28 UTC (rev 293506)
+++ trunk/Tools/ChangeLog	2022-04-27 13:16:03 UTC (rev 293507)
@@ -1,3 +1,14 @@
+2022-04-26  Michael Catanzaro  <mcatanz...@redhat.com>
+
+        [GLib] Make WebKitSettings XSS auditor functions no-op
+        https://bugs.webkit.org/show_bug.cgi?id=239651
+        <rdar://problem/92304443>
+
+        Reviewed by Adrian Perez de Castro.
+
+        * TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
+        (testWebKitSettings):
+
 2022-04-27  Youenn Fablet  <you...@apple.com>
 
         Add testRunner API to clear memory cache

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp (293506 => 293507)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp	2022-04-27 13:12:28 UTC (rev 293506)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp	2022-04-27 13:16:03 UTC (rev 293507)
@@ -72,10 +72,10 @@
     webkit_settings_set_enable_html5_database(settings, FALSE);
     g_assert_false(webkit_settings_get_enable_html5_database(settings));
 
-    // XSS Auditor is enabled by default.
-    g_assert_true(webkit_settings_get_enable_xss_auditor(settings));
-    webkit_settings_set_enable_xss_auditor(settings, FALSE);
+    // XSS Auditor is deprecated and always disabled.
     g_assert_false(webkit_settings_get_enable_xss_auditor(settings));
+    webkit_settings_set_enable_xss_auditor(settings, TRUE);
+    g_assert_false(webkit_settings_get_enable_xss_auditor(settings));
 
     // Frame flattening is disabled by default.
     g_assert_false(webkit_settings_get_enable_frame_flattening(settings));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to