Пример #1
0
FormControlState InputType::saveFormControlState() const
{
    String currentValue = element().value();
    if (currentValue == element().defaultValue())
        return FormControlState();
    return FormControlState(currentValue);
}
Пример #2
0
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;
}
Пример #3
0
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;
}
Пример #4
0
FormControlState BaseMultipleFieldsDateAndTimeInputType::saveFormControlState() const
{
    if (!m_dateTimeEditElement)
        return FormControlState();

    return m_dateTimeEditElement->valueAsDateTimeFieldsState().saveFormControlState();
}
Пример #5
0
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();
}