Source/WebCore/ChangeLog

 12019-09-13 Said Abou-Hallawa <sabouhallawa@apple.com>
 2
 3 Introduce DOMLiveObject and make SVGProperty a superclass of it
 4 https://bugs.webkit.org/show_bug.cgi?id=201782
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This is a step towards replacing SVGPoint by DOMPoint. We need to make
 9 DOMPoint be a live object like SVGProperty.
 10
 11 -- A new class, named DOMLiveObject, is added. Its job is to communicate
 12 the changes in this object to its observer. SVGProperty is made a super
 13 class of DOMLiveObject. DOMPoint will be made in a super of it also
 14 in a following patch.
 15
 16 -- Another new class, named DOMLiveObjectObserver and make it the base
 17 class of DOMLiveObject observers. Currently the following class are
 18 made super classes of DOMLiveObjectObserver:
 19 1. Element: This observes the changes in all the SVG properties.
 20 2. SVGAnimatedProperty: This observes the changes in its baseVal.
 21 3. SVGPropertyList: This observes the changes in the items.
 22 4. SVGTransform: This observes the changes in the underlying SVGMatrix.
 23
 24 * Headers.cmake:
 25 * Sources.txt:
 26 * WebCore.xcodeproj/project.pbxproj:
 27 * dom/DOMLiveObject.h: Added.
 28 (WebCore::DOMLiveObject::observer const):
 29 (WebCore::DOMLiveObject::isAttached const):
 30 (WebCore::DOMLiveObject::attach):
 31 (WebCore::DOMLiveObject::detach):
 32 (WebCore::DOMLiveObject::contextElement const):
 33 (WebCore::DOMLiveObject::commitChange):
 34 (WebCore::DOMLiveObject::isSVGProperty const):
 35 (WebCore::DOMLiveObject::DOMLiveObject):
 36 * dom/DOMLiveObjectObserver.h: Added.
 37 (WebCore::DOMLiveObjectObserver::observer const):
 38 (WebCore::DOMLiveObjectObserver::contextElement const):
 39 (WebCore::DOMLiveObjectObserver::commitChange):
 40 * dom/Element.h:
 41 * svg/SVGAngle.h:
 42 (WebCore::SVGAngle::create):
 43 * svg/SVGElement.cpp:
 44 (WebCore::SVGElement::commitChange):
 45 (WebCore::SVGElement::commitPropertyChange): Deleted.
 46 * svg/SVGElement.h:
 47 * svg/SVGLength.h:
 48 (WebCore::SVGLength::create):
 49 (WebCore::SVGLength::valueForBindings):
 50 (WebCore::SVGLength::setValueForBindings):
 51 (WebCore::SVGLength::convertToSpecifiedUnits):
 52 * svg/SVGLengthList.h:
 53 (WebCore::SVGLengthList::create):
 54 (WebCore::SVGLengthList::SVGLengthList):
 55 * svg/SVGMatrix.h:
 56 (WebCore::SVGMatrix::create):
 57 * svg/SVGNumber.h:
 58 (WebCore::SVGNumber::create):
 59 * svg/SVGNumberList.h:
 60 (WebCore::SVGNumberList::create):
 61 * svg/SVGPathSegList.h:
 62 * svg/SVGPointList.h:
 63 (WebCore::SVGPointList::create):
 64 * svg/SVGPreserveAspectRatio.h:
 65 (WebCore::SVGPreserveAspectRatio::create):
 66 * svg/SVGRect.h:
 67 (WebCore::SVGRect::create):
 68 * svg/SVGStringList.h:
 69 * svg/SVGTransform.h:
 70 * svg/SVGTransformList.h:
 71 * svg/properties/SVGAnimatedDecoratedProperty.h:
 72 (WebCore::SVGAnimatedDecoratedProperty::setBaseVal):
 73 * svg/properties/SVGAnimatedPrimitiveProperty.h:
 74 (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
 75 * svg/properties/SVGAnimatedProperty.cpp:
 76 (WebCore::SVGAnimatedProperty::observer const):
 77 (WebCore::SVGAnimatedProperty::contextElement const):
 78 (WebCore::SVGAnimatedProperty::commitChange):
 79 (WebCore::SVGAnimatedProperty::owner const): Deleted.
 80 (WebCore::SVGAnimatedProperty::commitPropertyChange): Deleted.
 81 * svg/properties/SVGAnimatedProperty.h:
 82 (WebCore::SVGAnimatedProperty::contextElement const): Deleted.
 83 * svg/properties/SVGAnimatedPropertyList.h:
 84 * svg/properties/SVGAnimatedValueProperty.h:
 85 * svg/properties/SVGProperty.cpp: Added.
 86 (WebCore::SVGProperty::svgContextElement const):
 87 * svg/properties/SVGProperty.h:
 88 (WebCore::SVGProperty::attach):
 89 (WebCore::SVGProperty::detach):
 90 (WebCore::SVGProperty::SVGProperty):
 91 (WebCore::SVGProperty::isSVGProperty const):
 92 (isType):
 93 (WebCore::SVGProperty::isAttached const): Deleted.
 94 (WebCore::SVGProperty::contextElement const): Deleted.
 95 (WebCore::SVGProperty::commitChange): Deleted.
 96 * svg/properties/SVGPropertyList.h:
 97 (WebCore::SVGPropertyList::SVGPropertyList):
 98 * svg/properties/SVGPropertyOwner.h: Removed.
 99 * svg/properties/SVGValueProperty.h:
 100 (WebCore::SVGValueProperty::SVGValueProperty):
 101 * svg/properties/SVGValuePropertyList.h:
 102 (WebCore::SVGValuePropertyList::SVGValuePropertyList):
 103
11042019-09-11 Dean Jackson <dino@apple.com>
2105
3106 Provide a prototype for AR QuickLook to trigger processing in the originating page
249860

Source/WebCore/Headers.cmake

@@set(WebCore_PRIVATE_FRAMEWORK_HEADERS
360360 dom/DOMException.h
361361 dom/DOMHighResTimeStamp.h
362362 dom/DOMImplementation.h
 363 dom/DOMLiveObject.h
 364 dom/DOMLiveObjectObserver.h
363365 dom/DOMPasteAccess.h
364366 dom/DOMRect.h
365367 dom/DOMRectInit.h

@@set(WebCore_PRIVATE_FRAMEWORK_HEADERS
13851387 svg/properties/SVGList.h
13861388 svg/properties/SVGPrimitiveList.h
13871389 svg/properties/SVGProperty.h
1388  svg/properties/SVGPropertyOwner.h
13891390 svg/properties/SVGPropertyTraits.h
13901391
13911392 testing/MockGamepad.h
249850

Source/WebCore/Sources.txt

@@svg/graphics/filters/SVGFilterBuilder.cp
24572457svg/properties/SVGAnimatedProperty.cpp
24582458svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp
24592459svg/properties/SVGAttributeAnimator.cpp
 2460svg/properties/SVGProperty.cpp
24602461
24612462workers/AbstractWorker.cpp
24622463workers/DedicatedWorkerGlobalScope.cpp
249850

Source/WebCore/WebCore.xcodeproj/project.pbxproj

20842084 72144331223EC85400F12FF7 /* (null) in Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Private, ); }; };
20852085 72144332223EC85F00F12FF7 /* (null) in Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Private, ); }; };
20862086 72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5363223B2A2400FBA944 /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
2087  72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
 2087 72159D4C232C10E500076930 /* DOMLiveObjectObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 72159D4A232B1A9000076930 /* DOMLiveObjectObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
 2088 72159D4D232C150000076930 /* DOMLiveObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 72159D48232B1A5F00076930 /* DOMLiveObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
20882089 72283F0E230B268C00F5D828 /* ImagePaintingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C18A3F230B04B7006847C7 /* ImagePaintingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
20892090 724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
20902091 724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };

85528553 55EE535D223B2A0D00FBA944 /* SVGAnimatedPropertyPairAccessorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAccessorImpl.h; sourceTree = "<group>"; };
85538554 55EE535E223B2A0E00FBA944 /* SVGAnimationAdditiveValueFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveValueFunction.h; sourceTree = "<group>"; };
85548555 55EE535F223B2A0F00FBA944 /* SVGAnimatedPropertyPairAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAnimator.h; sourceTree = "<group>"; };
8555  55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyOwner.h; sourceTree = "<group>"; };
85568556 55EE5361223B2A2200FBA944 /* SVGAttributeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeAnimator.cpp; sourceTree = "<group>"; };
85578557 55EE5362223B2A2300FBA944 /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; };
85588558 55EE5363223B2A2400FBA944 /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; };

94139413 71FF851822A3F81F005D5959 /* NavigatorMaxTouchPoints.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorMaxTouchPoints.idl; sourceTree = "<group>"; };
94149414 721443452240C8BA00F12FF7 /* SVGAnimatedValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedValueProperty.h; sourceTree = "<group>"; };
94159415 721443462240CAD200F12FF7 /* SVGValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValueProperty.h; sourceTree = "<group>"; };
 9416 72159D48232B1A5F00076930 /* DOMLiveObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMLiveObject.h; sourceTree = "<group>"; };
 9417 72159D4A232B1A9000076930 /* DOMLiveObjectObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMLiveObjectObserver.h; sourceTree = "<group>"; };
 9418 72159D4B232C0ED500076930 /* SVGProperty.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGProperty.cpp; sourceTree = "<group>"; };
94169419 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; };
94179420 724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTBlendMinMax.h; sourceTree = "<group>"; };
94189421 724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTBlendMinMax.idl; sourceTree = "<group>"; };

1612116124 55DCC5252240749E00C26E32 /* SVGPrimitiveList.h */,
1612216125 7266F0152241C09800833975 /* SVGPrimitivePropertyAnimator.h */,
1612316126 7266F0142241BFB200833975 /* SVGPrimitivePropertyAnimatorImpl.h */,
 16127 72159D4B232C0ED500076930 /* SVGProperty.cpp */,
1612416128 55EE5363223B2A2400FBA944 /* SVGProperty.h */,
1612516129 55DCC526224074FA00C26E32 /* SVGPropertyAccessor.h */,
1612616130 55DCC5272240750B00C26E32 /* SVGPropertyAccessorImpl.h */,
1612716131 7266F0162241C0FE00833975 /* SVGPropertyAnimator.h */,
1612816132 7266F0132241BCE200833975 /* SVGPropertyAnimatorFactory.h */,
1612916133 7266F0272243109200833975 /* SVGPropertyList.h */,
16130  55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */,
1613116134 55BE025C223B29C30032F08A /* SVGPropertyOwnerRegistry.h */,
1613216135 55BE0257223B29C00032F08A /* SVGPropertyRegistry.h */,
1613316136 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,

2749127494 A8185F3609765765005826D9 /* DOMImplementation.cpp */,
2749227495 A8185F3309765765005826D9 /* DOMImplementation.h */,
2749327496 93EEC1E909C2877700C515D1 /* DOMImplementation.idl */,
 27497 72159D48232B1A5F00076930 /* DOMLiveObject.h */,
 27498 72159D4A232B1A9000076930 /* DOMLiveObjectObserver.h */,
2749427499 F4B422C2220C0000009E1E7D /* DOMPasteAccess.h */,
2749527500 0F4966991DB408C100A274BB /* DOMPoint.h */,
2749627501 0F49669A1DB408C100A274BB /* DOMPoint.idl */,

2908129086 E3A776671DC85D2800B690D8 /* DOMJITIDLConvert.h in Headers */,
2908229087 E3A776681DC85D2800B690D8 /* DOMJITIDLType.h in Headers */,
2908329088 E35802B61DC8435D00A9773C /* DOMJITIDLTypeFilter.h in Headers */,
 29089 72159D4D232C150000076930 /* DOMLiveObject.h in Headers */,
 29090 72159D4C232C10E500076930 /* DOMLiveObjectObserver.h in Headers */,
2908429091 836ACECA1ECA9569004BD012 /* DOMMatrix.h in Headers */,
2908529092 7CBBBCC71F560581005EFAAC /* DOMMatrix2DInit.h in Headers */,
2908629093 836ACECB1ECA956D004BD012 /* DOMMatrixInit.h in Headers */,

3189831905 B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
3189931906 55DCC52822407B2000C26E32 /* SVGPrimitiveList.h in Headers */,
3190031907 72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */,
31901  72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */,
3190231908 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
3190331909 B2227A9A0D00BF220071B782 /* SVGRadialGradientElement.h in Headers */,
3190431910 08EDE19F12A50B8E00B95797 /* SVGRect.h in Headers */,
249850

Source/WebCore/dom/DOMLiveObject.h

 1/*
 2* Copyright (C) 2019 Apple Inc. All rights reserved.
 3*
 4* Redistribution and use in source and binary forms, with or without
 5* modification, are permitted provided that the following conditions
 6* are met:
 7* 1. Redistributions of source code must retain the above copyright
 8* notice, this list of conditions and the following disclaimer.
 9* 2. Redistributions in binary form must reproduce the above copyright
 10* notice, this list of conditions and the following disclaimer in the
 11* documentation and/or other materials provided with the distribution.
 12*
 13* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24*/
 25
 26#pragma once
 27
 28#include "DOMLiveObjectObserver.h"
 29
 30namespace WebCore {
 31
 32class DOMLiveObject {
 33public:
 34 virtual ~DOMLiveObject() = default;
 35
 36 // Managing the relationship with the observer.
 37 DOMLiveObjectObserver* observer() const { return m_observer; }
 38 bool isAttached() const { return m_observer; }
 39
 40 void attach(DOMLiveObjectObserver* observer)
 41 {
 42 ASSERT(!m_observer);
 43 m_observer = observer;
 44 }
 45
 46 void detach()
 47 {
 48 m_observer = nullptr;
 49 }
 50
 51 // Traverse the observers chain till an Element observer is reached.
 52 const Element* contextElement() const
 53 {
 54 if (!m_observer)
 55 return nullptr;
 56 return m_observer->contextElement();
 57 }
 58
 59 // Commit the live object changes via the observers chain.
 60 void commitChange()
 61 {
 62 if (!m_observer)
 63 return;
 64 m_observer->commitChange(this);
 65 }
 66
 67 // Derived classes casting.
 68 virtual bool isSVGProperty() const { return false; }
 69
 70protected:
 71 DOMLiveObject(DOMLiveObjectObserver* observer = nullptr)
 72 : m_observer(observer)
 73 {
 74 }
 75
 76 DOMLiveObjectObserver* m_observer { nullptr };
 77};
 78
 79} // namespace WebCore
 80
nonexistent

Source/WebCore/dom/DOMLiveObjectObserver.h

 1/*
 2* Copyright (C) 2019 Apple Inc. All rights reserved.
 3*
 4* Redistribution and use in source and binary forms, with or without
 5* modification, are permitted provided that the following conditions
 6* are met:
 7* 1. Redistributions of source code must retain the above copyright
 8* notice, this list of conditions and the following disclaimer.
 9* 2. Redistributions in binary form must reproduce the above copyright
 10* notice, this list of conditions and the following disclaimer in the
 11* documentation and/or other materials provided with the distribution.
 12*
 13* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24*/
 25
 26#pragma once
 27
 28namespace WebCore {
 29
 30class DOMLiveObject;
 31class Element;
 32
 33class DOMLiveObjectObserver {
 34public:
 35 virtual ~DOMLiveObjectObserver() = default;
 36
 37 // The observer itself may have an observer.
 38 virtual DOMLiveObjectObserver* observer() const { return nullptr; }
 39
 40 // Traverse the observers chain tillan Element observer is reached.
 41 virtual const Element* contextElement() const
 42 {
 43 if (!observer())
 44 return nullptr;
 45 return observer()->contextElement();
 46 }
 47
 48 // Commit the live object changes via the observers chain.
 49 virtual void commitChange(DOMLiveObject* object)
 50 {
 51 if (!observer())
 52 return;
 53 observer()->commitChange(object);
 54 }
 55
 56protected:
 57 DOMLiveObjectObserver() = default;
 58};
 59
 60} // namespace WebCore
nonexistent

Source/WebCore/dom/Element.h

2525#pragma once
2626
2727#include "AXTextStateChangeIntent.h"
 28#include "DOMLiveObjectObserver.h"
2829#include "Document.h"
2930#include "ElementData.h"
3031#include "HTMLNames.h"

@@enum SpellcheckAttributeState {
7374 SpellcheckAttributeDefault
7475};
7576
76 class Element : public ContainerNode {
 77class Element : public ContainerNode, public DOMLiveObjectObserver {
7778 WTF_MAKE_ISO_ALLOCATED(Element);
7879public:
7980 static Ref<Element> create(const QualifiedName&, Document&);

@@public:
282283
283284 virtual void copyNonAttributePropertiesFromElement(const Element&) { }
284285
 286 const Element* contextElement() const override { return this; }
 287
285288 virtual RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&);
286289 virtual bool rendererIsNeeded(const RenderStyle&);
287290
249850

Source/WebCore/svg/SVGAngle.h

@@public:
4141 return adoptRef(*new SVGAngle(value));
4242 }
4343
44  static Ref<SVGAngle> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGAngleValue& value = { })
 44 static Ref<SVGAngle> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, const SVGAngleValue& value = { })
4545 {
46  return adoptRef(*new SVGAngle(owner, access, value));
 46 return adoptRef(*new SVGAngle(observer, access, value));
4747 }
4848
4949 template<typename T>
249850

Source/WebCore/svg/SVGElement.cpp

@@void SVGElement::synchronizeAllAnimatedS
562562 svgElement.synchronizeAllAttributes();
563563}
564564
565 void SVGElement::commitPropertyChange(SVGProperty* property)
 565void SVGElement::commitChange(DOMLiveObject* object)
