Changeset 243185 in webkit
- Timestamp:
- Mar 19, 2019 6:49:29 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243183 r243185 1 2019-03-19 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio 4 https://bugs.webkit.org/show_bug.cgi?id=195960 5 6 Reviewed by Simon Fraser. 7 8 -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty< 9 SVGPreserveAspectRatio>. 10 11 -- Make SVGPreserveAspectRatio be derived form SVGValueProperty< 12 SVGPreserveAspectRatioValue>. 13 14 -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated 15 property. 16 17 -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated 18 property of the target element and all its instances. 19 20 -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of 21 animated property in a period of time. 22 23 SVGFilterPrimitiveStandardAttributes::build() should be const function. 24 This is required for this patch because SVGFEImageElement::build() calls 25 SVGFEImageElement::preserveAspectRatio() which is const. 26 27 * Sources.txt: 28 * WebCore.xcodeproj/project.pbxproj: 29 * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed. 30 * svg/SVGAnimatedPreserveAspectRatio.h: Removed. 31 * svg/SVGAnimatorFactory.h: 32 (WebCore::SVGAnimatorFactory::create): 33 * svg/SVGFEBlendElement.cpp: 34 (WebCore::SVGFEBlendElement::build const): 35 (WebCore::SVGFEBlendElement::build): Deleted. 36 * svg/SVGFEBlendElement.h: 37 * svg/SVGFEColorMatrixElement.cpp: 38 (WebCore::SVGFEColorMatrixElement::build const): 39 (WebCore::SVGFEColorMatrixElement::build): Deleted. 40 * svg/SVGFEColorMatrixElement.h: 41 * svg/SVGFEComponentTransferElement.cpp: 42 (WebCore::SVGFEComponentTransferElement::build const): 43 (WebCore::SVGFEComponentTransferElement::build): Deleted. 44 * svg/SVGFEComponentTransferElement.h: 45 * svg/SVGFECompositeElement.cpp: 46 (WebCore::SVGFECompositeElement::build const): 47 (WebCore::SVGFECompositeElement::build): Deleted. 48 * svg/SVGFECompositeElement.h: 49 * svg/SVGFEConvolveMatrixElement.cpp: 50 (WebCore::SVGFEConvolveMatrixElement::build const): 51 (WebCore::SVGFEConvolveMatrixElement::build): Deleted. 52 * svg/SVGFEConvolveMatrixElement.h: 53 * svg/SVGFEDiffuseLightingElement.cpp: 54 (WebCore::SVGFEDiffuseLightingElement::build const): 55 (WebCore::SVGFEDiffuseLightingElement::build): Deleted. 56 * svg/SVGFEDiffuseLightingElement.h: 57 * svg/SVGFEDisplacementMapElement.cpp: 58 (WebCore::SVGFEDisplacementMapElement::build const): 59 (WebCore::SVGFEDisplacementMapElement::build): Deleted. 60 * svg/SVGFEDisplacementMapElement.h: 61 * svg/SVGFEDropShadowElement.cpp: 62 (WebCore::SVGFEDropShadowElement::build const): 63 (WebCore::SVGFEDropShadowElement::build): Deleted. 64 * svg/SVGFEDropShadowElement.h: 65 * svg/SVGFEFloodElement.cpp: 66 (WebCore::SVGFEFloodElement::build const): 67 (WebCore::SVGFEFloodElement::build): Deleted. 68 * svg/SVGFEFloodElement.h: 69 * svg/SVGFEGaussianBlurElement.cpp: 70 (WebCore::SVGFEGaussianBlurElement::build const): 71 (WebCore::SVGFEGaussianBlurElement::build): Deleted. 72 * svg/SVGFEGaussianBlurElement.h: 73 * svg/SVGFEImageElement.cpp: 74 (WebCore::SVGFEImageElement::SVGFEImageElement): 75 (WebCore::SVGFEImageElement::parseAttribute): 76 (WebCore::SVGFEImageElement::build const): 77 (WebCore::SVGFEImageElement::registerAttributes): Deleted. 78 (WebCore::SVGFEImageElement::build): Deleted. 79 * svg/SVGFEImageElement.h: 80 * svg/SVGFEMergeElement.cpp: 81 (WebCore::SVGFEMergeElement::build const): 82 (WebCore::SVGFEMergeElement::build): Deleted. 83 * svg/SVGFEMergeElement.h: 84 * svg/SVGFEMorphologyElement.cpp: 85 (WebCore::SVGFEMorphologyElement::build const): 86 (WebCore::SVGFEMorphologyElement::build): Deleted. 87 * svg/SVGFEMorphologyElement.h: 88 * svg/SVGFEOffsetElement.cpp: 89 (WebCore::SVGFEOffsetElement::build const): 90 (WebCore::SVGFEOffsetElement::build): Deleted. 91 * svg/SVGFEOffsetElement.h: 92 * svg/SVGFESpecularLightingElement.cpp: 93 (WebCore::SVGFESpecularLightingElement::build const): 94 (WebCore::SVGFESpecularLightingElement::build): Deleted. 95 * svg/SVGFESpecularLightingElement.h: 96 * svg/SVGFETileElement.cpp: 97 (WebCore::SVGFETileElement::build const): 98 (WebCore::SVGFETileElement::build): Deleted. 99 * svg/SVGFETileElement.h: 100 * svg/SVGFETurbulenceElement.cpp: 101 (WebCore::SVGFETurbulenceElement::build const): 102 (WebCore::SVGFETurbulenceElement::build): Deleted. 103 * svg/SVGFETurbulenceElement.h: 104 * svg/SVGFilterPrimitiveStandardAttributes.h: 105 * svg/SVGFitToViewBox.cpp: 106 (WebCore::SVGFitToViewBox::SVGFitToViewBox): 107 (WebCore::SVGFitToViewBox::parseViewBox): 108 (WebCore::SVGFitToViewBox::registerAttributes): Deleted. 109 * svg/SVGFitToViewBox.h: 110 (WebCore::SVGFitToViewBox::preserveAspectRatio const): 111 (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated): 112 (WebCore::SVGFitToViewBox::setPreserveAspectRatio): 113 (WebCore::SVGFitToViewBox::resetPreserveAspectRatio): 114 (WebCore::SVGFitToViewBox::preserveAspectRatioString const): 115 * svg/SVGImageElement.cpp: 116 (WebCore::SVGImageElement::SVGImageElement): 117 (WebCore::SVGImageElement::registerAttributes): 118 (WebCore::SVGImageElement::parseAttribute): 119 * svg/SVGImageElement.h: 120 * svg/SVGMarkerElement.h: 121 * svg/SVGPatternElement.h: 122 * svg/SVGPreserveAspectRatio.h: 123 (WebCore::SVGPreserveAspectRatio::create): 124 (WebCore::SVGPreserveAspectRatio::align const): 125 (WebCore::SVGPreserveAspectRatio::setAlign): 126 (WebCore::SVGPreserveAspectRatio::meetOrSlice const): 127 (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): 128 (WebCore::SVGPreserveAspectRatio::align): Deleted. 129 (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted. 130 (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted. 131 * svg/SVGSVGElement.h: 132 * svg/SVGStringList.h: 133 * svg/SVGSymbolElement.h: 134 * svg/SVGViewSpec.h: 135 * svg/properties/SVGAnimatedPropertyAccessorImpl.h: 136 * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: 137 * svg/properties/SVGAnimatedPropertyImpl.h: 138 * svg/properties/SVGAnimationDiscreteFunctionImpl.h: 139 * svg/properties/SVGAttributeRegistry.h: 140 * svg/properties/SVGPropertyOwnerRegistry.h: 141 (WebCore::SVGPropertyOwnerRegistry::registerProperty): 142 1 143 2019-03-19 Said Abou-Hallawa <sabouhallawa@apple.com> 2 144 -
trunk/Source/WebCore/Sources.txt
r243183 r243185 2280 2280 svg/SVGAnimatedPath.cpp 2281 2281 svg/SVGAnimatedPointList.cpp 2282 svg/SVGAnimatedPreserveAspectRatio.cpp2283 2282 svg/SVGAnimatedString.cpp 2284 2283 svg/SVGAnimatedTransformList.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243183 r243185 294 294 08F859D51463F9CD0067D933 /* SVGImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D933 /* SVGImageCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 295 295 08F859D51463F9CD0067D934 /* SVGImageForContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */; }; 296 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */; };297 296 0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 298 297 0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; }; … … 5679 5678 08F859D31463F9CD0067D933 /* SVGImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageCache.h; sourceTree = "<group>"; }; 5680 5679 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageForContainer.h; sourceTree = "<group>"; }; 5681 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPreserveAspectRatio.h; sourceTree = "<group>"; };5682 5680 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginViewBase.h; sourceTree = "<group>"; }; 5683 5681 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; }; … … 7579 7577 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; }; 7580 7578 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; }; 7581 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPreserveAspectRatio.cpp; sourceTree = "<group>"; };7582 7579 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; }; 7583 7580 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; }; … … 24148 24145 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */, 24149 24146 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */, 24150 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */,24151 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */,24152 24147 B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */, 24153 24148 B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */, … … 31929 31924 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */, 31930 31925 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */, 31931 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */,31932 31926 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */, 31933 31927 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */, -
trunk/Source/WebCore/svg/SVGAnimatorFactory.h
r243183 r243185 30 30 #include "SVGAnimatedPath.h" 31 31 #include "SVGAnimatedPointList.h" 32 #include "SVGAnimatedPreserveAspectRatio.h"33 32 #include "SVGAnimatedString.h" 34 33 #include "SVGAnimatedTransformList.h" … … 73 72 return std::make_unique<SVGAnimatedPointListAnimator>(animationElement, contextElement); 74 73 case AnimatedPreserveAspectRatio: 75 return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(animationElement, contextElement);74 return nullptr; 76 75 case AnimatedRect: 77 76 return nullptr; -
trunk/Source/WebCore/svg/SVGFEBlendElement.cpp
r243163 r243185 105 105 } 106 106 107 RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 107 RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 108 108 { 109 109 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEBlendElement.h
r243114 r243185 74 74 void svgAttributeChanged(const QualifiedName&) override; 75 75 76 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;76 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 77 77 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; 78 78 -
trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp
r243163 r243185 108 108 } 109 109 110 RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 110 RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 111 111 { 112 112 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h
r243114 r243185 99 99 100 100 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; 101 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;101 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 102 102 103 103 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp
r243163 r243185 67 67 } 68 68 69 RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 69 RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 70 70 { 71 71 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEComponentTransferElement.h
r243114 r243185 49 49 void parseAttribute(const QualifiedName&, const AtomicString&) override; 50 50 51 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;51 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 52 52 53 53 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGFECompositeElement.cpp
r243163 r243185 136 136 } 137 137 138 RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 138 RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 139 139 { 140 140 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFECompositeElement.h
r243114 r243185 86 86 static Ref<SVGFECompositeElement> create(const QualifiedName&, Document&); 87 87 88 String in1() { return m_in1.currentValue(attributeOwnerProxy()); }89 String in2() { return m_in2.currentValue(attributeOwnerProxy()); }88 String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } 89 String in2() const { return m_in2.currentValue(attributeOwnerProxy()); } 90 90 CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); } 91 91 float k1() const { return m_k1.currentValue(attributeOwnerProxy()); } … … 122 122 123 123 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; 124 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;124 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 125 125 126 126 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
r243163 r243185 217 217 } 218 218 219 RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 219 RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 220 220 { 221 221 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h
r243121 r243185 114 114 115 115 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; 116 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;116 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 117 117 118 118 static const AtomicString& kernelUnitLengthXIdentifier(); -
trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
r243163 r243185 171 171 } 172 172 173 RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 173 RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 174 174 { 175 175 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h
r243114 r243185 69 69 70 70 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; 71 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;71 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 72 72 73 73 static const AtomicString& kernelUnitLengthXIdentifier(); -
trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
r243163 r243185 120 120 } 121 121 122 RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 122 RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 123 123 { 124 124 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h
r243114 r243185 104 104 105 105 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; 106 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;106 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 107 107 108 108 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp
r243163 r243185 117 117 } 118 118 119 RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 119 RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 120 120 { 121 121 RenderObject* renderer = this->renderer(); -
trunk/Source/WebCore/svg/SVGFEDropShadowElement.h
r243114 r243185 65 65 void svgAttributeChanged(const QualifiedName&) override; 66 66 67 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;67 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 68 68 69 69 static const AtomicString& stdDeviationXIdentifier(); -
trunk/Source/WebCore/svg/SVGFEFloodElement.cpp
r231153 r243185 59 59 } 60 60 61 RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) 61 RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) const 62 62 { 63 63 RenderObject* renderer = this->renderer(); -
trunk/Source/WebCore/svg/SVGFEFloodElement.h
r229694 r243185 34 34 35 35 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; 36 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;36 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 37 37 }; 38 38 -
trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
r243163 r243185 115 115 } 116 116 117 RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 117 RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 118 118 { 119 119 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h
r243114 r243185 66 66 void svgAttributeChanged(const QualifiedName&) override; 67 67 68 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;68 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 69 69 70 70 static const AtomicString& stdDeviationXIdentifier(); -
trunk/Source/WebCore/svg/SVGFEImageElement.cpp
r240237 r243185 45 45 { 46 46 ASSERT(hasTagName(SVGNames::feImageTag)); 47 registerAttributes(); 47 48 static std::once_flag onceFlag; 49 std::call_once(onceFlag, [] { 50 PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>(); 51 }); 48 52 } 49 53 … … 112 116 } 113 117 114 void SVGFEImageElement::registerAttributes()115 {116 auto& registry = attributeRegistry();117 if (!registry.isEmpty())118 return;119 registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>();120 }121 122 118 void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 123 119 { … … 125 121 SVGPreserveAspectRatioValue preserveAspectRatio; 126 122 preserveAspectRatio.parse(value); 127 m_preserveAspectRatio .setValue(preserveAspectRatio);123 m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); 128 124 return; 129 125 } … … 186 182 } 187 183 188 RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) 184 RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) const 189 185 { 190 186 if (m_cachedImage) -
trunk/Source/WebCore/svg/SVGFEImageElement.h
r243121 r243185 24 24 #include "CachedImageClient.h" 25 25 #include "CachedResourceHandle.h" 26 #include "SVGAnimatedPreserveAspectRatio.h"27 26 #include "SVGExternalResourcesRequired.h" 28 27 #include "SVGFEImage.h" … … 41 40 bool hasSingleSecurityOrigin() const; 42 41 43 const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio .currentValue(attributeOwnerProxy()); }44 RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); }42 const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } 43 SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; } 45 44 46 45 private: … … 48 47 49 48 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; 50 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }51 static void registerAttributes();52 49 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 53 50 … … 68 65 void didFinishInsertingNode() override; 69 66 70 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;67 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 71 68 72 69 void clearResourceReferences(); … … 79 76 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 80 77 PropertyRegistry m_propertyRegistry { *this }; 81 SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;78 Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) }; 82 79 CachedResourceHandle<CachedImage> m_cachedImage; 83 80 }; -
trunk/Source/WebCore/svg/SVGFEMergeElement.cpp
r243163 r243185 45 45 } 46 46 47 RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 47 RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 48 48 { 49 49 auto effect = FEMerge::create(filter); -
trunk/Source/WebCore/svg/SVGFEMergeElement.h
r229694 r243185 33 33 SVGFEMergeElement(const QualifiedName&, Document&); 34 34 35 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;35 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 36 36 }; 37 37 -
trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp
r243163 r243185 134 134 } 135 135 136 RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 136 RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 137 137 { 138 138 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEMorphologyElement.h
r243114 r243185 94 94 95 95 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; 96 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;96 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 97 97 98 98 static const AtomicString& radiusXIdentifier(); -
trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp
r243163 r243185 86 86 } 87 87 88 RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 88 RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 89 89 { 90 90 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFEOffsetElement.h
r243114 r243185 59 59 void svgAttributeChanged(const QualifiedName&) override; 60 60 61 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;61 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 62 62 63 63 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp
r243163 r243185 180 180 } 181 181 182 RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 182 RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 183 183 { 184 184 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h
r243114 r243185 70 70 71 71 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; 72 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;72 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 73 73 74 74 static const AtomicString& kernelUnitLengthXIdentifier(); -
trunk/Source/WebCore/svg/SVGFETileElement.cpp
r243163 r243185 75 75 } 76 76 77 RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) 77 RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const 78 78 { 79 79 auto input1 = filterBuilder->getEffectById(in1()); -
trunk/Source/WebCore/svg/SVGFETileElement.h
r243114 r243185 53 53 void svgAttributeChanged(const QualifiedName&) override; 54 54 55 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;55 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 56 56 57 57 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp
r243114 r243185 140 140 } 141 141 142 RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) 142 RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) const 143 143 { 144 144 if (baseFrequencyX() < 0 || baseFrequencyY() < 0) -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.h
r243114 r243185 132 132 133 133 bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; 134 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;134 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 135 135 136 136 static const AtomicString& baseFrequencyXIdentifier(); -
trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
r243114 r243185 41 41 void setStandardAttributes(FilterEffect*) const; 42 42 43 virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) = 0;43 virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const = 0; 44 44 // Returns true, if the new value is different from the old one. 45 45 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); -
trunk/Source/WebCore/svg/SVGFitToViewBox.cpp
r243183 r243185 36 36 37 37 SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess access) 38 : m_ attributeOwnerProxy(*this, *contextElement, access == SVGPropertyAccess::ReadWrite ? PropertyIsReadWrite : PropertyIsReadOnly)39 , m_ viewBox(SVGAnimatedRect::create(contextElement, access))38 : m_viewBox(SVGAnimatedRect::create(contextElement, access)) 39 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(contextElement, access)) 40 40 { 41 registerAttributes();42 43 41 static std::once_flag onceFlag; 44 42 std::call_once(onceFlag, [] { 45 43 PropertyRegistry::registerProperty<SVGNames::viewBoxAttr, &SVGFitToViewBox::m_viewBox>(); 44 PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>(); 46 45 }); 47 }48 49 void SVGFitToViewBox::registerAttributes()50 {51 auto& registry = attributeRegistry();52 if (!registry.isEmpty())53 return;54 registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>();55 46 } 56 47 … … 114 105 115 106 if (validate) { 116 Document& document = m_ attributeOwnerProxy.element().document();107 Document& document = m_viewBox->contextElement()->document(); 117 108 118 109 if (!valid) { -
trunk/Source/WebCore/svg/SVGFitToViewBox.h
r243183 r243185 44 44 45 45 const FloatRect& viewBox() const { return m_viewBox->currentValue(); } 46 const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio .currentValue(m_attributeOwnerProxy); }46 const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } 47 47 48 48 SVGAnimatedRect& viewBoxAnimated() { return m_viewBox; } 49 RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(m_attributeOwnerProxy); }49 SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; } 50 50 51 51 void setViewBox(const FloatRect&); 52 52 void resetViewBox(); 53 53 54 void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio .setValue(preserveAspectRatio); }55 void resetPreserveAspectRatio() { m_preserveAspectRatio .resetValue(); }54 void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); } 55 void resetPreserveAspectRatio() { m_preserveAspectRatio->setBaseValInternal({ }); } 56 56 57 57 String viewBoxString() const { return SVGPropertyTraits<FloatRect>::toString(viewBox()); } 58 String preserveAspectRatioString() const { return m_preserveAspectRatio.toString(); }58 String preserveAspectRatioString() const { return preserveAspectRatio().valueAsString(); } 59 59 60 60 bool hasValidViewBox() const { return m_isViewBoxValid; } … … 75 75 76 76 private: 77 static void registerAttributes();78 79 AttributeOwnerProxy m_attributeOwnerProxy;80 77 Ref<SVGAnimatedRect> m_viewBox; 81 SVGAnimatedPreserveAspectRatioAttributem_preserveAspectRatio;78 Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; 82 79 bool m_isViewBoxValid { false }; 83 80 }; -
trunk/Source/WebCore/svg/SVGImageElement.cpp
r234683 r243185 45 45 { 46 46 registerAttributes(); 47 48 static std::once_flag onceFlag; 49 std::call_once(onceFlag, [] { 50 PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>(); 51 }); 47 52 } 48 53 … … 70 75 registry.registerAttribute<SVGNames::widthAttr, &SVGImageElement::m_width>(); 71 76 registry.registerAttribute<SVGNames::heightAttr, &SVGImageElement::m_height>(); 72 registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>();73 77 } 74 78 … … 78 82 SVGPreserveAspectRatioValue preserveAspectRatio; 79 83 preserveAspectRatio.parse(value); 80 m_preserveAspectRatio .setValue(preserveAspectRatio);84 m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); 81 85 return; 82 86 } -
trunk/Source/WebCore/svg/SVGImageElement.h
r243114 r243185 23 23 24 24 #include "SVGAnimatedLength.h" 25 #include "SVGAnimatedPreserveAspectRatio.h"26 25 #include "SVGExternalResourcesRequired.h" 27 26 #include "SVGGraphicsElement.h" … … 43 42 const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } 44 43 const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } 45 const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio .currentValue(attributeOwnerProxy()); }44 const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } 46 45 47 46 RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } … … 49 48 RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } 50 49 RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } 51 RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); }50 SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; } 52 51 53 52 private: … … 87 86 SVGAnimatedLengthAttribute m_width { LengthModeWidth }; 88 87 SVGAnimatedLengthAttribute m_height { LengthModeHeight }; 89 SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;88 Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) }; 90 89 SVGImageLoader m_imageLoader; 91 90 }; -
trunk/Source/WebCore/svg/SVGMarkerElement.h
r243183 r243185 25 25 #include "SVGAnimatedEnumeration.h" 26 26 #include "SVGAnimatedLength.h" 27 #include "SVGAnimatedPreserveAspectRatio.h"28 27 #include "SVGElement.h" 29 28 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGPatternElement.h
r243183 r243185 24 24 #include "SVGAnimatedEnumeration.h" 25 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPreserveAspectRatio.h"27 26 #include "SVGAnimatedTransformList.h" 28 27 #include "SVGElement.h" -
trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h
r242978 r243185 1 1 /* 2 * Copyright (C) 2016-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 28 28 #include "SVGPreserveAspectRatioValue.h" 29 #include "SVG PropertyTearOff.h"29 #include "SVGValueProperty.h" 30 30 31 31 namespace WebCore { 32 32 33 class SVGPreserveAspectRatio : public SVGPropertyTearOff<SVGPreserveAspectRatioValue> { 33 class SVGPreserveAspectRatio : public SVGValueProperty<SVGPreserveAspectRatioValue> { 34 using Base = SVGValueProperty<SVGPreserveAspectRatioValue>; 35 using Base::Base; 36 using Base::m_value; 37 34 38 public: 35 static Ref<SVGPreserveAspectRatio> create(SVG LegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value)39 static Ref<SVGPreserveAspectRatio> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGPreserveAspectRatioValue& value = { }) 36 40 { 37 return adoptRef(*new SVGPreserveAspectRatio( animatedProperty, role, value));41 return adoptRef(*new SVGPreserveAspectRatio(owner, access, value)); 38 42 } 39 43 40 static Ref<SVGPreserveAspectRatio> create(const SVGPreserveAspectRatioValue& initialValue = { }) 44 template<typename T> 45 static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& value) 41 46 { 42 return adoptRef(*new SVGPreserveAspectRatio(initialValue)); 47 if (value.hasException()) 48 return value.releaseException(); 49 return adoptRef(*new SVGPreserveAspectRatio(value.releaseReturnValue())); 43 50 } 44 51 45 template<typename T> static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& initialValue) 46 { 47 if (initialValue.hasException()) 48 return initialValue.releaseException(); 49 return create(initialValue.releaseReturnValue()); 50 } 51 52 unsigned short align() 53 { 54 return propertyReference().align(); 55 } 52 unsigned short align() const { return m_value.align(); } 56 53 57 54 ExceptionOr<void> setAlign(float value) … … 60 57 return Exception { NoModificationAllowedError }; 61 58 62 auto result = propertyReference().setAlign(value);59 auto result = m_value.setAlign(value); 63 60 if (result.hasException()) 64 61 return result; … … 68 65 } 69 66 70 unsigned short meetOrSlice() 71 { 72 return propertyReference().meetOrSlice(); 73 } 67 unsigned short meetOrSlice() const { return m_value.meetOrSlice(); } 74 68 75 69 ExceptionOr<void> setMeetOrSlice(float value) … … 78 72 return Exception { NoModificationAllowedError }; 79 73 80 auto result = propertyReference().setMeetOrSlice(value);74 auto result = m_value.setMeetOrSlice(value); 81 75 if (result.hasException()) 82 76 return result; … … 86 80 } 87 81 88 private: 89 SVGPreserveAspectRatio(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value) 90 : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(&animatedProperty, role, value) 82 String valueAsString() const override 91 83 { 92 } 93 94 explicit SVGPreserveAspectRatio(const SVGPreserveAspectRatioValue& initialValue) 95 : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(initialValue) 96 { 84 return m_value.valueAsString(); 97 85 } 98 86 }; -
trunk/Source/WebCore/svg/SVGSVGElement.h
r243183 r243185 24 24 #include "FloatPoint.h" 25 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPreserveAspectRatio.h"27 26 #include "SVGExternalResourcesRequired.h" 28 27 #include "SVGFitToViewBox.h" -
trunk/Source/WebCore/svg/SVGStringList.h
r243130 r243185 28 28 #include "SVGParserUtilities.h" 29 29 #include "SVGPrimitiveList.h" 30 #include <wtf/text/StringBuilder.h> 30 31 31 32 namespace WebCore { -
trunk/Source/WebCore/svg/SVGSymbolElement.h
r243183 r243185 22 22 #pragma once 23 23 24 #include "SVGAnimatedPreserveAspectRatio.h"25 24 #include "SVGElement.h" 26 25 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGViewSpec.h
r243183 r243185 21 21 #pragma once 22 22 23 #include "SVGAnimatedPreserveAspectRatio.h"24 23 #include "SVGFitToViewBox.h" 25 24 #include "SVGTransformListValues.h" -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
r243183 r243185 78 78 79 79 template<typename OwnerType> 80 class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> { 81 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>; 82 using Base::property; 83 84 public: 85 using Base::Base; 86 template<Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property> 87 constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPreserveAspectRatioAccessor, property>(); } 88 89 private: 90 std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final 91 { 92 return SVGAnimatedPreserveAspectRatioAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); 93 } 94 95 void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final 96 { 97 static_cast<SVGAnimatedPreserveAspectRatioAnimator&>(animator).appendAnimatedInstance(property(owner)); 98 } 99 }; 100 101 template<typename OwnerType> 80 102 class SVGAnimatedRectAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect> { 81 103 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
r243183 r243185 76 76 } 77 77 }; 78 78 79 class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> { 80 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>; 81 using Base::Base; 82 83 public: 84 static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPreserveAspectRatio>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) 85 { 86 return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive); 87 } 88 89 private: 90 void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final 91 { 92 SVGPreserveAspectRatioValue& animated = m_animated->animVal()->value(); 93 m_function.progress(targetElement, percentage, repeatCount, animated); 94 } 95 }; 96 79 97 class SVGAnimatedRectAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction> { 80 98 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
r243183 r243185 33 33 #include "SVGAnimatedNumberList.h" 34 34 #include "SVGAnimatedPointList.h" 35 #include "SVGAnimatedPreserveAspectRatio.h"36 35 #include "SVGAnimatedPrimitiveProperty.h" 37 36 #include "SVGAnimatedString.h" 38 37 #include "SVGAnimatedTransformList.h" 39 38 #include "SVGAnimatedValueProperty.h" 39 #include "SVGPreserveAspectRatio.h" 40 40 #include "SVGRect.h" 41 41 … … 46 46 47 47 using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>; 48 using SVGAnimatedPreserveAspectRatio = SVGAnimatedValueProperty<SVGPreserveAspectRatio>; 48 49 49 50 } -
trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h
r243121 r243185 43 43 }; 44 44 45 class SVGAnimationPreserveAspectRatioFunction : public SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue> { 46 public: 47 using Base = SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue>; 48 using Base::Base; 49 50 void setFromAndToValues(SVGElement*, const String& from, const String& to) override 51 { 52 m_from = SVGPreserveAspectRatioValue(from); 53 m_to = SVGPreserveAspectRatioValue(to); 54 } 55 }; 56 57 class SVGAnimationStringFunction : public SVGAnimationDiscreteFunction<String> { 58 public: 59 using Base = SVGAnimationDiscreteFunction<String>; 60 using Base::Base; 61 62 void setFromAndToValues(SVGElement*, const String& from, const String& to) override 63 { 64 m_from = from; 65 m_to = to; 66 } 67 }; 68 45 69 } -
trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h
r243183 r243185 32 32 #include "SVGAnimatedNumberList.h" 33 33 #include "SVGAnimatedPointList.h" 34 #include "SVGAnimatedPreserveAspectRatio.h"35 34 #include "SVGAnimatedString.h" 36 35 #include "SVGAnimatedTransformList.h" … … 100 99 { 101 100 registerAttribute(SVGAnimatedPointListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); 102 }103 104 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPreserveAspectRatioAttribute OwnerType::*attribute>105 void registerAttribute()106 {107 registerAttribute(SVGAnimatedPreserveAspectRatioAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());108 101 } 109 102 -
trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h
r243183 r243185 56 56 } 57 57 58 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property> 59 static void registerProperty() 60 { 61 registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>()); 62 } 63 64 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property> 65 static void registerProperty() 66 { 67 registerProperty(attributeName, SVGAnimatedPreserveAspectRatioAccessor<OwnerType>::template singleton<property>()); 68 } 69 58 70 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedRect> OwnerType::*property> 59 71 static void registerProperty() 60 72 { 61 73 registerProperty(attributeName, SVGAnimatedRectAccessor<OwnerType>::template singleton<property>()); 62 }63 64 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property>65 static void registerProperty()66 {67 registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());68 74 } 69 75
Note: See TracChangeset
for help on using the changeset viewer.