Bug 190696 - [LFC][IFC] Add generic inline run generator.
Summary: [LFC][IFC] Add generic inline run generator.
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: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-17 19:16 PDT by zalan
Modified: 2018-10-19 09:12 PDT (History)
5 users (show)

See Also:


Attachments
Patch (42.25 KB, patch)
2018-10-17 19:59 PDT, zalan
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2018-10-17 19:16:05 PDT
Generate inline runs for any type of inline content (replaced, text, float, inline-block etc)
Comment 1 zalan 2018-10-17 19:59:59 PDT
Created attachment 352679 [details]
Patch
Comment 2 Antti Koivisto 2018-10-19 07:35:12 PDT
Comment on attachment 352679 [details]
Patch

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

> Source/WebCore/layout/inlineformatting/InlineRunProvider.h:100
> +        Run(const InlineItem&, Type);
> +        Run(const InlineItem&, Type, TextContext);

Could just take std::optional<TextContext> and combine these.

> Source/WebCore/layout/inlineformatting/InlineRunProvider.h:108
> +    using Runs = Vector<InlineRunProvider::Run>;
> +
> +    const Runs& runs() const { return m_inlineRuns; }

Just using Vector<InlineRunProvider::Run> might be clearer an alias.

> Source/WebCore/layout/layouttree/LayoutInlineBox.cpp:39
> +InlineBox::InlineBox(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags)

BaseTypeFlags stuff should really be using OptionSet these days.
Comment 3 Antti Koivisto 2018-10-19 07:35:23 PDT
r=me, looks nice
Comment 4 zalan 2018-10-19 08:49:32 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 352679 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=352679&action=review
> 
> > Source/WebCore/layout/inlineformatting/InlineRunProvider.h:100
> > +        Run(const InlineItem&, Type);
> > +        Run(const InlineItem&, Type, TextContext);
> 
> Could just take std::optional<TextContext> and combine these.
> 
> > Source/WebCore/layout/inlineformatting/InlineRunProvider.h:108
> > +    using Runs = Vector<InlineRunProvider::Run>;
> > +
> > +    const Runs& runs() const { return m_inlineRuns; }
> 
> Just using Vector<InlineRunProvider::Run> might be clearer an alias.
> 
> > Source/WebCore/layout/layouttree/LayoutInlineBox.cpp:39
> > +InlineBox::InlineBox(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags)
> 
> BaseTypeFlags stuff should really be using OptionSet these days.
Yea, indeed. I'll fix it in a separate patch.

Thanks for the review.
Comment 5 zalan 2018-10-19 08:52:14 PDT
Committed r237286: <https://trac.webkit.org/changeset/237286>
Comment 6 Radar WebKit Bug Importer 2018-10-19 09:12:40 PDT
<rdar://problem/45406706>