Bug 224044 - Cleanup shouldComputeLogicalWidthFromAspectRatio and shouldComputeLogicalWidthFromAspectRatioAndInsets
Summary: Cleanup shouldComputeLogicalWidthFromAspectRatio and shouldComputeLogicalWidt...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-01 05:03 PDT by zalan
Modified: 2021-04-01 08:36 PDT (History)
12 users (show)

See Also:


Attachments
Patch (2.69 KB, patch)
2021-04-01 05:08 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>