Modified: trunk/Source/WebCore/ChangeLog (288155 => 288156)
--- trunk/Source/WebCore/ChangeLog 2022-01-18 23:53:23 UTC (rev 288155)
+++ trunk/Source/WebCore/ChangeLog 2022-01-18 23:56:46 UTC (rev 288156)
@@ -1,3 +1,21 @@
+2022-01-18 ChangSeok Oh <[email protected]>
+
+ [GTK] Implement native form validation bubbles for GTK4
+ https://bugs.webkit.org/show_bug.cgi?id=235303
+
+ Reviewed by Carlos Garcia Campos.
+
+ The gtk port using gtk3 supports a native validation bubble for the form validation
+ since r288104. This change brings the same support for gtk4.
+ The same features of ValidationBubble are implemented using gtk4 API.
+
+ No new tests since existing tests cover this change.
+
+ * platform/gtk/ValidationBubbleGtk.cpp:
+ (WebCore::ValidationBubble::ValidationBubble):
+ (WebCore::ValidationBubble::invalidate):
+ (WebCore::ValidationBubble::showRelativeTo):
+
2022-01-18 Alex Christensen <[email protected]>
Use c++2a instead of gnu++2a for Cocoa builds
Modified: trunk/Source/WebCore/platform/gtk/ValidationBubbleGtk.cpp (288155 => 288156)
--- trunk/Source/WebCore/platform/gtk/ValidationBubbleGtk.cpp 2022-01-18 23:53:23 UTC (rev 288155)
+++ trunk/Source/WebCore/platform/gtk/ValidationBubbleGtk.cpp 2022-01-18 23:56:46 UTC (rev 288156)
@@ -28,6 +28,7 @@
#if PLATFORM(GTK)
+#include "GtkVersioning.h"
#include <glib.h>
#include <wtf/glib/GUniquePtr.h>
#include <wtf/text/WTFString.h>
@@ -45,7 +46,6 @@
, m_fontSize(std::max(settings.minimumFontSize, minFontSize))
, m_shouldNotifyFocusEventsCallback(WTFMove(callback))
{
-#if !USE(GTK4)
GtkWidget* label = gtk_label_new(nullptr);
// https://docs.gtk.org/Pango/pango_markup.html
@@ -65,18 +65,25 @@
gtk_label_set_lines(GTK_LABEL(label), 4);
gtk_label_set_max_width_chars(GTK_LABEL(label), maxLabelWidthChars);
+#if USE(GTK4)
+ m_popover = gtk_popover_new();
+ gtk_popover_set_autohide(GTK_POPOVER(m_popover), FALSE);
+ gtk_popover_set_child(GTK_POPOVER(m_popover), label);
+
+ gtk_widget_set_parent(m_popover, webView);
+#else
m_popover = gtk_popover_new(webView);
gtk_popover_set_modal(GTK_POPOVER(m_popover), FALSE);
- gtk_popover_set_position(GTK_POPOVER(m_popover), GTK_POS_TOP);
gtk_popover_set_constrain_to(GTK_POPOVER(m_popover), GTK_POPOVER_CONSTRAINT_NONE);
gtk_container_add(GTK_CONTAINER(m_popover), label);
gtk_widget_show(label);
+#endif
+ gtk_popover_set_position(GTK_POPOVER(m_popover), GTK_POS_TOP);
g_signal_connect_swapped(m_popover, "closed", G_CALLBACK(+[](ValidationBubble* validationBubble) {
validationBubble->invalidate();
}), this);
-#endif
}
ValidationBubble::~ValidationBubble()
@@ -86,22 +93,23 @@
void ValidationBubble::invalidate()
{
-#if !USE(GTK4)
if (!m_popover)
return;
g_signal_handlers_disconnect_by_data(m_popover, this);
+#if USE(GTK4)
+ g_clear_pointer(&m_popover, gtk_widget_unparent);
+#else
gtk_widget_destroy(m_popover);
m_popover = nullptr;
+#endif
m_shouldNotifyFocusEventsCallback(m_view, true);
-#endif
}
void ValidationBubble::showRelativeTo(const IntRect& anchorRect)
{
-#if !USE(GTK4)
m_shouldNotifyFocusEventsCallback(m_view, false);
GdkRectangle rect(anchorRect);
@@ -108,7 +116,6 @@
gtk_popover_set_pointing_to(GTK_POPOVER(m_popover), &rect);
gtk_popover_popup(GTK_POPOVER(m_popover));
-#endif
}
} // namespace WebCore
Modified: trunk/Source/WebKit/ChangeLog (288155 => 288156)
--- trunk/Source/WebKit/ChangeLog 2022-01-18 23:53:23 UTC (rev 288155)
+++ trunk/Source/WebKit/ChangeLog 2022-01-18 23:56:46 UTC (rev 288156)
@@ -1,3 +1,17 @@
+2022-01-18 ChangSeok Oh <[email protected]>
+
+ [GTK] Implement native form validation bubbles for GTK4
+ https://bugs.webkit.org/show_bug.cgi?id=235303
+
+ Reviewed by Carlos Garcia Campos.
+
+ The gtk port using gtk3 supports a native validation bubble for the form validation
+ since r288104. This change brings the same support for gtk4.
+
+ * WebProcess/WebPage/WebPage.cpp: Enable pageConfiguration.validationMessageClient
+ for all gtk backends
+ (WebKit::m_appHighlightsVisible):
+
2022-01-18 Alex Christensen <[email protected]>
Build WebKitSwift when building with make or build-webkit
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (288155 => 288156)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2022-01-18 23:53:23 UTC (rev 288155)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2022-01-18 23:56:46 UTC (rev 288156)
@@ -609,7 +609,7 @@
pageConfiguration.speechSynthesisClient = makeUnique<WebSpeechSynthesisClient>(*this);
#endif
-#if PLATFORM(COCOA) || (PLATFORM(GTK) && !USE(GTK4))
+#if PLATFORM(COCOA) || PLATFORM(GTK)
pageConfiguration.validationMessageClient = makeUnique<WebValidationMessageClient>(*this);
#endif