Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Unified Diff: Source/core/html/HTMLTextAreaElement.cpp

Issue 222023002: focus() behaviour differs depending on how value is set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLTextFormControlElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextAreaElement.cpp
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index 6653cb1b2befa66630985cfe355ea8ec86b94fef..35ab21dd8a5ade3aed062df1ebbc65557afb66b4 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -240,12 +240,9 @@ bool HTMLTextAreaElement::shouldShowFocusRingOnMouseFocus() const
void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
{
- if (!restorePreviousSelection || !hasCachedSelection()) {
- // If this is the first focus, set a caret at the beginning of the text.
- // This matches some browsers' behavior; see bug 11746 Comment #15.
- // http://bugs.webkit.org/show_bug.cgi?id=11746#c15
+ if (!restorePreviousSelection)
setSelectionRange(0, 0);
- } else
+ else
restoreCachedSelection();
if (document().frame())
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLTextFormControlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698