[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:55:11 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f6994793e03ef83d692ebb4de26762c32de06d1d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 24 18:47:14 2009 +0000

    2009-11-24  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
    
            Reviewed by Xan Lopez.
    
            https://bugs.webkit.org/show_bug.cgi?id=25415
            [GTK][ATK] Please implement support for get_text_at_offset
    
            When building up the pango layout from text boxes, only append a
            newline char after verifying there are no more boxes on this line.
    
            * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
            (getPangoLayoutForAtk):
    2009-11-24  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
    
            Reviewed by Xan Lopez.
    
            https://bugs.webkit.org/show_bug.cgi?id=25415
            [GTK][ATK] Please implement support for get_text_at_offset
    
            When building up the pango layout from text boxes, only append a
            newline char after verifying there are no more boxes on this line.
    
            * tests/testatk.c
            (test_webkit_atk_get_text_at_offset_newlines):
            (main):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51342 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a51686b..692a12e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-24  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25415
+        [GTK][ATK] Please implement support for get_text_at_offset
+
+        When building up the pango layout from text boxes, only append a
+        newline char after verifying there are no more boxes on this line.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (getPangoLayoutForAtk):
+
 2009-11-24  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index d4f4ba8..308007c 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -890,7 +890,10 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
     while (box) {
         gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
         g_string_append(str, text);
-        g_string_append(str, "\n");
+        // Newline chars in the source result in separate text boxes, so check
+        // before adding a newline in the layout. See bug 25415 comment #78.
+        if (!box->nextOnLineExists())
+            g_string_append(str, "\n");
         box = box->nextTextBox();
     }
 
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index fe33df1..0dad90c 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-24  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25415
+        [GTK][ATK] Please implement support for get_text_at_offset
+
+        When building up the pango layout from text boxes, only append a
+        newline char after verifying there are no more boxes on this line.
+
+        * tests/testatk.c
+        (test_webkit_atk_get_text_at_offset_newlines):
+        (main):
+
 2009-11-19  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Gustavo Noronha Silva.
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index e47898b..79bf75c 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -28,6 +28,8 @@
 
 static const char* contents = "<html><body><p>This is a test. This is the second sentence. And this the third.</p></body></html>";
 
+static const char* contentsWithNewlines = "<html><body><p>This is a test. \n\nThis\n is the second sentence. And this the third.</p></body></html>";
+
 static gboolean bail_out(GMainLoop* loop)
 {
     if (g_main_loop_is_running(loop))
@@ -259,6 +261,39 @@ static void test_webkit_atk_get_text_at_offset(void)
     g_object_unref(webView);
 }
 
+static void test_webkit_atk_get_text_at_offset_newlines(void)
+{
+    WebKitWebView* webView;
+    AtkObject* obj;
+    GMainLoop* loop;
+    AtkText* text_obj;
+
+    webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    g_object_ref_sink(webView);
+    GtkAllocation alloc = { 0, 0, 800, 600 };
+    gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
+    webkit_web_view_load_string(webView, contentsWithNewlines, NULL, NULL, NULL);
+    loop = g_main_loop_new(NULL, TRUE);
+
+    g_timeout_add(100, (GSourceFunc)bail_out, loop);
+    g_main_loop_run(loop);
+
+    /* Get to the inner AtkText object */
+    obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
+    g_assert(obj);
+    obj = atk_object_ref_accessible_child(obj, 0);
+    g_assert(obj);
+    obj = atk_object_ref_accessible_child(obj, 0);
+    g_assert(obj);
+
+    text_obj = ATK_TEXT(obj);
+    g_assert(ATK_IS_TEXT(text_obj));
+
+    run_get_text_tests(text_obj);
+
+    g_object_unref(webView);
+}
+
 int main(int argc, char** argv)
 {
     g_thread_init(NULL);
@@ -267,6 +302,7 @@ int main(int argc, char** argv)
     g_test_bug_base("https://bugs.webkit.org/");
     g_test_add_func("/webkit/atk/get_text_at_offset", test_webkit_atk_get_text_at_offset);
     g_test_add_func("/webkit/atk/get_text_at_offset_forms", test_webkit_atk_get_text_at_offset_forms);
+    g_test_add_func("/webkit/atk/get_text_at_offset_newlines", test_webkit_atk_get_text_at_offset_newlines);
     return g_test_run ();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list