Open Bug 356665 Opened 18 years ago Updated 2 years ago

If table element has margin styled, then the offsetLeft, offsetTop, offsetWidth and offsetHeight of this table element will be wrong.

Categories

(Core :: Layout, defect)

defect

Tracking

()

People

(Reporter: topperlu, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 If table element has margin styled, then we got offsetWidth = correct value + margin-left + margin-right, offsetHeight = correct value + margin-top + margin-bottom, offsetLeft = correct value + margin-left, offsetTop = correct value + margin-top. The BoxObject of this table has same problems. Reproducible: Always Steps to Reproduce: 1. Create a TABLE element, with margin styled. 2. Check offsetLeft, offsetWidth, ... 3. Actual Results: offsetWidth = correct value + margin-left + margin-right, offsetHeight = correct value + margin-top + margin-bottom, offsetLeft = correct value + margin-left, offsetTop = correct value + margin-top.
Attached file show bugs
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → 1.8 Branch
Alignment was effected through the following css style: table.alignCenter { margin-left:auto; margin-right:auto; } This method was chosen to pass W3C validation. However the bug is there as well when you use the align=center attribute for the table
If bug 258255 was in the correct component then this would be a duplicate.
This bug causes errors in Firebug inspect for tables with margin. http://code.google.com/p/fbug/issues/detail?id=289
I want to mark this 'firebug wanted' but the UI won't let me. So I am cc beltzner.
Just tested this in FF3.0b4pre and the problem still exists but the offset is different.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Could we get a testcase that reports a binary pass/fail result [instead of just a gob of numbers] for the dimensions being tested? That would help for verifying the bug, and eventual conversion to a mochitest for the test suite.
Whiteboard: [firebug-p1]
Version: 1.8 Branch → Trunk
Whiteboard: [firebug-p1] → [firebug-p3]
Also probably causes: Issue 68: Inspect outline located too much to the left or right of element http://code.google.com/p/fbug/issues/detail?id=68 Issue 123: "position: absolute" on "body" element confuses Firebug http://code.google.com/p/fbug/issues/detail?id=123 Moving up on firebug list.
Whiteboard: [firebug-p3] → [firebug-p2]
I'll try marking the firebug-p2 bugs as wanted for 1.9.2
Flags: wanted1.9.2?
Also happens on OS X. A good testcase can be found with attachment 337022 [details].
Keywords: testcase
OS: Windows XP → All
Hardware: PC → All
John, please use getBoundingClientRect/getClientRects in Firebug instead of the offset* properties.
Ok thanks, I thought that these functions might be good alternatives but I didn't understand the details enough to know for sure. This will encourage me.
Mike Radcliffe took up the challenge and used getBoundingClientRect to slay at least 6 Firebug bugs related to offsets. (In Firebug 1.4a24).
Flags: wanted1.9.2?
Whiteboard: [firebug-p2]
I guess bug 562005 is related to this bug, right?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: