Bug 223377 - [css-flexbox] Make {main|cross}SizeForPercentageResolution() return booleans instead of actual sizes
Summary: [css-flexbox] Make {main|cross}SizeForPercentageResolution() return booleans ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Villar Senin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-17 06:14 PDT by Sergio Villar Senin
Modified: 2021-03-19 02:16 PDT (History)
13 users (show)

See Also:


Attachments
Patch (11.11 KB, patch)
2021-03-17 06:24 PDT, Sergio Villar Senin
no flags Details | Formatted Diff | Diff
Patch (11.13 KB, patch)
2021-03-18 08:51 PDT, Sergio Villar Senin
rego: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2021-03-17 06:14:38 PDT
[css-flex] Make XXXForPercentageResolution() methods return booleans instead of actual sizes
Comment 1 Sergio Villar Senin 2021-03-17 06:24:32 PDT
Created attachment 423479 [details]
Patch
Comment 2 Manuel Rego Casasnovas 2021-03-18 05:33:27 PDT
Comment on attachment 423479 [details]
Patch

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

Nice cleanup, but I have a couple of comments.

> Source/WebCore/rendering/RenderFlexibleBox.cpp:1237
> +bool RenderFlexibleBox::childCrossSizeIsDefiniteForPercentageResolution(const RenderBox& child)

I don't think this name and the next one are accurate.

If a flex item has fixed width and height, its main/cross size is definite, but this might be returning false.
This is checking if we should use or not the OverridingLogicalHeight to compute percentages, but the method name is confusing.

> Source/WebCore/rendering/RenderFlexibleBox.h:73
> +    bool childCrossSizeIsDefiniteForPercentageResolution(const RenderBox&);
> +    bool childMainSizeIsDefiniteForPercentageResolution(const RenderBox&);

Why are you making these 2 methods public?
Comment 3 Sergio Villar Senin 2021-03-18 08:12:11 PDT
Comment on attachment 423479 [details]
Patch

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

>> Source/WebCore/rendering/RenderFlexibleBox.cpp:1237
>> +bool RenderFlexibleBox::childCrossSizeIsDefiniteForPercentageResolution(const RenderBox& child)
> 
> I don't think this name and the next one are accurate.
> 
> If a flex item has fixed width and height, its main/cross size is definite, but this might be returning false.
> This is checking if we should use or not the OverridingLogicalHeight to compute percentages, but the method name is confusing.

Right, I agree I'll rename then.

>> Source/WebCore/rendering/RenderFlexibleBox.h:73
>> +    bool childMainSizeIsDefiniteForPercentageResolution(const RenderBox&);
> 
> Why are you making these 2 methods public?

Ups, I just put them all together but they were away for a reason :)
Comment 4 Sergio Villar Senin 2021-03-18 08:51:46 PDT
Created attachment 423602 [details]
Patch
Comment 5 Manuel Rego Casasnovas 2021-03-18 09:01:54 PDT
Comment on attachment 423602 [details]
Patch

r=me
Comment 6 Sergio Villar Senin 2021-03-19 02:15:07 PDT
Committed r274708 (235528@main): <https://commits.webkit.org/235528@main>
Comment 7 Radar WebKit Bug Importer 2021-03-19 02:16:15 PDT
<rdar://problem/75612783>