566566{
 567 ASSERT(is<SVGProperty>(*object));
 568 SVGProperty& property = downcast<SVGProperty>(*object);
 569
567570 // We want to dirty the top-level property when a descendant changes. For example
568571 // a change in an SVGLength item in SVGLengthList should set the dirty flag on
569572 // SVGLengthList and not the SVGLength.
570  property->setDirty();
 573 property.setDirty();
571574
572575 invalidateSVGAttributes();
573  svgAttributeChanged(propertyRegistry().propertyAttributeName(*property));
 576 svgAttributeChanged(propertyRegistry().propertyAttributeName(property));
574577}
575578
576 void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty)
 579void SVGElement::commitChange(SVGAnimatedProperty& animatedProperty)
577580{
578581 QualifiedName attributeName = propertyRegistry().animatedPropertyAttributeName(animatedProperty);
579582 ASSERT(attributeName != nullQName());
249850

Source/WebCore/svg/SVGElement.h

@@class SVGUseElement;
4747
4848void mapAttributeToCSSProperty(HashMap<AtomStringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName);
4949
50 class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner {
 50class SVGElement : public StyledElement, public SVGLangSpace {
5151 WTF_MAKE_ISO_ALLOCATED(SVGElement);
5252public:
5353 bool isOutermostSVGSVGElement() const;

@@public:
136136 void synchronizeAllAttributes();
137137 static void synchronizeAllAnimatedSVGAttribute(SVGElement&);
138138
139  void commitPropertyChange(SVGProperty*) override;
140  void commitPropertyChange(SVGAnimatedProperty&);
 139 void commitChange(DOMLiveObject*) override;
 140 void commitChange(SVGAnimatedProperty&);
141141
142  const SVGElement* attributeContextElement() const override { return this; }
143142 SVGPropertyAnimatorFactory& propertyAnimatorFactory() { return *m_propertyAnimatorFactory; }
144143 std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive);
145144 void animatorWillBeDeleted(const QualifiedName&);
249850

Source/WebCore/svg/SVGLength.h

@@public:
6262 return adoptRef(*new SVGLength(value));
6363 }
6464
65  static Ref<SVGLength> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGLengthValue& value = { })
 65 static Ref<SVGLength> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, const SVGLengthValue& value = { })
