Getting position of hidden element generates error in Firefox
|Reported by:||opgobee||Owned by:||paul|
|Keywords:||dimensions and core||Cc:|
I'm a newbie, please correct me if I submit this in the wrong way or wrong place.
I tracked it down, the origin seems twofold:
Dimensions plugin (line 108) calls the property .offsetParent of the hidden element. In FF this returns NULL, in IE the <body> element (FF also returns the <body> element if the element is not hidden).
Next, in the same Dimensions plugin (line 111) the retrieved value is wrapped in a jQuery object and returned. It appears $(null)== jQuery object containing <document>
After a series of intermediate steps the <document> ends up as 'elem' in jquery.js in line 876 : var getComputedStyle = document.defaultView.getComputedStyle( elem, null ); where it generates the error.
I wrote a colour-coded document that I'll try to attach that clarifies all intermediate steps.
Is it by design that $(null)== <document> ?
Finally, is there a resemblance of the behaviour that FF returns NULL as offsetParent on a hidden element with ticket 1779 stating that FF creates an error in a similar line of code with an animation in a hidden I-frame?
I didn't yet further track down in jquery.js why $(null)== <document>, also can't judge where along the line remediation of this combined issue preferably would be applied, but I hope this issue might be remedied. I bumped into this because I have an app. where a connected set of elements of which some can temporarily be hidden, have to be operated on, using position().
Change History (4)
Changed 8 years ago by opgobee
comment:2 Changed 7 years ago by Bosmon
- Resolution invalid deleted
- Status changed from closed to reopened