(In reply to Kannan Vijayan [:djvj] from comment #2)
@kmag I had a question about this one. You informed me at some point that our BrowsingContext tree are all going to be the same-type up the tree. I didn't know that when I wrote this summary. Does this mean that the root and same-type-root in this instance are definitely always the same, and the conditional here is perfunctory?
Well, there's a lot going on here...
In a BrowsingContext tree, all items will always be the same type. That isn't true for nsIDocShellTreeItem, though. DocShell tree items are also connected to parents of a different type.
However, in a content process, we are only allowed to have content DocShells, and the branch in question is only taken in content processes, which means that in this case they definitely are always going to be the same either way.
- I have no idea why the comment mentions <iframe mozbrowser>, and,
- If we change this to use BrowsingContext and the root tree item is in a different process, there will be no DocShell for it, and no BrowserChild. But the code would probably be less wrong that way than it is currently, where it gets the presentation URL from something other than the same-type root...