<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>239976</bug_id>
          
          <creation_ts>2022-05-02 12:03:37 -0700</creation_ts>
          <short_desc>WebKit pushes down auto-width BFC alongside float, if the BFC has any negative margin at all</short_desc>
          <delta_ts>2024-05-23 16:53:37 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=240128</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=274627</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Holbert">dholbert</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>karl+webkit</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1865906</commentid>
    <comment_count>0</comment_count>
      <attachid>458698</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2022-05-02 12:03:37 -0700</bug_when>
    <thetext>Created attachment 458698
testcase 1

STR:
1. Load attached testcase.

EXPECTED RESULTS:
The three sections should all have the same layout.

ACTUAL RESULTS:
In the lower two sections (the ones with a small negative margin), the aqua BFC gets pushed (i.e. cleared/wrapped) down below the fuchsia float.

Firefox and Chrome (Gecko/Blink) give EXPECTED RESULTS.
Safari (WebKit) gives ACTUAL RESULTS.


Note that there&apos;s a lot of subtlety and spec ambiguity in this area.  I do think it makes sense for sufficiently-large negative margins to cause content to wrap -- specifically if those margins are negative enough to &quot;prop up&quot; the border-box to be larger than the available space.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1745310#c9 for more thoughts on this.  (I&apos;m implementing this behavior in Gecko over there.)

In this particular attached testcase, though, with -5px margins (or even -1px margins), WebKit wraps even though there&apos;s no reason to do so that I can see.  And WebKit is alone in this behavior, so I&apos;m tentatively filing this as a WebKit bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867719</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-05-09 12:04:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/92978014&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909669</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-11-01 16:53:52 -0700</bug_when>
    <thetext>@Alan - do you think this will help in above case?

https://github.com/WebKit/WebKit/commit/c80dcb41f40298f9d1251e3773cda13fe5f3c910

I think it will resolve this negative margin case and we should just mark it close but I am happy to wait till it ships in Safari Technology Preview and test it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909832</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2022-11-02 12:41:49 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #2)
&gt; @Alan - do you think this will help in above case?
&gt; 
&gt; https://github.com/WebKit/WebKit/commit/
&gt; c80dcb41f40298f9d1251e3773cda13fe5f3c910
&gt; 
&gt; I think it will resolve this negative margin case and we should just mark it
&gt; close but I am happy to wait till it ships in Safari Technology Preview and
&gt; test it.
It still looks broken after 256132@main.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>458698</attachid>
            <date>2022-05-02 12:03:37 -0700</date>
            <delta_ts>2022-05-02 12:03:37 -0700</delta_ts>
            <desc>testcase 1</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>719</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KLmNvbnRhaW5lciB7CiAgd2lkdGg6IDQwMHB4OwogIGhl
aWdodDogNDBweDsKICBib3JkZXI6IDFweCBzb2xpZCBncmF5Owp9CgouZmxvYXQgewogIGZsb2F0
OiBsZWZ0OwogIHdpZHRoOiA1MHB4OwogIGhlaWdodDogOHB4OwogIGJhY2tncm91bmQ6IGZ1Y2hz
aWEgbm9uZSByZXBlYXQgc2Nyb2xsIDAlIDAlOwogIGJvcmRlcjogMXB4IHNvbGlkIHB1cnBsZTsK
fQoKLmJmYyB7CiAgZGlzcGxheTogZmxvdy1yb290OwogIGJhY2tncm91bmQ6IGFxdWEgbm9uZSBy
ZXBlYXQgc2Nyb2xsIDAlIDAlOwogIGJvcmRlcjogMXB4IHNvbGlkIGJsdWU7Cn0KPC9zdHlsZT4K
PGRpdiBjbGFzcz0iY29udGFpbmVyIj4KICA8ZGl2IGNsYXNzPSJmbG9hdCI+PC9kaXY+CiAgPGRp
diBjbGFzcz0iYmZjIiBzdHlsZT0ibWFyZ2luLWxlZnQ6IDBweDsiPm5vIG1hcmdpbnM8L2Rpdj4K
PC9kaXY+CjxkaXYgY2xhc3M9ImNvbnRhaW5lciI+CiAgPGRpdiBjbGFzcz0iZmxvYXQiPjwvZGl2
PgogIDxkaXYgY2xhc3M9ImJmYyIgc3R5bGU9Im1hcmdpbi1sZWZ0Oi01cHg7Ij5tYXJnaW4tbGVm
dDotNXB4PC9kaXY+CjwvZGl2Pgo8ZGl2IGNsYXNzPSJjb250YWluZXIiPgogIDxkaXYgY2xhc3M9
ImZsb2F0Ij48L2Rpdj4KICA8ZGl2IGNsYXNzPSJiZmMiIHN0eWxlPSJtYXJnaW4tcmlnaHQ6LTVw
eDsiPm1hcmdpbi1yaWdodDotNXB4PC9kaXY+CjwvZGl2Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>