Changeset 243130 in webkit


Ignore:
Timestamp:
Mar 18, 2019 9:23:27 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Remove the SVG property tear off objects for SVGStringList
https://bugs.webkit.org/show_bug.cgi?id=195863

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-18
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.
Location:
trunk/Source/WebCore
Files:
1 added
3 deleted
21 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243129 r243130  
     12019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Remove the SVG property tear off objects for SVGStringList
     4        https://bugs.webkit.org/show_bug.cgi?id=195863
     5
     6        Reviewed by Simon Fraser.
     7
     8        SVGStringList is not animated list. So we need to introduce two new classes:
     9
     10        -- SVGProperty: This will be the base of all the non-animated properties.
     11           Like the SVGAnimatedProperty, SVGProperty will be registered with the
     12           attribute name in SVGPropertyRegistery. It will also commit changes
     13           to the reflecting attribute. And it will provide a synchronize string
     14           for lazy attribute update.
     15
     16        -- SVGList: It will be the base of all the list properties. It can hold
     17           primitive types or SVG types. In this patch primitive types will be
     18           supported only. To do that, a superclass called SVGPrimitiveList is
     19           added. Its items are of primitive type such as String type.
     20
     21        * Sources.txt:
     22        * WebCore.xcodeproj/project.pbxproj:
     23        * svg/SVGElement.cpp:
     24        (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
     25        (WebCore::SVGElement::commitPropertyChange):
     26        * svg/SVGElement.h:
     27        * svg/SVGStringList.h:
     28        * svg/SVGStringListValues.cpp: Removed.
     29        * svg/SVGStringListValues.h: Removed.
     30        * svg/SVGTests.cpp:
     31        (WebCore::SVGTests::SVGTests):
     32        (WebCore::SVGTests::isKnownAttribute):
     33        (WebCore::SVGTests::isValid const):
     34        (WebCore::SVGTests::parseAttribute):
     35        (WebCore::SVGTests::registerAttributes): Deleted.
     36        (WebCore::SVGTests::requiredFeatures): Deleted.
     37        (WebCore::SVGTests::requiredExtensions): Deleted.
     38        (WebCore::SVGTests::systemLanguage): Deleted.
     39        * svg/SVGTests.h:
     40        (WebCore::SVGTests::requiredFeatures):
     41        (WebCore::SVGTests::requiredExtensions):
     42        (WebCore::SVGTests::systemLanguage):
     43        (): Deleted.
     44        * svg/SVGTests.idl:
     45        * svg/SVGTextPositioningElement.h:
     46        * svg/SVGViewElement.cpp:
     47        (WebCore::SVGViewElement::SVGViewElement):
     48        (WebCore::SVGViewElement::parseAttribute):
     49        (WebCore::SVGViewElement::viewTarget): Deleted.
     50        * svg/SVGViewElement.h:
     51        * svg/properties/SVGAnimatedListPropertyTearOff.h:
     52        * svg/properties/SVGAnimatedPrimitiveProperty.h:
     53        (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
     54        * svg/properties/SVGAnimatedProperty.cpp:
     55        (WebCore::SVGAnimatedProperty::commitPropertyChange):
     56        * svg/properties/SVGAnimatedProperty.h:
     57        * svg/properties/SVGAttributeRegistry.h:
     58        * svg/properties/SVGList.h: Added.
     59        (WebCore::SVGList::numberOfItems const):
     60        (WebCore::SVGList::clear):
     61        (WebCore::SVGList::getItem):
     62        (WebCore::SVGList::initialize):
     63        (WebCore::SVGList::insertItemBefore):
     64        (WebCore::SVGList::replaceItem):
     65        (WebCore::SVGList::removeItem):
     66        (WebCore::SVGList::appendItem):
     67        (WebCore::SVGList::items):
     68        (WebCore::SVGList::items const):
     69        (WebCore::SVGList::size const):
     70        (WebCore::SVGList::isEmpty const):
     71        (WebCore::SVGList::clearItems):
     72        (WebCore::SVGList::canAlterList const):
     73        (WebCore::SVGList::canGetItem):
     74        (WebCore::SVGList::canReplaceItem):
     75        (WebCore::SVGList::canRemoveItem):
     76        (WebCore::SVGList::detachItems):
     77        * svg/properties/SVGMemberAccessor.h:
     78        (WebCore::SVGMemberAccessor::matches const):
     79        * svg/properties/SVGPrimitiveList.h: Added.
     80        * svg/properties/SVGProperty.h:
     81        (WebCore::SVGProperty::isAttached const):
     82        (WebCore::SVGProperty::attach):
     83        (WebCore::SVGProperty::detach):
     84        (WebCore::SVGProperty::contextElement const):
     85        (WebCore::SVGProperty::commitChange):
     86        (WebCore::SVGProperty::access const):
     87        (WebCore::SVGProperty::isReadOnly const):
     88        (WebCore::SVGProperty::isDirty const):
     89        (WebCore::SVGProperty::setDirty):
     90        (WebCore::SVGProperty::synchronize):
     91        (WebCore::SVGProperty::valueAsString const):
     92        (WebCore::SVGProperty::SVGProperty):
     93        * svg/properties/SVGPropertyAccessor.h: Added.
     94        * svg/properties/SVGPropertyAccessorImpl.h: Added.
     95        * svg/properties/SVGPropertyOwner.h:
     96        (WebCore::SVGPropertyOwner::commitPropertyChange):
     97        * svg/properties/SVGPropertyOwnerRegistry.h:
     98        (WebCore::SVGPropertyOwnerRegistry::registerProperty):
     99        * svg/properties/SVGPropertyRegistry.h:
     100        * svg/properties/SVGStaticListPropertyTearOff.h: Removed.
     101
    11022019-03-18  Simon Fraser  <simon.fraser@apple.com>
    2103
  • trunk/Source/WebCore/Sources.txt

    r243121 r243130  
    23852385svg/SVGSetElement.cpp
    23862386svg/SVGStopElement.cpp
    2387 svg/SVGStringListValues.cpp
    23882387svg/SVGStyleElement.cpp
    23892388svg/SVGSwitchElement.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r243121 r243130  
    267267                087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    268268                087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */; };
    269                 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */; };
    270269                0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
    271270                0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    17881787                55AF14E61EAAC59B0026EEAA /* UTIRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17891788                55D70D23223B017C00044B8E /* SVGLegacyAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 55D70D20223B009100044B8E /* SVGLegacyAnimatedProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1789                55DCC52822407B2000C26E32 /* SVGPrimitiveList.h in Headers */ = {isa = PBXBuildFile; fileRef = 55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1790                55DCC52922407B2A00C26E32 /* SVGList.h in Headers */ = {isa = PBXBuildFile; fileRef = 55DCC523224073FE00C26E32 /* SVGList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17901791                55EC9599206AA7A0007DD0A9 /* PaintFrequencyTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17911792                55FA7FF0210FA386005AEFE7 /* SVGAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    21382139                71EFCEDC202B38A900D7C411 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71EFCED7202B388D00D7C411 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
    21392140                71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; };
     2141                72144331223EC85400F12FF7 /* (null) in Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Private, ); }; };
     2142                72144332223EC85F00F12FF7 /* (null) in Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Private, ); }; };
     2143                72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5363223B2A2400FBA944 /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2144                72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
    21402145                724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */; };
    21412146                724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
     
    22342239                7C330A081DF9F95100D3395C /* JSPositionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C330A061DF9F95100D3395C /* JSPositionOptions.h */; };
    22352240                7C39C3651DDA865200FEFB29 /* SVGLengthListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */; };
    2236                 7C39C3771DDBE17000FEFB29 /* SVGStringListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
    22372241                7C3A91E61C963B8800D1A7E3 /* ClipboardAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    22382242                7C3B79711908757B00B47A2D /* UserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */; };
     
    56415645                087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurrogatePairAwareTextIterator.h; sourceTree = "<group>"; };
    56425646                087B84951272CEC700A14417 /* SVGAnimatedAngle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedAngle.h; sourceTree = "<group>"; };
    5643                 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStaticListPropertyTearOff.h; sourceTree = "<group>"; };
    56445647                0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; };
    56455648                0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; };
     
    86818684                55DCC51C2240605E00C26E32 /* SVGAnimationDiscreteFunctionImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunctionImpl.h; sourceTree = "<group>"; };
    86828685                55DCC51D2240615500C26E32 /* SVGAnimationDiscreteFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunction.h; sourceTree = "<group>"; };
     8686                55DCC523224073FE00C26E32 /* SVGList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGList.h; sourceTree = "<group>"; };
     8687                55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPrimitiveList.h; sourceTree = "<group>"; };
     8688                55DCC526224074FA00C26E32 /* SVGPropertyAccessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAccessor.h; sourceTree = "<group>"; };
     8689                55DCC5272240750B00C26E32 /* SVGPropertyAccessorImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAccessorImpl.h; sourceTree = "<group>"; };
    86838690                55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaintFrequencyTracker.h; sourceTree = "<group>"; };
    86848691                55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMemberAccessor.h; sourceTree = "<group>"; };
     
    97329739                7C39C3621DDA864900FEFB29 /* SVGLengthListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthListValues.cpp; sourceTree = "<group>"; };
    97339740                7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthListValues.h; sourceTree = "<group>"; };
    9734                 7C39C3661DDB82CF00FEFB29 /* SVGStringListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGStringListValues.cpp; sourceTree = "<group>"; };
    9735                 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStringListValues.h; sourceTree = "<group>"; };
    97369741                7C39C3681DDB86D300FEFB29 /* SVGNumberListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGNumberListValues.cpp; sourceTree = "<group>"; };
    97379742                7C39C3691DDB86D300FEFB29 /* SVGNumberListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGNumberListValues.h; sourceTree = "<group>"; };
     
    1624416249                                55D70D20223B009100044B8E /* SVGLegacyAnimatedProperty.h */,
    1624516250                                55D70D22223B00EA00044B8E /* SVGLegacyProperty.h */,
     16251                                55DCC523224073FE00C26E32 /* SVGList.h */,
    1624616252                                0810764312828556007C63BA /* SVGListProperty.h */,
    1624716253                                088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */,
     
    1624916255                                55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */,
    1625016256                                55BE025A223B29C20032F08A /* SVGPointerMemberAccessor.h */,
     16257                                55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */,
    1625116258                                55EE5363223B2A2400FBA944 /* SVGProperty.h */,
     16259                                55DCC526224074FA00C26E32 /* SVGPropertyAccessor.h */,
     16260                                55DCC5272240750B00C26E32 /* SVGPropertyAccessorImpl.h */,
    1625216261                                55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */,
    1625316262                                55BE025C223B29C30032F08A /* SVGPropertyOwnerRegistry.h */,
     
    1625516264                                088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */,
    1625616265                                088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,
    16257                                 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */,
    1625816266                                0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */,
    1625916267                        );
     
    2451224520                                B22279160D00BF210071B782 /* SVGStringList.h */,
    2451324521                                B22279170D00BF210071B782 /* SVGStringList.idl */,
    24514                                 7C39C3661DDB82CF00FEFB29 /* SVGStringListValues.cpp */,
    24515                                 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */,
    2451624522                                B22279210D00BF210071B782 /* SVGStyleElement.cpp */,
    2451724523                                B22279220D00BF210071B782 /* SVGStyleElement.h */,
     
    2844028446                        buildActionMask = 2147483647;
    2844128447                        files = (
     28448                                72144332223EC85F00F12FF7 /* (null) in Headers */,
     28449                                72144331223EC85400F12FF7 /* (null) in Headers */,
    2844228450                                7CD0E2B81F80A4820016A4CE /* AbortController.h in Headers */,
    2844328451                                7CD0E2BF1F80A56E0016A4CE /* AbortSignal.h in Headers */,
     
    3201832026                                B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
    3201932027                                B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
     32028                                55DCC52922407B2A00C26E32 /* SVGList.h in Headers */,
    3202032029                                0810764412828556007C63BA /* SVGListProperty.h in Headers */,
    3202132030                                088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,
     
    3208532094                                B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */,
    3208632095                                B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
     32096                                55DCC52822407B2000C26E32 /* SVGPrimitiveList.h in Headers */,
     32097                                72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */,
     32098                                72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */,
    3208732099                                088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */,
    3208832100                                088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
     
    3210332115                                B2227AA60D00BF220071B782 /* SVGSetElement.h in Headers */,
    3210432116                                E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */,
    32105                                 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */,
    3210632117                                0813A4EA1284132600992511 /* SVGStaticPropertyTearOff.h in Headers */,
    3210732118                                B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */,
    3210832119                                B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */,
    32109                                 7C39C3771DDBE17000FEFB29 /* SVGStringListValues.h in Headers */,
    3211032120                                B2227AB80D00BF220071B782 /* SVGStyleElement.h in Headers */,
    3211132121                                B2227ABB0D00BF220071B782 /* SVGSVGElement.h in Headers */,
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r243036 r243130  
    721721    if (name == anyQName())
    722722        synchronizeAllAnimatedSVGAttribute(nonConstThis);
    723     else if (isAnimatedPropertyAttribute(name)) {
     723    else {
    724724        // If the value of the property has changed, serialize the new value to the attribute.
    725725        if (auto value = propertyRegistry().synchronize(name))
    726726            nonConstThis->setSynchronizedLazyAttribute(name, *value);
    727     } else
    728         nonConstThis->synchronizeAttribute(name);
     727        else
     728            nonConstThis->synchronizeAttribute(name);
     729    }
     730}
     731   
     732void SVGElement::commitPropertyChange(SVGProperty* property)
     733{
     734    // We want to dirty the top-level property when a descendant changes. For example
     735    // a change in an SVGLength item in SVGLengthList should set the dirty flag on
     736    // SVGLengthList and not the SVGLength.
     737    property->setDirty();
     738
     739    invalidateSVGAttributes();
     740    svgAttributeChanged(propertyRegistry().propertyAttributeName(*property));
    729741}
    730742
  • trunk/Source/WebCore/svg/SVGElement.h

    r243114 r243130  
    158158    bool isAnimatedAttribute(const QualifiedName&) const;
    159159
    160     void commitPropertyChange() override { }
     160    void commitPropertyChange(SVGProperty*) override;
    161161    void commitPropertyChange(SVGAnimatedProperty&);
    162162
  • trunk/Source/WebCore/svg/SVGStringList.h

    r208871 r243130  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #include "SVGAnimatedListPropertyTearOff.h"
    29 #include "SVGListPropertyTearOff.h"
    30 #include "SVGStringListValues.h"
     28#include "SVGParserUtilities.h"
     29#include "SVGPrimitiveList.h"
    3130
    3231namespace WebCore {
    3332
    34 class SVGStringList final : public SVGStaticListPropertyTearOff<SVGStringListValues> {
     33class SVGStringList final : public SVGPrimitiveList<String> {
     34    using Base = SVGPrimitiveList<String>;
     35    using Base::Base;
     36    using Base::m_items;
     37
    3538public:
    36     using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGStringListValues>;
    37     using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache;
    38 
    39     static Ref<SVGStringList> create(SVGElement& contextElement, SVGStringListValues& values)
     39    static Ref<SVGStringList> create(SVGPropertyOwner* owner)
    4040    {
    41         return adoptRef(*new SVGStringList(&contextElement, values));
     41        return adoptRef(*new SVGStringList(owner));
    4242    }
    4343
    44     static Ref<SVGStringList> create(AnimatedListPropertyTearOff&, SVGPropertyRole, SVGStringListValues& values, ListWrapperCache&)
     44    void reset(const String& string)
    4545    {
    46         // FIXME: Find a way to remove this. It's only needed to keep Windows compiling.
    47         ASSERT_NOT_REACHED();
    48         return adoptRef(*new SVGStringList(nullptr, values));
     46        parse(string, ' ');
     47
     48        // Add empty string, if list is empty.
     49        if (m_items.isEmpty())
     50            m_items.append(emptyString());
    4951    }
    5052
    51 private:
    52     SVGStringList(SVGElement* contextElement, SVGStringListValues& values)
    53         : SVGStaticListPropertyTearOff<SVGStringListValues>(contextElement, values)
     53    bool parse(const String& data, UChar delimiter)
    5454    {
     55        clearItems();
     56
     57        auto upconvertedCharacters = StringView(data).upconvertedCharacters();
     58        const UChar* ptr = upconvertedCharacters;
     59        const UChar* end = ptr + data.length();
     60        while (ptr < end) {
     61            const UChar* start = ptr;
     62            while (ptr < end && *ptr != delimiter && !isSVGSpace(*ptr))
     63                ptr++;
     64            if (ptr == start)
     65                break;
     66            m_items.append(String(start, ptr - start));
     67            skipOptionalSVGSpacesOrDelimiter(ptr, end, delimiter);
     68        }
     69
     70        return ptr == end;
     71    }
     72
     73    String valueAsString() const override
     74    {
     75        StringBuilder builder;
     76
     77        for (auto string : m_items) {
     78            if (builder.length())
     79                builder.append(' ');
     80
     81            builder.append(string);
     82        }
     83
     84        return builder.toString();
    5585    }
    5686};
  • trunk/Source/WebCore/svg/SVGTests.cpp

    r234620 r243130  
    110110SVGTests::SVGTests(SVGElement* contextElement)
    111111    : m_contextElement(*contextElement)
    112 {
    113     registerAttributes();
    114 }
    115 
    116 void SVGTests::registerAttributes()
    117 {
    118     auto& registry = attributeRegistry();
    119     if (!registry.isEmpty())
    120         return;
    121     registry.registerAttribute<SVGNames::requiredFeaturesAttr, &SVGTests::m_requiredFeatures>();
    122     registry.registerAttribute<SVGNames::requiredExtensionsAttr, &SVGTests::m_requiredExtensions>();
    123     registry.registerAttribute<SVGNames::systemLanguageAttr, &SVGTests::m_systemLanguage>();
     112    , m_requiredFeatures(SVGStringList::create(contextElement))
     113    , m_requiredExtensions(SVGStringList::create(contextElement))
     114    , m_systemLanguage(SVGStringList::create(contextElement))
     115{
     116    static std::once_flag onceFlag;
     117    std::call_once(onceFlag, [] {
     118        PropertyRegistry::registerProperty<SVGNames::requiredFeaturesAttr, &SVGTests::m_requiredFeatures>();
     119        PropertyRegistry::registerProperty<SVGNames::requiredExtensionsAttr, &SVGTests::m_requiredExtensions>();
     120        PropertyRegistry::registerProperty<SVGNames::systemLanguageAttr, &SVGTests::m_systemLanguage>();
     121    });
    124122}
    125123
     
    131129bool SVGTests::isKnownAttribute(const QualifiedName& attributeName)
    132130{
    133     return AttributeOwnerProxy::isKnownAttribute(attributeName);
     131    return PropertyRegistry::isKnownAttribute(attributeName);
    134132}
    135133
     
    146144bool SVGTests::isValid() const
    147145{
    148     for (auto& feature : m_requiredFeatures.value()) {
     146    for (auto& feature : m_requiredFeatures->items()) {
    149147        if (feature.isEmpty() || !supportedSVGFeatures().contains(feature))
    150148            return false;
    151149    }
    152     for (auto& language : m_systemLanguage.value()) {
     150    for (auto& language : m_systemLanguage->items()) {
    153151        if (language != defaultLanguage().substring(0, 2))
    154152            return false;
    155153    }
    156     for (auto& extension : m_requiredExtensions.value()) {
     154    for (auto& extension : m_requiredExtensions->items()) {
    157155        if (!hasExtension(extension))
    158156            return false;
     
    164162{
    165163    if (attributeName == requiredFeaturesAttr)
    166         m_requiredFeatures.value().reset(value);
     164        m_requiredFeatures->reset(value);
    167165    if (attributeName == requiredExtensionsAttr)
    168         m_requiredExtensions.value().reset(value);
     166        m_requiredExtensions->reset(value);
    169167    if (attributeName == systemLanguageAttr)
    170         m_systemLanguage.value().reset(value);
     168        m_systemLanguage->reset(value);
    171169}
    172170
     
    186184    supportedAttributes.add(requiredExtensionsAttr);
    187185    supportedAttributes.add(systemLanguageAttr);
    188 }
    189 
    190 Ref<SVGStringList> SVGTests::requiredFeatures()
    191 {
    192     m_requiredFeatures.setShouldSynchronize(true);
    193     return SVGStringList::create(m_contextElement, m_requiredFeatures.value());
    194 }
    195 
    196 Ref<SVGStringList> SVGTests::requiredExtensions()
    197 {
    198     m_requiredExtensions.setShouldSynchronize(true);
    199     return SVGStringList::create(m_contextElement, m_requiredExtensions.value());
    200 }
    201 
    202 Ref<SVGStringList> SVGTests::systemLanguage()
    203 {
    204     m_systemLanguage.setShouldSynchronize(true);
    205     return SVGStringList::create(m_contextElement, m_systemLanguage.value());
    206186}
    207187
  • trunk/Source/WebCore/svg/SVGTests.h

    r243114 r243130  
    2222#pragma once
    2323
    24 #include "SVGAttribute.h"
    25 #include "SVGStringListValues.h"
     24#include "SVGStringList.h"
    2625
    2726namespace WebCore {
     
    6059
    6160    // These methods are called from DOM through the super classes.
    62     Ref<SVGStringList> requiredFeatures();
    63     Ref<SVGStringList> requiredExtensions();
    64     Ref<SVGStringList> systemLanguage();
     61    SVGStringList& requiredFeatures() { return m_requiredFeatures; }
     62    SVGStringList& requiredExtensions() { return m_requiredExtensions; }
     63    SVGStringList& systemLanguage() { return m_systemLanguage; }
    6564
    6665protected:
     
    6968private:
    7069    using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTests>;
    71     static void registerAttributes();
    7270
    7371    SVGElement& m_contextElement;
    74     SVGStringListValuesAttribute m_requiredFeatures { SVGNames::requiredFeaturesAttr };
    75     SVGStringListValuesAttribute m_requiredExtensions { SVGNames::requiredExtensionsAttr };
    76     SVGStringListValuesAttribute m_systemLanguage { SVGNames::systemLanguageAttr };
     72    Ref<SVGStringList> m_requiredFeatures;
     73    Ref<SVGStringList> m_requiredExtensions;
     74    Ref<SVGStringList> m_systemLanguage;
    7775};
    7876
  • trunk/Source/WebCore/svg/SVGTests.idl

    r208863 r243130  
    2929    SuppressToJSObject,
    3030] interface SVGTests {
    31     [NewObject] readonly attribute SVGStringList requiredFeatures;
    32     [NewObject] readonly attribute SVGStringList requiredExtensions;
    33     [NewObject] readonly attribute SVGStringList systemLanguage;
     31    readonly attribute SVGStringList requiredFeatures;
     32    readonly attribute SVGStringList requiredExtensions;
     33    readonly attribute SVGStringList systemLanguage;
    3434
    3535    // FIXME: Using "undefined" as default parameter value is wrong.
  • trunk/Source/WebCore/svg/SVGViewElement.cpp

    r234620 r243130  
    22 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 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.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3535    , SVGExternalResourcesRequired(this)
    3636    , SVGFitToViewBox(this)
    37     , m_viewTarget(SVGNames::viewTargetAttr)
    3837{
    3938    ASSERT(hasTagName(SVGNames::viewTag));
     39   
     40    static std::once_flag onceFlag;
     41    std::call_once(onceFlag, [] {
     42        PropertyRegistry::registerProperty<SVGNames::viewTargetAttr, &SVGViewElement::m_viewTarget>();
     43    });
    4044}
    4145
     
    4549}
    4650
    47 Ref<SVGStringList> SVGViewElement::viewTarget()
    48 {
    49     return SVGStringList::create(*this, m_viewTarget);
    50 }
    51 
    5251void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    5352{
    54     if (name == SVGNames::viewTargetAttr)
    55         m_viewTarget.reset(value);
     53    if (name == SVGNames::viewTargetAttr) {
     54        m_viewTarget->reset(value);
     55        return;
     56    }
    5657
    5758    SVGElement::parseAttribute(name, value);
  • trunk/Source/WebCore/svg/SVGViewElement.h

    r243114 r243130  
    2525#include "SVGExternalResourcesRequired.h"
    2626#include "SVGFitToViewBox.h"
     27#include "SVGStringList.h"
    2728#include "SVGZoomAndPan.h"
    2829
    2930namespace WebCore {
    30 
    31 class SVGStringList;
    3231
    3332class SVGViewElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGZoomAndPan {
     
    3938    using SVGElement::deref;
    4039
    41     Ref<SVGStringList> viewTarget();
     40    Ref<SVGStringList> viewTarget() { return m_viewTarget.copyRef(); }
    4241
    4342private:
     
    5756    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    5857    PropertyRegistry m_propertyRegistry { *this };
    59     SVGStringListValues m_viewTarget;
     58    Ref<SVGStringList> m_viewTarget { SVGStringList::create(this) };
    6059};
    6160
  • trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h

    r242978 r243130  
    2323#include "SVGLegacyAnimatedProperty.h"
    2424#include "SVGListPropertyTearOff.h"
    25 #include "SVGStaticListPropertyTearOff.h"
    2625
    2726namespace WebCore {
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h

    r243036 r243130  
    5050    {
    5151        m_baseVal = baseVal;
    52         commitPropertyChange();
     52        commitPropertyChange(nullptr);
    5353        return { };
    5454    }
  • trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp

    r243036 r243130  
    3636}
    3737
    38 void SVGAnimatedProperty::commitPropertyChange()
     38void SVGAnimatedProperty::commitPropertyChange(SVGProperty*)
    3939{
    4040    if (!m_contextElement)
  • trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h

    r243036 r243130  
    2727
    2828#include "SVGPropertyOwner.h"
     29#include <wtf/Optional.h>
     30#include <wtf/RefCounted.h>
     31#include <wtf/text/WTFString.h>
    2932
    3033namespace WebCore {
     34   
     35class SVGElement;
    3136
    3237class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty>, public SVGPropertyOwner {
     
    6368   
    6469    SVGPropertyOwner* owner() const override;
    65     void commitPropertyChange() override;
     70    void commitPropertyChange(SVGProperty*) override;
    6671   
    6772    SVGElement* m_contextElement { nullptr };
  • trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h

    r243121 r243130  
    3838#include "SVGAttributeAccessor.h"
    3939#include "SVGLegacyAnimatedProperty.h"
    40 #include "SVGStringListValues.h"
    4140#include "SVGZoomAndPanType.h"
    4241#include <wtf/HashMap.h>
     
    5150        static NeverDestroyed<SVGAttributeRegistry<OwnerType, BaseTypes...>> map;
    5251        return map;
    53     }
    54 
    55     // Non animatable attributes
    56     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGStringListValuesAttribute OwnerType::*attribute>
    57     void registerAttribute()
    58     {
    59         registerAttribute(SVGStringListValuesAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
    6052    }
    6153
  • trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h

    r243036 r243130  
    3232
    3333class SVGAnimatedProperty;
     34class SVGProperty;
    3435
    3536template<typename OwnerType>
     
    4344    virtual bool isAnimatedLength() const { return false; }
    4445
     46    virtual bool matches(const OwnerType&, const SVGProperty&) const { return false; }
    4547    virtual bool matches(const OwnerType&, const SVGAnimatedProperty&) const { return false; }
    4648    virtual Optional<String> synchronize(const OwnerType&) const { return WTF::nullopt; }
  • trunk/Source/WebCore/svg/properties/SVGPrimitiveList.h

    r243129 r243130  
    11/*
    2  * Copyright (C) 2018-2019 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2019 Apple Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
     28#include "SVGList.h"
     29
    2830namespace WebCore {
    2931
    30 class SVGPropertyOwner {
    31 public:
    32     virtual ~SVGPropertyOwner() = default;
     32template<typename PropertyType>
     33class SVGPrimitiveList : public SVGList<PropertyType> {
     34protected:
     35    using Base = SVGList<PropertyType>;
     36    using Base::Base;
     37    using Base::size;
     38    using Base::m_items;
    3339
    34     virtual SVGPropertyOwner* owner() const { return nullptr; }
    35    
    36     virtual const SVGElement* attributeContextElement() const
     40    PropertyType at(unsigned index) const override
    3741    {
    38         if (!owner())
    39             return nullptr;
    40         return owner()->attributeContextElement();
     42        ASSERT(index < size());
     43        return m_items.at(index);
    4144    }
    42    
    43     virtual void commitPropertyChange()
     45
     46    PropertyType insert(unsigned index, PropertyType&& newItem) override
    4447    {
    45         if (!owner())
    46             return;
    47         owner()->commitPropertyChange();
     48        ASSERT(index <= size());
     49        m_items.insert(index, WTFMove(newItem));
     50        return at(index);
    4851    }
    49    
    50 protected:
    51     SVGPropertyOwner() = default;
     52
     53    PropertyType replace(unsigned index, PropertyType&& newItem) override
     54    {
     55        ASSERT(index < size());
     56        m_items.at(index) = WTFMove(newItem);
     57        return at(index);
     58    }
     59
     60    PropertyType remove(unsigned index) override
     61    {
     62        ASSERT(index < size());
     63        PropertyType item = at(index);
     64        m_items.remove(index);
     65        return WTFMove(item);
     66    }
     67
     68    PropertyType append(PropertyType&& newItem) override
     69    {
     70        m_items.append(WTFMove(newItem));
     71        return at(size() - 1);
     72    }
    5273};
    5374
  • trunk/Source/WebCore/svg/properties/SVGProperty.h

    r243036 r243130  
    2121#pragma once
    2222
     23#include "SVGPropertyOwner.h"
     24#include <wtf/RefCounted.h>
     25
    2326namespace WebCore {
    2427
     
    2629enum class SVGPropertyState : uint8_t { Clean, Dirty };
    2730
     31class SVGProperty : public RefCounted<SVGProperty> {
     32public:
     33    virtual ~SVGProperty() = default;
     34
     35    // Managing the relationship with the owner.
     36    bool isAttached() const { return m_owner; }
     37    void attach(SVGPropertyOwner* owner, SVGPropertyAccess access)
     38    {
     39        ASSERT(!m_owner);
     40        ASSERT(m_state == SVGPropertyState::Clean);
     41        m_owner = owner;
     42        m_access = access;
     43    }
     44
     45    void detach()
     46    {
     47        m_owner = nullptr;
     48        m_access = SVGPropertyAccess::ReadWrite;
     49        m_state = SVGPropertyState::Clean;
     50    }
     51
     52    const SVGElement* contextElement() const
     53    {
     54        if (!m_owner)
     55            return nullptr;
     56        return m_owner->attributeContextElement();
     57    }
     58
     59    void commitChange()
     60    {
     61        if (!m_owner)
     62            return;
     63        m_owner->commitPropertyChange(this);
     64    }
     65
     66    // DOM access.
     67    SVGPropertyAccess access() const { return m_access; }
     68    bool isReadOnly() const { return m_access == SVGPropertyAccess::ReadOnly; }
     69
     70    // Synchronizing the SVG attribute and its reflection here.
     71    bool isDirty() const { return m_state == SVGPropertyState::Dirty; }
     72    void setDirty() { m_state = SVGPropertyState::Dirty; }
     73    Optional<String> synchronize()
     74    {
     75        if (m_state == SVGPropertyState::Clean)
     76            return WTF::nullopt;
     77        m_state = SVGPropertyState::Clean;
     78        return valueAsString();
     79    }
     80
     81    // This is used when calling setAttribute().
     82    virtual String valueAsString() const { return emptyString(); }
     83
     84protected:
     85    SVGProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
     86        : m_owner(owner)
     87        , m_access(access)
     88    {
     89    }
     90
     91    SVGPropertyOwner* m_owner { nullptr };
     92    SVGPropertyAccess m_access { SVGPropertyAccess::ReadWrite };
     93    SVGPropertyState m_state { SVGPropertyState::Clean };
     94};
     95
    2896} // namespace WebCore
    29 
  • trunk/Source/WebCore/svg/properties/SVGPropertyAccessor.h

    r243129 r243130  
    2626#pragma once
    2727
     28#include "SVGPointerMemberAccessor.h"
     29
    2830namespace WebCore {
    2931
    30 class SVGPropertyOwner {
     32template<typename OwnerType, typename PropertyType>
     33class SVGPropertyAccessor : public SVGPointerMemberAccessor<OwnerType, PropertyType> {
     34    using Base = SVGPointerMemberAccessor<OwnerType, PropertyType>;
     35
    3136public:
    32     virtual ~SVGPropertyOwner() = default;
     37    using Base::Base;
    3338
    34     virtual SVGPropertyOwner* owner() const { return nullptr; }
    35    
    36     virtual const SVGElement* attributeContextElement() const
     39protected:
     40    using Base::property;
     41    using Base::singleton;
     42
     43    bool matches(const OwnerType& owner, const SVGProperty& property) const override
    3744    {
    38         if (!owner())
    39             return nullptr;
    40         return owner()->attributeContextElement();
     45        return this->property(owner).ptr() == &property;
    4146    }
    42    
    43     virtual void commitPropertyChange()
    44     {
    45         if (!owner())
    46             return;
    47         owner()->commitPropertyChange();
    48     }
    49    
    50 protected:
    51     SVGPropertyOwner() = default;
    5247};
    5348
  • trunk/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h

    r243129 r243130  
    2424 */
    2525
    26 #include "config.h"
    27 #include "SVGAnimatedProperty.h"
     26#pragma once
    2827
    29 #include "SVGElement.h"
     28#include "SVGPropertyAccessor.h"
     29#include "SVGStringList.h"
    3030
    3131namespace WebCore {
    3232
    33 SVGPropertyOwner* SVGAnimatedProperty::owner() const
    34 {
    35     return m_contextElement;
    36 }
     33template<typename OwnerType>
     34class SVGStringListAccessor final : public SVGPropertyAccessor<OwnerType, SVGStringList> {
     35    using Base = SVGPropertyAccessor<OwnerType, SVGStringList>;
    3736
    38 void SVGAnimatedProperty::commitPropertyChange()
    39 {
    40     if (!m_contextElement)
    41         return;
    42     m_contextElement->commitPropertyChange(*this);
    43 }
     37public:
     38    using Base::Base;
     39    template<Ref<SVGStringList> OwnerType::*property>
     40    constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGStringListAccessor, property>(); }
     41};
    4442
    4543}
  • trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h

    r243036 r243130  
    2727
    2828namespace WebCore {
     29   
     30class SVGElement;
     31class SVGProperty;
    2932
    3033class SVGPropertyOwner {
     
    4144    }
    4245   
    43     virtual void commitPropertyChange()
     46    virtual void commitPropertyChange(SVGProperty* property)
    4447    {
    4548        if (!owner())
    4649            return;
    47         owner()->commitPropertyChange();
     50        owner()->commitPropertyChange(property);
    4851    }
    4952   
  • trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h

    r243121 r243130  
    2828#include "SVGAnimatedPropertyAccessorImpl.h"
    2929#include "SVGAnimatedPropertyPairAccessorImpl.h"
     30#include "SVGPropertyAccessorImpl.h"
    3031#include "SVGPropertyRegistry.h"
    3132#include <wtf/HashMap.h>
     
    4344    }
    4445
     46    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGStringList> OwnerType::*property>
     47    static void registerProperty()
     48    {
     49        registerProperty(attributeName, SVGStringListAccessor<OwnerType>::template singleton<property>());
     50    }
     51
    4552    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedBoolean> OwnerType::*property>
    4653    static void registerProperty()
     
    7885    }
    7986
     87    QualifiedName propertyAttributeName(const SVGProperty& property) const override
     88    {
     89        QualifiedName attributeName = nullQName();
     90        enumerateRecursively([&](const auto& entry) -> bool {
     91            if (!entry.value->matches(m_owner, property))
     92                return true;
     93            attributeName = entry.key;
     94            return false;
     95        });
     96        return attributeName;
     97    }
     98
    8099    QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty& animatedProperty) const override
    81100    {
  • trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h

    r243036 r243130  
    3838
    3939    virtual void detachAllProperties() const = 0;
     40    virtual QualifiedName propertyAttributeName(const SVGProperty&) const = 0;
    4041    virtual QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty&) const = 0;
    4142    virtual Optional<String> synchronize(const QualifiedName&) const = 0;
Note: See TracChangeset for help on using the changeset viewer.