From 08ec785b8bdee59e1a5d24be88a9325959b189f7 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Thu, 18 Dec 2003 06:06:00 +0000 Subject: [PATCH] Account for 1 twip width of BR when computing the size of textareas. b=228752 Patch by Mats Palmgren . r+sr=dbaron a=brendan git-svn-id: svn://10.0.0.236/trunk@150407 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsTextControlFrame.cpp | 8 ++++++++ mozilla/layout/generic/nsBRFrame.cpp | 2 ++ mozilla/layout/html/base/src/nsBRFrame.cpp | 2 ++ mozilla/layout/html/forms/src/nsTextControlFrame.cpp | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index fc2420cfd0d..be6fc196642 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -1490,6 +1490,14 @@ nsTextControlFrame::CalculateSizeStandard(nsIPresContext* aPresContext, } // Now add the extra padding on (so that small input sizes work well) aDesiredSize.width += internalPadding; + } else { + // This is to account for the anonymous
having a 1 twip width + // in Full Standards mode, see BRFrame::Reflow and bug 228752. + nsCompatibility mode; + aPresContext->GetCompatibilityMode(&mode); + if (mode == eCompatibility_FullStandards) { + aDesiredSize.width += 1; + } } // Set the height equal to total number of rows (times the height of each diff --git a/mozilla/layout/generic/nsBRFrame.cpp b/mozilla/layout/generic/nsBRFrame.cpp index 5504769315a..4be7091b312 100644 --- a/mozilla/layout/generic/nsBRFrame.cpp +++ b/mozilla/layout/generic/nsBRFrame.cpp @@ -184,6 +184,8 @@ BRFrame::Reflow(nsIPresContext* aPresContext, // code in nsLineLayout::VerticalAlignFrames that zaps minY/maxY // if the width is zero. // XXX This also fixes bug 10036! + // Warning: nsTextControlFrame::CalculateSizeStandard depends on + // the following line, see bug 228752. aMetrics.width = 1; // Update max-element-width to keep us honest diff --git a/mozilla/layout/html/base/src/nsBRFrame.cpp b/mozilla/layout/html/base/src/nsBRFrame.cpp index 5504769315a..4be7091b312 100644 --- a/mozilla/layout/html/base/src/nsBRFrame.cpp +++ b/mozilla/layout/html/base/src/nsBRFrame.cpp @@ -184,6 +184,8 @@ BRFrame::Reflow(nsIPresContext* aPresContext, // code in nsLineLayout::VerticalAlignFrames that zaps minY/maxY // if the width is zero. // XXX This also fixes bug 10036! + // Warning: nsTextControlFrame::CalculateSizeStandard depends on + // the following line, see bug 228752. aMetrics.width = 1; // Update max-element-width to keep us honest diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index fc2420cfd0d..be6fc196642 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -1490,6 +1490,14 @@ nsTextControlFrame::CalculateSizeStandard(nsIPresContext* aPresContext, } // Now add the extra padding on (so that small input sizes work well) aDesiredSize.width += internalPadding; + } else { + // This is to account for the anonymous
having a 1 twip width + // in Full Standards mode, see BRFrame::Reflow and bug 228752. + nsCompatibility mode; + aPresContext->GetCompatibilityMode(&mode); + if (mode == eCompatibility_FullStandards) { + aDesiredSize.width += 1; + } } // Set the height equal to total number of rows (times the height of each