Bug 235392 - [LFC][IFC] Implement TextUtil::directionForTextContent
Summary: [LFC][IFC] Implement TextUtil::directionForTextContent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-19 20:20 PST by zalan
Modified: 2022-01-20 19:00 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.02 KB, patch)
2022-01-19 20:24 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (2.02 KB, patch)
2022-01-20 08:52 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2022-01-19 20:20:13 PST
ssia
Comment 1 zalan 2022-01-19 20:24:37 PST
Created attachment 449549 [details]
Patch
Comment 2 zalan 2022-01-20 08:52:54 PST
Created attachment 449585 [details]
Patch
Comment 3 Antti Koivisto 2022-01-20 08:58:09 PST
Comment on attachment 449585 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449585&action=review

> Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:345
> +TextDirection TextUtil::directionForTextContent(StringView content)
>  {
> -    ASSERT_NOT_IMPLEMENTED_YET();
> -    return TextDirection::LTR;
> +    if (content.is8Bit())
> +        return TextDirection::LTR;
> +    return ubidi_getBaseDirection(content.characters16(), content.length()) == UBIDI_RTL ? TextDirection::RTL : TextDirection::LTR;
>  }

Nice
Comment 4 EWS 2022-01-20 18:59:23 PST
Committed r288343 (246249@main): <https://commits.webkit.org/246249@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449585 [details].
Comment 5 Radar WebKit Bug Importer 2022-01-20 19:00:17 PST
<rdar://problem/87862754>