| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return willValidate() && m_inputType->hasBadInput(); | 234 return willValidate() && m_inputType->hasBadInput(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 bool HTMLInputElement::patternMismatch() const | 237 bool HTMLInputElement::patternMismatch() const |
| 238 { | 238 { |
| 239 return willValidate() && m_inputType->patternMismatch(value()); | 239 return willValidate() && m_inputType->patternMismatch(value()); |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check)
const | 242 bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check)
const |
| 243 { | 243 { |
| 244 // We use isTextType() instead of supportsMaxLength() because of the | 244 return m_inputType->tooLong(value, check); |
| 245 // 'virtual' overhead. | |
| 246 if (!isTextType()) | |
| 247 return false; | |
| 248 int max = maxLength(); | |
| 249 if (max < 0) | |
| 250 return false; | |
| 251 if (check == CheckDirtyFlag) { | |
| 252 // Return false for the default value or a value set by a script even if | |
| 253 // it is longer than maxLength. | |
| 254 if (!hasDirtyValue() || !lastChangeWasUserEdit()) | |
| 255 return false; | |
| 256 } | |
| 257 return value.length() > static_cast<unsigned>(max); | |
| 258 } | 245 } |
| 259 | 246 |
| 260 bool HTMLInputElement::rangeUnderflow() const | 247 bool HTMLInputElement::rangeUnderflow() const |
| 261 { | 248 { |
| 262 return willValidate() && m_inputType->rangeUnderflow(value()); | 249 return willValidate() && m_inputType->rangeUnderflow(value()); |
| 263 } | 250 } |
| 264 | 251 |
| 265 bool HTMLInputElement::rangeOverflow() const | 252 bool HTMLInputElement::rangeOverflow() const |
| 266 { | 253 { |
| 267 return willValidate() && m_inputType->rangeOverflow(value()); | 254 return willValidate() && m_inputType->rangeOverflow(value()); |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 | 824 |
| 838 setChecked(hasAttribute(checkedAttr)); | 825 setChecked(hasAttribute(checkedAttr)); |
| 839 m_reflectsCheckedAttribute = true; | 826 m_reflectsCheckedAttribute = true; |
| 840 } | 827 } |
| 841 | 828 |
| 842 bool HTMLInputElement::isTextField() const | 829 bool HTMLInputElement::isTextField() const |
| 843 { | 830 { |
| 844 return m_inputType->isTextField(); | 831 return m_inputType->isTextField(); |
| 845 } | 832 } |
| 846 | 833 |
| 847 bool HTMLInputElement::isTextType() const | |
| 848 { | |
| 849 return m_inputType->isTextType(); | |
| 850 } | |
| 851 | |
| 852 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) | 834 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) |
| 853 { | 835 { |
| 854 if (checked() == nowChecked) | 836 if (checked() == nowChecked) |
| 855 return; | 837 return; |
| 856 | 838 |
| 857 RefPtrWillBeRawPtr<HTMLInputElement> protector(this); | 839 RefPtrWillBeRawPtr<HTMLInputElement> protector(this); |
| 858 m_reflectsCheckedAttribute = false; | 840 m_reflectsCheckedAttribute = false; |
| 859 m_isChecked = nowChecked; | 841 m_isChecked = nowChecked; |
| 860 setNeedsStyleRecalc(SubtreeStyleChange); | 842 setNeedsStyleRecalc(SubtreeStyleChange); |
| 861 | 843 |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1558 bool HTMLInputElement::isSteppable() const | 1540 bool HTMLInputElement::isSteppable() const |
| 1559 { | 1541 { |
| 1560 return m_inputType->isSteppable(); | 1542 return m_inputType->isSteppable(); |
| 1561 } | 1543 } |
| 1562 | 1544 |
| 1563 bool HTMLInputElement::isTextButton() const | 1545 bool HTMLInputElement::isTextButton() const |
| 1564 { | 1546 { |
| 1565 return m_inputType->isTextButton(); | 1547 return m_inputType->isTextButton(); |
| 1566 } | 1548 } |
| 1567 | 1549 |
| 1568 bool HTMLInputElement::isText() const | |
| 1569 { | |
| 1570 return m_inputType->isTextType(); | |
| 1571 } | |
| 1572 | |
| 1573 bool HTMLInputElement::isEnumeratable() const | 1550 bool HTMLInputElement::isEnumeratable() const |
| 1574 { | 1551 { |
| 1575 return m_inputType->isEnumeratable(); | 1552 return m_inputType->isEnumeratable(); |
| 1576 } | 1553 } |
| 1577 | 1554 |
| 1578 bool HTMLInputElement::supportLabels() const | 1555 bool HTMLInputElement::supportLabels() const |
| 1579 { | 1556 { |
| 1580 return m_inputType->isInteractiveContent(); | 1557 return m_inputType->isInteractiveContent(); |
| 1581 } | 1558 } |
| 1582 | 1559 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 { | 1794 { |
| 1818 listAttributeTargetChanged(); | 1795 listAttributeTargetChanged(); |
| 1819 } | 1796 } |
| 1820 | 1797 |
| 1821 AXObject* HTMLInputElement::popupRootAXObject() | 1798 AXObject* HTMLInputElement::popupRootAXObject() |
| 1822 { | 1799 { |
| 1823 return m_inputTypeView->popupRootAXObject(); | 1800 return m_inputTypeView->popupRootAXObject(); |
| 1824 } | 1801 } |
| 1825 | 1802 |
| 1826 } // namespace | 1803 } // namespace |
| OLD | NEW |