<?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>195968</bug_id>
          
          <creation_ts>2019-03-19 15:33:12 -0700</creation_ts>
          <short_desc>border collapsing: subpixels can make table-cell with smaller border width &quot;win&quot; over table with larger width</short_desc>
          <delta_ts>2023-05-04 08:19:32 -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>macOS 10.13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>FromImplementor, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Grogan">dgrogan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</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>1518575</commentid>
    <comment_count>0</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2019-03-19 15:33:12 -0700</bug_when>
    <thetext>http://w3c-test.org/css/css-tables/subpixel-collapsed-borders-003.html passes in hi-dpi but fails in low-dpi. Its essence is:

&lt;table style=&quot;border-collapse: collapsed; border-width:5.95px&quot;&gt;
&lt;td style=&quot;border-width:5px&quot;&gt;&lt;/td&gt;
&lt;/table&gt;

In the collapsed border resolution algorithm, Safari (and Firefox) presumably use border widths after they&apos;ve been rounded to device pixels. In the test above, the table&apos;s 5.95px border should beat the cell&apos;s 5px border.

But rounding causes 5.95px to round down to 5px on a 1x ratio device. So the table and cell have the same widths. When the widths are the same, the cell beats the table. On a 2x device, 5.95px is rounded to 5.5px, making the table beat the cell.

The pre-rounded width should be used in the algorithm so that colors don&apos;t change based on the user&apos;s device pixel ratio.

(I filed an identical Firefox bug at https://bugzilla.mozilla.org/show_bug.cgi?id=1536646)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1520145</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-21 20:39:35 -0700</bug_when>
    <thetext>&lt;rdar://problem/49137686&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1952467</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-02 13:06:56 -0700</bug_when>
    <thetext>This testcase is on WPT and we are passing it on STP168 - https://wpt.fyi/results/css/css-tables/subpixel-collapsed-borders-003.html?label=experimental&amp;label=master&amp;aligned

@Alan - this is about low-dpi, do we need to track it with more granular reproduced test case or anything else?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1952898</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-05-04 08:19:32 -0700</bug_when>
    <thetext>.95 is normally ceiled to 1 on both 1x and 2x screens. Maybe there&apos;s something more to this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>