This is in preparation for supporting vertical text.
Created attachment 450999 [details] Patch
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].
<rdar://problem/88546530>
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.
(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!
(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
(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.
OK