Opened 7 years ago

Closed 4 years ago

#15255 closed defect (patchwelcome)

dojo/request/iframe issues with dojo/_base/win change of context

Reported by: bill Owned by: Bryan Forbes
Priority: undecided Milestone: 1.13
Component: IO Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

iframe.js has references to win.global, win.doc, and win.body(). Those values can change over the lifetime of a page due to win.setContext(), win.withGlobal() or win.withDoc() calls. Probably, that will cause problems with the iframe code. Likely, you want to just access window, document, and win.body(document).

To illustrate the problem, consider that when iframe.js is loaded, it does:

win.global[onload] = ...

It's accessing win.global, which will presumably point to "window" because no one has called win.setContext(), nor is the module factory executing within the callback to a win.withGlobal() or win.withDoc().

However, later on create() may be called when win.global is pointing somewhere else.

The dom.byId(options.form) calls are also worrisome. They will do a lookup of the id in the document currently pointed to by win.doc, which could be different than the value of win.doc when the request was issued. Perhaps you want dom.byId(options.form, document) to force it to the global top level document?

PS: seems like the old iframe.js also had this problem, but let's not worry about that since it's now deprecated code

Change History (1)

comment:1 Changed 4 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given the lack of interest and progress on this over the past 4 years, closing as patchwelcome.

Note: See TracTickets for help on using tickets.