6666 {
67  return adoptRef(*new SVGLength(owner, access, value));
 67 return adoptRef(*new SVGLength(observer, access, value));
6868 }
6969
7070 template<typename T>

@@public:
8787
8888 ExceptionOr<float> valueForBindings()
8989 {
90  return m_value.valueForBindings(SVGLengthContext { contextElement() });
 90 return m_value.valueForBindings(SVGLengthContext { svgContextElement() });
9191 }
9292
9393 ExceptionOr<void> setValueForBindings(float value)

@@public:
9595 if (isReadOnly())
9696 return Exception { NoModificationAllowedError };
9797
98  auto result = m_value.setValue(SVGLengthContext { contextElement() }, value);
 98 auto result = m_value.setValue(SVGLengthContext { svgContextElement() }, value);
9999 if (result.hasException())
100100 return result;
101101

@@public:
152152 if (unitType == SVG_LENGTHTYPE_UNKNOWN || unitType > SVG_LENGTHTYPE_PC)
153153 return Exception { NotSupportedError };
154154
155  auto result = m_value.convertToSpecifiedUnits(SVGLengthContext { contextElement() }, static_cast<SVGLengthType>(unitType));
 155 auto result = m_value.convertToSpecifiedUnits(SVGLengthContext { svgContextElement() }, static_cast<SVGLengthType>(unitType));
