WebCore:
[WebKit-https.git] / WebCore / rendering / RenderTextControlMultiLine.cpp
index 566a81c868a33af7581b4a435249ffb1a7ea527d..df31c2bdf6a59fc5b6bba075cd625770632b726b 100644 (file)
@@ -106,6 +106,19 @@ PassRefPtr<RenderStyle> RenderTextControlMultiLine::createInnerTextStyle(const R
     textBlockStyle->inheritFrom(startStyle);
 
     adjustInnerTextStyle(startStyle, textBlockStyle.get());
     textBlockStyle->inheritFrom(startStyle);
 
     adjustInnerTextStyle(startStyle, textBlockStyle.get());
+
+    // FIXME: This code should just map wrap into CSS in the DOM code.
+    // Then here we should set the textBlockStyle appropriately based off this
+    // object's style()->whiteSpace() and style->wordWrap().
+    // Set word wrap property based on wrap attribute.
+    if (static_cast<HTMLTextAreaElement*>(node())->shouldWrapText()) {
+        textBlockStyle->setWhiteSpace(PRE_WRAP);
+        textBlockStyle->setWordWrap(BreakWordWrap);
+    } else {
+        textBlockStyle->setWhiteSpace(PRE);
+        textBlockStyle->setWordWrap(NormalWordWrap);
+    }
+
     textBlockStyle->setDisplay(BLOCK);
 
     return textBlockStyle.release();
     textBlockStyle->setDisplay(BLOCK);
 
     return textBlockStyle.release();