<?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>226522</bug_id>
          
          <creation_ts>2021-06-01 22:28:59 -0700</creation_ts>
          <short_desc>Layout bug with nested grid inside flex</short_desc>
          <delta_ts>2024-07-15 20:02:59 -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 Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>271843</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tomas Carnecky">tomc</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>chernodubv</cc>
    
    <cc>estea</cc>
    
    <cc>karlcow</cc>
    
    <cc>maggotfish</cc>
    
    <cc>rego</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>svillar</cc>
    
    <cc>tombigel</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit-layout-noreply</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1765877</commentid>
    <comment_count>0</comment_count>
    <who name="Tomas Carnecky">tomc</who>
    <bug_when>2021-06-01 22:28:59 -0700</bug_when>
    <thetext>https://dor1x.csb.app

The image should be aligned to the top left of the viewbox, but is shifted slightly down in Safari 14 / Safari technology preview. Works in Chrome and Firefox..

Curiously, when I highlight the .box element in the devtools, the highlight shows up in the correct location. But the element appears to be actually rendered in a different place.

---

&lt;style&gt;
  img {
    display: block;
    width: 100%;
    flex-grow: 1;
  }

  .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .box {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    max-width: 20rem;
  }
&lt;/style&gt;

&lt;div class=&quot;container&quot;&gt;
  &lt;div class=&quot;box&quot;&gt;
    &lt;img src=&quot;https://media.giphy.com/media/hR6Q01jCXOr31wctJw/giphy.gif&quot; /&gt;
  &lt;/div&gt;
&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768055</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-08 22:29:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/79056985&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1771892</commentid>
    <comment_count>2</comment_count>
    <who name="Eleni Maria Stea">estea</who>
    <bug_when>2021-06-23 04:02:07 -0700</bug_when>
    <thetext>This is not a safari-specific bug, I can reproduce it in GTK port using mini-browser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1771905</commentid>
    <comment_count>3</comment_count>
    <who name="Manuel Rego Casasnovas">rego</who>
    <bug_when>2021-06-23 06:06:59 -0700</bug_when>
    <thetext>This looks like a flexbox or grid layout issue, so not platform specific at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1917165</commentid>
    <comment_count>4</comment_count>
    <who name="Viktor Chernodub">chernodubv</who>
    <bug_when>2022-12-07 01:11:04 -0800</bug_when>
    <thetext>For some reason, the grid container calculates its height based on the page height. So the content is at the center of the page, rather than at the center of the parent container. Here&apos;s a more concise example:

---

&lt;div class=&quot;flex&quot;&gt;
  &lt;div class=&quot;grid&quot;&gt;Content&lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
  .flex {
    display: flex;
    flex-direction: column;
  }

  .grid {
    background: yellow;

    display: grid;
    grid-auto-flow: column;
    justify-content: center;
    align-items: center;
    height: 100%;
  }
&lt;/style&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980142</commentid>
    <comment_count>5</comment_count>
    <who name="Yehonatan Daniv">maggotfish</who>
    <bug_when>2023-09-26 07:04:51 -0700</bug_when>
    <thetext>We have another case that could be related (same?).
See example: https://jsbin.com/henosigusa/1/edit?html,css,output

It&apos;s a structure of: flex &gt; grid &gt; flex.
with a min-height on the outer flex.

------

&lt;div class=&quot;flex min-height&quot;&gt;
  &lt;div class=&quot;grid&quot;&gt;
    &lt;div class=&quot;flex&quot;&gt;
      &lt;div class=&quot;content&quot;&gt;Hello1&lt;/div&gt;
      &lt;div class=&quot;content&quot;&gt;Hello2&lt;/div&gt;
      &lt;div class=&quot;content&quot;&gt;Hello3&lt;/div&gt;
      &lt;div class=&quot;content&quot;&gt;Hello4&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;

.grid {
  display: grid;
}

.flex {
  display: flex;
  flex-direction: column;
}

.flex &gt; * {
  flex-grow: 1;
}

.min-height {
  min-height: 90px;
}

&lt;/style&gt;

------

It appears that the min-height is affecting the content, and if the height of the content can&apos;t be contained inside the container, the min-height is applied to the .content items inside the inner flex.
Seems to be WebKit only.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2046400</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-07-15 19:23:51 -0700</bug_when>
    <thetext>https://jsbin.com/henosigusa/1/edit?html,css,output &lt;- works in Safari Technology Preview 198 while fails in Safari 17.6 Beta.

Same is the case with - https://dor1x.csb.app/.

Marking this as &apos;RESOLVED CONFIGURATION CHANGED&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2046406</commentid>
    <comment_count>7</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-07-15 20:02:59 -0700</bug_when>
    <thetext>progressed at https://commits.webkit.org/276880@main

*** This bug has been marked as a duplicate of bug 271843 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>