Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9555 closed bug (fixed)

jQuery.support fails in iframe

Reported by: Krinkle Owned by:
Priority: low Milestone: 1.next
Component: support Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


The test suite for jQuery.support has been failing for a looong time in the TestSwarm. From my rough estimates I think my jquery-swarm vm spends over 30% of the time re-testing jQuery.support).

Not a single browser that is in the swarm returns something at all for that module. (they all time-out or throw exceptions). This can be seen here: http://swarm.jquery.org/job/1238/

It fails everywhere.

However when running it standalone, such as from here: http://swarm.jquery.org/git/jquery/39c6c85/test/index.html?filter=support ... then it works fine.

Steps to reproduce

  • Go to a random page with jQuery on it (say, the last url linked above)
  • Open up the console and execute:
    jQuery('body').html( '<iframe src="http://swarm.jquery.org/git/jquery/39c6c85/test/index.html?filter=support" width="100%" height="100%">' );
  • Result:
    TypeError: Result of expression 'window.top.supportCallback' [undefined] is not a function.

Change History (10)

comment:1 Changed 12 years ago by timmywil

Component: unfiledmisc
Priority: undecidedlow
Resolution: invalid
Status: newclosed

I'm not sure what's going on there, but it doesn't seem like a jQuery core problem.

comment:2 Changed 12 years ago by Krinkle

QUnit tests are part of jQuery's core repository. A failing test means either the test needs fixing or the unit being tested does.

I think the unit being tested is failing. Try preforming the jQuery actions in support from within an iframe. It's incorrectly accessing windows, assuming the rootjQuery is in the top window.

comment:3 Changed 12 years ago by [email protected]

I can confirm this problem. It makes it impossible to run the JQuery tests in TestSwarm. Why is this marked as invalid?

comment:4 Changed 12 years ago by timmywil

Component: miscsupport
Resolution: invalid
Status: closedreopened

comment:5 Changed 12 years ago by timmywil

Status: reopenedopen

Now confirmed with test case

comment:6 Changed 12 years ago by timmywil

This above link runs your local jQuery test suite, adjust the address as needed.

comment:7 Changed 12 years ago by Krinkle

Not sure jsFiddle allows echo/html through GET (I couldn't get it to work).

Here's a test case off jsFiddle: http://toolserver.org/~krinkle/tmp/jqbug-9555-frame/

Steps to reproduce:

  • check out fresh github-jquery-jquery-master
  • include github-jquery-qunit as well in /test/qunit
  • Create a new .html page only containing an iframe pointing to jquery/test/index.html?filter=support

comment:8 Changed 12 years ago by Rick Waldron

Confirmed. "Uncaught TypeError: Object [object DOMWindow] has no method 'supportCallback'"

comment:10 Changed 12 years ago by Krinkle

Resolution: fixed
Status: openclosed

Landing pull request 433. Fix testswarm test cases. Fixes #9555.

More Details:

Note: See TracTickets for help on using tickets.