diff options
Diffstat (limited to 'Source/WebCore/svg/properties')
3 files changed, 14 insertions, 21 deletions
diff --git a/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h index 8b6dc6992..6be9b1c31 100644 --- a/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h +++ b/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h @@ -66,8 +66,7 @@ public: void detachListWrappers(unsigned newListSize) { - if (m_baseVal) - static_cast<ListProperty*>(m_baseVal.get())->detachListWrappers(newListSize); + ListProperty::detachListWrappersAndResize(&m_wrappers, newListSize); } PropertyType& currentAnimatedValue() diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h index 261a4006a..bbbd45b2e 100644 --- a/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h +++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h @@ -55,18 +55,7 @@ struct SVGSynchronizableAnimatedProperty { void synchronize(SVGElement* ownerElement, const QualifiedName& attrName, const AtomicString& value) { - // If the attribute already exists on the element, we change the - // Attribute directly to avoid a call to Element::attributeChanged - // that could cause the SVGElement to erroneously reset its properties. - // svg/dom/SVGStringList-basics.xhtml exercises this behavior. - ElementAttributeData* attributeData = ownerElement->mutableAttributeData(); - Attribute* old = attributeData->getAttributeItem(attrName); - if (old && value.isNull()) - attributeData->removeAttribute(old->name(), ownerElement); - else if (!old && !value.isNull()) - attributeData->addAttribute(Attribute(attrName, value), ownerElement); - else if (old && !value.isNull()) - old->setValue(value); + ownerElement->setSynchronizedLazyAttribute(attrName, value); } PropertyType value; diff --git a/Source/WebCore/svg/properties/SVGListProperty.h b/Source/WebCore/svg/properties/SVGListProperty.h index aed4ad49e..1587a40ac 100644 --- a/Source/WebCore/svg/properties/SVGListProperty.h +++ b/Source/WebCore/svg/properties/SVGListProperty.h @@ -52,21 +52,26 @@ public: return true; } - void detachListWrappers(unsigned newListSize) + static void detachListWrappersAndResize(ListWrapperCache* wrappers, unsigned newListSize = 0) { - // See SVGPropertyTearOff::detachWrapper() for an explaination what's happening here. - ASSERT(m_wrappers); - unsigned size = m_wrappers->size(); + // See SVGPropertyTearOff::detachWrapper() for an explanation about what's happening here. + ASSERT(wrappers); + unsigned size = wrappers->size(); for (unsigned i = 0; i < size; ++i) { - if (ListItemTearOff* item = m_wrappers->at(i).get()) + if (ListItemTearOff* item = wrappers->at(i).get()) item->detachWrapper(); } // Reinitialize the wrapper cache to be equal to the new values size, after the XML DOM changed the list. if (newListSize) - m_wrappers->fill(0, newListSize); + wrappers->fill(0, newListSize); else - m_wrappers->clear(); + wrappers->clear(); + } + + void detachListWrappers(unsigned newListSize) + { + detachListWrappersAndResize(m_wrappers, newListSize); } void setValuesAndWrappers(PropertyType* values, ListWrapperCache* wrappers, bool shouldOwnValues) |