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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 return m_inputType->convertFromVisibleValue(visibleValue); | 1407 return m_inputType->convertFromVisibleValue(visibleValue); |
1408 } | 1408 } |
1409 | 1409 |
1410 bool HTMLInputElement::isAcceptableValue(const String& proposedValue) const | 1410 bool HTMLInputElement::isAcceptableValue(const String& proposedValue) const |
1411 { | 1411 { |
1412 return m_inputType->isAcceptableValue(proposedValue); | 1412 return m_inputType->isAcceptableValue(proposedValue); |
1413 } | 1413 } |
1414 | 1414 |
1415 String HTMLInputElement::sanitizeValue(const String& proposedValue) const | 1415 String HTMLInputElement::sanitizeValue(const String& proposedValue) const |
1416 { | 1416 { |
| 1417 if (proposedValue.isNull()) |
| 1418 return proposedValue; |
1417 return m_inputType->sanitizeValue(proposedValue); | 1419 return m_inputType->sanitizeValue(proposedValue); |
1418 } | 1420 } |
1419 | 1421 |
1420 bool HTMLInputElement::hasUnacceptableValue() const | 1422 bool HTMLInputElement::hasUnacceptableValue() const |
1421 { | 1423 { |
1422 return m_inputType->hasUnacceptableValue(); | 1424 return m_inputType->hasUnacceptableValue(); |
1423 } | 1425 } |
1424 | 1426 |
1425 bool HTMLInputElement::isInRange() const | 1427 bool HTMLInputElement::isInRange() const |
1426 { | 1428 { |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 m_maxLength = maxLength; | 1950 m_maxLength = maxLength; |
1949 if (oldMaxLength != maxLength) | 1951 if (oldMaxLength != maxLength) |
1950 updateValueIfNeeded(); | 1952 updateValueIfNeeded(); |
1951 setNeedsStyleRecalc(); | 1953 setNeedsStyleRecalc(); |
1952 setNeedsValidityCheck(); | 1954 setNeedsValidityCheck(); |
1953 } | 1955 } |
1954 | 1956 |
1955 void HTMLInputElement::updateValueIfNeeded() | 1957 void HTMLInputElement::updateValueIfNeeded() |
1956 { | 1958 { |
1957 String newValue = sanitizeValue(m_valueIfDirty); | 1959 String newValue = sanitizeValue(m_valueIfDirty); |
| 1960 ASSERT(!m_valueIfDirty.isNull() || newValue.isNull()); |
1958 if (newValue != m_valueIfDirty) | 1961 if (newValue != m_valueIfDirty) |
1959 setValue(newValue); | 1962 setValue(newValue); |
1960 } | 1963 } |
1961 | 1964 |
1962 } // namespace | 1965 } // namespace |
OLD | NEW |