Changeset 77307 in webkit


Ignore:
Timestamp:
Feb 1, 2011 2:33:08 PM (13 years ago)
Author:
mrowe@apple.com
Message:

Merge r69033.

Location:
branches/safari-533.20-branch
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-533.20-branch/LayoutTests/ChangeLog

    r77304 r77307  
     12011-02-01  Mark Rowe  <mrowe@apple.com>
     2
     3        Merge r69033.
     4
     5    2010-10-04  Chris Fleizach  <cfleizach@apple.com>
     6
     7        Reviewed by Beth Dakin.
     8
     9        AX: doAXRangeForLine does not work
     10        https://bugs.webkit.org/show_bug.cgi?id=47101
     11
     12        * platform/mac/accessibility/range-for-line-textarea-expected.txt: Added.
     13        * platform/mac/accessibility/range-for-line-textarea.html: Added.
     14
    1152011-02-01  Mark Rowe  <mrowe@apple.com>
    216
  • branches/safari-533.20-branch/WebCore/ChangeLog

    r77304 r77307  
     12011-02-01  Mark Rowe  <mrowe@apple.com>
     2
     3        Merge r69033.
     4
     5    2010-10-04  Chris Fleizach  <cfleizach@apple.com>
     6
     7        Reviewed by Beth Dakin.
     8
     9        AX: doAXRangeForLine does not work
     10        https://bugs.webkit.org/show_bug.cgi?id=47101
     11
     12        Asking for NSAccessibilityRangeForLine was returning a null range for any line number > 0.
     13        The code was using a SelectionController to extend to the next line. Rather than change the implementation
     14        of that core functionality, it is cleaner to use endOfLine to find the end of the line.
     15
     16        Test: platform/mac/accessibility/range-for-line-textarea.html
     17
     18        * accessibility/AccessibilityRenderObject.cpp:
     19        (WebCore::AccessibilityRenderObject::doAXRangeForLine):
     20
    1212011-02-01  Mark Rowe  <mrowe@apple.com>
    222
  • branches/safari-533.20-branch/WebCore/accessibility/AccessibilityRenderObject.cpp

    r68706 r77307  
    26342634            return PlainTextRange();
    26352635    }
    2636    
    2637     // make a caret selection for the marker position, then extend it to the line
    2638     // NOTE: ignores results of selection.modify because it returns false when
    2639     // starting at an empty line.  The resulting selection in that case
    2640     // will be a caret at visiblePos.
    2641     SelectionController selection;
    2642     selection.setSelection(VisibleSelection(visiblePos));
    2643     selection.modify(SelectionController::EXTEND, SelectionController::LEFT, LineBoundary);
    2644     selection.modify(SelectionController::EXTEND, SelectionController::RIGHT, LineBoundary);
    2645    
    2646     // calculate the indices for the selection start and end
    2647     VisiblePosition startPosition = selection.selection().visibleStart();
    2648     VisiblePosition endPosition = selection.selection().visibleEnd();
    2649     int index1 = indexForVisiblePosition(startPosition);
     2636
     2637    // Get the end of the line based on the starting position.
     2638    VisiblePosition endPosition = endOfLine(visiblePos);
     2639
     2640    int index1 = indexForVisiblePosition(visiblePos);
    26502641    int index2 = indexForVisiblePosition(endPosition);
    26512642   
  • branches/safari-533.20-branch/WebKitTools/ChangeLog

    r68607 r77307  
     12011-02-01  Mark Rowe  <mrowe@apple.com>
     2
     3        Merge r69033.
     4
     5    2010-10-04  Chris Fleizach  <cfleizach@apple.com>
     6
     7        Reviewed by Beth Dakin.
     8
     9        AX: doAXRangeForLine does not work
     10        https://bugs.webkit.org/show_bug.cgi?id=47101
     11
     12        DRT support to handle NSAccessibilityRangeForLineParameterizedAttribute.
     13
     14        * DumpRenderTree/AccessibilityUIElement.cpp:
     15        (rangeForLineCallback):
     16        (AccessibilityUIElement::rangeForLine):
     17        (AccessibilityUIElement::getJSClass):
     18        * DumpRenderTree/AccessibilityUIElement.h:
     19        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
     20        (AccessibilityUIElement::rangeForLine):
     21
    1222010-07-09  Mark Rowe  <mrowe@apple.com>
    223
  • branches/safari-533.20-branch/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp

    r68607 r77307  
    129129}
    130130
     131static JSValueRef rangeForLineCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     132{
     133    int indexNumber = -1;
     134    if (argumentCount == 1)
     135        indexNumber = JSValueToNumber(context, arguments[0], exception);
     136   
     137    JSRetainPtr<JSStringRef> rangeLine(Adopt, toAXElement(thisObject)->rangeForLine(indexNumber));
     138    return JSValueMakeString(context, rangeLine.get());
     139}
     140
    131141static JSValueRef boundsForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    132142{
     
    630640    return JSValueMakeUndefined(context);
    631641}
     642
     643// Implementation
     644
     645// Unsupported methods on various platforms.
     646#if !PLATFORM(MAC)
     647JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
     648#endif
    632649
    633650// Destruction
     
    701718        { "parameterizedAttributeNames", parameterizedAttributeNamesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    702719        { "lineForIndex", lineForIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     720        { "rangeForLine", rangeForLineCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    703721        { "boundsForRange", boundsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    704722        { "stringForRange", stringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • branches/safari-533.20-branch/WebKitTools/DumpRenderTree/AccessibilityUIElement.h

    r68607 r77307  
    173173    // Parameterized attributes
    174174    int lineForIndex(int);
     175    JSStringRef rangeForLine(int);
    175176    JSStringRef boundsForRange(unsigned location, unsigned length);
    176177    void setSelectedTextRange(unsigned location, unsigned length);
  • branches/safari-533.20-branch/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm

    r68607 r77307  
    669669}
    670670
     671JSStringRef AccessibilityUIElement::rangeForLine(int line)
     672{
     673    BEGIN_AX_OBJC_EXCEPTIONS
     674    id value = [m_element accessibilityAttributeValue:NSAccessibilityRangeForLineParameterizedAttribute forParameter:[NSNumber numberWithInt:line]];
     675    if ([value isKindOfClass:[NSValue class]]) {
     676        return [NSStringFromRange([value rangeValue]) createJSStringRef];
     677    }
     678    END_AX_OBJC_EXCEPTIONS
     679   
     680    return 0;
     681}
     682
    671683JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
    672684{
Note: See TracChangeset for help on using the changeset viewer.