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
This commit is contained in:
cbiesinger%web.de 2002-07-29 20:13:09 +00:00
parent ec389d9ad1
commit 069f69ec74
2 changed files with 22 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}