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