Title: [169572] trunk/Source/WebCore
Revision
169572
Author
mario.pr...@samsung.com
Date
2014-06-03 14:38:00 -0700 (Tue, 03 Jun 2014)

Log Message

[ATK] accessibility/textarea-selected-text-range.html is failing
https://bugs.webkit.org/show_bug.cgi?id=133479

Reviewed by Chris Fleizach.

Implement atk_text_set_caret_offset() in terms of
atk_text_set_selection() for zero-length selections.

No new tests needed, the following test should just start
passing again now: accessibility/textarea-selected-text-range.html.

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(webkitAccessibleTextSetCaretOffset): Reimplemented this function
in terms of webkitAccessibleTextSetSelection().

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169571 => 169572)


--- trunk/Source/WebCore/ChangeLog	2014-06-03 21:37:06 UTC (rev 169571)
+++ trunk/Source/WebCore/ChangeLog	2014-06-03 21:38:00 UTC (rev 169572)
@@ -1,3 +1,20 @@
+2014-06-03  Mario Sanchez Prada  <mario.pr...@samsung.com>
+
+        [ATK] accessibility/textarea-selected-text-range.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=133479
+
+        Reviewed by Chris Fleizach.
+
+        Implement atk_text_set_caret_offset() in terms of
+        atk_text_set_selection() for zero-length selections.
+
+        No new tests needed, the following test should just start
+        passing again now: accessibility/textarea-selected-text-range.html.
+
+        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+        (webkitAccessibleTextSetCaretOffset): Reimplemented this function
+        in terms of webkitAccessibleTextSetSelection().
+
 2014-06-03  Alex Christensen  <achristen...@webkit.org>
 
         Corrected arm64 assertion in css jit.

Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (169571 => 169572)


--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp	2014-06-03 21:37:06 UTC (rev 169571)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp	2014-06-03 21:38:00 UTC (rev 169572)
@@ -1233,29 +1233,9 @@
 
 static gboolean webkitAccessibleTextSetCaretOffset(AtkText* text, gint offset)
 {
-    g_return_val_if_fail(ATK_TEXT(text), FALSE);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(text), FALSE);
-
-    AccessibilityObject* coreObject = core(text);
-    if (!coreObject->isAccessibilityRenderObject())
-        return FALSE;
-
-    // We need to adjust the offsets for the list item marker.
-    int offsetAdjustment = offsetAdjustmentForListItem(coreObject);
-    if (offsetAdjustment) {
-        if (offset < offsetAdjustment)
-            return FALSE;
-
-        offset = atkOffsetToWebCoreOffset(text, offset);
-    }
-
-    PlainTextRange textRange(offset, 0);
-    VisiblePositionRange range = coreObject->visiblePositionRangeForRange(textRange);
-    if (range.isNull())
-        return FALSE;
-
-    coreObject->setSelectedVisiblePositionRange(range);
-    return TRUE;
+    // Internally, setting the caret offset is equivalent to set a zero-length
+    // selection, so delegate in that implementation and void duplicated code.
+    return webkitAccessibleTextSetSelection(text, 0, offset, offset);
 }
 
 #if ATK_CHECK_VERSION(2, 10, 0)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to