Open Bug 258255 Opened 15 years ago Updated 7 months ago

offsetLeft property of table element wrong when table centered with align="center" or with CSS

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
Windows XP
defect

Tracking

()

People

(Reporter: martin.honnen, Unassigned)

References

Details

(Keywords: helpwanted, Whiteboard: [reflow-refactor])

Attachments

(7 files)

I will upload a test case where Mozilla (tested with Mozilla 1.8a3
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040906)
returns 8 for the offsetLeft property of a table element that is centered on the
page with <table align="center"> and is therefore in a window with a width of
about 800 pixels offset by about 150 pixels. 
As there is no standard for offsetLeft the implementation should follow the IE
implementation and IE shows a value much higher than 8.
Summary: offsetLeft property of table element wrong when align="center" attribute used on table → offsetLeft property of table element wrong when table centered with align="center" or with CSS
the dom probably queries the outer table frame but should ask the inner
We're probably looking at the offset of the table-outer frame, not the inner
frame...  Some testing would need to be done on whether we can always just look
at the inner frame for the table (that is, we need a clear description, with
testcases, of what IE does for tables with offsetLeft).
Keywords: helpwanted, qawanted
Blocks: useragent
The problem is more general; it's related to tables having margin styles set.  Example: <table style="margin-top: 10px; margin-left: 20px"> -- this will make offsetLeft report a 10px smaller value, and offsetTop a 20px smaller value.

The <table>'s align attribute is implemented in terms of CSS using float-s and margin-s. (see res/html.css).

It's kind of annoying so I'm voting for this bug...
*** Bug 319874 has been marked as a duplicate of this bug. ***
Flags: blocking1.9a1?
Flags: blocking1.9a1? → blocking1.9-
Whiteboard: [wanted-1.9]
Whiteboard: [wanted-1.9] → [wanted-1.9][reflow-refactor]
Flags: wanted1.9+
Whiteboard: [wanted-1.9][reflow-refactor] → [reflow-refactor]
Assignee: general → nobody
QA Contact: ian → general
Component: DOM: Mozilla Extensions → DOM
Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0 (20140113030203)
It seems the implementation for this changed. On Nightly, I get offsetLeft: 197 for the first two testcases, while Chrome gives 195 and IE 206.

For the third testcase, Firefox gives offsetLeft 8, 273, 548,
IE 8, 244 and 491,
Chrome 8, 233, 468.

The fourth testcase shows offsetLeft 208 on all three browsers.

All other offsets (non-left) have the same values on all three browsers.

Is this change by design? Is there anything that still needs investigating here?
Keywords: qawanted
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.