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

Changeset 273801 in webkit


Ignore:
Timestamp:
Mar 2, 2021, 7:09:17 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r273583. rdar://problem/74953376

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):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@273583 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.1.5-branch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1.5-branch/Source/WebCore/ChangeLog

    r273800 r273801  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273583. rdar://problem/74953376
     4
     5    Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
     6    https://bugs.webkit.org/show_bug.cgi?id=222477
     7    Source/WebCore:
     8   
     9    <rdar://problem/74793445>
     10   
     11    Reviewed by Chris Fleizach.
     12   
     13    This is a follow up to: https://bugs.webkit.org/show_bug.cgi?id=222154.
     14    As Chris Fleizach pointed out in the above review, it is necessary to
     15    add a handler in accessibilityAttributeValue:forParameter: for a new AX
     16    attribute in order for clients to access this functionality.
     17   
     18    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     19    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     20    (-[WebAccessibilityObjectWrapper textMarkerRangeForNSRange:]): Deleted.
     21   
     22    Tools:
     23   
     24    Reviewed by Chris Fleizach.
     25   
     26    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
     27    (WTR::AccessibilityUIElement::textMarkerRangeForRange):
     28   
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2021-02-26  Andres Gonzalez  <andresg_22@apple.com>
     33
     34            Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
     35            https://bugs.webkit.org/show_bug.cgi?id=222477
     36            <rdar://problem/74793445>
     37
     38            Reviewed by Chris Fleizach.
     39
     40            This is a follow up to: https://bugs.webkit.org/show_bug.cgi?id=222154.
     41            As Chris Fleizach pointed out in the above review, it is necessary to
     42            add a handler in accessibilityAttributeValue:forParameter: for a new AX
     43            attribute in order for clients to access this functionality.
     44
     45            * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     46            (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     47            (-[WebAccessibilityObjectWrapper textMarkerRangeForNSRange:]): Deleted.
     48
    1492021-03-02  Alan Coon  <alancoon@apple.com>
    250
  • branches/safari-612.1.5-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r273227 r273801  
    34793479}
    34803480
    3481 - (AXTextMarkerRangeRef)textMarkerRangeForNSRange:(const NSRange&)range
    3482 {
    3483     auto* backingObject = self.updateObjectBackingStore;
    3484     return backingObject ? backingObject->textMarkerRangeForNSRange(range) : nil;
    3485 }
    3486 
    34873481// FIXME: No reason for this to be a method instead of a function; can get document from range.
    34883482- (NSRange)_convertToNSRange:(const SimpleRange&)range
    … …  
    38613855    }
    38623856
     3857    // TextMarker attributes.
     3858
    38633859    if ([attribute isEqualToString:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute]) {
    38643860        return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retainPtr(self)] () -> RetainPtr<id> {
    … …  
    38943890        });
    38953891    }
     3892
     3893    // TextMarkerRange attributes.
     3894    if ([attribute isEqualToString:@"AXTextMarkerRangeForNSRange"])
     3895        return (id)backingObject->textMarkerRangeForNSRange(range);
    38963896
    38973897    if ([attribute isEqualToString:NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute])
  • branches/safari-612.1.5-branch/Tools/ChangeLog

    r273791 r273801  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273583. rdar://problem/74953376
     4
     5    Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
     6    https://bugs.webkit.org/show_bug.cgi?id=222477
     7    Source/WebCore:
     8   
     9    <rdar://problem/74793445>
     10   
     11    Reviewed by Chris Fleizach.
     12   
     13    This is a follow up to: https://bugs.webkit.org/show_bug.cgi?id=222154.
     14    As Chris Fleizach pointed out in the above review, it is necessary to
     15    add a handler in accessibilityAttributeValue:forParameter: for a new AX
     16    attribute in order for clients to access this functionality.
     17   
     18    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     19    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     20    (-[WebAccessibilityObjectWrapper textMarkerRangeForNSRange:]): Deleted.
     21   
     22    Tools:
     23   
     24    Reviewed by Chris Fleizach.
     25   
     26    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
     27    (WTR::AccessibilityUIElement::textMarkerRangeForRange):
     28   
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2021-02-26  Andres Gonzalez  <andresg_22@apple.com>
     33
     34            Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
     35            https://bugs.webkit.org/show_bug.cgi?id=222477
     36
     37            Reviewed by Chris Fleizach.
     38
     39            * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
     40            (WTR::AccessibilityUIElement::textMarkerRangeForRange):
     41
    1422021-03-02  Alan Coon  <alancoon@apple.com>
    243
  • branches/safari-612.1.5-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

    r273227 r273801  
    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.