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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; | 100 const int maxSavedResults = 256; |
101 | 101 |
102 HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document& docum
ent, HTMLFormElement* form, bool createdByParser) | 102 HTMLInputElement::HTMLInputElement(Document& document, HTMLFormElement* form, bo
ol createdByParser) |
103 : HTMLTextFormControlElement(tagName, document, form) | 103 : HTMLTextFormControlElement(inputTag, document, form) |
104 , m_size(defaultSize) | 104 , m_size(defaultSize) |
105 , m_maxLength(maximumLength) | 105 , m_maxLength(maximumLength) |
106 , m_maxResults(-1) | 106 , m_maxResults(-1) |
107 , m_isChecked(false) | 107 , m_isChecked(false) |
108 , m_reflectsCheckedAttribute(true) | 108 , m_reflectsCheckedAttribute(true) |
109 , m_isIndeterminate(false) | 109 , m_isIndeterminate(false) |
110 , m_hasType(false) | 110 , m_hasType(false) |
111 , m_isActivatedSubmit(false) | 111 , m_isActivatedSubmit(false) |
112 , m_autocomplete(Uninitialized) | 112 , m_autocomplete(Uninitialized) |
113 , m_hasNonEmptyList(false) | 113 , m_hasNonEmptyList(false) |
114 , m_stateRestored(false) | 114 , m_stateRestored(false) |
115 , m_parsingInProgress(createdByParser) | 115 , m_parsingInProgress(createdByParser) |
116 , m_valueAttributeWasUpdatedAfterParsing(false) | 116 , m_valueAttributeWasUpdatedAfterParsing(false) |
117 , m_wasModifiedByUser(false) | 117 , m_wasModifiedByUser(false) |
118 , m_canReceiveDroppedFiles(false) | 118 , m_canReceiveDroppedFiles(false) |
119 , m_hasTouchEventHandler(false) | 119 , m_hasTouchEventHandler(false) |
120 , m_inputType(InputType::createText(*this)) | 120 , m_inputType(InputType::createText(*this)) |
121 , m_inputTypeView(m_inputType) | 121 , m_inputTypeView(m_inputType) |
122 { | 122 { |
123 ASSERT(hasTagName(inputTag) || hasTagName(isindexTag)); | |
124 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 123 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
125 setHasCustomStyleCallbacks(); | 124 setHasCustomStyleCallbacks(); |
126 #endif | 125 #endif |
127 ScriptWrappable::init(this); | 126 ScriptWrappable::init(this); |
128 } | 127 } |
129 | 128 |
130 PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagNa
me, Document& document, HTMLFormElement* form, bool createdByParser) | 129 PassRefPtr<HTMLInputElement> HTMLInputElement::create(Document& document, HTMLFo
rmElement* form, bool createdByParser) |
131 { | 130 { |
132 RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(tagNam
e, document, form, createdByParser)); | 131 RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(docume
nt, form, createdByParser)); |
133 inputElement->ensureUserAgentShadowRoot(); | 132 inputElement->ensureUserAgentShadowRoot(); |
134 return inputElement.release(); | 133 return inputElement.release(); |
135 } | 134 } |
136 | 135 |
137 HTMLImageLoader* HTMLInputElement::imageLoader() | 136 HTMLImageLoader* HTMLInputElement::imageLoader() |
138 { | 137 { |
139 if (!m_imageLoader) | 138 if (!m_imageLoader) |
140 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); | 139 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); |
141 return m_imageLoader.get(); | 140 return m_imageLoader.get(); |
142 } | 141 } |
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1859 } | 1858 } |
1860 | 1859 |
1861 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1860 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
1862 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1861 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
1863 { | 1862 { |
1864 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); | 1863 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); |
1865 } | 1864 } |
1866 #endif | 1865 #endif |
1867 | 1866 |
1868 } // namespace | 1867 } // namespace |
OLD | NEW |