Bug 233880 - [LFC][IFC] Refactor bidi inline box boundary handling
Summary: [LFC][IFC] Refactor bidi inline box boundary handling
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: 2021-12-06 10:15 PST by zalan
Modified: 2021-12-09 13:05 PST (History)
5 users (show)

See Also:


Attachments
Patch (28.56 KB, patch)
2021-12-06 11:25 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (28.58 KB, patch)
2021-12-06 12:11 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (28.66 KB, patch)
2021-12-08 09:06 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (28.74 KB, patch)
2021-12-09 08:48 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 2021-12-06 10:15:38 PST
remove some code complexity by using more suitable data types.
Comment 1 zalan 2021-12-06 11:25:23 PST
Created attachment 446059 [details]
Patch
Comment 2 zalan 2021-12-06 12:11:16 PST
Created attachment 446067 [details]
Patch
Comment 3 zalan 2021-12-08 09:06:27 PST
Created attachment 446373 [details]
Patch
Comment 4 Antti Koivisto 2021-12-09 08:17:05 PST
Comment on attachment 446373 [details]
Patch

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

> Source/WebCore/ChangeLog:13
> +          the previous ends +-horizontal margins) unless the content is embedded in an inline box (e.g. <span>embedded content</soan>)

</span>

> Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:345
> +    Vector<std::unique_ptr<DisplayBoxNode>> children;

I think we could reduce heap allocation by making this Vector<DisplayBoxNode> (with some inline capacity perhaps).

> Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:371
> +    Vector<DisplayBoxNode*> m_stack;

Then this would probably need to be replaced with some sort of index thing.
Comment 5 zalan 2021-12-09 08:46:11 PST
(In reply to Antti Koivisto from comment #4)
> Comment on attachment 446373 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=446373&action=review
> 
> > Source/WebCore/ChangeLog:13
> > +          the previous ends +-horizontal margins) unless the content is embedded in an inline box (e.g. <span>embedded content</soan>)
> 
> </span>
> 
> > Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:345
> > +    Vector<std::unique_ptr<DisplayBoxNode>> children;
> 
> I think we could reduce heap allocation by making this
> Vector<DisplayBoxNode> (with some inline capacity perhaps).
> 
> > Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:371
> > +    Vector<DisplayBoxNode*> m_stack;
> 
> Then this would probably need to be replaced with some sort of index thing.
That's a very good point. I hope it's ok if I address this in a follow up patch.
Comment 6 zalan 2021-12-09 08:48:28 PST
Created attachment 446555 [details]
Patch
Comment 7 EWS 2021-12-09 09:28:12 PST
Committed r286784 (245025@main): <https://commits.webkit.org/245025@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446555 [details].
Comment 8 Radar WebKit Bug Importer 2021-12-09 13:05:48 PST
<rdar://problem/86287068>