156156 if (result.hasException())
157157 return result;
158158
249850

Source/WebCore/svg/SVGLengthList.h

@@public:
4040 return adoptRef(*new SVGLengthList(lengthMode));
4141 }
4242
43  static Ref<SVGLengthList> create(SVGPropertyOwner* owner, SVGPropertyAccess access, SVGLengthMode lengthMode)
 43 static Ref<SVGLengthList> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, SVGLengthMode lengthMode)
4444 {
45  return adoptRef(*new SVGLengthList(owner, access, lengthMode));
 45 return adoptRef(*new SVGLengthList(observer, access, lengthMode));
4646 }
4747
4848 static Ref<SVGLengthList> create(const SVGLengthList& other, SVGPropertyAccess access)

@@private:
9898 {
9999 }
100100
101  SVGLengthList(SVGPropertyOwner* owner, SVGPropertyAccess access, SVGLengthMode lengthMode)
102  : Base(owner, access)
 101 SVGLengthList(DOMLiveObjectObserver* observer, SVGPropertyAccess access, SVGLengthMode lengthMode)
 102 : Base(observer, access)
103103 , m_lengthMode(lengthMode)
104104 {
105105 }
249850

Source/WebCore/svg/SVGMatrix.h

@@public:
4242 return adoptRef(*new SVGMatrix(value));
4343 }
4444
45  static Ref<SVGMatrix> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const AffineTransform& value = { })
 45 static Ref<SVGMatrix> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, const AffineTransform& value = { })
