RESOLVED FIXED 236183
[LFC][IFC] Introduce LineBoxBuilder::setBaselineAndLayoutBounds/layoutBoundsMetricsForInlineBox
https://bugs.webkit.org/show_bug.cgi?id=236183
Summary [LFC][IFC] Introduce LineBoxBuilder::setBaselineAndLayoutBounds/layoutBoundsM...
zalan
Reported 2022-02-05 13:43:43 PST
This is in preparation for supporting vertical text.
Attachments
Patch (11.91 KB, patch)
2022-02-05 13:50 PST, zalan
no flags
zalan
Comment 1 2022-02-05 13:50:55 PST
EWS
Comment 2 2022-02-06 11:01:22 PST
Committed r289171 (246867@main): <https://commits.webkit.org/246867@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450999 [details].
Radar WebKit Bug Importer
Comment 3 2022-02-06 11:02:17 PST
Darin Adler
Comment 4 2022-02-06 11:41:17 PST
Comment on attachment 450999 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450999&action=review > Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:156 > + std::optional<InlineLayoutUnit> preferredLineHeight { }; Don’t need { } with std:.optional. It’s only scalars that are uninitialized (or classes and structures where we didn’t initialize the scalars in them for some reason). If InlineLayoutUnit was a class we wouldn’t need the { 0 } above either, but I guess it is and we do.
zalan
Comment 5 2022-02-06 12:24:07 PST
(In reply to Darin Adler from comment #4) > Comment on attachment 450999 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=450999&action=review > > > Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:156 > > + std::optional<InlineLayoutUnit> preferredLineHeight { }; > > Don’t need { } with std:.optional. It’s only scalars that are uninitialized > (or classes and structures where we didn’t initialize the scalars in them > for some reason). If InlineLayoutUnit was a class we wouldn’t need the { 0 } > above either, but I guess it is and we do. Good point, thanks!
zalan
Comment 6 2022-02-06 21:07:51 PST
(In reply to Darin Adler from comment #4) > Comment on attachment 450999 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=450999&action=review > > > Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:156 > > + std::optional<InlineLayoutUnit> preferredLineHeight { }; > > Don’t need { } with std:.optional. It’s only scalars that are uninitialized > (or classes and structures where we didn’t initialize the scalars in them > for some reason). If InlineLayoutUnit was a class we wouldn’t need the { 0 } > above either, but I guess it is and we do. https://trac.webkit.org/changeset/289198/webkit
zalan
Comment 7 2022-02-07 14:14:58 PST
(In reply to Darin Adler from comment #4) > Comment on attachment 450999 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=450999&action=review > > > Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:156 > > + std::optional<InlineLayoutUnit> preferredLineHeight { }; > > Don’t need { } with std:.optional. It’s only scalars that are uninitialized > (or classes and structures where we didn’t initialize the scalars in them > for some reason). If InlineLayoutUnit was a class we wouldn’t need the { 0 } > above either, but I guess it is and we do. I remember now. This is why I do it. ./layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:268:97: error: missing field 'preferredLineHeight' initializer [-Werror,-Wmissing-field-initializers] when calling inlineLevelBox.setLayoutBounds({ layoutBoundsMetrics.ascent, layoutBoundsMetrics.descent }); vs. inlineLevelBox.setLayoutBounds({ layoutBoundsMetrics.ascent, layoutBoundsMetrics.descent, { }, { } }); maybe I should just get out of the habit of relying on them.
Darin Adler
Comment 8 2022-02-07 14:32:17 PST
OK
Note You need to log in before you can comment on or make changes to this bug.