Index: Source/core/html/HTMLTextAreaElement.cpp |
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp |
index fd7ad6434bc60392e35ebe11871ee0c35cb2c472..9058c5e9ea5fa0ad64959cbb4f4fb8c85dd22f41 100644 |
--- a/Source/core/html/HTMLTextAreaElement.cpp |
+++ b/Source/core/html/HTMLTextAreaElement.cpp |
@@ -371,10 +371,10 @@ void HTMLTextAreaElement::setValueCommon(const String& newValue, TextFieldEventB |
setNeedsStyleRecalc(SubtreeStyleChange); |
m_suggestedValue = String(); |
- // Set the caret to the end of the text value. |
- if (document().focusedElement() == this) { |
+ if (renderer() && valid()) { |
tkent
2014/07/23 02:25:24
I don't understand this code at all. Why valid()
yoichio
2014/07/23 10:39:07
Move validity check to setSelectionRange.
HTMLTex
tkent
2014/07/24 01:04:22
ok, I understand that setNeedsValidityCheck() in s
|
+ // Set the caret to the end of the text value. |
unsigned endOfString = m_value.length(); |
- setSelectionRange(endOfString, endOfString); |
+ setSelectionRange(endOfString, endOfString, SelectionHasNoDirection, NotChangeSelection); |
} |
notifyFormStateChanged(); |