Bug 235391

Summary: [LFC][IFC] Add LineContent::inlineBaseDirection to support line based inline direction
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
none
Patch none

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.