<?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>251178</bug_id>
          
          <creation_ts>2023-01-25 15:11:09 -0800</creation_ts>
          <short_desc>Whitespace incorrectly suppressed inside table.</short_desc>
          <delta_ts>2025-11-24 00:20:22 -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>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://wpt.live/css/css-tables/whitespace-001.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Emilio Cobos Álvarez (:emilio)">emilio</reporter>
          <assigned_to name="Karl Dubost">karlcow</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>karlcow</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>1928292</commentid>
    <comment_count>0</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2023-01-25 15:11:09 -0800</bug_when>
    <thetext>In https://bug1811353.bmoattachments.org/attachment.cgi?id=9314059, Blink and WebKit render tables inconsistently from Gecko and the spec.

See also https://github.com/w3c/csswg-drafts/issues/8358 and https://bugs.chromium.org/p/chromium/issues/detail?id=1410345 for context, spec references, and equivalent Chromium bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928351</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-01-25 17:45:09 -0800</bug_when>
    <thetext>would it be https://searchfox.org/wubkat/rev/1c8b29ff201022e3a20578244e85d25d1b7706c4/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp#429-431</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928360</commentid>
    <comment_count>2</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2023-01-25 18:20:26 -0800</bug_when>
    <thetext>Yep that looks exactly like it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1930291</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-02-01 15:12:25 -0800</bug_when>
    <thetext>&lt;rdar://problem/104934417&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1940029</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-09 05:12:47 -0800</bug_when>
    <thetext>(In reply to Karl Dubost from comment #1)
&gt; would it be
&gt; https://searchfox.org/wubkat/rev/1c8b29ff201022e3a20578244e85d25d1b7706c4/
&gt; Source/WebCore/rendering/updating/RenderTreeUpdater.cpp#429-431

I tested locally by removing just &quot;parentRenderer.isTable()&quot; make us pass &quot;WPT&quot; test, if we remove other bits, it makes tables go haywire.

If you want to do PR, you can do so or if you want me to do, I am happy to do it as well. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1940053</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-03-09 07:24:21 -0800</bug_when>
    <thetext>Ahmad, feel free to give it a go.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2125696</commentid>
    <comment_count>6</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-06-24 23:21:02 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/47169</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2160999</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-11-24 00:20:22 -0800</bug_when>
    <thetext>    auto* previousRenderer = renderingParent.previousChildRenderer;
    if (parentRenderer.isRenderTableRow() || parentRenderer.isRenderTableSection() || parentRenderer.isRenderTableCol() || parentRenderer.isRenderFrameSet() || parentRenderer.isRenderGrid() || (parentRenderer.isRenderFlexibleBox() &amp;&amp; !parentRenderer.isRenderButton()))
        return false;
    if (parentRenderer.isRenderTable()) {
        if (!previousRenderer)
            return false;

        // Suppress whitespace after table-internal or block-level elements
        if (previousRenderer-&gt;isRenderTableRow() || previousRenderer-&gt;isRenderTableSection() || previousRenderer-&gt;isRenderTableCol() || previousRenderer-&gt;isRenderTableCaption())
            return false;

        // Preserve whitespace only if previous is inline-block or inline-table
        // (not regular table-cells or blocks)
        if (previousRenderer-&gt;isNonReplacedAtomicInlineLevelBox())
            return true; // Keep the whitespace

        // Otherwise suppress (covers table-cells, blocks, etc.)
        return false;
    }

This takes us to closet to our progress but still fails: https://jsfiddle.net/6Lbjd3qu/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>