⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 273583 in webkit


Ignore:
Timestamp:
Feb 26, 2021, 1:02:38 PM (6 years ago)
Author:
Andres Gonzalez
Message:

Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
​https://bugs.webkit.org/show_bug.cgi?id=222477
Source/WebCore:

<rdar://problem/74793445>

Reviewed by Chris Fleizach.

This is a follow up to: ​https://bugs.webkit.org/show_bug.cgi?id=222154.
As Chris Fleizach pointed out in the above review, it is necessary to
add a handler in accessibilityAttributeValue:forParameter: for a new AX
attribute in order for clients to access this functionality.

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper textMarkerRangeForNSRange:]): Deleted.

Tools:

Reviewed by Chris Fleizach.

  • WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:

(WTR::AccessibilityUIElement::textMarkerRangeForRange):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r273568 r273583  
     12021-02-26  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
     4        https://bugs.webkit.org/show_bug.cgi?id=222477
     5        <rdar://problem/74793445>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        This is a follow up to: https://bugs.webkit.org/show_bug.cgi?id=222154.
     10        As Chris Fleizach pointed out in the above review, it is necessary to
     11        add a handler in accessibilityAttributeValue:forParameter: for a new AX
     12        attribute in order for clients to access this functionality.
     13
     14        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     15        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     16        (-[WebAccessibilityObjectWrapper textMarkerRangeForNSRange:]): Deleted.
     17
    1182021-02-26  Jer Noble  <jer.noble@apple.com>
    219
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r273276 r273583  
    34533453}
    34543454
    3455 - (AXTextMarkerRangeRef)textMarkerRangeForNSRange:(const NSRange&)range
    3456 {
    3457     auto* backingObject = self.updateObjectBackingStore;
    3458     return backingObject ? backingObject->textMarkerRangeForNSRange(range) : nil;
    3459 }
    3460 
    34613455// FIXME: No reason for this to be a method instead of a function; can get document from range.
    34623456- (NSRange)_convertToNSRange:(const SimpleRange&)range
    … …  
    38353829    }
    38363830
     3831    // TextMarker attributes.
     3832
    38373833    if ([attribute isEqualToString:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute]) {
    38383834        return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retainPtr(self)] () -> RetainPtr<id> {
    … …  
    38683864        });
    38693865    }
     3866
     3867    // TextMarkerRange attributes.
     3868    if ([attribute isEqualToString:@"AXTextMarkerRangeForNSRange"])
     3869        return (id)backingObject->textMarkerRangeForNSRange(range);
    38703870
    38713871    if ([attribute isEqualToString:NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute])
  • trunk/Tools/ChangeLog

    r273581 r273583  
     12021-02-26  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
     4        https://bugs.webkit.org/show_bug.cgi?id=222477
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
     9        (WTR::AccessibilityUIElement::textMarkerRangeForRange):
     10
    1112021-02-26  Aakash Jain  <aakash_jain@apple.com>
    212
  • trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

    r273227 r273583  
    8484- (BOOL)accessibilityReplaceRange:(NSRange)range withText:(NSString *)string;
    8585- (BOOL)accessibilityInsertText:(NSString *)text;
    86 - (id)textMarkerRangeForNSRange:(const NSRange&)nsRange;
    8786- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
    8887- (NSUInteger)accessibilityIndexOfChild:(id)child;
    … …  
    18291828{
    18301829    BEGIN_AX_OBJC_EXCEPTIONS
    1831     return AccessibilityTextMarkerRange::create([m_element textMarkerRangeForNSRange:NSMakeRange(location, length)]);
     1830    return AccessibilityTextMarkerRange::create([m_element accessibilityAttributeValue:@"AXTextMarkerRangeForNSRange"
     1831        forParameter:[NSValue valueWithRange:NSMakeRange(location, length)]]);
    18321832    END_AX_OBJC_EXCEPTIONS
    18331833
Note: See TracChangeset for help on using the changeset viewer.