Title: [201269] releases/WebKitGTK/webkit-2.12
Revision
201269
Author
[email protected]
Date
2016-05-23 04:02:42 -0700 (Mon, 23 May 2016)

Log Message

Merge r200369 - [ATK] accessibility/content-editable-as-textarea.html fails
https://bugs.webkit.org/show_bug.cgi?id=155353

Reviewed by Darin Adler.

Source/WebCore:

The test was timing out because it expected an AXValueChanged notification.
In ATK, AXValueChanged notifications are made for widgets which implement
the AtkValue interface (sliders, progress bars, etc.). We should be listening
for AXTextChanged instead.

In addition, for contenteditable elements, we should emit the notification on
the element itself. Because we were handling the notification in the same way
as native text controls (where the notification we receive from WebCore is for
StaticTextRole children), we were attempting to emit the notification from
the parent of the contenteditable.

Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
methods that are being used as part of the previously-failing test. Those
methods are now implemented so that the ATK results are much more similar
to those on the Mac.

No new tests needed. The previously-failing test now passes.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::childrenChanged):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isNonNativeTextControl):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textChanged):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):

Tools:

The test was timing out because it expected an AXValueChanged notification.
In ATK, AXValueChanged notifications are made for widgets which implement
the AtkValue interface (sliders, progress bars, etc.). We should be listening
for AXTextChanged instead. AtkText's text-insert and text-remove have been
added to the AccessibilityNotificationHandler.

Also, ATK's AccessibilityUIElement support had a number of unimplemented
methods that are being used as part of the previously-failing test. Those
methods are now implemented so that the ATK results are much more similar
to those on the Mac.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::rangeForLine):
(WTR::AccessibilityUIElement::boundsForRange):
(WTR::AccessibilityUIElement::attributedStringForRange):

LayoutTests:

Updated the test identified in the bug to listen for the appropriate
notification for ATK and created platform-specific expectations.

In addition, set-selected-text-range-contenteditable.html was timing out
due to the use of shouldBecomeEqual() with an assertion that is wrong for
ATK. Modifying the test so that it verifies the result appropriate for
each platform eliminates the timeout.

* accessibility/content-editable-as-textarea.html: Updated.
* accessibility/set-selected-text-range-contenteditable.html: Updated.
* platform/gtk/TestExpectations: Unskipped the failing tests.
* platform/gtk/accessibility/content-editable-as-textarea-expected.txt: Added.
* platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
@@ -1,3 +1,24 @@
+2016-05-03  Joanmarie Diggs  <[email protected]>
+
+        [ATK] accessibility/content-editable-as-textarea.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=155353
+
+        Reviewed by Darin Adler.
+
+        Updated the test identified in the bug to listen for the appropriate
+        notification for ATK and created platform-specific expectations.
+
+        In addition, set-selected-text-range-contenteditable.html was timing out
+        due to the use of shouldBecomeEqual() with an assertion that is wrong for
+        ATK. Modifying the test so that it verifies the result appropriate for
+        each platform eliminates the timeout.
+
+        * accessibility/content-editable-as-textarea.html: Updated.
+        * accessibility/set-selected-text-range-contenteditable.html: Updated.
+        * platform/gtk/TestExpectations: Unskipped the failing tests.
+        * platform/gtk/accessibility/content-editable-as-textarea-expected.txt: Added.
+        * platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt: Added.
+
 2016-05-10  Zalan Bujtas  <[email protected]>
 
         REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html	2016-05-23 11:02:42 UTC (rev 201269)
@@ -19,8 +19,9 @@
 
     var notification = 0;
     var textArea = 0;
