Bug Tracker

Modify

Ticket #10950 (closed bug: invalid)

Opened 18 months ago

Last modified 18 months ago

dynamic Iframe $.support

Reported by: hafkensite@… Owned by:
Priority: low Milestone: None
Component: support Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

I use jQuery to create an iframe, and with a "javascript:parent.init(document,window)" url get a reference to the document and window instances of the iframe. These are stored as iDocument and iWindow.

When I create elements for the iframe (from the outer frame), I use $("<div>",iDocument). This works as expected.

I have need to know if the iframe uses boxModel, so I want to use $.support.boxModel (the iframe may have a different doctype than the parent). Sadly this does not work on the iframe. This is because the support values are computed when jQuery is instantiated.

This would indicate that any method that uses support values to determine its working might fail because of different doctype or encoding in the other document.

Change History

comment:1 Changed 18 months ago by hafkensite@…

An example of the code can be found here:  http://jsfiddle.net/S9qya/15/

It seems that the different rendering modes provided by the Internet Explorer developer bar (IE9), do not work as expected. Because the two iframes always have the same boxmodel.

They do however change depending on the rendeing mode, while the support.boxModel value always is true.

With other IE versions this changes, but the problem remains.

comment:2 Changed 18 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to support

In order to run the support tests for the iframe, jQuery must be loaded in the iframe. The support tests only test the current document, which is intentional.

comment:3 Changed 18 months ago by anonymous

What is the expected behavior if elements are created/accessed within a different context?

There is support for this, but I don't see how this would work correctly without running the support tests in the new context.

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.