4646 {
47  return adoptRef(*new SVGMatrix(owner, access, value));
 47 return adoptRef(*new SVGMatrix(observer, access, value));
4848 }
4949
5050 template<typename T>
249850

Source/WebCore/svg/SVGNumber.h

@@public:
4040 return adoptRef(*new SVGNumber(value));
4141 }
4242
43  static Ref<SVGNumber> create(SVGPropertyOwner* owner, SVGPropertyAccess access, float value = 0)
 43 static Ref<SVGNumber> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, float value = 0)
4444 {
45  return adoptRef(*new SVGNumber(owner, access, value));
 45 return adoptRef(*new SVGNumber(observer, access, value));
4646 }
4747
4848 template<typename T>
249850

Source/WebCore/svg/SVGNumberList.h

@@public:
4040 return adoptRef(*new SVGNumberList());
4141 }
4242
43  static Ref<SVGNumberList> create(SVGPropertyOwner* owner, SVGPropertyAccess access)
 43 static Ref<SVGNumberList> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access)
4444 {
45  return adoptRef(*new SVGNumberList(owner, access));
 45 return adoptRef(*new SVGNumberList(observer, access));
4646 }
4747
4848 static Ref<SVGNumberList> create(const SVGNumberList& other, SVGPropertyAccess access)
249850

Source/WebCore/svg/SVGPathSegList.h

@@class SVGPathSegList final : public SVGP
3636 using Base::Base;
3737
3838public:
39  static Ref<SVGPathSegList> create(SVGPropertyOwner* owner, SVGPropertyAccess access)
 39 static Ref<SVGPathSegList> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access)
4040 {
41  return adoptRef(*new SVGPathSegList(owner, access));
 41 return adoptRef(*new SVGPathSegList(observer, access));
4242 }
4343
4444 static Ref<SVGPathSegList> create(const SVGPathSegList& other, SVGPropertyAccess access)

@@public:
160160
161161private:
162162 SVGPathSegList(const SVGPathSegList& other, SVGPropertyAccess access)
163  : Base(other.owner(), access)
 163 : Base(other.observer(), access)
164164 , m_pathByteStream(other.pathByteStream())
165165 {
166166 }

@@private:
172172 }
173173
174174 // Called when changing an item in the list.
175  void commitPropertyChange(SVGProperty* property) override
 175 void commitChange(DOMLiveObject* object) override
176176 {
177177 itemsWillChange();
178  Base::commitPropertyChange(property);
 178 Base::commitChange(object);
179179 }
180180
181181 void ensureItems()
249850

Source/WebCore/svg/SVGPointList.h

@@public:
4040 return adoptRef(*new SVGPointList());
4141 }
4242
43  static Ref<SVGPointList> create(SVGPropertyOwner* owner, SVGPropertyAccess access)
 43 static Ref<SVGPointList> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access)
