From 3bcb8b4996f502f0ebe2df1ca2bf02dfcdfcb7fd Mon Sep 17 00:00:00 2001 From: kipp Date: Thu, 28 May 1998 17:06:43 +0000 Subject: [PATCH] Fixed infinite loop in GetStyleSize code git-svn-id: svn://10.0.0.236/trunk@2499 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/style/src/nsCSSLayout.cpp | 6 ++++-- mozilla/layout/html/style/src/nsCSSLayout.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSLayout.cpp b/mozilla/content/html/style/src/nsCSSLayout.cpp index 272d78db7b3..9bf050bb6fd 100644 --- a/mozilla/content/html/style/src/nsCSSLayout.cpp +++ b/mozilla/content/html/style/src/nsCSSLayout.cpp @@ -300,6 +300,7 @@ GetStyleDimension(nsIPresContext* aPresContext, // on the containing block's width. // XXX need to subtract out padding, also this needs // to be synced with nsFrame's IsPercentageBase + // XXX should this be geometric parent aFrame->GetContentParent(parentFrame); while (nsnull != parentFrame) { nsBlockFrame* block; @@ -312,6 +313,7 @@ GetStyleDimension(nsIPresContext* aPresContext, rv = PR_TRUE; break; } + parentFrame->GetContentParent(parentFrame); } break; default: @@ -336,8 +338,8 @@ nsCSSLayout::GetStyleSize(nsIPresContext* aPresContext, nsIStyleContext* sc = nsnull; aFrame->GetStyleContext(aPresContext, sc); if (nsnull != sc) { - nsStylePosition* pos = (nsStylePosition* - ) sc->GetData(eStyleStruct_Position); + nsStylePosition* pos = (nsStylePosition*) + sc->GetData(eStyleStruct_Position); if (GetStyleDimension(aPresContext, aFrame, pos, pos->mWidth, aStyleSize.width)) { rv |= NS_SIZE_HAS_WIDTH; diff --git a/mozilla/layout/html/style/src/nsCSSLayout.cpp b/mozilla/layout/html/style/src/nsCSSLayout.cpp index 272d78db7b3..9bf050bb6fd 100644 --- a/mozilla/layout/html/style/src/nsCSSLayout.cpp +++ b/mozilla/layout/html/style/src/nsCSSLayout.cpp @@ -300,6 +300,7 @@ GetStyleDimension(nsIPresContext* aPresContext, // on the containing block's width. // XXX need to subtract out padding, also this needs // to be synced with nsFrame's IsPercentageBase + // XXX should this be geometric parent aFrame->GetContentParent(parentFrame); while (nsnull != parentFrame) { nsBlockFrame* block; @@ -312,6 +313,7 @@ GetStyleDimension(nsIPresContext* aPresContext, rv = PR_TRUE; break; } + parentFrame->GetContentParent(parentFrame); } break; default: @@ -336,8 +338,8 @@ nsCSSLayout::GetStyleSize(nsIPresContext* aPresContext, nsIStyleContext* sc = nsnull; aFrame->GetStyleContext(aPresContext, sc); if (nsnull != sc) { - nsStylePosition* pos = (nsStylePosition* - ) sc->GetData(eStyleStruct_Position); + nsStylePosition* pos = (nsStylePosition*) + sc->GetData(eStyleStruct_Position); if (GetStyleDimension(aPresContext, aFrame, pos, pos->mWidth, aStyleSize.width)) { rv |= NS_SIZE_HAS_WIDTH;