| Summary: | [LFC][IFC] Add LineContent::inlineBaseDirection to support line based inline direction | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zalan <zalan> | ||||||||||||
| Component: | Layout and Rendering | Assignee: | 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
zalan
2022-01-19 19:58:02 PST
Created attachment 449546 [details]
Patch
Created attachment 449547 [details]
Patch
Created attachment 449583 [details]
Patch
Created attachment 449584 [details]
Patch
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 Created attachment 449610 [details]
Patch
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]. (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. |