Title: [273801] branches/safari-612.1.5-branch
Revision
273801
Author
[email protected]
Date
2021-03-02 19:09:17 -0800 (Tue, 02 Mar 2021)

Log 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

Modified Paths

Diff

Modified: branches/safari-612.1.5-branch/Source/WebCore/ChangeLog (273800 => 273801)


--- branches/safari-612.1.5-branch/Source/WebCore/ChangeLog	2021-03-03 03:09:13 UTC (rev 273800)
+++ branches/safari-612.1.5-branch/Source/WebCore/ChangeLog	2021-03-03 03:09:17 UTC (rev 273801)
@@ -1,5 +1,53 @@
 2021-03-02  Alan Coon  <[email protected]>
 
+        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
+
+    2021-02-26  Andres Gonzalez  <[email protected]>
+
+            Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
+            https://bugs.webkit.org/show_bug.cgi?id=222477
+            <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.
+
+2021-03-02  Alan Coon  <[email protected]>
+
         Cherry-pick r273568. rdar://problem/74952680
 
     [GPUP] Allow painting of GPUP hosted video from the WebContent process

Modified: branches/safari-612.1.5-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (273800 => 273801)


--- branches/safari-612.1.5-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2021-03-03 03:09:13 UTC (rev 273800)
+++ branches/safari-612.1.5-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2021-03-03 03:09:17 UTC (rev 273801)
@@ -3478,12 +3478,6 @@
     });
 }
 
-- (AXTextMarkerRangeRef)textMarkerRangeForNSRange:(const NSRange&)range
-{
-    auto* backingObject = self.updateObjectBackingStore;
-    return backingObject ? backingObject->textMarkerRangeForNSRange(range) : nil;
-}
-
 // FIXME: No reason for this to be a method instead of a function; can get document from range.
 - (NSRange)_convertToNSRange:(const SimpleRange&)range
 {
@@ -3860,6 +3854,8 @@
         return convertToNSArray(results);
     }
 
+    // TextMarker attributes.
+
     if ([attribute isEqualToString:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute]) {
         return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retainPtr(self)] () -> RetainPtr<id> {
             auto* backingObject = protectedSelf.get().axBackingObject;
@@ -3894,6 +3890,10 @@
         });
     }
 
+    // TextMarkerRange attributes.
+    if ([attribute isEqualToString:@"AXTextMarkerRangeForNSRange"])
+        return (id)backingObject->textMarkerRangeForNSRange(range);
+
     if ([attribute isEqualToString:NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute])
         return (id)[self lineTextMarkerRangeForTextMarker:textMarker forUnit:TextUnit::Line];
 

Modified: branches/safari-612.1.5-branch/Tools/ChangeLog (273800 => 273801)


--- branches/safari-612.1.5-branch/Tools/ChangeLog	2021-03-03 03:09:13 UTC (rev 273800)
+++ branches/safari-612.1.5-branch/Tools/ChangeLog	2021-03-03 03:09:17 UTC (rev 273801)
@@ -1,5 +1,46 @@
 2021-03-02  Alan Coon  <[email protected]>
 
+        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
+
+    2021-02-26  Andres Gonzalez  <[email protected]>
+
+            Add AXTextMarkerRangeForNSRange attribute so that Mac clients can access this functionality.
+            https://bugs.webkit.org/show_bug.cgi?id=222477
+
+            Reviewed by Chris Fleizach.
+
+            * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+            (WTR::AccessibilityUIElement::textMarkerRangeForRange):
+
+2021-03-02  Alan Coon  <[email protected]>
+
         Cherry-pick r273314. rdar://problem/74953186
 
     aspect-ratio shows in computed style when disabled

Modified: branches/safari-612.1.5-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (273800 => 273801)


--- branches/safari-612.1.5-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2021-03-03 03:09:13 UTC (rev 273800)
+++ branches/safari-612.1.5-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2021-03-03 03:09:17 UTC (rev 273801)
@@ -83,7 +83,6 @@
 - (BOOL)isIsolatedObject;
 - (BOOL)accessibilityReplaceRange:(NSRange)range withText:(NSString *)string;
 - (BOOL)accessibilityInsertText:(NSString *)text;
-- (id)textMarkerRangeForNSRange:(const NSRange&)nsRange;
 - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
 - (NSUInteger)accessibilityIndexOfChild:(id)child;
 - (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
@@ -1828,7 +1827,8 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForRange(unsigned location, unsigned length)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    return AccessibilityTextMarkerRange::create([m_element textMarkerRangeForNSRange:NSMakeRange(location, length)]);
+    return AccessibilityTextMarkerRange::create([m_element accessibilityAttributeValue:@"AXTextMarkerRangeForNSRange"
+        forParameter:[NSValue valueWithRange:NSMakeRange(location, length)]]);
     END_AX_OBJC_EXCEPTIONS
 
     return nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to