<?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>221473</bug_id>
          
          <creation_ts>2021-02-05 09:20:17 -0800</creation_ts>
          <short_desc>[css-flexbox] Tables as flex items issues</short_desc>
          <delta_ts>2024-11-18 15:42:46 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          <dependson>224665</dependson>
    
    <dependson>224934</dependson>
    
    <dependson>225343</dependson>
          <blocked>136754</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sergio Villar Senin">svillar</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>changseok</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>felipeerias</cc>
    
    <cc>glenn</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>pdr</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>1726108</commentid>
    <comment_count>0</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2021-02-05 09:20:17 -0800</bug_when>
    <thetext>Several failures in newly imported WPT tests:

imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-3.html
imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-flex-cross-size.html
imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-percent-width-cell-001.html
imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-specified-width.html
imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-stretch-cross-size.html
imported/w3c/web-platform-tests/css/css-flexbox/table-item-flex-percentage-width.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1728588</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-02-12 09:21:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/74278994&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1749658</commentid>
    <comment_count>2</comment_count>
    <who name="Felipe Erias">felipeerias</who>
    <bug_when>2021-04-13 05:27:05 -0700</bug_when>
    <thetext>A few notes about the failing tests:

— table-as-item-fixed-min-width-3

This test creates a flex layout with a table and a div. The table claims to have a min-width of 50px, but after layout it becomes wider as its only cell contains a div with a width of 100px.
  
The flex algorithm uses the min-width of the table to allocate the available space. After layout, the table takes up more space than expected, causing the second flex child to overflow the container.

— table-as-item-flex-cross-size

The flex container (row direction) sets an overriding logical height on its table child (cross axis from the point of view of the container). However, the table does not actually grow because it ignores that overriding value.

— table-as-item-percent-width-cell-001

The table ignores the overriding logical width placed by its flex container and instead takes all the available space and gives it to its first cell (which has width:100%).

Furthermore, the different values of flex-basis (content, min-content, max-content) are ignored, so the outcome is the same in all cases.

— table-as-item-specified-width

The element has flex-basis:100px with flex-grow and flex-shrink both set to 0. This means that its width should stay at 100px and don&apos;t change.

However, RenderTable::updateLogicalWidth() erroneously discards the 100px overriding width set by the flex container and uses the width value from the style instead (500px).

— table-as-item-stretch-cross-size

The flex container (column direction) sets an overriding logical height on its table child (main axis for the container). Like before, the table does not actually grow because it ignores that overriding value.

— table-item-flex-percentage-width

This test creates a series of flex containers with display:table children.

Several of those do not have the expected outcome, mainly because the content&apos;s width (set as a percentage) takes precedence over its flex-basis and does not change as a result of flex-shrink or flex-grow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751024</commentid>
    <comment_count>3</comment_count>
      <attachid>426208</attachid>
    <who name="Felipe Erias">felipeerias</who>
    <bug_when>2021-04-16 04:51:59 -0700</bug_when>
    <thetext>Created attachment 426208
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751027</commentid>
    <comment_count>4</comment_count>
      <attachid>426208</attachid>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2021-04-16 05:04:41 -0700</bug_when>
    <thetext>Comment on attachment 426208
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426208&amp;action=review

Thanks for the patch!

Every patch to WebKit needs a test. If this is covered by WPT tests then you need to remove them from TestExpectations file.

&gt; Source/WebCore/rendering/RenderTable.cpp:513
&gt; +            for (unsigned i = 0; i &lt; m_captions.size(); ++i) {

You can write this like

for (auto&amp; caption : m_captions)

&gt; Source/WebCore/rendering/RenderTable.cpp:517
&gt; +            LayoutUnit contentOverridingLogicalHeight = overridingLogicalHeight() - captionLogicalHeight;

Not sure why you label this as contentOverridingLogicalHeight. overridingLogicalHeight() refers to the border box, meaning that it includes border and padding so if you really want the content height you have to use overridingContentLogicalHeight()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751082</commentid>
    <comment_count>5</comment_count>
      <attachid>426208</attachid>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2021-04-16 08:14:13 -0700</bug_when>
    <thetext>Comment on attachment 426208
Patch

Moved to bug 224665</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075978</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-11-18 15:42:46 -0800</bug_when>
    <thetext>All `table-as-item` are passing on Safari Technology Preview 207 - https://wpt.fyi/results/css/css-flexbox?label=master&amp;label=experimental&amp;aligned&amp;q=css-flexbox%2Ftable-as-item

and this is also passing `table-item-flex-percentage-width.html` - https://wpt.fyi/results/css/css-flexbox/table-item-flex-percentage-width.html?label=master&amp;label=experimental&amp;aligned&amp;q=%2Ftable-item-flex-percentage-width.html</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>426208</attachid>
            <date>2021-04-16 04:51:59 -0700</date>
            <delta_ts>2021-04-16 08:14:13 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-221473-20210416205158.patch</filename>
            <type>text/plain</type>
            <size>2242</size>
            <attacher name="Felipe Erias">felipeerias</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjc1ODQ1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZmFlMzFjZDRjZTE1ODVh
ZjYxNTBmYzM0MzM2ZTEzZWZhMzZkMTEzOS4uMzllMjhhY2I5Yjc1MWE1OWJiMzFmYTUzYmY0OWMx
ZTdlYTZhYzc1OCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDIxLTA0LTE2ICBGZWxp
cGUgRXJpYXMgIDxmZWxpcGVlcmlhc0BpZ2FsaWEuY29tPgorCisgICAgICAgIFRhYmxlIGxheW91
dCB0YWtlcyBvdmVycmlkaW5nIGhlaWdodCBpbnRvIGFjY291bnQKKyAgICAgICAgaHR0cHM6Ly9i
dWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIyMTQ3MworCisgICAgICAgIFJldmlld2Vk
IGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIF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TWF4SGVpZ2h0TGVuZ3RoLmlz
TmVnYXRpdmUoKSkpIHsKICAgICAgICAgICAgIExheW91dFVuaXQgY29tcHV0ZWRNYXhMb2dpY2Fs
SGVpZ2h0ID0gY29udmVydFN0eWxlTG9naWNhbEhlaWdodFRvQ29tcHV0ZWRIZWlnaHQobG9naWNh
bE1heEhlaWdodExlbmd0aCk7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>