WebKit Bugzilla
Attachment 356731 Details for
Bug 191237
: Remove SVG properties tear-off objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
13-BasicShapes
13-BasicShapes.patch (text/plain), 62.18 KB, created by
Said Abou-Hallawa
on 2018-12-06 08:03:22 PST
(
hide
)
Description:
13-BasicShapes
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-06 08:03:22 PST
Size:
62.18 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2b0c7035112..9c3b66b6399 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,117 @@ >+2018-12-05 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Remove SVG properties tear-off objects >+ https://bugs.webkit.org/show_bug.cgi?id=191237 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove the SVG tear-off property references from the SVG basic shapes. >+ Here is the plan for this patch for the following similar patches: >+ >+ -- Header File: >+ %% Define PropertyRegistry to be an SVGPropertyOwnerRegistry and pass >+ the OwnerType and the BaseTypes to the template class. >+ %% Add the member 'm_propertyRegistry' and make its type PropertyRegistry >+ Pass '*this' to its constructor. >+ %% Override the virtual function propertyRegistry() and make it return >+ a reference to the member 'm_propertyRegistry'. >+ %% For every property owned by the owner do the following: >+ - Add a Ref object of the suitable SVGProperty or SVGAnimatedProperty >+ type. Pass '*this' and any other extra arguments to its constructor. >+ - Add a non-const getter function which returns the Ref property. This >+ method will be called from the DOM JS binding code. >+ - Add a const getter which returns the currentValue() of property. >+ This method will be called from then RenderSVGElement and DumpRenderTree >+ code. This code should be changing the property. >+ >+ -- Source file: >+ %% Move the reregistration code to the owner constructor and put inside >+ std::call_once() to ensure it's going to be called only once >+ %% In parseAttribute() call setBaseValInternal() of the property. Note >+ setBaseVal() is called from the JS and so will call commitChange(). >+ This should not be called while changing the property internally. >+ %% Use PropertyRegistry::isKnownAttribute() to check if an attribute >+ is owned directly by an owner or not. >+ >+ The SVGPathElement does not need to manage the SVGByteStream of the >+ SVGAnimatedPathSegList member anymore. Instead, SVGPathSegList which is the >+ baseVal of SVGAnimatedPathSegList, will be self-contained. The SVGByteStream >+ will be accessed via SVGAnimatedPathSegList::currentPathByteStream(). >+ >+ * svg/SVGCircleElement.cpp: >+ (WebCore::SVGCircleElement::SVGCircleElement): >+ (WebCore::SVGCircleElement::parseAttribute): >+ (WebCore::SVGCircleElement::svgAttributeChanged): >+ (WebCore::SVGCircleElement::registerAttributes): Deleted. >+ * svg/SVGCircleElement.h: >+ * svg/SVGEllipseElement.cpp: >+ (WebCore::SVGEllipseElement::SVGEllipseElement): >+ (WebCore::SVGEllipseElement::parseAttribute): >+ (WebCore::SVGEllipseElement::svgAttributeChanged): >+ (WebCore::SVGEllipseElement::registerAttributes): Deleted. >+ * svg/SVGEllipseElement.h: >+ * svg/SVGLineElement.cpp: >+ (WebCore::SVGLineElement::SVGLineElement): >+ (WebCore::SVGLineElement::parseAttribute): >+ (WebCore::SVGLineElement::svgAttributeChanged): >+ (WebCore::SVGLineElement::registerAttributes): Deleted. >+ * svg/SVGLineElement.h: >+ * svg/SVGPathElement.cpp: >+ (WebCore::SVGPathElement::SVGPathElement): >+ (WebCore::SVGPathElement::parseAttribute): >+ (WebCore::SVGPathElement::svgAttributeChanged): >+ (WebCore::SVGPathElement::createSVGPathSegClosePath): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegMovetoRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegArcAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegArcRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Deleted. >+ (WebCore::SVGPathElement::registerAttributes): Deleted. >+ (WebCore::SVGPathElement::pathByteStream const): Deleted. >+ (WebCore::SVGPathElement::pathForByteStream const): Deleted. >+ (WebCore::SVGPathElement::lookupOrCreateDWrapper): Deleted. >+ (WebCore::SVGPathElement::animatedPropertyWillBeDeleted): Deleted. >+ (WebCore::SVGPathElement::pathSegList): Deleted. >+ (WebCore::SVGPathElement::normalizedPathSegList): Deleted. >+ (WebCore::SVGPathElement::animatedPathSegList): Deleted. >+ (WebCore::SVGPathElement::animatedNormalizedPathSegList): Deleted. >+ (WebCore::SVGPathElement::approximateMemoryCost const): Deleted. >+ (WebCore::SVGPathElement::pathSegListChanged): Deleted. >+ * svg/SVGPathElement.h: >+ * svg/SVGPolyElement.cpp: >+ (WebCore::SVGPolyElement::SVGPolyElement): >+ (WebCore::SVGPolyElement::parseAttribute): >+ (WebCore::SVGPolyElement::approximateMemoryCost const): >+ (WebCore::SVGPolyElement::registerAttributes): Deleted. >+ (WebCore::SVGPolyElement::points): Deleted. >+ (WebCore::SVGPolyElement::animatedPoints): Deleted. >+ * svg/SVGPolyElement.h: >+ (WebCore::SVGPolyElement::points const): >+ (WebCore::SVGPolyElement::points): >+ (WebCore::SVGPolyElement::animatedPoints): >+ (WebCore::SVGPolyElement::pointList const): Deleted. >+ (WebCore::SVGPolyElement::attributeRegistry): Deleted. >+ (WebCore::SVGPolyElement::isKnownAttribute): Deleted. >+ * svg/SVGRectElement.cpp: >+ (WebCore::SVGRectElement::SVGRectElement): >+ (WebCore::SVGRectElement::parseAttribute): >+ (WebCore::SVGRectElement::svgAttributeChanged): >+ (WebCore::SVGRectElement::registerAttributes): Deleted. >+ * svg/SVGRectElement.h: >+ > 2018-12-05 Said Abou-Hallawa <sabouhallawa@apple.com> > > Remove SVG properties tear-off objects >diff --git a/Source/WebCore/svg/SVGCircleElement.cpp b/Source/WebCore/svg/SVGCircleElement.cpp >index ef3daa6a88f..ce8546a3ccc 100644 >--- a/Source/WebCore/svg/SVGCircleElement.cpp >+++ b/Source/WebCore/svg/SVGCircleElement.cpp >@@ -35,7 +35,13 @@ inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::circleTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::cxAttr, &SVGCircleElement::m_cx>(); >+ PropertyRegistry::registerProperty<SVGNames::cyAttr, &SVGCircleElement::m_cy>(); >+ PropertyRegistry::registerProperty<SVGNames::rAttr, &SVGCircleElement::m_r>(); >+ }); > } > > Ref<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Document& document) >@@ -43,26 +49,16 @@ Ref<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGCircleElement(tagName, document)); > } > >-void SVGCircleElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::cxAttr, &SVGCircleElement::m_cx>(); >- registry.registerAttribute<SVGNames::cyAttr, &SVGCircleElement::m_cy>(); >- registry.registerAttribute<SVGNames::rAttr, &SVGCircleElement::m_r>(); >-} >- > void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::cxAttr) >- m_cx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_cx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::cyAttr) >- m_cy.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_cy->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rAttr) >- m_r.setValue(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); >+ m_r->setBaseValInternal(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -72,7 +68,7 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr > > void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; >diff --git a/Source/WebCore/svg/SVGCircleElement.h b/Source/WebCore/svg/SVGCircleElement.h >index 65c7b465b51..4cb5d46c804 100644 >--- a/Source/WebCore/svg/SVGCircleElement.h >+++ b/Source/WebCore/svg/SVGCircleElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -33,23 +32,20 @@ class SVGCircleElement final : public SVGGeometryElement, public SVGExternalReso > public: > static Ref<SVGCircleElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& cx() const { return m_cx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& cy() const { return m_cy.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& r() const { return m_r.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& cx() const { return m_cx->currentValue(); } >+ const SVGLengthValue& cy() const { return m_cy->currentValue(); } >+ const SVGLengthValue& r() const { return m_r->currentValue(); } > >- RefPtr<SVGAnimatedLength> cxAnimated() { return m_cx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> cyAnimated() { return m_cy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rAnimated() { return m_r.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& cx() { return m_cx; } >+ Ref<SVGAnimatedLength>& cy() { return m_cy; } >+ Ref<SVGAnimatedLength>& r() { return m_r; } > > private: > SVGCircleElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGCircleElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCircleElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -58,10 +54,10 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_cx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_cy { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_r { LengthModeOther }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_cx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_cy { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_r { SVGAnimatedLength::create(this, LengthModeOther) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGEllipseElement.cpp b/Source/WebCore/svg/SVGEllipseElement.cpp >index 0a54b1875d8..bf87a7d75c0 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.cpp >+++ b/Source/WebCore/svg/SVGEllipseElement.cpp >@@ -35,37 +35,33 @@ inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Docume > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::ellipseTag)); >- registerAttributes(); >-} >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::cxAttr, &SVGEllipseElement::m_cx>(); >+ PropertyRegistry::registerProperty<SVGNames::cyAttr, &SVGEllipseElement::m_cy>(); >+ PropertyRegistry::registerProperty<SVGNames::rxAttr, &SVGEllipseElement::m_rx>(); >+ PropertyRegistry::registerProperty<SVGNames::ryAttr, &SVGEllipseElement::m_ry>(); >+ }); >+} > > Ref<SVGEllipseElement> SVGEllipseElement::create(const QualifiedName& tagName, Document& document) > { > return adoptRef(*new SVGEllipseElement(tagName, document)); > } > >-void SVGEllipseElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::cxAttr, &SVGEllipseElement::m_cx>(); >- registry.registerAttribute<SVGNames::cyAttr, &SVGEllipseElement::m_cy>(); >- registry.registerAttribute<SVGNames::rxAttr, &SVGEllipseElement::m_rx>(); >- registry.registerAttribute<SVGNames::ryAttr, &SVGEllipseElement::m_ry>(); >-} >- > void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::cxAttr) >- m_cx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_cx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::cyAttr) >- m_cy.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_cy->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rxAttr) >- m_rx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_rx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::ryAttr) >- m_ry.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_ry->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -75,7 +71,7 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt > > void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; >diff --git a/Source/WebCore/svg/SVGEllipseElement.h b/Source/WebCore/svg/SVGEllipseElement.h >index 9daaea8cf8b..071bbeafd4c 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.h >+++ b/Source/WebCore/svg/SVGEllipseElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -33,25 +32,22 @@ class SVGEllipseElement final : public SVGGeometryElement, public SVGExternalRes > public: > static Ref<SVGEllipseElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& cx() const { return m_cx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& cy() const { return m_cy.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& rx() const { return m_rx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& ry() const { return m_ry.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& cx() const { return m_cx->currentValue(); } >+ const SVGLengthValue& cy() const { return m_cy->currentValue(); } >+ const SVGLengthValue& rx() const { return m_rx->currentValue(); } >+ const SVGLengthValue& ry() const { return m_ry->currentValue(); } > >- RefPtr<SVGAnimatedLength> cxAnimated() { return m_cx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> cyAnimated() { return m_cy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rxAnimated() { return m_rx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> ryAnimated() { return m_ry.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& cx() { return m_cx; } >+ Ref<SVGAnimatedLength>& cy() { return m_cy; } >+ Ref<SVGAnimatedLength>& rx() { return m_rx; } >+ Ref<SVGAnimatedLength>& ry() { return m_ry; } > > private: > SVGEllipseElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGEllipseElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGEllipseElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -60,11 +56,11 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_cx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_cy { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_rx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_ry { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_cx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_cy { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_rx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_ry { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLineElement.cpp b/Source/WebCore/svg/SVGLineElement.cpp >index da54067b405..bdf3a0e51b6 100644 >--- a/Source/WebCore/svg/SVGLineElement.cpp >+++ b/Source/WebCore/svg/SVGLineElement.cpp >@@ -35,7 +35,14 @@ inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document& do > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::lineTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::x1Attr, &SVGLineElement::m_x1>(); >+ PropertyRegistry::registerProperty<SVGNames::y1Attr, &SVGLineElement::m_y1>(); >+ PropertyRegistry::registerProperty<SVGNames::x2Attr, &SVGLineElement::m_x2>(); >+ PropertyRegistry::registerProperty<SVGNames::y2Attr, &SVGLineElement::m_y2>(); >+ }); > } > > Ref<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Document& document) >@@ -43,29 +50,18 @@ Ref<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Documen > return adoptRef(*new SVGLineElement(tagName, document)); > } > >-void SVGLineElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::x1Attr, &SVGLineElement::m_x1>(); >- registry.registerAttribute<SVGNames::y1Attr, &SVGLineElement::m_y1>(); >- registry.registerAttribute<SVGNames::x2Attr, &SVGLineElement::m_x2>(); >- registry.registerAttribute<SVGNames::y2Attr, &SVGLineElement::m_y2>(); >-} >- > void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::x1Attr) >- m_x1.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x1->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::y1Attr) >- m_y1.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y1->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::x2Attr) >- m_x2.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x2->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::y2Attr) >- m_y2.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y2->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -75,7 +71,7 @@ void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > updateRelativeLengthsInformation(); > >diff --git a/Source/WebCore/svg/SVGLineElement.h b/Source/WebCore/svg/SVGLineElement.h >index f1ebc4ecbf7..50789384090 100644 >--- a/Source/WebCore/svg/SVGLineElement.h >+++ b/Source/WebCore/svg/SVGLineElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -33,25 +32,22 @@ class SVGLineElement final : public SVGGeometryElement, public SVGExternalResour > public: > static Ref<SVGLineElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& x1() const { return m_x1.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y1() const { return m_y1.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& x2() const { return m_x2.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y2() const { return m_y2.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x1() const { return m_x1->currentValue(); } >+ const SVGLengthValue& y1() const { return m_y1->currentValue(); } >+ const SVGLengthValue& x2() const { return m_x2->currentValue(); } >+ const SVGLengthValue& y2() const { return m_y2->currentValue(); } > >- RefPtr<SVGAnimatedLength> x1Animated() { return m_x1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> y1Animated() { return m_y1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> x2Animated() { return m_x2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> y2Animated() { return m_y2.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x1() { return m_x1; } >+ Ref<SVGAnimatedLength>& y1() { return m_y1; } >+ Ref<SVGAnimatedLength>& x2() { return m_x2; } >+ Ref<SVGAnimatedLength>& y2() { return m_y2; } > > private: > SVGLineElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGLineElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLineElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -59,11 +55,11 @@ private: > bool supportsMarkers() const final { return true; } > bool selfHasRelativeLengths() const final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x1 { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y1 { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_x2 { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y2 { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x1 { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y1 { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_x2 { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y2 { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp >index f9391b7d388..e35508246d9 100644 >--- a/Source/WebCore/svg/SVGPathElement.cpp >+++ b/Source/WebCore/svg/SVGPathElement.cpp >@@ -27,30 +27,9 @@ > #include "SVGDocumentExtensions.h" > #include "SVGMPathElement.h" > #include "SVGNames.h" >-#include "SVGPathSegArcAbs.h" >-#include "SVGPathSegArcRel.h" >-#include "SVGPathSegClosePath.h" >-#include "SVGPathSegCurvetoCubicAbs.h" >-#include "SVGPathSegCurvetoCubicRel.h" >-#include "SVGPathSegCurvetoCubicSmoothAbs.h" >-#include "SVGPathSegCurvetoCubicSmoothRel.h" >-#include "SVGPathSegCurvetoQuadraticAbs.h" >-#include "SVGPathSegCurvetoQuadraticRel.h" >-#include "SVGPathSegCurvetoQuadraticSmoothAbs.h" >-#include "SVGPathSegCurvetoQuadraticSmoothRel.h" >-#include "SVGPathSegLinetoAbs.h" >-#include "SVGPathSegLinetoHorizontalAbs.h" >-#include "SVGPathSegLinetoHorizontalRel.h" >-#include "SVGPathSegLinetoRel.h" >-#include "SVGPathSegLinetoVerticalAbs.h" >-#include "SVGPathSegLinetoVerticalRel.h" >-#include "SVGPathSegList.h" >-#include "SVGPathSegMovetoAbs.h" >-#include "SVGPathSegMovetoRel.h" > #include "SVGPathUtilities.h" > #include "SVGPoint.h" > #include <wtf/IsoMallocInlines.h> >-#include <wtf/NeverDestroyed.h> > > namespace WebCore { > >@@ -61,7 +40,11 @@ inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document& do > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::pathTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::dAttr, &SVGPathElement::m_pathSegList>(); >+ }); > } > > Ref<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document& document) >@@ -90,115 +73,11 @@ unsigned SVGPathElement::getPathSegAtLength(float length) const > return pathSeg; > } > >-Ref<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath(SVGPathSegRole role) >-{ >- return SVGPathSegClosePath::create(*this, role); >-} >- >-Ref<SVGPathSegMovetoAbs> SVGPathElement::createSVGPathSegMovetoAbs(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegMovetoAbs::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegMovetoRel> SVGPathElement::createSVGPathSegMovetoRel(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegMovetoRel::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegLinetoAbs> SVGPathElement::createSVGPathSegLinetoAbs(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoAbs::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegLinetoRel> SVGPathElement::createSVGPathSegLinetoRel(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoRel::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegCurvetoCubicAbs> SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicAbs::create(*this, role, x, y, x1, y1, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoCubicRel> SVGPathElement::createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicRel::create(*this, role, x, y, x1, y1, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoQuadraticAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticAbs::create(*this, role, x, y, x1, y1); >-} >- >-Ref<SVGPathSegCurvetoQuadraticRel> SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticRel::create(*this, role, x, y, x1, y1); >-} >- >-Ref<SVGPathSegArcAbs> SVGPathElement::createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole role) >-{ >- return SVGPathSegArcAbs::create(*this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag); >-} >- >-Ref<SVGPathSegArcRel> SVGPathElement::createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole role) >-{ >- return SVGPathSegArcRel::create(*this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag); >-} >- >-Ref<SVGPathSegLinetoHorizontalAbs> SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoHorizontalAbs::create(*this, role, x); >-} >- >-Ref<SVGPathSegLinetoHorizontalRel> SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoHorizontalRel::create(*this, role, x); >-} >- >-Ref<SVGPathSegLinetoVerticalAbs> SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoVerticalAbs::create(*this, role, y); >-} >- >-Ref<SVGPathSegLinetoVerticalRel> SVGPathElement::createSVGPathSegLinetoVerticalRel(float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoVerticalRel::create(*this, role, y); >-} >- >-Ref<SVGPathSegCurvetoCubicSmoothAbs> SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicSmoothAbs::create(*this, role, x, y, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoCubicSmoothRel> SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicSmoothRel::create(*this, role, x, y, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoQuadraticSmoothAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticSmoothAbs::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticSmoothRel::create(*this, role, x, y); >-} >- >-void SVGPathElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute(SVGAnimatedCustomPathSegListAttributeAccessor::singleton<SVGNames::dAttr, &SVGPathElement::m_pathSegList>()); >-} >- > void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::dAttr) { >- if (!buildSVGPathByteStreamFromString(value, m_pathByteStream, UnalteredParsing)) >+ if (!m_pathSegList->baseVal()->parse(value)) > document().accessSVGExtensions().reportError("Problem parsing d=\"" + value + "\""); >- m_cachedPath = std::nullopt; > return; > } > >@@ -208,24 +87,14 @@ void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (attrName == SVGNames::dAttr) { > InstanceInvalidationGuard guard(*this); >+ invalidateMPathDependencies(); > >- RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); >- if (attrName == SVGNames::dAttr) { >- if (m_pathSegList.shouldSynchronize() && !lookupAnimatedProperty(m_pathSegList)->isAnimating()) { >- SVGPathSegListValues newList(PathSegUnalteredRole); >- buildSVGPathSegListValuesFromByteStream(m_pathByteStream, *this, newList, UnalteredParsing); >- m_pathSegList.setValue(WTFMove(newList)); >- } >- >- if (renderer) >- renderer->setNeedsShapeUpdate(); >- invalidateMPathDependencies(); >- } >- >- if (renderer) >+ if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) { >+ renderer->setNeedsShapeUpdate(); > RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ } > return; > } > >@@ -258,106 +127,6 @@ void SVGPathElement::removedFromAncestor(RemovalType removalType, ContainerNode& > invalidateMPathDependencies(); > } > >-const SVGPathByteStream& SVGPathElement::pathByteStream() const >-{ >- auto property = lookupAnimatedProperty(m_pathSegList); >- if (!property || !property->isAnimating()) >- return m_pathByteStream; >- >- if (auto* animatedPathByteStream = static_cast<SVGAnimatedPathSegListPropertyTearOff*>(property.get())->animatedPathByteStream()) >- return *animatedPathByteStream; >- >- return m_pathByteStream; >-} >- >-Path SVGPathElement::pathForByteStream() const >-{ >- const auto& pathByteStreamToUse = pathByteStream(); >- >- if (&pathByteStreamToUse == &m_pathByteStream) { >- if (!m_cachedPath) >- m_cachedPath = buildPathFromByteStream(m_pathByteStream); >- return *m_cachedPath; >- } >- >- return buildPathFromByteStream(pathByteStreamToUse); >-} >- >-RefPtr<SVGAnimatedProperty> SVGPathElement::lookupOrCreateDWrapper() >-{ >- return m_pathSegList.animatedProperty(attributeOwnerProxy()); >-} >- >-void SVGPathElement::animatedPropertyWillBeDeleted() >-{ >- // m_pathSegList.shouldSynchronize is set to true when the 'd' wrapper for m_pathSegList >- // is created and cached. We need to reset it back to false when this wrapper is deleted >- // so we can be sure if shouldSynchronize is true, SVGAttributeAccessor::lookupAnimatedProperty() >- // will return a valid cached 'd' wrapper for the m_pathSegList. >- m_pathSegList.setShouldSynchronize(false); >-} >- >-Ref<SVGPathSegList> SVGPathElement::pathSegList() >-{ >- return static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper())->baseVal(); >-} >- >-RefPtr<SVGPathSegList> SVGPathElement::normalizedPathSegList() >-{ >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- return nullptr; >-} >- >-Ref<SVGPathSegList> SVGPathElement::animatedPathSegList() >-{ >- m_isAnimValObserved = true; >- return static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper())->animVal(); >-} >- >-RefPtr<SVGPathSegList> SVGPathElement::animatedNormalizedPathSegList() >-{ >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- return nullptr; >-} >- >-size_t SVGPathElement::approximateMemoryCost() const >-{ >- // This is an approximation for path memory cost since the path is parsed on demand. >- size_t pathMemoryCost = (m_pathByteStream.size() / 10) * sizeof(FloatPoint); >- // We need to account for the memory which is allocated by the RenderSVGPath::m_path. >- return sizeof(*this) + (renderer() ? pathMemoryCost * 2 + sizeof(RenderSVGPath) : pathMemoryCost); >-} >- >-void SVGPathElement::pathSegListChanged(SVGPathSegRole role, ListModification listModification) >-{ >- switch (role) { >- case PathSegNormalizedRole: >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- break; >- case PathSegUnalteredRole: { >- auto& pathSegList = m_pathSegList.value(false); >- if (listModification == ListModificationAppend) { >- ASSERT(!pathSegList.isEmpty()); >- appendSVGPathByteStreamFromSVGPathSeg(pathSegList.last().copyRef(), m_pathByteStream, UnalteredParsing); >- } else >- buildSVGPathByteStreamFromSVGPathSegListValues(pathSegList, m_pathByteStream, UnalteredParsing); >- m_cachedPath = std::nullopt; >- break; >- } >- case PathSegUndefinedRole: >- return; >- } >- >- invalidateSVGAttributes(); >- >- RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); >- if (!renderer) >- return; >- >- renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >-} >- > FloatRect SVGPathElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) > { > if (styleUpdateStrategy == AllowStyleUpdate) >diff --git a/Source/WebCore/svg/SVGPathElement.h b/Source/WebCore/svg/SVGPathElement.h >index 6c45a1bd0e4..2606900600e 100644 >--- a/Source/WebCore/svg/SVGPathElement.h >+++ b/Source/WebCore/svg/SVGPathElement.h >@@ -22,36 +22,14 @@ > #pragma once > > #include "Path.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedPath.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" > #include "SVGPathByteStream.h" >-#include "SVGPathSegListValues.h" >+#include "SVGPathSegImpl.h" > > namespace WebCore { > >-class SVGPathSegArcAbs; >-class SVGPathSegArcRel; >-class SVGPathSegClosePath; >-class SVGPathSegLinetoAbs; >-class SVGPathSegLinetoRel; >-class SVGPathSegMovetoAbs; >-class SVGPathSegMovetoRel; >-class SVGPathSegCurvetoCubicAbs; >-class SVGPathSegCurvetoCubicRel; >-class SVGPathSegLinetoVerticalAbs; >-class SVGPathSegLinetoVerticalRel; >-class SVGPathSegLinetoHorizontalAbs; >-class SVGPathSegLinetoHorizontalRel; >-class SVGPathSegCurvetoQuadraticAbs; >-class SVGPathSegCurvetoQuadraticRel; >-class SVGPathSegCurvetoCubicSmoothAbs; >-class SVGPathSegCurvetoCubicSmoothRel; >-class SVGPathSegCurvetoQuadraticSmoothAbs; >-class SVGPathSegCurvetoQuadraticSmoothRel; > class SVGPathSegList; > class SVGPoint; > >@@ -60,67 +38,85 @@ class SVGPathElement final : public SVGGeometryElement, public SVGExternalResour > public: > static Ref<SVGPathElement> create(const QualifiedName&, Document&); > >+ static Ref<SVGPathSegClosePath> createSVGPathSegClosePath() { return SVGPathSegClosePath::create(); } >+ static Ref<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y) { return SVGPathSegMovetoAbs::create(x, y); } >+ static Ref<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y) { return SVGPathSegMovetoRel::create(x, y); } >+ static Ref<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float x, float y) { return SVGPathSegLinetoAbs::create(x, y); } >+ static Ref<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float x, float y) { return SVGPathSegLinetoRel::create(x, y); } >+ static Ref<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicAbs::create(x, y, x1, y1, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicRel::create(x, y, x1, y1, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1) >+ { >+ return SVGPathSegCurvetoQuadraticAbs::create(x, y, x1, y1); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1) >+ { >+ return SVGPathSegCurvetoQuadraticRel::create(x, y, x1, y1); >+ } >+ static Ref<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >+ { >+ return SVGPathSegArcAbs::create(x, y, r1, r2, angle, largeArcFlag, sweepFlag); >+ } >+ static Ref<SVGPathSegArcRel> createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >+ { >+ return SVGPathSegArcRel::create(x, y, r1, r2, angle, largeArcFlag, sweepFlag); >+ } >+ static Ref<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLinetoHorizontalAbs(float x) { return SVGPathSegLinetoHorizontalAbs::create(x); } >+ static Ref<SVGPathSegLinetoHorizontalRel> createSVGPathSegLinetoHorizontalRel(float x) { return SVGPathSegLinetoHorizontalRel::create(x); } >+ static Ref<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVerticalAbs(float y) { return SVGPathSegLinetoVerticalAbs::create(y); } >+ static Ref<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVerticalRel(float y) { return SVGPathSegLinetoVerticalRel::create(y); } >+ static Ref<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicSmoothAbs::create(x, y, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicSmoothRel::create(x, y, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y) >+ { >+ return SVGPathSegCurvetoQuadraticSmoothAbs::create(x, y); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y) >+ { >+ return SVGPathSegCurvetoQuadraticSmoothRel::create(x, y); >+ } >+ > float getTotalLength() const final; > Ref<SVGPoint> getPointAtLength(float distance) const final; > unsigned getPathSegAtLength(float distance) const; >- >- Ref<SVGPathSegClosePath> createSVGPathSegClosePath(SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegArcRel> createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLinetoHorizontalAbs(float x, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoHorizontalRel> createSVGPathSegLinetoHorizontalRel(float x, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVerticalAbs(float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVerticalRel(float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- >- // Used in the bindings only. >- Ref<SVGPathSegList> pathSegList(); >- Ref<SVGPathSegList> animatedPathSegList(); >- RefPtr<SVGPathSegList> normalizedPathSegList(); >- RefPtr<SVGPathSegList> animatedNormalizedPathSegList(); >- >- const SVGPathByteStream& pathByteStream() const; >- Path pathForByteStream() const; >- >- void pathSegListChanged(SVGPathSegRole, ListModification = ListModificationUnknown); >- > FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) final; >+ >+ Ref<SVGPathSegList>& pathSegList() { return m_pathSegList->baseVal(); } >+ RefPtr<SVGPathSegList>& animatedPathSegList() { return m_pathSegList->animVal(); } > >- bool isAnimValObserved() const { return m_isAnimValObserved; } >- >- void animatedPropertyWillBeDeleted(); >- >- size_t approximateMemoryCost() const final; >+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >+ RefPtr<SVGPathSegList> normalizedPathSegList() { return nullptr; } >+ RefPtr<SVGPathSegList> animatedNormalizedPathSegList() { return nullptr; } > >- const SVGPathSegListValues& pathSegList() const { return m_pathSegList.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedPathSegList> pathSegListAnimated() { return m_pathSegList.animatedProperty(attributeOwnerProxy()); } >+ const SVGPathByteStream& pathByteStream() const { return m_pathSegList->currentPathByteStream(); } >+ Path path() const { return m_pathSegList->currentPath(); } >+ size_t approximateMemoryCost() const final { return m_pathSegList->approximateMemoryCost(); } > > private: > SVGPathElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPathElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPathElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > > bool isValid() const final { return SVGTests::isValid(); } > bool supportsMarkers() const final { return true; } >- RefPtr<SVGAnimatedProperty> lookupOrCreateDWrapper(); > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >@@ -129,34 +125,8 @@ private: > > void invalidateMPathDependencies(); > >-private: >- SVGPathByteStream m_pathByteStream; >- mutable std::optional<Path> m_cachedPath; >- bool m_isAnimValObserved { false }; >- >- class SVGAnimatedCustomPathSegListAttribute : public SVGAnimatedPathSegListAttribute { >- public: >- SVGAnimatedCustomPathSegListAttribute(SVGPathElement& element) >- : SVGAnimatedPathSegListAttribute(PathSegUnalteredRole) >- , m_element(element) >- { >- } >- >- SVGPathSegListValues& value(bool shouldBuildSegListValues = true) >- { >- if (shouldBuildSegListValues && m_property.isEmpty()) >- buildSVGPathSegListValuesFromByteStream(m_element.m_pathByteStream, m_element, m_property, UnalteredParsing); >- return m_property; >- } >- >- private: >- SVGPathElement& m_element; >- }; >- >- using SVGAnimatedCustomPathSegListAttributeAccessor = SVGAnimatedAttributeAccessor<SVGPathElement, SVGAnimatedCustomPathSegListAttribute, AnimatedPath>; >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedCustomPathSegListAttribute m_pathSegList { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedPathSegList> m_pathSegList { SVGAnimatedPathSegList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPolyElement.cpp b/Source/WebCore/svg/SVGPolyElement.cpp >index af6db56bcb0..6a66e7bcfb7 100644 >--- a/Source/WebCore/svg/SVGPolyElement.cpp >+++ b/Source/WebCore/svg/SVGPolyElement.cpp >@@ -37,28 +37,17 @@ SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document& document) > : SVGGeometryElement(tagName, document) > , SVGExternalResourcesRequired(this) > { >- registerAttributes(); >-} >- >-void SVGPolyElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); >+ }); > } > > void SVGPolyElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::pointsAttr) { >- SVGPointListValues newList; >- if (!pointsListFromSVGData(newList, value)) >+ if (!m_points->baseVal()->parse(value)) > document().accessSVGExtensions().reportError("Problem parsing points=\"" + value + "\""); >- >- if (auto wrapper = static_pointer_cast<SVGAnimatedPointList>(lookupAnimatedProperty(m_points))) >- wrapper->detachListWrappers(newList.size()); >- >- m_points.setValue(WTFMove(newList)); > return; > } > >@@ -81,21 +70,9 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) > SVGExternalResourcesRequired::svgAttributeChanged(attrName); > } > >-Ref<SVGPointList> SVGPolyElement::points() >-{ >- m_points.setShouldSynchronize(true); >- return static_pointer_cast<SVGAnimatedPointList>(lookupOrCreateAnimatedProperty(m_points))->baseVal(); >-} >- >-Ref<SVGPointList> SVGPolyElement::animatedPoints() >-{ >- m_points.setShouldSynchronize(true); >- return static_pointer_cast<SVGAnimatedPointList>(lookupOrCreateAnimatedProperty(m_points))->animVal(); >-} >- > size_t SVGPolyElement::approximateMemoryCost() const > { >- size_t pointsCost = pointList().size() * sizeof(FloatPoint); >+ size_t pointsCost = m_points->baseVal()->items().size() * sizeof(FloatPoint); > // We need to account for the memory which is allocated by the RenderSVGPath::m_path. > return sizeof(*this) + (renderer() ? pointsCost * 2 + sizeof(RenderSVGPath) : pointsCost); > } >diff --git a/Source/WebCore/svg/SVGPolyElement.h b/Source/WebCore/svg/SVGPolyElement.h >index 0320c047808..423f9cacf0b 100644 >--- a/Source/WebCore/svg/SVGPolyElement.h >+++ b/Source/WebCore/svg/SVGPolyElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedPointList.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -31,10 +30,10 @@ namespace WebCore { > class SVGPolyElement : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGPolyElement); > public: >- Ref<SVGPointList> points(); >- Ref<SVGPointList> animatedPoints(); >- >- const SVGPointListValues& pointList() const { return m_points.value(); } >+ const SVGPointList& points() const { return m_points->currentValue(); } >+ >+ Ref<SVGPointList>& points() { return m_points->baseVal(); } >+ RefPtr<SVGPointList>& animatedPoints() { return m_points->animVal(); } > > size_t approximateMemoryCost() const override; > >@@ -42,20 +41,17 @@ protected: > SVGPolyElement(const QualifiedName&, Document&); > > private: >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > > bool isValid() const override { return SVGTests::isValid(); } > bool supportsMarkers() const override { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedPointListAttribute m_points; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedPointList> m_points { SVGAnimatedPointList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGRectElement.cpp b/Source/WebCore/svg/SVGRectElement.cpp >index cfdf196d035..68e189fac2e 100644 >--- a/Source/WebCore/svg/SVGRectElement.cpp >+++ b/Source/WebCore/svg/SVGRectElement.cpp >@@ -36,7 +36,16 @@ inline SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document& do > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::rectTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGRectElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGRectElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGRectElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGRectElement::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::rxAttr, &SVGRectElement::m_rx>(); >+ PropertyRegistry::registerProperty<SVGNames::ryAttr, &SVGRectElement::m_ry>(); >+ }); > } > > Ref<SVGRectElement> SVGRectElement::create(const QualifiedName& tagName, Document& document) >@@ -44,35 +53,22 @@ Ref<SVGRectElement> SVGRectElement::create(const QualifiedName& tagName, Documen > return adoptRef(*new SVGRectElement(tagName, document)); > } > >-void SVGRectElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGRectElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGRectElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGRectElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGRectElement::m_height>(); >- registry.registerAttribute<SVGNames::rxAttr, &SVGRectElement::m_rx>(); >- registry.registerAttribute<SVGNames::ryAttr, &SVGRectElement::m_ry>(); >-} >- > void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rxAttr) >- m_rx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_rx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::ryAttr) >- m_ry.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_ry->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -82,7 +78,7 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; >diff --git a/Source/WebCore/svg/SVGRectElement.h b/Source/WebCore/svg/SVGRectElement.h >index e4cdab1affa..dcafca08014 100644 >--- a/Source/WebCore/svg/SVGRectElement.h >+++ b/Source/WebCore/svg/SVGRectElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -34,29 +32,26 @@ class SVGRectElement final : public SVGGeometryElement, public SVGExternalResour > public: > static Ref<SVGRectElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& rx() const { return m_rx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& ry() const { return m_ry.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ const SVGLengthValue& rx() const { return m_rx->currentValue(); } >+ const SVGLengthValue& ry() const { return m_ry->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rxAnimated() { return m_rx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> ryAnimated() { return m_ry.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedLength>& rx() { return m_rx; } >+ Ref<SVGAnimatedLength>& ry() { return m_ry; } > > private: > SVGRectElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGRectElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRectElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -65,13 +60,13 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_rx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_ry { LengthModeHeight}; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_rx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_ry { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191237
:
353808
|
353812
|
353815
|
353817
|
353818
|
353820
|
353824
|
353825
|
355382
|
355386
|
355388
|
355393
|
355568
|
355574
|
355575
|
355577
|
355580
|
355582
|
355585
|
355666
|
355672
|
355693
|
355699
|
355711
|
355752
|
355777
|
355820
|
356333
|
356334
|
356338
|
356340
|
356342
|
356344
|
356346
|
356351
|
356352
|
356358
|
356360
|
356380
|
356497
|
356500
|
356507
|
356579
|
356607
|
356728
|
356729
|
356730
|
356731
|
356732
|
356733
|
356752
|
356810
|
356811
|
356879
|
356880
|
356881
|
356882
|
356883
|
356884
|
356885
|
356887
|
356888
|
356889
|
356892
|
356895
|
356896
|
359721
|
359735
|
359747
|
363581
|
363595
|
363613
|
363690
|
364172
|
364180
|
366512
|
366557
|
366636