<?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>136858</bug_id>
          
          <creation_ts>2014-09-16 08:01:00 -0700</creation_ts>
          <short_desc>Backgrounds applied to &lt;td&gt; on nth-child rather than &lt;tr&gt;</short_desc>
          <delta_ts>2022-07-13 17:30:01 -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>CSS</component>
          <version>525.x (Safari 3.2)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>nickdeeleyitg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1035466</commentid>
    <comment_count>0</comment_count>
    <who name="">nickdeeleyitg</who>
    <bug_when>2014-09-16 08:01:00 -0700</bug_when>
    <thetext>Webkit applies backgrounds to &lt;td&gt;&apos;s rather than the &lt;tr&gt;&apos;s in the following code:

tr:nth-child(odd)
{background:#ffffff;}

tr:nth-child(even)
{background: #000000; /* Old browsers */
background: -moz-linear-gradient(left, #000000 0%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#000000), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #000000 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #000000 0%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #000000 0%,#ffffff 100%); /* IE10+ */
background: linear-gradient(to right, #000000 0%,#ffffff 100%); /* W3C */ */}

Have created a jsfiddle here: http://jsfiddle.net/fmcx07f7/3/

Tested in Chrome, Safari and Firefox. Firefox displays it as per the W3C spec, whereas the webkit browsers do not do this.

According to the W3C spec: http://www.w3.org/Style/Examples/007/evenodd.en.html
The &lt;tr&gt;&apos;s should be the one having the background, rather than the child of the &lt;tr&gt;, which in this case is the &lt;td&gt;. I&apos;m using gradients to highlight this, as the problem appears &quot;invisible&quot; using plain colours.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883498</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-13 17:29:51 -0700</bug_when>
    <thetext>This continues to be a problem in Safari 15.5+</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883499</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-13 17:30:01 -0700</bug_when>
    <thetext>&lt;rdar://problem/96983194&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>