Bug 224044

Summary: Cleanup shouldComputeLogicalWidthFromAspectRatio and shouldComputeLogicalWidthFromAspectRatioAndInsets
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, koivisto, kondapallykalyan, pdr, rbuis, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description zalan 2021-04-01 05:03:13 PDT
turn
if (foo)
  return true;
return false;

into
return !foo;
Comment 1 zalan 2021-04-01 05:08:16 PDT
Created attachment 424886 [details]
Patch
Comment 2 Antti Koivisto 2021-04-01 05:10:22 PDT
Comment on attachment 424886 [details]
Patch

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

> Source/WebCore/rendering/RenderBox.cpp:5130
> +    return style().width().isAuto() && style().height().isAuto() && !style().logicalTop().isAuto() && !style().logicalBottom().isAuto() && (style().logicalLeft().isAuto() || style().logicalRight().isAuto());

I'd probably split this into multiple returns.
Comment 3 zalan 2021-04-01 05:22:57 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 424886 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=424886&action=review
> 
> > Source/WebCore/rendering/RenderBox.cpp:5130
> > +    return style().width().isAuto() && style().height().isAuto() && !style().logicalTop().isAuto() && !style().logicalBottom().isAuto() && (style().logicalLeft().isAuto() || style().logicalRight().isAuto());
> 
> I'd probably split this into multiple returns.
Good idea. I am still trying to understand what this logic is in reference to. will do in a separate patch.
Comment 4 zalan 2021-04-01 07:34:26 PDT
(In reply to zalan from comment #0)
> turn
> if (foo)
>   return true;
> return false;
> 
> into
> return !foo;
should read "return foo;"
Comment 5 EWS 2021-04-01 07:47:57 PDT
Committed r275357: <https://commits.webkit.org/r275357>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424886 [details].
Comment 6 Radar WebKit Bug Importer 2021-04-01 07:48:14 PDT
<rdar://problem/76103365>