void SVGAnimateMotionElement::applyResultsToTarget() { // We accumulate to the target element transform list so there is not much to do here. SVGElement* targetElement = this->targetElement(); if (!targetElement) return; if (RenderElement* renderer = targetElement->renderer()) RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); AffineTransform* targetSupplementalTransform = targetElement->supplementalTransform(); if (!targetSupplementalTransform) return; // ...except in case where we have additional instances in <use> trees. for (auto* instance : targetElement->instances()) { AffineTransform* transform = instance->supplementalTransform(); if (!transform || *transform == *targetSupplementalTransform) continue; *transform = *targetSupplementalTransform; if (RenderElement* renderer = instance->renderer()) { renderer->setNeedsTransformUpdate(); RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); } } }
SVGElementAnimatedPropertyList SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName(SVGElement& targetElement, const QualifiedName& attributeName) { SVGElementAnimatedPropertyList result; if (!SVGAnimatedType::supportsAnimVal(m_type)) return result; auto& propertyMap = targetElement.localAttributeToPropertyMap(); auto targetProperties = propertyMap.properties(targetElement, attributeName); if (targetProperties.isEmpty()) return result; result.append(SVGElementAnimatedProperties { &targetElement, WTF::move(targetProperties) }); for (SVGElement* instance : targetElement.instances()) result.append(SVGElementAnimatedProperties { instance, propertyMap.properties(*instance, attributeName) }); #if !ASSERT_DISABLED for (auto& animatedProperties : result) { for (auto& property : animatedProperties.properties) { if (property->animatedPropertyType() != m_type) { ASSERT(m_type == AnimatedAngle); ASSERT(property->animatedPropertyType() == AnimatedEnumeration); } } } #endif return result; }