From 2ba05e9bf270682eddc1ac4443a4c7e663736b47 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 28 Jul 1999 04:48:34 +0000 Subject: [PATCH] Added failure check for call to nsStyleData::GetBorder() --- layout/base/nsCSSRendering.cpp | 4 +++- layout/forms/nsButtonFrameRenderer.cpp | 16 ++++++++++++---- layout/forms/nsFieldSetFrame.cpp | 4 +++- layout/forms/nsListControlFrame.cpp | 1 + layout/generic/nsAbsoluteContainingBlock.cpp | 4 +++- layout/generic/nsHTMLFrame.cpp | 4 +++- layout/generic/nsHTMLReflowState.cpp | 4 +++- .../html/base/src/nsAbsoluteContainingBlock.cpp | 4 +++- layout/html/base/src/nsHTMLFrame.cpp | 4 +++- layout/html/base/src/nsHTMLReflowState.cpp | 4 +++- layout/html/base/src/nsScrollFrame.cpp | 2 ++ layout/html/forms/src/nsButtonFrameRenderer.cpp | 16 ++++++++++++---- layout/html/forms/src/nsFieldSetFrame.cpp | 4 +++- layout/html/forms/src/nsListControlFrame.cpp | 1 + layout/html/style/src/nsCSSRendering.cpp | 4 +++- 15 files changed, 58 insertions(+), 18 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index d3b0146459c8..8af757c04ed0 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -1803,7 +1803,9 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, nsRect paddingArea(aBorderArea); nsMargin border; - aSpacing.GetBorder(border); + if (!aSpacing.GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } paddingArea.Deflate(border); // The actual dirty rect is the intersection of the padding area and the diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp index a4c32d0fa9ba..17bb4e74c7f3 100644 --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -235,7 +235,9 @@ nsButtonFrameRenderer::GetButtonOuterFocusBorderAndPadding() if (mOuterFocusStyle) { // get the outer focus border and padding const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOuterFocusStyle ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(focusBorderAndPadding); + if (!spacing->GetBorderPadding(focusBorderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } } return focusBorderAndPadding; @@ -249,7 +251,9 @@ nsButtonFrameRenderer::GetButtonBorderAndPadding() nsMargin borderAndPadding(0,0,0,0); const nsStyleSpacing* spacing = (const nsStyleSpacing*)context ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(borderAndPadding); + if (!spacing->GetBorderPadding(borderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } return borderAndPadding; } @@ -278,7 +282,9 @@ nsButtonFrameRenderer::GetButtonInnerFocusBorderAndPadding() if (mInnerFocusStyle) { // get the outer focus border and padding const nsStyleSpacing* spacing = (const nsStyleSpacing*)mInnerFocusStyle ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(innerFocusBorderAndPadding); + if (!spacing->GetBorderPadding(innerFocusBorderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } } return innerFocusBorderAndPadding; @@ -292,7 +298,9 @@ nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding() if (mOutlineStyle) { // get the outline border and padding const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOutlineStyle ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(borderAndPadding); + if (!spacing->GetBorderPadding(borderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } } return borderAndPadding; diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 5aab6c738fca..e40e522b10d1 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -200,7 +200,9 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext, nscoord onePixel = NSIntPixelsToTwips(1, p2t); nsMargin border; - spacing->GetBorder(border); + if (!spacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } nscoord yoff = 0; diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index cb9b0a8b0aa0..9b0e78300428 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -324,6 +324,7 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, // Subtract out the borders nsMargin border; if (!aReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); border.SizeTo(0, 0, 0, 0); } //XXX: Should just get the border.top when needed instead of diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index 7168cbef305d..bf363490ff2f 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -244,7 +244,9 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat nsMargin border; // Get the border values - aReflowState.mStyleSpacing->GetBorder(border); + if (!aReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } nsIHTMLReflow* htmlReflow; rv = aKidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow); diff --git a/layout/generic/nsHTMLFrame.cpp b/layout/generic/nsHTMLFrame.cpp index c03c125ef7d8..7319ef12a4df 100644 --- a/layout/generic/nsHTMLFrame.cpp +++ b/layout/generic/nsHTMLFrame.cpp @@ -327,7 +327,9 @@ RootFrame::Reflow(nsIPresContext& aPresContext, nsMargin border; nsFrameState kidState; - kidReflowState.mStyleSpacing->GetBorder(border); + if (!kidReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } kidFrame->GetFrameState(&kidState); // First check the combined area diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 0baacff024e2..9aa7e30ac189 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -425,7 +425,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, const nsStyleSpacing* blockSpacing; cbrs->frame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)blockSpacing); - blockSpacing->GetBorder(blockBorder); + if (!blockSpacing->GetBorder(blockBorder)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } placeholderOffset.x -= blockBorder.top; placeholderOffset.y -= blockBorder.bottom; } diff --git a/layout/html/base/src/nsAbsoluteContainingBlock.cpp b/layout/html/base/src/nsAbsoluteContainingBlock.cpp index 7168cbef305d..bf363490ff2f 100644 --- a/layout/html/base/src/nsAbsoluteContainingBlock.cpp +++ b/layout/html/base/src/nsAbsoluteContainingBlock.cpp @@ -244,7 +244,9 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat nsMargin border; // Get the border values - aReflowState.mStyleSpacing->GetBorder(border); + if (!aReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } nsIHTMLReflow* htmlReflow; rv = aKidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow); diff --git a/layout/html/base/src/nsHTMLFrame.cpp b/layout/html/base/src/nsHTMLFrame.cpp index c03c125ef7d8..7319ef12a4df 100644 --- a/layout/html/base/src/nsHTMLFrame.cpp +++ b/layout/html/base/src/nsHTMLFrame.cpp @@ -327,7 +327,9 @@ RootFrame::Reflow(nsIPresContext& aPresContext, nsMargin border; nsFrameState kidState; - kidReflowState.mStyleSpacing->GetBorder(border); + if (!kidReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } kidFrame->GetFrameState(&kidState); // First check the combined area diff --git a/layout/html/base/src/nsHTMLReflowState.cpp b/layout/html/base/src/nsHTMLReflowState.cpp index 0baacff024e2..9aa7e30ac189 100644 --- a/layout/html/base/src/nsHTMLReflowState.cpp +++ b/layout/html/base/src/nsHTMLReflowState.cpp @@ -425,7 +425,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, const nsStyleSpacing* blockSpacing; cbrs->frame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)blockSpacing); - blockSpacing->GetBorder(blockBorder); + if (!blockSpacing->GetBorder(blockBorder)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } placeholderOffset.x -= blockBorder.top; placeholderOffset.y -= blockBorder.bottom; } diff --git a/layout/html/base/src/nsScrollFrame.cpp b/layout/html/base/src/nsScrollFrame.cpp index 48a54291e6b4..913d8aca8a7b 100644 --- a/layout/html/base/src/nsScrollFrame.cpp +++ b/layout/html/base/src/nsScrollFrame.cpp @@ -310,6 +310,7 @@ nsScrollFrame::CreateScrollingView(nsIPresContext& aPresContext) // Set the scrolling view's insets to whatever our border is nsMargin border; if (!spacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); border.SizeTo(0, 0, 0, 0); } scrollingView->SetControlInsets(border); @@ -503,6 +504,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // Calculate the amount of space needed for borders nsMargin border; if (!aReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); border.SizeTo(0, 0, 0, 0); } diff --git a/layout/html/forms/src/nsButtonFrameRenderer.cpp b/layout/html/forms/src/nsButtonFrameRenderer.cpp index a4c32d0fa9ba..17bb4e74c7f3 100644 --- a/layout/html/forms/src/nsButtonFrameRenderer.cpp +++ b/layout/html/forms/src/nsButtonFrameRenderer.cpp @@ -235,7 +235,9 @@ nsButtonFrameRenderer::GetButtonOuterFocusBorderAndPadding() if (mOuterFocusStyle) { // get the outer focus border and padding const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOuterFocusStyle ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(focusBorderAndPadding); + if (!spacing->GetBorderPadding(focusBorderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } } return focusBorderAndPadding; @@ -249,7 +251,9 @@ nsButtonFrameRenderer::GetButtonBorderAndPadding() nsMargin borderAndPadding(0,0,0,0); const nsStyleSpacing* spacing = (const nsStyleSpacing*)context ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(borderAndPadding); + if (!spacing->GetBorderPadding(borderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } return borderAndPadding; } @@ -278,7 +282,9 @@ nsButtonFrameRenderer::GetButtonInnerFocusBorderAndPadding() if (mInnerFocusStyle) { // get the outer focus border and padding const nsStyleSpacing* spacing = (const nsStyleSpacing*)mInnerFocusStyle ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(innerFocusBorderAndPadding); + if (!spacing->GetBorderPadding(innerFocusBorderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } } return innerFocusBorderAndPadding; @@ -292,7 +298,9 @@ nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding() if (mOutlineStyle) { // get the outline border and padding const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOutlineStyle ->GetStyleData(eStyleStruct_Spacing); - spacing->GetBorderPadding(borderAndPadding); + if (!spacing->GetBorderPadding(borderAndPadding)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } } return borderAndPadding; diff --git a/layout/html/forms/src/nsFieldSetFrame.cpp b/layout/html/forms/src/nsFieldSetFrame.cpp index 5aab6c738fca..e40e522b10d1 100644 --- a/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/layout/html/forms/src/nsFieldSetFrame.cpp @@ -200,7 +200,9 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext, nscoord onePixel = NSIntPixelsToTwips(1, p2t); nsMargin border; - spacing->GetBorder(border); + if (!spacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } nscoord yoff = 0; diff --git a/layout/html/forms/src/nsListControlFrame.cpp b/layout/html/forms/src/nsListControlFrame.cpp index cb9b0a8b0aa0..9b0e78300428 100644 --- a/layout/html/forms/src/nsListControlFrame.cpp +++ b/layout/html/forms/src/nsListControlFrame.cpp @@ -324,6 +324,7 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, // Subtract out the borders nsMargin border; if (!aReflowState.mStyleSpacing->GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); border.SizeTo(0, 0, 0, 0); } //XXX: Should just get the border.top when needed instead of diff --git a/layout/html/style/src/nsCSSRendering.cpp b/layout/html/style/src/nsCSSRendering.cpp index d3b0146459c8..8af757c04ed0 100644 --- a/layout/html/style/src/nsCSSRendering.cpp +++ b/layout/html/style/src/nsCSSRendering.cpp @@ -1803,7 +1803,9 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, nsRect paddingArea(aBorderArea); nsMargin border; - aSpacing.GetBorder(border); + if (!aSpacing.GetBorder(border)) { + NS_NOTYETIMPLEMENTED("percentage border"); + } paddingArea.Deflate(border); // The actual dirty rect is the intersection of the padding area and the