OLD | NEW |
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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 void HTMLInputElement::setValueFromRenderer(const String& value) | 1088 void HTMLInputElement::setValueFromRenderer(const String& value) |
1089 { | 1089 { |
1090 // File upload controls will never use this. | 1090 // File upload controls will never use this. |
1091 ASSERT(!isFileUpload()); | 1091 ASSERT(!isFileUpload()); |
1092 | 1092 |
1093 m_suggestedValue = String(); | 1093 m_suggestedValue = String(); |
1094 | 1094 |
1095 // Renderer and our event handler are responsible for sanitizing values. | 1095 // Renderer and our event handler are responsible for sanitizing values. |
1096 ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty()); | 1096 ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty()); |
1097 | 1097 |
1098 // Workaround for bug where trailing \n is included in the result of textCon
tent. | 1098 m_valueIfDirty = value; |
1099 // The assert macro above may also be simplified to: value == constrainValue
(value) | |
1100 // http://bugs.webkit.org/show_bug.cgi?id=9661 | |
1101 m_valueIfDirty = value == "\n" ? emptyString() : value; | |
1102 | 1099 |
1103 setFormControlValueMatchesRenderer(true); | 1100 setFormControlValueMatchesRenderer(true); |
1104 m_wasModifiedByUser = true; | 1101 m_wasModifiedByUser = true; |
1105 | 1102 |
1106 // Input event is fired by the Node::defaultEventHandler for editable contro
ls. | 1103 // Input event is fired by the Node::defaultEventHandler for editable contro
ls. |
1107 if (!isTextField()) | 1104 if (!isTextField()) |
1108 dispatchInputEvent(); | 1105 dispatchInputEvent(); |
1109 notifyFormStateChanged(); | 1106 notifyFormStateChanged(); |
1110 | 1107 |
1111 setNeedsValidityCheck(); | 1108 setNeedsValidityCheck(); |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 } | 1908 } |
1912 | 1909 |
1913 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1910 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
1914 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1911 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
1915 { | 1912 { |
1916 return m_inputType->customStyleForRenderer(originalStyleForRenderer()); | 1913 return m_inputType->customStyleForRenderer(originalStyleForRenderer()); |
1917 } | 1914 } |
1918 #endif | 1915 #endif |
1919 | 1916 |
1920 } // namespace | 1917 } // namespace |
OLD | NEW |