The recent change to included #document under <frame> and <iframe> is clutter IMHO. Why expose the frame documents in the tree when we have never exposed the main document? It introduces yet another level of nesting. The only benefit I see to including the documents is for event listener and prototype inspection in the sidebar. But then why no show the main document if that is a large advantage? Why not include the window objects in that case too?
Created attachment 122947 [details] Example
Note: I agree #document should be in the model, it just shouldn't be rendered in the Elements panel IMHO. If we want them in the panel, we should include the main document too.
Couple of reasons I felt comfortable leaving it as is: 1) $0 on the document node 2) the amount of iframe nodes per page is not huge. 3) fixing DOMAgent code to hide this element would all unnecessary complexity to the code (where we would populate children array of frame owner with the document's children, etc.
The fix would not be in DOMAgent, it would be in ElementTreeOutline.
Your probably right, it isn't a huge issue.
Unsure if it's related, but at the same time this was introduced, inspect element inside an iframe no longer works. If your page is an iframe, right clicking an element and inspecting doesn't drill down to the element in web inspector but rather highlights the top level body. If in web inspector you manually drill down to the iframe in question and then try right click > inspect element, then it works
Yep, looks like that regressed at the time #document was added. Can you file a new bug about that?