<?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>226483</bug_id>
          
          <creation_ts>2021-06-01 02:26:52 -0700</creation_ts>
          <short_desc>position:absolute behaves like position:relative in flexbox with space-between</short_desc>
          <delta_ts>2021-06-08 02:27:20 -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 14</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Aleksei Kuzmichev">lesha</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>svillar</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1765538</commentid>
    <comment_count>0</comment_count>
      <attachid>430242</attachid>
    <who name="Aleksei Kuzmichev">lesha</who>
    <bug_when>2021-06-01 02:26:52 -0700</bug_when>
    <thetext>Created attachment 430242
demo code

Running Safari Version 14.0.3 (16610.4.3.1.7)
https://jsfiddle.net/suda14q3/

I have a flexbox with justify-content:space-between.
One of its descendants (.parent_right) has two children: .ch1 (gold), .ch2 (lime), both 100px wide.

When I resize the webpage down past 500px, I trigger a media query, which sets position:absolute to .ch1. 

Safari doesn&apos;t seem to update .parent_right&apos;s width and it looks like its still takes 200px of space.

If I now reload the webpage, everything will look fine (.parent_right 100px wide because .ch2 is 100px wide and .ch1 is positioned absolute)

I will resize the window back up to 500px+ and another bug occurs: children of .parent_right take up 50px each.

---
Expected behavior: 
When resizing down: .ch1 is moved to the top of .ch2, no space is left to the right of them. .parent_right takes 100px;
When resizing back up: everything returns back to initial state

I&apos;m sorry if this explanation is clumsy, not a native speaker. I can record a video of the bug if needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1767709</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-08 02:27:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/78993605&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>430242</attachid>
            <date>2021-06-01 02:26:52 -0700</date>
            <delta_ts>2021-06-01 02:26:52 -0700</delta_ts>
            <desc>demo code</desc>
            <filename>safari bug.html</filename>
            <type>text/html</type>
            <size>1236</size>
            <attacher name="Aleksei Kuzmichev">lesha</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICA8aGVhZD4KICAgIDxtZXRhIGNoYXJz
ZXQ9IlVURi04IiAvPgogICAgPG1ldGEgaHR0cC1lcXVpdj0iWC1VQS1Db21wYXRpYmxlIiBjb250
ZW50PSJJRT1lZGdlIiAvPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRo
PWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xLjAiIC8+CiAgICA8dGl0bGU+RG9jdW1lbnQ8
L3RpdGxlPgogICAgPHN0eWxlPgogICAgICBib2R5IHsKICAgICAgICBtYXJnaW46IDA7CiAgICAg
IH0KCiAgICAgIGRpdiB7CiAgICAgICAgaGVpZ2h0OiAzMnB4OwogICAgICB9CgogICAgICAubmF2
YmFyIHsKICAgICAgICBiYWNrZ3JvdW5kOiAjMDAwMDAwMjA7CiAgICAgICAgZGlzcGxheTogZmxl
eDsKICAgICAgICBtYXJnaW4tdG9wOiAzMnB4OwogICAgICAgIGp1c3RpZnktY29udGVudDogc3Bh
Y2UtYmV0d2VlbjsKICAgICAgfQogICAgICAubmF2YmFyIC5wYXJlbnRfbGVmdCB7CiAgICAgICAg
d2lkdGg6IDIwMHB4OwogICAgICAgIGZsZXgtc2hyaW5rOiAwOwogICAgICAgIGJhY2tncm91bmQ6
IHJvc3licm93bjsKICAgICAgfQogICAgICAubmF2YmFyIC5wYXJlbnRfcmlnaHQgewogICAgICAg
IHBvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICB9CiAgICAg
IC5uYXZiYXIgLnBhcmVudF9yaWdodCAuY2gyIHsKICAgICAgICB3aWR0aDogMTAwcHg7CiAgICAg
ICAgYmFja2dyb3VuZDogbGltZTsKICAgICAgfQogICAgICAubmF2YmFyIC5wYXJlbnRfcmlnaHQg
LmNoMSB7CiAgICAgICAgd2lkdGg6IDEwMHB4OwogICAgICAgIGJhY2tncm91bmQ6IGdvbGQ7CiAg
ICAgIH0KICAgICAgQG1lZGlhIChtYXgtd2lkdGg6IDUwMHB4KSB7CiAgICAgICAgLm5hdmJhciAu
cGFyZW50X3JpZ2h0IC5jaDEgewogICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAg
ICAgdG9wOiAtMzJweDsKICAgICAgICB9CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgPC9oZWFkPgog
IDxib2R5PgogICAgPGRpdiBjbGFzcz0ibmF2YmFyIj4KICAgICAgPGRpdiBjbGFzcz0icGFyZW50
X2xlZnQiPjwvZGl2PgogICAgICA8ZGl2IGNsYXNzPSJwYXJlbnRfcmlnaHQiPgogICAgICAgIDxk
aXYgY2xhc3M9ImNoMSI+PC9kaXY+CiAgICAgICAgPGRpdiBjbGFzcz0iY2gyIj48L2Rpdj4KICAg
ICAgPC9kaXY+CiAgICA8L2Rpdj4KICA8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>