Index: Source/core/html/HTMLTextAreaElement.cpp |
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp |
index fd7ad6434bc60392e35ebe11871ee0c35cb2c472..ff34db902f8a27abda936542d8531f09308037fa 100644 |
--- a/Source/core/html/HTMLTextAreaElement.cpp |
+++ b/Source/core/html/HTMLTextAreaElement.cpp |
@@ -220,6 +220,8 @@ bool HTMLTextAreaElement::appendFormData(FormDataList& encoding, bool) |
void HTMLTextAreaElement::resetImpl() |
{ |
setNonDirtyValue(defaultValue()); |
+ unsigned endOfString = m_value.length(); |
+ setSelectionRange(endOfString, endOfString, SelectionHasNoDirection, NotChangeSelection); |
tkent
2014/07/24 01:04:22
Why only resetImpl() has this though childrenChang
yoichio
2014/07/24 03:06:06
I found also childrenChanged and setDefaultValue n
|
} |
bool HTMLTextAreaElement::hasCustomFocusLogic() const |
@@ -371,10 +373,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()) { |
tkent
2014/07/24 01:04:22
Checking renderer() is not correct. We should cal
yoichio
2014/07/24 03:06:07
Done.
|
+ // Set the caret to the end of the text value except for initialize. |
unsigned endOfString = m_value.length(); |
- setSelectionRange(endOfString, endOfString); |
+ setSelectionRange(endOfString, endOfString, SelectionHasNoDirection, NotChangeSelection); |
} |
notifyFormStateChanged(); |