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

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

Issue 14969020: Avoid adding placeholder when deleting last text in root (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed bad TestExpectations behavior and unnecessary results churn. Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | no next file » | 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, 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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 void HTMLInputElement::setValueFromRenderer(const String& value) 1046 void HTMLInputElement::setValueFromRenderer(const String& value)
1047 { 1047 {
1048 // File upload controls will never use this. 1048 // File upload controls will never use this.
1049 ASSERT(!isFileUpload()); 1049 ASSERT(!isFileUpload());
1050 1050
1051 m_suggestedValue = String(); 1051 m_suggestedValue = String();
1052 1052
1053 // Renderer and our event handler are responsible for sanitizing values. 1053 // Renderer and our event handler are responsible for sanitizing values.
1054 ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty()); 1054 ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty());
1055 1055
1056 // Workaround for bug where trailing \n is included in the result of textCon tent. 1056 m_valueIfDirty = value;
1057 // The assert macro above may also be simplified to: value == constrainValue (value)
1058 // http://bugs.webkit.org/show_bug.cgi?id=9661
1059 m_valueIfDirty = value == "\n" ? emptyString() : value;
1060 1057
1061 setFormControlValueMatchesRenderer(true); 1058 setFormControlValueMatchesRenderer(true);
1062 m_wasModifiedByUser = true; 1059 m_wasModifiedByUser = true;
1063 1060
1064 // Input event is fired by the Node::defaultEventHandler for editable contro ls. 1061 // Input event is fired by the Node::defaultEventHandler for editable contro ls.
1065 if (!isTextField()) 1062 if (!isTextField())
1066 dispatchInputEvent(); 1063 dispatchInputEvent();
1067 notifyFormStateChanged(); 1064 notifyFormStateChanged();
1068 1065
1069 setNeedsValidityCheck(); 1066 setNeedsValidityCheck();
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 } 1879 }
1883 1880
1884 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1881 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1885 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1882 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1886 { 1883 {
1887 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl eForElement(this)); 1884 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl eForElement(this));
1888 } 1885 }
1889 #endif 1886 #endif
1890 1887
1891 } // namespace 1888 } // namespace
OLDNEW
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698