Bug 213162 - [LFC][Floats] Floating positioned box is always a float avoider.
Summary: [LFC][Floats] Floating positioned box is always a float avoider.
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: 2020-06-12 20:50 PDT by zalan
Modified: 2020-06-13 17:40 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.72 KB, patch)
2020-06-12 21:52 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 2020-06-12 20:50:09 PDT
it avoids other floats.
Comment 1 zalan 2020-06-12 21:52:58 PDT
Created attachment 401825 [details]
Patch
Comment 2 Darin Adler 2020-06-13 14:38:20 PDT
Comment on attachment 401825 [details]
Patch

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

> Source/WebCore/layout/layouttree/LayoutBox.cpp:180
> +    if (isFloatingPositioned() || hasFloatClear())
> +        return true;
> +
> +    return establishesTableFormattingContext() || establishesIndependentFormattingContext() || (establishesBlockFormattingContext() && !establishesInlineFormattingContext());

Would one long chain of conditions separated by || be more logical and readable than a separate if statement? Or are we making a point by using a separate if?
Comment 3 zalan 2020-06-13 15:20:54 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 401825 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=401825&action=review
> 
> > Source/WebCore/layout/layouttree/LayoutBox.cpp:180
> > +    if (isFloatingPositioned() || hasFloatClear())
> > +        return true;
> > +
> > +    return establishesTableFormattingContext() || establishesIndependentFormattingContext() || (establishesBlockFormattingContext() && !establishesInlineFormattingContext());
> 
> Would one long chain of conditions separated by || be more logical and
> readable than a separate if statement? Or are we making a point by using a
> separate if?
Yes, I was trying to make dedicated explicit/implicit groups here (whether the reason for the float avoiding behavior is some float related styles such as clear or some other seemingly unrelated reasons like table element etc.)
Comment 4 EWS 2020-06-13 17:39:16 PDT
Committed r263007: <https://trac.webkit.org/changeset/263007>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401825 [details].
Comment 5 Radar WebKit Bug Importer 2020-06-13 17:40:17 PDT
<rdar://problem/64334402>