Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug causing window.parent to be mis-assigned for nested iframe's.
  • Loading branch information
gleneivey committed Aug 17, 2009
1 parent cb6d649 commit e6a3a37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dist/env.rhino.js
Expand Up @@ -177,7 +177,6 @@ var Envjs = function(){
$env.loadFrame = function(frame, url){
try {

/* this code semi-duplicated in dom/implementation.js -- sorry */
var frameWindow,
makingNewWinFlag = !(frame._content);
if (makingNewWinFlag)
Expand All @@ -194,7 +193,7 @@ var Envjs = function(){
// global/window and won't be able to get at them....
var local__window__ = $env.window,
local_env = $env,
local_window = window;
local_window = frame.ownerDocument.parentWindow;

// a local function gives us something whose scope
// is easy to change
Expand All @@ -213,7 +212,7 @@ var Envjs = function(){
// change scope of window object creation
// functions, so that functions/code they create
// will be scoped to new window object
// *FunctionObjectsScope() from EnvjsRhinoSupraGlobal.java
// getScope()/setScope() from Window.java
var scopes = {
frame : $env.getScope(__frame__),
window : $env.getScope(local__window__),
Expand Down
5 changes: 2 additions & 3 deletions src/platform/core.js
Expand Up @@ -172,7 +172,6 @@ var Envjs = function(){
$env.loadFrame = function(frame, url){
try {

/* this code semi-duplicated in dom/implementation.js -- sorry */
var frameWindow,
makingNewWinFlag = !(frame._content);
if (makingNewWinFlag)
Expand All @@ -189,7 +188,7 @@ var Envjs = function(){
// global/window and won't be able to get at them....
var local__window__ = $env.window,
local_env = $env,
local_window = window;
local_window = frame.ownerDocument.parentWindow;

// a local function gives us something whose scope
// is easy to change
Expand All @@ -208,7 +207,7 @@ var Envjs = function(){
// change scope of window object creation
// functions, so that functions/code they create
// will be scoped to new window object
// *FunctionObjectsScope() from EnvjsRhinoSupraGlobal.java
// getScope()/setScope() from Window.java
var scopes = {
frame : $env.getScope(__frame__),
window : $env.getScope(local__window__),
Expand Down

0 comments on commit e6a3a37

Please sign in to comment.