Open Bug 492551 Opened 16 years ago Updated 3 years ago

offsetLeft and offsetTop of a position:absolute element is off by the offsetParent's border.

Categories

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

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: aharon, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090512 Minefield/3.6a1pre GTBDFff GTB5 The offsetLeft property of a position:absolute element whose offsetParent has both a left border and a vertical scrollbar is wrong. It is too low by the width of the offsetParent's left border. Similarly, the offsetTop property of a position:absolute element whose offsetParent has both a top border and a horizontal scrollbar is wrong. It is too low by the width of the offsetParent's top border. This occurs in FF2 and FF3 and the current trunk build version (see build identifier). This is similar to, but not identical to Bug 476510, which is fixed in the current trunk build version. Reproducible: Always Steps to Reproduce: Open attached test case. Actual Results: b3.offsetLeft and d3.offsetTop are displayed as -20. Expected Results: b3.offsetLeft and d3.offsetTop should be 0.
Attached file Test case
The bug does not reproduce in IE7, Safari 4 (beta), or Chrome 1.
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
Please note that the bug does not reproduce when the offsetParent is the body, even when it has a border and scrollbars.
More info: you do not need an actual vertical scrollbar in the offsetParent for the bug to reproduce. The offsetParent only needs to have overflow other than the default "visible".
Summary: offsetLeft and offsetTop of a position:absolute element is off by the offsetParent's margin. → offsetLeft and offsetTop of a position:absolute element is off by the offsetParent's border.
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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: