offsetLeft, offsetTop, offsetWidth, offsetHeight returns 0

RESOLVED WORKSFORME

Status

()

Core
DOM: CSS Object Model
P3
normal
RESOLVED WORKSFORME
18 years ago
4 years ago

People

(Reporter: sicking, Assigned: jst)

Tracking

({testcase})

Trunk
Other
Other
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

On build 2000-04-17-08 on Win98SE:

The offsetLeft, offsetTop, offsetWidth and offsetHeight properties always 
returns 0. OffsetParent works fine
Created attachment 7673 [details]
onLoad displays the offsetLeft, Top, Width, Height a <span> containing the text. IE reports 10, 15, 32, 19 which should be in the ballpark
adding testcase keyword
Keywords: testcase
Created attachment 7678 [details]
Bugfixed testcase. M14 reports 75,19,68,19

Comment 4

18 years ago
I really hope that these properties are not broken in the M15 build since they 
just got put in in the M14 build and it's been a long time coming.
(Assignee)

Comment 5

18 years ago
This was fixed yesterday, not sure if we return the correct numbers but we do
return the computed values. Marking FIXED, please open separate bug it the
nubers are incorrect.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Works fine so I'm marking verified
Status: RESOLVED → VERIFIED
Component: DOM Level 2 → DOM Style

Comment 7

17 years ago
TESTED ON 28/08/01 ON WINDOWS 2000 PROFESSIONNAL BUG NOT FIXED
userAgent:Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2)
Gecko/20010726 Netscape6/6.1 
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 8

17 years ago
Mathieu René, please explain, this still works for me on Win2k.

Comment 9

16 years ago
Created attachment 48881 [details]
broken offsetHeight in particular case...

Comment 10

16 years ago
Hi,

I found offsetHeight to return 0 in particular case. I just added  an
attachement with an example. In the example, the strange thing is that if you
remove the align=left attribute from the table tag, the offsetHeight will return
a good value.

I tested using Win2000 and Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
rv:0.9.3) Gecko/20010801.

Francois: your tescase is invalid since adding that align="left" floats the
table.  As a result the div actually does have size 0 (add a border to the div
to see this).

Sicking's testcases workforme.  I'm resolving this worksforme.  If you find that
it does not work for you, please reopen and _attach_a_testcase_.
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago16 years ago
Resolution: --- → WORKSFORME

Comment 12

4 years ago
offsetTop is back to returning 0's.
http://jesusnjim.com/test/css-flex.html
test case trying to get the absolute top of an element using getAbsoluteTop() a function I defined.
Jim, if you think there s a specific issue with flexbox, please file a new bug with a minimal-ish testcase.
You need to log in before you can comment on or make changes to this bug.