+    var notificationType = "AXValueChanged";
     function callback(notification) {
-        if (notification == "AXValueChanged") {
+        if (notification == notificationType) {
             textArea.removeNotificationListener();
             debug("Updated value: " + textArea.stringValue);
             document.getElementById("content").style.visibility = "hidden";
@@ -31,6 +32,11 @@
     if (window.accessibilityController) {
         window.jsTestIsAsync = true;
 
+        // In ATK, value-changed notifications are made for widgets which implement
+        // the AtkValue interface (sliders, progress bars, etc.).
+        if (accessibilityController.platformName == "atk")
+            notificationType = "AXTextChanged";
+
         textArea = accessibilityController.accessibleElementById("content");
         textArea.addNotificationListener(callback);
 

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt (0 => 201269)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt	2016-05-23 11:02:42 UTC (rev 201269)
@@ -0,0 +1,41 @@
+
+This tests that a contenteditable region behaves as a proper AXTextArea.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Role: AXRole: AXTextField
+Value: AXValue: hello<\n>world
+Value (writable): true
+String with range: ello
+worl
+Attributed string with range: 
+	Default text attributes:
+		editable:true
+		invisible:false
+		strikethrough:false
+		style:normal
+		underline:none
+		weight:400
+		family-name:standard
+		indent:0
+		rise:0
+		fg-color:0,0,0
+		bg-color:0,0,0
+		size:16
+	Range attributes for 'hello':
+		
+	Range attributes for '<\n>worl':
+		weight:700
+Line for index(0): 0
+Line for index(7): 1
+Range for line(0): {0, 6}
+Range for line(1): {6, 5}
+Bounds for range: {8, 8, 31, 34}
+Selected text range: {0, 3}
+Selected text: hel
+Updated value: AXValue: qlo<\n>world
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt (0 => 201269)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt	2016-05-23 11:02:42 UTC (rev 201269)
@@ -0,0 +1,29 @@
+hello world test
+This tests that selected text ranges can be set on a contenteditable element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial selected range: {1, 0}
+
+Set range: {3, 0}
+PASS content.selectedTextRange became '{3, 0}'
+
+Set range: {100, 0}
+PASS content.selectedTextRange became '{16, 0}'
+
+Set range: {0, 0}
+PASS content.selectedTextRange became '{0, 0}'
+
+Set range: {1, 12}
+PASS content.selectedTextRange became '{1, 12}'
+
+Set range: {-1, 0}
+PASS content.selectedTextRange became '{16, 0}'
+
+Set range: {7, 3}
+PASS content.selectedTextRange became '{7, 3}'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
@@ -1,3 +1,38 @@
+2016-05-03  Joanmarie Diggs  <[email protected]>
+
+        [ATK] accessibility/content-editable-as-textarea.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=155353
+
+        Reviewed by Darin Adler.
+
+        The test was timing out because it expected an AXValueChanged notification.
+        In ATK, AXValueChanged notifications are made for widgets which implement
+        the AtkValue interface (sliders, progress bars, etc.). We should be listening
+        for AXTextChanged instead.
+
+        In addition, for contenteditable elements, we should emit the notification on
+        the element itself. Because we were handling the notification in the same way
+        as native text controls (where the notification we receive from WebCore is for
+        StaticTextRole children), we were attempting to emit the notification from
+        the parent of the contenteditable.
+
+        Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
+        methods that are being used as part of the previously-failing test. Those
+        methods are now implemented so that the ATK results are much more similar
+        to those on the Mac.
+
+        No new tests needed. The previously-failing test now passes.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::childrenChanged):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isNonNativeTextControl):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::textChanged):
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
+
 2016-05-10  Zalan Bujtas  <[email protected]>
 
         REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-05-23 11:02:42 UTC (rev 201269)
@@ -159,7 +159,7 @@
             cache->postLiveRegionChangeNotification(parent);
         
         // If this element is an ARIA text control, notify the AT of changes.
-        if ((parent->isARIATextControl() || parent->hasContentEditableAttributeSet()) && !parent->isNativeTextControl())
+        if (parent->isNonNativeTextControl())
             cache->postNotification(parent, parent->document(), AXObjectCache::AXValueChanged);
     }
 }

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-05-23 11:02:42 UTC (rev 201269)
@@ -392,6 +392,11 @@
     return ariaRoleAttribute() == TextAreaRole || ariaRoleAttribute() == TextFieldRole || ariaRoleAttribute() == SearchFieldRole;
 }
 
