String InputElement::sanitizeValueForTextField(const InputElement* inputElement, const String& proposedValue) { #if ENABLE(WCSS) InputElementData data = const_cast<InputElement*>(inputElement)->data(); if (!isConformToInputMask(data, proposedValue)) { if (isConformToInputMask(data, data.value())) return data.value(); return String(); } #endif return replaceEOLAndLimitLength(inputElement, proposedValue, s_maximumLength); }
void InputElement::updateValueIfNeeded(InputElementData& data, InputElement* inputElement) { String oldValue = data.value(); String newValue = inputElement->sanitizeValue(oldValue); if (newValue != oldValue) inputElement->setValue(newValue); }
void InputElement::updateValueIfNeeded(InputElementData& data) { String oldValue = data.value(); String newValue = data.inputElement()->constrainValue(oldValue); if (newValue != oldValue) data.inputElement()->setValue(newValue); }