<?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>233956</bug_id>
          
          <creation_ts>2021-12-07 16:14:51 -0800</creation_ts>
          <short_desc>WebKit thinks that a formatting context root stops fitting in a tiny space, when you give it a negative margin</short_desc>
          <delta_ts>2022-05-02 12:55:21 -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>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          <see_also>https://bugs.chromium.org/p/chromium/issues/detail?id=1141209</see_also>
    
    <see_also>https://bugzilla.mozilla.org/show_bug.cgi?id=1745310</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>bfulgham</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>1821261</commentid>
    <comment_count>0</comment_count>
      <attachid>446248</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2021-12-07 16:14:51 -0800</bug_when>
    <thetext>Created attachment 446248
testcase 1

STR:
1. Load attached testcase. (also available on jsfiddle: https://jsfiddle.net/dholbert/ujphfkqz/ )

EXPECTED RESULTS:
Case 1 and Case 2 inside of the testcase should look the same.

ACTUAL RESULTS:
In &quot;Case 2&quot;, the &quot;A B&quot; text is pushed down, for no clear reason.

The only difference between Case 1 and Case 2 is: in Case 2, the &quot;A B&quot; element has a *negative margin*. So if anything, it should fit even better; there should be even less reason to push it down.


Chrome has the same bug, tracked in https://bugs.chromium.org/p/chromium/issues/detail?id=1141209 .

Firefox gives EXPECTED RESULTS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1821262</commentid>
    <comment_count>1</comment_count>
      <attachid>446249</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2021-12-07 16:17:16 -0800</bug_when>
    <thetext>Created attachment 446249
testcase 2 (using display:flow-root instead of flex)

Note: testcase 1 used flexbox, but as discussed on the chromium bug report, this isn&apos;t specific to flexbox; you can reproduce it with &apos;display:flow-root&apos; as well, for example.

Here&apos;s a version using &apos;display: flow-root&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1821356</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-12-07 20:29:23 -0800</bug_when>
    <thetext>&lt;rdar://problem/86189973&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822420</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2021-12-09 16:31:35 -0800</bug_when>
    <thetext>For reference, I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1745310 on the Firefox side, as a place to aggregate webcompat issues that we&apos;ve run into as a result of this interop issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1865922</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2022-05-02 12:55:21 -0700</bug_when>
    <thetext>I&apos;ve done some more investigation and I actually think the WebKit/Blink behavior makes some sense here, per https://bugzilla.mozilla.org/show_bug.cgi?id=1745310#c9 .  And the web apparently depends on it (per the various WebCompat dupes over there).

So, we can close this one as INVALID. But while investigating that, I found a WebKit-specific version of this behavior that makes less sense and that I suspect the web does *not* depend on, and I filed that as:
https://bugs.webkit.org/show_bug.cgi?id=239976</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>446248</attachid>
            <date>2021-12-07 16:14:51 -0800</date>
            <delta_ts>2021-12-07 16:14:51 -0800</delta_ts>
            <desc>testcase 1</desc>
            <filename>test-float.html</filename>
            <type>text/html</type>
            <size>893</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KLm91dGVyIHsKICB3aWR0aDogMjAwcHg7CiAgaGVpZ2h0
OiA1MHB4OwogIGJvcmRlcjogMXB4IHNvbGlkIGJsYWNrOwogIG1hcmdpbi1ib3R0b206IDMwcHg7
Cn0KCi5ncmVlZHktZmxvYXQgewogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogNTBweDsKICBmbG9h
dDogbGVmdDsKICBiYWNrZ3JvdW5kOiBwaW5rOwp9CgouZmxleCB7CiAgZGlzcGxheTogZmxleDsK
fQoKLml0ZW0gewogIC8qIFRoaXMgaXNuJ3QgbmVjZXNzYXJ5IHRvIHRyaWdnZXIgdGhlIGJ1ZywK
ICAgKiBidXQgaXQganVzdCBtYWtlcyBpdCBleHRyYS1jbGVhciB0aGF0IHRoZQogICAqIGZsZXgg
Y29udGFpbmVyIGNhbiBmaXQgdG8gdGhlIHJpZ2h0IG9mCiAgICogdGhlIGZsb2F0OiAqLwogIHdp
ZHRoOiAwOwp9CgoubmVnLW1hcmdpbiB7CiAgbWFyZ2luLXJpZ2h0OiAtMTVweDsKfQo8L3N0eWxl
Pgo8Ym9keT4KPGgzPldoZXJlIGRvZXMgdGhlICJBIEIiIHRleHQgZW5kIHVwIGluIHRoZSBjYXNl
cyBiZWxvdz88L2gzPgpDYXNlIDE6CjxkaXYgY2xhc3M9Im91dGVyIj4KICA8ZGl2IGNsYXNzPSJn
cmVlZHktZmxvYXQiPjwvZGl2PgogIDxkaXYgY2xhc3M9ImZsZXgiPgogICAgPGRpdiBjbGFzcz0i
aXRlbSI+CiAgICBBIEIKICAgIDwvZGl2PgogIDwvZGl2Pgo8L2Rpdj4KCkNhc2UgMjogU2FtZSBh
cyBhYm92ZSwgYnV0IG5vdyB3aXRoIGEgbmVnYXRpdmUgbWFyZ2luIG9uIHRoZSAiQSBCIiBjb250
YWluZXI6CjxkaXYgY2xhc3M9Im91dGVyIj4KICA8ZGl2IGNsYXNzPSJncmVlZHktZmxvYXQiPjwv
ZGl2PgogIDxkaXYgY2xhc3M9ImZsZXggbmVnLW1hcmdpbiI+CiAgICA8ZGl2IGNsYXNzPSJpdGVt
Ij4KICAgIEEgQgogICAgPC9kaXY+CiAgPC9kaXY+CjwvZGl2Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>446249</attachid>
            <date>2021-12-07 16:17:16 -0800</date>
            <delta_ts>2021-12-07 16:17:16 -0800</delta_ts>
            <desc>testcase 2 (using display:flow-root instead of flex)</desc>
            <filename>test-with-flow-root.html</filename>
            <type>text/html</type>
            <size>918</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KLm91dGVyIHsKICB3aWR0aDogMjAwcHg7CiAgaGVpZ2h0
OiA1MHB4OwogIGJvcmRlcjogMXB4IHNvbGlkIGJsYWNrOwogIG1hcmdpbi1ib3R0b206IDMwcHg7
Cn0KCi5ncmVlZHktZmxvYXQgewogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogNTBweDsKICBmbG9h
dDogbGVmdDsKICBiYWNrZ3JvdW5kOiBwaW5rOwp9CgouZmxvdy1yb290IHsKICBkaXNwbGF5OiBm
bG93LXJvb3Q7Cn0KCi5pdGVtIHsKICAvKiBUaGlzIGlzbid0IG5lY2Vzc2FyeSB0byB0cm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