Title: [125403] trunk/Source
Revision
125403
Author
[email protected]
Date
2012-08-13 02:42:39 -0700 (Mon, 13 Aug 2012)

Log Message

[GTK] Implementation of atk_editable_text_insert_text ignores 'length' parameter
https://bugs.webkit.org/show_bug.cgi?id=93804

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Use the 'length' parameter to insert a substring of the full
string passed to this method from AtkEditableText interface.

* accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp:
(webkitAccessibleEditableTextInsertText): Don't ignore 'length'.

Source/WebKit/gtk:

Update unit tests to also check inserting a partial string.

* tests/testatk.c:
(testWebkitAtkTextChangedNotifications): Update test.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125402 => 125403)


--- trunk/Source/WebCore/ChangeLog	2012-08-13 09:33:09 UTC (rev 125402)
+++ trunk/Source/WebCore/ChangeLog	2012-08-13 09:42:39 UTC (rev 125403)
@@ -1,3 +1,16 @@
+2012-08-13  Mario Sanchez Prada  <[email protected]>
+
+        [GTK] Implementation of atk_editable_text_insert_text ignores 'length' parameter
+        https://bugs.webkit.org/show_bug.cgi?id=93804
+
+        Reviewed by Carlos Garcia Campos.
+
+        Use the 'length' parameter to insert a substring of the full
+        string passed to this method from AtkEditableText interface.
+
+        * accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp:
+        (webkitAccessibleEditableTextInsertText): Don't ignore 'length'.
+
 2012-08-13  Sam D  <[email protected]>
 
         Web Inspector: Feature Request - Adding mouse gesture for editing attribute values in elements/css panel

Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp (125402 => 125403)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp	2012-08-13 09:33:09 UTC (rev 125402)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp	2012-08-13 09:42:39 UTC (rev 125403)
@@ -61,7 +61,8 @@
 
 static void webkitAccessibleEditableTextInsertText(AtkEditableText* text, const gchar* string, gint length, gint* position)
 {
-    // FIXME: string nullcheck?
+    if (!string)
+        return;
 
     AccessibilityObject* coreObject = core(text);
     // FIXME: Not implemented in WebCore
@@ -75,7 +76,7 @@
     coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(*position, 0)));
     coreObject->setFocused(true);
     // FIXME: We should set position to the actual inserted text length, which may be less than that requested.
-    if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string), false, 0))
+    if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string).substring(0, length), false, 0))
         *position += length;
 }
 

Modified: trunk/Source/WebKit/gtk/ChangeLog (125402 => 125403)


--- trunk/Source/WebKit/gtk/ChangeLog	2012-08-13 09:33:09 UTC (rev 125402)
+++ trunk/Source/WebKit/gtk/ChangeLog	2012-08-13 09:42:39 UTC (rev 125403)
@@ -1,3 +1,15 @@
+2012-08-13  Mario Sanchez Prada  <[email protected]>
+
+        [GTK] Implementation of atk_editable_text_insert_text ignores 'length' parameter
+        https://bugs.webkit.org/show_bug.cgi?id=93804
+
+        Reviewed by Carlos Garcia Campos.
+
+        Update unit tests to also check inserting a partial string.
+
+        * tests/testatk.c:
+        (testWebkitAtkTextChangedNotifications): Update test.
+
 2012-08-10  Alice Cheng  <[email protected]>
 
         Part 1 of: Extend -webkit-user-select with a new value "all"

Modified: trunk/Source/WebKit/gtk/tests/testatk.c (125402 => 125403)


--- trunk/Source/WebKit/gtk/tests/testatk.c	2012-08-13 09:33:09 UTC (rev 125402)
+++ trunk/Source/WebKit/gtk/tests/testatk.c	2012-08-13 09:42:39 UTC (rev 125403)
@@ -1761,7 +1761,7 @@
     g_free(text);
 
     pos = 4;
-    atk_editable_text_insert_text(ATK_EDITABLE_TEXT(textEntry), "qux quux", 8, &pos);
+    atk_editable_text_insert_text(ATK_EDITABLE_TEXT(textEntry), "qux quux tobeignored", 8, &pos);
     text = atk_text_get_text(ATK_TEXT(textEntry), 0, -1);
     g_assert_cmpstr(text, ==, "foo qux quux baz");
     g_assert_cmpstr(textChangedResult, ==, "|1|4|8|'qux quux'|");
@@ -1794,7 +1794,7 @@
     g_free(text);
 
     pos = 3;
-    atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "qux", 3, &pos);
+    atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "qux tobeignored", 3, &pos);
     g_assert_cmpstr(textChangedResult, ==, "|1|3|3|'\342\200\242\342\200\242\342\200\242'|");
 
     text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to