Bug Tracker

Modify

Ticket #3551 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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
Blocking: Blocked by:

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

comment:1 Changed 5 years ago by nphase

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!

comment:2 Changed 5 years ago by nphase

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 5 years ago by flesler

  • 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 4 years ago by brandon

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 1.3.3

This is fixed in latest SVN. Please test it out and let me know if it doesn't work for you.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.