If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.
Created attachment 342033 [details] Patch
Comment on attachment 342033 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=342033&action=review > Source/WebCore/layout/FormattingContext.h:98 > + static WidthAndMargin inlineReplacedWidthAndMargin(LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedMarginLeft = std::nullopt, I think you can do { } instead of std::nullopt if you want to be more compact. > Source/WebCore/layout/FormattingContextGeometry.cpp:557 > LayoutUnit computedMarginRightValue; Maybe this stuff would look nicer as a lambda? auto computedMarginRightValue = computeMarginRight(); You would avoid else branches. > Source/WebCore/layout/FormattingContextGeometry.cpp:572 > + computedMarginRightValue = marginRight.isAuto() ? LayoutUnit { 0 }: valueForLength(marginRight, containingBlockWidth); Missing space before :
Committed r232541: <https://trac.webkit.org/changeset/232541>
<rdar://problem/40853067>