+bool AccessibilityObject::isNonNativeTextControl() const
+{
+    return (isARIATextControl() || hasContentEditableAttributeSet()) && !isNativeTextControl();
+}
+
 bool AccessibilityObject::isLandmark() const
 {
     AccessibilityRole role = roleValue();

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h	2016-05-23 11:02:42 UTC (rev 201269)
@@ -520,6 +520,7 @@
     bool isToggleButton() const { return roleValue() == ToggleButtonRole; }
     bool isTextControl() const;
     bool isARIATextControl() const;
+    bool isNonNativeTextControl() const;
     bool isTabList() const { return roleValue() == TabListRole; }
     bool isTabItem() const { return roleValue() == TabRole; }
     bool isRadioGroup() const { return roleValue() == RadioGroupRole; }

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-05-23 11:02:42 UTC (rev 201269)
@@ -2905,7 +2905,7 @@
         if (parent->supportsARIALiveRegion())
             cache->postNotification(renderParent, AXObjectCache::AXLiveRegionChanged);
 
-        if ((parent->isARIATextControl() || parent->hasContentEditableAttributeSet()) && !parent->isNativeTextControl())
+        if (parent->isNonNativeTextControl())
             cache->postNotification(renderParent, AXObjectCache::AXValueChanged);
     }
 }

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp	2016-05-23 11:02:42 UTC (rev 201269)
@@ -249,7 +249,7 @@
     if (!object || text.isEmpty())
         return;
 
-    AccessibilityObject* parentObject = object->parentObjectUnignored();
+    AccessibilityObject* parentObject = object->isNonNativeTextControl() ? object : object->parentObjectUnignored();
     if (!parentObject)
         return;
 

Modified: releases/WebKitGTK/webkit-2.12/Tools/ChangeLog (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Tools/ChangeLog	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Tools/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
@@ -1,3 +1,29 @@
+2016-05-03  Joanmarie Diggs  <[email protected]>
+
+        [ATK] accessibility/content-editable-as-textarea.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=155353
+
+        Reviewed by Darin Adler.
+
+        The test was timing out because it expected an AXValueChanged notification.
+        In ATK, AXValueChanged notifications are made for widgets which implement
+        the AtkValue interface (sliders, progress bars, etc.). We should be listening
+        for AXTextChanged instead. AtkText's text-insert and text-remove have been
+        added to the AccessibilityNotificationHandler.
+
+        Also, ATK's AccessibilityUIElement support had a number of unimplemented
+        methods that are being used as part of the previously-failing test. Those
+        methods are now implemented so that the ATK results are much more similar
+        to those on the Mac.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+        (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::stringAttributeValue):
+        (WTR::AccessibilityUIElement::rangeForLine):
+        (WTR::AccessibilityUIElement::boundsForRange):
+        (WTR::AccessibilityUIElement::attributedStringForRange):
+
 2016-04-18  Carlos Garcia Campos  <[email protected]>
 
         Pending API Request URL is wrong after reloading

Modified: releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp	2016-05-23 11:02:42 UTC (rev 201269)
@@ -91,7 +91,8 @@
         GUniquePtr<char> signalValue(g_strdup_printf("%d", g_value_get_int(&paramValues[1])));
         JSRetainPtr<JSStringRef> jsSignalValue(Adopt, JSStringCreateWithUTF8CString(signalValue.get()));
         extraArgs.append(JSValueMakeString(jsContext, jsSignalValue.get()));
-    }
+    } else if (!g_strcmp0(signalQuery.signal_name, "text-insert") || !g_strcmp0(signalQuery.signal_name, "text-remove"))
+        notificationName = "AXTextChanged";
 
     if (!jsContext)
         return true;
@@ -218,6 +219,8 @@
         "ATK:AtkDocument:load-complete",
         "ATK:AtkSelection:selection-changed",
         "ATK:AtkText:text-caret-moved",
+        "ATK:AtkText:text-insert",
+        "ATK:AtkText:text-remove",
         0
     };
 

Modified: releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (201268 => 201269)


--- releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2016-05-23 11:02:42 UTC (rev 201269)
@@ -186,9 +186,8 @@
     return atkAttributeValueToCoreAttributeValue(type, id, attributeValue);
 }
 
