[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

xan at webkit.org xan at webkit.org
Wed Dec 22 15:18:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 87b1ca5d8da3c1b7ae35771fec21383d8acec016
Author: xan at webkit.org <xan at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 30 15:17:06 2010 +0000

    2010-10-30  Xan Lopez  <xlopez at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [GTK] Use new width for height APIs in GTK+ 3.x
            https://bugs.webkit.org/show_bug.cgi?id=48709
    
            Use the new width for height APIs in GTK+ 3.x, since size-request
            is deprecated.
    
            For now we just return the same value for preferred and minimum
            width/height, which should match the 2.x behavior. Probably we
            could do something smarter for the minimum values.
    
            * webkit/webkitwebview.cpp:
            (webkit_web_view_get_preferred_width): return our preferred width.
            (webkit_web_view_get_preferred_height): return our preferred height.
            (webkit_web_view_class_init): hook the new default handlers.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70983 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 8507a11..e4e009b 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-30  Xan Lopez  <xlopez at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Use new width for height APIs in GTK+ 3.x
+        https://bugs.webkit.org/show_bug.cgi?id=48709
+
+        Use the new width for height APIs in GTK+ 3.x, since size-request
+        is deprecated.
+
+        For now we just return the same value for preferred and minimum
+        width/height, which should match the 2.x behavior. Probably we
+        could do something smarter for the minimum values.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_get_preferred_width): return our preferred width.
+        (webkit_web_view_get_preferred_height): return our preferred height.
+        (webkit_web_view_class_init): hook the new default handlers.
+
 2010-10-29  Daniel Bates  <dbates at rim.com>
 
         No review, rolling out 70971.
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index a295fce..bba969a 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -868,6 +868,7 @@ static gboolean webkit_web_view_scroll_event(GtkWidget* widget, GdkEventScroll*
     return frame->eventHandler()->handleWheelEvent(wheelEvent);
 }
 
+#ifdef GTK_API_VERSION_2
 static void webkit_web_view_size_request(GtkWidget* widget, GtkRequisition* requisition)
 {
     WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget);
@@ -882,6 +883,35 @@ static void webkit_web_view_size_request(GtkWidget* widget, GtkRequisition* requ
     requisition->width = view->contentsWidth();
     requisition->height = view->contentsHeight();
 }
+#else
+static void webkit_web_view_get_preferred_width(GtkWidget* widget, gint* minimum, gint* natural)
+{
+    WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget);
+    Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view));
+    if (!coreFrame)
+        return;
+
+    FrameView* view = coreFrame->view();
+    if (!view)
+        return;
+
+    *minimum = *natural = view->contentsWidth();
+}
+
+static void webkit_web_view_get_preferred_height(GtkWidget* widget, gint* minimum, gint* natural)
+{
+    WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget);
+    Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view));
+    if (!coreFrame)
+        return;
+
+    FrameView* view = coreFrame->view();
+    if (!view)
+        return;
+
+    *minimum = *natural = view->contentsHeight();
+}
+#endif
 
 static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
 {
@@ -2602,7 +2632,12 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
     widgetClass->motion_notify_event = webkit_web_view_motion_event;
     widgetClass->scroll_event = webkit_web_view_scroll_event;
     widgetClass->size_allocate = webkit_web_view_size_allocate;
+#ifdef GTK_API_VERSION_2
     widgetClass->size_request = webkit_web_view_size_request;
+#else
+    widgetClass->get_preferred_width = webkit_web_view_get_preferred_width;
+    widgetClass->get_preferred_height = webkit_web_view_get_preferred_height;
+#endif
     widgetClass->popup_menu = webkit_web_view_popup_menu_handler;
     widgetClass->grab_focus = webkit_web_view_grab_focus;
     widgetClass->focus_in_event = webkit_web_view_focus_in_event;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list