[GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs https://bugs.webkit.org/show_bug.cgi?id=11591

System Internals / WebKit - carlosgc@webkit.org [268f45cc-cd09-0410-ab3c-d52691b4dbfc] - 12 May 2013 04:05 UTC

[GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs https://bugs.webkit.org/show_bug.cgi?id=115914

Reviewed by Martin Robinson.

Source/WebCore:

- platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: (WebCore::FullscreenVideoControllerGtk::hideHud): (WebCore::FullscreenVideoControllerGtk::initializeWindow):
- platform/gtk/GtkVersioning.c:
- platform/gtk/GtkVersioning.h:
- platform/gtk/WidgetRenderingContext.cpp: (WebCore::WidgetRenderingContext::WidgetRenderingContext):
- plugins/gtk/gtk2xtbin.c: (gtk_xtbin_realize):

Source/WebKit/gtk:

- WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::contentsSizeChanged):
- WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
- tests/testapplicationcache.c:
- tests/testatk.c:
- tests/testatkroles.c: (main):
- tests/testcontextmenu.c:
- tests/testcopyandpaste.c: (main):
- tests/testdomdocument.c:
- tests/testdomdomwindow.c:
- tests/testdomnode.c:
- tests/testdownload.c: (main):
- tests/testfavicondatabase.c: (main):
- tests/testglobals.c:
- tests/testhittestresult.c:
- tests/testhttpbackend.c: (main):
- tests/testkeyevents.c: (main):
- tests/testloading.c:
- tests/testmimehandling.c: (main):
- tests/testnetworkrequest.c: (main):
- tests/testnetworkresponse.c: (main):
- tests/testwebbackforwardlist.c: (main):
- tests/testwebdatasource.c: (main):
- tests/testwebframe.c: (main):
- tests/testwebhistoryitem.c: (main):
- tests/testwebinspector.c: (main):
- tests/testwebplugindatabase.c: (main):
- tests/testwebresource.c: (main):
- tests/testwebsettings.c: (main):
- tests/testwebview.c:
- tests/testwindow.c: (main):
- webkit/webkitwebview.cpp: (webkit_web_view_realize): (webkit_web_view_show_help): (webkit_web_view_class_init): (webkit_web_view_set_tooltip_text):

Source/WebKit2:

- UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize):

Tools:

- GtkLauncher/main.c: (createToolbar):
- MiniBrowser/gtk/BrowserWindow.c: (_BrowserWindow): (browserWindowSetStatusText): (fullScreenMessageTimeoutCallback): (webViewEnterFullScreen): (webViewLeaveFullScreen): (browserWindowFinalize): (browserWindowConstructed):
- WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: (WTR::EventSenderProxy::mouseScrollBy): (WTR::EventSenderProxy::continuousMouseScrollBy):

###

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 8758493..2b9c6f8 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2013-05-12 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115914
+
+ Reviewed by Martin Robinson.
+
+ * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp:
+ (WebCore::FullscreenVideoControllerGtk::hideHud):
+ (WebCore::FullscreenVideoControllerGtk::initializeWindow):
+ * platform/gtk/GtkVersioning.c:
+ * platform/gtk/GtkVersioning.h:
+ * platform/gtk/WidgetRenderingContext.cpp:
+ (WebCore::WidgetRenderingContext::WidgetRenderingContext):
+ * plugins/gtk/gtk2xtbin.c:
+ (gtk_xtbin_realize):
+
2013-05-11 Brent Fulgham

[Windows] Unreviewed build fix after r149932
diff --git a/Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp b/Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp
index e9d7f2f..46813be 100644
--- a/Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp
+++ b/Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp
@@ -197,8 +197,8 @@ void FullscreenVideoControllerGtk::hideHud()
}

GdkWindow* window = gtk_widget_get_window(m_window);
- GdkCursor* cursor = blankCursor();
- gdk_window_set_cursor(window, cursor);
+ GRefPtr cursor = adoptGRef(gdk_cursor_new(GDK_BLANK_CURSOR));
+ gdk_window_set_cursor(window, cursor.get());

gtk_widget_hide(m_hudWindow);

@@ -255,7 +255,7 @@ void FullscreenVideoControllerGtk::initializeWindow()
gtk_widget_show_all(m_window);

GdkWindow* window = gtk_widget_get_window(m_window);
- GRefPtr cursor(adoptGRef(blankCursor()));
+ GRefPtr cursor = adoptGRef(gdk_cursor_new(GDK_BLANK_CURSOR));
gdk_window_set_cursor(window, cursor.get());

m_motionNotifySignalId = g_signal_connect(m_window, "motion-notify-event", G_CALLBACK(onFullscreenGtkMotionNotifyEvent), this);
diff --git a/Source/WebCore/platform/gtk/GtkVersioning.c b/Source/WebCore/platform/gtk/GtkVersioning.c
index 2c8f5d8..679a432 100644
--- a/Source/WebCore/platform/gtk/GtkVersioning.c
+++ b/Source/WebCore/platform/gtk/GtkVersioning.c
@@ -27,33 +27,6 @@
#include
#endif

-#if !GTK_CHECK_VERSION(2, 14, 0)
-void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value)
-{
- m_adjustment->value = m_currentPos;
- gtk_adjustment_value_changed(m_adjustment);
-}
-
-void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
- gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize)
-{
- g_object_freeze_notify(G_OBJECT(adjustment));
-
- g_object_set(adjustment,
- "lower", lower,
- "upper", upper,
- "step-increment", stepIncrement,
- "page-increment", pageIncrement,
- "page-size", pageSize,
- NULL);
-
- g_object_thaw_notify(G_OBJECT(adjustment));
-
- gtk_adjustment_changed(adjustment);
- gtk_adjustment_value_changed(adjustment);
-}
-#endif
-
GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window)
{
#ifndef GTK_API_VERSION_2
@@ -64,46 +37,6 @@ GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window)
#endif // GTK_API_VERSION_2
}

-#if !GTK_CHECK_VERSION(2, 17, 3)
-void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
-{
- gdk_window_get_root_origin(window, rootX, rootY);
- *rootX = *rootX + x;
- *rootY = *rootY + y;
-}
-#endif
-
-GdkCursor * blankCursor()
-{
-#if GTK_CHECK_VERSION(2, 16, 0)
- return gdk_cursor_new(GDK_BLANK_CURSOR);
-#else
- GdkCursor * cursor;
- GdkPixmap * source;
- GdkPixmap * mask;
- GdkColor foreground = { 0, 65535, 0, 0 }; // Red.
- GdkColor background = { 0, 0, 0, 65535 }; // Blue.
- static gchar cursorBits[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
-
- source = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
- mask = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
- cursor = gdk_cursor_new_from_pixmap(source, mask, &foreground, &background, 8, 8);
- gdk_pixmap_unref(source);
- gdk_pixmap_unref(mask);
- return cursor;
-#endif // GTK_CHECK_VERSION(2, 16, 0)
-}
-
-#if !GTK_CHECK_VERSION(2, 16, 0)
-const gchar* gtk_menu_item_get_label(GtkMenuItem* menuItem)
-{
- GtkWidget * label = gtk_bin_get_child(GTK_BIN(menuItem));
- if (GTK_IS_LABEL(label))
- return gtk_label_get_text(GTK_LABEL(label));
- return 0;
-}
-#endif // GTK_CHECK_VERSION(2, 16, 0)
-
#ifdef GTK_API_VERSION_2
static cairo_format_t
gdk_cairo_format_for_content(cairo_content_t content)
@@ -266,41 +199,6 @@ gdk_pixbuf_get_from_surface(cairo_surface_t * surface,
return dest;
}

-#if GTK_CHECK_VERSION(2, 24, 0)
-void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height)
-{
- g_return_if_fail(GDK_IS_PIXMAP(drawable) || GDK_IS_WINDOW(drawable));
-
- if (GDK_IS_PIXMAP(drawable)) {
- gdk_pixmap_get_size(GDK_PIXMAP(drawable), width, height);
- return;
- }
-
- GdkWindow *window = GDK_WINDOW(drawable);
- *width = gdk_window_get_width(window);
- *height = gdk_window_get_height(window);
-}
-#else
-void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height)
-{
- gdk_drawable_get_size(drawable, width, height);
-}
-#endif // GTK_CHECK_VERSION(2, 24, 0)
-
-#endif // GTK_API_VERSION_2
-
-#if !GTK_CHECK_VERSION(2, 22, 0)
-cairo_surface_t *gdk_window_create_similar_surface(GdkWindow *window, cairo_content_t content, int width, int height)
-{
- cairo_t *cairoContext = gdk_cairo_create(window);
- cairo_surface_t *cairoSurface = cairo_get_target(cairoContext);
- cairo_surface_t *newSurface = cairo_surface_create_similar(cairoSurface, content, width, height);
- cairo_destroy(cairoContext);
- return newSurface;
-}
-#endif // GTK_CHECK_VERSION(2, 22, 0)
-
-#if !GTK_CHECK_VERSION(3, 3, 6)
#ifdef GDK_WINDOWING_X11
static int getScreenCurrentDesktop(GdkScreen *screen)
{
@@ -370,4 +268,4 @@ void gdk_screen_get_monitor_workarea(GdkScreen *screen, int monitor, GdkRectangl
gdk_rectangle_intersect(&workArea, area, area);
#endif
}
-#endif // GTK_CHECK_VERSION(3, 3, 6)
+#endif // GTK_API_VERSION_2
diff --git a/Source/WebCore/platform/gtk/GtkVersioning.h b/Source/WebCore/platform/gtk/GtkVersioning.h
index 251ade2..e0cd1ad 100644
--- a/Source/WebCore/platform/gtk/GtkVersioning.h
+++ b/Source/WebCore/platform/gtk/GtkVersioning.h
@@ -36,87 +36,10 @@ G_BEGIN_DECLS
#else
GdkPixbuf* gdk_pixbuf_get_from_surface(cairo_surface_t* surface, int srcX, int srcY,
int width, int height);
-void getGdkDrawableSize(GdkDrawable* drawable, int* width, int* height);
+void gdk_screen_get_monitor_workarea(GdkScreen *, int monitor, GdkRectangle *area);
#endif

-#if !GTK_CHECK_VERSION(2, 23, 4)
-#define gdk_pixmap_get_size gdk_drawable_get_size
-#endif // GTK_CHECK_VERSION(2, 23, 4)
-
-#if !GTK_CHECK_VERSION(2, 23, 0)
-#define gdk_window_get_display(window) gdk_drawable_get_display(window)
-#define gdk_window_get_visual gdk_drawable_get_visual
-#endif // GTK_CHECK_VERSION(2, 23, 0)
-
-#if !GTK_CHECK_VERSION(2, 22, 0)
-cairo_surface_t* gdk_window_create_similar_surface(GdkWindow* window, cairo_content_t content, int width, int height);
-#endif // GTK_CHECK_VERSION(2, 22, 0)
-
-#if !GTK_CHECK_VERSION(2, 21, 2)
-#define gdk_visual_get_depth(visual) (visual)->depth
-#define gdk_visual_get_bits_per_rgb(visual) (visual)->bits_per_rgb
-#define gdk_drag_context_get_selected_action(context) (context)->action
-#define gdk_drag_context_get_actions(context) (context)->actions
-#endif // GTK_CHECK_VERSION(2, 21, 2)
-
-#if !GTK_CHECK_VERSION(2, 20, 0)
-#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
-#define gtk_widget_set_realized(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_REALIZED)
-#define gtk_range_get_min_slider_size(range) (range)->min_slider_size
-#endif // GTK_CHECK_VERSION(2, 20, 0)
-
-#if !GTK_CHECK_VERSION(2, 19, 0)
-#define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL(widget)
-#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
-#define gtk_widget_get_has_window(widget) !GTK_WIDGET_NO_WINDOW(widget)
-#define gtk_widget_get_can_focus(widget) GTK_WIDGET_CAN_FOCUS(widget)
-#define gtk_widget_is_sensitive(widget) GTK_WIDGET_IS_SENSITIVE(widget)
-#endif // GTK_CHECK_VERSION(2, 19, 0)
-
-#if !GTK_CHECK_VERSION(2, 18, 0)
-#define gtk_widget_set_visible(widget, FALSE) GTK_WIDGET_UNSET_FLAGS((widget), GTK_VISIBLE)
-#define gtk_widget_get_visible(widget) (GTK_WIDGET_FLAGS(widget) & GTK_VISIBLE)
-
-#define gtk_widget_set_window(widget, new_window) (widget)->window = (new_window)
-#define gtk_widget_set_can_focus(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_CAN_FOCUS)
-#define gtk_widget_get_allocation(widget, alloc) (*(alloc) = (widget)->allocation)
-#define gtk_widget_set_allocation(widget, alloc) ((widget)->allocation = *(alloc))
-#endif // GTK_CHECK_VERSION(2, 18, 0)
-
-#if !GTK_CHECK_VERSION(2, 17, 3)
-void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY);
-#endif // GTK_CHECK_VERSION(2, 17, 3)
-
-#if !GTK_CHECK_VERSION(2, 16, 0)
-const gchar* gtk_menu_item_get_label(GtkMenuItem*);
-#endif // GTK_CHECK_VERSION(2, 16, 0)
-
-
-#if !GTK_CHECK_VERSION(2, 14, 0)
-#define gtk_widget_get_window(widget) (widget)->window
-#define gtk_adjustment_get_value(adj) (adj)->value
-#define gtk_dialog_get_content_area(dialog) (dialog)->vbox
-#define gtk_dialog_get_action_area(dialog) (dialog)->action_area
-#define gtk_selection_data_get_length(data) (data)->length
-#define gtk_selection_data_get_data(data) (data)->data
-#define gtk_selection_data_get_target(data) (data)->target
-#define gtk_adjustment_set_page_size(adj, newValue) ((adj)->page_size = newValue)
-#define gtk_adjustment_set_value(adj, newValue) ((adj)->value = newValue)
-#define gtk_adjustment_set_lower(adj, newValue) ((adj)->lower = newValue)
-#define gtk_adjustment_set_upper(adj, newValue) ((adj)->upper = newValue)
-
-void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
- gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize);
-
-void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
-#endif // GTK_CHECK_VERSION(2, 14, 0)
-
GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window);
-GdkCursor* blankCursor();
-
-#if !GTK_CHECK_VERSION(3, 3, 6)
-void gdk_screen_get_monitor_workarea(GdkScreen *, int monitor, GdkRectangle *area);
-#endif

