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

Changeset 268831 in webkit


Ignore:
Timestamp:
Oct 21, 2020, 3:15:49 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r268084. rdar://problem/70541921

AX: Expose lineRangeForPosition for iOS Accessibility code
https://bugs.webkit.org/show_bug.cgi?id=217256
<rdar://problem/67478962>

Reviewed by Zalan Bujtas.

Expose the existing lineRangeForPosition method for iOS accessibility.

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper lineMarkersForMarker:]):

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

Location:
branches/safari-610-branch/Source/WebCore
Files:
2 edited

Legend:

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

    r268830 r268831  
     12020-10-21  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r268084. rdar://problem/70541921
     4
     5    AX: Expose lineRangeForPosition for iOS Accessibility code
     6    https://bugs.webkit.org/show_bug.cgi?id=217256
     7    <rdar://problem/67478962>
     8   
     9    Reviewed by Zalan Bujtas.
     10   
     11    Expose the existing lineRangeForPosition method for iOS accessibility.
     12   
     13    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     14    (-[WebAccessibilityObjectWrapper lineMarkersForMarker:]):
     15   
     16   
     17    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     18
     19    2020-10-06  Chris Fleizach  <cfleizach@apple.com>
     20
     21            AX: Expose lineRangeForPosition for iOS Accessibility code
     22            https://bugs.webkit.org/show_bug.cgi?id=217256
     23            <rdar://problem/67478962>
     24
     25            Reviewed by Zalan Bujtas.
     26
     27            Expose the existing lineRangeForPosition method for iOS accessibility.
     28
     29            * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     30            (-[WebAccessibilityObjectWrapper lineMarkersForMarker:]):
     31
    1322020-10-21  Russell Epstein  <repstein@apple.com>
    233
  • branches/safari-610-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r265278 r268831  
    26762676}
    26772677
     2678// Returns start/end markers for the line based on position
     2679- (NSArray<WebAccessibilityTextMarker *> *)lineMarkersForMarker:(WebAccessibilityTextMarker *)marker
     2680{
     2681    if (![self _prepareAccessibilityCall])
     2682        return nil;
     2683
     2684    if (!marker)
     2685        return nil;
     2686
     2687    auto range = self.axBackingObject->lineRangeForPosition([marker visiblePosition]);
     2688    auto* startMarker = [WebAccessibilityTextMarker textMarkerWithVisiblePosition:range.start cache:self.axBackingObject->axObjectCache()];
     2689    auto* endMarker = [WebAccessibilityTextMarker textMarkerWithVisiblePosition:range.end cache:self.axBackingObject->axObjectCache()];
     2690    if (!startMarker || !endMarker)
     2691        return nil;
     2692   
     2693    return @[ startMarker, endMarker ];
     2694}
     2695
    26782696// This method is intended to return the marker at the start of the line starting at
    26792697// the marker that is passed into the method.
Note: See TracChangeset for help on using the changeset viewer.