Closed Bug 60935 Opened 24 years ago Closed 23 years ago

Wrong value for offsetLeft and offsetTop when a border is present

Categories

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

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: erik, Assigned: jst)

References

()

Details

(Keywords: dom2)

Attachments

(2 files)

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; COM+ 1.0.2204)
BuildID:    20001120

When taking the offsetLeft (or offsetTop) property of an element the value is 
off by the border width.

Reproducible: Always
Steps to Reproduce:
1. Create an element (any type).
2. Take the offsetLeft (or offsetTop)
3. Notify the value
4. Set a border on the element
5. Take the offsetLeft again

Actual Results:  The second time the offsetLeft is too big by the value of 
borderLeftWidth

Expected Results:  The offsetLeft should give the same value no matter what the 
size of the border

This is actually not DOM2 but there was no other component that matched better.

Padding works fine.

The test case contains 6 divs and if you click them you get the offset*. The 
divs contain some info about the expected values.
http://webfx.eae.net/gecko/offset.html doesn't seem to exist any more, could you
attach the testcase to this bug please? I'm futuring this for now bug if I get a
testcase I might get to this sooner rather than later.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Keywords: dom2
Component: DOM Level 2 → DOM HTML
Erik, could you please retest this bug? The behavior of offset* has changed and
I think it is consistent with IE now.
Both test cases work as expected and gives the same values (when box-sizing is 
set to border-box) as for IE55 (SP2). I think this bug can safely be marked as 
fixed. Good work guys.
Wow, that's one hell of a testcase, worth the acid box ;-)
Thanks Erik for taking care of the testing.
Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: vidur → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: