diff options
Diffstat (limited to 'WebCore/dom/InputElement.h')
-rw-r--r-- | WebCore/dom/InputElement.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/WebCore/dom/InputElement.h b/WebCore/dom/InputElement.h index 7ad3cbd..e0e7110 100644 --- a/WebCore/dom/InputElement.h +++ b/WebCore/dom/InputElement.h @@ -44,17 +44,13 @@ public: virtual bool isSearchField() const = 0; virtual bool isTextField() const = 0; - virtual bool placeholderShouldBeVisible() const = 0; virtual bool searchEventsShouldBeDispatched() const = 0; virtual int size() const = 0; virtual String value() const = 0; virtual void setValue(const String&) = 0; - virtual String placeholder() const = 0; - virtual void setPlaceholder(const String&) = 0; - - virtual String constrainValue(const String&) const = 0; + virtual String sanitizeValue(const String&) const = 0; virtual void setValueFromRenderer(const String&) = 0; virtual void cacheSelection(int start, int end) = 0; @@ -64,15 +60,19 @@ public: static const int s_defaultSize; protected: - static void dispatchFocusEvent(InputElementData&, InputElement*, Element*); - static void dispatchBlurEvent(InputElementData&, InputElement*, Element*); - static void updatePlaceholderVisibility(InputElementData&, InputElement*, Element*, bool placeholderValueChanged = false); + static void dispatchFocusEvent(InputElement*, Element*); + static void dispatchBlurEvent(InputElement*, Element*); static void updateFocusAppearance(InputElementData&, InputElement*, Element*, bool restorePreviousSelection); static void updateSelectionRange(InputElement*, Element*, int start, int end); static void aboutToUnload(InputElement*, Element*); static void setValueFromRenderer(InputElementData&, InputElement*, Element*, const String&); - static String constrainValue(const InputElement*, const String& proposedValue, int maxLength); - static void handleBeforeTextInsertedEvent(InputElementData&, InputElement*, Document*, Event*); + // Replaces CRs and LFs, shrinks the value for s_maximumLength. + // This should be applied to values from the HTML value attribute and the DOM value property. + static String sanitizeValue(const InputElement*, const String&); + // Replaces CRs and LFs, shrinks the value for the specified maximum length. + // This should be applied to values specified by users. + static String sanitizeUserInputValue(const InputElement*, const String&, int); + static void handleBeforeTextInsertedEvent(InputElementData&, InputElement*, Element*, Event*); static void parseSizeAttribute(InputElementData&, Element*, MappedAttribute*); static void parseMaxLengthAttribute(InputElementData&, InputElement*, Element*, MappedAttribute*); static void updateValueIfNeeded(InputElementData&, InputElement*); @@ -85,9 +85,6 @@ class InputElementData { public: InputElementData(); - bool placeholderShouldBeVisible() const { return m_placeholderShouldBeVisible; } - void setPlaceholderShouldBeVisible(bool visible) { m_placeholderShouldBeVisible = visible; } - const AtomicString& name() const; void setName(const AtomicString& value) { m_name = value; } @@ -107,7 +104,6 @@ public: void setCachedSelectionEnd(int value) { m_cachedSelectionEnd = value; } private: - bool m_placeholderShouldBeVisible; AtomicString m_name; String m_value; int m_size; |