| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 Member<HTMLInputElement> m_element; | 91 Member<HTMLInputElement> m_element; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 // FIXME: According to HTML4, the length attribute's value can be arbitrarily | 94 // FIXME: According to HTML4, the length attribute's value can be arbitrarily |
| 95 // large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things | 95 // large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things |
| 96 // get rather sluggish when a text field has a larger number of characters than | 96 // get rather sluggish when a text field has a larger number of characters than |
| 97 // this, even when just clicking in the text field. | 97 // this, even when just clicking in the text field. |
| 98 const int HTMLInputElement::maximumLength = 524288; | 98 const int HTMLInputElement::maximumLength = 524288; |
| 99 const int defaultSize = 20; | 99 const int defaultSize = 20; |
| 100 const int maxSavedResults = 256; | |
| 101 | 100 |
| 102 HTMLInputElement::HTMLInputElement(Document& document, HTMLFormElement* form, bo
ol createdByParser) | 101 HTMLInputElement::HTMLInputElement(Document& document, HTMLFormElement* form, bo
ol createdByParser) |
| 103 : HTMLTextFormControlElement(inputTag, document, form) | 102 : HTMLTextFormControlElement(inputTag, document, form) |
| 104 , m_size(defaultSize) | 103 , m_size(defaultSize) |
| 105 , m_maxLength(maximumLength) | 104 , m_maxLength(maximumLength) |
| 106 , m_minLength(-1) | 105 , m_minLength(-1) |
| 107 , m_maxResults(-1) | |
| 108 , m_isChecked(false) | 106 , m_isChecked(false) |
| 109 , m_dirtyCheckedness(false) | 107 , m_dirtyCheckedness(false) |
| 110 , m_isIndeterminate(false) | 108 , m_isIndeterminate(false) |
| 111 , m_isActivatedSubmit(false) | 109 , m_isActivatedSubmit(false) |
| 112 , m_autocomplete(Uninitialized) | 110 , m_autocomplete(Uninitialized) |
| 113 , m_hasNonEmptyList(false) | 111 , m_hasNonEmptyList(false) |
| 114 , m_stateRestored(false) | 112 , m_stateRestored(false) |
| 115 , m_parsingInProgress(createdByParser) | 113 , m_parsingInProgress(createdByParser) |
| 116 , m_valueAttributeWasUpdatedAfterParsing(false) | 114 , m_valueAttributeWasUpdatedAfterParsing(false) |
| 117 , m_canReceiveDroppedFiles(false) | 115 , m_canReceiveDroppedFiles(false) |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 layoutObject()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(LayoutInvalidationReason::AttributeChanged); | 715 layoutObject()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(LayoutInvalidationReason::AttributeChanged); |
| 718 } else if (name == altAttr) { | 716 } else if (name == altAttr) { |
| 719 m_inputTypeView->altAttributeChanged(); | 717 m_inputTypeView->altAttributeChanged(); |
| 720 } else if (name == srcAttr) { | 718 } else if (name == srcAttr) { |
| 721 m_inputTypeView->srcAttributeChanged(); | 719 m_inputTypeView->srcAttributeChanged(); |
| 722 } else if (name == usemapAttr || name == accesskeyAttr) { | 720 } else if (name == usemapAttr || name == accesskeyAttr) { |
| 723 // FIXME: ignore for the moment | 721 // FIXME: ignore for the moment |
| 724 } else if (name == onsearchAttr) { | 722 } else if (name == onsearchAttr) { |
| 725 // Search field and slider attributes all just cause updateFromElement t
o be called through style recalcing. | 723 // Search field and slider attributes all just cause updateFromElement t
o be called through style recalcing. |
| 726 setAttributeEventListener(EventTypeNames::search, createAttributeEventLi
stener(this, name, value, eventParameterName())); | 724 setAttributeEventListener(EventTypeNames::search, createAttributeEventLi
stener(this, name, value, eventParameterName())); |
| 727 } else if (name == resultsAttr) { | |
| 728 int oldResults = m_maxResults; | |
| 729 m_maxResults = !value.isNull() ? std::min(value.toInt(), maxSavedResults
) : -1; | |
| 730 // FIXME: Detaching just for maxResults change is not ideal. We should
figure out the right | |
| 731 // time to relayout for this change. | |
| 732 if ((m_maxResults < 0) != (oldResults < 0)) | |
| 733 lazyReattachIfAttached(); | |
| 734 Deprecation::countDeprecation(document(), UseCounter::ResultsAttribute); | |
| 735 } else if (name == incrementalAttr) { | 725 } else if (name == incrementalAttr) { |
| 736 UseCounter::count(document(), UseCounter::IncrementalAttribute); | 726 UseCounter::count(document(), UseCounter::IncrementalAttribute); |
| 737 } else if (name == minAttr) { | 727 } else if (name == minAttr) { |
| 738 m_inputTypeView->minOrMaxAttributeChanged(); | 728 m_inputTypeView->minOrMaxAttributeChanged(); |
| 739 m_inputType->sanitizeValueInResponseToMinOrMaxAttributeChange(); | 729 m_inputType->sanitizeValueInResponseToMinOrMaxAttributeChange(); |
| 740 setNeedsValidityCheck(); | 730 setNeedsValidityCheck(); |
| 741 UseCounter::count(document(), UseCounter::MinAttribute); | 731 UseCounter::count(document(), UseCounter::MinAttribute); |
| 742 } else if (name == maxAttr) { | 732 } else if (name == maxAttr) { |
| 743 m_inputTypeView->minOrMaxAttributeChanged(); | 733 m_inputTypeView->minOrMaxAttributeChanged(); |
| 744 m_inputType->sanitizeValueInResponseToMinOrMaxAttributeChange(); | 734 m_inputType->sanitizeValueInResponseToMinOrMaxAttributeChange(); |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 void HTMLInputElement::ensurePrimaryContent() | 1906 void HTMLInputElement::ensurePrimaryContent() |
| 1917 { | 1907 { |
| 1918 m_inputTypeView->ensurePrimaryContent(); | 1908 m_inputTypeView->ensurePrimaryContent(); |
| 1919 } | 1909 } |
| 1920 | 1910 |
| 1921 bool HTMLInputElement::hasFallbackContent() const | 1911 bool HTMLInputElement::hasFallbackContent() const |
| 1922 { | 1912 { |
| 1923 return m_inputTypeView->hasFallbackContent(); | 1913 return m_inputTypeView->hasFallbackContent(); |
| 1924 } | 1914 } |
| 1925 } // namespace blink | 1915 } // namespace blink |
| OLD | NEW |