Bug 235391 - [LFC][IFC] Add LineContent::inlineBaseDirection to support line based inline direction
Summary: [LFC][IFC] Add LineContent::inlineBaseDirection to support line based inline ...
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 19:58 PST by zalan
Modified: 2022-01-20 17:07 PST (History)
5 users (show)

See Also:


Attachments
Patch (10.36 KB, patch)
2022-01-19 20:08 PST, zalan
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (10.36 KB, patch)
2022-01-19 20:19 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (10.73 KB, patch)
2022-01-20 08:48 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (10.73 KB, patch)
2022-01-20 08:51 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (11.91 KB, patch)
2022-01-20 14:06 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 19:58:02 PST
and not just block based.
Comment 1 zalan 2022-01-19 20:08:05 PST
Created attachment 449546 [details]
Patch
Comment 2 zalan 2022-01-19 20:19:20 PST
Created attachment 449547 [details]
Patch
Comment 3 zalan 2022-01-20 08:48:12 PST
Created attachment 449583 [details]
Patch
Comment 4 zalan 2022-01-20 08:51:58 PST
Created attachment 449584 [details]
Patch
Comment 5 Antti Koivisto 2022-01-20 08:57:50 PST
Comment on attachment 449584 [details]
Patch

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

> Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:53
> +    // FIXME: We could try to reuse the content builder in InlineItemsBuilder if this turns out to be a perf bottleneck. 
> +    StringBuilder lineContentBuilder;
> +    for (auto& run : runs) {
> +        if (!run.isText())
> +            continue;
> +        auto& textContent = run.textContent();
> +        lineContentBuilder.append(downcast<InlineTextBox>(run.layoutBox()).content().substring(textContent->start, textContent->length));
> +    }

Wonder if copying could be avoided in some common cases and a stringview to content() string scanned directly
Comment 6 zalan 2022-01-20 14:06:35 PST
Created attachment 449610 [details]
Patch
Comment 7 EWS 2022-01-20 16:18:55 PST
Committed r288332 (246240@main): <https://commits.webkit.org/246240@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449610 [details].
Comment 8 Radar WebKit Bug Importer 2022-01-20 16:19:19 PST
<rdar://problem/87855803>
Comment 9 zalan 2022-01-20 17:07:01 PST
(In reply to Antti Koivisto from comment #5)
> Comment on attachment 449584 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449584&action=review
> 
> > Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:53
> > +    // FIXME: We could try to reuse the content builder in InlineItemsBuilder if this turns out to be a perf bottleneck. 
> > +    StringBuilder lineContentBuilder;
> > +    for (auto& run : runs) {
> > +        if (!run.isText())
> > +            continue;
> > +        auto& textContent = run.textContent();
> > +        lineContentBuilder.append(downcast<InlineTextBox>(run.layoutBox()).content().substring(textContent->start, textContent->length));
> > +    }
> 
> Wonder if copying could be avoided in some common cases and a stringview to
> content() string scanned directly
Yeah, I think we could add a fast path like that.