<?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>15036</bug_id>
          
          <creation_ts>2007-08-21 07:07:26 -0700</creation_ts>
          <short_desc>background-image for &lt;tbody&gt; or &lt;thead&gt; is used for each &lt;tr&gt; in that element</short_desc>
          <delta_ts>2010-03-26 18:58:13 -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>Tables</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>9268</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="mupo">mupo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dbates</cc>
    
    <cc>jasper</cc>
    
    <cc>jberlin</cc>
    
    <cc>mrowe</cc>
    
    <cc>t.bussmann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1806</commentid>
    <comment_count>0</comment_count>
    <who name="mupo">mupo</who>
    <bug_when>2007-08-21 07:07:26 -0700</bug_when>
    <thetext>Using an background-image for &lt;tbody&gt; or &lt;thead&gt; is used for each &lt;tr&gt; in that element.
Happens also in Safari 2.0.4 (419.3) on Mac OS X (10.4.10) and actual nightly build on Windows (r25168).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1789</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-08-21 09:30:31 -0700</bug_when>
    <thetext>Thanks for the bug report!  Could you attach an example of this bug to this report, or provide a URL where this occurs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1751</commentid>
    <comment_count>2</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2007-08-21 17:36:40 -0700</bug_when>
    <thetext>This is identical to WinIE&apos;s behavior I believe.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70220</commentid>
    <comment_count>3</comment_count>
    <who name="Rene Trost">r.trost</who>
    <bug_when>2008-02-11 02:37:23 -0800</bug_when>
    <thetext>I can confirm this bug with OSX 10.4.11 - Safari 3.0.4 (523.12.2).

Example is available here: http://www.syncbyte.com/tbody_bg.html
The background image is only set to TBODY (even with no-repeat) but gets repeated in every TR

WinIE 7 repeats the background in every TR too.
FF 2.x shows it correctly and doesn&apos;t repeat the background image in every TR.


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94423</commentid>
    <comment_count>4</comment_count>
    <who name="Jasper Bryant-Greene">jasper</who>
    <bug_when>2008-10-07 13:21:40 -0700</bug_when>
    <thetext>I can confirm this bug on Safari 3.1.2 and on the latest WebKit nightly on Mac OS X 10.5.5.

background-image is inherited when it should not be; I have tested and confirmed inheritance from &lt;tbody&gt;/&lt;thead&gt; to &lt;tr&gt; as described in this bug and also from &lt;tr&gt; to &lt;td&gt; (which was the problem that lead me to search for this bug).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94430</commentid>
    <comment_count>5</comment_count>
    <who name="Jasper Bryant-Greene">jasper</who>
    <bug_when>2008-10-07 13:33:38 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; The background image is only set to TBODY (even with no-repeat) but gets
&gt; repeated in every TR

FYI no-repeat refers to repetition /within the element/ if the image is smaller than the element. It&apos;s nothing to do with inheritance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128630</commentid>
    <comment_count>6</comment_count>
      <attachid>31970</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2009-06-26 19:08:30 -0700</bug_when>
    <thetext>Created attachment 31970
Test case

Here&apos;s a test case that&apos;s a little easier on the eyes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128814</commentid>
    <comment_count>7</comment_count>
    <who name="Jessie Berlin">jberlin</who>
    <bug_when>2009-06-29 08:35:47 -0700</bug_when>
    <thetext>Mark and I took a look at this on Friday night, and it appears that the reason this is happening is that in the call to:

void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* bgLayer, int tx, int ty, int w, int h, IntRect&amp; destRect, IntPoint&amp; phase, IntSize&amp; tileSize)

the phase, which is then used to determine the offset into the background image in RenderBoxModelObject::paintFillLayerExtended, is getting set to the top left corner of the image on each cell paint.

This is because the x and y positions of the bgLayer are initialized in to the top left corner of the image and never changed between cell paints, and they are used calculate the phase.

Since paintFillLayerExtended is used in so many other places, it would probably be best to modify the xPosition and yPosition of the bgLayer in RenderTableCell::paintBackgroundsBehindCell on a per cell basis, based on what colgroup and section that cell belongs to.

We found that modifying the x and y positions of the bgLayer in RenderTableCell::paintBackgroundsBehindCell right before the call to paintFillLayers could make it exhibit the correct behavior (the numbers 555 and 979 were the hard coded width and height of the image used in the test case attached to this bug):

if (backgroundObject != this) {
// If we&apos;re in a column group, we need to the x offset to be
// relative to the left of the column group.
// We can do this by walking backwards through the columns until
// we hit one that is the start of a column group.
// table()-&gt;colElement(col(), &amp;isFirstInColGroup, 0)
// getColumnPos(someColumnIndex)
const_cast&lt;FillLayer*&gt;(bgLayer)-&gt;setXPosition(Length(-x() + 555, Fixed));
const_cast&lt;FillLayer*&gt;(bgLayer)-&gt;setYPosition(Length(-y() + 979, Fixed));
}
paintFillLayers(paintInfo, c, bgLayer, my, mh, tx, ty, w, h);

some logic will be needed, as described in the comment, to determine correctly based on the column group what offset into  the image the phase should start at.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204908</commentid>
    <comment_count>8</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-03-26 18:58:13 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 9268 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>31970</attachid>
            <date>2009-06-26 19:08:30 -0700</date>
            <delta_ts>2009-06-26 19:08:30 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>386</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">PHN0eWxlIHR5cGU9InRleHQvY3NzIj4KICAgIHRhYmxlIHsgd2lkdGg6IDUwJTsgYm9yZGVyLWNv
bGxhcHNlOiBjb2xsYXBzZTsgfQogICAgdGhlYWQgeyBiYWNrZ3JvdW5kOiB1cmwoaHR0cDovL2Jk
YXNoLm5ldC5uei9pbWFnZXMvbW91bnRhaW4tYmFja2dyb3VuZC5qcGcpOyB9CiAgICB0ciB7IGhl
aWdodDogNWVtOyB9Cjwvc3R5bGU+Cgo8dGFibGU+CiAgICA8dGhlYWQ+CiAgICAgICAgPHRyPgog
ICAgICAgICAgICA8dGQ+QTE8L3RkPgogICAgICAgICAgICA8dGQ+QTI8L3RkPgogICAgICAgIDwv
dHI+CiAgICAgICAgPHRyPgogICAgICAgICAgICA8dGQ+QjE8L3RkPgogICAgICAgICAgICA8dGQ+
QjI8L3RkPgogICAgICAgIDwvdHI+CiAgICA8L3RoZWFkPgo8L3RhYmxlPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>