From 8ed4ae4bd02a2efdfa329ed5e2c2369a4c4b7196 Mon Sep 17 00:00:00 2001 From: "timeless%mac.com" Date: Wed, 17 May 2006 02:33:59 +0000 Subject: [PATCH] http://bonsai.mozilla.org/cvsquery.cgi?module=SeaMonkeyAll&branch=HEAD&cvsroot=/cvsroot&date=explicit&mindate=1017959940&maxdate=1017960540&who=jst%25netscape.com&generateBackoutCVSCommands=1 Backing out the fix for bug 52334 approved by sheriff (karnaze) and cathleen --- layout/inspector/src/inLayoutUtils.cpp | 39 +++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/layout/inspector/src/inLayoutUtils.cpp b/layout/inspector/src/inLayoutUtils.cpp index b3de7a494201..12a7a7333300 100644 --- a/layout/inspector/src/inLayoutUtils.cpp +++ b/layout/inspector/src/inLayoutUtils.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: NPL 1.1/GPL 2.0/LGPL 2.1 * @@ -253,12 +253,22 @@ inLayoutUtils::GetSubDocumentFor(nsIDOMNode* aNode) nsCOMPtr doc; content->GetDocument(*getter_AddRefs(doc)); if (doc) { - nsCOMPtr sub_doc; - doc->GetSubDocumentFor(content, getter_AddRefs(sub_doc)); - - nsCOMPtr domdoc(do_QueryInterface(sub_doc)); - - return domdoc; + nsCOMPtr shell; + doc->GetShellAt(0, getter_AddRefs(shell)); + if (shell) { + nsCOMPtr supports; + shell->GetSubShellFor(content, getter_AddRefs(supports)); + nsCOMPtr docShell = do_QueryInterface(supports); + if (docShell) { + nsCOMPtr contentViewer; + docShell->GetContentViewer(getter_AddRefs(contentViewer)); + if (contentViewer) { + nsCOMPtr domdoc; + contentViewer->GetDOMDocument(getter_AddRefs(domdoc)); + return domdoc; + } + } + } } } @@ -269,7 +279,6 @@ nsIDOMNode* inLayoutUtils::GetContainerFor(nsIDOMDocument* aDoc) { nsCOMPtr container; - nsCOMPtr doc(do_QueryInterface(aDoc)); // get the doc shell for this document and look for the parent doc shell nsCOMPtr win = inLayoutUtils::GetWindowFor(aDoc); @@ -288,17 +297,9 @@ inLayoutUtils::GetContainerFor(nsIDOMDocument* aDoc) nsCOMPtr presShell; parentDocShell->GetPresShell(getter_AddRefs(presShell)); - nsCOMPtr parent_doc; - presShell->GetDocument(getter_AddRefs(parent_doc)); - - nsCOMPtr node; - - if (parent_doc) { - nsCOMPtr content; - parent_doc->FindContentForSubDocument(doc, getter_AddRefs(content)); - - node = do_QueryInterface(content); - } + nsCOMPtr content; + presShell->FindContentForShell(docShell, getter_AddRefs(content)); + nsCOMPtr node = do_QueryInterface(content); return node; }