Closed Bug 427618 Opened 16 years ago Closed 16 years ago

style="position:relative" on <td> is ignored when it contains an <img style="position:relative;">

Categories

(Firefox :: General, defect)

x86
Windows Server 2003
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 35168

People

(Reporter: samuel.w.hills, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13

The attached .zip file contains a pop-up calendar.  When the user clicks on the calendar graphic, the pop-up calendar opens.  Today's date and the selected date are supposed to be highlighted.

This program works OK in IE7; but in FF the individual date img's do not get properly positioned in relation to the calendar body graphic.

If the style="position:relative" attribute is deleted from the <td> which contains the bulk of the img's, the same mispositioning occurs in IE; so apparently FF is ignoring the style="position:relative" attribute of the <td>.

Reproducible: Always

Steps to Reproduce:
1. Unzip the attached file into a directory of your choosing.
2. Open CalendarBug.htm in FF.
3. Click on the calendar graphic.  Note the position of the red outline square (which is supposed to be on today's date) and the grey square (which is supposed to be on the selected date).
4.  Click on any date in the calendar.  Note that the date returned to the form is two weeks (i.e. 2 calendar rows) ahead of the chosen date.
5.  Open CalendarBug in IE.  Observe how it is supposed to appear and function.
Actual Results:  
In FF, offsetLeft and offsetTop for <img id="MonthImg"...> returned 0 and offsetParent returned null, causing the javascript to position the individual day img's with respect to the form, rather than with respect to <img id="MonthImg"...>.

Expected Results:  
offsetLeft, offsetTop and offsetParent for <img id="MonthImg"...> should return the values indicating its true position within the form.
Please note that

- "Table cells may be relatively and absolutely positioned, but this is not recommended: positioning and floating remove a box from the flow, affecting table alignment."
http://www.w3.org/TR/CSS2/tables.html#q7

- "Positioning and floating of table cells can cause them not to be table cells anymore, according to the rules in section 9.7. When floating is used, the rules on anonymous table objects may cause an anonymous cell object to be created as well."
http://www.w3.org/TR/CSS21/tables.html#table-layout

- "The effect of 'position:relative' on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined."
http://www.w3.org/TR/CSS21/visuren.html#choose-position

Resolving as DUPLICATE of bug 35168
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: