Changeset 77307 in webkit
- Timestamp:
- Feb 1, 2011 2:33:08 PM (13 years ago)
- Location:
- branches/safari-533.20-branch
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-533.20-branch/LayoutTests/ChangeLog
r77304 r77307 1 2011-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 1 15 2011-02-01 Mark Rowe <mrowe@apple.com> 2 16 -
branches/safari-533.20-branch/WebCore/ChangeLog
r77304 r77307 1 2011-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 1 21 2011-02-01 Mark Rowe <mrowe@apple.com> 2 22 -
branches/safari-533.20-branch/WebCore/accessibility/AccessibilityRenderObject.cpp
r68706 r77307 2634 2634 return PlainTextRange(); 2635 2635 } 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); 2650 2641 int index2 = indexForVisiblePosition(endPosition); 2651 2642 -
branches/safari-533.20-branch/WebKitTools/ChangeLog
r68607 r77307 1 2011-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 1 22 2010-07-09 Mark Rowe <mrowe@apple.com> 2 23 -
branches/safari-533.20-branch/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
r68607 r77307 129 129 } 130 130 131 static 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 131 141 static JSValueRef boundsForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 132 142 { … … 630 640 return JSValueMakeUndefined(context); 631 641 } 642 643 // Implementation 644 645 // Unsupported methods on various platforms. 646 #if !PLATFORM(MAC) 647 JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; } 648 #endif 632 649 633 650 // Destruction … … 701 718 { "parameterizedAttributeNames", parameterizedAttributeNamesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 702 719 { "lineForIndex", lineForIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 720 { "rangeForLine", rangeForLineCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 703 721 { "boundsForRange", boundsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 704 722 { "stringForRange", stringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
branches/safari-533.20-branch/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
r68607 r77307 173 173 // Parameterized attributes 174 174 int lineForIndex(int); 175 JSStringRef rangeForLine(int); 175 176 JSStringRef boundsForRange(unsigned location, unsigned length); 176 177 void setSelectedTextRange(unsigned location, unsigned length); -
branches/safari-533.20-branch/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
r68607 r77307 669 669 } 670 670 671 JSStringRef 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 671 683 JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length) 672 684 {
Note: See TracChangeset
for help on using the changeset viewer.