<?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>219279</bug_id>
          
          <creation_ts>2020-11-24 14:17:32 -0800</creation_ts>
          <short_desc>Nested flex container incorrectly shrinks to zero or cuts off content</short_desc>
          <delta_ts>2020-11-30 08:22:00 -0800</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jamiec</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>svillar</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1710023</commentid>
    <comment_count>0</comment_count>
    <who name="">jamiec</who>
    <bug_when>2020-11-24 14:17:32 -0800</bug_when>
    <thetext>Only when also set to display: flex, elements in flex containers are allowed to shrink to as little as zero height ignoring their content height. This doesn&apos;t affect Chrome or Firefox: https://jsfiddle.net/4sd2pzuw/

In this test case, the &quot;B&quot; content is reduced to 0 height and is not visible only in Safari. The real difference between A/B/C is only that B has style=&quot;display: flex&quot;, and if this is removed, its content displays without being cut off and C is shifted downward. (The fact that one child element is also a flex container shouldn&apos;t allow it to shrink to zero.)

Setting .content { height: 100px; } for grandchild elements produces the same result: the set content height is ignored for the nested flex container and it&apos;s reduced to as little as zero height.

It looks like issue 146020 may have been intended to fix this general problem but doesn&apos;t in this case. Issue 146020 comment #35 may have included this case but I don&apos;t see it filed. I can&apos;t be sure if any other bugs are reporting the same issue. Not sure which Chromium ticket may have addressed this bug, but this one includes a test case that seems to remain unfixed in Safari: https://bugs.chromium.org/p/chromium/issues/detail?id=596743</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710024</commentid>
    <comment_count>1</comment_count>
    <who name="">jamiec</who>
    <bug_when>2020-11-24 14:19:12 -0800</bug_when>
    <thetext>* bug 146020 comment #34</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710557</commentid>
    <comment_count>2</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2020-11-30 03:11:08 -0800</bug_when>
    <thetext>Thanks for the report. This has been already fixed in trunk. I landed several patches related to nested flexboxes, very likely bug 210089 or bug 215369 (or a combination of the two).

No idea when it will be shipped in Safari, but I&apos;d say that sooner than later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710617</commentid>
    <comment_count>3</comment_count>
    <who name="">jamiec</who>
    <bug_when>2020-11-30 08:22:00 -0800</bug_when>
    <thetext>It seems fixed in Safari Technology Preview release 116. Sorry, did not think to test there.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>