Ejemplo n.º 1
0
void HTMLFormControlElement::parseMappedAttribute(Attribute* attr)
{
    if (attr->name() == disabledAttr) {
        bool oldDisabled = m_disabled;
        m_disabled = !attr->isNull();
        if (oldDisabled != m_disabled) {
            setNeedsStyleRecalc();
            if (renderer() && renderer()->style()->hasAppearance())
                renderer()->theme()->stateChanged(renderer(), EnabledState);
        }
    } else if (attr->name() == readonlyAttr) {
        bool oldReadOnly = m_readOnly;
        m_readOnly = !attr->isNull();
        if (oldReadOnly != m_readOnly) {
            setNeedsStyleRecalc();
            if (renderer() && renderer()->style()->hasAppearance())
                renderer()->theme()->stateChanged(renderer(), ReadOnlyState);
        }
    } else if (attr->name() == requiredAttr) {
        bool oldRequired = m_required;
        m_required = !attr->isNull();
        if (oldRequired != m_required) {
            setNeedsValidityCheck();
            setNeedsStyleRecalc(); // Updates for :required :optional classes.
        }
    } else
        HTMLElement::parseMappedAttribute(attr);
    setNeedsWillValidateCheck();
}
Ejemplo n.º 2
0
void HTMLButtonElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
    if (name == typeAttr) {
        if (equalIgnoringCase(value, "reset"))
            m_type = RESET;
        else if (equalIgnoringCase(value, "button"))
            m_type = BUTTON;
        else
            m_type = SUBMIT;
        setNeedsWillValidateCheck();
    } else
        HTMLFormControlElement::parseAttribute(name, value);
}
Ejemplo n.º 3
0
void HTMLButtonElement::parseAttribute(const QualifiedName& name,
                                       const AtomicString& oldValue,
                                       const AtomicString& value) {
  if (name == typeAttr) {
    if (equalIgnoringCase(value, "reset"))
      m_type = RESET;
    else if (equalIgnoringCase(value, "button"))
      m_type = BUTTON;
    else
      m_type = SUBMIT;
    setNeedsWillValidateCheck();
    if (formOwner() && isConnected())
      formOwner()->invalidateDefaultButtonStyle();
  } else {
    if (name == formactionAttr)
      logUpdateAttributeIfIsolatedWorldAndInDocument("button", formactionAttr,
                                                     oldValue, value);
    HTMLFormControlElement::parseAttribute(name, oldValue, value);
  }
}