Bug 213162

Summary: [LFC][Floats] Floating positioned box is always a float avoider.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, darin, koivisto, 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 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>