4444 {
45  return adoptRef(*new SVGPointList(owner, access));
 45 return adoptRef(*new SVGPointList(observer, access));
4646 }
4747
4848 static Ref<SVGPointList> create(const SVGPointList& other, SVGPropertyAccess access)
249850

Source/WebCore/svg/SVGPreserveAspectRatio.h

@@class SVGPreserveAspectRatio : public SV
3636 using Base::m_value;
3737
3838public:
39  static Ref<SVGPreserveAspectRatio> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGPreserveAspectRatioValue& value = { })
 39 static Ref<SVGPreserveAspectRatio> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, const SVGPreserveAspectRatioValue& value = { })
4040 {
41  return adoptRef(*new SVGPreserveAspectRatio(owner, access, value));
 41 return adoptRef(*new SVGPreserveAspectRatio(observer, access, value));
4242 }
4343
4444 template<typename T>
249850

Source/WebCore/svg/SVGRect.h

@@public:
3636 return adoptRef(*new SVGRect(value));
3737 }
3838
39  static Ref<SVGRect> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const FloatRect& value = { })
 39 static Ref<SVGRect> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access, const FloatRect& value = { })
4040 {
41  return adoptRef(*new SVGRect(owner, access, value));
 41 return adoptRef(*new SVGRect(observer, access, value));
4242 }
4343
4444 template<typename T>
249850

Source/WebCore/svg/SVGStringList.h

@@class SVGStringList final : public SVGPr
3737 using Base::m_items;
3838
3939public:
40  static Ref<SVGStringList> create(SVGPropertyOwner* owner)
 40 static Ref<SVGStringList> create(DOMLiveObjectObserver* observer)
4141 {
42  return adoptRef(*new SVGStringList(owner));
 42 return adoptRef(*new SVGStringList(observer));
4343 }
4444
4545 void reset(const String& string)
249850

Source/WebCore/svg/SVGTransform.h

