Bug 5306

Summary: KHTMLPart::requestObject doesn't destroy old plugin content
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Vicki Murley <vicki>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase (uses external resource)
none
detach() to destroy old plugin mjs: review+

mitz
Reported 2005-10-09 11:08:17 PDT
Summary: Changes to an OBJECT node's children can trigger a new request for the object content. When this happens, the old child frame with the old plugin view doesn't get destroyed and in fact keeps running. To reproduce: 1) You need the Flash plugin 2) Open Activity Monitor or use 'top' to measure Safari's CPU usage 3) Open the testcase 4) Click the "Click to test" link and wait until "Running..." changes back to the link 5) Repeat step 4 two or three times if Safari's CPU usage does not appear to change Expected: Safari's CPU usage to not change Actual: Safari's CPU usage increases to close to 100% of what's available Analysis: A change to the OBJECT node's children triggers updateWidget on the RenderPartObject, which calls KHTMLPart::requestObject, which does not discard the old child frame (and associated plugin view) but instead just adds a new one. The increase in CPU usage is a result of multiple instances of the plugin running simultaneously. As far as I can see, only one of them is discarded when the Safari window is closed, so I also suspect a memory leak.
Attachments
testcase (uses external resource) (1.16 KB, text/html)
2005-10-09 11:10 PDT, mitz
no flags
detach() to destroy old plugin (952 bytes, patch)
2005-10-10 10:39 PDT, mitz
mjs: review+
mitz
Comment 1 2005-10-09 11:10:21 PDT
Created attachment 4266 [details] testcase (uses external resource)
mitz
Comment 2 2005-10-10 10:39:25 PDT
Created attachment 4291 [details] detach() to destroy old plugin
Maciej Stachowiak
Comment 3 2005-10-14 00:35:03 PDT
Looks good to me. Is there any chance of makng a test case that works without a remote resource and can work as a layout test? I'm guessing no, so I guess it's ok to add the current one as a manual test.
Vicki Murley
Comment 4 2005-10-24 12:00:58 PDT
I'll commit this.
Note You need to log in before you can comment on or make changes to this bug.