Closed Bug 476510 Opened 15 years ago Closed 15 years ago

offsetLeft counts html border-left double

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bugzilla, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)

The most common method to detect an element's position on the page seems to be using IE's offsetLeft properties et al. This works nicely everywhere around, with one notable exception: If the html element has a border-left set, Firefox will count its width double to the offsetLeft value. See the attached test case for details.

The test case works fine for all combinations of padding-left, margin-left and border-left on the HTML element, for IE 7, Opera 9.6 and Firefox 3.0 (except for border-left, which this bug is about).

Reproducible: Always
Attached file Test case
You can replace the border-left style attribute by margin-left and padding-left to see that those work.
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
No, it doesn't seem like it. I see the bug also in Firefox 2.

This seems to have been fixed between 2008-09-07 and 2008-09-08:
http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2008-09-07+04%3A00%3A00&enddate=2008-09-08+09%3A00%3A00
I guess this was fixed by bug 243519.

So I'm marking this bug fixed, since this was fixed by bug 243519 and it doesn't make sense to backport the fix for that bug, since it's too risky and this isn't a regression.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Depends on: 243519
Resolution: --- → FIXED
True, "Shiretoko" Firefox 3.1b3pre nightly of today behaves like any other tested browser, which I assume is the correct behaviour. Thank you.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: