| 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 * | 10 * |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 m_wasModifiedByUser = sendChangeEvent; | 1095 m_wasModifiedByUser = sendChangeEvent; |
| 1096 if (isTextField()) | 1096 if (isTextField()) |
| 1097 updatePlaceholderVisibility(false); | 1097 updatePlaceholderVisibility(false); |
| 1098 } | 1098 } |
| 1099 setNeedsStyleRecalc(); | 1099 setNeedsStyleRecalc(); |
| 1100 } else | 1100 } else |
| 1101 setAttribute(valueAttr, sanitizedValue); | 1101 setAttribute(valueAttr, sanitizedValue); |
| 1102 | 1102 |
| 1103 setNeedsValidityCheck(); | 1103 setNeedsValidityCheck(); |
| 1104 | 1104 |
| 1105 m_suggestedValue = String(); // updateInnerTextValue uses the suggested valu
e. |
| 1105 if (valueChanged) | 1106 if (valueChanged) |
| 1106 updateInnerTextValue(); | 1107 updateInnerTextValue(); |
| 1107 | 1108 |
| 1108 if (isTextField()) { | 1109 if (isTextField()) { |
| 1109 unsigned max = visibleValue().length(); | 1110 unsigned max = visibleValue().length(); |
| 1110 if (document()->focusedNode() == this) | 1111 if (document()->focusedNode() == this) |
| 1111 setSelectionRange(max, max); | 1112 setSelectionRange(max, max); |
| 1112 else | 1113 else |
| 1113 cacheSelection(max, max, SelectionHasNoDirection); | 1114 cacheSelection(max, max, SelectionHasNoDirection); |
| 1114 m_suggestedValue = String(); | |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 if (!valueChanged) | 1117 if (!valueChanged) |
| 1118 return; | 1118 return; |
| 1119 | 1119 |
| 1120 m_inputType->valueChanged(); | 1120 m_inputType->valueChanged(); |
| 1121 | 1121 |
| 1122 if (sendChangeEvent) { | 1122 if (sendChangeEvent) { |
| 1123 // If the user is still editing this field, dispatch an input event rath
er than a change event. | 1123 // If the user is still editing this field, dispatch an input event rath
er than a change event. |
| 1124 // The change event will be dispatched when editing finishes. | 1124 // The change event will be dispatched when editing finishes. |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 } | 1950 } |
| 1951 | 1951 |
| 1952 void HTMLInputElement::updateValueIfNeeded() | 1952 void HTMLInputElement::updateValueIfNeeded() |
| 1953 { | 1953 { |
| 1954 String newValue = sanitizeValue(m_valueIfDirty); | 1954 String newValue = sanitizeValue(m_valueIfDirty); |
| 1955 if (newValue != m_valueIfDirty) | 1955 if (newValue != m_valueIfDirty) |
| 1956 setValue(newValue); | 1956 setValue(newValue); |
| 1957 } | 1957 } |
| 1958 | 1958 |
| 1959 } // namespace | 1959 } // namespace |
| OLD | NEW |