示例#1
0
void HTMLFieldSetElement::setNeedsValidityCheck()
{
    // For now unconditionally order style recalculation, which triggers
    // validity recalculation. In the near future, consider implement validity
    // cache and recalculate style only if it changed.
    pseudoStateChanged(CSSSelector::PseudoValid);
    pseudoStateChanged(CSSSelector::PseudoInvalid);
}
void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& value)
{
    if (name == tabindexAttr || name == XMLNames::langAttr)
        return Element::parseAttribute(name, oldValue, value);

    if (name == dirAttr) {
        dirAttributeChanged(value);
    } else if (name == langAttr) {
        pseudoStateChanged(CSSSelector::PseudoLang);
    } else {
        const AtomicString& eventName = eventNameForAttributeName(name);
        if (!eventName.isNull())
            setAttributeEventListener(eventName, createAttributeEventListener(this, name, value, eventParameterName()));
    }
}
示例#3
0
void HTMLTextFormControlElement::updatePlaceholderVisibility()
{
    HTMLElement* placeholder = placeholderElement();
    if (!placeholder) {
        updatePlaceholderText();
        return;
    }

    bool placeHolderWasVisible = isPlaceholderVisible();
    setPlaceholderVisibility(placeholderShouldBeVisible());
    if (placeHolderWasVisible == isPlaceholderVisible())
        return;

    pseudoStateChanged(CSSSelector::PseudoPlaceholderShown);
    placeholder->setInlineStyleProperty(CSSPropertyDisplay, isPlaceholderVisible() ? CSSValueBlock : CSSValueNone, true);
}