Changeset 243336 in webkit
- Timestamp:
- Mar 21, 2019, 3:21:58 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 4 deleted
- 27 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/svg/dom/SVGPointList-basics-expected.txt (modified) (4 diffs)
-
LayoutTests/svg/dom/SVGPointList-basics.xhtml (modified) (4 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (2 diffs)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (11 diffs)
-
Source/WebCore/rendering/svg/SVGPathData.cpp (modified) (6 diffs)
-
Source/WebCore/rendering/svg/SVGPathData.h (modified) (1 diff)
-
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGAnimatedPointList.cpp (deleted)
-
Source/WebCore/svg/SVGAnimatedPointList.h (deleted)
-
Source/WebCore/svg/SVGAnimatedType.h (modified) (1 diff)
-
Source/WebCore/svg/SVGAnimatorFactory.h (modified) (3 diffs)
-
Source/WebCore/svg/SVGParserUtilities.cpp (modified) (2 diffs)
-
Source/WebCore/svg/SVGParserUtilities.h (modified) (2 diffs)
-
Source/WebCore/svg/SVGPoint.h (modified) (3 diffs)
-
Source/WebCore/svg/SVGPoint.idl (modified) (1 diff)
-
Source/WebCore/svg/SVGPointList.h (modified) (2 diffs)
-
Source/WebCore/svg/SVGPointListValues.cpp (deleted)
-
Source/WebCore/svg/SVGPointListValues.h (deleted)
-
Source/WebCore/svg/SVGPolyElement.cpp (modified) (4 diffs)
-
Source/WebCore/svg/SVGPolyElement.h (modified) (4 diffs)
-
Source/WebCore/svg/SVGSVGElement.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGSVGElement.h (modified) (4 diffs)
-
Source/WebCore/svg/SVGSVGElement.idl (modified) (1 diff)
-
Source/WebCore/svg/SVGValue.h (modified) (2 diffs)
-
Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h (modified) (1 diff)
-
Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h (modified) (2 diffs)
-
Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h (modified) (2 diffs)
-
Source/WebCore/svg/properties/SVGAnimatedPropertyList.h (added)
-
Source/WebCore/svg/properties/SVGAnimationAdditiveListFunction.h (added)
-
Source/WebCore/svg/properties/SVGAnimationAdditiveListFunctionImpl.h (added)
-
Source/WebCore/svg/properties/SVGAttributeRegistry.h (modified) (2 diffs)
-
Source/WebCore/svg/properties/SVGPropertyList.h (added)
-
Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h (modified) (1 diff)
-
Source/WebCore/svg/properties/SVGValuePropertyList.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243331 r243336 1 2019-03-21 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Remove the SVG tear off objects for SVGPoint, SVGPointList and SVGAnimatedPointList 4 https://bugs.webkit.org/show_bug.cgi?id=195905 5 6 Reviewed by Simon Fraser. 7 8 * svg/dom/SVGPointList-basics-expected.txt: 9 * svg/dom/SVGPointList-basics.xhtml: 10 This change is required because SVGPointList will be following the SVG2 11 specs regarding adding new items to the list. 12 13 See https://www.w3.org/TR/SVG/types.html#TermListInterface. 14 1 15 2019-03-21 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt
r219663 r243336 46 46 PASS poly1.points.insertItemBefore(null) threw exception TypeError: Not enough arguments. 47 47 PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString')) is "x=100 y=0" 48 PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=100 y=0" 48 49 PASS poly1.points.numberOfItems is 4 49 50 PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0" … … 53 54 PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100" 54 55 PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1)) is "x=0 y=0" 56 PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=0 y=0" 55 57 PASS poly1.points.numberOfItems is 4 56 58 PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0" … … 60 62 PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100" 61 63 PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null)) is "x=100 y=0" 64 PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=100 y=0" 62 65 PASS poly1.points.numberOfItems is 4 63 66 PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0" … … 66 69 PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100" 67 70 PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0)) is "x=0 y=0" 71 PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=0 y=0" 68 72 PASS poly1.points.numberOfItems is 4 69 73 PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0" -
trunk/LayoutTests/svg/dom/SVGPointList-basics.xhtml
r155284 r243336 78 78 79 79 shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString'))", "x=100 y=0"); 80 shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=100 y=0"); 80 81 shouldBe("poly1.points.numberOfItems", "4"); 81 82 shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0"); … … 84 85 shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100"); 85 86 shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 0 0 100 100 0 100"); 86 87 87 88 shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1))", "x=0 y=0"); 89 shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=0 y=0"); 88 90 shouldBe("poly1.points.numberOfItems", "4"); 89 91 shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0"); … … 94 96 95 97 shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null))", "x=100 y=0"); 98 shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=100 y=0"); 96 99 shouldBe("poly1.points.numberOfItems", "4"); 97 100 shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0"); … … 99 102 shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100"); 100 103 shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 0 0 100 100 0 100"); 101 104 102 105 shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0))", "x=0 y=0"); 106 shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=0 y=0"); 103 107 shouldBe("poly1.points.numberOfItems", "4"); 104 108 shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0"); -
trunk/Source/WebCore/ChangeLog
r243333 r243336 1 2019-03-21 Said Abou-Hallawa <said@apple.com> 2 3 Remove the SVG tear off objects for SVGPoint, SVGPointList and SVGAnimatedPointList 4 https://bugs.webkit.org/show_bug.cgi?id=195905 5 6 Reviewed by Simon Fraser. 7 8 To remove the SVG tear off objects for SVGPoint, SVGPointList and 9 SVGAnimatedPointList, these changes are needed: 10 11 -- Define SVGPoint to be a superclass of SVGValueProperty<FloatPoint>. 12 13 -- Define SVGAnimatedPointList to be a superclass of SVGAnimatedPropertyList<SVGPointList> 14 15 -- Add SVGPropertyList which is a superclass of SVGList. Its items are 16 defined to RefCounted. It is the base class of SVGValuePropertyList 17 and it will be the base class of SVGPathSegList in a later patch. 18 19 -- Add SVGValuePropertyList which is the base class of all the lists whose 20 items are backed by a value objects like SVGPoint. The difference between 21 SVGPropertyList and SVGValuePropertyList is the former class can store 22 a Ref pointer of the base class like SVGPathSeg while the later type 23 has to store the same type for all the items. 24 25 -- Add SVGAnimatedPropertyList which is the base class for all the animated 26 lists. Note that: 27 1) SVGElement owns SVGAnimatedPropertyList 28 2) SVGAnimatedPropertyList owns m_baseVal whose type is SVGList 29 3) m_baseVal owns the items whose type is a superclass of SVGProperty. 30 When changing an item, it calls its owner which is an SVGList. 31 SVGList calls its owner which is SVGAnimatedPropertyList. 32 SVGAnimatedPropertyList calls its owner which SVGElement to commit 33 the change. Later SVGAnimatedPropertyList::synchronize() is called 34 which returns the property valueAsString() to update the reflecting 35 attribute. 36 37 -- New accessor, animator and animation function are added to access 38 and animate a member of type SVGAnimatedPropertyList. 39 40 * Sources.txt: 41 * WebCore.xcodeproj/project.pbxproj: 42 * rendering/svg/SVGPathData.cpp: 43 (WebCore::pathFromCircleElement): 44 (WebCore::pathFromEllipseElement): 45 (WebCore::pathFromLineElement): 46 (WebCore::pathFromPathElement): 47 (WebCore::pathFromPolygonElement): 48 (WebCore::pathFromPolylineElement): 49 (WebCore::pathFromRectElement): 50 (WebCore::pathFromGraphicsElement): 51 * rendering/svg/SVGPathData.h: 52 The IDL of SVGPolyElement interface requires the following attribute: 53 readonly attribute SVGPointList points; 54 For which we return: 55 SVGPointList& points() { return m_points->baseVal(); } 56 But for all the other properties we return the currentValue(). So to have 57 the two functions with the same name, the following function is added: 58 const SVGPointList& points() const { return m_points->currentValue(); } 59 This definition requires changing all callers to be const. 60 61 * rendering/svg/SVGRenderTreeAsText.cpp: 62 (WebCore::operator<<): 63 * svg/SVGAnimatedPointList.cpp: Removed. 64 * svg/SVGAnimatedPointList.h: Removed. 65 * svg/SVGAnimatedType.h: 66 (WebCore::SVGAnimatedType::type const): 67 This function had a bad design. It was designed to use the index of the 68 variant as the AnimatedPropertyType. But when some of the types are removed 69 from SVGValueVariant, this broke things. This fix is temporary till the 70 class SVGValueVariant is removed. 71 72 * svg/SVGAnimatorFactory.h: 73 (WebCore::SVGAnimatorFactory::create): 74 * svg/SVGExternalResourcesRequired.cpp: 75 * svg/SVGParserUtilities.cpp: 76 (WebCore::pointsListFromSVGData): Deleted. 77 * svg/SVGParserUtilities.h: 78 * svg/SVGPoint.h: 79 (WebCore::SVGPoint::create): 80 (WebCore::SVGPoint::clone const): 81 (WebCore::SVGPoint::x): 82 (WebCore::SVGPoint::setX): 83 (WebCore::SVGPoint::y): 84 (WebCore::SVGPoint::setY): 85 (WebCore::SVGPoint::matrixTransform const): 86 (WebCore::SVGPoint::matrixTransform): Deleted. 87 (WebCore::SVGPoint::SVGPoint): Deleted. 88 * svg/SVGPoint.idl: 89 matrixTransform() should not throw an exception. 90 91 * svg/SVGPointList.h: 92 (WebCore::SVGPointList::create): 93 (WebCore::SVGPointList::parse): 94 (WebCore::SVGPointList::SVGPointList): Deleted. 95 Move the parse() and valueAsString() methods to SVGPointList. It is now 96 a superclass of SVGValuePropertyList. Its items are of type Ref<SVGPoint>. 97 98 * svg/SVGPointListValues.cpp: Removed. 99 * svg/SVGPointListValues.h: Removed. 100 * svg/SVGPolyElement.cpp: 101 (WebCore::SVGPolyElement::SVGPolyElement): 102 (WebCore::SVGPolyElement::parseAttribute): 103 (WebCore::SVGPolyElement::approximateMemoryCost const): 104 (WebCore::SVGPolyElement::registerAttributes): Deleted. 105 (WebCore::SVGPolyElement::points): Deleted. 106 (WebCore::SVGPolyElement::animatedPoints): Deleted. 107 * svg/SVGPolyElement.h: 108 (WebCore::SVGPolyElement::points const): 109 (WebCore::SVGPolyElement::points): 110 (WebCore::SVGPolyElement::animatedPoints): 111 (WebCore::SVGPolyElement::pointList const): Deleted. 112 (WebCore::SVGPolyElement::attributeRegistry): Deleted. 113 * svg/SVGSVGElement.cpp: 114 (WebCore::SVGSVGElement::setCurrentTranslate): 115 (WebCore::SVGSVGElement::currentTranslate): Deleted. 116 * svg/SVGSVGElement.h: 117 * svg/SVGSVGElement.idl: 118 Define currentTranslate property to be of type Ref<SVGPoint>. When requesting 119 it just return a reference to it. 120 121 * svg/SVGValue.h: 122 * svg/properties/SVGAnimatedPropertyAccessorImpl.h: 123 * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: 124 * svg/properties/SVGAnimatedPropertyImpl.h: 125 * svg/properties/SVGAnimatedPropertyList.h: Added. 126 Define the accessor, the animator and the animated type of SVGPointList. 127 128 (WebCore::SVGAnimatedPropertyList::create): 129 (WebCore::SVGAnimatedPropertyList::~SVGAnimatedPropertyList): 130 (WebCore::SVGAnimatedPropertyList::baseVal const): 131 (WebCore::SVGAnimatedPropertyList::baseVal): 132 (WebCore::SVGAnimatedPropertyList::animVal const): 133 (WebCore::SVGAnimatedPropertyList::animVal): 134 (WebCore::SVGAnimatedPropertyList::currentValue const): 135 (WebCore::SVGAnimatedPropertyList::SVGAnimatedPropertyList): 136 (WebCore::SVGAnimatedPropertyList::ensureAnimVal): 137 * svg/properties/SVGAnimationAdditiveListFunction.h: Added. 138 (WebCore::SVGAnimationAdditiveListFunction::SVGAnimationAdditiveListFunction): 139 (WebCore::SVGAnimationAdditiveListFunction::toAtEndOfDuration const): 140 (WebCore::SVGAnimationAdditiveListFunction::adjustAnimatedList): 141 * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: Added. 142 (WebCore::SVGAnimationPointListFunction::progress): 143 Define the animation function for animating SVGPointList. 144 145 * svg/properties/SVGAttributeRegistry.h: 146 * svg/properties/SVGPropertyList.h: Added. 147 (WebCore::SVGPropertyList::SVGPropertyList): 148 (WebCore::SVGPropertyList::~SVGPropertyList): 149 * svg/properties/SVGPropertyOwnerRegistry.h: 150 (WebCore::SVGPropertyOwnerRegistry::registerProperty): 151 * svg/properties/SVGValuePropertyList.h: Added. 152 (WebCore::SVGValuePropertyList::operator=): 153 (WebCore::SVGValuePropertyList::operator Vector<typename PropertyType::ValueType> const): 154 (WebCore::SVGValuePropertyList::resize): 155 (WebCore::SVGValuePropertyList::SVGValuePropertyList): 156 1 157 2019-03-21 Said Abou-Hallawa <said@apple.com> 2 158 -
trunk/Source/WebCore/Sources.txt
r243333 r243336 2276 2276 svg/SVGAnimatedNumberList.cpp 2277 2277 svg/SVGAnimatedPath.cpp 2278 svg/SVGAnimatedPointList.cpp2279 2278 svg/SVGAnimatedTransformList.cpp 2280 2279 svg/SVGAnimatedTypeAnimator.cpp … … 2368 2367 svg/SVGPathUtilities.cpp 2369 2368 svg/SVGPatternElement.cpp 2370 svg/SVGPointListValues.cpp2371 2369 svg/SVGPolyElement.cpp 2372 2370 svg/SVGPolygonElement.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243333 r243336 1222 1222 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */; }; 1223 1223 43B85ED418CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */; }; 1224 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */; };1225 1224 43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 43C092BA12D9E4EE00A989C3 /* RenderSVGForeignObject.h */; }; 1226 1225 43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */ = {isa = PBXBuildFile; fileRef = 43EDD67D1B485DBF00640E75 /* CombinedFiltersAlphabet.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7668 7667 43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SelectorPseudoClassAndCompatibilityElementMap.gperf; path = DerivedSources/WebCore/SelectorPseudoClassAndCompatibilityElementMap.gperf; sourceTree = BUILT_PRODUCTS_DIR; }; 7669 7668 43B85ED618CBEC9700E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SelectorPseudoClassAndCompatibilityElementMap.in; sourceTree = "<group>"; }; 7670 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPointList.h; sourceTree = "<group>"; };7671 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPointList.cpp; sourceTree = "<group>"; };7672 7669 43C092B912D9E4EE00A989C3 /* RenderSVGForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGForeignObject.cpp; sourceTree = "<group>"; }; 7673 7670 43C092BA12D9E4EE00A989C3 /* RenderSVGForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGForeignObject.h; sourceTree = "<group>"; }; … … 9523 9520 7266F0162241C0FE00833975 /* SVGPropertyAnimator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAnimator.h; sourceTree = "<group>"; }; 9524 9521 7266F01822429CFD00833975 /* SVGAnimationAdditiveValueFunctionImpl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimationAdditiveValueFunctionImpl.cpp; sourceTree = "<group>"; }; 9522 7266F02522430F8C00833975 /* SVGValuePropertyList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyList.h; sourceTree = "<group>"; }; 9523 7266F0272243109200833975 /* SVGPropertyList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyList.h; sourceTree = "<group>"; }; 9524 7266F0282243120300833975 /* SVGAnimationAdditiveListFunctionImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveListFunctionImpl.h; sourceTree = "<group>"; }; 9525 7266F029224312B100833975 /* SVGAnimationAdditiveListFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveListFunction.h; sourceTree = "<group>"; }; 9526 7266F02A2243149B00833975 /* SVGAnimatedPropertyList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyList.h; sourceTree = "<group>"; }; 9525 9527 727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTsRGB.cpp; sourceTree = "<group>"; }; 9526 9528 727AFED21A2EA6A0000442E8 /* EXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTsRGB.h; sourceTree = "<group>"; }; … … 9737 9739 7C39C3681DDB86D300FEFB29 /* SVGNumberListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGNumberListValues.cpp; sourceTree = "<group>"; }; 9738 9740 7C39C3691DDB86D300FEFB29 /* SVGNumberListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGNumberListValues.h; sourceTree = "<group>"; }; 9739 7C39C36A1DDB871C00FEFB29 /* SVGPointListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPointListValues.cpp; sourceTree = "<group>"; };9740 7C39C36B1DDB871C00FEFB29 /* SVGPointListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPointListValues.h; sourceTree = "<group>"; };9741 9741 7C39C36C1DDB8BB000FEFB29 /* SVGTransformListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformListValues.cpp; sourceTree = "<group>"; }; 9742 9742 7C39C36D1DDB8BB000FEFB29 /* SVGTransformListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformListValues.h; sourceTree = "<group>"; }; … … 16220 16220 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */, 16221 16221 55EE535C223B2A0D00FBA944 /* SVGAnimatedPropertyImpl.h */, 16222 7266F02A2243149B00833975 /* SVGAnimatedPropertyList.h */, 16222 16223 55BE025E223B29C40032F08A /* SVGAnimatedPropertyPairAccessor.h */, 16223 16224 55EE535D223B2A0D00FBA944 /* SVGAnimatedPropertyPairAccessorImpl.h */, … … 16230 16231 721443452240C8BA00F12FF7 /* SVGAnimatedValueProperty.h */, 16231 16232 55BE025F223B29C50032F08A /* SVGAnimationAdditiveFunction.h */, 16233 7266F029224312B100833975 /* SVGAnimationAdditiveListFunction.h */, 16234 7266F0282243120300833975 /* SVGAnimationAdditiveListFunctionImpl.h */, 16232 16235 55EE535E223B2A0E00FBA944 /* SVGAnimationAdditiveValueFunction.h */, 16233 16236 7266F01822429CFD00833975 /* SVGAnimationAdditiveValueFunctionImpl.cpp */, … … 16261 16264 7266F0162241C0FE00833975 /* SVGPropertyAnimator.h */, 16262 16265 7266F0132241BCE200833975 /* SVGPropertyAnimatorFactory.h */, 16266 7266F0272243109200833975 /* SVGPropertyList.h */, 16263 16267 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */, 16264 16268 55BE025C223B29C30032F08A /* SVGPropertyOwnerRegistry.h */, … … 16268 16272 0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */, 16269 16273 721443462240CAD200F12FF7 /* SVGValueProperty.h */, 16274 7266F02522430F8C00833975 /* SVGValuePropertyList.h */, 16270 16275 ); 16271 16276 path = properties; … … 24147 24152 0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */, 24148 24153 0863951413B5FE5700BB344D /* SVGAnimatedPath.h */, 24149 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */,24150 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */,24151 24154 B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */, 24152 24155 B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */, … … 24481 24484 B22278F60D00BF210071B782 /* SVGPointList.h */, 24482 24485 B22278F70D00BF210071B782 /* SVGPointList.idl */, 24483 7C39C36A1DDB871C00FEFB29 /* SVGPointListValues.cpp */,24484 7C39C36B1DDB871C00FEFB29 /* SVGPointListValues.h */,24485 24486 B22278F80D00BF210071B782 /* SVGPolyElement.cpp */, 24486 24487 B22278F90D00BF210071B782 /* SVGPolyElement.h */, … … 31924 31925 0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */, 31925 31926 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */, 31926 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,31927 31927 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */, 31928 31928 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */, -
trunk/Source/WebCore/rendering/svg/SVGPathData.cpp
r224213 r243336 40 40 namespace WebCore { 41 41 42 static Path pathFromCircleElement( SVGElement& element)42 static Path pathFromCircleElement(const SVGElement& element) 43 43 { 44 44 ASSERT(is<SVGCircleElement>(element)); … … 60 60 } 61 61 62 static Path pathFromEllipseElement( SVGElement& element)62 static Path pathFromEllipseElement(const SVGElement& element) 63 63 { 64 64 RenderElement* renderer = element.renderer(); … … 83 83 } 84 84 85 static Path pathFromLineElement( SVGElement& element)85 static Path pathFromLineElement(const SVGElement& element) 86 86 { 87 87 Path path; … … 94 94 } 95 95 96 static Path pathFromPathElement( SVGElement& element)96 static Path pathFromPathElement(const SVGElement& element) 97 97 { 98 98 return downcast<SVGPathElement>(element).pathForByteStream(); 99 99 } 100 100 101 static Path pathFromPolygonElement( SVGElement& element)101 static Path pathFromPolygonElement(const SVGElement& element) 102 102 { 103 auto& points = downcast<SVGPolygonElement>(element). animatedPoints()->values();103 auto& points = downcast<SVGPolygonElement>(element).points().items(); 104 104 if (points.isEmpty()) 105 105 return { }; 106 106 107 107 Path path; 108 path.moveTo(points.first() );108 path.moveTo(points.first()->value()); 109 109 110 110 unsigned size = points.size(); 111 111 for (unsigned i = 1; i < size; ++i) 112 path.addLineTo(points.at(i) );112 path.addLineTo(points.at(i)->value()); 113 113 114 114 path.closeSubpath(); … … 116 116 } 117 117 118 static Path pathFromPolylineElement( SVGElement& element)118 static Path pathFromPolylineElement(const SVGElement& element) 119 119 { 120 auto& points = downcast<SVGPolylineElement>(element). animatedPoints()->values();120 auto& points = downcast<SVGPolylineElement>(element).points().items(); 121 121 if (points.isEmpty()) 122 122 return { }; 123 123 124 124 Path path; 125 path.moveTo(points.first() );125 path.moveTo(points.first()->value()); 126 126 127 127 unsigned size = points.size(); 128 128 for (unsigned i = 1; i < size; ++i) 129 path.addLineTo(points.at(i) );129 path.addLineTo(points.at(i)->value()); 130 130 return path; 131 131 } 132 132 133 static Path pathFromRectElement( SVGElement& element)133 static Path pathFromRectElement(const SVGElement& element) 134 134 { 135 135 RenderElement* renderer = element.renderer(); … … 170 170 } 171 171 172 Path pathFromGraphicsElement( SVGElement* element)172 Path pathFromGraphicsElement(const SVGElement* element) 173 173 { 174 174 ASSERT(element); 175 175 176 typedef Path (*PathFromFunction)( SVGElement&);176 typedef Path (*PathFromFunction)(const SVGElement&); 177 177 static HashMap<AtomicStringImpl*, PathFromFunction>* map = 0; 178 178 if (!map) { -
trunk/Source/WebCore/rendering/svg/SVGPathData.h
r223804 r243336 25 25 class Path; 26 26 27 Path pathFromGraphicsElement( SVGElement*);27 Path pathFromGraphicsElement(const SVGElement*); 28 28 29 29 } // namespace WebCore -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r239535 r243336 272 272 } else if (is<SVGPolyElement>(svgElement)) { 273 273 const SVGPolyElement& element = downcast<SVGPolyElement>(svgElement); 274 writeNameAndQuotedValue(ts, "points", element.point List().valueAsString());274 writeNameAndQuotedValue(ts, "points", element.points().valueAsString()); 275 275 } else if (is<SVGPathElement>(svgElement)) { 276 276 const SVGPathElement& element = downcast<SVGPathElement>(svgElement); -
trunk/Source/WebCore/svg/SVGAnimatedType.h
r229417 r243336 111 111 AnimatedPropertyType type() const 112 112 { 113 ASSERT(m_value.index() >= AnimatedPropertyTypeMin && m_value.index() < AnimatedPropertyTypeMax); 114 return static_cast<AnimatedPropertyType>(m_value.index()); 113 static AnimatedPropertyType animatedTypes[] = { 114 AnimatedAngle, 115 AnimatedEnumeration, 116 AnimatedLength, 117 AnimatedLengthList, 118 AnimatedNumberList, 119 AnimatedPath, 120 AnimatedTransformList 121 }; 122 123 ASSERT(static_cast<size_t>(m_value.index()) < sizeof(animatedTypes) / sizeof(animatedTypes[0])); 124 return animatedTypes[m_value.index()]; 115 125 } 116 126 -
trunk/Source/WebCore/svg/SVGAnimatorFactory.h
r243333 r243336 26 26 #include "SVGAnimatedNumberList.h" 27 27 #include "SVGAnimatedPath.h" 28 #include "SVGAnimatedPointList.h"29 28 #include "SVGAnimatedTransformList.h" 30 29 … … 47 46 case AnimatedNumber: 48 47 case AnimatedNumberOptionalNumber: 48 case AnimatedPoints: 49 49 case AnimatedPreserveAspectRatio: 50 50 case AnimatedRect: … … 64 64 case AnimatedPath: 65 65 return std::make_unique<SVGAnimatedPathAnimator>(animationElement, contextElement); 66 case AnimatedPoints:67 return std::make_unique<SVGAnimatedPointListAnimator>(animationElement, contextElement);68 66 case AnimatedTransformList: 69 67 return std::make_unique<SVGAnimatedTransformListAnimator>(animationElement, contextElement); -
trunk/Source/WebCore/svg/SVGParserUtilities.cpp
r228721 r243336 26 26 #include "Document.h" 27 27 #include "FloatRect.h" 28 #include "SVGPointListValues.h"29 28 #include <limits> 30 29 #include <wtf/ASCIICType.h> … … 259 258 rect = FloatRect(x, y, width, height); 260 259 return valid; 261 }262 263 bool pointsListFromSVGData(SVGPointListValues& pointsList, const String& points)264 {265 if (points.isEmpty())266 return true;267 auto upconvertedCharacters = StringView(points).upconvertedCharacters();268 const UChar* cur = upconvertedCharacters;269 const UChar* end = cur + points.length();270 271 skipOptionalSVGSpaces(cur, end);272 273 bool delimParsed = false;274 while (cur < end) {275 delimParsed = false;276 float xPos = 0.0f;277 if (!parseNumber(cur, end, xPos))278 return false;279 280 float yPos = 0.0f;281 if (!parseNumber(cur, end, yPos, false))282 return false;283 284 skipOptionalSVGSpaces(cur, end);285 286 if (cur < end && *cur == ',') {287 delimParsed = true;288 cur++;289 }290 skipOptionalSVGSpaces(cur, end);291 292 pointsList.append(FloatPoint(xPos, yPos));293 }294 return cur == end && !delimParsed;295 260 } 296 261 -
trunk/Source/WebCore/svg/SVGParserUtilities.h
r228721 r243336 33 33 class FloatPoint; 34 34 class FloatRect; 35 class SVGPointListValues;36 35 37 36 template <typename CharacterType> … … 83 82 } 84 83 85 bool pointsListFromSVGData(SVGPointListValues&, const String& points);86 84 Vector<String> parseDelimitedString(const String& input, const char seperator); 87 85 bool parseKerningUnicodeString(const String& input, UnicodeRanges&, HashSet<String>& stringList); -
trunk/Source/WebCore/svg/SVGPoint.h
r242978 r243336 1 1 /* 2 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2018 Apple Inc. All rights reserved.3 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "FloatPoint.h" 30 30 #include "SVGMatrix.h" 31 #include "SVG PropertyTearOff.h"31 #include "SVGValueProperty.h" 32 32 33 33 namespace WebCore { 34 34 35 class SVGPoint : public SVGPropertyTearOff<FloatPoint> { 35 class SVGPoint : public SVGValueProperty<FloatPoint> { 36 using Base = SVGValueProperty<FloatPoint>; 37 using Base::Base; 38 using Base::m_value; 39 36 40 public: 37 static Ref<SVGPoint> create( SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, FloatPoint& value)41 static Ref<SVGPoint> create(const FloatPoint& value = { }) 38 42 { 39 return adoptRef(*new SVGPoint( animatedProperty, role,value));43 return adoptRef(*new SVGPoint(value)); 40 44 } 41 45 42 static Ref<SVGPoint> create(const FloatPoint& initialValue = { }) 46 template<typename T> 47 static ExceptionOr<Ref<SVGPoint>> create(ExceptionOr<T>&& value) 43 48 { 44 return adoptRef(*new SVGPoint(initialValue)); 49 if (value.hasException()) 50 return value.releaseException(); 51 return adoptRef(*new SVGPoint(value.releaseReturnValue())); 45 52 } 46 53 47 template<typename T> static ExceptionOr<Ref<SVGPoint>> create(ExceptionOr<T>&& initialValue)54 Ref<SVGPoint> clone() const 48 55 { 49 if (initialValue.hasException()) 50 return initialValue.releaseException(); 51 return create(initialValue.releaseReturnValue()); 56 return SVGPoint::create(m_value); 52 57 } 58 59 float x() { return m_value.x(); } 53 60 54 float x() 55 { 56 return propertyReference().x(); 57 } 58 59 ExceptionOr<void> setX(float xValue) 61 ExceptionOr<void> setX(float x) 60 62 { 61 63 if (isReadOnly()) 62 64 return Exception { NoModificationAllowedError }; 63 65 64 propertyReference().setX(xValue);66 m_value.setX(x); 65 67 commitChange(); 66 68 … … 68 70 } 69 71 70 float y() 71 { 72 return propertyReference().y(); 73 } 72 float y() { return m_value.y(); } 74 73 75 ExceptionOr<void> setY(float xValue)74 ExceptionOr<void> setY(float y) 76 75 { 77 76 if (isReadOnly()) 78 77 return Exception { NoModificationAllowedError }; 79 78 80 propertyReference().setY(xValue);79 m_value.setY(y); 81 80 commitChange(); 82 83 81 return { }; 84 82 } 85 83 86 ExceptionOr<Ref<SVGPoint>> matrixTransform(SVGMatrix& matrix)84 Ref<SVGPoint> matrixTransform(SVGMatrix& matrix) const 87 85 { 88 if (isReadOnly()) 89 return Exception { NoModificationAllowedError }; 90 91 auto newPoint = propertyReference().matrixTransform(matrix.propertyReference()); 92 commitChange(); 93 94 return SVGPoint::create(newPoint); 86 auto newPoint = m_value.matrixTransform(matrix.propertyReference()); 87 return adoptRef(*new SVGPoint(newPoint)); 95 88 } 96 89 97 protected: 98 SVGPoint(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, FloatPoint& value) 99 : SVGPropertyTearOff<FloatPoint>(&animatedProperty, role, value) 90 private: 91 String valueAsString() const override 100 92 { 101 } 102 103 SVGPoint(SVGPropertyRole role, FloatPoint& value) 104 : SVGPropertyTearOff<FloatPoint>(nullptr, role, value) 105 { 106 } 107 108 explicit SVGPoint(const FloatPoint& initialValue) 109 : SVGPropertyTearOff<FloatPoint>(initialValue) 110 { 93 return SVGPropertyTraits<FloatPoint>::toString(m_value); 111 94 } 112 95 }; -
trunk/Source/WebCore/svg/SVGPoint.idl
r222429 r243336 27 27 attribute unrestricted float y; 28 28 29 [ MayThrowException,NewObject] SVGPoint matrixTransform(SVGMatrix matrix);29 [NewObject] SVGPoint matrixTransform(SVGMatrix matrix); 30 30 }; 31 31 -
trunk/Source/WebCore/svg/SVGPointList.h
r208863 r243336 1 1 /* 2 * Copyright (C) 2016 Apple 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 … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedListPropertyTearOff.h"29 #include "SVGListPropertyTearOff.h"30 28 #include "SVGPoint.h" 31 #include "SVG PointListValues.h"29 #include "SVGValuePropertyList.h" 32 30 33 31 namespace WebCore { 34 32 35 class SVGPointList : public SVGListPropertyTearOff<SVGPointListValues> { 33 class SVGPointList : public SVGValuePropertyList<SVGPoint> { 34 using Base = SVGValuePropertyList<SVGPoint>; 35 using Base::Base; 36 36 37 public: 37 using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGPointListValues>; 38 using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; 39 40 static Ref<SVGPointList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPointListValues& values, ListWrapperCache& wrappers) 38 static Ref<SVGPointList> create() 41 39 { 42 return adoptRef(*new SVGPointList( animatedProperty, role, values, wrappers));40 return adoptRef(*new SVGPointList()); 43 41 } 44 42 45 private: 46 SVGPointList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPointListValues& values, ListWrapperCache& wrappers) 47 : SVGListPropertyTearOff<SVGPointListValues>(animatedProperty, role, values, wrappers) 43 static Ref<SVGPointList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) 48 44 { 45 return adoptRef(*new SVGPointList(owner, access)); 46 } 47 48 static Ref<SVGPointList> create(const SVGPointList& other, SVGPropertyAccess access) 49 { 50 return adoptRef(*new SVGPointList(other, access)); 51 } 52 53 bool parse(const String& value) 54 { 55 clearItems(); 56 57 auto upconvertedCharacters = StringView(value).upconvertedCharacters(); 58 const UChar* cur = upconvertedCharacters; 59 const UChar* end = cur + value.length(); 60 61 skipOptionalSVGSpaces(cur, end); 62 63 bool delimParsed = false; 64 while (cur < end) { 65 delimParsed = false; 66 float xPos = 0.0f; 67 if (!parseNumber(cur, end, xPos)) 68 return false; 69 70 float yPos = 0.0f; 71 if (!parseNumber(cur, end, yPos, false)) 72 return false; 73 74 skipOptionalSVGSpaces(cur, end); 75 76 if (cur < end && *cur == ',') { 77 delimParsed = true; 78 cur++; 79 } 80 skipOptionalSVGSpaces(cur, end); 81 82 append(SVGPoint::create({ xPos, yPos })); 83 } 84 85 return !delimParsed; 86 } 87 88 String valueAsString() const override 89 { 90 StringBuilder builder; 91 92 for (const auto& point : m_items) { 93 if (builder.length()) 94 builder.append(' '); 95 96 builder.appendNumber(point->x()); 97 builder.append(' '); 98 builder.appendNumber(point->y()); 99 } 100 101 return builder.toString(); 49 102 } 50 103 }; 51 104 52 } // namespace WebCore105 } -
trunk/Source/WebCore/svg/SVGPolyElement.cpp
r234620 r243336 2 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005, 2006, 2007 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 … … 38 38 , SVGExternalResourcesRequired(this) 39 39 { 40 registerAttributes(); 41 } 42 43 void SVGPolyElement::registerAttributes() 44 { 45 auto& registry = attributeRegistry(); 46 if (!registry.isEmpty()) 47 return; 48 registry.registerAttribute<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); 40 static std::once_flag onceFlag; 41 std::call_once(onceFlag, [] { 42 PropertyRegistry::registerProperty<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); 43 }); 49 44 } 50 45 … … 52 47 { 53 48 if (name == SVGNames::pointsAttr) { 54 SVGPointListValues newList; 55 if (!pointsListFromSVGData(newList, value)) 49 if (!m_points->baseVal()->parse(value)) 56 50 document().accessSVGExtensions().reportError("Problem parsing points=\"" + value + "\""); 57 58 if (auto wrapper = static_pointer_cast<SVGAnimatedPointList>(lookupAnimatedProperty(m_points)))59 wrapper->detachListWrappers(newList.size());60 61 m_points.setValue(WTFMove(newList));62 51 return; 63 52 } … … 82 71 } 83 72 84 Ref<SVGPointList> SVGPolyElement::points()85 {86 m_points.setShouldSynchronize(true);87 return static_pointer_cast<SVGAnimatedPointList>(lookupOrCreateAnimatedProperty(m_points))->baseVal();88 }89 90 Ref<SVGPointList> SVGPolyElement::animatedPoints()91 {92 m_points.setShouldSynchronize(true);93 return static_pointer_cast<SVGAnimatedPointList>(lookupOrCreateAnimatedProperty(m_points))->animVal();94 }95 96 73 size_t SVGPolyElement::approximateMemoryCost() const 97 74 { 98 size_t pointsCost = pointList().size() * sizeof(FloatPoint);75 size_t pointsCost = m_points->baseVal()->items().size() * sizeof(FloatPoint); 99 76 // We need to account for the memory which is allocated by the RenderSVGPath::m_path. 100 77 return sizeof(*this) + (renderer() ? pointsCost * 2 + sizeof(RenderSVGPath) : pointsCost); -
trunk/Source/WebCore/svg/SVGPolyElement.h
r243114 r243336 22 22 #pragma once 23 23 24 #include "SVGAnimatedPointList.h"25 24 #include "SVGExternalResourcesRequired.h" 26 25 #include "SVGGeometryElement.h" … … 32 31 WTF_MAKE_ISO_ALLOCATED(SVGPolyElement); 33 32 public: 34 Ref<SVGPointList> points(); 35 Ref<SVGPointList> animatedPoints(); 33 const SVGPointList& points() const { return m_points->currentValue(); } 36 34 37 const SVGPointListValues& pointList() const { return m_points.value(); } 35 SVGPointList& points() { return m_points->baseVal(); } 36 SVGPointList& animatedPoints() { return *m_points->animVal(); } 38 37 39 38 size_t approximateMemoryCost() const override; … … 44 43 private: 45 44 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; 46 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }47 static void registerAttributes();48 45 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 49 46 … … 64 61 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 65 62 PropertyRegistry m_propertyRegistry { *this }; 66 SVGAnimatedPointListAttribute m_points;63 Ref<SVGAnimatedPointList> m_points { SVGAnimatedPointList::create(this) }; 67 64 }; 68 65 -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r243183 r243336 172 172 } 173 173 174 Ref<SVGPoint> SVGSVGElement::currentTranslate()175 {176 return SVGStaticPropertyTearOff<SVGSVGElement, SVGPoint>::create(*this, m_currentTranslate, &SVGSVGElement::updateCurrentTranslate);177 }178 179 174 void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation) 180 175 { 181 if (m_currentTranslate == translation)176 if (m_currentTranslate->value() == translation) 182 177 return; 183 m_currentTranslate = translation;178 m_currentTranslate->setValue(translation); 184 179 updateCurrentTranslate(); 185 180 } -
trunk/Source/WebCore/svg/SVGSVGElement.h
r243185 r243336 2 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org> 4 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.4 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 62 62 void setCurrentScale(float); 63 63 64 Ref<SVGPoint> currentTranslate();65 FloatPoint currentTranslateValue() { return m_currentTranslate; }64 SVGPoint& currentTranslate() { return m_currentTranslate; } 65 FloatPoint currentTranslateValue() const { return m_currentTranslate->value(); } 66 66 67 67 unsigned suspendRedraw(unsigned maxWaitMilliseconds); … … 107 107 108 108 void setCurrentTranslate(const FloatPoint&); // Used to pan. 109 void updateCurrentTranslate(); // Used from DOM bindings to create an SVGStaticPropertyTearOff for currentTranslate.109 void updateCurrentTranslate(); 110 110 111 111 bool hasIntrinsicWidth() const; … … 170 170 bool m_useCurrentView { false }; 171 171 Ref<SMILTimeContainer> m_timeContainer; 172 FloatPoint m_currentTranslate;173 172 RefPtr<SVGViewSpec> m_viewSpec; 174 173 String m_currentViewFragmentIdentifier; 174 175 Ref<SVGPoint> m_currentTranslate { SVGPoint::create() }; 175 176 176 177 AttributeOwnerProxy m_attributeOwnerProxy { *this }; -
trunk/Source/WebCore/svg/SVGSVGElement.idl
r213393 r243336 43 43 readonly attribute SVGViewSpec currentView; 44 44 attribute unrestricted float currentScale; 45 [NewObject]readonly attribute SVGPoint currentTranslate;45 readonly attribute SVGPoint currentTranslate; 46 46 47 47 unsigned long suspendRedraw(optional unsigned long maxWaitMilliseconds = 0); -
trunk/Source/WebCore/svg/SVGValue.h
r234620 r243336 34 34 #include "SVGNumberListValues.h" 35 35 #include "SVGPathByteStream.h" 36 #include "SVGPointListValues.h"37 36 #include "SVGPreserveAspectRatioValue.h" 38 37 #include "SVGPropertyTraits.h" … … 45 44 using SVGValueVariant = Variant< 46 45 std::pair<SVGAngleValue, unsigned>*, 47 bool*,48 Color*,49 46 unsigned*, 50 int*,51 std::pair<int, int>*,52 47 SVGLengthValue*, 53 48 SVGLengthListValues*, 54 float*,55 49 SVGNumberListValues*, 56 std::pair<float, float>*,57 50 SVGPathByteStream*, 58 SVGPointListValues*,59 SVGPreserveAspectRatioValue*,60 FloatRect*,61 String*,62 51 SVGTransformListValues* 63 52 >; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
r243333 r243336 100 100 101 101 template<typename OwnerType> 102 class SVGAnimatedPointListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPointList> { 103 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPointList>; 104 using Base::property; 105 106 public: 107 using Base::Base; 108 template<Ref<SVGAnimatedPointList> OwnerType::*property> 109 constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPointListAccessor, property>(); } 110 111 private: 112 std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final 113 { 114 return SVGAnimatedPointListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); 115 } 116 117 void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final 118 { 119 static_cast<SVGAnimatedPointListAnimator&>(animator).appendAnimatedInstance(property(owner)); 120 } 121 }; 122 123 template<typename OwnerType> 102 124 class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> { 103 125 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
r243333 r243336 28 28 #include "SVGAnimatedPropertyAnimator.h" 29 29 #include "SVGAnimatedPropertyImpl.h" 30 #include "SVGAnimationAdditiveListFunctionImpl.h" 30 31 #include "SVGAnimationAdditiveValueFunctionImpl.h" 31 32 #include "SVGAnimationDiscreteFunctionImpl.h" … … 96 97 }; 97 98 99 class SVGAnimatedPointListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPointList, SVGAnimationPointListFunction> { 100 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPointList, SVGAnimationPointListFunction>; 101 using Base::Base; 102 103 public: 104 static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPointList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) 105 { 106 return std::unique_ptr<SVGAnimatedPointListAnimator>(new SVGAnimatedPointListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); 107 } 108 109 private: 110 void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final 111 { 112 m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); 113 } 114 }; 115 98 116 class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> { 99 117 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
r243333 r243336 31 31 #include "SVGAnimatedLengthList.h" 32 32 #include "SVGAnimatedNumberList.h" 33 #include "SVGAnimatedPointList.h"34 33 #include "SVGAnimatedPrimitiveProperty.h" 34 #include "SVGAnimatedPropertyList.h" 35 35 #include "SVGAnimatedTransformList.h" 36 36 #include "SVGAnimatedValueProperty.h" 37 #include "SVGPointList.h" 37 38 #include "SVGPreserveAspectRatio.h" 38 39 #include "SVGRect.h" … … 48 49 using SVGAnimatedPreserveAspectRatio = SVGAnimatedValueProperty<SVGPreserveAspectRatio>; 49 50 51 using SVGAnimatedPointList = SVGAnimatedPropertyList<SVGPointList>; 52 50 53 } -
trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h
r243333 r243336 30 30 #include "SVGAnimatedLengthList.h" 31 31 #include "SVGAnimatedNumberList.h" 32 #include "SVGAnimatedPointList.h"33 32 #include "SVGAnimatedTransformList.h" 34 33 #include "SVGAttributeAccessor.h" … … 77 76 { 78 77 registerAttribute(SVGAnimatedNumberListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); 79 }80 81 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPointListAttribute OwnerType::*attribute>82 void registerAttribute()83 {84 registerAttribute(SVGAnimatedPointListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());85 78 } 86 79 -
trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h
r243333 r243336 68 68 } 69 69 70 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPointList> OwnerType::*property> 71 static void registerProperty() 72 { 73 registerProperty(attributeName, SVGAnimatedPointListAccessor<OwnerType>::template singleton<property>()); 74 } 75 70 76 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property> 71 77 static void registerProperty()
Note:
See TracChangeset
for help on using the changeset viewer.