diff options
Diffstat (limited to 'WebCore/html/HTMLInputElement.h')
-rw-r--r-- | WebCore/html/HTMLInputElement.h | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h index 410f2e1..7f090a8 100644 --- a/WebCore/html/HTMLInputElement.h +++ b/WebCore/html/HTMLInputElement.h @@ -24,12 +24,14 @@ #ifndef HTMLInputElement_h #define HTMLInputElement_h -#include "HTMLGenericFormElement.h" +#include "HTMLFormControlElement.h" #include <wtf/OwnPtr.h> namespace WebCore { +class FileList; class HTMLImageLoader; +class KURL; class Selection; class HTMLInputElement : public HTMLFormControlElementWithState { @@ -49,6 +51,12 @@ public: SEARCH, RANGE }; + + enum AutoCompleteSetting { + Uninitialized, + On, + Off + }; HTMLInputElement(Document*, HTMLFormElement* = 0); HTMLInputElement(const QualifiedName& tagName, Document*, HTMLFormElement* = 0); @@ -68,7 +76,7 @@ public: virtual const AtomicString& name() const; - bool autoComplete() const { return m_autocomplete; } + bool autoComplete() const; // isChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state virtual bool isChecked() const { return checked() && (inputType() == CHECKBOX || inputType() == RADIO); } @@ -76,11 +84,14 @@ public: bool readOnly() const { return isReadOnlyControl(); } + virtual bool isTextControl() const { return isTextField(); } + bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; } virtual bool isRadioButton() const { return m_type == RADIO; } bool isTextField() const { return m_type == TEXT || m_type == PASSWORD || m_type == SEARCH || m_type == ISINDEX; } bool isSearchField() const { return m_type == SEARCH; } virtual bool isInputTypeHidden() const { return m_type == HIDDEN; } + virtual bool isPasswordField() const { return m_type == PASSWORD; } bool checked() const { return m_checked; } void setChecked(bool, bool sendChangeEvent = false); @@ -97,6 +108,7 @@ public: String valueWithDefault() const; void setValueFromRenderer(const String&); + void setFileListFromRenderer(const Vector<String>&); virtual bool saveState(String& value) const; virtual void restoreState(const String&); @@ -166,7 +178,7 @@ public: void setSize(unsigned); - String src() const; + KURL src() const; void setSrc(const String&); void setMaxLength(int); @@ -176,7 +188,9 @@ public: bool autofilled() const { return m_autofilled; } void setAutofilled(bool b = true) { m_autofilled = b; } - + + FileList* files(); + void cacheSelection(int s, int e) { cachedSelStart = s; cachedSelEnd = e; }; void addSearchResult(); void onSearch(); @@ -185,7 +199,13 @@ public: String constrainValue(const String& proposedValue) const; - virtual void didRestoreFromCache(); + virtual void documentDidBecomeActive(); + + virtual void getSubresourceAttributeStrings(Vector<String>&) const; + + virtual bool willValidate() const; + + bool placeholderShouldBeVisible() const { return m_placeholderShouldBeVisible; } protected: virtual void willMoveToNewOwnerDocument(); @@ -198,7 +218,13 @@ private: bool storesValueSeparateFromAttribute() const; String constrainValue(const String& proposedValue, int maxLen) const; void recheckValue(); + + bool needsActivationCallback(); + void registerForActivationCallbackIfNeeded(); + void unregisterForActivationCallbackIfNeeded(); + void updatePlaceholderVisibility(bool placeholderValueChanged = false); + String m_value; String m_originalValue; int xPos; @@ -210,6 +236,8 @@ private: OwnPtr<HTMLImageLoader> m_imageLoader; + RefPtr<FileList> m_fileList; + unsigned m_type : 4; // InputType bool m_checked : 1; bool m_defaultChecked : 1; @@ -217,9 +245,10 @@ private: bool m_indeterminate : 1; bool m_haveType : 1; bool m_activeSubmit : 1; - bool m_autocomplete : 1; + unsigned m_autocomplete : 2; // AutoCompleteSetting bool m_autofilled : 1; bool m_inited : 1; + bool m_placeholderShouldBeVisible : 1; int cachedSelStart; int cachedSelEnd; |