Bug 93995 - DOMWindow should obtain the Frame via its Document
Summary: DOMWindow should obtain the Frame via its Document
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adam Barth
: 77537 (view as bug list)
Depends on:
Reported: 2012-08-14 10:25 PDT by WebKit Review Bot
Modified: 2016-01-01 17:10 PST (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description WebKit Review Bot 2012-08-14 10:25:49 PDT
DOMWindow should obtain the Frame via its Document
Requested by abarth on #webkit.
Comment 1 Adam Barth 2012-08-16 15:10:01 PDT
This is worth doing, but I'm removing it from Bug 75793 because this is going to be a bit delicate because some of the DOMWindow functions need to "forward to the outer window" (which is Mozilla parlance for "continue to work in detached DOMWindows).
Comment 2 Adam Barth 2012-08-16 15:16:29 PDT
Ideally, when a Frame navigates to a new Document, we'd like to sever all pointers back from the Document to the Frame so that we don't accidentally give the old Document access to objects that belong to the new Document.

We've been largely successful at zeroing out all the pointers, but one pointer remains:  DOMWindow::m_frame.  The goal of this bug is to zero out that pointer when the Document detaches from the Frame.  More specifically, we'd like to remove that pointer and have DOMWindow find the frame via DOMWinndow->document()->frame(), which is already zeroed out appropriately.

The complication here is that some functions of DOMWindow might still need to work (i.e., access resources associated with the Frame) after the Document becomes detached from the Frame.  In Mozilla, some of the DOMWindow functions are marked as "forwarding to outer Window", and they actually do this indirecting in their bindings layer.  To fix this bug, we need to figure out how to deal with these functions.
Comment 3 Adam Barth 2012-08-16 15:49:39 PDT
*** Bug 77537 has been marked as a duplicate of this bug. ***