[webkit-reviews] review granted: [Bug 186337] [LFC] Add margin computation for floating, replaced elements. : [Attachment 342033] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 6 07:50:20 PDT 2018

Antti Koivisto <koivisto at iki.fi> has granted zalan <zalan at apple.com>'s request
for review:
Bug 186337: [LFC] Add margin computation for floating, replaced elements.

Attachment 342033: Patch


--- Comment #2 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 342033
  --> https://bugs.webkit.org/attachment.cgi?id=342033

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 :

More information about the webkit-reviews mailing list