Changeset 243730 in webkit
- Timestamp:
- Apr 1, 2019 6:31:54 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 15 deleted
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243719 r243730 1 2019-04-01 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList 4 https://bugs.webkit.org/show_bug.cgi?id=196086 5 6 Reviewed by Simon Fraser. 7 8 * svg/dom/SVGTransformList-basics-expected.txt: 9 * svg/dom/SVGTransformList-basics.xhtml: 10 These changes are required because SVGTransfromList will be following the 11 SVG2 specs regarding adding new items to the list. 12 13 See https://www.w3.org/TR/SVG/types.html#TermListInterface. 14 1 15 2019-04-01 Devin Rousso <drousso@apple.com> 2 16 -
trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt
r219663 r243730 28 28 PASS circle1.transform.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments. 29 29 PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString') is circle1.transform.baseVal.getItem(0) 30 PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" 30 31 PASS circle1.transform.baseVal.numberOfItems is 2 31 32 PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" … … 33 34 PASS circle1.getAttribute('transform') is "translate(10 10) scale(2 2)" 34 35 PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), circle1) is circle1.transform.baseVal.getItem(0) 36 PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" 35 37 PASS circle1.transform.baseVal.numberOfItems is 2 36 38 PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" … … 38 40 PASS circle1.getAttribute('transform') is "scale(2 2) translate(10 10)" 39 41 PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), null) is circle1.transform.baseVal.getItem(0) 42 PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" 40 43 PASS circle1.transform.baseVal.numberOfItems is 2 41 44 PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" … … 43 46 PASS circle1.getAttribute('transform') is "translate(10 10) scale(2 2)" 44 47 PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 0) is circle1.transform.baseVal.getItem(0) 48 PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" 45 49 PASS circle1.transform.baseVal.numberOfItems is 2 46 50 PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" -
trunk/LayoutTests/svg/dom/SVGTransformList-basics.xhtml
r180129 r243730 75 75 76 76 shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString')", "circle1.transform.baseVal.getItem(0)"); 77 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); 77 78 shouldBe("circle1.transform.baseVal.numberOfItems", "2"); 78 79 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); … … 81 82 82 83 shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), circle1)", "circle1.transform.baseVal.getItem(0)"); 84 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); 83 85 shouldBe("circle1.transform.baseVal.numberOfItems", "2"); 84 86 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); … … 87 89 88 90 shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), null)", "circle1.transform.baseVal.getItem(0)"); 91 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); 89 92 shouldBe("circle1.transform.baseVal.numberOfItems", "2"); 90 93 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); … … 93 96 94 97 shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 0)", "circle1.transform.baseVal.getItem(0)"); 98 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); 95 99 shouldBe("circle1.transform.baseVal.numberOfItems", "2"); 96 100 shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); -
trunk/Source/WebCore/ChangeLog
r243719 r243730 1 2019-04-01 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList 4 https://bugs.webkit.org/show_bug.cgi?id=196086 5 6 Reviewed by Simon Fraser. 7 8 The IDL changes: 9 10 SVGTransform.idl: 11 Remove the NewObject qualifier from matrix attribute. This matches 12 the specs: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGTransform. 13 SVGTransform will internally hold an SVGMatrix. A change in this 14 SVGMatrix will affect the container SVGTransform. 15 16 SVGTransformList.idl: 17 Remove the NewObject qualifier from consolidate() method. This matches 18 the specs: 19 https://www.w3.org/TR/SVG11/coords.html#__svg__SVGTransformList__consolidate 20 The method consolidate() should return a reference to the first item 21 in the list after consolidating it. 22 23 Code changes: 24 25 -- SVGMatrix is now a superclass of SVGValueProperty<AffineTransform>. 26 No need for SVGMatrixValue since it was wrapper of AffineTransform. 27 28 -- SVGTransformValue now holds a Ref<SVGMatrix> member in addition to the 29 angle and the rotationCenter. Ref<SVGMatrix> is what SVGTransform.matrix 30 will return. So a change in this matrix will change the owner SVGTransform. 31 32 -- SVGTransform is now the owner of SVGMatrix via its SVGTransformValue. 33 34 -- SVGTransformList is now a superclass of SVGValuePropertyList<SVGTransform>. 35 It is responsible for parsing a String to items of SVGTransform. 36 37 -- SVGAnimatedTransformList is now defined as SVGAnimatedPropertyList< 38 SVGTransformList>. 39 40 Note the ownership chain of these objects is the following: 41 42 -- SVGAnimatedTransformList owns the SVGTransformList via its baseVal 43 and animVal members. 44 45 -- SVGTransformList owns SVGTransform via its list of items 46 47 -- SVGTransform owns SVGMatrix via its SVGTransformValue. 48 49 So a change in SVGMatrix will propagate to the owner SVGElement through 50 the following ownership chain: 51 52 SVGMatrix 53 |_ SVGTransfrom 54 |_ SVGTransformList 55 |_ SVGAmimatedTransformList 56 |_ SVGElement 57 58 To get the mechanics of this change right, a new accessor, a new animator 59 and animation functions are added for the SVGAnimatedTransformList. 60 61 -- SVGViewSpec used to hold an SVGAnimatedTransformListAttribute for the 62 member m_transform although this member should not be animated. See the 63 comment in the old SVGViewSpec::transform(). This has been changed in this 64 patch. SVGViewSpec now holds Ref<SVGTransformList> which matches the specs: 65 https://www.w3.org/TR/SVG11/types.html#InterfaceSVGViewSpec. 66 67 * Sources.txt: 68 * WebCore.xcodeproj/project.pbxproj: 69 * svg/SVGAnimateElementBase.cpp: 70 (WebCore::SVGAnimateElementBase::attributeAnimationController): 71 (WebCore::SVGAnimateElementBase::hasValidAttributeType const): 72 (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): 73 (WebCore::SVGAnimateElementBase::calculateFromAndToValues): 74 (WebCore::SVGAnimateElementBase::calculateFromAndByValues): 75 * svg/SVGAnimateElementBase.h: 76 (WebCore::SVGAnimateElementBase::animateRangeString const): 77 * svg/SVGAnimateTransformElement.cpp: 78 (WebCore::SVGAnimateTransformElement::animateRangeString const): 79 * svg/SVGAnimateTransformElement.h: 80 This change is needed because animating the transform attribute can be 81 written as 82 <animate ... from="translate(100)" to="translate(200)"/> 83 or 84 <animateTransform type="translate" from="100" to="200"/>" 85 So we need to surround the animation range string with the type qualifier 86 for animateTransform. 87 88 * svg/SVGAnimatedTransformList.cpp: Removed. 89 * svg/SVGAnimatedTransformList.h: Removed. 90 * svg/SVGAnimatedType.h: Removed. 91 * svg/SVGAnimatedTypeAnimator.cpp: Removed. 92 * svg/SVGAnimatedTypeAnimator.h: Removed. 93 * svg/SVGAnimationElement.cpp: 94 (WebCore::SVGAnimationElement::adjustForInheritance): Deleted. 95 * svg/SVGAnimationElement.h: 96 (WebCore::SVGAnimationElement::adjustForInheritance): Deleted. 97 (WebCore::SVGAnimationElement::adjustFromToListValues): Deleted. 98 (WebCore::SVGAnimationElement::animateDiscreteType): Deleted. 99 These functions were used by SVGLegacyAttributeAnimationController. 100 101 * svg/SVGAnimatorFactory.h: Removed. 102 * svg/SVGExternalResourcesRequired.h: 103 (WebCore::SVGExternalResourcesRequired::isKnownAttribute): 104 * svg/SVGFEImageElement.h: 105 * svg/SVGFEMorphologyElement.h: 106 * svg/SVGFETileElement.h: 107 * svg/SVGFitToViewBox.h: 108 (WebCore::SVGFitToViewBox::isKnownAttribute): 109 * svg/SVGGradientElement.cpp: 110 (WebCore::SVGGradientElement::SVGGradientElement): 111 (WebCore::SVGGradientElement::parseAttribute): 112 (WebCore::SVGGradientElement::registerAttributes): Deleted. 113 * svg/SVGGradientElement.h: 114 (WebCore::SVGGradientElement::gradientTransform const): 115 (WebCore::SVGGradientElement::gradientTransformAnimated): 116 (WebCore::SVGGradientElement::isKnownAttribute): 117 * svg/SVGGraphicsElement.cpp: 118 (WebCore::SVGGraphicsElement::SVGGraphicsElement): 119 (WebCore::SVGGraphicsElement::animatedLocalTransform const): 120 (WebCore::SVGGraphicsElement::parseAttribute): 121 (WebCore::SVGGraphicsElement::svgAttributeChanged): 122 There is one attribute for this element which is "SVGNames::transformAttr" 123 So there is no need to check for it twice. 124 125 (WebCore::SVGGraphicsElement::registerAttributes): Deleted. 126 * svg/SVGGraphicsElement.h: 127 (WebCore::SVGGraphicsElement::transform const): 128 (WebCore::SVGGraphicsElement::transformAnimated): 129 (WebCore::SVGGraphicsElement::isKnownAttribute): Deleted. 130 * svg/SVGLangSpace.cpp: 131 (WebCore::SVGLangSpace::SVGLangSpace): 132 (WebCore::SVGLangSpace::xmlspace const): 133 (WebCore::SVGLangSpace::isKnownAttribute): 134 (WebCore::SVGLangSpace::svgAttributeChanged): 135 (WebCore::SVGLangSpace::registerAttributes): Deleted. 136 * svg/SVGLangSpace.h: 137 (WebCore::SVGLangSpace::xmllang const): 138 (WebCore::SVGLangSpace::setXmllang): 139 (WebCore::SVGLangSpace::setXmlspace): 140 (WebCore::SVGLangSpace::attributeRegistry): Deleted. 141 (WebCore::SVGLangSpace::isKnownAttribute): Deleted. 142 * svg/SVGLegacyAttributeAnimationController.cpp: Removed. 143 * svg/SVGLegacyAttributeAnimationController.h: Removed. 144 * svg/SVGLinearGradientElement.cpp: 145 (WebCore::setGradientAttributes): 146 * svg/SVGMaskElement.h: 147 * svg/SVGMatrix.h: 148 (WebCore::SVGMatrix::create): 149 (WebCore::SVGMatrix::a const): 150 (WebCore::SVGMatrix::setA): 151 (WebCore::SVGMatrix::b const): 152 (WebCore::SVGMatrix::setB): 153 (WebCore::SVGMatrix::c const): 154 (WebCore::SVGMatrix::setC): 155 (WebCore::SVGMatrix::d const): 156 (WebCore::SVGMatrix::setD): 157 (WebCore::SVGMatrix::e const): 158 (WebCore::SVGMatrix::setE): 159 (WebCore::SVGMatrix::f const): 160 (WebCore::SVGMatrix::setF): 161 (WebCore::SVGMatrix::multiply const): 162 (WebCore::SVGMatrix::inverse const): 163 (WebCore::SVGMatrix::translate const): 164 (WebCore::SVGMatrix::scale const): 165 (WebCore::SVGMatrix::scaleNonUniform const): 166 (WebCore::SVGMatrix::rotate const): 167 (WebCore::SVGMatrix::rotateFromVector const): 168 (WebCore::SVGMatrix::flipX const): 169 (WebCore::SVGMatrix::flipY const): 170 (WebCore::SVGMatrix::skewX const): 171 (WebCore::SVGMatrix::skewY const): 172 * svg/SVGPatternElement.cpp: 173 (WebCore::SVGPatternElement::SVGPatternElement): 174 (WebCore::SVGPatternElement::parseAttribute): 175 (WebCore::SVGPatternElement::svgAttributeChanged): 176 (WebCore::SVGPatternElement::collectPatternAttributes const): 177 (WebCore::SVGPatternElement::localCoordinateSpaceTransform const): 178 (WebCore::SVGPatternElement::registerAttributes): Deleted. 179 * svg/SVGPatternElement.h: 180 * svg/SVGPoint.h: 181 (WebCore::SVGPoint::matrixTransform const): 182 * svg/SVGPolyElement.h: 183 (WebCore::SVGPolyElement::isKnownAttribute): Deleted. 184 * svg/SVGRadialGradientElement.cpp: 185 (WebCore::setGradientAttributes): 186 * svg/SVGSVGElement.cpp: 187 (WebCore::SVGSVGElement::createSVGTransform): 188 (WebCore::SVGSVGElement::createSVGTransformFromMatrix): 189 (WebCore::SVGSVGElement::viewBoxToViewTransform const): 190 * svg/SVGTextElement.cpp: 191 (WebCore::SVGTextElement::animatedLocalTransform const): 192 * svg/SVGTransform.cpp: Removed. 193 * svg/SVGTransform.h: 194 (WebCore::SVGTransform::create): 195 (WebCore::SVGTransform::~SVGTransform): 196 (WebCore::SVGTransform::clone const): 197 (WebCore::SVGTransform::type): 198 (WebCore::SVGTransform::angle): 199 (WebCore::SVGTransform::matrix): 200 (WebCore::SVGTransform::setMatrix): 201 (WebCore::SVGTransform::setTranslate): 202 (WebCore::SVGTransform::setScale): 203 (WebCore::SVGTransform::setRotate): 204 (WebCore::SVGTransform::setSkewX): 205 (WebCore::SVGTransform::setSkewY): 206 (WebCore::SVGTransform::SVGTransform): 207 * svg/SVGTransform.idl: 208 * svg/SVGTransformList.h: 209 * svg/SVGTransformList.idl: 210 * svg/SVGTransformListValues.cpp: Removed. 211 * svg/SVGTransformListValues.h: Removed. 212 * svg/SVGTransformValue.cpp: Removed. 213 * svg/SVGTransformValue.h: 214 (WebCore::SVGTransformValue::SVGTransformValue): 215 (WebCore::SVGTransformValue::operator=): 216 (WebCore::SVGTransformValue::matrix const): 217 (WebCore::SVGTransformValue::rotationCenter const): 218 (WebCore::SVGTransformValue::isValid const): 219 (WebCore::SVGTransformValue::setMatrix): 220 (WebCore::SVGTransformValue::matrixDidChange): 221 (WebCore::SVGTransformValue::translate const): 222 (WebCore::SVGTransformValue::setTranslate): 223 (WebCore::SVGTransformValue::scale const): 224 (WebCore::SVGTransformValue::setScale): 225 (WebCore::SVGTransformValue::setRotate): 226 (WebCore::SVGTransformValue::setSkewX): 227 (WebCore::SVGTransformValue::setSkewY): 228 (WebCore::SVGTransformValue::valueAsString const): 229 (WebCore::SVGTransformValue::prefixForTransfromType): 230 (WebCore::SVGTransformValue::appendNumbers const): 231 (WebCore::SVGTransformValue::appendMatrix const): 232 (WebCore::SVGTransformValue::appendTranslate const): 233 (WebCore::SVGTransformValue::appendScale const): 234 (WebCore::SVGTransformValue::appendRotate const): 235 (WebCore::SVGTransformValue::appendSkewX const): 236 (WebCore::SVGTransformValue::appendSkewY const): 237 (WebCore::SVGTransformValue::matrix): Deleted. 238 * svg/SVGTransformable.cpp: 239 (WebCore::SVGTransformable::parseAndSkipType): 240 (WebCore::parseAndSkipType): Deleted. 241 (WebCore::SVGTransformable::parseTransformAttribute): Deleted. 242 The code of this function was moved to SVGTransformList::parse(). 243 244 * svg/SVGTransformable.h: 245 There is no need for enum TransformParsingMode. It was used by 246 SVGViewSpec::parseViewSpec() to tell SVGTransformable::parseTransformAttribute() 247 not to clear the list. SVGTransfromList now has two parse() functions: 248 one public and the second is private. The public one clear the list 249 before parsing the input String. The private one just does the parsing. 250 SVGViewSpec::parseViewSpec() calls the private once since it is a friend 251 of SVGTransfromList. 252 253 * svg/SVGValue.h: Removed. 254 * svg/SVGViewSpec.cpp: 255 (WebCore::SVGViewSpec::SVGViewSpec): 256 (WebCore::SVGViewSpec::reset): 257 (WebCore::SVGViewSpec::parseViewSpec): 258 (WebCore::SVGViewSpec::registerAttributes): Deleted. 259 (WebCore::SVGViewSpec::transform): Deleted. 260 * svg/SVGViewSpec.h: 261 * svg/properties/SVGAnimatedPropertyAccessorImpl.h: 262 * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: 263 * svg/properties/SVGAnimatedPropertyImpl.h: 264 * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed. 265 * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: 266 (WebCore::SVGAnimationTransformListFunction::progress): 267 * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: 268 * svg/properties/SVGAttributeRegistry.h: 269 * svg/properties/SVGMatrixTearOff.h: Removed. 270 * svg/properties/SVGPropertyAccessorImpl.h: 271 * svg/properties/SVGPropertyOwnerRegistry.h: 272 (WebCore::SVGPropertyOwnerRegistry::registerProperty): 273 1 274 2019-04-01 Devin Rousso <drousso@apple.com> 2 275 -
trunk/Source/WebCore/Sources.txt
r243666 r243730 2230 2230 svg/SVGAnimateMotionElement.cpp 2231 2231 svg/SVGAnimateTransformElement.cpp 2232 svg/SVGAnimatedTransformList.cpp2233 svg/SVGAnimatedTypeAnimator.cpp2234 2232 svg/SVGAnimationElement.cpp 2235 2233 svg/SVGAttributeAnimationController.cpp … … 2292 2290 svg/SVGImageLoader.cpp 2293 2291 svg/SVGLangSpace.cpp 2294 svg/SVGLegacyAttributeAnimationController.cpp2295 2292 svg/SVGLengthContext.cpp 2296 2293 svg/SVGLengthValue.cpp … … 2339 2336 svg/SVGTitleElement.cpp 2340 2337 svg/SVGToOTFFontConversion.cpp 2341 svg/SVGTransform.cpp2342 2338 svg/SVGTransformDistance.cpp 2343 svg/SVGTransformListValues.cpp2344 svg/SVGTransformValue.cpp2345 2339 svg/SVGTransformable.cpp 2346 2340 svg/SVGURIReference.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243703 r243730 242 242 081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; }; 243 243 081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */; }; 244 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */; };245 244 083DAEA70F01A7FB00342754 /* RenderTextControlMultiLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 083DAEA30F01A7FB00342754 /* RenderTextControlMultiLine.h */; }; 246 245 083DAEA90F01A7FB00342754 /* RenderTextControlSingleLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 083DAEA50F01A7FB00342754 /* RenderTextControlSingleLine.h */; }; … … 255 254 0854B0231255E4E600B9CDD0 /* SVGRootInlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0111255E4E600B9CDD0 /* SVGRootInlineBox.h */; }; 256 255 0854B0251255E4E600B9CDD0 /* SVGTextQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */; }; 257 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */; };258 256 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; }; 259 257 08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 274 272 08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; }; 275 273 08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 276 08CA3D4412894A3800FFF260 /* SVGMatrixTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */; };277 274 08EDE19F12A50B8E00B95797 /* SVGRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08EDE19E12A50B8E00B95797 /* SVGRect.h */; }; 278 275 08F0BFC31255C53C00075185 /* SVGTextChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F0BFBE1255C53C00075185 /* SVGTextChunk.h */; }; … … 1186 1183 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */; }; 1187 1184 439176E012DA25E17BAF80A2 /* MathMLStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 439176CC12DA25E17BAF80A2 /* MathMLStyle.h */; }; 1188 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334013A6911C00C20F4F /* SVGAnimatedType.h */; };1189 439D334413A6911C00C20F4F /* SVGAnimatedTypeAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */; };1190 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */; };1191 1185 43B85ED418CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */; }; 1192 1186 43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 43C092BA12D9E4EE00A989C3 /* RenderSVGForeignObject.h */; }; … … 5548 5542 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; }; 5549 5543 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilterBuilder.h; sourceTree = "<group>"; }; 5550 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformList.h; sourceTree = "<group>"; };5551 5544 083DAEA20F01A7FB00342754 /* RenderTextControlMultiLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControlMultiLine.cpp; sourceTree = "<group>"; }; 5552 5545 083DAEA30F01A7FB00342754 /* RenderTextControlMultiLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextControlMultiLine.h; sourceTree = "<group>"; }; … … 5571 5564 0854B0121255E4E600B9CDD0 /* SVGTextQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextQuery.cpp; sourceTree = "<group>"; }; 5572 5565 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextQuery.h; sourceTree = "<group>"; }; 5573 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformListPropertyTearOff.h; sourceTree = "<group>"; };5574 5566 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; }; 5575 5567 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataBuilder.h; sourceTree = "<group>"; }; … … 5596 5588 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterEffect.cpp; sourceTree = "<group>"; }; 5597 5589 08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterEffect.h; sourceTree = "<group>"; }; 5598 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMatrixTearOff.h; sourceTree = "<group>"; };5599 5590 08EDE19E12A50B8E00B95797 /* SVGRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRect.h; sourceTree = "<group>"; }; 5600 5591 08F0BFBD1255C53C00075185 /* SVGTextChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextChunk.cpp; sourceTree = "<group>"; }; … … 7526 7517 439176CB12DA25E17BAF80A2 /* MathMLStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLStyle.cpp; sourceTree = "<group>"; }; 7527 7518 439176CC12DA25E17BAF80A2 /* MathMLStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLStyle.h; sourceTree = "<group>"; }; 7528 439D334013A6911C00C20F4F /* SVGAnimatedType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedType.h; sourceTree = "<group>"; };7529 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTypeAnimator.h; sourceTree = "<group>"; };7530 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatorFactory.h; sourceTree = "<group>"; };7531 7519 43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoClassAndCompatibilityElementMap.py; sourceTree = "<group>"; }; 7532 7520 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectorPseudoClassAndCompatibilityElementMap.cpp; path = DerivedSources/WebCore/SelectorPseudoClassAndCompatibilityElementMap.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; … … 8501 8489 550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8502 8490 55137B2C20379E550001004B /* SVGMarkerTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerTypes.h; sourceTree = "<group>"; }; 8503 55137B34203CEB710001004B /* SVGValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValue.h; sourceTree = "<group>"; };8504 8491 55346AF021150FAF0059BCDD /* SVGAttributeOwnerProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeOwnerProxy.h; sourceTree = "<group>"; }; 8505 8492 55346AFA2117FFAF0059BCDD /* SVGAttributeOwnerProxyImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeOwnerProxyImpl.h; sourceTree = "<group>"; }; … … 9284 9271 7156BC9F21CA350600534397 /* BasicEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BasicEffectTiming.h; sourceTree = "<group>"; }; 9285 9272 7157E3D11DC1EE4B0094550E /* scrubbing-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "scrubbing-support.js"; sourceTree = "<group>"; }; 9286 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTransformList.cpp; sourceTree = "<group>"; };9287 9273 715AD71D2050512400D592DC /* DeclarativeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeclarativeAnimation.h; sourceTree = "<group>"; }; 9288 9274 715AD71F2050512400D592DC /* DeclarativeAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeclarativeAnimation.cpp; sourceTree = "<group>"; }; … … 9386 9372 723F97BC2238EE08007F079C /* SVGAttributeAnimationController.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeAnimationController.cpp; sourceTree = "<group>"; }; 9387 9373 723F97BD2238EE08007F079C /* SVGAttributeAnimationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAnimationController.h; sourceTree = "<group>"; }; 9388 723F97BE2239512D007F079C /* SVGLegacyAttributeAnimationController.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLegacyAttributeAnimationController.cpp; sourceTree = "<group>"; };9389 723F97BF2239512D007F079C /* SVGLegacyAttributeAnimationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGLegacyAttributeAnimationController.h; sourceTree = "<group>"; };9390 9374 723F97C022396B88007F079C /* SVGAttributeAnimationControllerBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAnimationControllerBase.h; sourceTree = "<group>"; }; 9391 9375 723F97C122397725007F079C /* SVGAttributeAnimationControllerBase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeAnimationControllerBase.cpp; sourceTree = "<group>"; }; … … 9622 9606 7C330A061DF9F95100D3395C /* JSPositionOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionOptions.h; sourceTree = "<group>"; }; 9623 9607 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = "<group>"; }; 9624 7C39C36C1DDB8BB000FEFB29 /* SVGTransformListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformListValues.cpp; sourceTree = "<group>"; };9625 7C39C36D1DDB8BB000FEFB29 /* SVGTransformListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformListValues.h; sourceTree = "<group>"; };9626 9608 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; }; 9627 9609 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = "<group>"; }; … … 9872 9854 7CE58D521DD7B09300128552 /* SVGLengthValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthValue.cpp; sourceTree = "<group>"; }; 9873 9855 7CE58D531DD7B09300128552 /* SVGLengthValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthValue.h; sourceTree = "<group>"; }; 9874 7CE58D551DD7D96D00128552 /* SVGTransformValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformValue.cpp; sourceTree = "<group>"; };9875 9856 7CE58D561DD7D96D00128552 /* SVGTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformValue.h; sourceTree = "<group>"; }; 9876 7CE58D591DD7DE5200128552 /* SVGTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransform.cpp; sourceTree = "<group>"; };9877 9857 7CE68342192143A800F4D928 /* UserMessageHandlerDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandlerDescriptor.cpp; sourceTree = "<group>"; }; 9878 9858 7CE68343192143A800F4D928 /* UserMessageHandlerDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlerDescriptor.h; sourceTree = "<group>"; }; … … 10045 10025 836D032E1DA8A13200FFD96B /* JSClipboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClipboardEvent.h; sourceTree = "<group>"; }; 10046 10026 836DAA051CEAB7CD00A2B707 /* RenderDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderDescendantIterator.h; sourceTree = "<group>"; }; 10047 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = "<group>"; };10048 10027 837056881F50915000D93425 /* JSFileCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileCallback.cpp; sourceTree = "<group>"; }; 10049 10028 837056891F50915000D93425 /* JSFileSystemEntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemEntryCallback.h; sourceTree = "<group>"; }; … … 13867 13846 D00D77FE2242ED450043F12C /* WebGPUComputePassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUComputePassEncoder.cpp; sourceTree = "<group>"; }; 13868 13847 D00D77FF2242ED450043F12C /* WebGPUComputePassEncoder.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUComputePassEncoder.idl; sourceTree = "<group>"; }; 13869 13848 D00F5940216ECC7A000D71DB /* DOMWindowWebGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMWindowWebGPU.h; sourceTree = "<group>"; }; 13870 13849 D00F5941216ECC7A000D71DB /* DOMWindowWebGPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowWebGPU.cpp; sourceTree = "<group>"; }; 13871 13850 D00F5942216ECC7A000D71DB /* DOMWindowWebGPU.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMWindowWebGPU.idl; sourceTree = "<group>"; }; … … 16024 16003 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */, 16025 16004 55FA7FFE21110E6E005AEFE7 /* SVGAnimatedPropertyType.h */, 16026 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */,16027 16005 721443452240C8BA00F12FF7 /* SVGAnimatedValueProperty.h */, 16028 16006 55BE025F223B29C50032F08A /* SVGAnimationAdditiveFunction.h */, … … 16052 16030 0810764312828556007C63BA /* SVGListProperty.h */, 16053 16031 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */, 16054 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */,16055 16032 55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */, 16056 16033 55BE025A223B29C20032F08A /* SVGPointerMemberAccessor.h */, … … 23808 23785 B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */, 23809 23786 B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */, 23810 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */,23811 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */,23812 23787 B22277F80D00BF1F0071B782 /* SVGAnimatedTransformList.idl */, 23813 439D334013A6911C00C20F4F /* SVGAnimatedType.h */,23814 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */,23815 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */,23816 23788 B22277F90D00BF1F0071B782 /* SVGAnimateElement.cpp */, 23817 23789 B22277FA0D00BF1F0071B782 /* SVGAnimateElement.h */, … … 23828 23800 B22278020D00BF1F0071B782 /* SVGAnimationElement.h */, 23829 23801 B22278030D00BF1F0071B782 /* SVGAnimationElement.idl */, 23830 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */,23831 23802 723F97BC2238EE08007F079C /* SVGAttributeAnimationController.cpp */, 23832 23803 723F97BD2238EE08007F079C /* SVGAttributeAnimationController.h */, … … 24002 23973 B22278990D00BF200071B782 /* SVGLangSpace.cpp */, 24003 23974 B222789A0D00BF200071B782 /* SVGLangSpace.h */, 24004 723F97BE2239512D007F079C /* SVGLegacyAttributeAnimationController.cpp */,24005 723F97BF2239512D007F079C /* SVGLegacyAttributeAnimationController.h */,24006 23975 7CE58D511DD7B09300128552 /* SVGLength.h */, 24007 23976 B222789E0D00BF200071B782 /* SVGLength.idl */, … … 24170 24139 1CCDF5BB1990332400BCEBAD /* SVGToOTFFontConversion.cpp */, 24171 24140 1CCDF5BC1990332400BCEBAD /* SVGToOTFFontConversion.h */, 24172 7CE58D591DD7DE5200128552 /* SVGTransform.cpp */,24173 24141 B22279410D00BF210071B782 /* SVGTransform.h */, 24174 24142 B22279420D00BF210071B782 /* SVGTransform.idl */, … … 24179 24147 B22279490D00BF210071B782 /* SVGTransformList.h */, 24180 24148 B222794A0D00BF210071B782 /* SVGTransformList.idl */, 24181 7C39C36C1DDB8BB000FEFB29 /* SVGTransformListValues.cpp */,24182 7C39C36D1DDB8BB000FEFB29 /* SVGTransformListValues.h */,24183 7CE58D551DD7D96D00128552 /* SVGTransformValue.cpp */,24184 24149 7CE58D561DD7D96D00128552 /* SVGTransformValue.h */, 24185 24150 B222794B0D00BF210071B782 /* SVGTRefElement.cpp */, … … 24199 24164 B22279570D00BF210071B782 /* SVGUseElement.h */, 24200 24165 B22279580D00BF210071B782 /* SVGUseElement.idl */, 24201 55137B34203CEB710001004B /* SVGValue.h */,24202 24166 B22279590D00BF210071B782 /* SVGViewElement.cpp */, 24203 24167 B222795A0D00BF210071B782 /* SVGViewElement.h */, … … 25886 25850 D05A99E421C9BF2C00032B75 /* WebGPUPipelineLayout.h */, 25887 25851 D05A99E621C9BF2C00032B75 /* WebGPUPipelineLayout.idl */, 25888 D00487D222457BEA00EED7D9 /* WebGPUPipelineLayoutDescriptor.cpp */,25889 25852 D00487D222457BEA00EED7D9 /* WebGPUPipelineLayoutDescriptor.cpp */, 25890 25853 D05A99E121C9B50F00032B75 /* WebGPUPipelineLayoutDescriptor.h */, … … 31541 31504 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */, 31542 31505 55FA7FFF21110E6E005AEFE7 /* SVGAnimatedPropertyType.h in Headers */, 31543 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */,31544 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */,31545 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */,31546 439D334413A6911C00C20F4F /* SVGAnimatedTypeAnimator.h in Headers */,31547 31506 B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */, 31548 31507 832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */, … … 31550 31509 B22279950D00BF220071B782 /* SVGAnimateTransformElement.h in Headers */, 31551 31510 B22279980D00BF220071B782 /* SVGAnimationElement.h in Headers */, 31552 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */,31553 31511 55FA7FF0210FA386005AEFE7 /* SVGAttribute.h in Headers */, 31554 31512 55FA7FF5210FB6B1005AEFE7 /* SVGAttributeAccessor.h in Headers */, … … 31637 31595 B2227A470D00BF220071B782 /* SVGMaskElement.h in Headers */, 31638 31596 0806E57A12893045007CED32 /* SVGMatrix.h in Headers */, 31639 08CA3D4412894A3800FFF260 /* SVGMatrixTearOff.h in Headers */,31640 31597 B2227A4B0D00BF220071B782 /* SVGMetadataElement.h in Headers */, 31641 31598 B2A1F2B10CEF0ABF00442F6A /* SVGMissingGlyphElement.h in Headers */, -
trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp
r243515 r243730 26 26 27 27 #include "QualifiedName.h" 28 #include "SVGAnimatorFactory.h"29 28 #include "SVGAttributeAnimationController.h" 30 29 #include "SVGElement.h" 31 #include "SVGLegacyAttributeAnimationController.h"32 30 #include "SVGNames.h" 33 31 #include <wtf/IsoMallocInlines.h> … … 50 48 ASSERT(!hasInvalidCSSAttributeType()); 51 49 52 if (!m_attributeAnimationController) { 53 if (targetElement()->isAnimatedAttribute(attributeName())) 54 m_attributeAnimationController = std::make_unique<SVGAttributeAnimationController>(*this, *targetElement()); 55 else 56 m_attributeAnimationController = std::make_unique<SVGLegacyAttributeAnimationController>(*this, *targetElement()); 57 } 50 if (!m_attributeAnimationController) 51 m_attributeAnimationController = std::make_unique<SVGAttributeAnimationController>(*this, *targetElement()); 58 52 59 53 return *m_attributeAnimationController; … … 64 58 if (!targetElement() || hasInvalidCSSAttributeType()) 65 59 return false; 66 67 if (SVGAnimatorFactory::isSupportedAttributeType(determineAnimatedPropertyType(*targetElement())))68 return true;69 60 70 61 return targetElement()->isAnimatedAttribute(attributeName()); … … 92 83 if (!targetElement()) 93 84 return false; 94 return attributeAnimationController().calculateToAtEndOfDurationValue( toAtEndOfDurationString);85 return attributeAnimationController().calculateToAtEndOfDurationValue(animateRangeString(toAtEndOfDurationString)); 95 86 } 96 87 … … 99 90 if (!targetElement()) 100 91 return false; 101 return attributeAnimationController().calculateFromAndToValues( fromString, toString);92 return attributeAnimationController().calculateFromAndToValues(animateRangeString(fromString), animateRangeString(toString)); 102 93 } 103 94 … … 106 97 if (!this->targetElement()) 107 98 return false; 108 return attributeAnimationController().calculateFromAndByValues( fromString, byString);99 return attributeAnimationController().calculateFromAndByValues(animateRangeString(fromString), animateRangeString(byString)); 109 100 } 110 101 -
trunk/Source/WebCore/svg/SVGAnimateElementBase.h
r243333 r243730 62 62 void resetAnimation() override; 63 63 64 virtual String animateRangeString(const String& string) const { return string; } 65 64 66 private: 65 67 bool hasInvalidCSSAttributeType() const; -
trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp
r243036 r243730 67 67 } 68 68 69 String SVGAnimateTransformElement::animateRangeString(const String& string) const 70 { 71 return SVGTransformValue::prefixForTransfromType(m_type) + string + ')'; 69 72 } 73 74 } -
trunk/Source/WebCore/svg/SVGAnimateTransformElement.h
r243036 r243730 42 42 bool hasValidAttributeType() const final; 43 43 void parseAttribute(const QualifiedName&, const AtomicString&) final; 44 String animateRangeString(const String&) const final; 44 45 45 46 SVGTransformValue::SVGTransformType m_type; -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r243515 r243730 628 628 } 629 629 630 void SVGAnimationElement::adjustForInheritance(SVGElement* targetElement, const QualifiedName& attributeName, String& value)631 {632 // FIXME: At the moment the computed style gets returned as a String and needs to get parsed again.633 // In the future we might want to work with the value type directly to avoid the String parsing.634 ASSERT(targetElement);635 636 auto parent = makeRefPtr(targetElement->parentElement());637 if (!parent || !parent->isSVGElement())638 return;639 640 SVGElement& svgParent = downcast<SVGElement>(*parent);641 computeCSSPropertyValue(&svgParent, cssPropertyID(attributeName.localName()), value);642 }643 644 630 static bool inheritsFromProperty(SVGElement* targetElement, const QualifiedName& attributeName, const String& value) 645 631 { -
trunk/Source/WebCore/svg/SVGAnimationElement.h
r243121 r243730 33 33 34 34 class ConditionEventListener; 35 class SVGAnimatedType;36 35 class TimeContainer; 37 36 … … 70 69 AnimatedPropertyValueType fromPropertyValueType() const { return m_fromPropertyValueType; } 71 70 AnimatedPropertyValueType toPropertyValueType() const { return m_toPropertyValueType; } 72 73 template<typename AnimatedType> void adjustForInheritance(AnimatedType (*parseTypeFromString)(SVGAnimationElement*, const String&), AnimatedPropertyValueType valueType, AnimatedType& animatedType, SVGElement* contextElement)74 {75 if (valueType != InheritValue)76 return;77 // Replace 'inherit' by its computed property value.78 ASSERT(parseTypeFromString);79 String typeString;80 adjustForInheritance(contextElement, attributeName(), typeString);81 animatedType = (*parseTypeFromString)(this, typeString);82 }83 84 template<typename AnimatedType> bool adjustFromToListValues(const AnimatedType& fromList, const AnimatedType& toList, AnimatedType& animatedList, float percentage, bool resizeAnimatedListIfNeeded = true)85 {86 // If no 'to' value is given, nothing to animate.87 unsigned toListSize = toList.size();88 if (!toListSize)89 return false;90 91 // If the 'from' value is given and it's length doesn't match the 'to' value list length, fallback to a discrete animation.92 unsigned fromListSize = fromList.size();93 if (fromListSize != toListSize && fromListSize) {94 if (percentage < 0.5) {95 if (animationMode() != AnimationMode::To)96 animatedList = AnimatedType(fromList);97 } else98 animatedList = AnimatedType(toList);99 100 return false;101 }102 103 ASSERT(!fromListSize || fromListSize == toListSize);104 if (resizeAnimatedListIfNeeded && animatedList.size() < toListSize)105 animatedList.resize(toListSize);106 107 return true;108 }109 110 template<typename AnimatedType> void animateDiscreteType(float percentage, const AnimatedType& fromType, const AnimatedType& toType, AnimatedType& animatedType)111 {112 if ((animationMode() == AnimationMode::FromTo && percentage > 0.5) || animationMode() == AnimationMode::To || percentage == 1) {113 animatedType = AnimatedType(toType);114 return;115 }116 animatedType = AnimatedType(fromType);117 }118 71 119 72 void animateAdditiveNumber(float percentage, unsigned repeatCount, float fromNumber, float toNumber, float toAtEndOfDurationNumber, float& animatedNumber) … … 193 146 unsigned calculateKeyTimesIndex(float percent) const; 194 147 195 void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType*);196 void adjustForInheritance(SVGElement* targetElement, const QualifiedName& attributeName, String&);197 198 148 void setCalcMode(const AtomicString&); 199 149 -
trunk/Source/WebCore/svg/SVGElement.h
r243515 r243730 25 25 #include "SVGAnimatedPropertyImpl.h" 26 26 #include "SVGAttributeOwnerProxy.h" 27 #include "SVGAttributeOwnerProxyImpl.h" 27 28 #include "SVGLangSpace.h" 28 29 #include "SVGLocatable.h" … … 136 137 137 138 // The definition of the owner proxy has to match the class inheritance but we are interested in the SVG objects only. 138 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGElement , SVGLangSpace>;139 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGElement>; 139 140 140 141 // A super class will override this function to return its owner proxy. The attributes of the super class will 141 142 // be accessible through the registry of the owner proxy. 142 143 virtual const SVGAttributeOwnerProxy& attributeOwnerProxy() const { return m_attributeOwnerProxy; } 144 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } 143 145 144 146 // Helper functions which return info for the super class' attributes. -
trunk/Source/WebCore/svg/SVGExternalResourcesRequired.h
r243121 r243730 57 57 SVGExternalResourcesRequired(SVGElement* contextElement); 58 58 59 static bool isKnownAttribute(const QualifiedName& attributeName) 60 { 61 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName); 62 } 59 static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } 63 60 64 61 virtual void setHaveFiredLoadEvent(bool) { } -
trunk/Source/WebCore/svg/SVGFEImageElement.h
r243185 r243730 52 52 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 53 53 54 static bool isKnownAttribute(const QualifiedName& attributeName)55 {56 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);57 }58 59 54 void parseAttribute(const QualifiedName&, const AtomicString&) override; 60 55 void svgAttributeChanged(const QualifiedName&) override; -
trunk/Source/WebCore/svg/SVGFEMorphologyElement.h
r243478 r243730 76 76 77 77 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; 78 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }79 static void registerAttributes();80 78 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 81 79 82 80 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; 83 81 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 84 85 static bool isKnownAttribute(const QualifiedName& attributeName)86 {87 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);88 }89 82 90 83 void parseAttribute(const QualifiedName&, const AtomicString&) override; -
trunk/Source/WebCore/svg/SVGFETileElement.h
r243333 r243730 43 43 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 44 44 45 static bool isKnownAttribute(const QualifiedName& attributeName)46 {47 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);48 }49 50 45 void parseAttribute(const QualifiedName&, const AtomicString&) override; 51 46 void svgAttributeChanged(const QualifiedName&) override; -
trunk/Source/WebCore/svg/SVGFitToViewBox.h
r243259 r243730 67 67 SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess = SVGPropertyAccess::ReadWrite); 68 68 69 static bool isKnownAttribute(const QualifiedName& attributeName) 70 { 71 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName); 72 } 69 static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } 73 70 74 71 void reset(); -
trunk/Source/WebCore/svg/SVGGradientElement.cpp
r243478 r243730 3 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 4 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) 2018 Apple Inc. All rights reserved.5 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 30 30 #include "SVGNames.h" 31 31 #include "SVGStopElement.h" 32 #include "SVGTransformListValues.h"33 32 #include "SVGTransformable.h" 34 33 #include "StyleResolver.h" … … 45 44 , SVGURIReference(this) 46 45 { 47 registerAttributes();48 49 46 static std::once_flag onceFlag; 50 47 std::call_once(onceFlag, [] { 51 48 PropertyRegistry::registerProperty<SVGNames::spreadMethodAttr, SVGSpreadMethodType, &SVGGradientElement::m_spreadMethod>(); 52 49 PropertyRegistry::registerProperty<SVGNames::gradientUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGGradientElement::m_gradientUnits>(); 50 PropertyRegistry::registerProperty<SVGNames::gradientTransformAttr, &SVGGradientElement::m_gradientTransform>(); 53 51 }); 54 }55 56 void SVGGradientElement::registerAttributes()57 {58 auto& registry = attributeRegistry();59 if (!registry.isEmpty())60 return;61 registry.registerAttribute<SVGNames::gradientTransformAttr, &SVGGradientElement::m_gradientTransform>();62 52 } 63 53 … … 72 62 73 63 if (name == SVGNames::gradientTransformAttr) { 74 SVGTransformListValues newList; 75 newList.parse(value); 76 m_gradientTransform.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); 77 m_gradientTransform.setValue(WTFMove(newList)); 64 m_gradientTransform->baseVal()->parse(value); 78 65 return; 79 66 } -
trunk/Source/WebCore/svg/SVGGradientElement.h
r243478 r243730 23 23 24 24 #include "Gradient.h" 25 #include "SVGAnimatedTransformList.h"26 25 #include "SVGElement.h" 27 26 #include "SVGExternalResourcesRequired.h" … … 91 90 SVGSpreadMethodType spreadMethod() const { return m_spreadMethod->currentValue<SVGSpreadMethodType>(); } 92 91 SVGUnitTypes::SVGUnitType gradientUnits() const { return m_gradientUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } 93 const SVGTransformList Values& gradientTransform() const { return m_gradientTransform.currentValue(attributeOwnerProxy()); }92 const SVGTransformList& gradientTransform() const { return m_gradientTransform->currentValue(); } 94 93 95 94 SVGAnimatedEnumeration& spreadMethodAnimated() { return m_spreadMethod; } 96 95 SVGAnimatedEnumeration& gradientUnitsAnimated() { return m_gradientUnits; } 97 RefPtr<SVGAnimatedTransformList> gradientTransformAnimated() { return m_gradientTransform.animatedProperty(attributeOwnerProxy()); }96 SVGAnimatedTransformList& gradientTransformAnimated() { return m_gradientTransform; } 98 97 99 98 protected: 100 99 SVGGradientElement(const QualifiedName&, Document&); 101 100 102 static bool isKnownAttribute(const QualifiedName& attributeName) 103 { 104 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName); 105 } 101 static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } 106 102 107 103 void parseAttribute(const QualifiedName&, const AtomicString&) override; … … 113 109 114 110 const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } 115 static void registerAttributes();116 117 111 const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } 118 112 … … 121 115 Ref<SVGAnimatedEnumeration> m_spreadMethod { SVGAnimatedEnumeration::create(this, SVGSpreadMethodPad) }; 122 116 Ref<SVGAnimatedEnumeration> m_gradientUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; 123 SVGAnimatedTransformListAttribute m_gradientTransform;117 Ref<SVGAnimatedTransformList> m_gradientTransform { SVGAnimatedTransformList::create(this) }; 124 118 }; 125 119 -
trunk/Source/WebCore/svg/SVGGraphicsElement.cpp
r234620 r243730 43 43 , m_shouldIsolateBlending(false) 44 44 { 45 registerAttributes(); 45 static std::once_flag onceFlag; 46 std::call_once(onceFlag, [] { 47 PropertyRegistry::registerProperty<SVGNames::transformAttr, &SVGGraphicsElement::m_transform>(); 48 }); 46 49 } 47 50 … … 107 110 108 111 } else 109 transform().concatenate(matrix);112 matrix = transform().concatenate(); 110 113 111 114 if (m_supplementalTransform) … … 121 124 } 122 125 123 void SVGGraphicsElement::registerAttributes()124 {125 auto& registry = attributeRegistry();126 if (!registry.isEmpty())127 return;128 registry.registerAttribute<SVGNames::transformAttr, &SVGGraphicsElement::m_transform>();129 }130 131 126 void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 132 127 { 133 128 if (name == SVGNames::transformAttr) { 134 SVGTransformListValues newList; 135 newList.parse(value); 136 m_transform.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); 137 m_transform.setValue(newList); 129 m_transform->baseVal()->parse(value); 138 130 return; 139 131 } … … 145 137 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) 146 138 { 147 if ( isKnownAttribute(attrName)) {139 if (attrName == SVGNames::transformAttr) { 148 140 InstanceInvalidationGuard guard(*this); 149 141 150 auto renderer = this->renderer(); 151 if (!renderer) 152 return; 153 154 if (attrName == SVGNames::transformAttr) { 142 if (auto renderer = this->renderer()) { 155 143 renderer->setNeedsTransformUpdate(); 156 144 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); 157 return;158 145 } 146 147 return; 159 148 } 160 149 -
trunk/Source/WebCore/svg/SVGGraphicsElement.h
r243114 r243730 22 22 #pragma once 23 23 24 #include "SVGAnimatedTransformList.h"25 24 #include "SVGElement.h" 26 25 #include "SVGTests.h" … … 69 68 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGraphicsElement, SVGElement, SVGTests>; 70 69 71 const auto& transform() const { return m_transform.currentValue(attributeOwnerProxy()); }72 auto transformAnimated() { return m_transform.animatedProperty(attributeOwnerProxy()); }70 const SVGTransformList& transform() const { return m_transform->currentValue(); } 71 SVGAnimatedTransformList& transformAnimated() { return m_transform; } 73 72 74 73 protected: … … 84 83 85 84 const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } 86 static void registerAttributes();87 88 85 const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } 89 90 static bool isKnownAttribute(const QualifiedName& attributeName)91 {92 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);93 }94 86 95 87 // Used by <animateMotion> … … 101 93 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 102 94 PropertyRegistry m_propertyRegistry { *this }; 103 SVGAnimatedTransformListAttribute m_transform;95 Ref<SVGAnimatedTransformList> m_transform { SVGAnimatedTransformList::create(this) }; 104 96 }; 105 97 -
trunk/Source/WebCore/svg/SVGLangSpace.cpp
r236991 r243730 2 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 * Copyright (C) 2018 Apple Inc. All rights reserved.4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 34 34 : m_contextElement(*contextElement) 35 35 { 36 registerAttributes();37 36 } 38 37 39 void SVGLangSpace::registerAttributes() 38 const AtomicString& SVGLangSpace::xmlspace() const 40 39 { 41 auto& registry = attributeRegistry(); 42 if (!registry.isEmpty()) 43 return; 44 registry.registerAttribute(SVGStringAttributeAccessor::singleton<XMLNames::langAttr, &SVGLangSpace::m_lang>()); 45 registry.registerAttribute(SVGStringAttributeAccessor::singleton<XMLNames::spaceAttr, &SVGLangSpace::m_space>()); 46 } 47 48 const String& SVGLangSpace::xmlspace() const 49 { 50 if (!m_space.value()) { 51 static NeverDestroyed<String> defaultString("default"); 40 if (!m_space) { 41 static NeverDestroyed<const AtomicString> defaultString("default", AtomicString::ConstructFromLiteral); 52 42 return defaultString; 53 43 } 54 return m_space.value(); 44 return m_space; 45 } 46 47 bool SVGLangSpace::isKnownAttribute(const QualifiedName& attributeName) 48 { 49 return attributeName.matches(XMLNames::langAttr) || attributeName.matches(XMLNames::spaceAttr); 55 50 } 56 51 … … 63 58 } 64 59 65 void SVGLangSpace::svgAttributeChanged(const QualifiedName& attr Name)60 void SVGLangSpace::svgAttributeChanged(const QualifiedName& attributeName) 66 61 { 67 if (!isKnownAttribute(attr Name))62 if (!isKnownAttribute(attributeName)) 68 63 return; 69 64 -
trunk/Source/WebCore/svg/SVGLangSpace.h
r234620 r243730 2 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 * Copyright (C) 2018 Apple Inc. All rights reserved.4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 23 23 24 24 #include "QualifiedName.h" 25 #include "SVGAttributeOwnerProxyImpl.h"26 25 #include <wtf/HashSet.h> 27 26 … … 32 31 class SVGLangSpace { 33 32 public: 34 const String& xmllang() const { return m_lang.value(); }35 void setXmllang(const AtomicString& xmlLang) { m_lang .setValue(xmlLang); }33 const AtomicString& xmllang() const { return m_lang; } 34 void setXmllang(const AtomicString& xmlLang) { m_lang = xmlLang; } 36 35 37 const String& xmlspace() const;38 void setXmlspace(const AtomicString& xmlSpace) { m_space .setValue(xmlSpace); }36 const AtomicString& xmlspace() const; 37 void setXmlspace(const AtomicString& xmlSpace) { m_space = xmlSpace; } 39 38 40 39 void parseAttribute(const QualifiedName&, const AtomicString&); … … 42 41 void svgAttributeChanged(const QualifiedName&); 43 42 44 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGLangSpace>; 45 using AttributeRegistry = SVGAttributeRegistry<SVGLangSpace>; 46 static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } 47 static bool isKnownAttribute(const QualifiedName& attributeName) { return attributeRegistry().isKnownAttribute(attributeName); } 43 static bool isKnownAttribute(const QualifiedName&); 48 44 49 45 protected: … … 51 47 52 48 private: 53 using SVGStringAttribute = SVGPropertyAttribute<String>;54 using SVGStringAttributeAccessor = SVGPropertyAttributeAccessor<SVGLangSpace, SVGStringAttribute>;55 static void registerAttributes();56 57 49 SVGElement& m_contextElement; 58 SVGStringAttributem_lang;59 SVGStringAttributem_space;50 AtomicString m_lang; 51 AtomicString m_space; 60 52 }; 61 53 -
trunk/Source/WebCore/svg/SVGLinearGradientElement.cpp
r243515 r243730 104 104 attributes.setGradientUnits(element.gradientUnits()); 105 105 106 if (!attributes.hasGradientTransform() && element.hasAttribute(SVGNames::gradientTransformAttr)) { 107 AffineTransform transform; 108 element.gradientTransform().concatenate(transform); 109 attributes.setGradientTransform(transform); 110 } 106 if (!attributes.hasGradientTransform() && element.hasAttribute(SVGNames::gradientTransformAttr)) 107 attributes.setGradientTransform(element.gradientTransform().concatenate()); 111 108 112 109 if (!attributes.hasStops()) { -
trunk/Source/WebCore/svg/SVGMaskElement.h
r243515 r243730 52 52 53 53 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGMaskElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; 54 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }55 static void registerAttributes();56 54 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 57 55 58 56 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMaskElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; 59 57 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 60 61 static bool isKnownAttribute(const QualifiedName& attributeName)62 {63 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);64 }65 58 66 59 void parseAttribute(const QualifiedName&, const AtomicString&) final; -
trunk/Source/WebCore/svg/SVGMatrix.h
r243703 r243730 27 27 28 28 #include "AffineTransform.h" 29 #include "SVG PropertyTearOff.h"29 #include "SVGValueProperty.h" 30 30 31 31 namespace WebCore { 32 32 33 33 // FIXME: Remove this class once SVGMatrix becomes an alias to DOMMatrix. 34 class SVGMatrix : public SVG PropertyTearOff<AffineTransform> {35 using Base = SVG PropertyTearOff<AffineTransform>;34 class SVGMatrix : public SVGValueProperty<AffineTransform> { 35 using Base = SVGValueProperty<AffineTransform>; 36 36 using Base::Base; 37 37 38 38 public: 39 static Ref<SVGMatrix> create(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, AffineTransform& value) 40 { 41 return adoptRef(*new SVGMatrix(&animatedProperty, role, value)); 42 } 43 44 static Ref<SVGMatrix> create(const AffineTransform& initialValue = { }) 45 { 46 return adoptRef(*new SVGMatrix(initialValue)); 47 } 48 49 template<typename T> static ExceptionOr<Ref<SVGMatrix>> create(ExceptionOr<T>&& initialValue) 50 { 51 if (initialValue.hasException()) 52 return initialValue.releaseException(); 53 return create(initialValue.releaseReturnValue()); 39 static Ref<SVGMatrix> create(const AffineTransform& value = { }) 40 { 41 return adoptRef(*new SVGMatrix(value)); 42 } 43 44 static Ref<SVGMatrix> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const AffineTransform& value = { }) 45 { 46 return adoptRef(*new SVGMatrix(owner, access, value)); 47 } 48 49 template<typename T> 50 static ExceptionOr<Ref<SVGMatrix>> create(ExceptionOr<T>&& value) 51 { 52 if (value.hasException()) 53 return value.releaseException(); 54 return create(value.releaseReturnValue()); 54 55 } 55 56 56 57 double a() const 57 58 { 58 return propertyReference().a();59 return m_value.a(); 59 60 } 60 61 … … 64 65 return Exception { NoModificationAllowedError }; 65 66 66 propertyReference().setA(value); 67 commitChange(); 68 67 m_value.setA(value); 68 commitChange(); 69 69 return { }; 70 70 } … … 72 72 double b() const 73 73 { 74 return propertyReference().b();74 return m_value.b(); 75 75 } 76 76 … … 80 80 return Exception { NoModificationAllowedError }; 81 81 82 propertyReference().setB(value); 83 commitChange(); 84 82 m_value.setB(value); 83 commitChange(); 85 84 return { }; 86 85 } … … 88 87 double c() const 89 88 { 90 return propertyReference().c();89 return m_value.c(); 91 90 } 92 91 … … 96 95 return Exception { NoModificationAllowedError }; 97 96 98 propertyReference().setC(value); 99 commitChange(); 100 97 m_value.setC(value); 98 commitChange(); 101 99 return { }; 102 100 } … … 104 102 double d() const 105 103 { 106 return propertyReference().d();104 return m_value.d(); 107 105 } 108 106 … … 112 110 return Exception { NoModificationAllowedError }; 113 111 114 propertyReference().setD(value); 115 commitChange(); 116 112 m_value.setD(value); 113 commitChange(); 117 114 return { }; 118 115 } … … 120 117 double e() const 121 118 { 122 return propertyReference().e();119 return m_value.e(); 123 120 } 124 121 … … 128 125 return Exception { NoModificationAllowedError }; 129 126 130 propertyReference().setE(value); 131 commitChange(); 132 127 m_value.setE(value); 128 commitChange(); 133 129 return { }; 134 130 } … … 136 132 double f() const 137 133 { 138 return propertyReference().f();134 return m_value.f(); 139 135 } 140 136 … … 144 140 return Exception { NoModificationAllowedError }; 145 141 146 propertyReference().setF(value); 147 commitChange(); 148 142 m_value.setF(value); 143 commitChange(); 149 144 return { }; 150 145 } … … 152 147 Ref<SVGMatrix> multiply(SVGMatrix& secondMatrix) const 153 148 { 154 auto copy = propertyReference();155 copy.multiply(secondMatrix. propertyReference());149 auto copy = m_value; 150 copy.multiply(secondMatrix.value()); 156 151 return SVGMatrix::create(copy); 157 152 } … … 159 154 ExceptionOr<Ref<SVGMatrix>> inverse() const 160 155 { 161 auto inverse = propertyReference().inverse();156 auto inverse = m_value.inverse(); 162 157 if (!inverse) 163 158 return Exception { InvalidStateError, "Matrix is not invertible"_s }; 164 165 159 return SVGMatrix::create(*inverse); 166 160 } … … 168 162 Ref<SVGMatrix> translate(float x, float y) const 169 163 { 170 auto copy = propertyReference();164 auto copy = m_value; 171 165 copy.translate(x, y); 172 166 return SVGMatrix::create(copy); … … 175 169 Ref<SVGMatrix> scale(float scaleFactor) const 176 170 { 177 auto copy = propertyReference();171 auto copy = m_value; 178 172 copy.scale(scaleFactor); 179 173 return SVGMatrix::create(copy); … … 182 176 Ref<SVGMatrix> scaleNonUniform(float scaleFactorX, float scaleFactorY) const 183 177 { 184 auto copy = propertyReference();178 auto copy = m_value; 185 179 copy.scaleNonUniform(scaleFactorX, scaleFactorY); 186 180 return SVGMatrix::create(copy); … … 189 183 Ref<SVGMatrix> rotate(float angle) const 190 184 { 191 auto copy = propertyReference();185 auto copy = m_value; 192 186 copy.rotate(angle); 193 187 return SVGMatrix::create(copy); … … 199 193 return Exception { TypeError }; 200 194 201 auto copy = propertyReference();195 auto copy = m_value; 202 196 copy.rotateFromVector(x, y); 203 197 return SVGMatrix::create(copy); … … 206 200 Ref<SVGMatrix> flipX() const 207 201 { 208 auto copy = propertyReference();202 auto copy = m_value; 209 203 copy.flipX(); 210 204 return SVGMatrix::create(copy); … … 213 207 Ref<SVGMatrix> flipY() const 214 208 { 215 auto copy = propertyReference();209 auto copy = m_value; 216 210 copy.flipY(); 217 211 return SVGMatrix::create(copy); … … 220 214 Ref<SVGMatrix> skewX(float angle) const 221 215 { 222 auto copy = propertyReference();216 auto copy = m_value; 223 217 copy.skewX(angle); 224 218 return SVGMatrix::create(copy); … … 227 221 Ref<SVGMatrix> skewY(float angle) const 228 222 { 229 auto copy = propertyReference();223 auto copy = m_value; 230 224 copy.skewY(angle); 231 225 return SVGMatrix::create(copy); -
trunk/Source/WebCore/svg/SVGPatternElement.cpp
r243515 r243730 54 54 { 55 55 ASSERT(hasTagName(SVGNames::patternTag)); 56 registerAttributes();57 56 58 57 static std::once_flag onceFlag; … … 64 63 PropertyRegistry::registerProperty<SVGNames::patternUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGPatternElement::m_patternUnits>(); 65 64 PropertyRegistry::registerProperty<SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGPatternElement::m_patternContentUnits>(); 65 PropertyRegistry::registerProperty<SVGNames::patternTransformAttr, &SVGPatternElement::m_patternTransform>(); 66 66 }); 67 67 } … … 70 70 { 71 71 return adoptRef(*new SVGPatternElement(tagName, document)); 72 }73 74 void SVGPatternElement::registerAttributes()75 {76 auto& registry = attributeRegistry();77 if (!registry.isEmpty())78 return;79 registry.registerAttribute<SVGNames::patternTransformAttr, &SVGPatternElement::m_patternTransform>();80 72 } 81 73 … … 95 87 } 96 88 if (name == SVGNames::patternTransformAttr) { 97 SVGTransformListValues newList; 98 newList.parse(value); 99 m_patternTransform.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); 100 m_patternTransform.setValue(WTFMove(newList)); 89 m_patternTransform->baseVal()->parse(value); 101 90 return; 102 91 } … … 130 119 } 131 120 132 if ( isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {121 if (PropertyRegistry::isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { 133 122 if (RenderObject* object = renderer()) 134 123 object->setNeedsLayout(); … … 182 171 attributes.setPatternContentUnits(patternContentUnits()); 183 172 184 if (!attributes.hasPatternTransform() && hasAttribute(SVGNames::patternTransformAttr)) { 185 AffineTransform transform; 186 patternTransform().concatenate(transform); 187 attributes.setPatternTransform(transform); 188 } 173 if (!attributes.hasPatternTransform() && hasAttribute(SVGNames::patternTransformAttr)) 174 attributes.setPatternTransform(patternTransform().concatenate()); 189 175 190 176 if (!attributes.hasPatternContentElement() && childElementCount()) … … 194 180 AffineTransform SVGPatternElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope) const 195 181 { 196 AffineTransform matrix; 197 patternTransform().concatenate(matrix); 198 return matrix; 182 return patternTransform().concatenate(); 199 183 } 200 184 -
trunk/Source/WebCore/svg/SVGPatternElement.h
r243515 r243730 22 22 #pragma once 23 23 24 #include "SVGAnimatedTransformList.h"25 24 #include "SVGElement.h" 26 25 #include "SVGExternalResourcesRequired.h" … … 50 49 SVGUnitTypes::SVGUnitType patternUnits() const { return m_patternUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } 51 50 SVGUnitTypes::SVGUnitType patternContentUnits() const { return m_patternContentUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } 52 const SVGTransformList Values& patternTransform() const { return m_patternTransform.currentValue(attributeOwnerProxy()); }51 const SVGTransformList& patternTransform() const { return m_patternTransform->currentValue(); } 53 52 54 53 SVGAnimatedLength& xAnimated() { return m_x; } … … 58 57 SVGAnimatedEnumeration& patternUnitsAnimated() { return m_patternUnits; } 59 58 SVGAnimatedEnumeration& patternContentUnitsAnimated() { return m_patternContentUnits; } 60 RefPtr<SVGAnimatedTransformList> patternTransformAnimated() { return m_patternTransform.animatedProperty(attributeOwnerProxy()); }59 SVGAnimatedTransformList& patternTransformAnimated() { return m_patternTransform; } 61 60 62 61 private: … … 64 63 65 64 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPatternElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGTests, SVGURIReference>; 66 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }67 static void registerAttributes();68 65 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 69 66 70 67 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPatternElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGTests, SVGURIReference>; 71 68 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 72 73 static bool isKnownAttribute(const QualifiedName& attributeName)74 {75 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);76 }77 69 78 70 void parseAttribute(const QualifiedName&, const AtomicString&) final; … … 94 86 Ref<SVGAnimatedEnumeration> m_patternUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; 95 87 Ref<SVGAnimatedEnumeration> m_patternContentUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) }; 96 SVGAnimatedTransformListAttribute m_patternTransform;88 Ref<SVGAnimatedTransformList> m_patternTransform { SVGAnimatedTransformList::create(this) }; 97 89 }; 98 90 -
trunk/Source/WebCore/svg/SVGPoint.h
r243515 r243730 85 85 Ref<SVGPoint> matrixTransform(SVGMatrix& matrix) const 86 86 { 87 auto newPoint = m_value.matrixTransform(matrix. propertyReference());87 auto newPoint = m_value.matrixTransform(matrix.value()); 88 88 return adoptRef(*new SVGPoint(newPoint)); 89 89 } -
trunk/Source/WebCore/svg/SVGPolyElement.h
r243336 r243730 48 48 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 49 49 50 static bool isKnownAttribute(const QualifiedName& attributeName)51 {52 return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);53 }54 55 50 void parseAttribute(const QualifiedName&, const AtomicString&) override; 56 51 void svgAttributeChanged(const QualifiedName&) override; -
trunk/Source/WebCore/svg/SVGRadialGradientElement.cpp
r243515 r243730 110 110 attributes.setGradientUnits(element.gradientUnits()); 111 111 112 if (!attributes.hasGradientTransform() && element.hasAttribute(SVGNames::gradientTransformAttr)) { 113 AffineTransform transform; 114 element.gradientTransform().concatenate(transform); 115 attributes.setGradientTransform(transform); 116 } 112 if (!attributes.hasGradientTransform() && element.hasAttribute(SVGNames::gradientTransformAttr)) 113 attributes.setGradientTransform(element.gradientTransform().concatenate()); 117 114 118 115 if (!attributes.hasStops()) { -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r243515 r243730 387 387 Ref<SVGTransform> SVGSVGElement::createSVGTransform() 388 388 { 389 return SVGTransform::create(SVGTransformValue { SVGTransformValue::SVG_TRANSFORM_MATRIX });389 return SVGTransform::create(SVGTransformValue::SVG_TRANSFORM_MATRIX); 390 390 } 391 391 392 392 Ref<SVGTransform> SVGSVGElement::createSVGTransformFromMatrix(SVGMatrix& matrix) 393 393 { 394 return SVGTransform::create( SVGTransformValue { matrix.propertyReference() });394 return SVGTransform::create(matrix.value()); 395 395 } 396 396 … … 609 609 610 610 AffineTransform transform = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_viewSpec->preserveAspectRatio(), viewWidth, viewHeight); 611 m_viewSpec->transformValue().concatenate(transform);611 transform *= m_viewSpec->transform()->concatenate(); 612 612 return transform; 613 613 } -
trunk/Source/WebCore/svg/SVGTextElement.cpp
r229694 r243730 60 60 matrix = t.toAffineTransform(); 61 61 } else 62 transform().concatenate(matrix);62 matrix = transform().concatenate(); 63 63 64 64 const AffineTransform* transform = const_cast<SVGTextElement*>(this)->supplementalTransform(); -
trunk/Source/WebCore/svg/SVGTransform.h
r242978 r243730 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 "SVGMatrix.h" 29 #include "SVGPropertyTearOff.h"30 29 #include "SVGTransformValue.h" 30 #include "SVGValueProperty.h" 31 31 32 32 namespace WebCore { 33 33 34 class SVGTransform : public SVG PropertyTearOff<SVGTransformValue>{34 class SVGTransform : public SVGValueProperty<SVGTransformValue>, public SVGPropertyOwner { 35 35 public: 36 static Ref<SVGTransform> create(SVG LegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGTransformValue& value)36 static Ref<SVGTransform> create(SVGTransformValue::SVGTransformType type) 37 37 { 38 return adoptRef(*new SVGTransform( animatedProperty, role, value));38 return adoptRef(*new SVGTransform(type)); 39 39 } 40 40 41 static Ref<SVGTransform> create(const SVGTransformValue& initialValue= { })41 static Ref<SVGTransform> create(const AffineTransform& transform = { }) 42 42 { 43 return adoptRef(*new SVGTransform( initialValue));43 return adoptRef(*new SVGTransform(SVGTransformValue::SVG_TRANSFORM_MATRIX, transform)); 44 44 } 45 45 46 template<typename T> static ExceptionOr<Ref<SVGTransform>> create(ExceptionOr<T>&& initialValue)46 static Ref<SVGTransform> create(const SVGTransformValue& value) 47 47 { 48 if (initialValue.hasException()) 49 return initialValue.releaseException(); 50 return create(initialValue.releaseReturnValue()); 48 return adoptRef(*new SVGTransform(value.type(), value.matrix()->value(), value.angle(), value.rotationCenter())); 51 49 } 52 50 53 unsigned short type() 51 template<typename T> 52 static ExceptionOr<Ref<SVGTransform>> create(ExceptionOr<T>&& value) 54 53 { 55 return propertyReference().type(); 54 if (value.hasException()) 55 return value.releaseException(); 56 return create(value.releaseReturnValue()); 56 57 } 57 58 58 Ref<SVGMatrix> matrix(); 59 ~SVGTransform() 60 { 61 m_value.matrix()->detach(); 62 } 59 63 60 float angle()64 Ref<SVGTransform> clone() const 61 65 { 62 return propertyReference().angle();66 return SVGTransform::create(m_value); 63 67 } 68 69 unsigned short type() { return m_value.type(); } 70 float angle() { return m_value.angle(); } 71 const Ref<SVGMatrix>& matrix() { return m_value.matrix(); } 64 72 65 73 ExceptionOr<void> setMatrix(SVGMatrix& matrix) … … 68 76 return Exception { NoModificationAllowedError }; 69 77 70 propertyReference().setMatrix(matrix.propertyReference());78 m_value.setMatrix(matrix.value()); 71 79 commitChange(); 72 73 80 return { }; 74 81 } … … 79 86 return Exception { NoModificationAllowedError }; 80 87 81 propertyReference().setTranslate(tx, ty);88 m_value.setTranslate(tx, ty); 82 89 commitChange(); 83 84 90 return { }; 85 91 } … … 90 96 return Exception { NoModificationAllowedError }; 91 97 92 propertyReference().setScale(sx, sy);98 m_value.setScale(sx, sy); 93 99 commitChange(); 94 95 100 return { }; 96 101 } … … 101 106 return Exception { NoModificationAllowedError }; 102 107 103 propertyReference().setRotate(angle, cx, cy);108 m_value.setRotate(angle, cx, cy); 104 109 commitChange(); 105 106 110 return { }; 107 111 } … … 112 116 return Exception { NoModificationAllowedError }; 113 117 114 propertyReference().setSkewX(angle);118 m_value.setSkewX(angle); 115 119 commitChange(); 116 117 120 return { }; 118 121 } … … 123 126 return Exception { NoModificationAllowedError }; 124 127 125 propertyReference().setSkewY(angle);128 m_value.setSkewY(angle); 126 129 commitChange(); 127 128 130 return { }; 129 131 } 130 132 131 133 private: 132 SVGTransform(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGTransformValue& value) 133 : SVGPropertyTearOff<SVGTransformValue>(&animatedProperty, role, value) 134 using Base = SVGValueProperty<SVGTransformValue>; 135 136 SVGTransform(SVGTransformValue::SVGTransformType type, const AffineTransform& transform = { }, float angle = 0, const FloatPoint& rotationCenter = { }) 137 : Base(SVGTransformValue(type, SVGMatrix::create(this, SVGPropertyAccess::ReadWrite, transform), angle, rotationCenter)) 134 138 { 135 139 } 136 140 137 explicit SVGTransform(const SVGTransformValue& initialValue) 138 : SVGPropertyTearOff<SVGTransformValue>(initialValue) 141 SVGPropertyOwner* owner() const override { return m_owner; } 142 143 void commitPropertyChange(SVGProperty* property) override 139 144 { 145 ASSERT_UNUSED(property, property == m_value.matrix().ptr()); 146 if (owner()) 147 owner()->commitPropertyChange(this); 148 m_value.matrixDidChange(); 149 } 150 151 String valueAsString() const override 152 { 153 return m_value.valueAsString(); 140 154 } 141 155 }; -
trunk/Source/WebCore/svg/SVGTransform.idl
r208705 r243730 33 33 34 34 readonly attribute unsigned short type; 35 [NewObject]readonly attribute SVGMatrix matrix;35 readonly attribute SVGMatrix matrix; 36 36 readonly attribute unrestricted float angle; 37 37 -
trunk/Source/WebCore/svg/SVGTransformList.h
r243163 r243730 2 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 4 * Copyright (C) 2019 Apple Inc. All rights reserved. 4 5 * 5 6 * This library is free software; you can redistribute it and/or … … 21 22 #pragma once 22 23 23 #include "SVG AnimatedListPropertyTearOff.h"24 #include "SVG ListPropertyTearOff.h"25 #include "SVG TransformListValues.h"24 #include "SVGTransform.h" 25 #include "SVGTransformable.h" 26 #include "SVGValuePropertyList.h" 26 27 27 28 namespace WebCore { 28 29 29 class SVGTransformList final : public SVGListPropertyTearOff<SVGTransformListValues> { 30 class SVGTransformList final : public SVGValuePropertyList<SVGTransform> { 31 friend class SVGViewSpec; 32 using Base = SVGValuePropertyList<SVGTransform>; 33 using Base::Base; 34 30 35 public: 31 using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGTransformListValues>; 32 using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; 33 34 static Ref<SVGTransformList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGTransformListValues& values, ListWrapperCache& wrappers) 36 static Ref<SVGTransformList> create() 35 37 { 36 return adoptRef(*new SVGTransformList( animatedProperty, role, values, wrappers));38 return adoptRef(*new SVGTransformList()); 37 39 } 38 40 39 ExceptionOr<Ref<SVGTransform>> createSVGTransformFromMatrix(SVGMatrix& matrix)41 static Ref<SVGTransformList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) 40 42 { 41 ASSERT(m_values); 42 return m_values->createSVGTransformFromMatrix(matrix); 43 return adoptRef(*new SVGTransformList(owner, access)); 44 } 45 46 static Ref<SVGTransformList> create(const SVGTransformList& other, SVGPropertyAccess access) 47 { 48 return adoptRef(*new SVGTransformList(other, access)); 49 } 50 51 ExceptionOr<Ref<SVGTransform>> createSVGTransformFromMatrix(const Ref<SVGMatrix>& matrix) 52 { 53 return SVGTransform::create(matrix->value()); 43 54 } 44 55 45 56 ExceptionOr<RefPtr<SVGTransform>> consolidate() 46 57 { 47 ASSERT(m_values);48 ASSERT(m_wrappers);49 50 58 auto result = canAlterList(); 51 59 if (result.hasException()) … … 53 61 ASSERT(result.releaseReturnValue()); 54 62 55 ASSERT(m_values->size() == m_wrappers->size());56 57 63 // Spec: If the list was empty, then a value of null is returned. 58 if (m_ values->isEmpty())64 if (m_items.isEmpty()) 59 65 return nullptr; 60 66 61 detachListWrappers(0); 62 63 RefPtr<SVGTransform> wrapper = m_values->consolidate(); 64 m_wrappers->append(makeWeakPtr(*wrapper)); 67 if (m_items.size() == 1) 68 return makeRefPtr(at(0).get()); 65 69 66 ASSERT(m_values->size() == m_wrappers->size()); 67 return wrapper; 70 auto newItem = SVGTransform::create(concatenate()); 71 clearItems(); 72 73 auto item = append(WTFMove(newItem)); 74 commitChange(); 75 return makeRefPtr(item.get()); 76 } 77 78 void parse(const String& value) 79 { 80 clearItems(); 81 82 auto upconvertedCharacters = StringView(value).upconvertedCharacters(); 83 const UChar* start = upconvertedCharacters; 84 if (!parse(start, start + value.length())) 85 clearItems(); 86 } 87 88 AffineTransform concatenate() const 89 { 90 AffineTransform result; 91 for (const auto& transform : m_items) 92 result *= transform->matrix()->value(); 93 return result; 94 } 95 96 String valueAsString() const override 97 { 98 StringBuilder builder; 99 for (const auto& transfrom : m_items) { 100 if (builder.length()) 101 builder.append(' '); 102 103 builder.append(transfrom->value().valueAsString()); 104 } 105 return builder.toString(); 68 106 } 69 107 70 108 private: 71 SVGTransformList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGTransformListValues& values, ListWrapperCache& wrappers) 72 : SVGListPropertyTearOff<SVGTransformListValues>(animatedProperty, role, values, wrappers) 109 bool parse(const UChar*& start, const UChar* end) 73 110 { 111 bool delimParsed = false; 112 while (start < end) { 113 delimParsed = false; 114 SVGTransformValue::SVGTransformType type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN; 115 skipOptionalSVGSpaces(start, end); 116 117 if (!SVGTransformable::parseAndSkipType(start, end, type)) 118 return false; 119 120 Ref<SVGTransform> transform = SVGTransform::create(type); 121 if (!SVGTransformable::parseTransformValue(type, start, end, transform->value())) 122 return false; 123 124 append(WTFMove(transform)); 125 skipOptionalSVGSpaces(start, end); 126 if (start < end && *start == ',') { 127 delimParsed = true; 128 ++start; 129 } 130 131 skipOptionalSVGSpaces(start, end); 132 } 133 return !delimParsed; 74 134 } 75 135 }; -
trunk/Source/WebCore/svg/SVGTransformList.idl
r208705 r243730 37 37 38 38 [MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix); 39 [MayThrowException , NewObject] SVGTransform consolidate();39 [MayThrowException] SVGTransform consolidate(); 40 40 }; -
trunk/Source/WebCore/svg/SVGTransformValue.h
r243703 r243730 22 22 #pragma once 23 23 24 #include " AffineTransform.h"24 #include "FloatConversion.h" 25 25 #include "FloatPoint.h" 26 #include "FloatSize.h" 27 #include "SVGMatrix.h" 28 #include <wtf/HashMap.h> 29 #include <wtf/NeverDestroyed.h> 30 #include <wtf/text/StringBuilder.h> 26 31 27 32 namespace WebCore { … … 46 51 }; 47 52 48 SVGTransformValue(); 49 SVGTransformValue(SVGTransformType, ConstructionMode = ConstructIdentityTransform); 50 explicit SVGTransformValue(const AffineTransform&); 53 SVGTransformValue(SVGTransformType type = SVG_TRANSFORM_MATRIX, const AffineTransform& transform = { }) 54 : m_type(type) 55 , m_matrix(SVGMatrix::create(transform)) 56 { 57 } 58 59 SVGTransformValue(const SVGTransformValue& other) 60 : m_type(other.m_type) 61 , m_matrix(SVGMatrix::create(other.matrix()->value())) 62 , m_angle(other.m_angle) 63 , m_rotationCenter(other.m_rotationCenter) 64 { 65 } 66 67 SVGTransformValue(SVGTransformType type, Ref<SVGMatrix>&& matrix, float angle, const FloatPoint& rotationCenter) 68 : m_type(type) 69 , m_matrix(WTFMove(matrix)) 70 , m_angle(angle) 71 , m_rotationCenter(rotationCenter) 72 { 73 } 74 75 SVGTransformValue(SVGTransformValue&& other) 76 : m_type(other.m_type) 77 , m_matrix(other.m_matrix.copyRef()) 78 , m_angle(other.m_angle) 79 , m_rotationCenter(other.m_rotationCenter) 80 { 81 } 82 83 SVGTransformValue& operator=(const SVGTransformValue& other) 84 { 85 m_type = other.m_type; 86 m_matrix->setValue(other.m_matrix->value()); 87 m_angle = other.m_angle; 88 m_rotationCenter = other.m_rotationCenter; 89 return *this; 90 } 51 91 52 92 SVGTransformType type() const { return m_type; } 53 54 const AffineTransform& matrix() const { return m_matrix; } 55 AffineTransform& matrix() { return m_matrix; } 56 void updateSVGMatrix(); 57 93 const Ref<SVGMatrix>& matrix() const { return m_matrix; } 58 94 float angle() const { return m_angle; } 59 FloatPoint rotationCenter() const { return m_center; } 60 61 void setMatrix(const AffineTransform&); 62 void setTranslate(float tx, float ty); 63 void setScale(float sx, float sy); 64 void setRotate(float angle, float cx, float cy); 65 void setSkewX(float angle); 66 void setSkewY(float angle); 67 68 FloatPoint translate() const; 69 FloatSize scale() const; 95 FloatPoint rotationCenter() const { return m_rotationCenter; } 70 96 71 97 bool isValid() const { return m_type != SVG_TRANSFORM_UNKNOWN; } 72 String valueAsString() const; 73 74 static const String& transformTypePrefixForParsing(SVGTransformType); 98 99 void setMatrix(const AffineTransform& matrix) 100 { 101 m_type = SVG_TRANSFORM_MATRIX; 102 m_angle = 0; 103 m_rotationCenter = FloatPoint(); 104 m_matrix->setValue(matrix); 105 } 106 107 void matrixDidChange() 108 { 109 // The underlying matrix has been changed, alter the transformation type. 110 // Spec: In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform interface itself) 111 // then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX. 112 m_type = SVG_TRANSFORM_MATRIX; 113 m_angle = 0; 114 m_rotationCenter = FloatPoint(); 115 } 116 117 FloatPoint translate() const 118 { 119 return FloatPoint::narrowPrecision(m_matrix->e(), m_matrix->f()); 120 } 121 122 void setTranslate(float tx, float ty) 123 { 124 m_type = SVG_TRANSFORM_TRANSLATE; 125 m_angle = 0; 126 m_rotationCenter = FloatPoint(); 127 128 m_matrix->value().makeIdentity(); 129 m_matrix->value().translate(tx, ty); 130 } 131 132 FloatSize scale() const 133 { 134 return FloatSize::narrowPrecision(m_matrix->a(), m_matrix->d()); 135 } 136 137 void setScale(float sx, float sy) 138 { 139 m_type = SVG_TRANSFORM_SCALE; 140 m_angle = 0; 141 m_rotationCenter = FloatPoint(); 142 143 m_matrix->value().makeIdentity(); 144 m_matrix->value().scaleNonUniform(sx, sy); 145 } 146 147 void setRotate(float angle, float cx, float cy) 148 { 149 m_type = SVG_TRANSFORM_ROTATE; 150 m_angle = angle; 151 m_rotationCenter = FloatPoint(cx, cy); 152 153 // TODO: toString() implementation, which can show cx, cy (need to be stored?) 154 m_matrix->value().makeIdentity(); 155 m_matrix->value().translate(cx, cy); 156 m_matrix->value().rotate(angle); 157 m_matrix->value().translate(-cx, -cy); 158 } 159 160 void setSkewX(float angle) 161 { 162 m_type = SVG_TRANSFORM_SKEWX; 163 m_angle = angle; 164 m_rotationCenter = FloatPoint(); 165 166 m_matrix->value().makeIdentity(); 167 m_matrix->value().skewX(angle); 168 } 169 170 void setSkewY(float angle) 171 { 172 m_type = SVG_TRANSFORM_SKEWY; 173 m_angle = angle; 174 m_rotationCenter = FloatPoint(); 175 176 m_matrix->value().makeIdentity(); 177 m_matrix->value().skewY(angle); 178 } 179 180 String valueAsString() const 181 { 182 StringBuilder builder; 183 builder.append(prefixForTransfromType(m_type)); 184 switch (m_type) { 185 case SVG_TRANSFORM_UNKNOWN: 186 break; 187 case SVG_TRANSFORM_MATRIX: 188 appendMatrix(builder); 189 break; 190 case SVG_TRANSFORM_TRANSLATE: 191 appendTranslate(builder); 192 break; 193 case SVG_TRANSFORM_SCALE: 194 appendScale(builder); 195 break; 196 case SVG_TRANSFORM_ROTATE: 197 appendRotate(builder); 198 break; 199 case SVG_TRANSFORM_SKEWX: 200 appendSkewX(builder); 201 break; 202 case SVG_TRANSFORM_SKEWY: 203 appendSkewY(builder); 204 break; 205 } 206 return builder.toString(); 207 } 208 209 static String prefixForTransfromType(SVGTransformType type) 210 { 211 switch (type) { 212 case SVG_TRANSFORM_UNKNOWN: 213 return emptyString(); 214 case SVG_TRANSFORM_MATRIX: 215 return "matrix("_s; 216 case SVG_TRANSFORM_TRANSLATE: 217 return "translate("_s; 218 case SVG_TRANSFORM_SCALE: 219 return "scale("_s; 220 case SVG_TRANSFORM_ROTATE: 221 return "rotate("_s; 222 case SVG_TRANSFORM_SKEWX: 223 return "skewX("_s; 224 case SVG_TRANSFORM_SKEWY: 225 return "skewY("_s; 226 } 227 ASSERT_NOT_REACHED(); 228 return emptyString(); 229 } 75 230 76 231 private: 232 static void appendNumbers(StringBuilder& builder) 233 { 234 builder.append(')'); 235 } 236 237 template<typename Number, typename... Numbers> 238 static void appendNumbers(StringBuilder& builder, Number number, Numbers... numbers) 239 { 240 if (builder.length() && builder[builder.length() - 1] != '(') 241 builder.append(' '); 242 builder.appendNumber(number); 243 appendNumbers(builder, numbers...); 244 } 245 246 void appendMatrix(StringBuilder& builder) const 247 { 248 appendNumbers(builder, m_matrix->a(), m_matrix->b(), m_matrix->c(), m_matrix->d(), m_matrix->e(), m_matrix->f()); 249 } 250 251 void appendTranslate(StringBuilder& builder) const 252 { 253 appendNumbers(builder, m_matrix->e(), m_matrix->f()); 254 } 255 256 void appendScale(StringBuilder& builder) const 257 { 258 appendNumbers(builder, m_matrix->value().xScale(), m_matrix->value().yScale()); 259 } 260 261 void appendRotate(StringBuilder& builder) const 262 { 263 double angleInRad = deg2rad(m_angle); 264 double cosAngle = std::cos(angleInRad); 265 double sinAngle = std::sin(angleInRad); 266 267 float cx = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix->e() * (1 - cosAngle) - m_matrix->f() * sinAngle) / (1 - cosAngle) / 2 : 0); 268 float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix->e() * sinAngle / (1 - cosAngle) + m_matrix->f()) / 2 : 0); 269 270 if (cx || cy) 271 appendNumbers(builder, m_angle, cx, cy); 272 else 273 appendNumbers(builder, m_angle); 274 } 275 276 void appendSkewX(StringBuilder& builder) const 277 { 278 appendNumbers(builder, m_angle); 279 } 280 281 void appendSkewY(StringBuilder& builder) const 282 { 283 appendNumbers(builder, m_angle); 284 } 285 77 286 SVGTransformType m_type { SVG_TRANSFORM_UNKNOWN }; 287 Ref<SVGMatrix> m_matrix; 78 288 float m_angle { 0 }; 79 FloatPoint m_center; 80 AffineTransform m_matrix; 289 FloatPoint m_rotationCenter; 81 290 }; 82 291 -
trunk/Source/WebCore/svg/SVGTransformable.cpp
r223728 r243730 28 28 #include "SVGNames.h" 29 29 #include "SVGParserUtilities.h" 30 #include "SVGTransformListValues.h"31 30 #include <wtf/text/StringView.h> 32 31 … … 145 144 static const UChar matrixDesc[] = {'m', 'a', 't', 'r', 'i', 'x'}; 146 145 147 static inline boolparseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransformValue::SVGTransformType& type)146 bool SVGTransformable::parseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransformValue::SVGTransformType& type) 148 147 { 149 148 if (currTransform >= end) … … 180 179 } 181 180 182 bool SVGTransformable::parseTransformAttribute(SVGTransformListValues& list, const UChar*& currTransform, const UChar* end, TransformParsingMode mode)183 {184 if (mode == ClearList)185 list.clear();186 187 bool delimParsed = false;188 while (currTransform < end) {189 delimParsed = false;190 SVGTransformValue::SVGTransformType type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN;191 skipOptionalSVGSpaces(currTransform, end);192 193 if (!parseAndSkipType(currTransform, end, type))194 return false;195 196 SVGTransformValue transform;197 if (!parseTransformValue(type, currTransform, end, transform))198 return false;199 200 list.append(transform);201 skipOptionalSVGSpaces(currTransform, end);202 if (currTransform < end && *currTransform == ',') {203 delimParsed = true;204 ++currTransform;205 }206 skipOptionalSVGSpaces(currTransform, end);207 }208 209 return !delimParsed;210 181 } 211 212 } -
trunk/Source/WebCore/svg/SVGTransformable.h
r208863 r243730 28 28 29 29 class AffineTransform; 30 class SVGTransformListValues;31 30 32 31 class SVGTransformable : public SVGLocatable { 33 32 public: 34 enum TransformParsingMode {35 ClearList,36 DoNotClearList37 };38 39 33 virtual ~SVGTransformable(); 40 34 41 static bool parseTransformAttribute(SVGTransformListValues&, const UChar*& ptr, const UChar* end, TransformParsingMode = ClearList);42 35 static bool parseTransformValue(SVGTransformValue::SVGTransformType, const UChar*& ptr, const UChar* end, SVGTransformValue&); 43 36 static SVGTransformValue::SVGTransformType parseTransformType(const String&); 37 static bool parseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransformValue::SVGTransformType&); 44 38 45 39 AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const override { return animatedLocalTransform(); } -
trunk/Source/WebCore/svg/SVGViewSpec.cpp
r243183 r243730 23 23 24 24 #include "Document.h" 25 #include "SVGAnimatedTransformList.h"26 25 #include "SVGElement.h" 27 26 #include "SVGFitToViewBox.h" … … 37 36 , m_contextElement(makeWeakPtr(contextElement)) 38 37 , m_attributeOwnerProxy(*this, contextElement) 38 , m_transform(SVGTransformList::create(&contextElement, SVGPropertyAccess::ReadOnly)) 39 39 { 40 registerAttributes(); 41 } 42 43 void SVGViewSpec::registerAttributes() 44 { 45 auto& registry = attributeRegistry(); 46 if (!registry.isEmpty()) 47 return; 48 registry.registerAttribute<SVGNames::transformAttr, &SVGViewSpec::m_transform>(); 40 static std::once_flag onceFlag; 41 std::call_once(onceFlag, [] { 42 PropertyRegistry::registerProperty<SVGNames::transformAttr, &SVGViewSpec::m_transform>(); 43 }); 49 44 } 50 45 … … 59 54 } 60 55 61 RefPtr<SVGTransformList> SVGViewSpec::transform()62 {63 if (!m_contextElement)64 return nullptr;65 // Return the animVal here, as its readonly by default - which is exactly what we want here.66 return m_transform.animatedProperty(m_attributeOwnerProxy)->animVal();67 }68 69 56 void SVGViewSpec::reset() 70 57 { 71 58 m_viewTargetString = emptyString(); 72 m_transform .resetValue();59 m_transform->clearItems(); 73 60 SVGFitToViewBox::reset(); 74 61 SVGZoomAndPan::reset(); … … 153 140 return false; 154 141 currViewSpec++; 155 SVGTransformable::parseTransformAttribute(m_transform.value(), currViewSpec, end, SVGTransformable::DoNotClearList);142 m_transform->parse(currViewSpec, end); 156 143 if (currViewSpec >= end || *currViewSpec != ')') 157 144 return false; -
trunk/Source/WebCore/svg/SVGViewSpec.h
r243185 r243730 22 22 23 23 #include "SVGFitToViewBox.h" 24 #include "SVGTransformListValues.h"25 24 #include "SVGZoomAndPan.h" 26 25 … … 44 43 const String& viewTargetString() const { return m_viewTargetString; } 45 44 46 String transformString() const { return m_transform.toString(); } 47 RefPtr<SVGTransformList> transform(); 48 SVGTransformListValues transformValue() const { return m_transform.value(); } 45 String transformString() const { return m_transform->valueAsString(); } 46 Ref<SVGTransformList>& transform() { return m_transform; } 49 47 50 48 const WeakPtr<SVGElement>& contextElementConcurrently() const { return m_contextElement; } … … 54 52 55 53 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGViewSpec, SVGFitToViewBox>; 56 static void registerAttributes();57 58 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }59 static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); }60 61 54 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>; 62 55 … … 64 57 String m_viewTargetString; 65 58 AttributeOwnerProxy m_attributeOwnerProxy; 66 SVGAnimatedTransformListAttributem_transform;59 Ref<SVGTransformList> m_transform; 67 60 }; 68 61 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
r243555 r243730 320 320 }; 321 321 322 template<typename OwnerType> 323 class SVGAnimatedTransformListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedTransformList> { 324 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedTransformList>; 325 using Base::property; 326 327 public: 328 using Base::Base; 329 template<Ref<SVGAnimatedTransformList> OwnerType::*property> 330 constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedTransformListAccessor, property>(); } 331 332 private: 333 std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final 334 { 335 return SVGAnimatedTransformListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); 336 } 337 338 void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final 339 { 340 static_cast<SVGAnimatedTransformListAnimator&>(animator).appendAnimatedInstance(property(owner)); 341 } 342 }; 343 322 344 } -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
r243555 r243730 309 309 }; 310 310 311 class SVGAnimatedTransformListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedTransformList, SVGAnimationTransformListFunction> { 312 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedTransformList, SVGAnimationTransformListFunction>; 313 using Base::Base; 314 315 public: 316 static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedTransformList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) 317 { 318 return std::make_unique<SVGAnimatedTransformListAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive); 319 } 320 321 private: 322 void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final 323 { 324 m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); 325 } 326 }; 327 311 328 } -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
r243555 r243730 30 30 #include "SVGAnimatedPrimitiveProperty.h" 31 31 #include "SVGAnimatedPropertyList.h" 32 #include "SVGAnimatedTransformList.h"33 32 #include "SVGAnimatedValueProperty.h" 34 33 #include "SVGDecoratedEnumeration.h" … … 41 40 #include "SVGPreserveAspectRatio.h" 42 41 #include "SVGRect.h" 42 #include "SVGTransformList.h" 43 43 44 44 namespace WebCore { … … 59 59 using SVGAnimatedNumberList = SVGAnimatedPropertyList<SVGNumberList>; 60 60 using SVGAnimatedPointList = SVGAnimatedPropertyList<SVGPointList>; 61 using SVGAnimatedTransformList = SVGAnimatedPropertyList<SVGTransformList>; 61 62 62 63 class SVGAnimatedOrientType : public SVGAnimatedEnumeration { -
trunk/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunctionImpl.h
r243515 r243730 28 28 #include "SVGAnimationAdditiveListFunction.h" 29 29 #include "SVGLengthList.h" 30 #include "SVGNumberList.h" 30 31 #include "SVGPointList.h" 32 #include "SVGTransformDistance.h" 33 #include "SVGTransformList.h" 31 34 32 35 namespace WebCore { … … 200 203 }; 201 204 205 class SVGAnimationTransformListFunction : public SVGAnimationAdditiveListFunction<SVGTransformList> { 206 public: 207 using Base = SVGAnimationAdditiveListFunction<SVGTransformList>; 208 using Base::Base; 209 210 void setFromAndToValues(SVGElement*, const String& from, const String& to) override 211 { 212 m_from->parse(from); 213 m_to->parse(to); 214 } 215 216 void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override 217 { 218 m_toAtEndOfDuration->parse(toAtEndOfDuration); 219 } 220 221 void progress(SVGElement*, float percentage, unsigned repeatCount, RefPtr<SVGTransformList>& animated) 222 { 223 // Pass false to 'resizeAnimatedIfNeeded', as the special post-multiplication behavior of <animateTransform> needs to be respected below. 224 if (!adjustAnimatedList(m_animationMode, percentage, animated, false)) 225 return; 226 227 // Spec: To animations provide specific functionality to get a smooth change from the underlying 228 // value to the âtoâ attribute value, which conflicts mathematically with the requirement for 229 // additive transform animations to be post-multiplied. As a consequence, in SVG 1.1 the behavior 230 // of to animations for âanimateTransformâ is undefined. 231 const Vector<Ref<SVGTransform>>& fromItems = m_from->items(); 232 const Vector<Ref<SVGTransform>>& toItems = m_to->items(); 233 const Vector<Ref<SVGTransform>>& toAtEndOfDurationItems = toAtEndOfDuration()->items(); 234 Vector<Ref<SVGTransform>>& animatedItems = animated->items(); 235 236 // Never resize the animatedList to the m_to size, instead either clear the list 237 // or append to it. 238 if (!animatedItems.isEmpty() && (!m_isAdditive || m_animationMode == AnimationMode::To)) 239 animatedItems.clear(); 240 241 auto fromItemsSize = fromItems.size(); 242 243 static const AffineTransform zerosAffineTransform = { 0, 0, 0, 0, 0, 0 }; 244 const SVGTransformValue& to = toItems[0]->value(); 245 const SVGTransformValue zerosTransform = SVGTransformValue(to.type(), zerosAffineTransform); 246 247 const SVGTransformValue& from = fromItemsSize ? fromItems[0]->value() : zerosTransform; 248 SVGTransformValue current = SVGTransformDistance(from, to).scaledDistance(percentage).addToSVGTransform(from); 249 250 if (m_isAccumulated && repeatCount) { 251 const SVGTransformValue& toAtEndOfDuration = toAtEndOfDurationItems.size() ? toAtEndOfDurationItems[0]->value() : zerosTransform; 252 animatedItems.append(SVGTransform::create(SVGTransformDistance::addSVGTransforms(current, toAtEndOfDuration, repeatCount))); 253 } else 254 animatedItems.append(SVGTransform::create(current)); 255 } 256 257 private: 258 void addFromAndToValues(SVGElement*) override 259 { 260 const Vector<Ref<SVGTransform>>& fromItems = m_from->items(); 261 Vector<Ref<SVGTransform>>& toItems = m_to->items(); 262 263 if (!fromItems.size() || fromItems.size() != toItems.size()) 264 return; 265 266 ASSERT(fromItems.size() == 1); 267 const Ref<SVGTransform>& from = fromItems[0]; 268 Ref<SVGTransform>& to = toItems[0]; 269 270 to->setValue(SVGTransformDistance::addSVGTransforms(from->value(), to->value())); 271 } 272 }; 273 202 274 } -
trunk/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h
r243555 r243730 26 26 #pragma once 27 27 28 #include "Color.h" 29 #include "FloatRect.h" 30 #include "SVGAngleValue.h" 28 31 #include "SVGAnimationAdditiveValueFunction.h" 32 #include "SVGLengthValue.h" 29 33 #include "SVGPathByteStream.h" 30 34 #include "SVGPropertyTraits.h" -
trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h
r243515 r243730 26 26 #pragma once 27 27 28 #include "SVGAnimatedTransformList.h"29 28 #include "SVGAttributeAccessor.h" 30 29 #include "SVGLegacyAnimatedProperty.h" … … 41 40 static NeverDestroyed<SVGAttributeRegistry<OwnerType, BaseTypes...>> map; 42 41 return map; 43 }44 45 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGZoomAndPanTypeAttribute OwnerType::*attribute>46 void registerAttribute()47 {48 registerAttribute(SVGZoomAndPanTypeAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());49 }50 51 // Animatable attributes52 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedTransformListAttribute OwnerType::*attribute>53 void registerAttribute()54 {55 registerAttribute(SVGAnimatedTransformListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());56 42 } 57 43 -
trunk/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h
r243130 r243730 41 41 }; 42 42 43 template<typename OwnerType> 44 class SVGTransformListAccessor final : public SVGPropertyAccessor<OwnerType, SVGTransformList> { 45 using Base = SVGPropertyAccessor<OwnerType, SVGTransformList>; 46 47 public: 48 using Base::Base; 49 template<Ref<SVGTransformList> OwnerType::*property> 50 constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGTransformListAccessor, property>(); } 51 }; 52 43 53 } -
trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h
r243555 r243730 50 50 } 51 51 52 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGTransformList> OwnerType::*property> 53 static void registerProperty() 54 { 55 registerProperty(attributeName, SVGTransformListAccessor<OwnerType>::template singleton<property>()); 56 } 57 52 58 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedBoolean> OwnerType::*property> 53 59 static void registerProperty() … … 127 133 registerProperty(attributeName, SVGAnimatedStringAccessor<OwnerType>::template singleton<property>()); 128 134 } 129 135 136 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedTransformList> OwnerType::*property> 137 static void registerProperty() 138 { 139 registerProperty(attributeName, SVGAnimatedTransformListAccessor<OwnerType>::template singleton<property>()); 140 } 141 130 142 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property1, Ref<SVGAnimatedInteger> OwnerType::*property2> 131 143 static void registerProperty()
Note: See TracChangeset
for help on using the changeset viewer.