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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 void HTMLInputElement::setValueFromRenderer(const String& value) | 1070 void HTMLInputElement::setValueFromRenderer(const String& value) |
1071 { | 1071 { |
1072 // File upload controls will never use this. | 1072 // File upload controls will never use this. |
1073 ASSERT(!isFileUpload()); | 1073 ASSERT(!isFileUpload()); |
1074 | 1074 |
1075 m_suggestedValue = String(); | 1075 m_suggestedValue = String(); |
1076 | 1076 |
1077 // Renderer and our event handler are responsible for sanitizing values. | 1077 // Renderer and our event handler are responsible for sanitizing values. |
1078 ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty()); | 1078 ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty()); |
1079 | 1079 |
1080 // Workaround for bug where trailing \n is included in the result of textCon
tent. | 1080 m_valueIfDirty = value; |
1081 // The assert macro above may also be simplified to: value == constrainValue
(value) | |
1082 // http://bugs.webkit.org/show_bug.cgi?id=9661 | |
1083 m_valueIfDirty = value == "\n" ? emptyString() : value; | |
1084 | 1081 |
1085 setFormControlValueMatchesRenderer(true); | 1082 setFormControlValueMatchesRenderer(true); |
1086 m_wasModifiedByUser = true; | 1083 m_wasModifiedByUser = true; |
1087 | 1084 |
1088 // Input event is fired by the Node::defaultEventHandler for editable contro
ls. | 1085 // Input event is fired by the Node::defaultEventHandler for editable contro
ls. |
1089 if (!isTextField()) | 1086 if (!isTextField()) |
1090 dispatchInputEvent(); | 1087 dispatchInputEvent(); |
1091 notifyFormStateChanged(); | 1088 notifyFormStateChanged(); |
1092 | 1089 |
1093 setNeedsValidityCheck(); | 1090 setNeedsValidityCheck(); |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 } | 1955 } |
1959 | 1956 |
1960 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1957 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
1961 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1958 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
1962 { | 1959 { |
1963 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); | 1960 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); |
1964 } | 1961 } |
1965 #endif | 1962 #endif |
1966 | 1963 |
1967 } // namespace | 1964 } // namespace |
OLD | NEW |