[webkit-changes] [WebKit/WebKit] 3a1d73: AX: The platform wrapper code is unnecessarily cre...

AndresGonzalezApple noreply at github.com
Wed Mar 29 06:05:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3a1d73db387c7462d8782dc093fafb75a1e260dc
      https://github.com/WebKit/WebKit/commit/3a1d73db387c7462d8782dc093fafb75a1e260dc
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: The platform wrapper code is unnecessarily creating an additional SimpleRange when calculating a TextMarkerRange length.
https://bugs.webkit.org/show_bug.cgi?id=254620
<rdar://problem/107335186>

Reviewed by Tyler Wilcock.

Changed the AXObjectCache::lengthForRange method to take a SimpleRange instead of an optional and return an unsigned instead of an int, as it should.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::lengthForRange):
(WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
* Source/WebCore/accessibility/AXObjectCache.h:

The wrapper code doesn't call the SimpleRange copy constructor unnecessarily any more, and doesn't need to check for a negative value for the length.
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper lengthForTextMarkers:]):
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

Canonical link: https://commits.webkit.org/262270@main




More information about the webkit-changes mailing list