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

Side by Side Diff: Source/core/html/HTMLInputElement.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
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 333
334 bool HTMLInputElement::shouldShowFocusRingOnMouseFocus() const 334 bool HTMLInputElement::shouldShowFocusRingOnMouseFocus() const
335 { 335 {
336 return m_inputType->shouldShowFocusRingOnMouseFocus(); 336 return m_inputType->shouldShowFocusRingOnMouseFocus();
337 } 337 }
338 338
339 void HTMLInputElement::updateFocusAppearance(bool restorePreviousSelection) 339 void HTMLInputElement::updateFocusAppearance(bool restorePreviousSelection)
340 { 340 {
341 if (isTextField()) { 341 if (isTextField()) {
342 if (!restorePreviousSelection || !hasCachedSelection()) 342 if (!restorePreviousSelection)
343 select(); 343 select();
344 else 344 else
345 restoreCachedSelection(); 345 restoreCachedSelection();
346 if (document().frame()) 346 if (document().frame())
347 document().frame()->selection().revealSelection(); 347 document().frame()->selection().revealSelection();
348 } else 348 } else
349 HTMLTextFormControlElement::updateFocusAppearance(restorePreviousSelecti on); 349 HTMLTextFormControlElement::updateFocusAppearance(restorePreviousSelecti on);
350 } 350 }
351 351
352 void HTMLInputElement::beginEditing() 352 void HTMLInputElement::beginEditing()
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 } 1878 }
1879 1879
1880 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1880 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1881 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1881 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1882 { 1882 {
1883 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); 1883 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer());
1884 } 1884 }
1885 #endif 1885 #endif
1886 1886
1887 } // namespace 1887 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698