mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
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:
parent
ec389d9ad1
commit
069f69ec74
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user