From 0dddb3aadc2d33cd15e32762a50a054b5032866b Mon Sep 17 00:00:00 2001 From: "jkeiser%netscape.com" Date: Tue, 17 Dec 2002 01:10:03 +0000 Subject: [PATCH] Remove 8 nested frames limit on framesets (bug 175270), patch by mkaply@us.ibm.com, r=jkeiser@netscape.com, sr=jst@netscape.com --- content/base/src/nsFrameLoader.cpp | 35 ------------------------------ 1 file changed, 35 deletions(-) diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 87e6b6d4969a..bfaab09e21f5 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -67,11 +67,6 @@ #include "nsHTMLAtoms.h" #include "nsINameSpaceManager.h" -// Bug 8065: Limit content frame depth to some reasonable level. This -// does not count chrome frames when determining depth, nor does it -// prevent chrome recursion. -#define MAX_DEPTH_CONTENT_FRAMES 8 - // Bug 98158: Limit to the number of total docShells in one page. #define MAX_NUMBER_DOCSHELLS 100 @@ -335,39 +330,9 @@ nsFrameLoader::EnsureDocShell() GetPresContext(getter_AddRefs(presContext)); NS_ENSURE_TRUE(presContext, NS_ERROR_UNEXPECTED); - // Bug 8065: Don't exceed some maximum depth in content frames - // (MAX_DEPTH_CONTENT_FRAMES) - PRInt32 depth = 0; nsCOMPtr parentAsSupports; presContext->GetContainer(getter_AddRefs(parentAsSupports)); - if (parentAsSupports) { - nsCOMPtr parentAsItem = - do_QueryInterface(parentAsSupports); - - while (parentAsItem) { - ++depth; - - if (depth >= MAX_DEPTH_CONTENT_FRAMES) { - NS_WARNING("Too many nested content frames so giving up"); - - return NS_ERROR_UNEXPECTED; // Too deep, give up! (silently?) - } - - // Only count depth on content, not chrome. - // If we wanted to limit total depth, skip the following check: - PRInt32 parentType; - parentAsItem->GetItemType(&parentType); - - if (nsIDocShellTreeItem::typeContent == parentType) { - nsIDocShellTreeItem* temp = parentAsItem; - temp->GetParent(getter_AddRefs(parentAsItem)); - } else { - break; // we have exited content, stop counting, depth is OK! - } - } - } - // bug98158:count the children under the root docshell. // if the total number of children under the root docshell // beyond the limit,return a error.