AX: doAXRangeForLine does not work
[WebKit-https.git] / WebKitTools / DumpRenderTree / mac / AccessibilityUIElementMac.mm
index 13c9fa1..2ca5755 100644 (file)
@@ -835,6 +835,18 @@ int AccessibilityUIElement::lineForIndex(int index)
     return -1;
 }
 
+JSStringRef AccessibilityUIElement::rangeForLine(int line)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityRangeForLineParameterizedAttribute forParameter:[NSNumber numberWithInt:line]];
+    if ([value isKindOfClass:[NSValue class]]) {
+        return [NSStringFromRange([value rangeValue]) createJSStringRef];
+    }
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
 JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
 {
     NSRange range = NSMakeRange(location, length);