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

Side by Side 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: Addressing the changes mention in comments in Patch set 2 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLTextFormControlElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 return isFocusable(); 233 return isFocusable();
234 } 234 }
235 235
236 bool HTMLTextAreaElement::shouldShowFocusRingOnMouseFocus() const 236 bool HTMLTextAreaElement::shouldShowFocusRingOnMouseFocus() const
237 { 237 {
238 return true; 238 return true;
239 } 239 }
240 240
241 void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection) 241 void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
242 { 242 {
243 if (!restorePreviousSelection || !hasCachedSelection()) { 243 if (!restorePreviousSelection) {
244 // If this is the first focus, set a caret at the beginning of the text. 244 // If this is the first focus, set a caret at the beginning of the text.
tkent 2014/04/10 01:37:39 This comment is obsolete. Please remove it.
harpreet.sk 2014/04/10 06:13:27 Done.
245 // This matches some browsers' behavior; see bug 11746 Comment #15. 245 // This matches some browsers' behavior; see bug 11746 Comment #15.
246 // http://bugs.webkit.org/show_bug.cgi?id=11746#c15 246 // http://bugs.webkit.org/show_bug.cgi?id=11746#c15
247 setSelectionRange(0, 0); 247 setSelectionRange(0, 0);
248 } else 248 } else
249 restoreCachedSelection(); 249 restoreCachedSelection();
250 250
251 if (document().frame()) 251 if (document().frame())
252 document().frame()->selection().revealSelection(); 252 document().frame()->selection().revealSelection();
253 } 253 }
254 254
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 { 564 {
565 return true; 565 return true;
566 } 566 }
567 567
568 bool HTMLTextAreaElement::supportsAutofocus() const 568 bool HTMLTextAreaElement::supportsAutofocus() const
569 { 569 {
570 return true; 570 return true;
571 } 571 }
572 572
573 } 573 }
OLDNEW
« 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