3131
3232namespace WebCore {
3333
34 class SVGTransform : public SVGValueProperty<SVGTransformValue>, public SVGPropertyOwner {
 34class SVGTransform : public SVGValueProperty<SVGTransformValue>, public DOMLiveObjectObserver {
 35 using Base = SVGValueProperty<SVGTransformValue>;
 36 using Base::commitChange;
 37
3538public:
3639 static Ref<SVGTransform> create(SVGTransformValue::SVGTransformType type)
3740 {

@@public:
131134 }
132135
133136private:
134  using Base = SVGValueProperty<SVGTransformValue>;
135 
136137 SVGTransform(SVGTransformValue::SVGTransformType type, const AffineTransform& transform = { }, float angle = 0, const FloatPoint& rotationCenter = { })
137138 : Base(SVGTransformValue(type, SVGMatrix::create(this, SVGPropertyAccess::ReadWrite, transform), angle, rotationCenter))
138139 {
139140 }
140141
141  SVGPropertyOwner* owner() const override { return m_owner; }
 142 DOMLiveObjectObserver* observer() const override { return Base::observer(); }
 143 const Element* contextElement() const override { return Base::contextElement(); }
142144
143  void commitPropertyChange(SVGProperty* property) override
 145 void commitChange(DOMLiveObject* object) override
144146 {
145  ASSERT_UNUSED(property, property == m_value.matrix().ptr());
146  if (owner())
147  owner()->commitPropertyChange(this);
 147 ASSERT_UNUSED(object, object == m_value.matrix().ptr());
 148 if (observer())
 149 observer()->commitChange(this);
148150 m_value.matrixDidChange();
149151 }
150152
249850

Source/WebCore/svg/SVGTransformList.h

@@public:
3838 return adoptRef(*new SVGTransformList());
3939 }
4040
41  static Ref<SVGTransformList> create(SVGPropertyOwner* owner, SVGPropertyAccess access)
 41 static Ref<SVGTransformList> create(DOMLiveObjectObserver* observer, SVGPropertyAccess access)
4242 {
43  return adoptRef(*new SVGTransformList(owner, access));
 43 return adoptRef(*new SVGTransformList(observer, access));
4444 }
4545
4646 static Ref<SVGTransformList> create(const SVGTransformList& other, SVGPropertyAccess access)
249850

Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h

@@public:
5656 {
5757 if (!m_baseVal->setValue(baseVal))
5858 return Exception { TypeError };
59  commitPropertyChange(nullptr);
 59 commitChange(nullptr);
6060 return { };
6161 }
6262
249850

Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h

@@public:
4949 ExceptionOr<void> setBaseVal(const PropertyType& baseVal)
5050 {
5151 m_baseVal->setValue(baseVal);
52  commitPropertyChange(nullptr);
 52 commitChange(nullptr);
5353 return { };
5454 }
5555
249850

Source/WebCore/svg/properties/SVGAnimatedProperty.cpp

3030
3131namespace WebCore {
3232
33 SVGPropertyOwner* SVGAnimatedProperty::owner() const
 33DOMLiveObjectObserver* SVGAnimatedProperty::observer() const
3434{
3535 return m_contextElement;
3636}
3737
38 void SVGAnimatedProperty::commitPropertyChange(SVGProperty*)
 38Element* SVGAnimatedProperty::contextElement() const
 39{
 40 return m_contextElement;
 41}
 42
 43void SVGAnimatedProperty::commitChange(DOMLiveObject*)
3944{
4045 if (!m_contextElement)
4146 return;
42  m_contextElement->commitPropertyChange(*this);
 47 m_contextElement->commitChange(*this);
4348}
4449
4550}
249850

Source/WebCore/svg/properties/SVGAnimatedProperty.h

2525
2626#pragma once
2727
28 #include "SVGPropertyOwner.h"
2928#include <wtf/Optional.h>
3029#include <wtf/RefCounted.h>
3130#include <wtf/text/WTFString.h>

@@namespace WebCore {
3433
3534class SVGElement;
3635
37 class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty>, public SVGPropertyOwner {
 36class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty>, public DOMLiveObjectObserver {
3837public:
3938 virtual ~SVGAnimatedProperty() = default;
4039
4140 // Manage the relationship with the owner.
4241 bool isAttached() const { return m_contextElement; }
4342 void detach() { m_contextElement = nullptr; }
44  SVGElement* contextElement() const { return m_contextElement; }
 43 Element* contextElement() const override;
4544
4645 virtual String baseValAsString() const { return emptyString(); }
4746 virtual String animValAsString() const { return emptyString(); }

@@protected:
6665 {
6766 }
6867
69  SVGPropertyOwner* owner() const override;
70  void commitPropertyChange(SVGProperty*) override;
 68 DOMLiveObjectObserver* observer() const override;
 69 void commitChange(DOMLiveObject*) override;
7170
7271 SVGElement* m_contextElement { nullptr };
7372 bool m_isAnimating { false };
249850

Source/WebCore/svg/properties/SVGAnimatedPropertyList.h

@@protected:
129129 }
130130
131131 // Called when m_baseVal changes or an item in m_baseVal changes.
132  void commitPropertyChange(SVGProperty* property) override
 132 void commitChange(DOMLiveObject* object) override
133133 {
134134 if (m_animVal)
135135 *m_animVal = m_baseVal;
136  SVGAnimatedProperty::commitPropertyChange(property);
 136 SVGAnimatedProperty::commitChange(object);
137137 }
138138
139139 Ref<ListType> m_baseVal;
249850

Source/WebCore/svg/properties/SVGAnimatedValueProperty.h

@@protected:
150150 }
151151
152152 // Called when m_baseVal changes.
153  void commitPropertyChange(SVGProperty* property) override
 153 void commitChange(DOMLiveObject* object) override
154154 {
155155 if (m_animVal)
156156 m_animVal->setValue(m_baseVal->value());
157  SVGAnimatedProperty::commitPropertyChange(property);
 157 SVGAnimatedProperty::commitChange(object);
158158 }
159159
160160 Ref<PropertyType> m_baseVal;
249850

Source/WebCore/svg/properties/SVGProperty.cpp

 1/*
 2 * Copyright (C) 2019 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "SVGProperty.h"
 28
 29#include "SVGElement.h"
 30
 31namespace WebCore {
 32
 33const SVGElement* SVGProperty::svgContextElement() const
 34{
 35 if (auto* element = contextElement()) {
 36 ASSERT(is<SVGElement>(element));
 37 return downcast<SVGElement>(element);
 38 }
 39 return nullptr;
 40}
 41
 42}
nonexistent

Source/WebCore/svg/properties/SVGProperty.h

2020
2121#pragma once
2222
23 #include "SVGPropertyOwner.h"
 23#include "DOMLiveObject.h"
2424#include <wtf/Optional.h>
2525#include <wtf/RefCounted.h>
2626#include <wtf/text/WTFString.h>
2727
2828namespace WebCore {
2929
 30class SVGElement;
 31
3032enum class SVGPropertyAccess : uint8_t { ReadWrite, ReadOnly };
3133enum class SVGPropertyState : uint8_t { Clean, Dirty };
3234
33 class SVGProperty : public RefCounted<SVGProperty> {
 35class SVGProperty : public RefCounted<SVGProperty>, public DOMLiveObject {
3436public:
3537 virtual ~SVGProperty() = default;
3638
37  // Managing the relationship with the owner.
38  bool isAttached() const { return m_owner; }
39  void attach(SVGPropertyOwner* owner, SVGPropertyAccess access)
 39 // Managing the relationship with the observer.
 40 void attach(DOMLiveObjectObserver* observer, SVGPropertyAccess access)
4041 {
41  ASSERT(!m_owner);
 42 DOMLiveObject::attach(observer);
4243 ASSERT(m_state == SVGPropertyState::Clean);
43  m_owner = owner;
4444 m_access = access;
4545 }
4646
4747 void detach()
4848 {
49  m_owner = nullptr;
5049 m_access = SVGPropertyAccess::ReadWrite;
5150 m_state = SVGPropertyState::Clean;
 51 DOMLiveObject::detach();
5252 }
53 
54  const SVGElement* contextElement() const
55  {
56  if (!m_owner)
57  return nullptr;
58  return m_owner->attributeContextElement();
59  }
60 
61  void commitChange()
62  {
63  if (!m_owner)
64  return;
65  m_owner->commitPropertyChange(this);
66  }
67 
 53
6854 // DOM access.
6955 SVGPropertyAccess access() const { return m_access; }
7056 bool isReadOnly() const { return m_access == SVGPropertyAccess::ReadOnly; }

@@public:
8874#if !COMPILER(MSVC)
8975protected:
9076#endif
91  SVGProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
92  : m_owner(owner)
 77 SVGProperty(DOMLiveObjectObserver* observer = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
 78 : DOMLiveObject(observer)
9379 , m_access(access)
9480 {
9581 }
9682
97  SVGPropertyOwner* m_owner { nullptr };
 83 virtual bool isSVGProperty() const { return true; }
 84 const SVGElement* svgContextElement() const;
 85
9886 SVGPropertyAccess m_access { SVGPropertyAccess::ReadWrite };
9987 SVGPropertyState m_state { SVGPropertyState::Clean };
10088};
10189
10290} // namespace WebCore
 91
 92SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGProperty)
 93 static bool isType(const WebCore::DOMLiveObject& object) { return object.isSVGProperty(); }
 94SPECIALIZE_TYPE_TRAITS_END()
249850

Source/WebCore/svg/properties/SVGPropertyList.h

3030namespace WebCore {
3131
3232template<typename PropertyType>
33 class SVGPropertyList : public SVGList<Ref<PropertyType>>, public SVGPropertyOwner {
 33class SVGPropertyList : public SVGList<Ref<PropertyType>>, public DOMLiveObjectObserver {
3434public:
3535 using BaseList = SVGList<Ref<PropertyType>>;
3636 using BaseList::isEmpty;

@@public:
4242#if !COMPILER(MSVC)
4343protected:
4444#endif
45  using SVGPropertyOwner::SVGPropertyOwner;
 45 using DOMLiveObjectObserver::DOMLiveObjectObserver;
4646 using BaseList::m_items;
4747 using BaseList::m_access;
48  using BaseList::m_owner;
 48 using BaseList::commitChange;
4949
50  SVGPropertyList(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
51  : BaseList(owner, access)
 50 SVGPropertyList(DOMLiveObjectObserver* observer = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
 51 : BaseList(observer, access)
5252 {
5353 }
5454

@@protected:
6464 item->detach();
6565 }
6666
67  SVGPropertyOwner* owner() const override { return m_owner; }
 67 DOMLiveObjectObserver* observer() const override { return BaseList::observer(); }
 68 const Element* contextElement() const override { return BaseList::contextElement(); }
6869
69  void commitPropertyChange(SVGProperty*) override
 70 void commitChange(DOMLiveObject*) override
7071 {
71  if (owner())
72  owner()->commitPropertyChange(this);
 72 if (observer())
 73 observer()->commitChange(this);
7374 }
7475
7576 Ref<PropertyType> at(unsigned index) const override
249850

Source/WebCore/svg/properties/SVGPropertyOwner.h

1 /*
2  * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #pragma once
27 
28 namespace WebCore {
29 
30 class SVGElement;
31 class SVGProperty;
32 
33 class SVGPropertyOwner {
34 public:
35  virtual ~SVGPropertyOwner() = default;
36 
37  virtual SVGPropertyOwner* owner() const { return nullptr; }
38 
39  virtual const SVGElement* attributeContextElement() const
40  {
41  if (!owner())
42  return nullptr;
43  return owner()->attributeContextElement();
44  }
45 
46  virtual void commitPropertyChange(SVGProperty* property)
47  {
48  if (!owner())
49  return;
50  owner()->commitPropertyChange(property);
51  }
52 
53 protected:
54  SVGPropertyOwner() = default;
55 };
56 
57 }
249850

Source/WebCore/svg/properties/SVGValueProperty.h

@@protected:
6464 }
6565
6666 // Base and default constructor. Do not use "using SVGProperty::SVGProperty" because of Windows and GTK ports.
67  SVGValueProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
68  : SVGProperty(owner, access)
 67 SVGValueProperty(DOMLiveObjectObserver* observer = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
 68 : SVGProperty(observer, access)
6969 {
7070 }
7171
7272 // Create an initialized and attached property.
73  SVGValueProperty(SVGPropertyOwner* owner, SVGPropertyAccess access, const PropertyType& value)
74  : SVGProperty(owner, access)
 73 SVGValueProperty(DOMLiveObjectObserver* observer, SVGPropertyAccess access, const PropertyType& value)
 74 : SVGProperty(observer, access)
7575 , m_value(value)
7676 {
7777 }
249850

Source/WebCore/svg/properties/SVGValuePropertyList.h

@@protected:
7575 using Base::remove;
7676
7777 // Base and default constructor. Do not use "using Base::Base" because of Windows and GTK ports.
78  SVGValuePropertyList(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
79  : Base(owner, access)
 78 SVGValuePropertyList(DOMLiveObjectObserver* observer = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
 79 : Base(observer, access)
8080 {
8181 }
8282
8383 // Used by SVGAnimatedPropertyList when creating it animVal from baseVal.
8484 SVGValuePropertyList(const SVGValuePropertyList& other, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite)
85  : Base(other.owner(), access)
 85 : Base(other.observer(), access)
8686 {
8787 // Clone all items.
8888 for (const auto& item : other.items())
249850