From a7f818a9a6a680c2af4d7c7d88f13aadd9625608 Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Wed, 10 Apr 2002 11:13:35 +0000 Subject: [PATCH] Lower limit on number of nested content frames before giving up. b=126466 r=fabian@bluishgecko.net sr=jst@netscape.com a=rjesup@wgate.com (drivers) a=jaimejr@netscape.com (adt) git-svn-id: svn://10.0.0.236/trunk@118610 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrameFrame.cpp | 7 +++++-- mozilla/layout/html/document/src/nsFrameFrame.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 0970e11314c..bbff77b79d8 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -106,7 +106,8 @@ static NS_DEFINE_CID(kCChildCID, NS_CHILD_CID); // 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 25 +// Also see bug 126466. +#define MAX_DEPTH_CONTENT_FRAMES 8 /******************************************************************************* * FrameLoadingInfo @@ -977,8 +978,10 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext) nsCOMPtr parentAsItem(do_QueryInterface(parentAsSupports)); while (parentAsItem) { depth++; - if (MAX_DEPTH_CONTENT_FRAMES < depth) + if (MAX_DEPTH_CONTENT_FRAMES < depth) { + 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: diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 0970e11314c..bbff77b79d8 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -106,7 +106,8 @@ static NS_DEFINE_CID(kCChildCID, NS_CHILD_CID); // 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 25 +// Also see bug 126466. +#define MAX_DEPTH_CONTENT_FRAMES 8 /******************************************************************************* * FrameLoadingInfo @@ -977,8 +978,10 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext) nsCOMPtr parentAsItem(do_QueryInterface(parentAsSupports)); while (parentAsItem) { depth++; - if (MAX_DEPTH_CONTENT_FRAMES < depth) + if (MAX_DEPTH_CONTENT_FRAMES < depth) { + 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: