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
This commit is contained in:
locka%iol.ie
2002-04-10 11:13:35 +00:00
parent f7209cf65c
commit a7f818a9a6
2 changed files with 10 additions and 4 deletions

View File

@@ -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<nsIDocShellTreeItem> 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:

View File

@@ -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<nsIDocShellTreeItem> 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: