WebKit Bugzilla
Attachment 356733 Details for
Bug 191237
: Remove SVG properties tear-off objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
15-Filters
15-Filters.patch (text/plain), 187.50 KB, created by
Said Abou-Hallawa
on 2018-12-06 08:04:20 PST
(
hide
)
Description:
15-Filters
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-06 08:04:20 PST
Size:
187.50 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e987bb71dbd..4c02c25b9a8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,278 @@ >+2018-12-06 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Remove SVG properties tear-off objects >+ https://bugs.webkit.org/show_bug.cgi?id=191237 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove the SVG tear-off property references from the SVG filters. >+ >+ * svg/SVGComponentTransferFunctionElement.cpp: >+ (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): >+ (WebCore::SVGComponentTransferFunctionElement::parseAttribute): >+ (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): >+ (WebCore::SVGComponentTransferFunctionElement::transferFunction const): >+ (WebCore::SVGComponentTransferFunctionElement::registerAttributes): Deleted. >+ * svg/SVGComponentTransferFunctionElement.h: >+ (WebCore::SVGComponentTransferFunctionElement::type const): >+ (WebCore::SVGComponentTransferFunctionElement::tableValues const): >+ (WebCore::SVGComponentTransferFunctionElement::slope const): >+ (WebCore::SVGComponentTransferFunctionElement::intercept const): >+ (WebCore::SVGComponentTransferFunctionElement::amplitude const): >+ (WebCore::SVGComponentTransferFunctionElement::exponent const): >+ (WebCore::SVGComponentTransferFunctionElement::offset const): >+ (WebCore::SVGComponentTransferFunctionElement::type): >+ (WebCore::SVGComponentTransferFunctionElement::tableValues): >+ (WebCore::SVGComponentTransferFunctionElement::slope): >+ (WebCore::SVGComponentTransferFunctionElement::intercept): >+ (WebCore::SVGComponentTransferFunctionElement::amplitude): >+ (WebCore::SVGComponentTransferFunctionElement::exponent): >+ (WebCore::SVGComponentTransferFunctionElement::offset): >+ (WebCore::SVGComponentTransferFunctionElement::typeAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::slopeAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::interceptAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::exponentAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::offsetAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::attributeRegistry): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): Deleted. >+ * svg/SVGFEBlendElement.cpp: >+ (WebCore::SVGFEBlendElement::SVGFEBlendElement): >+ (WebCore::SVGFEBlendElement::parseAttribute): >+ (WebCore::SVGFEBlendElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEBlendElement::build const): >+ (WebCore::SVGFEBlendElement::registerAttributes): Deleted. >+ (WebCore::SVGFEBlendElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEBlendElement::build): Deleted. >+ * svg/SVGFEBlendElement.h: >+ (WebCore::SVGPropertyTraits<BlendMode>::fromString): >+ * svg/SVGFEColorMatrixElement.cpp: >+ (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): >+ (WebCore::SVGFEColorMatrixElement::parseAttribute): >+ (WebCore::SVGFEColorMatrixElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEColorMatrixElement::build const): >+ (WebCore::SVGFEColorMatrixElement::registerAttributes): Deleted. >+ (WebCore::SVGFEColorMatrixElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEColorMatrixElement::build): Deleted. >+ * svg/SVGFEColorMatrixElement.h: >+ * svg/SVGFEComponentTransferElement.cpp: >+ (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement): >+ (WebCore::SVGFEComponentTransferElement::parseAttribute): >+ (WebCore::SVGFEComponentTransferElement::build const): >+ (WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted. >+ (WebCore::SVGFEComponentTransferElement::build): Deleted. >+ * svg/SVGFEComponentTransferElement.h: >+ * svg/SVGFECompositeElement.cpp: >+ (WebCore::SVGFECompositeElement::SVGFECompositeElement): >+ (WebCore::SVGFECompositeElement::parseAttribute): >+ (WebCore::SVGFECompositeElement::setFilterEffectAttribute const): >+ (WebCore::SVGFECompositeElement::build const): >+ (WebCore::SVGFECompositeElement::registerAttributes): Deleted. >+ (WebCore::SVGFECompositeElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFECompositeElement::build): Deleted. >+ * svg/SVGFECompositeElement.h: >+ * svg/SVGFEConvolveMatrixElement.cpp: >+ (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): >+ (WebCore::SVGFEConvolveMatrixElement::parseAttribute): >+ (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEConvolveMatrixElement::setOrder): >+ (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength): >+ (WebCore::SVGFEConvolveMatrixElement::build const): >+ (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::registerAttributes): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::build): Deleted. >+ * svg/SVGFEConvolveMatrixElement.h: >+ * svg/SVGFEDiffuseLightingElement.cpp: >+ (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement): >+ (WebCore::SVGFEDiffuseLightingElement::parseAttribute): >+ (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEDiffuseLightingElement::build const): >+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::build): Deleted. >+ * svg/SVGFEDiffuseLightingElement.h: >+ * svg/SVGFEDisplacementMapElement.cpp: >+ (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): >+ (WebCore::SVGFEDisplacementMapElement::parseAttribute): >+ (WebCore::SVGFEDisplacementMapElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEDisplacementMapElement::build const): >+ (WebCore::SVGFEDisplacementMapElement::registerAttributes): Deleted. >+ (WebCore::SVGFEDisplacementMapElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEDisplacementMapElement::build): Deleted. >+ * svg/SVGFEDisplacementMapElement.h: >+ * svg/SVGFEDropShadowElement.cpp: >+ (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement): >+ (WebCore::SVGFEDropShadowElement::setStdDeviation): >+ (WebCore::SVGFEDropShadowElement::parseAttribute): >+ (WebCore::SVGFEDropShadowElement::svgAttributeChanged): >+ (WebCore::SVGFEDropShadowElement::build const): >+ (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted. >+ (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted. >+ (WebCore::SVGFEDropShadowElement::registerAttributes): Deleted. >+ (WebCore::SVGFEDropShadowElement::build): Deleted. >+ * svg/SVGFEDropShadowElement.h: >+ * svg/SVGFEFloodElement.cpp: >+ (WebCore::SVGFEFloodElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEFloodElement::build const): >+ (WebCore::SVGFEFloodElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEFloodElement::build): Deleted. >+ * svg/SVGFEFloodElement.h: >+ * svg/SVGFEGaussianBlurElement.cpp: >+ (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement): >+ (WebCore::SVGFEGaussianBlurElement::setStdDeviation): >+ (WebCore::SVGFEGaussianBlurElement::parseAttribute): >+ (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): >+ (WebCore::SVGFEGaussianBlurElement::build const): >+ (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted. >+ (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted. >+ (WebCore::SVGFEGaussianBlurElement::registerAttributes): Deleted. >+ (WebCore::SVGFEGaussianBlurElement::build): Deleted. >+ * svg/SVGFEGaussianBlurElement.h: >+ * svg/SVGFEImageElement.cpp: >+ (WebCore::SVGFEImageElement::SVGFEImageElement): >+ (WebCore::SVGFEImageElement::requestImageResource): >+ (WebCore::SVGFEImageElement::buildPendingResource): >+ (WebCore::SVGFEImageElement::parseAttribute): >+ (WebCore::SVGFEImageElement::build const): >+ (WebCore::SVGFEImageElement::registerAttributes): Deleted. >+ (WebCore::SVGFEImageElement::build): Deleted. >+ * svg/SVGFEImageElement.h: >+ * svg/SVGFELightElement.cpp: >+ (WebCore::SVGFELightElement::SVGFELightElement): >+ (WebCore::SVGFELightElement::parseAttribute): >+ (WebCore::SVGFELightElement::svgAttributeChanged): >+ (WebCore::SVGFELightElement::registerAttributes): Deleted. >+ * svg/SVGFELightElement.h: >+ (WebCore::SVGFELightElement::azimuth const): >+ (WebCore::SVGFELightElement::elevation const): >+ (WebCore::SVGFELightElement::x const): >+ (WebCore::SVGFELightElement::y const): >+ (WebCore::SVGFELightElement::z const): >+ (WebCore::SVGFELightElement::pointsAtX const): >+ (WebCore::SVGFELightElement::pointsAtY const): >+ (WebCore::SVGFELightElement::pointsAtZ const): >+ (WebCore::SVGFELightElement::specularExponent const): >+ (WebCore::SVGFELightElement::limitingConeAngle const): >+ (WebCore::SVGFELightElement::azimuth): >+ (WebCore::SVGFELightElement::elevation): >+ (WebCore::SVGFELightElement::x): >+ (WebCore::SVGFELightElement::y): >+ (WebCore::SVGFELightElement::z): >+ (WebCore::SVGFELightElement::pointsAtX): >+ (WebCore::SVGFELightElement::pointsAtY): >+ (WebCore::SVGFELightElement::pointsAtZ): >+ (WebCore::SVGFELightElement::specularExponent): >+ (WebCore::SVGFELightElement::limitingConeAngle): >+ (WebCore::SVGFELightElement::azimuthAnimated): Deleted. >+ (WebCore::SVGFELightElement::elevationAnimated): Deleted. >+ (WebCore::SVGFELightElement::xAnimated): Deleted. >+ (WebCore::SVGFELightElement::yAnimated): Deleted. >+ (WebCore::SVGFELightElement::zAnimated): Deleted. >+ (WebCore::SVGFELightElement::pointsAtXAnimated): Deleted. >+ (WebCore::SVGFELightElement::pointsAtYAnimated): Deleted. >+ (WebCore::SVGFELightElement::pointsAtZAnimated): Deleted. >+ (WebCore::SVGFELightElement::specularExponentAnimated): Deleted. >+ (WebCore::SVGFELightElement::limitingConeAngleAnimated): Deleted. >+ (WebCore::SVGFELightElement::attributeRegistry): Deleted. >+ (WebCore::SVGFELightElement::isKnownAttribute): Deleted. >+ * svg/SVGFEMergeElement.cpp: >+ (WebCore::SVGFEMergeElement::build const): >+ (WebCore::SVGFEMergeElement::build): Deleted. >+ * svg/SVGFEMergeElement.h: >+ * svg/SVGFEMergeNodeElement.cpp: >+ (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement): >+ (WebCore::SVGFEMergeNodeElement::parseAttribute): >+ (WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted. >+ * svg/SVGFEMergeNodeElement.h: >+ * svg/SVGFEMorphologyElement.cpp: >+ (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement): >+ (WebCore::SVGFEMorphologyElement::setRadius): >+ (WebCore::SVGFEMorphologyElement::parseAttribute): >+ (WebCore::SVGFEMorphologyElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEMorphologyElement::build const): >+ (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted. >+ (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted. >+ (WebCore::SVGFEMorphologyElement::registerAttributes): Deleted. >+ (WebCore::SVGFEMorphologyElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEMorphologyElement::build): Deleted. >+ * svg/SVGFEMorphologyElement.h: >+ * svg/SVGFEOffsetElement.cpp: >+ (WebCore::SVGFEOffsetElement::SVGFEOffsetElement): >+ (WebCore::SVGFEOffsetElement::parseAttribute): >+ (WebCore::SVGFEOffsetElement::svgAttributeChanged): >+ (WebCore::SVGFEOffsetElement::build const): >+ (WebCore::SVGFEOffsetElement::registerAttributes): Deleted. >+ (WebCore::SVGFEOffsetElement::build): Deleted. >+ * svg/SVGFEOffsetElement.h: >+ * svg/SVGFESpecularLightingElement.cpp: >+ (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): >+ (WebCore::SVGFESpecularLightingElement::parseAttribute): >+ (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute const): >+ (WebCore::SVGFESpecularLightingElement::build const): >+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted. >+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted. >+ (WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted. >+ (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFESpecularLightingElement::build): Deleted. >+ * svg/SVGFESpecularLightingElement.h: >+ * svg/SVGFETileElement.cpp: >+ (WebCore::SVGFETileElement::SVGFETileElement): >+ (WebCore::SVGFETileElement::parseAttribute): >+ (WebCore::SVGFETileElement::build const): >+ (WebCore::SVGFETileElement::registerAttributes): Deleted. >+ (WebCore::SVGFETileElement::build): Deleted. >+ * svg/SVGFETileElement.h: >+ * svg/SVGFETurbulenceElement.cpp: >+ (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): >+ (WebCore::SVGFETurbulenceElement::parseAttribute): >+ (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute const): >+ (WebCore::SVGFETurbulenceElement::svgAttributeChanged): >+ (WebCore::SVGFETurbulenceElement::build const): >+ (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted. >+ (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted. >+ (WebCore::SVGFETurbulenceElement::registerAttributes): Deleted. >+ (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFETurbulenceElement::build): Deleted. >+ * svg/SVGFETurbulenceElement.h: >+ * svg/SVGFilterElement.cpp: >+ (WebCore::SVGFilterElement::SVGFilterElement): >+ (WebCore::SVGFilterElement::parseAttribute): >+ (WebCore::SVGFilterElement::svgAttributeChanged): >+ (WebCore::SVGFilterElement::registerAttributes): Deleted. >+ * svg/SVGFilterElement.h: >+ * svg/SVGFilterPrimitiveStandardAttributes.cpp: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute): Deleted. >+ * svg/SVGFilterPrimitiveStandardAttributes.h: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::x const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::y const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::width const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::height const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::result const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::x): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::y): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::width): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::height): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::result): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): Deleted. >+ > 2018-12-05 Said Abou-Hallawa <sabouhallawa@apple.com> > > Remove SVG properties tear-off objects >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >index 4e2032bb217..41296edafd5 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >@@ -24,7 +24,6 @@ > > #include "SVGFEComponentTransferElement.h" > #include "SVGNames.h" >-#include "SVGNumberListValues.h" > #include <wtf/IsoMallocInlines.h> > #include <wtf/NeverDestroyed.h> > >@@ -35,21 +34,16 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGComponentTransferFunctionElement); > SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > { >- registerAttributes(); >-} >- >-void SVGComponentTransferFunctionElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>(); >- registry.registerAttribute<SVGNames::tableValuesAttr, &SVGComponentTransferFunctionElement::m_tableValues>(); >- registry.registerAttribute<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>(); >- registry.registerAttribute<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>(); >- registry.registerAttribute<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>(); >- registry.registerAttribute<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>(); >- registry.registerAttribute<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>(); >+ PropertyRegistry::registerProperty<SVGNames::tableValuesAttr, &SVGComponentTransferFunctionElement::m_tableValues>(); >+ PropertyRegistry::registerProperty<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>(); >+ PropertyRegistry::registerProperty<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>(); >+ PropertyRegistry::registerProperty<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>(); >+ PropertyRegistry::registerProperty<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>(); >+ PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>(); >+ }); > } > > void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -57,40 +51,37 @@ void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na > if (name == SVGNames::typeAttr) { > ComponentTransferType propertyValue = SVGPropertyTraits<ComponentTransferType>::fromString(value); > if (propertyValue > 0) >- m_type.setValue(propertyValue); >+ m_type->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::tableValuesAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_tableValues.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_tableValues.setValue(WTFMove(newList)); >+ m_tableValues->baseVal()->parse(value); > return; > } > > if (name == SVGNames::slopeAttr) { >- m_slope.setValue(value.toFloat()); >+ m_slope->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::interceptAttr) { >- m_intercept.setValue(value.toFloat()); >+ m_intercept->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::amplitudeAttr) { >- m_amplitude.setValue(value.toFloat()); >+ m_amplitude->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::exponentAttr) { >- m_exponent.setValue(value.toFloat()); >+ m_exponent->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::offsetAttr) { >- m_offset.setValue(value.toFloat()); >+ m_offset->setBaseValInternal(value.toFloat()); > return; > } > >@@ -99,7 +90,7 @@ void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na > > void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateFilterPrimitiveParent(this); > return; >@@ -110,15 +101,7 @@ void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam > > ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction() const > { >- return { >- type(), >- slope(), >- intercept(), >- amplitude(), >- exponent(), >- offset(), >- tableValues() >- }; >+ return { type(), slope(), intercept(), amplitude(), exponent(), offset(), tableValues() }; > } > > } >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >index 9f46becdfb4..7cd06f4a0c2 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >@@ -22,9 +22,6 @@ > #pragma once > > #include "FEComponentTransfer.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -75,45 +72,42 @@ class SVGComponentTransferFunctionElement : public SVGElement { > public: > ComponentTransferFunction transferFunction() const; > >- ComponentTransferType type() const { return m_type.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& tableValues() const { return m_tableValues.currentValue(attributeOwnerProxy()); } >- float slope() const { return m_slope.currentValue(attributeOwnerProxy()); } >- float intercept() const { return m_intercept.currentValue(attributeOwnerProxy()); } >- float amplitude() const { return m_amplitude.currentValue(attributeOwnerProxy()); } >- float exponent() const { return m_exponent.currentValue(attributeOwnerProxy()); } >- float offset() const { return m_offset.currentValue(attributeOwnerProxy()); } >+ ComponentTransferType type() const { return m_type->currentValue<ComponentTransferType>(); } >+ const SVGNumberList& tableValues() const { return m_tableValues->currentValue(); } >+ float slope() const { return m_slope->currentValue(); } >+ float intercept() const { return m_intercept->currentValue(); } >+ float amplitude() const { return m_amplitude->currentValue(); } >+ float exponent() const { return m_exponent->currentValue(); } >+ float offset() const { return m_offset->currentValue(); } > >- RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> tableValuesAnimated() { return m_tableValues.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> slopeAnimated() { return m_slope.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> interceptAnimated() { return m_intercept.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> amplitudeAnimated() { return m_amplitude.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> exponentAnimated() { return m_exponent.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedEnumeration>& type() { return m_type; } >+ Ref<SVGAnimatedNumberList>& tableValues() { return m_tableValues; } >+ Ref<SVGAnimatedNumber>& slope() { return m_slope; } >+ Ref<SVGAnimatedNumber>& intercept() { return m_intercept; } >+ Ref<SVGAnimatedNumber>& amplitude() { return m_amplitude; } >+ Ref<SVGAnimatedNumber>& exponent() { return m_exponent; } >+ Ref<SVGAnimatedNumber>& offset() { return m_offset; } > > protected: > SVGComponentTransferFunctionElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGComponentTransferFunctionElement, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGComponentTransferFunctionElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > > bool rendererIsNeeded(const RenderStyle&) override { return false; } > > private: >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedEnumerationAttribute<ComponentTransferType> m_type { FECOMPONENTTRANSFER_TYPE_IDENTITY }; >- SVGAnimatedNumberListAttribute m_tableValues; >- SVGAnimatedNumberAttribute m_slope { 1 }; >- SVGAnimatedNumberAttribute m_intercept; >- SVGAnimatedNumberAttribute m_amplitude { 1 }; >- SVGAnimatedNumberAttribute m_exponent { 1 }; >- SVGAnimatedNumberAttribute m_offset; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, FECOMPONENTTRANSFER_TYPE_IDENTITY) }; >+ Ref<SVGAnimatedNumberList> m_tableValues { SVGAnimatedNumberList::create(this) }; >+ Ref<SVGAnimatedNumber> m_slope { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_intercept { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_amplitude { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_exponent { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEBlendElement.cpp b/Source/WebCore/svg/SVGFEBlendElement.cpp >index 8c66d2c2216..683b9d7816e 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.cpp >+++ b/Source/WebCore/svg/SVGFEBlendElement.cpp >@@ -37,7 +37,13 @@ inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Docume > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feBlendTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEBlendElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::in2Attr, &SVGFEBlendElement::m_in2>(); >+ PropertyRegistry::registerProperty<SVGNames::modeAttr, BlendMode, &SVGFEBlendElement::m_mode>(); >+ }); > } > > Ref<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, Document& document) >@@ -45,39 +51,29 @@ Ref<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGFEBlendElement(tagName, document)); > } > >-void SVGFEBlendElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEBlendElement::m_in1>(); >- registry.registerAttribute<SVGNames::in2Attr, &SVGFEBlendElement::m_in2>(); >- registry.registerAttribute<SVGNames::modeAttr, BlendMode, &SVGFEBlendElement::m_mode>(); >-} >- > void SVGFEBlendElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::modeAttr) { > BlendMode mode = BlendMode::Normal; > if (parseBlendMode(value, mode)) >- m_mode.setValue(mode); >+ m_mode->setBaseValInternal(mode); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::in2Attr) { >- m_in2.setValue(value); >+ m_in2->setBaseValInternal(value); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEBlend* blend = static_cast<FEBlend*>(effect); > if (attrName == SVGNames::modeAttr) >@@ -104,7 +100,7 @@ void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > auto input2 = filterBuilder->getEffectById(in2()); >diff --git a/Source/WebCore/svg/SVGFEBlendElement.h b/Source/WebCore/svg/SVGFEBlendElement.h >index d67baffcaa9..1199acad86d 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.h >+++ b/Source/WebCore/svg/SVGFEBlendElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "GraphicsTypes.h" >-#include "SVGAnimatedEnumeration.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -31,7 +30,13 @@ namespace WebCore { > template<> > struct SVGPropertyTraits<BlendMode> { > static unsigned highestEnumValue() { return static_cast<unsigned>(BlendMode::Luminosity); } >- >+ static BlendMode fromString(const String& string) >+ { >+ BlendMode mode = BlendMode::Normal; >+ parseBlendMode(string, mode); >+ return mode; >+ } >+ > static String toString(BlendMode type) > { > if (type < BlendMode::PlusDarker) >@@ -46,33 +51,30 @@ class SVGFEBlendElement final : public SVGFilterPrimitiveStandardAttributes { > public: > static Ref<SVGFEBlendElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- String in2() const { return m_in2.currentValue(attributeOwnerProxy()); } >- BlendMode mode() const { return m_mode.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ String in2() const { return m_in2->currentValue(); } >+ BlendMode mode() const { return m_mode->currentValue<BlendMode>(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> modeAnimated() { return m_mode.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedString>& in2() { return m_in2; } >+ Ref<SVGAnimatedEnumeration>& mode() { return m_mode; } > > private: > SVGFEBlendElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEBlendElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEBlendElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedStringAttribute m_in2; >- SVGAnimatedEnumerationAttribute<BlendMode> m_mode { BlendMode::Normal }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedString> m_in2 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_mode { SVGAnimatedEnumeration::create(this, BlendMode::Normal) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >index 515d32ffbcd..48828c0d48b 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >@@ -35,7 +35,13 @@ inline SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tag > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feColorMatrixTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEColorMatrixElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::typeAttr, ColorMatrixType, &SVGFEColorMatrixElement::m_type>(); >+ PropertyRegistry::registerProperty<SVGNames::valuesAttr, &SVGFEColorMatrixElement::m_values>(); >+ }); > } > > Ref<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName& tagName, Document& document) >@@ -43,42 +49,29 @@ Ref<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName > return adoptRef(*new SVGFEColorMatrixElement(tagName, document)); > } > >-void SVGFEColorMatrixElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEColorMatrixElement::m_in1>(); >- registry.registerAttribute<SVGNames::typeAttr, ColorMatrixType, &SVGFEColorMatrixElement::m_type>(); >- registry.registerAttribute<SVGNames::valuesAttr, &SVGFEColorMatrixElement::m_values>(); >-} >- > void SVGFEColorMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::typeAttr) { > auto propertyValue = SVGPropertyTraits<ColorMatrixType>::fromString(value); > if (propertyValue > 0) >- m_type.setValue(propertyValue); >+ m_type->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::valuesAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_values.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_values.setValue(WTFMove(newList)); >+ m_values->baseVal()->parse(value); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEColorMatrix* colorMatrix = static_cast<FEColorMatrix*>(effect); > if (attrName == SVGNames::typeAttr) >@@ -107,7 +100,7 @@ void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >@@ -134,13 +127,14 @@ RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuil > break; > } > } else { >- filterValues = values(); >- unsigned size = filterValues.size(); >+ unsigned size = values().size(); > > if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20) > || (filterType == FECOLORMATRIX_TYPE_HUEROTATE && size != 1) > || (filterType == FECOLORMATRIX_TYPE_SATURATE && size != 1)) > return nullptr; >+ >+ filterValues = values(); > } > > RefPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filterValues); >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.h b/Source/WebCore/svg/SVGFEColorMatrixElement.h >index 47688ec869d..00654b23ab1 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.h >@@ -22,8 +22,6 @@ > #pragma once > > #include "FEColorMatrix.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -70,33 +68,30 @@ class SVGFEColorMatrixElement final : public SVGFilterPrimitiveStandardAttribute > public: > static Ref<SVGFEColorMatrixElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- ColorMatrixType type() const { return m_type.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& values() const { return m_values.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ ColorMatrixType type() const { return m_type->currentValue<ColorMatrixType>(); } >+ const SVGNumberList& values() const { return m_values->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> valuesAnimated() { return m_values.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedEnumeration>& type() { return m_type; } >+ Ref<SVGAnimatedNumberList>& values() { return m_values; } > > private: > SVGFEColorMatrixElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEColorMatrixElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEColorMatrixElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedEnumerationAttribute<ColorMatrixType> m_type { FECOLORMATRIX_TYPE_MATRIX }; >- SVGAnimatedNumberListAttribute m_values; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, FECOLORMATRIX_TYPE_MATRIX) }; >+ Ref<SVGAnimatedNumberList> m_values { SVGAnimatedNumberList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >index 57faf3b4630..5b71dc87809 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >@@ -40,7 +40,11 @@ inline SVGFEComponentTransferElement::SVGFEComponentTransferElement(const Qualif > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feComponentTransferTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEComponentTransferElement::m_in1>(); >+ }); > } > > Ref<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document& document) >@@ -48,25 +52,17 @@ Ref<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const Q > return adoptRef(*new SVGFEComponentTransferElement(tagName, document)); > } > >-void SVGFEComponentTransferElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEComponentTransferElement::m_in1>(); >-} >- > void SVGFEComponentTransferElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.h b/Source/WebCore/svg/SVGFEComponentTransferElement.h >index bd62b3481c5..0eff451ce23 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.h >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.h >@@ -30,24 +30,22 @@ class SVGFEComponentTransferElement final : public SVGFilterPrimitiveStandardAtt > public: > static Ref<SVGFEComponentTransferElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } > > private: > SVGFEComponentTransferElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > // FIXME: svgAttributeChanged missing. >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFECompositeElement.cpp b/Source/WebCore/svg/SVGFECompositeElement.cpp >index a10e3a721cf..a36e62f8365 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.cpp >+++ b/Source/WebCore/svg/SVGFECompositeElement.cpp >@@ -35,7 +35,17 @@ inline SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feCompositeTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFECompositeElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>(); >+ PropertyRegistry::registerProperty<SVGNames::operatorAttr, CompositeOperationType, &SVGFECompositeElement::m_svgOperator>(); >+ PropertyRegistry::registerProperty<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>(); >+ PropertyRegistry::registerProperty<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>(); >+ PropertyRegistry::registerProperty<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>(); >+ PropertyRegistry::registerProperty<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>(); >+ }); > } > > Ref<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& tagName, Document& document) >@@ -43,63 +53,49 @@ Ref<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& ta > return adoptRef(*new SVGFECompositeElement(tagName, document)); > } > >-void SVGFECompositeElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFECompositeElement::m_in1>(); >- registry.registerAttribute<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>(); >- registry.registerAttribute<SVGNames::operatorAttr, CompositeOperationType, &SVGFECompositeElement::m_svgOperator>(); >- registry.registerAttribute<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>(); >- registry.registerAttribute<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>(); >- registry.registerAttribute<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>(); >- registry.registerAttribute<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>(); >-} >- > void SVGFECompositeElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::operatorAttr) { > CompositeOperationType propertyValue = SVGPropertyTraits<CompositeOperationType>::fromString(value); > if (propertyValue > 0) >- m_svgOperator.setValue(propertyValue); >+ m_svgOperator->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::in2Attr) { >- m_in2.setValue(value); >+ m_in2->setBaseValInternal(value); > return; > } > > if (name == SVGNames::k1Attr) { >- m_k1.setValue(value.toFloat()); >+ m_k1->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::k2Attr) { >- m_k2.setValue(value.toFloat()); >+ m_k2->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::k3Attr) { >- m_k3.setValue(value.toFloat()); >+ m_k3->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::k4Attr) { >- m_k4.setValue(value.toFloat()); >+ m_k4->setBaseValInternal(value.toFloat()); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEComposite* composite = static_cast<FEComposite*>(effect); > if (attrName == SVGNames::operatorAttr) >@@ -135,7 +131,7 @@ void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > auto input2 = filterBuilder->getEffectById(in2()); >diff --git a/Source/WebCore/svg/SVGFECompositeElement.h b/Source/WebCore/svg/SVGFECompositeElement.h >index a123cc6a714..b7c2dc22019 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.h >+++ b/Source/WebCore/svg/SVGFECompositeElement.h >@@ -22,8 +22,6 @@ > #pragma once > > #include "FEComposite.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -85,45 +83,42 @@ class SVGFECompositeElement final : public SVGFilterPrimitiveStandardAttributes > public: > static Ref<SVGFECompositeElement> create(const QualifiedName&, Document&); > >- String in1() { return m_in1.currentValue(attributeOwnerProxy()); } >- String in2() { return m_in2.currentValue(attributeOwnerProxy()); } >- CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); } >- float k1() const { return m_k1.currentValue(attributeOwnerProxy()); } >- float k2() const { return m_k2.currentValue(attributeOwnerProxy()); } >- float k3() const { return m_k3.currentValue(attributeOwnerProxy()); } >- float k4() const { return m_k4.currentValue(attributeOwnerProxy()); } >- >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k1Animated() { return m_k1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k2Animated() { return m_k2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k3Animated() { return m_k3.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k4Animated() { return m_k4.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ String in2() const { return m_in2->currentValue(); } >+ CompositeOperationType svgOperator() const { return m_svgOperator->currentValue<CompositeOperationType>(); } >+ float k1() const { return m_k1->currentValue(); } >+ float k2() const { return m_k2->currentValue(); } >+ float k3() const { return m_k3->currentValue(); } >+ float k4() const { return m_k4->currentValue(); } >+ >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedString>& in2() { return m_in2; } >+ Ref<SVGAnimatedEnumeration>& svgOperator() { return m_svgOperator; } >+ Ref<SVGAnimatedNumber>& k1() { return m_k1; } >+ Ref<SVGAnimatedNumber>& k2() { return m_k2; } >+ Ref<SVGAnimatedNumber>& k3() { return m_k3; } >+ Ref<SVGAnimatedNumber>& k4() { return m_k4; } > > private: > SVGFECompositeElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFECompositeElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFECompositeElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedStringAttribute m_in2; >- SVGAnimatedEnumerationAttribute<CompositeOperationType> m_svgOperator { FECOMPOSITE_OPERATOR_OVER }; >- SVGAnimatedNumberAttribute m_k1; >- SVGAnimatedNumberAttribute m_k2; >- SVGAnimatedNumberAttribute m_k3; >- SVGAnimatedNumberAttribute m_k4; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedString> m_in2 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_svgOperator { SVGAnimatedEnumeration::create(this, FECOMPOSITE_OPERATOR_OVER) }; >+ Ref<SVGAnimatedNumber> m_k1 { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_k2 { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_k3 { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_k4 { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >index e63b3237a55..5f8c64c5249 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >@@ -27,7 +27,6 @@ > #include "IntSize.h" > #include "SVGFilterBuilder.h" > #include "SVGNames.h" >-#include "SVGNumberListValues.h" > #include "SVGParserUtilities.h" > #include <wtf/IsoMallocInlines.h> > >@@ -39,7 +38,20 @@ inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedNam > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feConvolveMatrixTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::orderAttr, &SVGFEConvolveMatrixElement::m_orderX, &SVGFEConvolveMatrixElement::m_orderY>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>(); >+ PropertyRegistry::registerProperty<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>(); >+ PropertyRegistry::registerProperty<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>(); >+ PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); >+ PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); >+ PropertyRegistry::registerProperty<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>(); >+ PropertyRegistry::registerProperty<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>(); >+ }); > } > > Ref<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const QualifiedName& tagName, Document& document) >@@ -47,63 +59,18 @@ Ref<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const Qualifi > return adoptRef(*new SVGFEConvolveMatrixElement(tagName, document)); > } > >-const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEConvolveMatrixElement::orderXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGOrderX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEConvolveMatrixElement::orderYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGOrderY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFEConvolveMatrixElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>(); >- registry.registerAttribute<SVGNames::orderAttr, >- &SVGFEConvolveMatrixElement::orderXIdentifier, &SVGFEConvolveMatrixElement::m_orderX, >- &SVGFEConvolveMatrixElement::orderYIdentifier, &SVGFEConvolveMatrixElement::m_orderY>(); >- registry.registerAttribute<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>(); >- registry.registerAttribute<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>(); >- registry.registerAttribute<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>(); >- registry.registerAttribute<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); >- registry.registerAttribute<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); >- registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>(); >- registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >- &SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, >- &SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>(); >- registry.registerAttribute<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>(); >-} >- > void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::orderAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y) && x >= 1 && y >= 1) { >- m_orderX.setValue(x); >- m_orderY.setValue(y); >+ m_orderX->setBaseValInternal(x); >+ m_orderY->setBaseValInternal(y); > } else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing order=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -112,49 +79,46 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const > if (name == SVGNames::edgeModeAttr) { > EdgeModeType propertyValue = SVGPropertyTraits<EdgeModeType>::fromString(value); > if (propertyValue > 0) >- m_edgeMode.setValue(propertyValue); >+ m_edgeMode->setBaseValInternal(propertyValue); > else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing edgeMode=\"" + value + "\". Filtered element will not be displayed."); > return; > } > > if (name == SVGNames::kernelMatrixAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_kernelMatrix.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_kernelMatrix.setValue(WTFMove(newList)); >+ m_kernelMatrix->baseVal()->parse(value); > return; > } > > if (name == SVGNames::divisorAttr) { > float divisor = value.toFloat(); > if (divisor) >- m_divisor.setValue(divisor); >+ m_divisor->setBaseValInternal(divisor); > else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing divisor=\"" + value + "\". Filtered element will not be displayed."); > return; > } > > if (name == SVGNames::biasAttr) { >- m_bias.setValue(value.toFloat()); >+ m_bias->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::targetXAttr) { >- m_targetX.setValue(value.string().toUIntStrict()); >+ m_targetX->setBaseValInternal(value.string().toUIntStrict()); > return; > } > > if (name == SVGNames::targetYAttr) { >- m_targetY.setValue(value.string().toUIntStrict()); >+ m_targetY->setBaseValInternal(value.string().toUIntStrict()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y) && x > 0 && y > 0) { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > } else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing kernelUnitLength=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -162,9 +126,9 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const > > if (name == SVGNames::preserveAlphaAttr) { > if (value == "true") >- m_preserveAlpha.setValue(true); >+ m_preserveAlpha->setBaseValInternal(true); > else if (value == "false") >- m_preserveAlpha.setValue(false); >+ m_preserveAlpha->setBaseValInternal(false); > else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing preserveAlphaAttr=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -173,7 +137,7 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEConvolveMatrix* convolveMatrix = static_cast<FEConvolveMatrix*>(effect); > if (attrName == SVGNames::edgeModeAttr) >@@ -197,15 +161,15 @@ bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, > > void SVGFEConvolveMatrixElement::setOrder(float x, float y) > { >- m_orderX.setValue(x); >- m_orderY.setValue(y); >+ m_orderX->setBaseValInternal(x); >+ m_orderY->setBaseValInternal(y); > invalidate(); > } > > void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y) > { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > invalidate(); > } > >@@ -226,7 +190,7 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >@@ -243,7 +207,7 @@ RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterB > if (orderXValue < 1 || orderYValue < 1) > return nullptr; > auto& kernelMatrix = this->kernelMatrix(); >- int kernelMatrixSize = kernelMatrix.size(); >+ int kernelMatrixSize = kernelMatrix.items().size(); > // The spec says this is a requirement, and should bail out if fails > if (orderXValue * orderYValue != kernelMatrixSize) > return nullptr; >@@ -276,7 +240,7 @@ RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterB > return nullptr; > if (!hasAttribute(SVGNames::divisorAttr)) { > for (int i = 0; i < kernelMatrixSize; ++i) >- divisorValue += kernelMatrix.at(i); >+ divisorValue += kernelMatrix.items()[i]->value(); > if (!divisorValue) > divisorValue = 1; > } >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >index 6f731749a32..88e2aea03ed 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >@@ -21,11 +21,6 @@ > #pragma once > > #include "FEConvolveMatrix.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -72,65 +67,57 @@ public: > void setOrder(float orderX, float orderY); > void setKernelUnitLength(float kernelUnitLengthX, float kernelUnitLengthY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- int orderX() const { return m_orderX.currentValue(attributeOwnerProxy()); } >- int orderY() const { return m_orderY.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& kernelMatrix() const { return m_kernelMatrix.currentValue(attributeOwnerProxy()); } >- float divisor() const { return m_divisor.currentValue(attributeOwnerProxy()); } >- float bias() const { return m_bias.currentValue(attributeOwnerProxy()); } >- int targetX() const { return m_targetX.currentValue(attributeOwnerProxy()); } >- int targetY() const { return m_targetY.currentValue(attributeOwnerProxy()); } >- EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } >- bool preserveAlpha() const { return m_preserveAlpha.currentValue(attributeOwnerProxy()); } >- >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> orderXAnimated() { return m_orderX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> orderYAnimated() { return m_orderY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> kernelMatrixAnimated() { return m_kernelMatrix.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> divisorAnimated() { return m_divisor.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> biasAnimated() { return m_bias.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> targetXAnimated() { return m_targetX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> targetYAnimated() { return m_targetY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedBoolean> preserveAlphaAnimated() { return m_preserveAlpha.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ int orderX() const { return m_orderX->currentValue(); } >+ int orderY() const { return m_orderY->currentValue(); } >+ const SVGNumberList& kernelMatrix() const { return m_kernelMatrix->currentValue(); } >+ float divisor() const { return m_divisor->currentValue(); } >+ float bias() const { return m_bias->currentValue(); } >+ int targetX() const { return m_targetX->currentValue(); } >+ int targetY() const { return m_targetY->currentValue(); } >+ EdgeModeType edgeMode() const { return m_edgeMode->currentValue<EdgeModeType>(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); } >+ bool preserveAlpha() const { return m_preserveAlpha->currentValue(); } >+ >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedInteger>& orderX() { return m_orderX; } >+ Ref<SVGAnimatedInteger>& orderY() { return m_orderY; } >+ Ref<SVGAnimatedNumberList>& kernelMatrix() { return m_kernelMatrix; } >+ Ref<SVGAnimatedNumber>& divisor() { return m_divisor; } >+ Ref<SVGAnimatedNumber>& bias() { return m_bias; } >+ Ref<SVGAnimatedInteger>& targetX() { return m_targetX; } >+ Ref<SVGAnimatedInteger>& targetY() { return m_targetY; } >+ Ref<SVGAnimatedEnumeration>& edgeMode() { return m_edgeMode; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthX() { return m_kernelUnitLengthX; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthY() { return m_kernelUnitLengthY; } >+ Ref<SVGAnimatedBoolean>& preserveAlpha() { return m_preserveAlpha; } > > private: > SVGFEConvolveMatrixElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- >- static const AtomicString& orderXIdentifier(); >- static const AtomicString& orderYIdentifier(); >- static const AtomicString& kernelUnitLengthXIdentifier(); >- static const AtomicString& kernelUnitLengthYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedIntegerAttribute m_orderX; >- SVGAnimatedIntegerAttribute m_orderY; >- SVGAnimatedNumberListAttribute m_kernelMatrix; >- SVGAnimatedNumberAttribute m_divisor; >- SVGAnimatedNumberAttribute m_bias; >- SVGAnimatedIntegerAttribute m_targetX; >- SVGAnimatedIntegerAttribute m_targetY; >- SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_DUPLICATE }; >- SVGAnimatedNumberAttribute m_kernelUnitLengthX; >- SVGAnimatedNumberAttribute m_kernelUnitLengthY; >- SVGAnimatedBooleanAttribute m_preserveAlpha; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedInteger> m_orderX { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedInteger> m_orderY { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedNumberList> m_kernelMatrix { SVGAnimatedNumberList::create(this) }; >+ Ref<SVGAnimatedNumber> m_divisor { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_bias { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedInteger> m_targetX { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedInteger> m_targetY { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_edgeMode { SVGAnimatedEnumeration::create(this, EDGEMODE_DUPLICATE) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedBoolean> m_preserveAlpha { SVGAnimatedBoolean::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >index b9b023ac006..b61b50a0281 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >@@ -38,7 +38,14 @@ inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedN > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feDiffuseLightingTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEDiffuseLightingElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>(); >+ PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>(); >+ }); > } > > Ref<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const QualifiedName& tagName, Document& document) >@@ -46,53 +53,28 @@ Ref<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const Quali > return adoptRef(*new SVGFEDiffuseLightingElement(tagName, document)); > } > >-const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFEDiffuseLightingElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEDiffuseLightingElement::m_in1>(); >- registry.registerAttribute<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>(); >- registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>(); >- registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >- &SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX, >- &SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>(); >-} >- > void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::surfaceScaleAttr) { >- m_surfaceScale.setValue(value.toFloat()); >+ m_surfaceScale->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::diffuseConstantAttr) { >- m_diffuseConstant.setValue(value.toFloat()); >+ m_diffuseConstant->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > } > return; > } >@@ -100,7 +82,7 @@ void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, cons > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect); > >@@ -170,7 +152,7 @@ void SVGFEDiffuseLightingElement::lightElementAttributeChanged(const SVGFELightE > primitiveAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.h b/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >index 0b8ae8b01ef..ee78ceea99c 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >@@ -36,42 +36,36 @@ public: > static Ref<SVGFEDiffuseLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float diffuseConstant() const { return m_diffuseConstant.currentValue(attributeOwnerProxy()); } >- float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float diffuseConstant() const { return m_diffuseConstant->currentValue(); } >+ float surfaceScale() const { return m_surfaceScale->currentValue(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> diffuseConstantAnimated() { return m_diffuseConstant.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& diffuseConstant() { return m_diffuseConstant; } >+ Ref<SVGAnimatedNumber>& surfaceScale() { return m_surfaceScale; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthX() { return m_kernelUnitLengthX; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthY() { return m_kernelUnitLengthY; } > > private: > SVGFEDiffuseLightingElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDiffuseLightingElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDiffuseLightingElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& kernelUnitLengthXIdentifier(); >- static const AtomicString& kernelUnitLengthYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_diffuseConstant { 1 }; >- SVGAnimatedNumberAttribute m_surfaceScale { 1 }; >- SVGAnimatedNumberAttribute m_kernelUnitLengthX; >- SVGAnimatedNumberAttribute m_kernelUnitLengthY; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_diffuseConstant { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >index 435fc701df6..59ddcaa72ff 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >@@ -34,7 +34,15 @@ inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedN > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feDisplacementMapTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEDisplacementMapElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::in2Attr, &SVGFEDisplacementMapElement::m_in2>(); >+ PropertyRegistry::registerProperty<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>(); >+ PropertyRegistry::registerProperty<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>(); >+ PropertyRegistry::registerProperty<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>(); >+ }); > } > > Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document& document) >@@ -42,53 +50,41 @@ Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const Quali > return adoptRef(*new SVGFEDisplacementMapElement(tagName, document)); > } > >-void SVGFEDisplacementMapElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEDisplacementMapElement::m_in1>(); >- registry.registerAttribute<SVGNames::in2Attr, &SVGFEDisplacementMapElement::m_in2>(); >- registry.registerAttribute<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>(); >- registry.registerAttribute<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>(); >- registry.registerAttribute<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>(); >-} >- > void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::xChannelSelectorAttr) { > auto propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value); > if (propertyValue > 0) >- m_xChannelSelector.setValue(propertyValue); >+ m_xChannelSelector->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::yChannelSelectorAttr) { > auto propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value); > if (propertyValue > 0) >- m_yChannelSelector.setValue(propertyValue); >+ m_yChannelSelector->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::in2Attr) { >- m_in2.setValue(value); >+ m_in2->setBaseValInternal(value); > return; > } > > if (name == SVGNames::scaleAttr) { >- m_scale.setValue(value.toFloat()); >+ m_scale->setBaseValInternal(value.toFloat()); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect); > if (attrName == SVGNames::xChannelSelectorAttr) >@@ -119,7 +115,7 @@ void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > auto input2 = filterBuilder->getEffectById(in2()); >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.h b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >index 51bed53df66..43b8b40c050 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.h >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >@@ -21,8 +21,6 @@ > #pragma once > > #include "FEDisplacementMap.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -71,39 +69,36 @@ public: > > static ChannelSelectorType stringToChannel(const String&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- String in2() const { return m_in2.currentValue(attributeOwnerProxy()); } >- ChannelSelectorType xChannelSelector() const { return m_xChannelSelector.currentValue(attributeOwnerProxy()); } >- ChannelSelectorType yChannelSelector() const { return m_yChannelSelector.currentValue(attributeOwnerProxy()); } >- float scale() const { return m_scale.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ String in2() const { return m_in2->currentValue(); } >+ ChannelSelectorType xChannelSelector() const { return m_xChannelSelector->currentValue<ChannelSelectorType>(); } >+ ChannelSelectorType yChannelSelector() const { return m_yChannelSelector->currentValue<ChannelSelectorType>(); } >+ float scale() const { return m_scale->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> xChannelSelectorAnimated() { return m_xChannelSelector.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> yChannelSelectorAnimated() { return m_yChannelSelector.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> scaleAnimated() { return m_scale.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedString>& in2() { return m_in2; } >+ Ref<SVGAnimatedEnumeration>& xChannelSelector() { return m_xChannelSelector; } >+ Ref<SVGAnimatedEnumeration>& yChannelSelector() { return m_yChannelSelector; } >+ Ref<SVGAnimatedNumber>& scale() { return m_scale; } > > private: > SVGFEDisplacementMapElement(const QualifiedName& tagName, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedStringAttribute m_in2; >- SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_xChannelSelector { CHANNEL_A }; >- SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_yChannelSelector { CHANNEL_A }; >- SVGAnimatedNumberAttribute m_scale; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedString> m_in2 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_xChannelSelector { SVGAnimatedEnumeration::create(this, CHANNEL_A) }; >+ Ref<SVGAnimatedEnumeration> m_yChannelSelector { SVGAnimatedEnumeration::create(this, CHANNEL_A) }; >+ Ref<SVGAnimatedNumber> m_scale { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >index 550f65e2743..8f8df493b76 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.cpp >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >@@ -36,7 +36,14 @@ inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagNa > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feDropShadowTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>(); >+ PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>(); >+ PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEDropShadowElement::m_stdDeviationX, &SVGFEDropShadowElement::m_stdDeviationY>(); >+ }); > } > > Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& tagName, Document& document) >@@ -44,61 +51,36 @@ Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& > return adoptRef(*new SVGFEDropShadowElement(tagName, document)); > } > >-const AtomicString& SVGFEDropShadowElement::stdDeviationXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEDropShadowElement::stdDeviationYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > void SVGFEDropShadowElement::setStdDeviation(float x, float y) > { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > invalidate(); > } > >-void SVGFEDropShadowElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>(); >- registry.registerAttribute<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>(); >- registry.registerAttribute<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>(); >- registry.registerAttribute<SVGNames::stdDeviationAttr, >- &SVGFEDropShadowElement::stdDeviationXIdentifier, &SVGFEDropShadowElement::m_stdDeviationX, >- &SVGFEDropShadowElement::stdDeviationYIdentifier, &SVGFEDropShadowElement::m_stdDeviationY>(); >-} >- > void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::stdDeviationAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > } > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::dxAttr) { >- m_dx.setValue(value.toFloat()); >+ m_dx->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::dyAttr) { >- m_dy.setValue(value.toFloat()); >+ m_dy->setBaseValInternal(value.toFloat()); > return; > } > >@@ -107,7 +89,7 @@ void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const Ato > > void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >@@ -116,7 +98,7 @@ void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > RenderObject* renderer = this->renderer(); > if (!renderer) >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.h b/Source/WebCore/svg/SVGFEDropShadowElement.h >index 366219e02c6..48a7caf3e71 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.h >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.h >@@ -21,7 +21,6 @@ > #pragma once > > #include "FEDropShadow.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -33,41 +32,35 @@ public: > > void setStdDeviation(float stdDeviationX, float stdDeviationY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float dx() const { return m_dx.currentValue(attributeOwnerProxy()); } >- float dy() const { return m_dy.currentValue(attributeOwnerProxy()); } >- float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); } >- float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float dx() const { return m_dx->currentValue(); } >+ float dy() const { return m_dy->currentValue(); } >+ float stdDeviationX() const { return m_stdDeviationX->currentValue(); } >+ float stdDeviationY() const { return m_stdDeviationY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& dx() { return m_dx; } >+ Ref<SVGAnimatedNumber>& dy() { return m_dy; } >+ Ref<SVGAnimatedNumber>& stdDeviationX() { return m_stdDeviationX; } >+ Ref<SVGAnimatedNumber>& stdDeviationY() { return m_stdDeviationY; } > > private: > SVGFEDropShadowElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& stdDeviationXIdentifier(); >- static const AtomicString& stdDeviationYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_dx { 2 }; >- SVGAnimatedNumberAttribute m_dy { 2 }; >- SVGAnimatedNumberAttribute m_stdDeviationX { 2 }; >- SVGAnimatedNumberAttribute m_stdDeviationY { 2 }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this, 2) }; >+ Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this, 2) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this, 2) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this, 2) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEFloodElement.cpp b/Source/WebCore/svg/SVGFEFloodElement.cpp >index cfe642a332f..041ef9561b6 100644 >--- a/Source/WebCore/svg/SVGFEFloodElement.cpp >+++ b/Source/WebCore/svg/SVGFEFloodElement.cpp >@@ -42,7 +42,7 @@ Ref<SVGFEFloodElement> SVGFEFloodElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGFEFloodElement(tagName, document)); > } > >-bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > RenderObject* renderer = this->renderer(); > ASSERT(renderer); >@@ -58,7 +58,7 @@ bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const Qua > return false; > } > >-RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) >+RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) const > { > RenderObject* renderer = this->renderer(); > if (!renderer) >diff --git a/Source/WebCore/svg/SVGFEFloodElement.h b/Source/WebCore/svg/SVGFEFloodElement.h >index 6447ffc4719..4710cca9a6e 100644 >--- a/Source/WebCore/svg/SVGFEFloodElement.h >+++ b/Source/WebCore/svg/SVGFEFloodElement.h >@@ -32,8 +32,8 @@ public: > private: > SVGFEFloodElement(const QualifiedName&, Document&); > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >index 933187e6d04..e80e208b39b 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >@@ -36,7 +36,13 @@ inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& t > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feGaussianBlurTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEGaussianBlurElement::m_stdDeviationX, &SVGFEGaussianBlurElement::m_stdDeviationY>(); >+ PropertyRegistry::registerProperty<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>(); >+ }); > } > > Ref<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedName& tagName, Document& document) >@@ -44,57 +50,33 @@ Ref<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedNa > return adoptRef(*new SVGFEGaussianBlurElement(tagName, document)); > } > >-const AtomicString& SVGFEGaussianBlurElement::stdDeviationXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEGaussianBlurElement::stdDeviationYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > void SVGFEGaussianBlurElement::setStdDeviation(float x, float y) > { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > invalidate(); > } > >-void SVGFEGaussianBlurElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>(); >- registry.registerAttribute<SVGNames::stdDeviationAttr, >- &SVGFEGaussianBlurElement::stdDeviationXIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationX, >- &SVGFEGaussianBlurElement::stdDeviationYIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationY>(); >- registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>(); >-} >- > void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::stdDeviationAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > } > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::edgeModeAttr) { > auto propertyValue = SVGPropertyTraits<EdgeModeType>::fromString(value); > if (propertyValue > 0) >- m_edgeMode.setValue(propertyValue); >+ m_edgeMode->setBaseValInternal(propertyValue); > else > document().accessSVGExtensions().reportWarning("feGaussianBlur: problem parsing edgeMode=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -105,7 +87,7 @@ void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const A > > void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >@@ -114,7 +96,7 @@ void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.h b/Source/WebCore/svg/SVGFEGaussianBlurElement.h >index 93b61aca46a..a6afc4da2bd 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.h >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.h >@@ -22,8 +22,6 @@ > #pragma once > > #include "FEGaussianBlur.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFEConvolveMatrixElement.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > >@@ -36,38 +34,32 @@ public: > > void setStdDeviation(float stdDeviationX, float stdDeviationY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); } >- float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); } >- EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float stdDeviationX() const { return m_stdDeviationX->currentValue(); } >+ float stdDeviationY() const { return m_stdDeviationY->currentValue(); } >+ EdgeModeType edgeMode() const { return m_edgeMode->currentValue<EdgeModeType>(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& stdDeviationX() { return m_stdDeviationX; } >+ Ref<SVGAnimatedNumber>& stdDeviationY() { return m_stdDeviationY; } >+ Ref<SVGAnimatedEnumeration>& edgeMode() { return m_edgeMode; } > > private: > SVGFEGaussianBlurElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEGaussianBlurElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEGaussianBlurElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& stdDeviationXIdentifier(); >- static const AtomicString& stdDeviationYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_stdDeviationX; >- SVGAnimatedNumberAttribute m_stdDeviationY; >- SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_NONE }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_edgeMode { SVGAnimatedEnumeration::create(this, EDGEMODE_NONE) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEImageElement.cpp b/Source/WebCore/svg/SVGFEImageElement.cpp >index 65cfde1de77..92c9340e5c3 100644 >--- a/Source/WebCore/svg/SVGFEImageElement.cpp >+++ b/Source/WebCore/svg/SVGFEImageElement.cpp >@@ -44,7 +44,11 @@ inline SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Docume > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::feImageTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>(); >+ }); > } > > Ref<SVGFEImageElement> SVGFEImageElement::create(const QualifiedName& tagName, Document& document) >@@ -80,7 +84,8 @@ void SVGFEImageElement::requestImageResource() > ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions(); > options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck; > >- CachedResourceRequest request(ResourceRequest(document().completeURL(href())), options); >+ String href = this->href()->currentValue(); >+ CachedResourceRequest request(ResourceRequest(document().completeURL(href)), options); > request.setInitiator(*this); > m_cachedImage = document().cachedResourceLoader().requestImage(WTFMove(request)).value_or(nullptr); > >@@ -94,7 +99,8 @@ void SVGFEImageElement::buildPendingResource() > if (!isConnected()) > return; > >- auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); > if (!target.element) { > if (target.identifier.isEmpty()) > requestImageResource(); >@@ -111,20 +117,12 @@ void SVGFEImageElement::buildPendingResource() > invalidate(); > } > >-void SVGFEImageElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>(); >-} >- > void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::preserveAspectRatioAttr) { > SVGPreserveAspectRatioValue preserveAspectRatio; > preserveAspectRatio.parse(value); >- m_preserveAspectRatio.setValue(preserveAspectRatio); >+ m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); > return; > } > >@@ -185,7 +183,7 @@ void SVGFEImageElement::notifyFinished(CachedResource&) > RenderSVGResource::markForLayoutAndParentResourceInvalidation(*parentRenderer); > } > >-RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) >+RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) const > { > if (m_cachedImage) > return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(renderer()), preserveAspectRatio()); >diff --git a/Source/WebCore/svg/SVGFEImageElement.h b/Source/WebCore/svg/SVGFEImageElement.h >index 6c4fd6350b9..8cc89d48b37 100644 >--- a/Source/WebCore/svg/SVGFEImageElement.h >+++ b/Source/WebCore/svg/SVGFEImageElement.h >@@ -23,8 +23,6 @@ > > #include "CachedImageClient.h" > #include "CachedResourceHandle.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedPreserveAspectRatio.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFEImage.h" > #include "SVGFilterPrimitiveStandardAttributes.h" >@@ -41,18 +39,15 @@ public: > > bool hasSingleSecurityOrigin() const; > >- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); } >+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } >+ Ref<SVGAnimatedPreserveAspectRatio>& preserveAspectRatio() { return m_preserveAspectRatio; } > > private: > SVGFEImageElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -61,7 +56,7 @@ private: > > void didFinishInsertingNode() override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > > void clearResourceReferences(); > void requestImageResource(); >@@ -70,8 +65,8 @@ private: > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) override; > void removedFromAncestor(RemovalType, ContainerNode&) override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) }; > CachedResourceHandle<CachedImage> m_cachedImage; > }; > >diff --git a/Source/WebCore/svg/SVGFELightElement.cpp b/Source/WebCore/svg/SVGFELightElement.cpp >index 891fedd98d5..97c02b0fe0e 100644 >--- a/Source/WebCore/svg/SVGFELightElement.cpp >+++ b/Source/WebCore/svg/SVGFELightElement.cpp >@@ -43,7 +43,19 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFELightElement); > SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>(); >+ PropertyRegistry::registerProperty<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>(); >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFELightElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFELightElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::zAttr, &SVGFELightElement::m_z>(); >+ PropertyRegistry::registerProperty<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>(); >+ PropertyRegistry::registerProperty<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>(); >+ PropertyRegistry::registerProperty<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>(); >+ PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>(); >+ PropertyRegistry::registerProperty<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>(); >+ }); > } > > SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement) >@@ -55,72 +67,55 @@ SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElem > return nullptr; > } > >-void SVGFELightElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>(); >- registry.registerAttribute<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>(); >- registry.registerAttribute<SVGNames::xAttr, &SVGFELightElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGFELightElement::m_y>(); >- registry.registerAttribute<SVGNames::zAttr, &SVGFELightElement::m_z>(); >- registry.registerAttribute<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>(); >- registry.registerAttribute<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>(); >- registry.registerAttribute<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>(); >- registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>(); >- registry.registerAttribute<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>(); >-} >- > void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::azimuthAttr) { >- m_azimuth.setValue(value.toFloat()); >+ m_azimuth->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::elevationAttr) { >- m_elevation.setValue(value.toFloat()); >+ m_elevation->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::xAttr) { >- m_x.setValue(value.toFloat()); >+ m_x->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::yAttr) { >- m_y.setValue(value.toFloat()); >+ m_y->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::zAttr) { >- m_z.setValue(value.toFloat()); >+ m_z->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::pointsAtXAttr) { >- m_pointsAtX.setValue(value.toFloat()); >+ m_pointsAtX->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::pointsAtYAttr) { >- m_pointsAtY.setValue(value.toFloat()); >+ m_pointsAtY->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::pointsAtZAttr) { >- m_pointsAtZ.setValue(value.toFloat()); >+ m_pointsAtZ->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::specularExponentAttr) { >- m_specularExponent.setValue(value.toFloat()); >+ m_specularExponent->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::limitingConeAngleAttr) { >- m_limitingConeAngle.setValue(value.toFloat()); >+ m_limitingConeAngle->setBaseValInternal(value.toFloat()); > return; > } > >@@ -129,7 +124,7 @@ void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicSt > > void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > auto parent = makeRefPtr(parentElement()); > if (!parent) > return; >diff --git a/Source/WebCore/svg/SVGFELightElement.h b/Source/WebCore/svg/SVGFELightElement.h >index 84a678ffb0e..13d2c4818d0 100644 >--- a/Source/WebCore/svg/SVGFELightElement.h >+++ b/Source/WebCore/svg/SVGFELightElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "LightSource.h" >-#include "SVGAnimatedNumber.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -36,27 +35,27 @@ public: > virtual Ref<LightSource> lightSource(SVGFilterBuilder&) const = 0; > static SVGFELightElement* findLightElement(const SVGElement*); > >- float azimuth() const { return m_azimuth.currentValue(attributeOwnerProxy()); } >- float elevation() const { return m_elevation.currentValue(attributeOwnerProxy()); } >- float x() const { return m_x.currentValue(attributeOwnerProxy()); } >- float y() const { return m_y.currentValue(attributeOwnerProxy()); } >- float z() const { return m_z.currentValue(attributeOwnerProxy()); } >- float pointsAtX() const { return m_pointsAtX.currentValue(attributeOwnerProxy()); } >- float pointsAtY() const { return m_pointsAtY.currentValue(attributeOwnerProxy()); } >- float pointsAtZ() const { return m_pointsAtZ.currentValue(attributeOwnerProxy()); } >- float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); } >- float limitingConeAngle() const { return m_limitingConeAngle.currentValue(attributeOwnerProxy()); } >+ float azimuth() const { return m_azimuth->currentValue(); } >+ float elevation() const { return m_elevation->currentValue(); } >+ float x() const { return m_x->currentValue(); } >+ float y() const { return m_y->currentValue(); } >+ float z() const { return m_z->currentValue(); } >+ float pointsAtX() const { return m_pointsAtX->currentValue(); } >+ float pointsAtY() const { return m_pointsAtY->currentValue(); } >+ float pointsAtZ() const { return m_pointsAtZ->currentValue(); } >+ float specularExponent() const { return m_specularExponent->currentValue(); } >+ float limitingConeAngle() const { return m_limitingConeAngle->currentValue(); } > >- RefPtr<SVGAnimatedNumber> azimuthAnimated() { return m_azimuth.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> elevationAnimated() { return m_elevation.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> zAnimated() { return m_z.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> pointsAtXAnimated() { return m_pointsAtX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> pointsAtYAnimated() { return m_pointsAtY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> pointsAtZAnimated() { return m_pointsAtZ.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> limitingConeAngleAnimated() { return m_limitingConeAngle.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedNumber>& azimuth() { return m_azimuth; } >+ Ref<SVGAnimatedNumber>& elevation() { return m_elevation; } >+ Ref<SVGAnimatedNumber>& x() { return m_x; } >+ Ref<SVGAnimatedNumber>& y() { return m_y; } >+ Ref<SVGAnimatedNumber>& z() { return m_z; } >+ Ref<SVGAnimatedNumber>& pointsAtX() { return m_pointsAtX; } >+ Ref<SVGAnimatedNumber>& pointsAtY() { return m_pointsAtY; } >+ Ref<SVGAnimatedNumber>& pointsAtZ() { return m_pointsAtZ; } >+ Ref<SVGAnimatedNumber>& specularExponent() { return m_specularExponent; } >+ Ref<SVGAnimatedNumber>& limitingConeAngle() { return m_limitingConeAngle; } > > protected: > SVGFELightElement(const QualifiedName&, Document&); >@@ -64,27 +63,24 @@ protected: > bool rendererIsNeeded(const RenderStyle&) override { return false; } > > private: >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFELightElement, SVGElement>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedNumberAttribute m_azimuth; >- SVGAnimatedNumberAttribute m_elevation; >- SVGAnimatedNumberAttribute m_x; >- SVGAnimatedNumberAttribute m_y; >- SVGAnimatedNumberAttribute m_z; >- SVGAnimatedNumberAttribute m_pointsAtX; >- SVGAnimatedNumberAttribute m_pointsAtY; >- SVGAnimatedNumberAttribute m_pointsAtZ; >- SVGAnimatedNumberAttribute m_specularExponent { 1 }; >- SVGAnimatedNumberAttribute m_limitingConeAngle; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedNumber> m_azimuth { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_elevation { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_x { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_y { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_z { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_pointsAtX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_pointsAtY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_pointsAtZ { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_limitingConeAngle { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEMergeElement.cpp b/Source/WebCore/svg/SVGFEMergeElement.cpp >index 502a99193c8..62285f70655 100644 >--- a/Source/WebCore/svg/SVGFEMergeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeElement.cpp >@@ -44,7 +44,7 @@ Ref<SVGFEMergeElement> SVGFEMergeElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGFEMergeElement(tagName, document)); > } > >-RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > RefPtr<FilterEffect> effect = FEMerge::create(filter); > FilterEffectVector& mergeInputs = effect->inputEffects(); >diff --git a/Source/WebCore/svg/SVGFEMergeElement.h b/Source/WebCore/svg/SVGFEMergeElement.h >index 3e42a748daa..8433c9a481e 100644 >--- a/Source/WebCore/svg/SVGFEMergeElement.h >+++ b/Source/WebCore/svg/SVGFEMergeElement.h >@@ -32,7 +32,7 @@ public: > private: > SVGFEMergeElement(const QualifiedName&, Document&); > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >index 69cdef0a52b..ae802c286dd 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >@@ -36,7 +36,11 @@ inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName > : SVGElement(tagName, document) > { > ASSERT(hasTagName(SVGNames::feMergeNodeTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEMergeNodeElement::m_in1>(); >+ }); > } > > Ref<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& tagName, Document& document) >@@ -44,18 +48,10 @@ Ref<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& ta > return adoptRef(*new SVGFEMergeNodeElement(tagName, document)); > } > >-void SVGFEMergeNodeElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEMergeNodeElement::m_in1>(); >-} >- > void SVGFEMergeNodeElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.h b/Source/WebCore/svg/SVGFEMergeNodeElement.h >index 9c554ee1125..8deb1d978b3 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.h >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -31,25 +30,22 @@ class SVGFEMergeNodeElement final : public SVGElement { > public: > static Ref<SVGFEMergeNodeElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } > > private: > SVGFEMergeNodeElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEMergeNodeElement, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeNodeElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.cpp b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >index fcbc63b62e6..796e351cbf8 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.cpp >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >@@ -35,7 +35,13 @@ inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagNa > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feMorphologyTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::operatorAttr, MorphologyOperatorType, &SVGFEMorphologyElement::m_svgOperator>(); >+ PropertyRegistry::registerProperty<SVGNames::radiusAttr, &SVGFEMorphologyElement::m_radiusX, &SVGFEMorphologyElement::m_radiusY>(); >+ }); > } > > Ref<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& tagName, Document& document) >@@ -43,56 +49,32 @@ Ref<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& > return adoptRef(*new SVGFEMorphologyElement(tagName, document)); > } > >-const AtomicString& SVGFEMorphologyElement::radiusXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGRadiusX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEMorphologyElement::radiusYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGRadiusY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > void SVGFEMorphologyElement::setRadius(float x, float y) > { >- m_radiusX.setValue(x); >- m_radiusY.setValue(y); >+ m_radiusX->setBaseValInternal(x); >+ m_radiusY->setBaseValInternal(y); > invalidate(); > } > >-void SVGFEMorphologyElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>(); >- registry.registerAttribute<SVGNames::operatorAttr, MorphologyOperatorType, &SVGFEMorphologyElement::m_svgOperator>(); >- registry.registerAttribute<SVGNames::radiusAttr, >- &SVGFEMorphologyElement::radiusXIdentifier, &SVGFEMorphologyElement::m_radiusX, >- &SVGFEMorphologyElement::radiusYIdentifier, &SVGFEMorphologyElement::m_radiusY>(); >-} >- > void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::operatorAttr) { > MorphologyOperatorType propertyValue = SVGPropertyTraits<MorphologyOperatorType>::fromString(value); > if (propertyValue > 0) >- m_svgOperator.setValue(propertyValue); >+ m_svgOperator->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::radiusAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_radiusX.setValue(x); >- m_radiusY.setValue(y); >+ m_radiusX->setBaseValInternal(x); >+ m_radiusY->setBaseValInternal(y); > } > return; > } >@@ -100,7 +82,7 @@ void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const Ato > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEMorphology* morphology = static_cast<FEMorphology*>(effect); > if (attrName == SVGNames::operatorAttr) >@@ -133,7 +115,7 @@ void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > float xRadius = radiusX(); >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.h b/Source/WebCore/svg/SVGFEMorphologyElement.h >index af6f15e8f73..aeaa5caf46e 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.h >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.h >@@ -21,8 +21,6 @@ > #pragma once > > #include "FEMorphology.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -63,39 +61,33 @@ public: > > void setRadius(float radiusX, float radiusY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- MorphologyOperatorType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); } >- float radiusX() const { return m_radiusX.currentValue(attributeOwnerProxy()); } >- float radiusY() const { return m_radiusY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ MorphologyOperatorType svgOperator() const { return m_svgOperator->currentValue<MorphologyOperatorType>(); } >+ float radiusX() const { return m_radiusX->currentValue(); } >+ float radiusY() const { return m_radiusY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> radiusXAnimated() { return m_radiusX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> radiusYAnimated() { return m_radiusY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedEnumeration>& svgOperator() { return m_svgOperator; } >+ Ref<SVGAnimatedNumber>& radiusX() { return m_radiusX; } >+ Ref<SVGAnimatedNumber>& radiusY() { return m_radiusY; } > > private: > SVGFEMorphologyElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& radiusXIdentifier(); >- static const AtomicString& radiusYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedEnumerationAttribute<MorphologyOperatorType> m_svgOperator { FEMORPHOLOGY_OPERATOR_ERODE }; >- SVGAnimatedNumberAttribute m_radiusX; >- SVGAnimatedNumberAttribute m_radiusY; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_svgOperator { SVGAnimatedEnumeration::create(this, FEMORPHOLOGY_OPERATOR_ERODE) }; >+ Ref<SVGAnimatedNumber> m_radiusX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_radiusY { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.cpp b/Source/WebCore/svg/SVGFEOffsetElement.cpp >index 28236984f41..54bb1414658 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.cpp >+++ b/Source/WebCore/svg/SVGFEOffsetElement.cpp >@@ -36,7 +36,13 @@ inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Docu > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feOffsetTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>(); >+ PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>(); >+ }); > } > > Ref<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document) >@@ -44,30 +50,20 @@ Ref<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, > return adoptRef(*new SVGFEOffsetElement(tagName, document)); > } > >-void SVGFEOffsetElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>(); >- registry.registerAttribute<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>(); >- registry.registerAttribute<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>(); >-} >- > void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::dxAttr) { >- m_dx.setValue(value.toFloat()); >+ m_dx->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::dyAttr) { >- m_dy.setValue(value.toFloat()); >+ m_dy->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > >@@ -76,7 +72,7 @@ void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicS > > void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >@@ -85,7 +81,7 @@ void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.h b/Source/WebCore/svg/SVGFEOffsetElement.h >index bdb0e4f0b8f..61be10f1b72 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.h >+++ b/Source/WebCore/svg/SVGFEOffsetElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -31,32 +30,29 @@ class SVGFEOffsetElement final : public SVGFilterPrimitiveStandardAttributes { > public: > static Ref<SVGFEOffsetElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float dx() const { return m_dx.currentValue(attributeOwnerProxy()); } >- float dy() const { return m_dy.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float dx() const { return m_dx->currentValue(); } >+ float dy() const { return m_dy->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& dx() { return m_dx; } >+ Ref<SVGAnimatedNumber>& dy() { return m_dy; } > > private: > SVGFEOffsetElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEOffsetElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEOffsetElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_dx; >- SVGAnimatedNumberAttribute m_dy; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >index 3a2f4d23f97..9ed808bd98a 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >@@ -39,7 +39,15 @@ inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const Qualifie > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feSpecularLightingTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>(); >+ PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>(); >+ PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFESpecularLightingElement::m_kernelUnitLengthX, &SVGFESpecularLightingElement::m_kernelUnitLengthY>(); >+ }); > } > > Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document& document) >@@ -47,59 +55,33 @@ Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const Qua > return adoptRef(*new SVGFESpecularLightingElement(tagName, document)); > } > >-const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFESpecularLightingElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>(); >- registry.registerAttribute<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>(); >- registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>(); >- registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>(); >- registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >- &SVGFESpecularLightingElement::kernelUnitLengthXIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthX, >- &SVGFESpecularLightingElement::kernelUnitLengthYIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthY>(); >-} >- > void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::surfaceScaleAttr) { >- m_surfaceScale.setValue(value.toFloat()); >+ m_surfaceScale->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::specularConstantAttr) { >- m_specularConstant.setValue(value.toFloat()); >+ m_specularConstant->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::specularExponentAttr) { >- m_specularExponent.setValue(value.toFloat()); >+ m_specularExponent->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > } > return; > } >@@ -107,7 +89,7 @@ void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, con > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effect); > >@@ -179,7 +161,7 @@ void SVGFESpecularLightingElement::lightElementAttributeChanged(const SVGFELight > primitiveAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.h b/Source/WebCore/svg/SVGFESpecularLightingElement.h >index 7cedaf8599b..0482f0436f6 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.h >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "FESpecularLighting.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFELightElement.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > >@@ -35,45 +34,39 @@ public: > static Ref<SVGFESpecularLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float specularConstant() const { return m_specularConstant.currentValue(attributeOwnerProxy()); } >- float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); } >- float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float specularConstant() const { return m_specularConstant->currentValue(); } >+ float specularExponent() const { return m_specularExponent->currentValue(); } >+ float surfaceScale() const { return m_surfaceScale->currentValue(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> specularConstantAnimated() { return m_specularConstant.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& specularConstant() { return m_specularConstant; } >+ Ref<SVGAnimatedNumber>& specularExponent() { return m_specularExponent; } >+ Ref<SVGAnimatedNumber>& surfaceScale() { return m_surfaceScale; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthX() { return m_kernelUnitLengthX; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthY() { return m_kernelUnitLengthY; } > > private: > SVGFESpecularLightingElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFESpecularLightingElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFESpecularLightingElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& kernelUnitLengthXIdentifier(); >- static const AtomicString& kernelUnitLengthYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_specularConstant { 1 }; >- SVGAnimatedNumberAttribute m_specularExponent { 1 }; >- SVGAnimatedNumberAttribute m_surfaceScale { 1 }; >- SVGAnimatedNumberAttribute m_kernelUnitLengthX; >- SVGAnimatedNumberAttribute m_kernelUnitLengthY; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_specularConstant { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFETileElement.cpp b/Source/WebCore/svg/SVGFETileElement.cpp >index 3f3879d7e66..2fb5029cd90 100644 >--- a/Source/WebCore/svg/SVGFETileElement.cpp >+++ b/Source/WebCore/svg/SVGFETileElement.cpp >@@ -37,7 +37,11 @@ inline SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feTileTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFETileElement::m_in1>(); >+ }); > } > > Ref<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Document& document) >@@ -45,18 +49,10 @@ Ref<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGFETileElement(tagName, document)); > } > >-void SVGFETileElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFETileElement::m_in1>(); >-} >- > void SVGFETileElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > >@@ -74,7 +70,7 @@ void SVGFETileElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFETileElement.h b/Source/WebCore/svg/SVGFETileElement.h >index 754df40991e..5ebe246699b 100644 >--- a/Source/WebCore/svg/SVGFETileElement.h >+++ b/Source/WebCore/svg/SVGFETileElement.h >@@ -30,25 +30,22 @@ class SVGFETileElement final : public SVGFilterPrimitiveStandardAttributes { > public: > static Ref<SVGFETileElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } > > private: > SVGFETileElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFETileElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETileElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.cpp b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >index 6b76b847935..3f08d45c103 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.cpp >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >@@ -34,7 +34,15 @@ inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagNa > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feTurbulenceTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::baseFrequencyAttr, &SVGFETurbulenceElement::m_baseFrequencyX, &SVGFETurbulenceElement::m_baseFrequencyY>(); >+ PropertyRegistry::registerProperty<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); >+ PropertyRegistry::registerProperty<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); >+ PropertyRegistry::registerProperty<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); >+ PropertyRegistry::registerProperty<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>(); >+ }); > } > > Ref<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& tagName, Document& document) >@@ -42,71 +50,45 @@ Ref<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& > return adoptRef(*new SVGFETurbulenceElement(tagName, document)); > } > >-const AtomicString& SVGFETurbulenceElement::baseFrequencyXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFETurbulenceElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::baseFrequencyAttr, >- &SVGFETurbulenceElement::baseFrequencyXIdentifier, &SVGFETurbulenceElement::m_baseFrequencyX, >- &SVGFETurbulenceElement::baseFrequencyYIdentifier, &SVGFETurbulenceElement::m_baseFrequencyY>(); >- registry.registerAttribute<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); >- registry.registerAttribute<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); >- registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); >- registry.registerAttribute<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>(); >-} >- > void SVGFETurbulenceElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::typeAttr) { > TurbulenceType propertyValue = SVGPropertyTraits<TurbulenceType>::fromString(value); > if (propertyValue != TurbulenceType::Unknown) >- m_type.setValue(propertyValue); >+ m_type->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::stitchTilesAttr) { > SVGStitchOptions propertyValue = SVGPropertyTraits<SVGStitchOptions>::fromString(value); > if (propertyValue > 0) >- m_stitchTiles.setValue(propertyValue); >+ m_stitchTiles->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::baseFrequencyAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_baseFrequencyX.setValue(x); >- m_baseFrequencyY.setValue(y); >+ m_baseFrequencyX->setBaseValInternal(x); >+ m_baseFrequencyY->setBaseValInternal(y); > } > return; > } > > if (name == SVGNames::seedAttr) { >- m_seed.setValue(value.toFloat()); >+ m_seed->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::numOctavesAttr) { >- m_numOctaves.setValue(value.string().toUIntStrict()); >+ m_numOctaves->setBaseValInternal(value.string().toUIntStrict()); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FETurbulence* turbulence = static_cast<FETurbulence*>(effect); > if (attrName == SVGNames::typeAttr) >@@ -126,7 +108,7 @@ bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, cons > > void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > primitiveAttributeChanged(attrName); > return; >@@ -135,7 +117,7 @@ void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) >+RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) const > { > if (baseFrequencyX() < 0 || baseFrequencyY() < 0) > return nullptr; >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.h b/Source/WebCore/svg/SVGFETurbulenceElement.h >index a0f5488d600..04db763786c 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.h >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.h >@@ -22,9 +22,6 @@ > #pragma once > > #include "FETurbulence.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -98,45 +95,39 @@ class SVGFETurbulenceElement final : public SVGFilterPrimitiveStandardAttributes > public: > static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&); > >- float baseFrequencyX() const { return m_baseFrequencyX.currentValue(attributeOwnerProxy()); } >- float baseFrequencyY() const { return m_baseFrequencyY.currentValue(attributeOwnerProxy()); } >- int numOctaves() const { return m_numOctaves.currentValue(attributeOwnerProxy()); } >- float seed() const { return m_seed.currentValue(attributeOwnerProxy()); } >- SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(attributeOwnerProxy()); } >- TurbulenceType type() const { return m_type.currentValue(attributeOwnerProxy()); } >+ float baseFrequencyX() const { return m_baseFrequencyX->currentValue(); } >+ float baseFrequencyY() const { return m_baseFrequencyY->currentValue(); } >+ int numOctaves() const { return m_numOctaves->currentValue(); } >+ float seed() const { return m_seed->currentValue(); } >+ SVGStitchOptions stitchTiles() const { return m_stitchTiles->currentValue<SVGStitchOptions>(); } >+ TurbulenceType type() const { return m_type->currentValue<TurbulenceType>(); } > >- RefPtr<SVGAnimatedNumber> baseFrequencyXAnimated() { return m_baseFrequencyX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> baseFrequencyYAnimated() { return m_baseFrequencyY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> numOctavesAnimated() { return m_numOctaves.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedNumber>& baseFrequencyX() { return m_baseFrequencyX; } >+ Ref<SVGAnimatedNumber>& baseFrequencyY() { return m_baseFrequencyY; } >+ Ref<SVGAnimatedInteger>& numOctaves() { return m_numOctaves; } >+ Ref<SVGAnimatedNumber>& seed() { return m_seed; } >+ Ref<SVGAnimatedEnumeration>& stitchTiles() { return m_stitchTiles; } >+ Ref<SVGAnimatedEnumeration>& type() { return m_type; } > > private: > SVGFETurbulenceElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& baseFrequencyXIdentifier(); >- static const AtomicString& baseFrequencyYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedNumberAttribute m_baseFrequencyX; >- SVGAnimatedNumberAttribute m_baseFrequencyY; >- SVGAnimatedIntegerAttribute m_numOctaves { 1 }; >- SVGAnimatedNumberAttribute m_seed; >- SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { SVG_STITCHTYPE_NOSTITCH }; >- SVGAnimatedEnumerationAttribute<TurbulenceType> m_type { TurbulenceType::Turbulence }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedNumber> m_baseFrequencyX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_baseFrequencyY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_seed { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_stitchTiles { SVGAnimatedEnumeration::create(this, SVG_STITCHTYPE_NOSTITCH) }; >+ Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, TurbulenceType::Turbulence) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFilterElement.cpp b/Source/WebCore/svg/SVGFilterElement.cpp >index cdeaa38df6d..a6edec432f1 100644 >--- a/Source/WebCore/svg/SVGFilterElement.cpp >+++ b/Source/WebCore/svg/SVGFilterElement.cpp >@@ -46,7 +46,16 @@ inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document > // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified. > // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. > ASSERT(hasTagName(SVGNames::filterTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::filterUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_filterUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::primitiveUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_primitiveUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFilterElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFilterElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGFilterElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGFilterElement::m_height>(); >+ }); > } > > Ref<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Document& document) >@@ -54,19 +63,6 @@ Ref<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGFilterElement(tagName, document)); > } > >-void SVGFilterElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::filterUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_filterUnits>(); >- registry.registerAttribute<SVGNames::primitiveUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_primitiveUnits>(); >- registry.registerAttribute<SVGNames::xAttr, &SVGFilterElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGFilterElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGFilterElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGFilterElement::m_height>(); >-} >- > void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; >@@ -74,19 +70,19 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicStr > if (name == SVGNames::filterUnitsAttr) { > SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_filterUnits.setValue(propertyValue); >+ m_filterUnits->setBaseValInternal(propertyValue); > } else if (name == SVGNames::primitiveUnitsAttr) { > SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_primitiveUnits.setValue(propertyValue); >+ m_primitiveUnits->setBaseValInternal(propertyValue); > } else if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -97,13 +93,13 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicStr > > void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isAnimatedLengthAttribute(attrName)) { >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; > } > >- if (isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { > if (auto* renderer = this->renderer()) > renderer->setNeedsLayout(); > return; >diff --git a/Source/WebCore/svg/SVGFilterElement.h b/Source/WebCore/svg/SVGFilterElement.h >index 9c2109f4361..bce982148d7 100644 >--- a/Source/WebCore/svg/SVGFilterElement.h >+++ b/Source/WebCore/svg/SVGFilterElement.h >@@ -23,9 +23,6 @@ > > #pragma once > >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedLength.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGURIReference.h" >@@ -38,30 +35,26 @@ class SVGFilterElement final : public SVGElement, public SVGExternalResourcesReq > public: > static Ref<SVGFilterElement> create(const QualifiedName&, Document&); > >- SVGUnitTypes::SVGUnitType filterUnits() const { return m_filterUnits.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType primitiveUnits() const { return m_primitiveUnits.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >+ SVGUnitTypes::SVGUnitType filterUnits() const { return m_filterUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ SVGUnitTypes::SVGUnitType primitiveUnits() const { return m_primitiveUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } > >- RefPtr<SVGAnimatedEnumeration> filterUnitsAnimated() { return m_filterUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> primitiveUnitsAnimated() { return m_primitiveUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedEnumeration>& filterUnits() { return m_filterUnits; } >+ Ref<SVGAnimatedEnumeration>& primitiveUnits() { return m_primitiveUnits; } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } > > private: > SVGFilterElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFilterElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isAnimatedLengthAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >@@ -73,13 +66,13 @@ private: > > bool selfHasRelativeLengths() const final { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_filterUnits { SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_primitiveUnits { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth, "-10%" }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight, "-10%" }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth, "120%" }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight, "120%" }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedEnumeration> m_filterUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; >+ Ref<SVGAnimatedEnumeration> m_primitiveUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth, "-10%") }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight, "-10%") }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth, "120%") }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight, "120%") }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >index 88806fb972f..9ab50619de7 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >@@ -36,19 +36,14 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFilterPrimitiveStandardAttributes); > SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > { >- registerAttributes(); >-} >- >-void SVGFilterPrimitiveStandardAttributes::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGFilterPrimitiveStandardAttributes::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGFilterPrimitiveStandardAttributes::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGFilterPrimitiveStandardAttributes::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGFilterPrimitiveStandardAttributes::m_height>(); >- registry.registerAttribute<SVGNames::resultAttr, &SVGFilterPrimitiveStandardAttributes::m_result>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFilterPrimitiveStandardAttributes::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFilterPrimitiveStandardAttributes::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGFilterPrimitiveStandardAttributes::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGFilterPrimitiveStandardAttributes::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::resultAttr, &SVGFilterPrimitiveStandardAttributes::m_result>(); >+ }); > } > > void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -56,22 +51,22 @@ void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& n > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::resultAttr) >- m_result.setValue(value); >+ m_result->setBaseValInternal(value); > > reportAttributeParsingError(parseError, name, value); > > SVGElement::parseAttribute(name, value); > } > >-bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect*, const QualifiedName&) >+bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const > { > // When all filters support this method, it will be changed to a pure virtual method. > ASSERT_NOT_REACHED(); >@@ -80,7 +75,7 @@ bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect > > void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >index e0946f552ea..ffc88b26bda 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >@@ -23,8 +23,6 @@ > > #include "RenderSVGResourceFilter.h" > #include "RenderSVGResourceFilterPrimitive.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGNames.h" > #include <wtf/RefPtr.h> >@@ -40,24 +38,23 @@ class SVGFilterPrimitiveStandardAttributes : public SVGElement { > public: > void setStandardAttributes(FilterEffect*) const; > >- virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) = 0; >+ virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const = 0; > // Returns true, if the new value is different from the old one. >- virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); >+ virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const; > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFilterPrimitiveStandardAttributes, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterPrimitiveStandardAttributes, SVGElement>; > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- const String& result() const { return m_result.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ String result() const { return m_result->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> resultAnimated() { return m_result.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedString>& result() { return m_result; } > > protected: > SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document&); >@@ -70,26 +67,22 @@ protected: > void primitiveAttributeChanged(const QualifiedName& attributeName); > > private: >- static void registerAttributes(); >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- > bool isFilterEffect() const override { return true; } > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > bool rendererIsNeeded(const RenderStyle&) override; > bool childShouldCreateRenderer(const Node&) const override { return false; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > > // Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified. > // Spec: If the width/height attribute is not specified, the effect is as if a value of "100%" were specified. >- SVGAnimatedLengthAttribute m_x { LengthModeWidth, "0%" }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight, "0%" }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth, "100%" }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight, "100%" }; >- SVGAnimatedStringAttribute m_result; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth, "0%") }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight, "0%") }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth, "100%") }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight, "100%") }; >+ Ref<SVGAnimatedString> m_result { SVGAnimatedString::create(this) }; > }; > > void invalidateFilterPrimitiveParent(SVGElement*);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191237
:
353808
|
353812
|
353815
|
353817
|
353818
|
353820
|
353824
|
353825
|
355382
|
355386
|
355388
|
355393
|
355568
|
355574
|
355575
|
355577
|
355580
|
355582
|
355585
|
355666
|
355672
|
355693
|
355699
|
355711
|
355752
|
355777
|
355820
|
356333
|
356334
|
356338
|
356340
|
356342
|
356344
|
356346
|
356351
|
356352
|
356358
|
356360
|
356380
|
356497
|
356500
|
356507
|
356579
|
356607
|
356728
|
356729
|
356730
|
356731
|
356732
|
356733
|
356752
|
356810
|
356811
|
356879
|
356880
|
356881
|
356882
|
356883
|
356884
|
356885
|
356887
|
356888
|
356889
|
356892
|
356895
|
356896
|
359721
|
359735
|
359747
|
363581
|
363595
|
363613
|
363690
|
364172
|
364180
|
366512
|
366557
|
366636