Bug 9479 - Disassociate the inspector from the frame when it detaches from its parent
Summary: Disassociate the inspector from the frame when it detaches from its parent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-17 01:37 PDT by mitz
Modified: 2006-06-18 10:56 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (6.36 KB, patch)
2006-06-17 01:46 PDT, mitz
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2006-06-17 01:37:07 PDT
[This is a follow-up to bug 8672]
The current way of the Inspector observing NSWindowWillCloseNotification in order to tell when to disassociate from the inspected WebFrame is wrong. Aside from the fact that it doesn't track the WebFrame's WebView's window and hostWindow as they change, a WebFrame can be deallocated while its WebView remains in a window. For example, this crashes Safari (which is why this bug is P1):

1. Open a frameset page.
2. Inspect an element in one of the frames.
3. Navigate to another page in the same tab.
4. Try to select a different node in the inspector.
Comment 1 mitz 2006-06-17 01:46:31 PDT
Created attachment 8877 [details]
Proposed patch
Comment 2 mitz 2006-06-17 01:54:10 PDT
Comment on attachment 8877 [details]
Proposed patch

The same idea can be implemented with generic notifications, which may be cleaner (since WebFrame wouldn't need to know about inspectors).
Comment 3 Geoffrey Garen 2006-06-17 20:43:59 PDT
Notification sure sounds better to me. TimH?
Comment 4 Timothy Hatcher 2006-06-17 21:01:43 PDT
Comment on attachment 8877 [details]
Proposed patch

r=me. A WebFrame might need to know about it's inspectors in the future, so this is fine.
Comment 5 David Kilzer (:ddkilzer) 2006-06-18 10:56:32 PDT
Committed revision 14906.