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

Changeset 268084 in webkit


Ignore:
Timestamp:
Oct 6, 2020, 4:21:34 PM (6 years ago)
Author:
Chris Fleizach
Message:

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

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r268082 r268084  
     12020-10-06  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Expose lineRangeForPosition for iOS Accessibility code
     4        https://bugs.webkit.org/show_bug.cgi?id=217256
     5        <rdar://problem/67478962>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Expose the existing lineRangeForPosition method for iOS accessibility.
     10
     11        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     12        (-[WebAccessibilityObjectWrapper lineMarkersForMarker:]):
     13
    1142020-10-06  Zalan Bujtas  <zalan@apple.com>
    215
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r267363 r268084  
    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.