Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10950 closed bug (invalid)

dynamic Iframe $.support

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

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 (3)

comment:1 Changed 7 years 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 7 years ago by timmywil

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

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 7 years 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.

Note: See TracTickets for help on using tickets.