FormControlState InputType::saveFormControlState() const { String currentValue = element().value(); if (currentValue == element().defaultValue()) return FormControlState(); return FormControlState(currentValue); }
FormControlState SavedFormState::takeControlState(const AtomicString& name, const AtomicString& type) { if (m_stateForNewFormElements.isEmpty()) return FormControlState(); FormElementStateMap::iterator it = m_stateForNewFormElements.find(FormElementKey(name.impl(), type.impl())); if (it == m_stateForNewFormElements.end()) return FormControlState(); ASSERT(it->value.size()); FormControlState state = it->value.takeFirst(); m_controlStateCount--; if (!it->value.size()) m_stateForNewFormElements.remove(it); return state; }
FormControlState FormControlState::deserialize(const Vector<String>& stateVector, size_t& index) { if (index >= stateVector.size()) return FormControlState(TypeFailure); size_t valueSize = stateVector[index++].toUInt(); if (!valueSize) return FormControlState(); if (index + valueSize > stateVector.size()) return FormControlState(TypeFailure); FormControlState state; state.m_values.reserveCapacity(valueSize); for (size_t i = 0; i < valueSize; ++i) state.append(stateVector[index++]); return state; }
FormControlState BaseMultipleFieldsDateAndTimeInputType::saveFormControlState() const { if (!m_dateTimeEditElement) return FormControlState(); return m_dateTimeEditElement->valueAsDateTimeFieldsState().saveFormControlState(); }
FormControlState HTMLTextAreaElement::saveFormControlState() const { return m_isDirty ? FormControlState(value()) : FormControlState(); }
FormControlState PasswordInputType::saveFormControlState() const { // Should never save/restore password fields. ASSERT_NOT_REACHED(); return FormControlState(); }
FormControlState HTMLFormControlElementWithState::saveFormControlState() const { return FormControlState(); }
FormControlState MultipleFieldsTemporalInputTypeView::saveFormControlState() const { if (DateTimeEditElement* edit = dateTimeEditElement()) return edit->valueAsDateTimeFieldsState().saveFormControlState(); return FormControlState(); }