[webkit-reviews] review granted: [Bug 220582] Handle min-width/min-height:auto for aspect-ratio : [Attachment 419685] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 11 01:14:20 PST 2021


Antti Koivisto <koivisto at iki.fi> has granted  review:
Bug 220582: Handle min-width/min-height:auto for aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=220582

Attachment 419685: Patch

https://bugs.webkit.org/attachment.cgi?id=419685&action=review




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

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

> Source/WebCore/rendering/RenderBox.cpp:665
> +    Length minLength = styleToUse.logicalMinWidth();

could use auto

> Source/WebCore/rendering/RenderBox.cpp:3810
> +    if (widthType == MinSize && logicalWidth.isAuto()) {
> +	   if (shouldComputeLogicalWidthFromAspectRatio()) {
> +	       LayoutUnit minLogicalWidth;
> +	       LayoutUnit maxLogicalWidth;
> +	       computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWidth);
> +	       logicalWidth = Length(minLogicalWidth, Fixed);
> +	   } else
> +	       logicalWidth = Length(0, Fixed);
> +    } else if (widthType == MainOrPreferredSize && logicalWidth.isAuto() &&
shouldComputeLogicalWidthFromAspectRatio())
>	   logicalWidth = Length(computeLogicalWidthFromAspectRatio(), Fixed);
>      else if (logicalWidth.isIntrinsic())
>	   logicalWidth =
Length(computeIntrinsicLogicalWidthUsing(logicalWidth, containerLogicalWidth,
bordersPlusPadding) - bordersPlusPadding, Fixed);

This sort of code can often made read better by using lambdas and early
returns.


More information about the webkit-reviews mailing list