Changeset 85007 in webkit


Ignore:
Timestamp:
Apr 26, 2011 8:50:15 PM (13 years ago)
Author:
Chris Fleizach
Message:

2011-04-26 Chris Fleizach <Chris Fleizach>

Reviewed by Adele Peterson.

AX: Add more text marker routines to DRT
https://bugs.webkit.org/show_bug.cgi?id=58949

  • platform/mac/accessibility/textmarker-string-for-range-expected.txt: Added.
  • platform/mac/accessibility/textmarker-string-for-range.html: Added.

2011-04-26 Chris Fleizach <Chris Fleizach>

Reviewed by Adele Peterson.

AX: Add more text marker routines to DRT
https://bugs.webkit.org/show_bug.cgi?id=58949

Add a few more methods to help test the text marker system, including nextMarker, previousMarker and
stringForMarkerRange.

  • DumpRenderTree/AccessibilityUIElement.cpp: (nextTextMarkerCallback): (previousTextMarkerCallback): (stringForTextMarkerRangeCallback): (AccessibilityUIElement::previousTextMarker): (AccessibilityUIElement::nextTextMarker): (AccessibilityUIElement::stringForTextMarkerRange): (AccessibilityUIElement::getJSClass):
  • DumpRenderTree/AccessibilityUIElement.h:
  • DumpRenderTree/mac/AccessibilityUIElementMac.mm: (AccessibilityUIElement::previousTextMarker): (AccessibilityUIElement::nextTextMarker): (AccessibilityUIElement::stringForTextMarkerRange):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85006 r85007  
     12011-04-26  Chris Fleizach  <cfleizach@apple.com>
     2
     3        Reviewed by Adele Peterson.
     4
     5        AX: Add more text marker routines to DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=58949
     7
     8        * platform/mac/accessibility/textmarker-string-for-range-expected.txt: Added.
     9        * platform/mac/accessibility/textmarker-string-for-range.html: Added.
     10
    1112011-04-26  Dirk Pranke  <dpranke@chromium.org>
    212
  • trunk/Tools/ChangeLog

    r85003 r85007  
     12011-04-26  Chris Fleizach  <cfleizach@apple.com>
     2
     3        Reviewed by Adele Peterson.
     4
     5        AX: Add more text marker routines to DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=58949
     7
     8        Add a few more methods to help test the text marker system, including nextMarker, previousMarker and
     9        stringForMarkerRange.
     10
     11        * DumpRenderTree/AccessibilityUIElement.cpp:
     12        (nextTextMarkerCallback):
     13        (previousTextMarkerCallback):
     14        (stringForTextMarkerRangeCallback):
     15        (AccessibilityUIElement::previousTextMarker):
     16        (AccessibilityUIElement::nextTextMarker):
     17        (AccessibilityUIElement::stringForTextMarkerRange):
     18        (AccessibilityUIElement::getJSClass):
     19        * DumpRenderTree/AccessibilityUIElement.h:
     20        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
     21        (AccessibilityUIElement::previousTextMarker):
     22        (AccessibilityUIElement::nextTextMarker):
     23        (AccessibilityUIElement::stringForTextMarkerRange):
     24
    1252011-04-26  Dan Bernstein  <mitz@apple.com>
    226
  • trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp

    r74025 r85007  
    455455}
    456456
     457static JSValueRef nextTextMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     458{
     459    AccessibilityTextMarker* marker = 0;
     460    if (argumentCount == 1)
     461        marker = toTextMarker(JSValueToObject(context, arguments[0], exception));
     462   
     463    return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->nextTextMarker(marker));
     464}
     465
     466static JSValueRef previousTextMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     467{
     468    AccessibilityTextMarker* marker = 0;
     469    if (argumentCount == 1)
     470        marker = toTextMarker(JSValueToObject(context, arguments[0], exception));
     471   
     472    return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->previousTextMarker(marker));
     473}
     474
     475static JSValueRef stringForTextMarkerRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     476{
     477    AccessibilityTextMarkerRange* markerRange = 0;
     478    if (argumentCount == 1)
     479        markerRange = toTextMarkerRange(JSValueToObject(context, arguments[0], exception));
     480   
     481    JSRetainPtr<JSStringRef> markerRangeString(Adopt, toAXElement(thisObject)->stringForTextMarkerRange(markerRange));
     482    return JSValueMakeString(context, markerRangeString.get());   
     483}
     484
    457485static JSValueRef textMarkerForPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    458486{
     
    838866
    839867AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
     868{
     869    return 0;
     870}
     871
     872AccessibilityTextMarker AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*)
     873{
     874    return 0;   
     875}
     876
     877AccessibilityTextMarker AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*)
     878{
     879    return 0;
     880}
     881
     882JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*)
    840883{
    841884    return 0;
     
    9691012        { "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    9701013        { "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     1014        { "nextTextMarker", nextTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     1015        { "previousTextMarker", previousTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     1016        { "stringForTextMarkerRange", stringForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    9711017        { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    9721018        { "selectedChildAtIndex", selectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/Tools/DumpRenderTree/AccessibilityUIElement.h

    r74025 r85007  
    203203    AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
    204204    AccessibilityTextMarker textMarkerForPoint(int x, int y);
     205    AccessibilityTextMarker previousTextMarker(AccessibilityTextMarker*);
     206    AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker*);
    205207    AccessibilityUIElement accessibilityElementForTextMarker(AccessibilityTextMarker*);
     208    JSStringRef stringForTextMarkerRange(AccessibilityTextMarkerRange*);
    206209    int textMarkerRangeLength(AccessibilityTextMarkerRange*);
    207210   
  • trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm

    r74025 r85007  
    12871287}
    12881288
     1289AccessibilityTextMarker AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
     1290{
     1291    BEGIN_AX_OBJC_EXCEPTIONS
     1292    id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
     1293    return AccessibilityTextMarker(previousMarker);
     1294    END_AX_OBJC_EXCEPTIONS
     1295   
     1296    return 0;
     1297}
     1298
     1299AccessibilityTextMarker AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
     1300{
     1301    BEGIN_AX_OBJC_EXCEPTIONS
     1302    id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
     1303    return AccessibilityTextMarker(nextMarker);
     1304    END_AX_OBJC_EXCEPTIONS
     1305   
     1306    return 0;
     1307}
     1308
     1309JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
     1310{
     1311    BEGIN_AX_OBJC_EXCEPTIONS
     1312    id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(id)markerRange->platformTextMarkerRange()];
     1313    return [textString createJSStringRef];
     1314    END_AX_OBJC_EXCEPTIONS
     1315   
     1316    return 0;
     1317}
    12891318
    12901319AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
Note: See TracChangeset for help on using the changeset viewer.