Changeset 243121 in webkit
- Timestamp:
- Mar 18, 2019, 5:39:41 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 34 edited
- 2 copied
-
ChangeLog (modified) (1 diff)
-
Sources.txt (modified) (1 diff)
-
WebCore.xcodeproj/project.pbxproj (modified) (7 diffs)
-
svg/SVGAnimationElement.h (modified) (1 diff)
-
svg/SVGAnimatorFactory.h (modified) (2 diffs)
-
svg/SVGClipPathElement.h (modified) (1 diff)
-
svg/SVGCursorElement.h (modified) (1 diff)
-
svg/SVGDefsElement.h (modified) (1 diff)
-
svg/SVGExternalResourcesRequired.cpp (modified) (2 diffs)
-
svg/SVGExternalResourcesRequired.h (modified) (2 diffs)
-
svg/SVGFEConvolveMatrixElement.cpp (modified) (3 diffs)
-
svg/SVGFEConvolveMatrixElement.h (modified) (5 diffs)
-
svg/SVGFEImageElement.h (modified) (1 diff)
-
svg/SVGFontElement.h (modified) (1 diff)
-
svg/SVGForeignObjectElement.h (modified) (1 diff)
-
svg/SVGGElement.h (modified) (1 diff)
-
svg/SVGGradientElement.h (modified) (1 diff)
-
svg/SVGMPathElement.h (modified) (1 diff)
-
svg/SVGMarkerElement.h (modified) (1 diff)
-
svg/SVGMaskElement.h (modified) (1 diff)
-
svg/SVGPathElement.h (modified) (1 diff)
-
svg/SVGPatternElement.h (modified) (1 diff)
-
svg/SVGRectElement.h (modified) (1 diff)
-
svg/SVGSVGElement.h (modified) (1 diff)
-
svg/SVGScriptElement.h (modified) (1 diff)
-
svg/SVGSwitchElement.h (modified) (1 diff)
-
svg/SVGSymbolElement.h (modified) (1 diff)
-
svg/SVGTextContentElement.h (modified) (1 diff)
-
svg/SVGUseElement.h (modified) (1 diff)
-
svg/properties/SVGAnimatedPropertyAccessorImpl.h (modified) (1 diff)
-
svg/properties/SVGAnimatedPropertyAnimatorImpl.h (modified) (2 diffs)
-
svg/properties/SVGAnimatedPropertyImpl.h (modified) (2 diffs)
-
svg/properties/SVGAnimationDiscreteFunction.h (copied) (copied from trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h ) (1 diff)
-
svg/properties/SVGAnimationDiscreteFunctionImpl.h (copied) (copied from trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h ) (2 diffs)
-
svg/properties/SVGAttributeRegistry.h (modified) (2 diffs)
-
svg/properties/SVGPropertyOwnerRegistry.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243120 r243121 1 2019-03-18 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Remove the SVG property tear off objects for SVGAnimatedBoolean 4 https://bugs.webkit.org/show_bug.cgi?id=195862 5 6 Reviewed by Simon Fraser. 7 8 -- SVGAnimatedBoolean will be defined as SVGAnimatedPrimitiveProperty<bool>. 9 -- SVGAnimatedBooleanAccessor is added to access a member of this type. 10 -- A function registerProperty() is added to SVGPropertyOwnerRegistry 11 to register this type. 12 -- SVGAnimatedBooleanAnimator is added to animate a member of this type. 13 -- SVGAnimationBooleanFunction is added to handle the progress of this 14 new type over a period of time. 15 16 SVGAnimationDiscreteFunction is the base class of SVGAnimationBooleanFunction. 17 It will be the base class of all the discrete animation function types: 18 string, bool, enum and PreserveAspectRatio types. 19 20 * Sources.txt: 21 * WebCore.xcodeproj/project.pbxproj: 22 * svg/SVGAnimationElement.h: 23 * svg/SVGAnimatorFactory.h: 24 (WebCore::SVGAnimatorFactory::create): 25 * svg/SVGClipPathElement.h: 26 * svg/SVGCursorElement.h: 27 * svg/SVGDefsElement.h: 28 * svg/SVGExternalResourcesRequired.cpp: 29 (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired): 30 (WebCore::SVGExternalResourcesRequired::parseAttribute): 31 (WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted. 32 * svg/SVGExternalResourcesRequired.h: 33 (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const): 34 (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated): 35 (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted. 36 * svg/SVGFEConvolveMatrixElement.cpp: 37 (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): 38 (WebCore::SVGFEConvolveMatrixElement::registerAttributes): 39 (WebCore::SVGFEConvolveMatrixElement::parseAttribute): 40 * svg/SVGFEConvolveMatrixElement.h: 41 * svg/SVGFEImageElement.h: 42 * svg/SVGFontElement.h: 43 * svg/SVGForeignObjectElement.h: 44 * svg/SVGGElement.h: 45 * svg/SVGGradientElement.h: 46 * svg/SVGMPathElement.h: 47 * svg/SVGMarkerElement.h: 48 * svg/SVGMaskElement.h: 49 * svg/SVGPathElement.h: 50 * svg/SVGPatternElement.h: 51 * svg/SVGRectElement.h: 52 * svg/SVGSVGElement.h: 53 * svg/SVGScriptElement.h: 54 * svg/SVGSwitchElement.h: 55 * svg/SVGSymbolElement.h: 56 * svg/SVGTextContentElement.h: 57 * svg/SVGUseElement.h: 58 * svg/properties/SVGAnimatedPropertyAccessorImpl.h: 59 * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: 60 * svg/properties/SVGAnimatedPropertyImpl.h: 61 * svg/properties/SVGAnimationDiscreteFunction.h: Added. 62 (WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction): 63 (WebCore::SVGAnimationDiscreteFunction::progress): 64 * svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added. 65 * svg/properties/SVGAttributeRegistry.h: 66 * svg/properties/SVGPropertyOwnerRegistry.h: 67 (WebCore::SVGPropertyOwnerRegistry::registerProperty): 68 1 69 2019-03-18 Simon Fraser <simon.fraser@apple.com> 2 70 -
trunk/Source/WebCore/Sources.txt
r243036 r243121 2271 2271 svg/SVGAnimateTransformElement.cpp 2272 2272 svg/SVGAnimatedAngle.cpp 2273 svg/SVGAnimatedBoolean.cpp2274 2273 svg/SVGAnimatedColor.cpp 2275 2274 svg/SVGAnimatedEnumeration.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243116 r243121 259 259 0854B0231255E4E600B9CDD0 /* SVGRootInlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0111255E4E600B9CDD0 /* SVGRootInlineBox.h */; }; 260 260 0854B0251255E4E600B9CDD0 /* SVGTextQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */; }; 261 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */; };262 261 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */; }; 263 262 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; }; … … 5630 5629 0854B0121255E4E600B9CDD0 /* SVGTextQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextQuery.cpp; sourceTree = "<group>"; }; 5631 5630 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextQuery.h; sourceTree = "<group>"; }; 5632 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedBoolean.h; sourceTree = "<group>"; };5633 5631 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformListPropertyTearOff.h; sourceTree = "<group>"; }; 5634 5632 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; }; … … 7582 7580 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; }; 7583 7581 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPreserveAspectRatio.cpp; sourceTree = "<group>"; }; 7584 431A308713B8F978007791E4 /* SVGAnimatedBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedBoolean.cpp; sourceTree = "<group>"; };7585 7582 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; }; 7586 7583 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; }; … … 8682 8679 55D70D21223B00BB00044B8E /* SVGLegacyAnimatedProperty.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLegacyAnimatedProperty.cpp; sourceTree = "<group>"; }; 8683 8680 55D70D22223B00EA00044B8E /* SVGLegacyProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLegacyProperty.h; sourceTree = "<group>"; }; 8681 55DCC51C2240605E00C26E32 /* SVGAnimationDiscreteFunctionImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunctionImpl.h; sourceTree = "<group>"; }; 8682 55DCC51D2240615500C26E32 /* SVGAnimationDiscreteFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunction.h; sourceTree = "<group>"; }; 8684 8683 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaintFrequencyTracker.h; sourceTree = "<group>"; }; 8685 8684 55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMemberAccessor.h; sourceTree = "<group>"; }; … … 16231 16230 55EE535E223B2A0E00FBA944 /* SVGAnimationAdditiveValueFunction.h */, 16232 16231 55BE0259223B29C10032F08A /* SVGAnimationAdditiveValueFunctionImpl.h */, 16232 55DCC51D2240615500C26E32 /* SVGAnimationDiscreteFunction.h */, 16233 55DCC51C2240605E00C26E32 /* SVGAnimationDiscreteFunctionImpl.h */, 16233 16234 55BE025B223B29C20032F08A /* SVGAnimationFunction.h */, 16234 16235 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */, … … 24113 24114 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */, 24114 24115 B22277E60D00BF1F0071B782 /* SVGAnimatedAngle.idl */, 24115 431A308713B8F978007791E4 /* SVGAnimatedBoolean.cpp */,24116 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */,24117 24116 B22277E70D00BF1F0071B782 /* SVGAnimatedBoolean.idl */, 24118 24117 43A625F713B3304000AC94B8 /* SVGAnimatedColor.cpp */, … … 31911 31910 B222797A0D00BF220071B782 /* SVGAnimateColorElement.h in Headers */, 31912 31911 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */, 31913 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */,31914 31912 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */, 31915 31913 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */, -
trunk/Source/WebCore/svg/SVGAnimationElement.h
r243114 r243121 25 25 #pragma once 26 26 27 #include "SVGAnimatedBoolean.h"28 27 #include "SVGExternalResourcesRequired.h" 29 28 #include "SVGSMILElement.h" -
trunk/Source/WebCore/svg/SVGAnimatorFactory.h
r243036 r243121 21 21 22 22 #include "SVGAnimatedAngle.h" 23 #include "SVGAnimatedBoolean.h"24 23 #include "SVGAnimatedColor.h" 25 24 #include "SVGAnimatedEnumeration.h" … … 51 50 return std::make_unique<SVGAnimatedAngleAnimator>(animationElement, contextElement); 52 51 case AnimatedBoolean: 53 return std::make_unique<SVGAnimatedBooleanAnimator>(animationElement, contextElement);52 return nullptr; 54 53 case AnimatedColor: 55 54 return std::make_unique<SVGAnimatedColorAnimator>(*animationElement, *contextElement); -
trunk/Source/WebCore/svg/SVGClipPathElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedEnumeration.h" 26 25 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGCursorElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedLength.h" 26 25 #include "SVGAnimatedString.h" -
trunk/Source/WebCore/svg/SVGDefsElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGExternalResourcesRequired.h" 26 25 #include "SVGGraphicsElement.h" -
trunk/Source/WebCore/svg/SVGExternalResourcesRequired.cpp
r234620 r243121 30 30 SVGExternalResourcesRequired::SVGExternalResourcesRequired(SVGElement* contextElement) 31 31 : m_contextElement(*contextElement) 32 , m_externalResourcesRequired(SVGAnimatedBoolean::create(contextElement)) 32 33 { 33 registerAttributes(); 34 } 35 36 void SVGExternalResourcesRequired::registerAttributes() 37 { 38 auto& registry = attributeRegistry(); 39 if (!registry.isEmpty()) 40 return; 41 registry.registerAttribute<SVGNames::externalResourcesRequiredAttr, &SVGEllipseElement::m_externalResourcesRequired>(); 34 static std::once_flag onceFlag; 35 std::call_once(onceFlag, [] { 36 PropertyRegistry::registerProperty<SVGNames::externalResourcesRequiredAttr, &SVGExternalResourcesRequired::m_externalResourcesRequired>(); 37 }); 42 38 } 43 39 … … 45 41 { 46 42 if (name == SVGNames::externalResourcesRequiredAttr) 47 setExternalResourcesRequired(value == "true");43 m_externalResourcesRequired->setBaseValInternal(value == "true"); 48 44 } 49 45 -
trunk/Source/WebCore/svg/SVGExternalResourcesRequired.h
r243114 r243121 51 51 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGExternalResourcesRequired>; 52 52 53 auto externalResourcesRequiredAnimated() { return m_externalResourcesRequired.animatedProperty(attributeOwnerProxy()); } 54 55 bool externalResourcesRequired() const { return m_externalResourcesRequired.value(); } 56 void setExternalResourcesRequired(bool externalResourcesRequired) { m_externalResourcesRequired.setValue(externalResourcesRequired); } 53 bool externalResourcesRequired() const { return m_externalResourcesRequired->currentValue(); } 54 SVGAnimatedBoolean& externalResourcesRequiredAnimated() { return m_externalResourcesRequired; } 57 55 58 56 protected: … … 74 72 75 73 private: 76 static void registerAttributes();77 74 AttributeOwnerProxy attributeOwnerProxy() { return { *this, m_contextElement }; } 78 75 79 76 SVGElement& m_contextElement; 80 SVGAnimatedBooleanAttributem_externalResourcesRequired;77 Ref<SVGAnimatedBoolean> m_externalResourcesRequired; 81 78 }; 82 79 -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
r243036 r243121 47 47 PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); 48 48 PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); 49 PropertyRegistry::registerProperty<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>(); 49 50 }); 50 51 } … … 80 81 &SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, 81 82 &SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>(); 82 registry.registerAttribute<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>();83 83 } 84 84 … … 153 153 if (name == SVGNames::preserveAlphaAttr) { 154 154 if (value == "true") 155 m_preserveAlpha .setValue(true);155 m_preserveAlpha->setBaseValInternal(true); 156 156 else if (value == "false") 157 m_preserveAlpha .setValue(false);157 m_preserveAlpha->setBaseValInternal(false); 158 158 else 159 159 document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing preserveAlphaAttr=\"" + value + "\". Filtered element will not be displayed."); -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h
r243114 r243121 79 79 float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } 80 80 float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } 81 bool preserveAlpha() const { return m_preserveAlpha .currentValue(attributeOwnerProxy()); }81 bool preserveAlpha() const { return m_preserveAlpha->currentValue(); } 82 82 83 83 RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } … … 92 92 RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } 93 93 RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } 94 RefPtr<SVGAnimatedBoolean> preserveAlphaAnimated() { return m_preserveAlpha.animatedProperty(attributeOwnerProxy()); }94 SVGAnimatedBoolean& preserveAlphaAnimated() { return m_preserveAlpha; } 95 95 96 96 private: … … 100 100 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } 101 101 static void registerAttributes(); 102 102 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 103 103 104 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; 104 105 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } … … 109 110 } 110 111 111 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }112 112 void parseAttribute(const QualifiedName&, const AtomicString&) override; 113 113 void svgAttributeChanged(const QualifiedName&) override; … … 132 132 SVGAnimatedNumberAttribute m_kernelUnitLengthX; 133 133 SVGAnimatedNumberAttribute m_kernelUnitLengthY; 134 SVGAnimatedBooleanAttribute m_preserveAlpha;134 Ref<SVGAnimatedBoolean> m_preserveAlpha { SVGAnimatedBoolean::create(this) }; 135 135 }; 136 136 -
trunk/Source/WebCore/svg/SVGFEImageElement.h
r243114 r243121 24 24 #include "CachedImageClient.h" 25 25 #include "CachedResourceHandle.h" 26 #include "SVGAnimatedBoolean.h"27 26 #include "SVGAnimatedPreserveAspectRatio.h" 28 27 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGFontElement.h
r243114 r243121 25 25 #if ENABLE(SVG_FONTS) 26 26 27 #include "SVGAnimatedBoolean.h"28 27 #include "SVGElement.h" 29 28 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGForeignObjectElement.h
r243114 r243121 20 20 #pragma once 21 21 22 #include "SVGAnimatedBoolean.h"23 22 #include "SVGAnimatedLength.h" 24 23 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGGElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGExternalResourcesRequired.h" 26 25 #include "SVGGraphicsElement.h" -
trunk/Source/WebCore/svg/SVGGradientElement.h
r243114 r243121 23 23 24 24 #include "Gradient.h" 25 #include "SVGAnimatedBoolean.h"26 25 #include "SVGAnimatedEnumeration.h" 27 26 #include "SVGAnimatedTransformList.h" -
trunk/Source/WebCore/svg/SVGMPathElement.h
r243114 r243121 21 21 #pragma once 22 22 23 #include "SVGAnimatedBoolean.h"24 23 #include "SVGAnimatedString.h" 25 24 #include "SVGElement.h" -
trunk/Source/WebCore/svg/SVGMarkerElement.h
r243114 r243121 23 23 24 24 #include "SVGAnimatedAngle.h" 25 #include "SVGAnimatedBoolean.h"26 25 #include "SVGAnimatedEnumeration.h" 27 26 #include "SVGAnimatedLength.h" -
trunk/Source/WebCore/svg/SVGMaskElement.h
r243114 r243121 21 21 #pragma once 22 22 23 #include "SVGAnimatedBoolean.h"24 23 #include "SVGAnimatedEnumeration.h" 25 24 #include "SVGAnimatedLength.h" -
trunk/Source/WebCore/svg/SVGPathElement.h
r243114 r243121 23 23 24 24 #include "Path.h" 25 #include "SVGAnimatedBoolean.h"26 25 #include "SVGAnimatedNumber.h" 27 26 #include "SVGAnimatedPath.h" -
trunk/Source/WebCore/svg/SVGPatternElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedEnumeration.h" 26 25 #include "SVGAnimatedLength.h" -
trunk/Source/WebCore/svg/SVGRectElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedLength.h" 26 25 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGSVGElement.h
r243114 r243121 23 23 24 24 #include "FloatPoint.h" 25 #include "SVGAnimatedBoolean.h"26 25 #include "SVGAnimatedLength.h" 27 26 #include "SVGAnimatedPreserveAspectRatio.h" -
trunk/Source/WebCore/svg/SVGScriptElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedString.h" 26 25 #include "SVGElement.h" -
trunk/Source/WebCore/svg/SVGSwitchElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGExternalResourcesRequired.h" 26 25 #include "SVGGraphicsElement.h" -
trunk/Source/WebCore/svg/SVGSymbolElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedPreserveAspectRatio.h" 26 25 #include "SVGAnimatedRect.h" -
trunk/Source/WebCore/svg/SVGTextContentElement.h
r243114 r243121 22 22 #pragma once 23 23 24 #include "SVGAnimatedBoolean.h"25 24 #include "SVGAnimatedEnumeration.h" 26 25 #include "SVGAnimatedLength.h" -
trunk/Source/WebCore/svg/SVGUseElement.h
r243114 r243121 24 24 #include "CachedResourceHandle.h" 25 25 #include "CachedSVGDocumentClient.h" 26 #include "SVGAnimatedBoolean.h"27 26 #include "SVGAnimatedLength.h" 28 27 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
r243036 r243121 34 34 35 35 template<typename OwnerType> 36 class SVGAnimatedBooleanAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedBoolean> { 37 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedBoolean>; 38 using Base::property; 39 40 public: 41 using Base::Base; 42 template<Ref<SVGAnimatedBoolean> OwnerType::*property> 43 constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedBooleanAccessor, property>(); } 44 45 private: 46 std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final 47 { 48 return SVGAnimatedBooleanAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); 49 } 50 51 void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final 52 { 53 static_cast<SVGAnimatedBooleanAnimator&>(animator).appendAnimatedInstance(property(owner)); 54 } 55 }; 56 57 template<typename OwnerType> 36 58 class SVGAnimatedIntegerAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedInteger> { 37 59 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedInteger>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
r243036 r243121 29 29 #include "SVGAnimatedPropertyImpl.h" 30 30 #include "SVGAnimationAdditiveValueFunctionImpl.h" 31 #include "SVGAnimationDiscreteFunctionImpl.h" 31 32 32 33 namespace WebCore { … … 36 37 template<typename AnimatedPropertyAnimator1, typename AnimatedPropertyAnimator2> 37 38 class SVGAnimatedPropertyPairAnimator; 39 40 class SVGAnimatedBooleanAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedBoolean, SVGAnimationBooleanFunction> { 41 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedBoolean, SVGAnimationBooleanFunction>; 42 using Base::Base; 43 44 public: 45 static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedBoolean>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) 46 { 47 return std::unique_ptr<SVGAnimatedBooleanAnimator>(new SVGAnimatedBooleanAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); 48 } 49 50 private: 51 void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final 52 { 53 bool& animated = m_animated->animVal(); 54 m_function.progress(targetElement, percentage, repeatCount, animated); 55 } 56 }; 38 57 39 58 class SVGAnimatedIntegerAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedInteger, SVGAnimationIntegerFunction> { -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
r243036 r243121 27 27 28 28 #include "SVGAnimatedAngle.h" 29 #include "SVGAnimatedBoolean.h"30 29 #include "SVGAnimatedEnumeration.h" 31 30 #include "SVGAnimatedLength.h" … … 42 41 namespace WebCore { 43 42 43 using SVGAnimatedBoolean = SVGAnimatedPrimitiveProperty<bool>; 44 44 using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>; 45 45 -
trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunction.h
r243120 r243121 26 26 #pragma once 27 27 28 #include "SVGAnimatedAngle.h"29 #include "SVGAnimatedBoolean.h"30 #include "SVGAnimatedEnumeration.h"31 #include "SVGAnimatedLength.h"32 #include "SVGAnimatedLengthList.h"33 #include "SVGAnimatedNumber.h"34 #include "SVGAnimatedNumberList.h"35 #include "SVGAnimatedPointList.h"36 #include "SVGAnimatedPreserveAspectRatio.h"37 #include "SVGAnimatedPrimitiveProperty.h"38 #include "SVGAnimatedRect.h"39 #include "SVGAnimatedString.h"40 #include "SVGAnimatedTransformList.h"41 42 28 namespace WebCore { 43 29 44 using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>; 30 template<typename ValueType> 31 class SVGAnimationDiscreteFunction : public SVGAnimationFunction { 32 public: 33 SVGAnimationDiscreteFunction(AnimationMode animationMode, CalcMode, bool, bool) 34 : SVGAnimationFunction(animationMode) 35 { 36 } 37 38 bool isDiscrete() const override { return true; } 39 40 void setToAtEndOfDurationValue(const String&) override 41 { 42 ASSERT_NOT_REACHED(); 43 } 44 45 void setFromAndByValues(SVGElement*, const String&, const String&) override 46 { 47 ASSERT_NOT_REACHED(); 48 } 49 50 void progress(SVGElement*, float percentage, unsigned, ValueType& animated) 51 { 52 if ((m_animationMode == AnimationMode::FromTo && percentage > 0.5) || m_animationMode == AnimationMode::To || percentage == 1) 53 animated = m_to; 54 else 55 animated = m_from; 56 } 57 58 protected: 59 ValueType m_from; 60 ValueType m_to; 61 }; 45 62 46 63 } -
trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h
r243120 r243121 1 1 /* 2 * Copyright (C) 201 8-2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedAngle.h" 29 #include "SVGAnimatedBoolean.h" 30 #include "SVGAnimatedEnumeration.h" 31 #include "SVGAnimatedLength.h" 32 #include "SVGAnimatedLengthList.h" 33 #include "SVGAnimatedNumber.h" 34 #include "SVGAnimatedNumberList.h" 35 #include "SVGAnimatedPointList.h" 36 #include "SVGAnimatedPreserveAspectRatio.h" 37 #include "SVGAnimatedPrimitiveProperty.h" 38 #include "SVGAnimatedRect.h" 39 #include "SVGAnimatedString.h" 40 #include "SVGAnimatedTransformList.h" 28 #include "SVGAnimationDiscreteFunction.h" 29 #include "SVGPropertyTraits.h" 41 30 42 31 namespace WebCore { 43 32 44 using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>; 33 class SVGAnimationBooleanFunction : public SVGAnimationDiscreteFunction<bool> { 34 public: 35 using Base = SVGAnimationDiscreteFunction<bool>; 36 using Base::Base; 37 38 void setFromAndToValues(SVGElement*, const String& from, const String& to) override 39 { 40 m_from = SVGPropertyTraits<bool>::fromString(from); 41 m_to = SVGPropertyTraits<bool>::fromString(to); 42 } 43 }; 45 44 46 45 } -
trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h
r243036 r243121 26 26 #pragma once 27 27 28 #include "SVGAnimatedBoolean.h"29 28 #include "SVGAnimatedEnumeration.h" 30 29 #include "SVGAnimatedLength.h" … … 68 67 69 68 // Animatable attributes 70 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedBooleanAttribute OwnerType::*attribute>71 void registerAttribute()72 {73 registerAttribute(SVGAnimatedBooleanAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());74 }75 76 69 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, typename EnumType, SVGAnimatedEnumerationAttribute<EnumType> OwnerType::*attribute> 77 70 void registerAttribute() -
trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h
r243036 r243121 43 43 } 44 44 45 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedBoolean> OwnerType::*property> 46 static void registerProperty() 47 { 48 registerProperty(attributeName, SVGAnimatedBooleanAccessor<OwnerType>::template singleton<property>()); 49 } 50 45 51 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property> 46 52 static void registerProperty()
Note:
See TracChangeset
for help on using the changeset viewer.