G_END_DECLS

diff --git a/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp b/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp
index 036d4aa..671aadb 100644
--- a/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp
+++ b/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp
@@ -85,9 +85,15 @@ WidgetRenderingContext::WidgetRenderingContext(GraphicsContext* graphicsContext,
// We never want to create a scratch buffer larger than the size of our target GdkDrawable.
// This prevents giant pixmap allocations for very large widgets in smaller views.
// FIXME: We need to implement this check for WebKit2 as well.
- if (graphicsContext->gdkWindow()) {
+ if (GdkDrawable* drawable = graphicsContext->gdkWindow()) {
int maxWidth = 0, maxHeight = 0;
- getGdkDrawableSize(graphicsContext->gdkWindow(), &maxWidth, &maxHeight);
+
+ if (GDK_IS_PIXMAP(drawable))
+ gdk_pixmap_get_size(GDK_PIXMAP(drawable), &maxWidth, &maxHeight);
+ else if (GDK_IS_WINDOW(drawable)) {
+ maxWidth = gdk_window_get_width(GDK_WINDOW(drawable));
+ maxHeight = gdk_window_get_height(GDK_WINDOW(drawable));
+ }
m_targetRect.setSize(m_targetRect.size().shrunkTo(IntSize(maxWidth, maxHeight)));
}

diff --git a/Source/WebCore/plugins/gtk/gtk2xtbin.c b/Source/WebCore/plugins/gtk/gtk2xtbin.c
index 7bcfa7a..3d2fe7c 100644
--- a/Source/WebCore/plugins/gtk/gtk2xtbin.c
+++ b/Source/WebCore/plugins/gtk/gtk2xtbin.c
@@ -273,9 +273,7 @@ gtk_xtbin_realize (GtkWidget *widget)
{
GtkXtBin *xtbin;
GtkAllocation allocation = { 0, 0, 200, 200 };
-#if GTK_CHECK_VERSION(2, 18, 0)
GtkAllocation widget_allocation;
-#endif

#ifdef DEBUG_XTBIN
printf("gtk_xtbin_realize()\n");
@@ -286,29 +284,17 @@ gtk_xtbin_realize (GtkWidget *widget)
xtbin = GTK_XTBIN (widget);

/* caculate the allocation before realize */
-#if GTK_CHECK_VERSION(2, 24, 0)
allocation.width = gdk_window_get_width(xtbin->parent_window);
allocation.height = gdk_window_get_height(xtbin->parent_window);
-#else
- gint x, y, w, h, d; /* geometry of window */
- gdk_window_get_geometry(xtbin->parent_window, &x, &y, &w, &h, &d);
- allocation.width = w;
- allocation.height = h;
-#endif
gtk_widget_size_allocate (widget, &allocation);

#ifdef DEBUG_XTBIN
printf("initial allocation %d %d %d %d\n", x, y, w, h);
#endif

-#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_get_allocation(widget, &widget_allocation);
xtbin->width = widget_allocation.width;
xtbin->height = widget_allocation.height;
-#else
- xtbin->width = widget->allocation.width;
- xtbin->height = widget->allocation.height;
-#endif

/* use GtkSocket's realize */
(*GTK_WIDGET_CLASS(parent_class)->realize)(widget);
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index b8ee8d7..3e16e0b 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,66 @@
+2013-05-12 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115914
+
+ Reviewed by Martin Robinson.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::contentsSizeChanged):
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+ * tests/testapplicationcache.c:
+ * tests/testatk.c:
+ * tests/testatkroles.c:
+ (main):
+ * tests/testcontextmenu.c:
+ * tests/testcopyandpaste.c:
+ (main):
+ * tests/testdomdocument.c:
+ * tests/testdomdomwindow.c:
+ * tests/testdomnode.c:
+ * tests/testdownload.c:
+ (main):
+ * tests/testfavicondatabase.c:
+ (main):
+ * tests/testglobals.c:
+ * tests/testhittestresult.c:
+ * tests/testhttpbackend.c:
+ (main):
+ * tests/testkeyevents.c:
+ (main):
+ * tests/testloading.c:
+ * tests/testmimehandling.c:
+ (main):
+ * tests/testnetworkrequest.c:
+ (main):
+ * tests/testnetworkresponse.c:
+ (main):
+ * tests/testwebbackforwardlist.c:
+ (main):
+ * tests/testwebdatasource.c:
+ (main):
+ * tests/testwebframe.c:
+ (main):
+ * tests/testwebhistoryitem.c:
+ (main):
+ * tests/testwebinspector.c:
+ (main):
+ * tests/testwebplugindatabase.c:
+ (main):
+ * tests/testwebresource.c:
+ (main):
+ * tests/testwebsettings.c:
+ (main):
+ * tests/testwebview.c:
+ * tests/testwindow.c:
+ (main):
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_realize):
+ (webkit_web_view_show_help):
+ (webkit_web_view_class_init):
+ (webkit_web_view_set_tooltip_text):
+
2013-05-07 Tomas Popela

[GTK] Initialize WebKitWebPlugin path to prevent double-free
diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 1a7a7dc..9a52e7f 100644
--- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -720,11 +720,7 @@ void ChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
// otherwise we get into an infinite loop!
GtkWidget* widget = GTK_WIDGET(m_webView);
GtkRequisition requisition;
-#if GTK_CHECK_VERSION(2, 20, 0)
gtk_widget_get_requisition(widget, &requisition);
-#else
- requisition = widget->requisition;
-#endif
if (gtk_widget_get_realized(widget)
&& (requisition.height != size.height())
|| (requisition.width != size.width()))
diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index bee4e72..d3bcee4 100644
--- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -1250,11 +1250,7 @@ void FrameLoaderClient::transitionToCommittedForNewPage()
{
WebKitWebView* containingWindow = getViewFromFrame(m_frame);
GtkAllocation allocation;
-#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_get_allocation(GTK_WIDGET(containingWindow), &allocation);
-#else
- allocation = GTK_WIDGET(containingWindow)->allocation;
-#endif
IntSize size = IntSize(allocation.width, allocation.height);
bool transparent = webkit_web_view_get_transparent(containingWindow);
Color backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white;
diff --git a/Source/WebKit/gtk/tests/testapplicationcache.c b/Source/WebKit/gtk/tests/testapplicationcache.c
index e2c4e8d..3a2909e 100644
--- a/Source/WebKit/gtk/tests/testapplicationcache.c
+++ b/Source/WebKit/gtk/tests/testapplicationcache.c
@@ -23,8 +23,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static void test_application_cache_maximum_size()
{
unsigned long long maxSize = 8192;
@@ -49,11 +47,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c
index 42bc461..107166a 100644
--- a/Source/WebKit/gtk/tests/testatk.c
+++ b/Source/WebKit/gtk/tests/testatk.c
@@ -26,8 +26,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static const char* centeredContents = "

Short line

Long-size line with some foo bar baz content

Short line

This is a multi-line paragraph
where the first line
is the biggest one

";

static const char* contents = "

This is a test. This is the second sentence. And this the third.

";
@@ -2030,11 +2028,3 @@ int main(int argc, char** argv)
return g_test_run ();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testatkroles.c b/Source/WebKit/gtk/tests/testatkroles.c
index 4970482..da7833e 100644
--- a/Source/WebKit/gtk/tests/testatkroles.c
+++ b/Source/WebKit/gtk/tests/testatkroles.c
@@ -24,8 +24,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
/* Non form roles */
#define HTML_DOCUMENT_FRAME "This is a test."
#define HTML_HEADING "

1

2

3

4

5
6
"
@@ -426,12 +424,3 @@ int main(int argc, char** argv)

return g_test_run();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testcontextmenu.c b/Source/WebKit/gtk/tests/testcontextmenu.c
index e3afd8c..fbf4ede 100644
--- a/Source/WebKit/gtk/tests/testcontextmenu.c
+++ b/Source/WebKit/gtk/tests/testcontextmenu.c
@@ -20,8 +20,6 @@
#include "autotoolsconfig.h"
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
typedef struct {
char *data;
guint flag;
@@ -314,12 +312,3 @@ int main(int argc, char **argv)
return g_test_run();
}

-#else
-
-int main(int argc, char **argv)
-{
- g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testcopyandpaste.c b/Source/WebKit/gtk/tests/testcopyandpaste.c
index e613c3a..5557ff8 100644
--- a/Source/WebKit/gtk/tests/testcopyandpaste.c
+++ b/Source/WebKit/gtk/tests/testcopyandpaste.c
@@ -26,8 +26,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
typedef struct {
char* page;
char* expectedContent;
@@ -266,13 +264,3 @@ int main(int argc, char** argv)

return g_test_run();
}
-
-#else
-
-int main(int argc, char** argv)
-{
- g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testdomdocument.c b/Source/WebKit/gtk/tests/testdomdocument.c
index effcdbf..e40a895 100644
--- a/Source/WebKit/gtk/tests/testdomdocument.c
+++ b/Source/WebKit/gtk/tests/testdomdocument.c
@@ -25,8 +25,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
#define HTML_DOCUMENT_TITLE "This is the title"
#define HTML_DOCUMENT_ELEMENTS "
  • 1
  • 2
  • 3
"
#define HTML_DOCUMENT_ELEMENTS_CLASS "
"
@@ -391,11 +389,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testdomdomwindow.c b/Source/WebKit/gtk/tests/testdomdomwindow.c
index ac2a763..3d312df 100644
--- a/Source/WebKit/gtk/tests/testdomdomwindow.c
+++ b/Source/WebKit/gtk/tests/testdomdomwindow.c
@@ -25,8 +25,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
#define HTML_DOCUMENT "This is the title

test

"

typedef struct {
@@ -217,11 +215,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testdomnode.c b/Source/WebKit/gtk/tests/testdomnode.c
index 56669a8..6612dbf 100644
--- a/Source/WebKit/gtk/tests/testdomnode.c
+++ b/Source/WebKit/gtk/tests/testdomnode.c
@@ -25,8 +25,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
#define HTML_DOCUMENT_HIERARCHY_NAVIGATION "This is the title

1

2

3

"
#define HTML_DOCUMENT_NODE_INSERTION ""

@@ -194,11 +192,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testdownload.c b/Source/WebKit/gtk/tests/testdownload.c
index dc2429e..106c346 100644
--- a/Source/WebKit/gtk/tests/testdownload.c
+++ b/Source/WebKit/gtk/tests/testdownload.c
@@ -23,8 +23,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
GMainLoop* loop;
char* temporaryFilename = NULL;
WebKitDownload* theDownload = NULL;
@@ -322,13 +320,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/download/not-found", test_webkit_download_not_found);
return g_test_run ();
}
-
-#else
-
-int main(int argc, char** argv)
-{
- g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testfavicondatabase.c b/Source/WebKit/gtk/tests/testfavicondatabase.c
index 2ec4928..971a7e7 100644
--- a/Source/WebKit/gtk/tests/testfavicondatabase.c
+++ b/Source/WebKit/gtk/tests/testfavicondatabase.c
@@ -26,7 +26,6 @@

const int gIconSize = 16;

-#if GTK_CHECK_VERSION(2, 14, 0)
GMainLoop *loop;
char *baseURI;

@@ -275,11 +274,3 @@ int main(int argc, char **argv)

return g_test_run();
}
-#else
-int main(int argc, char **argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testglobals.c b/Source/WebKit/gtk/tests/testglobals.c
index 66b567d..d7f316c 100644
--- a/Source/WebKit/gtk/tests/testglobals.c
+++ b/Source/WebKit/gtk/tests/testglobals.c
@@ -22,8 +22,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
// Make sure the session is initialized properly when webkit_get_default_session() is called.
static void test_globals_default_session()
{
@@ -110,11 +108,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testhittestresult.c b/Source/WebKit/gtk/tests/testhittestresult.c
index b4080fd..adbf98a 100644
--- a/Source/WebKit/gtk/tests/testhittestresult.c
+++ b/Source/WebKit/gtk/tests/testhittestresult.c
@@ -23,8 +23,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
typedef struct {
char* data;
guint flag;
@@ -169,12 +167,3 @@ int main(int argc, char** argv)
return g_test_run ();
}

-#else
-
-int main(int argc, char** argv)
-{
- g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testhttpbackend.c b/Source/WebKit/gtk/tests/testhttpbackend.c
index 1a85bd6..d50be96 100644
--- a/Source/WebKit/gtk/tests/testhttpbackend.c
+++ b/Source/WebKit/gtk/tests/testhttpbackend.c
@@ -25,8 +25,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
// Not yet public API
SoupMessage* webkit_network_request_get_message(WebKitNetworkRequest* request);

@@ -75,12 +73,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/soupmessage/lifetime", test_soup_message_lifetime);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testkeyevents.c b/Source/WebKit/gtk/tests/testkeyevents.c
index 2afdeff..ad8e398 100644
--- a/Source/WebKit/gtk/tests/testkeyevents.c
+++ b/Source/WebKit/gtk/tests/testkeyevents.c
@@ -26,9 +26,6 @@
#include
#include

-
-#if GTK_CHECK_VERSION(2, 14, 0)
-
typedef struct {
char* page;
char* text;
@@ -251,7 +248,7 @@ static void test_blocking(KeyEventFixture* fixture, gconstpointer data)
setup_keyevent_test(fixture, data, G_CALLBACK(test_blocking_load_status_cb));
}

-#if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 16, 0)
+#if defined(GDK_WINDOWING_X11)
static void test_xim_load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data)
{
KeyEventFixture* fixture = (KeyEventFixture*)data;
@@ -375,7 +372,7 @@ int main(int argc, char** argv)
key_event_fixture_setup,
test_blocking,
key_event_fixture_teardown);
-#if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 16, 0)
+#if defined(GDK_WINDOWING_X11)
g_test_add("/webkit/keyevent/xim-textinput", KeyEventFixture,
test_info_new(textinput_html, TRUE),
key_event_fixture_setup,
@@ -391,12 +388,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-
-int main(int argc, char** argv)
-{
- g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testloading.c b/Source/WebKit/gtk/tests/testloading.c
index f4fc134..7949951 100644
--- a/Source/WebKit/gtk/tests/testloading.c
+++ b/Source/WebKit/gtk/tests/testloading.c
@@ -24,8 +24,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
/* This string has to be rather big because of the cancelled test - it
* looks like soup refuses to send or receive a too small chunk */
#define HTML_STRING "Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!Testing!"
@@ -435,11 +433,3 @@ int main(int argc, char** argv)
return g_test_run();
}

-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testmimehandling.c b/Source/WebKit/gtk/tests/testmimehandling.c
index 9aa62f8..ffaa703 100644
--- a/Source/WebKit/gtk/tests/testmimehandling.c
+++ b/Source/WebKit/gtk/tests/testmimehandling.c
@@ -28,8 +28,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
GMainLoop* loop;
SoupSession *session;
char* base_uri;
@@ -203,12 +201,3 @@ int main(int argc, char** argv)

return g_test_run();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testnetworkrequest.c b/Source/WebKit/gtk/tests/testnetworkrequest.c
index bf3a2df..2af471a 100644
--- a/Source/WebKit/gtk/tests/testnetworkrequest.c
+++ b/Source/WebKit/gtk/tests/testnetworkrequest.c
@@ -26,8 +26,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static void test_network_request_create_destroy()
{
WebKitNetworkRequest* request;
@@ -96,12 +94,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/networkrequest/properties", test_network_request_properties);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testnetworkresponse.c b/Source/WebKit/gtk/tests/testnetworkresponse.c
index 35ac414..8b12f82 100644
--- a/Source/WebKit/gtk/tests/testnetworkresponse.c
+++ b/Source/WebKit/gtk/tests/testnetworkresponse.c
@@ -27,8 +27,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static void test_network_response_create_destroy()
{
WebKitNetworkResponse* response;
@@ -97,12 +95,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/networkresponse/properties", test_network_response_properties);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebbackforwardlist.c b/Source/WebKit/gtk/tests/testwebbackforwardlist.c
index 9d49df6..22acb45 100644
--- a/Source/WebKit/gtk/tests/testwebbackforwardlist.c
+++ b/Source/WebKit/gtk/tests/testwebbackforwardlist.c
@@ -22,8 +22,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static void test_webkit_web_history_item_lifetime(void)
{
WebKitWebView* webView;
@@ -326,12 +324,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/webbackforwardlist/clear", test_webkit_web_back_forward_list_clear);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebdatasource.c b/Source/WebKit/gtk/tests/testwebdatasource.c
index 39c5a66..ed73bdb 100644
--- a/Source/WebKit/gtk/tests/testwebdatasource.c
+++ b/Source/WebKit/gtk/tests/testwebdatasource.c
@@ -22,8 +22,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static const gshort defaultTimeout = 10;
guint waitTimer;
gboolean shouldWait;
@@ -242,12 +240,3 @@ int main(int argc, char** argv)

return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebframe.c b/Source/WebKit/gtk/tests/testwebframe.c
index a506d0b..531fae2 100644
--- a/Source/WebKit/gtk/tests/testwebframe.c
+++ b/Source/WebKit/gtk/tests/testwebframe.c
@@ -26,8 +26,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static int numberOfFramesCreated = 0;

static void createFrameSignalTestFrameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* frame, gpointer data)
@@ -220,12 +218,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/webview/response", test_webkit_web_frame_response);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebhistoryitem.c b/Source/WebKit/gtk/tests/testwebhistoryitem.c
index c12836e..40ced4c 100644
--- a/Source/WebKit/gtk/tests/testwebhistoryitem.c
+++ b/Source/WebKit/gtk/tests/testwebhistoryitem.c
@@ -22,8 +22,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
typedef struct {
WebKitWebHistoryItem* item;
} WebHistoryItemFixture;
@@ -70,12 +68,3 @@ int main(int argc, char** argv)
test_webkit_web_history_item_alternate_title, web_history_item_fixture_teardown);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebinspector.c b/Source/WebKit/gtk/tests/testwebinspector.c
index ff05eaf..8de6904 100644
--- a/Source/WebKit/gtk/tests/testwebinspector.c
+++ b/Source/WebKit/gtk/tests/testwebinspector.c
@@ -25,8 +25,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
GMainLoop *loop;
GtkWidget *window;

@@ -172,12 +170,3 @@ int main(int argc, char** argv)

return g_test_run();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebplugindatabase.c b/Source/WebKit/gtk/tests/testwebplugindatabase.c
index 21b63e8..7a1f7ec 100644
--- a/Source/WebKit/gtk/tests/testwebplugindatabase.c
+++ b/Source/WebKit/gtk/tests/testwebplugindatabase.c
@@ -24,8 +24,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
/* This function is not public, so we need an extern declaration */
extern void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* view, const gchar* directory);

@@ -78,12 +76,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/webplugindatabase/getplugins", test_webkit_web_plugin_database_get_plugins);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need at least gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebresource.c b/Source/WebKit/gtk/tests/testwebresource.c
index 00cdd3e..b91eb2c 100644
--- a/Source/WebKit/gtk/tests/testwebresource.c
+++ b/Source/WebKit/gtk/tests/testwebresource.c
@@ -24,8 +24,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
#define INDEX_HTML ""
#define MAIN_HTML "

hah

"
#define JAVASCRIPT "function blah () { var a = 1; }"
@@ -331,12 +329,3 @@ int main(int argc, char** argv)

return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebsettings.c b/Source/WebKit/gtk/tests/testwebsettings.c
index 397946c..5ed5b18 100644
--- a/Source/WebKit/gtk/tests/testwebsettings.c
+++ b/Source/WebKit/gtk/tests/testwebsettings.c
@@ -22,8 +22,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
/* Private API */
char* webkitWebSettingsUserAgentForURI(WebKitWebSettings *settings, const char *uri);

@@ -153,12 +151,3 @@ int main(int argc, char **argv)
g_test_add_func("/webkit/websettings/copy", test_webkit_web_settings_copy);
return g_test_run ();
}
-
-#else
-int main(int argc, char **argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwebview.c b/Source/WebKit/gtk/tests/testwebview.c
index 786a11f..90e6cc3 100644
--- a/Source/WebKit/gtk/tests/testwebview.c
+++ b/Source/WebKit/gtk/tests/testwebview.c
@@ -33,8 +33,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
GMainLoop* loop;
SoupSession *session;
char* base_uri;
@@ -724,12 +722,3 @@ int main(int argc, char** argv)

return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/tests/testwindow.c b/Source/WebKit/gtk/tests/testwindow.c
index fad86fb..ce66d46 100644
--- a/Source/WebKit/gtk/tests/testwindow.c
+++ b/Source/WebKit/gtk/tests/testwindow.c
@@ -21,8 +21,6 @@
#include
#include

-#if GTK_CHECK_VERSION(2, 14, 0)
-
static void notify_load_status_cb(WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
{
if (webkit_web_view_get_load_status(web_view) == WEBKIT_LOAD_FINISHED) {
@@ -119,12 +117,3 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/window/scrollbar_policy", test_webkit_window_scrollbar_policy);
return g_test_run ();
}
-
-#else
-int main(int argc, char** argv)
-{
- g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
- return 0;
-}
-
-#endif
diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp
index c0b771c..07666be 100644
--- a/Source/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp
@@ -963,11 +963,7 @@ static void webkit_web_view_realize(GtkWidget* widget)
gtk_widget_set_realized(widget, TRUE);

GtkAllocation allocation;
-#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_get_allocation(widget, &allocation);
-#else
- allocation = widget->allocation;
-#endif

GdkWindowAttr attributes;
attributes.window_type = GDK_WINDOW_CHILD;
@@ -1006,11 +1002,7 @@ static void webkit_web_view_realize(GtkWidget* widget)
gdk_window_set_user_data(window, widget);

#ifdef GTK_API_VERSION_2
-#if GTK_CHECK_VERSION(2, 20, 0)
gtk_widget_style_attach(widget);
-#else
- widget->style = gtk_style_attach(gtk_widget_get_style(widget), window);
-#endif
gtk_style_set_background(gtk_widget_get_style(widget), window, GTK_STATE_NORMAL);
#else
gtk_style_context_set_background(gtk_widget_get_style_context(widget), window);
@@ -1587,7 +1579,6 @@ static gboolean webkit_web_view_drag_drop(GtkWidget* widget, GdkDragContext* con
}
#endif // ENABLE(DRAG_SUPPORT)

-#if GTK_CHECK_VERSION(2, 12, 0)
static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip)
{
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW(widget)->priv;
@@ -1644,7 +1635,6 @@ static gboolean webkit_web_view_show_help(GtkWidget* widget, GtkWidgetHelpType h

return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->show_help(widget, help_type);
}
-#endif

static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
{
@@ -3117,10 +3107,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
widgetClass->drag_drop = NULL;
widgetClass->drag_data_received = NULL;
#endif
-#if GTK_CHECK_VERSION(2, 12, 0)
widgetClass->query_tooltip = webkit_web_view_query_tooltip;
widgetClass->show_help = webkit_web_view_show_help;
-#endif
widgetClass->map = webkitWebViewMap;

GtkContainerClass* containerClass = GTK_CONTAINER_CLASS(webViewClass);
@@ -5291,7 +5279,6 @@ static IntPoint documentPointForWindowPoint(Frame* frame, const IntPoint& window

void webkit_web_view_set_tooltip_text(WebKitWebView* webView, const char* tooltip)
{
-#if GTK_CHECK_VERSION(2, 12, 0)
WebKitWebViewPrivate* priv = webView->priv;
if (tooltip && *tooltip != '\0') {
priv->tooltipText = tooltip;
@@ -5302,11 +5289,6 @@ void webkit_web_view_set_tooltip_text(WebKitWebView* webView, const char* toolti
}

gtk_widget_trigger_tooltip_query(GTK_WIDGET(webView));
-#else
- // TODO: Support older GTK+ versions
- // See http://bugs.webkit.org/show_bug.cgi?id=15793
- notImplemented();
-#endif
}

/**
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index ca4889d..e92697d 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,13 @@
+2013-05-12 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115914
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseRealize):
+
2013-05-12 Raphael Kubo da Costa

Unreviewed build fix after r149944.
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
index 94c3425..dcf336c 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
@@ -245,9 +245,7 @@ static void webkitWebViewBaseRealize(GtkWidget* widget)
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
-#if GTK_CHECK_VERSION(3, 3, 18)
| GDK_SMOOTH_SCROLL_MASK
-#endif
| GDK_POINTER_MOTION_MASK
| GDK_KEY_PRESS_MASK
| GDK_KEY_RELEASE_MASK
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index e4fce9c..4a87793 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,24 @@
+2013-05-12 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115914
+
+ Reviewed by Martin Robinson.
+
+ * GtkLauncher/main.c:
+ (createToolbar):
+ * MiniBrowser/gtk/BrowserWindow.c:
+ (_BrowserWindow):
+ (browserWindowSetStatusText):
+ (fullScreenMessageTimeoutCallback):
+ (webViewEnterFullScreen):
+ (webViewLeaveFullScreen):
+ (browserWindowFinalize):
+ (browserWindowConstructed):
+ * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
+ (WTR::EventSenderProxy::mouseScrollBy):
+ (WTR::EventSenderProxy::continuousMouseScrollBy):
+
2013-05-11 Anders Carlsson

Crash when terminating a process that has not been fully launched
diff --git a/Tools/GtkLauncher/main.c b/Tools/GtkLauncher/main.c
index b6c5bae..cef7cd3 100644
--- a/Tools/GtkLauncher/main.c
+++ b/Tools/GtkLauncher/main.c
@@ -264,11 +264,7 @@ static GtkWidget* createToolbar(GtkWidget* window, GtkWidget* uriEntry, WebKitWe
{
GtkWidget *toolbar = gtk_toolbar_new();

-#if GTK_CHECK_VERSION(2, 15, 0)
gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL);
-#else
- gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL);
-#endif
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);

GtkToolItem *item;
diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c
index ebce505..e0cee62 100644
--- a/Tools/MiniBrowser/gtk/BrowserWindow.c
+++ b/Tools/MiniBrowser/gtk/BrowserWindow.c
@@ -52,10 +52,8 @@ struct _BrowserWindow {
WebKitWebView *webView;
GtkWidget *downloadsBar;
GdkPixbuf *favicon;
-#if GTK_CHECK_VERSION(3, 2, 0)
GtkWidget *fullScreenMessageLabel;
guint fullScreenMessageLabelId;
-#endif
};

struct _BrowserWindowClass {
@@ -91,10 +89,8 @@ static char *getExternalURI(const char *uri)

static void browserWindowSetStatusText(BrowserWindow *window, const char *text)
{
-#if GTK_CHECK_VERSION(3, 2, 0)
gtk_label_set_text(GTK_LABEL(window->statusLabel), text);
gtk_widget_set_visible(window->statusLabel, !!text);
-#endif
}

static void resetStatusText(GtkWidget *widget, BrowserWindow *window)
@@ -286,18 +282,15 @@ static void webViewReadyToShow(WebKitWebView *webView, BrowserWindow *window)
gtk_widget_show(GTK_WIDGET(window));
}

-#if GTK_CHECK_VERSION(3, 2, 0)
static gboolean fullScreenMessageTimeoutCallback(BrowserWindow *window)
{
gtk_widget_hide(window->fullScreenMessageLabel);
window->fullScreenMessageLabelId = 0;
return FALSE;
}
-#endif

static gboolean webViewEnterFullScreen(WebKitWebView *webView, BrowserWindow *window)
{
-#if GTK_CHECK_VERSION(3, 2, 0)
gchar *titleOrURI = g_strdup(webkit_web_view_get_title(window->webView));
if (!titleOrURI)
titleOrURI = getExternalURI(webkit_web_view_get_uri(window->webView));
@@ -309,8 +302,6 @@ static gboolean webViewEnterFullScreen(WebKitWebView *webView, BrowserWindow *wi
gtk_widget_show(window->fullScreenMessageLabel);

window->fullScreenMessageLabelId = g_timeout_add_seconds(2, (GSourceFunc)fullScreenMessageTimeoutCallback, window);
-#endif
-
gtk_widget_hide(window->toolbar);

return FALSE;
@@ -318,14 +309,11 @@ static gboolean webViewEnterFullScreen(WebKitWebView *webView, BrowserWindow *wi

static gboolean webViewLeaveFullScreen(WebKitWebView *webView, BrowserWindow *window)
{
-#if GTK_CHECK_VERSION(3, 2, 0)
if (window->fullScreenMessageLabelId) {
g_source_remove(window->fullScreenMessageLabelId);
window->fullScreenMessageLabelId = 0;
}
gtk_widget_hide(window->fullScreenMessageLabel);
-#endif
-
gtk_widget_show(window->toolbar);

return FALSE;
@@ -466,10 +454,8 @@ static void browserWindowFinalize(GObject *gObject)
window->favicon = NULL;
}

-#if GTK_CHECK_VERSION(3, 2, 0)
if (window->fullScreenMessageLabelId)
g_source_remove(window->fullScreenMessageLabelId);
-#endif

G_OBJECT_CLASS(browser_window_parent_class)->finalize(gObject);

@@ -596,7 +582,6 @@ static void browserWindowConstructed(GObject *gObject)
WebKitBackForwardList *backForwadlist = webkit_web_view_get_back_forward_list(window->webView);
g_signal_connect(backForwadlist, "changed", G_CALLBACK(backForwadlistChanged), window);

-#if GTK_CHECK_VERSION(3, 2, 0)
GtkWidget *overlay = gtk_overlay_new();
gtk_box_pack_start(GTK_BOX(window->mainBox), overlay, TRUE, TRUE, 0);
gtk_widget_show(overlay);
@@ -617,9 +602,6 @@ static void browserWindowConstructed(GObject *gObject)
gtk_widget_set_valign(window->fullScreenMessageLabel, GTK_ALIGN_CENTER);
gtk_widget_set_no_show_all(window->fullScreenMessageLabel, TRUE);
gtk_overlay_add_overlay(GTK_OVERLAY(overlay), window->fullScreenMessageLabel);
-#else
- gtk_box_pack_start(GTK_BOX(window->mainBox), GTK_WIDGET(window->webView), TRUE, TRUE, 0);
-#endif
gtk_widget_show(GTK_WIDGET(window->webView));
}

diff --git a/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp b/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
index cdbaec5..3dcb03a 100644
--- a/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
+++ b/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
@@ -387,7 +387,6 @@ void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
gdk_event_set_device(event, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(event->scroll.window))));

// For more than one tick in a scroll, we need smooth scroll event
-#if GTK_CHECK_VERSION(3, 3, 18)
if ((horizontal && vertical) || horizontal > 1 || horizontal < -1 || vertical > 1 || vertical < -1) {
event->scroll.direction = GDK_SCROLL_SMOOTH;
event->scroll.delta_x = -horizontal;
@@ -396,7 +395,6 @@ void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
sendOrQueueEvent(event);
return;
}
-#endif

if (horizontal < 0)
event->scroll.direction = GDK_SCROLL_RIGHT;
@@ -417,7 +415,6 @@ void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, boo
// Gtk+ does not support paged scroll events.
g_return_if_fail(!paged);

-#if GTK_CHECK_VERSION(3, 3, 18)
GdkEvent* event = gdk_event_new(GDK_SCROLL);
event->scroll.x = m_position.x;
event->scroll.y = m_position.y;
@@ -431,7 +428,6 @@ void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, boo
event->scroll.delta_y = -vertical / pixelsPerScrollTick;

sendOrQueueEvent(event);
-#endif
}

void EventSenderProxy::leapForward(int milliseconds)

8f2778b [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs https://bugs.webkit.org/show_bug.cgi?id=115914
Source/WebCore/ChangeLog | 17 ++++
.../graphics/gtk/FullscreenVideoControllerGtk.cpp | 6 +-
Source/WebCore/platform/gtk/GtkVersioning.c | 104 +-------------------
Source/WebCore/platform/gtk/GtkVersioning.h | 79 +--------------
.../platform/gtk/WidgetRenderingContext.cpp | 10 +-
Source/WebCore/plugins/gtk/gtk2xtbin.c | 14 ---
Source/WebKit/gtk/ChangeLog | 63 ++++++++++++
.../WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp | 4 -
.../gtk/WebCoreSupport/FrameLoaderClientGtk.cpp | 4 -
Source/WebKit/gtk/tests/testapplicationcache.c | 10 --
Source/WebKit/gtk/tests/testatk.c | 10 --
Source/WebKit/gtk/tests/testatkroles.c | 11 ---
Source/WebKit/gtk/tests/testcontextmenu.c | 11 ---
Source/WebKit/gtk/tests/testcopyandpaste.c | 12 ---
Source/WebKit/gtk/tests/testdomdocument.c | 10 --
Source/WebKit/gtk/tests/testdomdomwindow.c | 10 --
Source/WebKit/gtk/tests/testdomnode.c | 10 --
Source/WebKit/gtk/tests/testdownload.c | 12 ---
Source/WebKit/gtk/tests/testfavicondatabase.c | 9 --
Source/WebKit/gtk/tests/testglobals.c | 10 --
Source/WebKit/gtk/tests/testhittestresult.c | 11 ---
Source/WebKit/gtk/tests/testhttpbackend.c | 11 ---
Source/WebKit/gtk/tests/testkeyevents.c | 16 +--
Source/WebKit/gtk/tests/testloading.c | 10 --
Source/WebKit/gtk/tests/testmimehandling.c | 11 ---
Source/WebKit/gtk/tests/testnetworkrequest.c | 11 ---
Source/WebKit/gtk/tests/testnetworkresponse.c | 11 ---
Source/WebKit/gtk/tests/testwebbackforwardlist.c | 11 ---
Source/WebKit/gtk/tests/testwebdatasource.c | 11 ---
Source/WebKit/gtk/tests/testwebframe.c | 11 ---
Source/WebKit/gtk/tests/testwebhistoryitem.c | 11 ---
Source/WebKit/gtk/tests/testwebinspector.c | 11 ---
Source/WebKit/gtk/tests/testwebplugindatabase.c | 11 ---
Source/WebKit/gtk/tests/testwebresource.c | 11 ---
Source/WebKit/gtk/tests/testwebsettings.c | 11 ---
Source/WebKit/gtk/tests/testwebview.c | 11 ---
Source/WebKit/gtk/tests/testwindow.c | 11 ---
Source/WebKit/gtk/webkit/webkitwebview.cpp | 18 ----
Source/WebKit2/ChangeLog | 10 ++
.../UIProcess/API/gtk/WebKitWebViewBase.cpp | 2 -
Tools/ChangeLog | 21 ++++
Tools/GtkLauncher/main.c | 4 -
Tools/MiniBrowser/gtk/BrowserWindow.c | 18 ----
Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp | 4 -
44 files changed, 126 insertions(+), 558 deletions(-)

Upstream: github.com


  • Share