-String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type)
+String attributeSetToString(AtkAttributeSet* attributeSet, String separator=", ")
 {
-    AtkAttributeSet* attributeSet = getAttributeSet(accessible, type);
     if (!attributeSet)
         return String();
 
@@ -198,13 +197,18 @@
         GUniquePtr<gchar> attributeData(g_strconcat(attribute->name, ":", attribute->value, NULL));
         builder.append(attributeData.get());
         if (attributes->next)
-            builder.append(", ");
+            builder.append(separator);
     }
     atk_attribute_set_free(attributeSet);
 
     return builder.toString();
 }
 
+String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type,  String separator=", ")
+{
+    return attributeSetToString(getAttributeSet(accessible, type), separator);
+}
+
 bool checkElementState(PlatformUIElement element, AtkStateType stateType)
 {
     if (!ATK_IS_OBJECT(element.get()))
@@ -502,6 +506,19 @@
     }
 }
 
+String selectedText(AtkObject* accessible)
+{
+    if (!ATK_IS_TEXT(accessible))
+        return String();
+
+    AtkText* text = ATK_TEXT(accessible);
+
+    gint start, end;
+    g_free(atk_text_get_selection(text, 0, &start, &end));
+
+    return atk_text_get_text(text, start, end);
+}
+
 String attributesOfElement(AccessibilityUIElement* element)
 {
     StringBuilder builder;
@@ -914,7 +931,13 @@
 
     String atkAttributeName = coreAttributeToAtkAttribute(attribute);
 
-    // Try object attributes first.
+    // The value of AXSelectedText is not exposed through any AtkAttribute.
+    if (atkAttributeName == "AXSelectedText") {
+        String string = selectedText(m_element.get());
+        return JSStringCreateWithUTF8CString(string.utf8().data());
+    }
+
+    // Try object attributes before text attributes.
     String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, atkAttributeName);
 
     // Try text attributes if the requested one was not found and we have an AtkText object.
@@ -1450,8 +1473,16 @@
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line)
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    if (!ATK_IS_TEXT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    AtkText* text = ATK_TEXT(m_element.get());
+    gint startOffset = 0, endOffset = 0;
+    for (int i = 0; i <= line; ++i)
+        atk_text_get_string_at_offset(text, endOffset, ATK_TEXT_GRANULARITY_LINE, &startOffset, &endOffset);
+
+    GUniquePtr<gchar> range(g_strdup_printf("{%d, %d}", startOffset, endOffset - startOffset));
+    return JSStringCreateWithUTF8CString(range.get());
 }
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int x, int y)
@@ -1462,8 +1493,14 @@
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    if (!ATK_IS_TEXT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    AtkTextRectangle rect;
+    atk_text_get_range_extents(ATK_TEXT(m_element.get()), location, location + length, ATK_XY_WINDOW, &rect);
+
+    GUniquePtr<gchar> bounds(g_strdup_printf("{%d, %d, %d, %d}", rect.x, rect.y, rect.width, rect.height));
+    return JSStringCreateWithUTF8CString(bounds.get());
 }
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
@@ -1477,8 +1514,29 @@
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    if (!ATK_IS_TEXT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    StringBuilder builder;
+
+    // The default text attributes apply to the entire element.
+    builder.append("\n\tDefault text attributes:\n\t\t");
+    builder.append(attributeSetToString(getAttributeSet(m_element.get(), TextAttributeType), "\n\t\t"));
+
+    // The attribute run provides attributes specific to the range of text at the specified offset.
+    AtkAttributeSet* attributeSet;
+    AtkText* text = ATK_TEXT(m_element.get());
+    gint start = 0, end = 0;
+    for (int i = location; i < location + length; i = end) {
+        AtkAttributeSet* attributeSet = atk_text_get_run_attributes(text, i, &start, &end);
+        GUniquePtr<gchar> substring(replaceCharactersForResults(atk_text_get_text(text, start, end)));
+        builder.append(String::format("\n\tRange attributes for '%s':\n\t\t", substring.get()));
+        builder.append(attributeSetToString(attributeSet, "\n\t\t"));
+    }
+
+    atk_attribute_set_free(attributeSet);
+
+    return JSStringCreateWithUTF8CString(builder.toString().utf8().data());
 }
 
 bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to