Opened 14 years ago
Closed 14 years ago
#3551 closed bug (fixed)
Dimensions functions fail exceptionally on parent-frame scope
Reported by: | nphase | Owned by: | brandon |
---|---|---|---|
Priority: | minor | Milestone: | 1.4 |
Component: | dimensions | Version: | 1.2.6 |
Keywords: | Cc: | nphase, flesler | |
Blocked by: | Blocking: |
Description
Forgive me for adding to your pile of work. I'd suggest my own fix but I'm not quite skilled enough with the codebase to do such.
The Dimensions set of functions do not properly handle the parent scope (frames).
parent.$("#overlay,#alert").hide().fadeIn("slow");
all of that will run perfectly, yet something like
parent.$(window).height()
will fail and throw an exeception "NS_ERROR_XPC_BAD_CONVERT_JS" in FF.
parent.window.innerHeight is verified to work properly.
If you need any help testing or replication, feel free to ask
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Surprisingly, I got this to work when I tried:
window.parent.$().height(); window.parent.$(document).height() does not work (seems like it should) window.parent.$(window).height() does not work (seems like it shouldn't).
Hopefully this will help someone!
(formatting)
comment:3 Changed 14 years ago by
Cc: | flesler added |
---|
I think this is quite expected, here why (I think):
parent.$(window) is calling the jQuery function of the parent window, but passing the window from the frame.
That means... The jQuery object from another window, touching a foreign window.
Maybe this could be indeed patched. That would require to never assume that window is the only window. So replace every foo == window for !!foo.setInterval or something like that.
Still, could fail in many cases. This is not a very common use and I'm not sure it's worthy to patch such a thing.
I will keep this open, assigned to Brandon.
comment:4 Changed 14 years ago by
Milestone: | → 1.3.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
This is fixed in latest SVN. Please test it out and let me know if it doesn't work for you.
Surprisingly, I got this to work when I tried:
window.parent.$().height(); window.parent.$(document).height() does not work (seems like it should) window.parent.$(window).height() does not work (seems like it shouldn't).
Hopefully this will help someone!