Diff
Modified: trunk/Source/WebCore/ChangeLog (243129 => 243130)
--- trunk/Source/WebCore/ChangeLog 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/ChangeLog 2019-03-19 04:23:27 UTC (rev 243130)
@@ -1,3 +1,104 @@
+2019-03-18 Said Abou-Hallawa <[email protected]>
+
+ Remove the SVG property tear off objects for SVGStringList
+ https://bugs.webkit.org/show_bug.cgi?id=195863
+
+ Reviewed by Simon Fraser.
+
+ SVGStringList is not animated list. So we need to introduce two new classes:
+
+ -- SVGProperty: This will be the base of all the non-animated properties.
+ Like the SVGAnimatedProperty, SVGProperty will be registered with the
+ attribute name in SVGPropertyRegistery. It will also commit changes
+ to the reflecting attribute. And it will provide a synchronize string
+ for lazy attribute update.
+
+ -- SVGList: It will be the base of all the list properties. It can hold
+ primitive types or SVG types. In this patch primitive types will be
+ supported only. To do that, a superclass called SVGPrimitiveList is
+ added. Its items are of primitive type such as String type.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
+ (WebCore::SVGElement::commitPropertyChange):
+ * svg/SVGElement.h:
+ * svg/SVGStringList.h:
+ * svg/SVGStringListValues.cpp: Removed.
+ * svg/SVGStringListValues.h: Removed.
+ * svg/SVGTests.cpp:
+ (WebCore::SVGTests::SVGTests):
+ (WebCore::SVGTests::isKnownAttribute):
+ (WebCore::SVGTests::isValid const):
+ (WebCore::SVGTests::parseAttribute):
+ (WebCore::SVGTests::registerAttributes): Deleted.
+ (WebCore::SVGTests::requiredFeatures): Deleted.
+ (WebCore::SVGTests::requiredExtensions): Deleted.
+ (WebCore::SVGTests::systemLanguage): Deleted.
+ * svg/SVGTests.h:
+ (WebCore::SVGTests::requiredFeatures):
+ (WebCore::SVGTests::requiredExtensions):
+ (WebCore::SVGTests::systemLanguage):
+ (): Deleted.
+ * svg/SVGTests.idl:
+ * svg/SVGTextPositioningElement.h:
+ * svg/SVGViewElement.cpp:
+ (WebCore::SVGViewElement::SVGViewElement):
+ (WebCore::SVGViewElement::parseAttribute):
+ (WebCore::SVGViewElement::viewTarget): Deleted.
+ * svg/SVGViewElement.h:
+ * svg/properties/SVGAnimatedListPropertyTearOff.h:
+ * svg/properties/SVGAnimatedPrimitiveProperty.h:
+ (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
+ * svg/properties/SVGAnimatedProperty.cpp:
+ (WebCore::SVGAnimatedProperty::commitPropertyChange):
+ * svg/properties/SVGAnimatedProperty.h:
+ * svg/properties/SVGAttributeRegistry.h:
+ * svg/properties/SVGList.h: Added.
+ (WebCore::SVGList::numberOfItems const):
+ (WebCore::SVGList::clear):
+ (WebCore::SVGList::getItem):
+ (WebCore::SVGList::initialize):
+ (WebCore::SVGList::insertItemBefore):
+ (WebCore::SVGList::replaceItem):
+ (WebCore::SVGList::removeItem):
+ (WebCore::SVGList::appendItem):
+ (WebCore::SVGList::items):
+ (WebCore::SVGList::items const):
+ (WebCore::SVGList::size const):
+ (WebCore::SVGList::isEmpty const):
+ (WebCore::SVGList::clearItems):
+ (WebCore::SVGList::canAlterList const):
+ (WebCore::SVGList::canGetItem):
+ (WebCore::SVGList::canReplaceItem):
+ (WebCore::SVGList::canRemoveItem):
+ (WebCore::SVGList::detachItems):
+ * svg/properties/SVGMemberAccessor.h:
+ (WebCore::SVGMemberAccessor::matches const):
+ * svg/properties/SVGPrimitiveList.h: Added.
+ * svg/properties/SVGProperty.h:
+ (WebCore::SVGProperty::isAttached const):
+ (WebCore::SVGProperty::attach):
+ (WebCore::SVGProperty::detach):
+ (WebCore::SVGProperty::contextElement const):
+ (WebCore::SVGProperty::commitChange):
+ (WebCore::SVGProperty::access const):
+ (WebCore::SVGProperty::isReadOnly const):
+ (WebCore::SVGProperty::isDirty const):
+ (WebCore::SVGProperty::setDirty):
+ (WebCore::SVGProperty::synchronize):
+ (WebCore::SVGProperty::valueAsString const):
+ (WebCore::SVGProperty::SVGProperty):
+ * svg/properties/SVGPropertyAccessor.h: Added.
+ * svg/properties/SVGPropertyAccessorImpl.h: Added.
+ * svg/properties/SVGPropertyOwner.h:
+ (WebCore::SVGPropertyOwner::commitPropertyChange):
+ * svg/properties/SVGPropertyOwnerRegistry.h:
+ (WebCore::SVGPropertyOwnerRegistry::registerProperty):
+ * svg/properties/SVGPropertyRegistry.h:
+ * svg/properties/SVGStaticListPropertyTearOff.h: Removed.
+
2019-03-18 Simon Fraser <[email protected]>
Unreviewed followup to r243126.
Modified: trunk/Source/WebCore/Sources.txt (243129 => 243130)
--- trunk/Source/WebCore/Sources.txt 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/Sources.txt 2019-03-19 04:23:27 UTC (rev 243130)
@@ -2384,7 +2384,6 @@
svg/SVGScriptElement.cpp
svg/SVGSetElement.cpp
svg/SVGStopElement.cpp
-svg/SVGStringListValues.cpp
svg/SVGStyleElement.cpp
svg/SVGSwitchElement.cpp
svg/SVGSymbolElement.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (243129 => 243130)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-03-19 04:23:27 UTC (rev 243130)
@@ -266,7 +266,6 @@
0873B86B136064EA00A522C2 /* GlyphPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0873B86A136064EA00A522C2 /* GlyphPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */; };
- 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */; };
0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */; };
@@ -1787,6 +1786,8 @@
55A336F91D821E3C0022C4C7 /* ImageBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
55AF14E61EAAC59B0026EEAA /* UTIRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
55D70D23223B017C00044B8E /* SVGLegacyAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 55D70D20223B009100044B8E /* SVGLegacyAnimatedProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 55DCC52822407B2000C26E32 /* SVGPrimitiveList.h in Headers */ = {isa = PBXBuildFile; fileRef = 55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 55DCC52922407B2A00C26E32 /* SVGList.h in Headers */ = {isa = PBXBuildFile; fileRef = 55DCC523224073FE00C26E32 /* SVGList.h */; settings = {ATTRIBUTES = (Private, ); }; };
55EC9599206AA7A0007DD0A9 /* PaintFrequencyTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
55FA7FF0210FA386005AEFE7 /* SVGAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */; settings = {ATTRIBUTES = (Private, ); }; };
55FA7FF5210FB6B1005AEFE7 /* SVGAttributeAccessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FF4210FB688005AEFE7 /* SVGAttributeAccessor.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2137,6 +2138,10 @@
71EADCD822087E720065A45F /* PointerID.h in Headers */ = {isa = PBXBuildFile; fileRef = 71EADCD622087E6D0065A45F /* PointerID.h */; settings = {ATTRIBUTES = (Private, ); }; };
71EFCEDC202B38A900D7C411 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71EFCED7202B388D00D7C411 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; };
+ 72144331223EC85400F12FF7 /* (null) in Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Private, ); }; };
+ 72144332223EC85F00F12FF7 /* (null) in Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Private, ); }; };
+ 72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5363223B2A2400FBA944 /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */; };
724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2233,7 +2238,6 @@
7C330A021DF8FAC600D3395C /* GraphicsContext3DAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C330A011DF8FAC600D3395C /* GraphicsContext3DAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
7C330A081DF9F95100D3395C /* JSPositionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C330A061DF9F95100D3395C /* JSPositionOptions.h */; };
7C39C3651DDA865200FEFB29 /* SVGLengthListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */; };
- 7C39C3771DDBE17000FEFB29 /* SVGStringListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
7C3A91E61C963B8800D1A7E3 /* ClipboardAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
7C3B79711908757B00B47A2D /* UserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */; };
7C3B79721908757B00B47A2D /* UserMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3B79701908757B00B47A2D /* UserMessageHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5640,7 +5644,6 @@
087558C313B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SurrogatePairAwareTextIterator.cpp; sourceTree = "<group>"; };
087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurrogatePairAwareTextIterator.h; sourceTree = "<group>"; };
087B84951272CEC700A14417 /* SVGAnimatedAngle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedAngle.h; sourceTree = "<group>"; };
- 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStaticListPropertyTearOff.h; sourceTree = "<group>"; };
0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; };
0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; };
088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedListPropertyTearOff.h; sourceTree = "<group>"; };
@@ -8680,6 +8683,10 @@
55D70D22223B00EA00044B8E /* SVGLegacyProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLegacyProperty.h; sourceTree = "<group>"; };
55DCC51C2240605E00C26E32 /* SVGAnimationDiscreteFunctionImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunctionImpl.h; sourceTree = "<group>"; };
55DCC51D2240615500C26E32 /* SVGAnimationDiscreteFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunction.h; sourceTree = "<group>"; };
+ 55DCC523224073FE00C26E32 /* SVGList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGList.h; sourceTree = "<group>"; };
+ 55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPrimitiveList.h; sourceTree = "<group>"; };
+ 55DCC526224074FA00C26E32 /* SVGPropertyAccessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAccessor.h; sourceTree = "<group>"; };
+ 55DCC5272240750B00C26E32 /* SVGPropertyAccessorImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAccessorImpl.h; sourceTree = "<group>"; };
55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaintFrequencyTracker.h; sourceTree = "<group>"; };
55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMemberAccessor.h; sourceTree = "<group>"; };
55EE5356223B29F700FBA944 /* SVGAnimatedPropertyAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAnimatorImpl.h; sourceTree = "<group>"; };
@@ -9731,8 +9738,6 @@
7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = "<group>"; };
7C39C3621DDA864900FEFB29 /* SVGLengthListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthListValues.cpp; sourceTree = "<group>"; };
7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthListValues.h; sourceTree = "<group>"; };
- 7C39C3661DDB82CF00FEFB29 /* SVGStringListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGStringListValues.cpp; sourceTree = "<group>"; };
- 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStringListValues.h; sourceTree = "<group>"; };
7C39C3681DDB86D300FEFB29 /* SVGNumberListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGNumberListValues.cpp; sourceTree = "<group>"; };
7C39C3691DDB86D300FEFB29 /* SVGNumberListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGNumberListValues.h; sourceTree = "<group>"; };
7C39C36A1DDB871C00FEFB29 /* SVGPointListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPointListValues.cpp; sourceTree = "<group>"; };
@@ -16243,18 +16248,21 @@
55D70D21223B00BB00044B8E /* SVGLegacyAnimatedProperty.cpp */,
55D70D20223B009100044B8E /* SVGLegacyAnimatedProperty.h */,
55D70D22223B00EA00044B8E /* SVGLegacyProperty.h */,
+ 55DCC523224073FE00C26E32 /* SVGList.h */,
0810764312828556007C63BA /* SVGListProperty.h */,
088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */,
08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */,
55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */,
55BE025A223B29C20032F08A /* SVGPointerMemberAccessor.h */,
+ 55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */,
55EE5363223B2A2400FBA944 /* SVGProperty.h */,
+ 55DCC526224074FA00C26E32 /* SVGPropertyAccessor.h */,
+ 55DCC5272240750B00C26E32 /* SVGPropertyAccessorImpl.h */,
55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */,
55BE025C223B29C30032F08A /* SVGPropertyOwnerRegistry.h */,
55BE0257223B29C00032F08A /* SVGPropertyRegistry.h */,
088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */,
088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,
- 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */,
0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */,
);
path = properties;
@@ -24511,8 +24519,6 @@
B22279140D00BF210071B782 /* SVGStopElement.idl */,
B22279160D00BF210071B782 /* SVGStringList.h */,
B22279170D00BF210071B782 /* SVGStringList.idl */,
- 7C39C3661DDB82CF00FEFB29 /* SVGStringListValues.cpp */,
- 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */,
B22279210D00BF210071B782 /* SVGStyleElement.cpp */,
B22279220D00BF210071B782 /* SVGStyleElement.h */,
B22279230D00BF210071B782 /* SVGStyleElement.idl */,
@@ -28439,6 +28445,8 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
+ 72144332223EC85F00F12FF7 /* (null) in Headers */,
+ 72144331223EC85400F12FF7 /* (null) in Headers */,
7CD0E2B81F80A4820016A4CE /* AbortController.h in Headers */,
7CD0E2BF1F80A56E0016A4CE /* AbortSignal.h in Headers */,
46B95195207D633400A7D2DD /* AbstractDOMWindow.h in Headers */,
@@ -32017,6 +32025,7 @@
7CCEBFC01DD8F6AB002C40B8 /* SVGLengthValue.h in Headers */,
B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
+ 55DCC52922407B2A00C26E32 /* SVGList.h in Headers */,
0810764412828556007C63BA /* SVGListProperty.h in Headers */,
088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,
B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */,
@@ -32084,6 +32093,9 @@
B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */,
B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
+ 55DCC52822407B2000C26E32 /* SVGPrimitiveList.h in Headers */,
+ 72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */,
+ 72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */,
088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */,
088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
B2227A9A0D00BF220071B782 /* SVGRadialGradientElement.h in Headers */,
@@ -32102,11 +32114,9 @@
B2227AA30D00BF220071B782 /* SVGScriptElement.h in Headers */,
B2227AA60D00BF220071B782 /* SVGSetElement.h in Headers */,
E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */,
- 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */,
0813A4EA1284132600992511 /* SVGStaticPropertyTearOff.h in Headers */,
B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */,
B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */,
- 7C39C3771DDBE17000FEFB29 /* SVGStringListValues.h in Headers */,
B2227AB80D00BF220071B782 /* SVGStyleElement.h in Headers */,
B2227ABB0D00BF220071B782 /* SVGSVGElement.h in Headers */,
B2227ABE0D00BF220071B782 /* SVGSwitchElement.h in Headers */,
Modified: trunk/Source/WebCore/svg/SVGElement.cpp (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGElement.cpp 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGElement.cpp 2019-03-19 04:23:27 UTC (rev 243130)
@@ -720,14 +720,26 @@
SVGElement* nonConstThis = const_cast<SVGElement*>(this);
if (name == anyQName())
synchronizeAllAnimatedSVGAttribute(nonConstThis);
- else if (isAnimatedPropertyAttribute(name)) {
+ else {
// If the value of the property has changed, serialize the new value to the attribute.
if (auto value = propertyRegistry().synchronize(name))
nonConstThis->setSynchronizedLazyAttribute(name, *value);
- } else
- nonConstThis->synchronizeAttribute(name);
+ else
+ nonConstThis->synchronizeAttribute(name);
+ }
}
+
+void SVGElement::commitPropertyChange(SVGProperty* property)
+{
+ // We want to dirty the top-level property when a descendant changes. For example
+ // a change in an SVGLength item in SVGLengthList should set the dirty flag on
+ // SVGLengthList and not the SVGLength.
+ property->setDirty();
+ invalidateSVGAttributes();
+ svgAttributeChanged(propertyRegistry().propertyAttributeName(*property));
+}
+
void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty)
{
QualifiedName attributeName = propertyRegistry().animatedPropertyAttributeName(animatedProperty);
Modified: trunk/Source/WebCore/svg/SVGElement.h (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGElement.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGElement.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -157,7 +157,7 @@
bool isAnimatedPropertyAttribute(const QualifiedName&) const;
bool isAnimatedAttribute(const QualifiedName&) const;
- void commitPropertyChange() override { }
+ void commitPropertyChange(SVGProperty*) override;
void commitPropertyChange(SVGAnimatedProperty&);
const SVGElement* attributeContextElement() const override { return this; }
Modified: trunk/Source/WebCore/svg/SVGStringList.h (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGStringList.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGStringList.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,33 +25,63 @@
#pragma once
-#include "SVGAnimatedListPropertyTearOff.h"
-#include "SVGListPropertyTearOff.h"
-#include "SVGStringListValues.h"
+#include "SVGParserUtilities.h"
+#include "SVGPrimitiveList.h"
namespace WebCore {
-class SVGStringList final : public SVGStaticListPropertyTearOff<SVGStringListValues> {
+class SVGStringList final : public SVGPrimitiveList<String> {
+ using Base = SVGPrimitiveList<String>;
+ using Base::Base;
+ using Base::m_items;
+
public:
- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGStringListValues>;
- using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache;
+ static Ref<SVGStringList> create(SVGPropertyOwner* owner)
+ {
+ return adoptRef(*new SVGStringList(owner));
+ }
- static Ref<SVGStringList> create(SVGElement& contextElement, SVGStringListValues& values)
+ void reset(const String& string)
{
- return adoptRef(*new SVGStringList(&contextElement, values));
+ parse(string, ' ');
+
+ // Add empty string, if list is empty.
+ if (m_items.isEmpty())
+ m_items.append(emptyString());
}
- static Ref<SVGStringList> create(AnimatedListPropertyTearOff&, SVGPropertyRole, SVGStringListValues& values, ListWrapperCache&)
+ bool parse(const String& data, UChar delimiter)
{
- // FIXME: Find a way to remove this. It's only needed to keep Windows compiling.
- ASSERT_NOT_REACHED();
- return adoptRef(*new SVGStringList(nullptr, values));
+ clearItems();
+
+ auto upconvertedCharacters = StringView(data).upconvertedCharacters();
+ const UChar* ptr = upconvertedCharacters;
+ const UChar* end = ptr + data.length();
+ while (ptr < end) {
+ const UChar* start = ptr;
+ while (ptr < end && *ptr != delimiter && !isSVGSpace(*ptr))
+ ptr++;
+ if (ptr == start)
+ break;
+ m_items.append(String(start, ptr - start));
+ skipOptionalSVGSpacesOrDelimiter(ptr, end, delimiter);
+ }
+
+ return ptr == end;
}
-private:
- SVGStringList(SVGElement* contextElement, SVGStringListValues& values)
- : SVGStaticListPropertyTearOff<SVGStringListValues>(contextElement, values)
+ String valueAsString() const override
{
+ StringBuilder builder;
+
+ for (auto string : m_items) {
+ if (builder.length())
+ builder.append(' ');
+
+ builder.append(string);
+ }
+
+ return builder.toString();
}
};
Deleted: trunk/Source/WebCore/svg/SVGStringListValues.cpp (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGStringListValues.cpp 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGStringListValues.cpp 2019-03-19 04:23:27 UTC (rev 243130)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004, 2005, 2006 Rob Buis <[email protected]>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SVGStringListValues.h"
-
-#include "SVGElement.h"
-#include "SVGParserUtilities.h"
-#include <wtf/text/StringBuilder.h>
-
-namespace WebCore {
-
-void SVGStringListValues::commitChange(SVGElement& contextElement)
-{
- contextElement.invalidateSVGAttributes();
- contextElement.svgAttributeChanged(m_attributeName);
-}
-
-void SVGStringListValues::reset(const String& string)
-{
- parse(string, ' ');
-
- // Add empty string, if list is empty.
- if (isEmpty())
- append(emptyString());
-}
-
-void SVGStringListValues::parse(const String& data, UChar delimiter)
-{
- // TODO : more error checking/reporting
- clear();
-
- auto upconvertedCharacters = StringView(data).upconvertedCharacters();
- const UChar* ptr = upconvertedCharacters;
- const UChar* end = ptr + data.length();
- while (ptr < end) {
- const UChar* start = ptr;
- while (ptr < end && *ptr != delimiter && !isSVGSpace(*ptr))
- ptr++;
- if (ptr == start)
- break;
- append(String(start, ptr - start));
- skipOptionalSVGSpacesOrDelimiter(ptr, end, delimiter);
- }
-}
-
-String SVGStringListValues::valueAsString() const
-{
- StringBuilder builder;
-
- unsigned size = this->size();
- for (unsigned i = 0; i < size; ++i) {
- if (i > 0)
- builder.append(' ');
-
- builder.append(at(i));
- }
-
- return builder.toString();
-}
-
-}
Deleted: trunk/Source/WebCore/svg/SVGStringListValues.h (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGStringListValues.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGStringListValues.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004, 2005, 2006 Rob Buis <[email protected]>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "QualifiedName.h"
-#include "SVGAttributeAccessor.h"
-#include "SVGPropertyTraits.h"
-
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class SVGElement;
-class SVGStringList;
-class SVGStringListValues;
-
-template<typename T>
-class SVGPropertyTearOff;
-
-using SVGStringListValuesAttribute = SVGPropertyAttribute<SVGStringListValues>;
-
-template<typename OwnerType>
-using SVGStringListValuesAttributeAccessor = SVGPropertyAttributeAccessor<OwnerType, SVGStringListValuesAttribute>;
-
-class SVGStringListValues final : public Vector<String> {
-public:
- SVGStringListValues(const QualifiedName& attributeName)
- : m_attributeName(attributeName)
- {
- }
-
- void reset(const String&);
- void parse(const String&, UChar delimiter = ',');
-
- // Only used by SVGStringList.
- void commitChange(SVGElement& contextElement);
-
- String valueAsString() const;
-
-private:
- const QualifiedName& m_attributeName;
-};
-
-template<> struct SVGPropertyTraits<SVGStringListValues> {
- static String toString(const SVGStringListValues& list) { return list.valueAsString(); }
-
- using ListItemType = String;
- using ListItemTearOff = SVGPropertyTearOff<String>;
- using ListPropertyTearOff = SVGStringList;
-};
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGTests.cpp (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGTests.cpp 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGTests.cpp 2019-03-19 04:23:27 UTC (rev 243130)
@@ -109,20 +109,18 @@
SVGTests::SVGTests(SVGElement* contextElement)
: m_contextElement(*contextElement)
+ , m_requiredFeatures(SVGStringList::create(contextElement))
+ , m_requiredExtensions(SVGStringList::create(contextElement))
+ , m_systemLanguage(SVGStringList::create(contextElement))
{
- registerAttributes();
+ static std::once_flag onceFlag;
+ std::call_once(onceFlag, [] {
+ PropertyRegistry::registerProperty<SVGNames::requiredFeaturesAttr, &SVGTests::m_requiredFeatures>();
+ PropertyRegistry::registerProperty<SVGNames::requiredExtensionsAttr, &SVGTests::m_requiredExtensions>();
+ PropertyRegistry::registerProperty<SVGNames::systemLanguageAttr, &SVGTests::m_systemLanguage>();
+ });
}
-void SVGTests::registerAttributes()
-{
- auto& registry = attributeRegistry();
- if (!registry.isEmpty())
- return;
- registry.registerAttribute<SVGNames::requiredFeaturesAttr, &SVGTests::m_requiredFeatures>();
- registry.registerAttribute<SVGNames::requiredExtensionsAttr, &SVGTests::m_requiredExtensions>();
- registry.registerAttribute<SVGNames::systemLanguageAttr, &SVGTests::m_systemLanguage>();
-}
-
SVGTests::AttributeRegistry& SVGTests::attributeRegistry()
{
return AttributeOwnerProxy::attributeRegistry();
@@ -130,7 +128,7 @@
bool SVGTests::isKnownAttribute(const QualifiedName& attributeName)
{
- return AttributeOwnerProxy::isKnownAttribute(attributeName);
+ return PropertyRegistry::isKnownAttribute(attributeName);
}
bool SVGTests::hasExtension(const String& extension)
@@ -145,15 +143,15 @@
bool SVGTests::isValid() const
{
- for (auto& feature : m_requiredFeatures.value()) {
+ for (auto& feature : m_requiredFeatures->items()) {
if (feature.isEmpty() || !supportedSVGFeatures().contains(feature))
return false;
}
- for (auto& language : m_systemLanguage.value()) {
+ for (auto& language : m_systemLanguage->items()) {
if (language != defaultLanguage().substring(0, 2))
return false;
}
- for (auto& extension : m_requiredExtensions.value()) {
+ for (auto& extension : m_requiredExtensions->items()) {
if (!hasExtension(extension))
return false;
}
@@ -163,11 +161,11 @@
void SVGTests::parseAttribute(const QualifiedName& attributeName, const AtomicString& value)
{
if (attributeName == requiredFeaturesAttr)
- m_requiredFeatures.value().reset(value);
+ m_requiredFeatures->reset(value);
if (attributeName == requiredExtensionsAttr)
- m_requiredExtensions.value().reset(value);
+ m_requiredExtensions->reset(value);
if (attributeName == systemLanguageAttr)
- m_systemLanguage.value().reset(value);
+ m_systemLanguage->reset(value);
}
void SVGTests::svgAttributeChanged(const QualifiedName& attrName)
@@ -187,24 +185,6 @@
supportedAttributes.add(systemLanguageAttr);
}
-Ref<SVGStringList> SVGTests::requiredFeatures()
-{
- m_requiredFeatures.setShouldSynchronize(true);
- return SVGStringList::create(m_contextElement, m_requiredFeatures.value());
-}
-
-Ref<SVGStringList> SVGTests::requiredExtensions()
-{
- m_requiredExtensions.setShouldSynchronize(true);
- return SVGStringList::create(m_contextElement, m_requiredExtensions.value());
-}
-
-Ref<SVGStringList> SVGTests::systemLanguage()
-{
- m_systemLanguage.setShouldSynchronize(true);
- return SVGStringList::create(m_contextElement, m_systemLanguage.value());
-}
-
bool SVGTests::hasFeatureForLegacyBindings(const String& feature, const String& version)
{
// FIXME: This function is here only to be exposed in the Objective-C and GObject bindings for both Node and DOMImplementation.
Modified: trunk/Source/WebCore/svg/SVGTests.h (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGTests.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGTests.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -21,8 +21,7 @@
#pragma once
-#include "SVGAttribute.h"
-#include "SVGStringListValues.h"
+#include "SVGStringList.h"
namespace WebCore {
@@ -59,9 +58,9 @@
WEBCORE_EXPORT static bool hasFeatureForLegacyBindings(const String& feature, const String& version);
// These methods are called from DOM through the super classes.
- Ref<SVGStringList> requiredFeatures();
- Ref<SVGStringList> requiredExtensions();
- Ref<SVGStringList> systemLanguage();
+ SVGStringList& requiredFeatures() { return m_requiredFeatures; }
+ SVGStringList& requiredExtensions() { return m_requiredExtensions; }
+ SVGStringList& systemLanguage() { return m_systemLanguage; }
protected:
SVGTests(SVGElement* contextElement);
@@ -68,12 +67,11 @@
private:
using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTests>;
- static void registerAttributes();
SVGElement& m_contextElement;
- SVGStringListValuesAttribute m_requiredFeatures { SVGNames::requiredFeaturesAttr };
- SVGStringListValuesAttribute m_requiredExtensions { SVGNames::requiredExtensionsAttr };
- SVGStringListValuesAttribute m_systemLanguage { SVGNames::systemLanguageAttr };
+ Ref<SVGStringList> m_requiredFeatures;
+ Ref<SVGStringList> m_requiredExtensions;
+ Ref<SVGStringList> m_systemLanguage;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGTests.idl (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGTests.idl 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGTests.idl 2019-03-19 04:23:27 UTC (rev 243130)
@@ -28,9 +28,9 @@
NoInterfaceObject,
SuppressToJSObject,
] interface SVGTests {
- [NewObject] readonly attribute SVGStringList requiredFeatures;
- [NewObject] readonly attribute SVGStringList requiredExtensions;
- [NewObject] readonly attribute SVGStringList systemLanguage;
+ readonly attribute SVGStringList requiredFeatures;
+ readonly attribute SVGStringList requiredExtensions;
+ readonly attribute SVGStringList systemLanguage;
// FIXME: Using "undefined" as default parameter value is wrong.
boolean hasExtension(optional DOMString extension = "undefined");
Modified: trunk/Source/WebCore/svg/SVGViewElement.cpp (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGViewElement.cpp 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGViewElement.cpp 2019-03-19 04:23:27 UTC (rev 243130)
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <[email protected]>
* Copyright (C) 2004, 2005, 2007 Rob Buis <[email protected]>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -34,9 +34,13 @@
: SVGElement(tagName, document)
, SVGExternalResourcesRequired(this)
, SVGFitToViewBox(this)
- , m_viewTarget(SVGNames::viewTargetAttr)
{
ASSERT(hasTagName(SVGNames::viewTag));
+
+ static std::once_flag onceFlag;
+ std::call_once(onceFlag, [] {
+ PropertyRegistry::registerProperty<SVGNames::viewTargetAttr, &SVGViewElement::m_viewTarget>();
+ });
}
Ref<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Document& document)
@@ -44,15 +48,12 @@
return adoptRef(*new SVGViewElement(tagName, document));
}
-Ref<SVGStringList> SVGViewElement::viewTarget()
-{
- return SVGStringList::create(*this, m_viewTarget);
-}
-
void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (name == SVGNames::viewTargetAttr)
- m_viewTarget.reset(value);
+ if (name == SVGNames::viewTargetAttr) {
+ m_viewTarget->reset(value);
+ return;
+ }
SVGElement::parseAttribute(name, value);
SVGExternalResourcesRequired::parseAttribute(name, value);
Modified: trunk/Source/WebCore/svg/SVGViewElement.h (243129 => 243130)
--- trunk/Source/WebCore/svg/SVGViewElement.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/SVGViewElement.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -24,12 +24,11 @@
#include "SVGElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
+#include "SVGStringList.h"
#include "SVGZoomAndPan.h"
namespace WebCore {
-class SVGStringList;
-
class SVGViewElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGZoomAndPan {
WTF_MAKE_ISO_ALLOCATED(SVGViewElement);
public:
@@ -38,7 +37,7 @@
using SVGElement::ref;
using SVGElement::deref;
- Ref<SVGStringList> viewTarget();
+ Ref<SVGStringList> viewTarget() { return m_viewTarget.copyRef(); }
private:
SVGViewElement(const QualifiedName&, Document&);
@@ -56,7 +55,7 @@
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
- SVGStringListValues m_viewTarget;
+ Ref<SVGStringList> m_viewTarget { SVGStringList::create(this) };
};
} // namespace WebCore
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -22,7 +22,6 @@
#include "SVGLegacyAnimatedProperty.h"
#include "SVGListPropertyTearOff.h"
-#include "SVGStaticListPropertyTearOff.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -49,7 +49,7 @@
ExceptionOr<void> setBaseVal(const PropertyType& baseVal)
{
m_baseVal = baseVal;
- commitPropertyChange();
+ commitPropertyChange(nullptr);
return { };
}
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp 2019-03-19 04:23:27 UTC (rev 243130)
@@ -35,7 +35,7 @@
return m_contextElement;
}
-void SVGAnimatedProperty::commitPropertyChange()
+void SVGAnimatedProperty::commitPropertyChange(SVGProperty*)
{
if (!m_contextElement)
return;
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -26,8 +26,13 @@
#pragma once
#include "SVGPropertyOwner.h"
+#include <wtf/Optional.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
+
+class SVGElement;
class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty>, public SVGPropertyOwner {
public:
@@ -62,7 +67,7 @@
}
SVGPropertyOwner* owner() const override;
- void commitPropertyChange() override;
+ void commitPropertyChange(SVGProperty*) override;
SVGElement* m_contextElement { nullptr };
bool m_isAnimating { false };
Modified: trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -37,7 +37,6 @@
#include "SVGAnimatedTransformList.h"
#include "SVGAttributeAccessor.h"
#include "SVGLegacyAnimatedProperty.h"
-#include "SVGStringListValues.h"
#include "SVGZoomAndPanType.h"
#include <wtf/HashMap.h>
@@ -52,13 +51,6 @@
return map;
}
- // Non animatable attributes
- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGStringListValuesAttribute OwnerType::*attribute>
- void registerAttribute()
- {
- registerAttribute(SVGStringListValuesAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
- }
-
template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGZoomAndPanTypeAttribute OwnerType::*attribute>
void registerAttribute()
{
Added: trunk/Source/WebCore/svg/properties/SVGList.h (0 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGList.h (rev 0)
+++ trunk/Source/WebCore/svg/properties/SVGList.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ExceptionOr.h"
+#include "SVGProperty.h"
+
+namespace WebCore {
+
+template<typename ItemType>
+class SVGList : public SVGProperty {
+public:
+ unsigned numberOfItems() const
+ {
+ return m_items.size();
+ }
+
+ ExceptionOr<void> clear()
+ {
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ clearItems();
+ commitChange();
+ return { };
+ }
+
+ ExceptionOr<ItemType> getItem(unsigned index)
+ {
+ auto result = canGetItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ return at(index);
+ }
+
+ ExceptionOr<ItemType> initialize(ItemType&& newItem)
+ {
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+
+ // Spec: Clears all existing current items from the list.
+ clearItems();
+
+ auto item = append(WTFMove(newItem));
+ commitChange();
+ return WTFMove(item);
+ }
+
+ ExceptionOr<ItemType> insertItemBefore(ItemType&& newItem, unsigned index)
+ {
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ // Spec: If the index is greater than or equal to numberOfItems,
+ // then the new item is appended to the end of the list.
+ if (index > numberOfItems())
+ index = numberOfItems();
+
+ auto item = insert(index, WTFMove(newItem));
+ commitChange();
+ return WTFMove(item);
+ }
+
+ ExceptionOr<ItemType> replaceItem(ItemType&& newItem, unsigned index)
+ {
+ auto result = canReplaceItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ auto item = replace(index, WTFMove(newItem));
+ commitChange();
+ return WTFMove(item);
+ }
+
+ ExceptionOr<ItemType> removeItem(unsigned index)
+ {
+ auto result = canRemoveItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ auto item = remove(index);
+ commitChange();
+ return WTFMove(item);
+ }
+
+ ExceptionOr<ItemType> appendItem(ItemType&& newItem)
+ {
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ auto item = append(WTFMove(newItem));
+ commitChange();
+ return WTFMove(item);
+ }
+
+ // Parsers and animators need to have a direct access to the items.
+ Vector<ItemType>& items() { return m_items; }
+ const Vector<ItemType>& items() const { return m_items; }
+ size_t size() const { return m_items.size(); }
+ bool isEmpty() const { return m_items.isEmpty(); }
+
+ void clearItems()
+ {
+ detachItems();
+ m_items.clear();
+ }
+
+protected:
+ using SVGProperty::SVGProperty;
+
+ ExceptionOr<bool> canAlterList() const
+ {
+ if (isReadOnly())
+ return Exception { NoModificationAllowedError };
+ return true;
+ }
+
+ ExceptionOr<bool> canGetItem(unsigned index)
+ {
+ if (index >= m_items.size())
+ return Exception { IndexSizeError };
+ return true;
+ }
+
+ ExceptionOr<bool> canReplaceItem(unsigned index)
+ {
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ if (index >= m_items.size())
+ return Exception { IndexSizeError };
+ return true;
+ }
+
+ ExceptionOr<bool> canRemoveItem(unsigned index)
+ {
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ ASSERT(result.releaseReturnValue());
+
+ if (index >= m_items.size())
+ return Exception { IndexSizeError };
+ return true;
+ }
+
+ virtual void detachItems() { }
+ virtual ItemType at(unsigned index) const = 0;
+ virtual ItemType insert(unsigned index, ItemType&&) = 0;
+ virtual ItemType replace(unsigned index, ItemType&&) = 0;
+ virtual ItemType remove(unsigned index) = 0;
+ virtual ItemType append(ItemType&&) = 0;
+
+ Vector<ItemType> m_items;
+};
+
+}
Modified: trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -31,6 +31,7 @@
namespace WebCore {
class SVGAnimatedProperty;
+class SVGProperty;
template<typename OwnerType>
class SVGMemberAccessor {
@@ -42,6 +43,7 @@
virtual bool isAnimatedProperty() const { return false; }
virtual bool isAnimatedLength() const { return false; }
+ virtual bool matches(const OwnerType&, const SVGProperty&) const { return false; }
virtual bool matches(const OwnerType&, const SVGAnimatedProperty&) const { return false; }
virtual Optional<String> synchronize(const OwnerType&) const { return WTF::nullopt; }
Copied: trunk/Source/WebCore/svg/properties/SVGPrimitiveList.h (from rev 243129, trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h) (0 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGPrimitiveList.h (rev 0)
+++ trunk/Source/WebCore/svg/properties/SVGPrimitiveList.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "SVGList.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGPrimitiveList : public SVGList<PropertyType> {
+protected:
+ using Base = SVGList<PropertyType>;
+ using Base::Base;
+ using Base::size;
+ using Base::m_items;
+
+ PropertyType at(unsigned index) const override
+ {
+ ASSERT(index < size());
+ return m_items.at(index);
+ }
+
+ PropertyType insert(unsigned index, PropertyType&& newItem) override
+ {
+ ASSERT(index <= size());
+ m_items.insert(index, WTFMove(newItem));
+ return at(index);
+ }
+
+ PropertyType replace(unsigned index, PropertyType&& newItem) override
+ {
+ ASSERT(index < size());
+ m_items.at(index) = WTFMove(newItem);
+ return at(index);
+ }
+
+ PropertyType remove(unsigned index) override
+ {
+ ASSERT(index < size());
+ PropertyType item = at(index);
+ m_items.remove(index);
+ return WTFMove(item);
+ }
+
+ PropertyType append(PropertyType&& newItem) override
+ {
+ m_items.append(WTFMove(newItem));
+ return at(size() - 1);
+ }
+};
+
+}
Modified: trunk/Source/WebCore/svg/properties/SVGProperty.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGProperty.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGProperty.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -20,10 +20,77 @@
#pragma once
+#include "SVGPropertyOwner.h"
+#include <wtf/RefCounted.h>
+
namespace WebCore {
enum class SVGPropertyAccess : uint8_t { ReadWrite, ReadOnly };
enum class SVGPropertyState : uint8_t { Clean, Dirty };
+class SVGProperty : public RefCounted<SVGProperty> {
+public:
+ virtual ~SVGProperty() = default;
+
+ // Managing the relationship with the owner.
+ bool isAttached() const { return m_owner; }
+ void attach(SVGPropertyOwner* owner, SVGPropertyAccess access)
+ {
+ ASSERT(!m_owner);
+ ASSERT(m_state == SVGPropertyState::Clean);
+ m_owner = owner;
+ m_access = access;
+ }
+
+ void detach()
+ {
+ m_owner = nullptr;
+ m_access = SVGPropertyAccess::ReadWrite;
+ m_state = SVGPropertyState::Clean;
+ }
+
+ const SVGElement* contextElement() const
+ {
+ if (!m_owner)
+ return nullptr;
+ return m_owner->attributeContextElement();
+ }
+
+ void commitChange()
+ {
+ if (!m_owner)
+ return;
+ m_owner->commitPropertyChange(this);
+ }
+
+ // DOM access.
+ SVGPropertyAccess access() const { return m_access; }
+ bool isReadOnly() const { return m_access == SVGPropertyAccess::ReadOnly; }
+
+ // Synchronizing the SVG attribute and its reflection here.
+ bool isDirty() const { return m_state == SVGPropertyState::Dirty; }
+ void setDirty() { m_state = SVGPropertyState::Dirty; }
+ Optional<String> synchronize()
+ {
+ if (m_state == SVGPropertyState::Clean)
+ return WTF::nullopt;
+ m_state = SVGPropertyState::Clean;
+ return valueAsString();
+ }
+
+ // This is used when calling setAttribute().
+ virtual String valueAsString() const { return emptyString(); }
+
+protected:
+ SVGProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
+ : m_owner(owner)
+ , m_access(access)
+ {
+ }
+
+ SVGPropertyOwner* m_owner { nullptr };
+ SVGPropertyAccess m_access { SVGPropertyAccess::ReadWrite };
+ SVGPropertyState m_state { SVGPropertyState::Clean };
+};
+
} // namespace WebCore
-
Copied: trunk/Source/WebCore/svg/properties/SVGPropertyAccessor.h (from rev 243129, trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h) (0 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGPropertyAccessor.h (rev 0)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyAccessor.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "SVGPointerMemberAccessor.h"
+
+namespace WebCore {
+
+template<typename OwnerType, typename PropertyType>
+class SVGPropertyAccessor : public SVGPointerMemberAccessor<OwnerType, PropertyType> {
+ using Base = SVGPointerMemberAccessor<OwnerType, PropertyType>;
+
+public:
+ using Base::Base;
+
+protected:
+ using Base::property;
+ using Base::singleton;
+
+ bool matches(const OwnerType& owner, const SVGProperty& property) const override
+ {
+ return this->property(owner).ptr() == &property;
+ }
+};
+
+}
Copied: trunk/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h (from rev 243129, trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp) (0 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h (rev 0)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "SVGPropertyAccessor.h"
+#include "SVGStringList.h"
+
+namespace WebCore {
+
+template<typename OwnerType>
+class SVGStringListAccessor final : public SVGPropertyAccessor<OwnerType, SVGStringList> {
+ using Base = SVGPropertyAccessor<OwnerType, SVGStringList>;
+
+public:
+ using Base::Base;
+ template<Ref<SVGStringList> OwnerType::*property>
+ constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGStringListAccessor, property>(); }
+};
+
+}
Modified: trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -26,6 +26,9 @@
#pragma once
namespace WebCore {
+
+class SVGElement;
+class SVGProperty;
class SVGPropertyOwner {
public:
@@ -40,11 +43,11 @@
return owner()->attributeContextElement();
}
- virtual void commitPropertyChange()
+ virtual void commitPropertyChange(SVGProperty* property)
{
if (!owner())
return;
- owner()->commitPropertyChange();
+ owner()->commitPropertyChange(property);
}
protected:
Modified: trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -27,6 +27,7 @@
#include "SVGAnimatedPropertyAccessorImpl.h"
#include "SVGAnimatedPropertyPairAccessorImpl.h"
+#include "SVGPropertyAccessorImpl.h"
#include "SVGPropertyRegistry.h"
#include <wtf/HashMap.h>
@@ -42,6 +43,12 @@
{
}
+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGStringList> OwnerType::*property>
+ static void registerProperty()
+ {
+ registerProperty(attributeName, SVGStringListAccessor<OwnerType>::template singleton<property>());
+ }
+
template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedBoolean> OwnerType::*property>
static void registerProperty()
{
@@ -77,6 +84,18 @@
return findAccessor(attributeName);
}
+ QualifiedName propertyAttributeName(const SVGProperty& property) const override
+ {
+ QualifiedName attributeName = nullQName();
+ enumerateRecursively([&](const auto& entry) -> bool {
+ if (!entry.value->matches(m_owner, property))
+ return true;
+ attributeName = entry.key;
+ return false;
+ });
+ return attributeName;
+ }
+
QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty& animatedProperty) const override
{
QualifiedName attributeName = nullQName();
Modified: trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -37,6 +37,7 @@
virtual ~SVGPropertyRegistry() = default;
virtual void detachAllProperties() const = 0;
+ virtual QualifiedName propertyAttributeName(const SVGProperty&) const = 0;
virtual QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty&) const = 0;
virtual Optional<String> synchronize(const QualifiedName&) const = 0;
virtual HashMap<QualifiedName, String> synchronizeAllAttributes() const = 0;
Deleted: trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h (243129 => 243130)
--- trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h 2019-03-19 04:13:37 UTC (rev 243129)
+++ trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h 2019-03-19 04:23:27 UTC (rev 243130)
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "SVGListProperty.h"
-
-namespace WebCore {
-
-template<typename PropertyType>
-class SVGStaticListPropertyTearOff : public SVGListProperty<PropertyType> {
-public:
- using Self = SVGStaticListPropertyTearOff<PropertyType>;
- using Base = SVGListProperty<PropertyType>;
-
- using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType;
- using ListItemTearOff = typename SVGPropertyTraits<PropertyType>::ListItemTearOff;
-
- using Base::m_role;
- using Base::m_values;
-
- static Ref<Self> create(SVGElement& contextElement, PropertyType& values)
- {
- return adoptRef(*new Self(contextElement, values));
- }
-
- ExceptionOr<void> clear()
- {
- return Base::clearValues();
- }
-
- ExceptionOr<ListItemType> initialize(const ListItemType& newItem)
- {
- return Base::initializeValues(newItem);
- }
-
- ExceptionOr<ListItemType> getItem(unsigned index)
- {
- return Base::getItemValues(index);
- }
-
- ExceptionOr<ListItemType> insertItemBefore(const ListItemType& newItem, unsigned index)
- {
- return Base::insertItemBeforeValues(newItem, index);
- }
-
- ExceptionOr<ListItemType> replaceItem(const ListItemType& newItem, unsigned index)
- {
- return Base::replaceItemValues(newItem, index);
- }
-
- ExceptionOr<ListItemType> removeItem(unsigned index)
- {
- return Base::removeItemValues(index);
- }
-
- ExceptionOr<ListItemType> appendItem(const ListItemType& newItem)
- {
- return Base::appendItemValues(newItem);
- }
-
-protected:
- SVGStaticListPropertyTearOff(SVGElement* contextElement, PropertyType& values)
- : Base(UndefinedRole, values, nullptr)
- , m_contextElement(*contextElement)
- {
- }
-
- bool isReadOnly() const override
- {
- return m_role == AnimValRole;
- }
-
- void commitChange() override
- {
- ASSERT(m_values);
- m_values->commitChange(m_contextElement);
- }
-
- bool processIncomingListItemValue(const ListItemType&, unsigned*) override
- {
- // no-op for static lists
- return true;
- }
-
- bool processIncomingListItemWrapper(Ref<ListItemTearOff>&, unsigned*) override
- {
- ASSERT_NOT_REACHED();
- return true;
- }
-
- Ref<SVGElement> m_contextElement;
-};
-
-}