Bug 255387

Summary: [IFC] InlineLevelBox::LayoutBounds is a glorified AscentAndDescent
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
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch none

Description zalan 2023-04-12 21:15:45 PDT
ssia
Comment 1 zalan 2023-04-12 21:20:41 PDT
Created attachment 465880 [details]
Patch
Comment 2 Antti Koivisto 2023-04-13 06:56:09 PDT
Comment on attachment 465880 [details]
Patch

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

> Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:76
>      struct LayoutBounds {
> -        InlineLayoutUnit height() const { return ascent + descent; }
> -        bool operator==(const LayoutBounds& other) const { return ascent == other.ascent && descent == other.descent; }
> +        LayoutBounds(AscentAndDescent);
> +        LayoutBounds() = default;
>  
> -        InlineLayoutUnit ascent { 0 };
> -        InlineLayoutUnit descent { 0 };
> +        InlineLayoutUnit ascent() const { return m_ascentAndDescent.ascent; }
> +        InlineLayoutUnit descent() const { return m_ascentAndDescent.descent; }
> +
> +        InlineLayoutUnit height() const { return m_ascentAndDescent.height(); }
> +        bool operator==(const LayoutBounds& other) const { return m_ascentAndDescent == other.m_ascentAndDescent; }
> +
> +    private:
> +        AscentAndDescent m_ascentAndDescent;
>      };

Maybe this type can be just replaced with AscentAndDescent directly? Or `using LayoutBounds = AscentAndDescent`?
Comment 3 zalan 2023-04-13 08:58:20 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 465880 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=465880&action=review
> 
> > Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:76
> >      struct LayoutBounds {
> > -        InlineLayoutUnit height() const { return ascent + descent; }
> > -        bool operator==(const LayoutBounds& other) const { return ascent == other.ascent && descent == other.descent; }
> > +        LayoutBounds(AscentAndDescent);
> > +        LayoutBounds() = default;
> >  
> > -        InlineLayoutUnit ascent { 0 };
> > -        InlineLayoutUnit descent { 0 };
> > +        InlineLayoutUnit ascent() const { return m_ascentAndDescent.ascent; }
> > +        InlineLayoutUnit descent() const { return m_ascentAndDescent.descent; }
> > +
> > +        InlineLayoutUnit height() const { return m_ascentAndDescent.height(); }
> > +        bool operator==(const LayoutBounds& other) const { return m_ascentAndDescent == other.m_ascentAndDescent; }
> > +
> > +    private:
> > +        AscentAndDescent m_ascentAndDescent;
> >      };
> 
> Maybe this type can be just replaced with AscentAndDescent directly? Or
> `using LayoutBounds = AscentAndDescent`?
yeah it was going to be one of the next steps, but you are right, there's no need for this intermediate step. will change.
Comment 4 zalan 2023-04-13 09:25:30 PDT
Created attachment 465888 [details]
Patch
Comment 5 zalan 2023-04-13 10:18:53 PDT
Created attachment 465895 [details]
Patch
Comment 6 zalan 2023-04-13 13:40:18 PDT
Created attachment 465897 [details]
Patch
Comment 7 zalan 2023-04-13 18:52:47 PDT
Created attachment 465906 [details]
Patch
Comment 8 EWS 2023-04-13 20:48:08 PDT
Committed 262942@main (a055bb114d45): <https://commits.webkit.org/262942@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 465906 [details].
Comment 9 Radar WebKit Bug Importer 2023-04-13 20:49:16 PDT
<rdar://problem/108030264>