It looks like the remote accessibility element holds strong references to the window object. To remedy, WKView should release those references when the page closes.
<rdar://problem/8868239>
Created attachment 80084 [details] Patch
Attachment 80084 [details] did not build on win: Build output: http://queues.webkit.org/results/7582371
Created attachment 80088 [details] Patch
Attachment 80084 [details] did not build on qt: Build output: http://queues.webkit.org/results/7516293
Comment on attachment 80084 [details] Patch This needs to stub out pageClosed in the other PageClients (win/WebView.h, API/qt/qwkpage_p.h). We may also want to do this when the process crashes.
Attachment 80088 [details] did not build on qt: Build output: http://queues.webkit.org/results/7614333
Comment on attachment 80088 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=80088&action=review Please don’t break the Qt build, otherwise looks good. > Source/WebKit2/UIProcess/API/mac/WKView.mm:1405 > + WKAXInitializeRemoteElementWithWindow(_data->_remoteAccessibilityChild.get(), nil); The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > Source/WebKit2/UIProcess/win/WebView.cpp:631 > +void WebView::pageClosed() > +{ > +} I think you’ll need this for Qt too, in UIProcess/API/qt/qwkpage.cpp.
> The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > file https://bugs.webkit.org/show_bug.cgi?id=53118 to handle the rename
(In reply to comment #9) > > The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > > > > file https://bugs.webkit.org/show_bug.cgi?id=53118 to handle the rename Instead of doing this in close, could we do it in viewDidMoveToWindow when the new window is nil? That way you wouldn't always leak the WKView unless you explicitly call close.
(In reply to comment #10) > (In reply to comment #9) > > > The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > > > > > > > file https://bugs.webkit.org/show_bug.cgi?id=53118 to handle the rename > > Instead of doing this in close, could we do it in viewDidMoveToWindow when the new window is nil? > > That way you wouldn't always leak the WKView unless you explicitly call close. It looks like viewDidMoveToWindow is not called when the window is closed
Created attachment 80110 [details] Patch
Comment on attachment 80110 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=80110&action=review This patch failed to apply because of a merge conflict, so we are not getting EWS results for it. You probably should merge and post a new patch so we can see if it breaks the build or not. > Source/WebKit2/UIProcess/API/mac/WKView.mm:1412 > + [self _setRemoteAccessibilityWindow:nil]; We may want to do this in viewDidMoveToWindow as well, as Anders suggested, even though we can’t do it only there.
Created attachment 80126 [details] Patch
adding patch to see if it builds on qt
http://trac.webkit.org/changeset/76657
Comment on attachment 80126 [details] Patch already reviewed by darin