Bug 222520 - [LFC][IFC] Every line box must have a root inline box
Summary: [LFC][IFC] Every line box must have a root inline box
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-02-27 15:31 PST by zalan
Modified: 2021-02-28 08:23 PST (History)
6 users (show)

See Also:


Attachments
Patch (9.39 KB, patch)
2021-02-27 15:48 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (8.84 KB, patch)
2021-02-27 15:53 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (11.23 KB, patch)
2021-02-27 20:50 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-02-27 15:31:13 PST
let's construct the m_rootInlineBox in LineBox c'tor
Comment 1 zalan 2021-02-27 15:48:11 PST
Created attachment 421760 [details]
Patch
Comment 2 zalan 2021-02-27 15:53:44 PST
Created attachment 421761 [details]
Patch
Comment 3 Sam Weinig 2021-02-27 18:43:50 PST
Comment on attachment 421761 [details]
Patch

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

> Source/WebCore/ChangeLog:4
> +        [LFC][IFC] Every line box must have a root inline box
> +        https://bugs.webkit.org/show_bug.cgi?id=222520

Should it use a UniqueRef instead of a unique_ptr then, to indicate this via types?

> Source/WebCore/ChangeLog:18
> +        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
> +        (WebCore::Layout::LineBoxBuilder::build):
> +        (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
> +        * layout/inlineformatting/InlineLineBox.cpp:
> +        (WebCore::Layout::LineBox::LineBox):
> +        (WebCore::Layout::m_horizontalAlignmentOffset):
> +        (WebCore::Layout::LineBox::logicalRectForTextRun const):
> +        (WebCore::Layout::m_contentLogicalWidth): Deleted.
> +        (WebCore::Layout::LineBox::addRootInlineBox): Deleted.
> +        * layout/inlineformatting/InlineLineBox.h:
> +        (WebCore::Layout::LineBox::InlineLevelBox::createRootInlineBox): Deleted.

This could be fleshed out a bit.

> Source/WebCore/layout/inlineformatting/InlineLineBox.cpp:91
> +    , m_horizontalAlignmentOffset(horizontalAlignmentOffset)
>  {
> +    m_rootInlineBox = makeUnique<LineBox::InlineLevelBox>(rootLayoutBox, horizontalAlignmentOffset.valueOr(InlineLayoutUnit { }), InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox);

This seems like it should be in the list above.
Comment 4 zalan 2021-02-27 20:22:57 PST
(In reply to Sam Weinig from comment #3)
> Comment on attachment 421761 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=421761&action=review
> 
> > Source/WebCore/ChangeLog:4
> > +        [LFC][IFC] Every line box must have a root inline box
> > +        https://bugs.webkit.org/show_bug.cgi?id=222520
> 
> Should it use a UniqueRef instead of a unique_ptr then, to indicate this via
> types?
> 
I keep forgetting UniqueRef!!! Thanks.
Comment 5 zalan 2021-02-27 20:50:42 PST
Created attachment 421765 [details]
Patch
Comment 6 EWS 2021-02-28 08:22:25 PST
Committed r273636: <https://commits.webkit.org/r273636>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421765 [details].
Comment 7 Radar WebKit Bug Importer 2021-02-28 08:23:14 PST
<rdar://problem/74838464>