[Webkit-unassigned] [Bug 261056] AX: Expose accessibility attributes for inline text predictions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 7 05:51:40 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=261056

--- Comment #13 from Andres Gonzalez <andresg_22 at apple.com> ---
(In reply to Joshua Hoffman from comment #10)
> Created attachment 467570 [details]
> Patch

--- a/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm
+++ b/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm

+static void attributedStringSetCompositionAttributes(NSMutableAttributedString *attributedString, Node& node)
+{
+#if HAVE(INLINE_PREDICTIONS)
+    auto& editor = node.document().editor();
+
+    auto lastPresentedCompleteWord = editor.lastPresentedTextPredictionComplete();
+    unsigned lastPresentedCompleteWordLength = lastPresentedCompleteWord.text.length();
+    unsigned lastPresentedCompleteWordPosition = lastPresentedCompleteWord.location;
+
+    if (!attributedString)
+        return;

Should we move this param validation / early return to the beginning of the function?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230907/b1307155/attachment-0001.htm>


More information about the webkit-unassigned mailing list