[Webkit-unassigned] [Bug 15036] background-image for <tbody> or <thead> is used for each <tr> in that element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 29 08:35:48 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=15036


jberlin at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jberlin at apple.com,
                   |                            |mrowe at apple.com




------- Comment #7 from jberlin at apple.com  2009-06-29 08:35 PDT -------
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& destRect, IntPoint& phase,
IntSize& 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'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()->colElement(col(), &isFirstInColGroup, 0)
// getColumnPos(someColumnIndex)
const_cast<FillLayer*>(bgLayer)->setXPosition(Length(-x() + 555, Fixed));
const_cast<FillLayer*>(bgLayer)->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.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list