From c1146da4883e6b951348ca0fd93aca46ffb13d5d Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Mon, 29 Jul 2002 20:13:09 +0000 Subject: [PATCH] bug 50633 patch by riceman+bmo@mail.rit.edu r=jkeiser sr=kin a=asa textarea always does a soft wrap, even with wrap="off" or white-space:nowrap or white-space:pre git-svn-id: svn://10.0.0.236/trunk@126007 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsTextControlFrame.cpp | 11 +++++++++++ mozilla/layout/html/forms/src/nsTextControlFrame.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index b09cc5fcf18..25acff0a3f6 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -2101,6 +2101,17 @@ nsTextControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, col = ((colAttr.GetUnit() == eHTMLUnit_Pixel) ? colAttr.GetPixelValue() : colAttr.GetIntValue()); col = (col <= 0) ? 1 : col; // XXX why a default of 1 char, why hide it } + if (type == NS_FORM_TEXTAREA) + { + nsFormControlHelper::nsHTMLTextWrap wrapProp; + nsresult rv = nsFormControlHelper::GetWrapPropertyEnum(mContent, wrapProp); + // do not wrap at the cols attribute when wrap=off + if ((rv != NS_CONTENT_ATTR_NOT_THERE) && + (wrapProp == nsFormControlHelper::eHTMLTextWrap_Off)) + { + col = -1; + } + } textEditor->SetWrapWidth(col); delete spec; } diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index b09cc5fcf18..25acff0a3f6 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -2101,6 +2101,17 @@ nsTextControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, col = ((colAttr.GetUnit() == eHTMLUnit_Pixel) ? colAttr.GetPixelValue() : colAttr.GetIntValue()); col = (col <= 0) ? 1 : col; // XXX why a default of 1 char, why hide it } + if (type == NS_FORM_TEXTAREA) + { + nsFormControlHelper::nsHTMLTextWrap wrapProp; + nsresult rv = nsFormControlHelper::GetWrapPropertyEnum(mContent, wrapProp); + // do not wrap at the cols attribute when wrap=off + if ((rv != NS_CONTENT_ATTR_NOT_THERE) && + (wrapProp == nsFormControlHelper::eHTMLTextWrap_Off)) + { + col = -1; + } + } textEditor->SetWrapWidth(col); delete spec; }