From 8e0776ee66b0b67df5358077add87830be5b514d Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Wed, 30 Aug 2000 00:05:59 +0000 Subject: [PATCH] Putting fix for 42492 back in. r=ben git-svn-id: svn://10.0.0.236/trunk@77515 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/forms/src/nsGfxTextControlFrame2.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp index 1785148c3f4..702079ebb95 100644 --- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -1507,7 +1507,7 @@ nsGfxTextControlFrame2::CreateFrameFor(nsIPresContext* aPresContext, return NS_ERROR_FAILURE; } -#define DIV_STRING "user-focus: none; overflow:auto; border: 0px !important; padding: 0px; margin:0px" +#define DIV_STRING "user-focus: none; border: 0px !important; padding: 0px; margin:0px; " #define DIV_STRING_SINGLELINE "user-focus: none; white-space : nowrap; overflow:auto; border: 0px !important; padding: 0px; margin:0px" NS_IMETHODIMP @@ -1580,8 +1580,17 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext, if (IsSingleLineTextControl()) rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, NS_ConvertToString(DIV_STRING_SINGLELINE), PR_FALSE); - else - rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, NS_ConvertToString(DIV_STRING), PR_FALSE); + else { + nsAutoString divStr; divStr.AssignWithConversion(DIV_STRING); + const nsStyleDisplay* disp = (const nsStyleDisplay*) + mStyleContext->GetStyleData(eStyleStruct_Display); + if (disp->mOverflow == NS_STYLE_OVERFLOW_SCROLL) + divStr += NS_LITERAL_STRING("overflow:scroll;"); + else if (disp->mOverflow == NS_STYLE_OVERFLOW_HIDDEN) + divStr += NS_LITERAL_STRING("overflow:hidden;"); + else divStr += NS_LITERAL_STRING("overflow:auto;"); + rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, divStr, PR_FALSE); + } if (NS_FAILED(rv)) return rv;