WebKit has a redundant frame tree which is not necessarily entirely consistent with the WebCore tree it duplicates. As part of removing it and pushing code down, WebFrame should no longer keep a direct parent pointer and should count on the one from WebCore.
Created attachment 5280 [details] change to do it
Comment on attachment 5280 [details] change to do it Looks good. I think these lines for (i = [_private->children count]-1; i >=0; i--) { [[_private->children objectAtIndex:i] _detachFromParent]; - [_private->children removeObjectAtIndex:i]; } now have braces that don't belong.