Beispiel #1
0
bool SVGTests::handleAttributeChange(SVGElement* targetElement, const QualifiedName& attrName)
{
    ASSERT(targetElement);
    if (!isKnownAttribute(attrName))
        return false;
    if (!targetElement->inDocument())
        return true;
    bool valid = targetElement->isValid();
    if (valid && !targetElement->attached())
        targetElement->attach();
    if (!valid && targetElement->attached())
        targetElement->detach();
    return true;
}
bool SVGTests::handleAttributeChange(const SVGElement* targetElement, const QualifiedName& attrName)
{
    if (!isKnownAttribute(attrName))
        return false;
    if (!targetElement->inDocument())
        return false;
    SVGElement* svgElement = const_cast<SVGElement*>(targetElement);
    ASSERT(svgElement);
    bool valid = svgElement->isValid();
    if (valid && !svgElement->attached())
        svgElement->attach();
    if (!valid && svgElement->attached())
        svgElement->detach();
    return true;
}
Beispiel #3
0
void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName)
{
    SVGTextContentElement::svgAttributeChanged(attrName);

    if (attrName == SVGNames::xAttr
        || attrName == SVGNames::yAttr
        || attrName == SVGNames::dxAttr
        || attrName == SVGNames::dyAttr)
        updateRelativeLengthsInformation();

    if (!renderer())
        return;

    if (isKnownAttribute(attrName))
        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
}
bool SVGExternalResourcesRequired::handleAttributeChange(SVGElement* targetElement, const QualifiedName& attrName)
{
    ASSERT(targetElement);
    if (!isKnownAttribute(attrName))
        return false;
    if (!targetElement->inDocument())
        return true;

    // Handle dynamic updates of the 'externalResourcesRequired' attribute. Only possible case: changing from 'true' to 'false'
    // causes an immediate dispatch of the SVGLoad event. If the attribute value was 'false' before inserting the script element
    // in the document, the SVGLoad event has already been dispatched.
    if (!externalResourcesRequiredBaseValue() && !haveFiredLoadEvent() && !isParserInserted()) {
        setHaveFiredLoadEvent(true);
        ASSERT(targetElement->haveLoadedRequiredResources());

        targetElement->sendSVGLoadEventIfPossible();
    }

    return true;
}