Home | History | Annotate | Download | only in dom

Lines Matching refs:inputElement

22 #include "InputElement.h"
52 const int InputElement::s_maximumLength = 524288;
53 const int InputElement::s_defaultSize = 20;
55 void InputElement::dispatchFocusEvent(InputElement* inputElement, Element* element)
57 if (!inputElement->isTextField())
61 if (inputElement->isPasswordField() && document->frame())
65 void InputElement::dispatchBlurEvent(InputElement* inputElement, Element* element)
67 if (!inputElement->isTextField())
75 if (inputElement->isPasswordField())
81 void InputElement::updateFocusAppearance(InputElementData& data, InputElement* inputElement, Element* element, bool restorePreviousSelection)
83 ASSERT(inputElement->isTextField());
86 inputElement->select();
89 updateSelectionRange(inputElement, element, data.cachedSelectionStart(), data.cachedSelectionEnd());
96 void InputElement::updateSelectionRange(InputElement* inputElement, Element* element, int start, int end)
98 if (!inputElement->isTextField())
104 void InputElement::aboutToUnload(InputElement* inputElement, Element* element)
106 if (!inputElement->isTextField() || !element->focused())
117 void InputElement::setValueFromRenderer(InputElementData& data, InputElement* inputElement, Element* element, const String& value)
120 ASSERT_UNUSED(inputElement, value == inputElement->sanitizeValue(value) || inputElement->sanitizeValue(value).isEmpty());
133 if (!inputElement->isTextField())
138 static String replaceEOLAndLimitLength(const InputElement* inputElement, const String& proposedValue, int maxLength)
140 if (!inputElement->isTextField())
159 String InputElement::sanitizeValueForTextField(const InputElement* inputElement, const String& proposedValue)
162 InputElementData data = const_cast<InputElement*>(inputElement)->data();
169 return replaceEOLAndLimitLength(inputElement, proposedValue, s_maximumLength);
172 String InputElement::sanitizeUserInputValue(const InputElement* inputElement, const String& proposedValue, int maxLength)
174 return replaceEOLAndLimitLength(inputElement, proposedValue, maxLength);
177 void InputElement::handleBeforeTextInsertedEvent(InputElementData& data, InputElement* inputElement, Element* element, Event* event)
182 // We use RenderTextControlSingleLine::text() instead of InputElement::value()
197 unsigned maxLength = static_cast<unsigned>(inputElement->supportsMaxLength() ? data.maxLength() : s_maximumLength); // maxLength() can never be negative.
209 if (!isConformToInputMask(inputElement->data(), candidateString)) {
214 textEvent->setText(sanitizeUserInputValue(inputElement, textEvent->text(), appendableLength));
217 void InputElement::parseSizeAttribute(InputElementData& data, Element* element, Attribute* attribute)
219 data.setSize(attribute->isNull() ? InputElement::s_defaultSize : attribute->value().toInt());
225 void InputElement::parseMaxLengthAttribute(InputElementData& data, InputElement* inputElement, Element* element, Attribute* attribute)
227 int maxLength = attribute->isNull() ? InputElement::s_maximumLength : attribute->value().toInt();
228 if (maxLength <= 0 || maxLength > InputElement::s_maximumLength)
229 maxLength = InputElement::s_maximumLength;
235 updateValueIfNeeded(data, inputElement);
240 void InputElement::updateValueIfNeeded(InputElementData& data, InputElement* inputElement)
243 String newValue = inputElement->sanitizeValue(oldValue);
245 inputElement->setValue(newValue);
248 void InputElement::notifyFormStateChanged(Element* element)
261 : m_size(InputElement::s_defaultSize)
262 , m_maxLength(InputElement::s_maximumLength)
267 , m_maxInputCharsAllowed(InputElement::s_maximumLength)
305 bool InputElement::isConformToInputMask(const InputElementData& data, const String& inputChars)
313 bool InputElement::isConformToInputMask(const InputElementData& data, UChar inChar, unsigned cursorPosition)
358 String InputElement::validateInputMask(InputElementData& data, String& inputMask)