Index: Source/core/html/HTMLInputElement.cpp |
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp |
index 5983d417c03b3c4e9a14ec5dcd650b3c6d441442..315c4b93e67247cacfb2357dc8cfde8bfe6b718c 100644 |
--- a/Source/core/html/HTMLInputElement.cpp |
+++ b/Source/core/html/HTMLInputElement.cpp |
@@ -1053,7 +1053,10 @@ void HTMLInputElement::setValueFromRenderer(const String& value) |
// Renderer and our event handler are responsible for sanitizing values. |
ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty()); |
- m_valueIfDirty = value; |
+ // Workaround for bug where trailing \n is included in the result of textContent. |
+ // The assert macro above may also be simplified to: value == constrainValue(value) |
+ // http://bugs.webkit.org/show_bug.cgi?id=9661 |
+ m_valueIfDirty = value == "\n" ? emptyString() : value; |
setFormControlValueMatchesRenderer(true); |
m_wasModifiedByUser = true; |