Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e1e98dfa5bb94b1df6872a71be21f247b80e582b
https://github.com/WebKit/WebKit/commit/e1e98dfa5bb94b1df6872a71be21f247b80e582b
Author: Claudio Saavedra <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp
Log Message:
-----------
[ATSPI] Do not convert the accessible text to UTF-8 only to check whether it
is null
https://bugs.webkit.org/show_bug.cgi?id=325935
Reviewed by Adrian Perez de Castro.
Most of the text interface methods converted the whole accessible text to
UTF-8 and then either checked the copy for null and nothing more, or did
not read it at all. That check cannot fire: String::utf8() returns a
non-null empty CString for a null String, and has done so since these
methods were written. Now that the code point counts come from the UTF-16
string, each call allocated and transcoded the text for no effect.
Drop the conversion and the check. The methods that do need the UTF-8
bytes, text(), textAtOffset() and characterAtOffset(), keep the conversion
and lose only the check. No change in behavior.
* Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::text const):
(WebCore::AccessibilityObjectAtspi::textInserted):
(WebCore::AccessibilityObjectAtspi::textDeleted):
(WebCore::AccessibilityObjectAtspi::textAtOffset const):
(WebCore::AccessibilityObjectAtspi::characterAtOffset const):
(WebCore::AccessibilityObjectAtspi::characterIndex const):
(WebCore::AccessibilityObjectAtspi::textExtents const):
(WebCore::AccessibilityObjectAtspi::offsetAtPoint const):
(WebCore::AccessibilityObjectAtspi::selectionBounds const):
(WebCore::AccessibilityObjectAtspi::selectRange):
(WebCore::AccessibilityObjectAtspi::selectionChanged):
(WebCore::AccessibilityObjectAtspi::textAttributesWithUTF8Offset const):
(WebCore::AccessibilityObjectAtspi::scrollToMakeVisible const):
(WebCore::AccessibilityObjectAtspi::scrollToPoint const):
Canonical link: https://commits.webkit.org/322381@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications