Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f7f3e11543724542dd187070c0cd5709ae8892d1
      
https://github.com/WebKit/WebKit/commit/f7f3e11543724542dd187070c0cd5709ae8892d1
  Author: Joshua Hoffman <jhoffma...@apple.com>
  Date:   2025-03-25 (Tue, 25 Mar 2025)

  Changed paths:
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    M LayoutTests/accessibility/mac/bounds-for-range-expected.txt
    A LayoutTests/accessibility/mac/bounds-for-range-multiline-expected.txt
    A LayoutTests/accessibility/mac/bounds-for-range-multiline.html
    A LayoutTests/accessibility/mac/bounds-for-range-vertical-expected.txt
    A LayoutTests/accessibility/mac/bounds-for-range-vertical.html
    M LayoutTests/accessibility/mac/bounds-for-range.html
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/AXTextRun.cpp
    M Source/WebCore/accessibility/AXTextRun.h
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h

  Log Message:
  -----------
  AX: [AX Thread Text APIs] Cache text run character widths up front to more 
accurately serve bounds APIs
https://bugs.webkit.org/show_bug.cgi?id=290315
rdar://147752500

Reviewed by Tyler Wilcock.

In the quest to improve the accuracy of the text marker bounds that are served 
off of the main thread,
this new approach caches the widths of each character in a run up-front. We do 
this a new method in
FontCascade to compute the width, and storing these widths in the text run. 
Then, when we serve the
bounds for a given range, we can sum up these advances (in the direction of the 
text orientation) to
build a more accurate bounds. This adds the extra benefit of more gracefully 
handling Horizontal and
Vertical text orientations.

Two new tests were added with this change. One test verifies bounds 
calculations when they span across
soft line breaks. The other tests bounds with mixed/upright vertical text.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
* LayoutTests/accessibility/mac/bounds-for-range-expected.txt:
* LayoutTests/accessibility/mac/bounds-for-range-multiline-expected.txt: Added.
* LayoutTests/accessibility/mac/bounds-for-range-multiline.html: Added.
* LayoutTests/accessibility/mac/bounds-for-range-vertical-expected.txt: Added.
* LayoutTests/accessibility/mac/bounds-for-range-vertical.html: Added.
* LayoutTests/accessibility/mac/bounds-for-range.html:
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::viewportRelativeFrameFromRuns):
* Source/WebCore/accessibility/AXTextRun.cpp:
(WebCore::AXTextRuns::localRect const):
* Source/WebCore/accessibility/AXTextRun.h:
(WebCore::AXTextRun::AXTextRun):
(WebCore::AXTextRun::advances const):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textRuns):
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForCharacterInRun const):
* Source/WebCore/platform/graphics/FontCascade.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to