This function determines whether a document is a tab document or not. For content documents, it checks for a null parent. For chrome documents, it checks whether the parent of the document is equal to the root of the document.
Only the first case should need fixing. Explained below.
In the former case (content-process), the logic should do the following.
- Check if parent is null, if non-null, then this is not a tab document.
- If the parent is null, then check for an out-of-process parent, and return false if it exists, otherwise true.
In the latter case (chrome process), the logic should work as is, since chrome process contains everything in-process, and should not have any notion of "out of process" parents for the current doc. If this assumption is false, then an appropriate fix is needed for the chrome-process case as well.