From 92637c280b17e7ac5bea1a2fe006d601b9445477 Mon Sep 17 00:00:00 2001 From: kipp Date: Thu, 7 May 1998 23:38:12 +0000 Subject: [PATCH] Unsupported border+padding around form elements (except for image - it still works) --- layout/html/forms/src/nsInputButton.cpp | 7 ++----- layout/html/forms/src/nsInputFrame.cpp | 17 ++--------------- layout/html/forms/src/nsInputFrame.h | 4 ---- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/layout/html/forms/src/nsInputButton.cpp b/layout/html/forms/src/nsInputButton.cpp index dffa7ea2dc33..f1769cdd37eb 100644 --- a/layout/html/forms/src/nsInputButton.cpp +++ b/layout/html/forms/src/nsInputButton.cpp @@ -378,7 +378,8 @@ nsInputButtonFrame::ResizeReflow(nsIPresContext* aPresContext, nsSize* aMaxElementSize, ReflowStatus& aStatus) { - if ((kButtonTag_Input == GetButtonTagType()) && (kButton_Image == GetButtonType())) { + if ((kButtonTag_Input == GetButtonTagType()) && + (kButton_Image == GetButtonType())) { nsSize ignore; GetDesiredSize(aPresContext, aMaxSize, aDesiredSize, ignore); AddBordersAndPadding(aPresContext, aDesiredSize); @@ -386,10 +387,6 @@ nsInputButtonFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width = aDesiredSize.width; aMaxElementSize->height = aDesiredSize.height; } - mViewBounds.x = 0; - mViewBounds.y = 0; - mViewBounds.width = aDesiredSize.width; - mViewBounds.height = aDesiredSize.height; aStatus = frComplete; return NS_OK; } diff --git a/layout/html/forms/src/nsInputFrame.cpp b/layout/html/forms/src/nsInputFrame.cpp index f7af8584b7ef..2e186d1b1d11 100644 --- a/layout/html/forms/src/nsInputFrame.cpp +++ b/layout/html/forms/src/nsInputFrame.cpp @@ -93,7 +93,7 @@ nsInputFrame::MoveTo(nscoord aX, nscoord aY) nsIView* parentWithView; nsPoint origin; GetOffsetFromView(origin, parentWithView); - view->SetPosition(origin.x + mViewBounds.x, origin.y + mViewBounds.y); + view->SetPosition(origin.x, origin.y); NS_IF_RELEASE(parentWithView); NS_RELEASE(view); } @@ -112,7 +112,7 @@ nsInputFrame::SizeTo(nscoord aWidth, nscoord aHeight) nsIView* view = nsnull; GetView(view); if (nsnull != view) { - view->SetDimensions(mViewBounds.width, mViewBounds.height); + view->SetDimensions(aWidth, aHeight); NS_RELEASE(view); } return NS_OK; @@ -239,8 +239,6 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, nsSize widgetSize; GetDesiredSize(aPresContext, aMaxSize, aDesiredSize, widgetSize); - mViewBounds.width = widgetSize.width; - mViewBounds.height = widgetSize.height; nsRect boundBox(0, 0, widgetSize.width, widgetSize.height); nsIFrame* parWithView; @@ -294,20 +292,9 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, SetViewVisiblity(aPresContext, PR_FALSE); } - // Add in borders and padding - nsStyleSpacing* space = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - aDesiredSize.width += space->mBorderPadding.left + - space->mBorderPadding.right; - aDesiredSize.height += space->mBorderPadding.top + - space->mBorderPadding.bottom; aDesiredSize.ascent = aDesiredSize.height; aDesiredSize.descent = 0; - // Remember the view's offset coordinates - mViewBounds.x = space->mBorderPadding.left; - mViewBounds.y = space->mBorderPadding.top; - if (nsnull != aMaxElementSize) { aMaxElementSize->width = aDesiredSize.width; aMaxElementSize->height = aDesiredSize.height; diff --git a/layout/html/forms/src/nsInputFrame.h b/layout/html/forms/src/nsInputFrame.h index e0bda2f07893..70c78672db38 100644 --- a/layout/html/forms/src/nsInputFrame.h +++ b/layout/html/forms/src/nsInputFrame.h @@ -212,10 +212,6 @@ protected: nscoord GetStyleDim(nsIPresContext& aPresContext, nscoord aMaxDim, nscoord aMaxWidth, const nsStyleCoord& aCoord); - // Location of the view within the frame. The view will be inset by - // the border+padding. - nsRect mViewBounds; - nsMouseState mLastMouseState; };