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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 1437813002: Set selection to INPUT/TEXTAREA before dispatching 'focus' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve selection-functions.html Created 5 years, 1 month 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
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, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
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 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 { 344 {
345 if (isTextField()) { 345 if (isTextField()) {
346 switch (selectionBehavior) { 346 switch (selectionBehavior) {
347 case SelectionBehaviorOnFocus::Reset: 347 case SelectionBehaviorOnFocus::Reset:
348 select(NotDispatchSelectEvent); 348 select(NotDispatchSelectEvent);
349 break; 349 break;
350 case SelectionBehaviorOnFocus::Restore: 350 case SelectionBehaviorOnFocus::Restore:
351 restoreCachedSelection(); 351 restoreCachedSelection();
352 break; 352 break;
353 case SelectionBehaviorOnFocus::None: 353 case SelectionBehaviorOnFocus::None:
354 // |None| is used only for FocusController::setFocusedElement and 354 return;
355 // Document::setFocusedElement, and they don't call
356 // updateFocusAppearance().
357 ASSERT_NOT_REACHED();
358 } 355 }
359 if (document().frame()) 356 if (document().frame())
360 document().frame()->selection().revealSelection(); 357 document().frame()->selection().revealSelection();
361 } else { 358 } else {
362 HTMLTextFormControlElement::updateFocusAppearance(selectionBehavior); 359 HTMLTextFormControlElement::updateFocusAppearance(selectionBehavior);
363 } 360 }
364 } 361 }
365 362
366 void HTMLInputElement::beginEditing() 363 void HTMLInputElement::beginEditing()
367 { 364 {
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 void HTMLInputElement::ensurePrimaryContent() 1949 void HTMLInputElement::ensurePrimaryContent()
1953 { 1950 {
1954 m_inputTypeView->ensurePrimaryContent(); 1951 m_inputTypeView->ensurePrimaryContent();
1955 } 1952 }
1956 1953
1957 bool HTMLInputElement::hasFallbackContent() const 1954 bool HTMLInputElement::hasFallbackContent() const
1958 { 1955 {
1959 return m_inputTypeView->hasFallbackContent(); 1956 return m_inputTypeView->hasFallbackContent();
1960 } 1957 }
1961 } // namespace 1958 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698