WebKit Bugzilla
Attachment 356880 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]
20-Miscellaneous
20-Miscellaneous.patch (text/plain), 25.90 KB, created by
Said Abou-Hallawa
on 2018-12-08 11:33:33 PST
(
hide
)
Description:
20-Miscellaneous
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-08 11:33:33 PST
Size:
25.90 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a8353320b3a..e9397b3bd1d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,47 @@ >+2018-12-07 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 SVG miscellaneous objects. >+ >+ * svg/SVGAElement.cpp: >+ (WebCore::SVGAElement::SVGAElement): >+ (WebCore::SVGAElement::parseAttribute): >+ (WebCore::SVGAElement::svgAttributeChanged): >+ (WebCore::SVGAElement::defaultEventHandler): >+ (WebCore::SVGAElement::registerAttributes): Deleted. >+ * svg/SVGAElement.h: >+ * svg/SVGCursorElement.cpp: >+ (WebCore::SVGCursorElement::SVGCursorElement): >+ (WebCore::SVGCursorElement::parseAttribute): >+ (WebCore::SVGCursorElement::svgAttributeChanged): >+ (WebCore::SVGCursorElement::registerAttributes): Deleted. >+ * svg/SVGCursorElement.h: >+ * svg/SVGGlyphRefElement.h: >+ * svg/SVGScriptElement.cpp: >+ (WebCore::SVGScriptElement::svgAttributeChanged): >+ * svg/SVGScriptElement.h: >+ * svg/SVGSwitchElement.h: >+ * svg/SVGTRefElement.cpp: >+ (WebCore::SVGTRefElement::detachTarget): >+ (WebCore::SVGTRefElement::buildPendingResource): >+ * svg/SVGTRefElement.h: >+ * svg/SVGViewElement.cpp: >+ (WebCore::SVGViewElement::SVGViewElement): >+ (WebCore::SVGViewElement::parseAttribute): >+ (WebCore::SVGViewElement::viewTarget): Deleted. >+ * svg/SVGViewElement.h: >+ * svg/SVGViewSpec.cpp: >+ (WebCore::SVGViewSpec::SVGViewSpec): >+ (WebCore::SVGViewSpec::reset): >+ (WebCore::SVGViewSpec::parseViewSpec): >+ (WebCore::SVGViewSpec::registerAttributes): Deleted. >+ (WebCore::SVGViewSpec::transform): Deleted. >+ * svg/SVGViewSpec.h: >+ > 2018-12-07 Said Abou-Hallawa <sabouhallawa@apple.com> > > Remove SVG properties tear-off objects >diff --git a/Source/WebCore/svg/SVGAElement.cpp b/Source/WebCore/svg/SVGAElement.cpp >index ca9cdf06b9b..481d93f9318 100644 >--- a/Source/WebCore/svg/SVGAElement.cpp >+++ b/Source/WebCore/svg/SVGAElement.cpp >@@ -52,7 +52,11 @@ inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document& document > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::aTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::targetAttr, &SVGAElement::m_target>(); >+ }); > } > > Ref<SVGAElement> SVGAElement::create(const QualifiedName& tagName, Document& document) >@@ -71,18 +75,10 @@ String SVGAElement::title() const > return SVGElement::title(); > } > >-void SVGAElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::targetAttr, &SVGAElement::m_target>(); >-} >- > void SVGAElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::targetAttr) { >- m_target.setValue(value); >+ m_target->setBaseValInternal(value); > return; > } > >@@ -95,7 +91,8 @@ void SVGAElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (SVGURIReference::isKnownAttribute(attrName)) { > bool wasLink = isLink(); >- setIsLink(!href().isNull() && !shouldProhibitLinks(this)); >+ String href = this->href()->currentValue(); >+ setIsLink(!href.isNull() && !shouldProhibitLinks(this)); > if (wasLink != isLink()) { > InstanceInvalidationGuard guard(*this); > invalidateStyleForSubtree(); >@@ -125,7 +122,8 @@ void SVGAElement::defaultEventHandler(Event& event) > } > > if (MouseEvent::canTriggerActivationBehavior(event)) { >- String url = stripLeadingAndTrailingHTMLSpaces(href()); >+ String href = this->href()->currentValue(); >+ String url = stripLeadingAndTrailingHTMLSpaces(href); > > if (url[0] == '#') { > auto targetElement = makeRefPtr(treeScope().getElementById(url.substringSharingImpl(1))); >@@ -139,7 +137,7 @@ void SVGAElement::defaultEventHandler(Event& event) > return; > } > >- String target = this->target(); >+ String target = this->target()->currentValue(); > if (target.isEmpty() && attributeWithoutSynchronization(XLinkNames::showAttr) == "new") > target = "_blank"; > event.setDefaultHandled(); >diff --git a/Source/WebCore/svg/SVGAElement.h b/Source/WebCore/svg/SVGAElement.h >index d41ad0b3522..c39ee2f5851 100644 >--- a/Source/WebCore/svg/SVGAElement.h >+++ b/Source/WebCore/svg/SVGAElement.h >@@ -33,17 +33,15 @@ class SVGAElement final : public SVGGraphicsElement, public SVGExternalResources > public: > static Ref<SVGAElement> create(const QualifiedName&, Document&); > >- String target() const final { return m_target.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> targetAnimated() { return m_target.animatedProperty(attributeOwnerProxy()); } >+ String target() const final { return m_target->currentValue(); } >+ Ref<SVGAnimatedString>& target() { return m_target; } > > private: > SVGAElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGAElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ 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; > >@@ -63,8 +61,8 @@ private: > > bool willRespondToMouseClickEvents() final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_target; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_target { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGCursorElement.cpp b/Source/WebCore/svg/SVGCursorElement.cpp >index cd808c9984b..aab4f2fa126 100644 >--- a/Source/WebCore/svg/SVGCursorElement.cpp >+++ b/Source/WebCore/svg/SVGCursorElement.cpp >@@ -40,7 +40,12 @@ inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::cursorTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGCursorElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGCursorElement::m_y>(); >+ }); > } > > Ref<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Document& document) >@@ -54,23 +59,14 @@ SVGCursorElement::~SVGCursorElement() > client->cursorElementRemoved(*this); > } > >-void SVGCursorElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGCursorElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGCursorElement::m_y>(); >-} >- > void SVGCursorElement::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)); > > reportAttributeParsingError(parseError, name, value); > >@@ -92,7 +88,7 @@ void SVGCursorElement::removeClient(CSSCursorImageValue& value) > > void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > for (auto& client : m_clients) > client->cursorElementChanged(*this); >diff --git a/Source/WebCore/svg/SVGCursorElement.h b/Source/WebCore/svg/SVGCursorElement.h >index 2a71c62c0b6..f21cefa3d55 100644 >--- a/Source/WebCore/svg/SVGCursorElement.h >+++ b/Source/WebCore/svg/SVGCursorElement.h >@@ -21,9 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGTests.h" >@@ -43,21 +40,18 @@ public: > void addClient(CSSCursorImageValue&); > void removeClient(CSSCursorImageValue&); > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } > > private: > SVGCursorElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGCursorElement, SVGElement, SVGExternalResourcesRequired, SVGTests, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCursorElement, SVGElement, SVGExternalResourcesRequired, SVGTests, SVGURIReference>; >+ 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; > >@@ -66,9 +60,9 @@ private: > > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; > HashSet<CSSCursorImageValue*> m_clients; > }; > >diff --git a/Source/WebCore/svg/SVGGlyphRefElement.h b/Source/WebCore/svg/SVGGlyphRefElement.h >index 8810d5b0926..0a2fb841d39 100644 >--- a/Source/WebCore/svg/SVGGlyphRefElement.h >+++ b/Source/WebCore/svg/SVGGlyphRefElement.h >@@ -46,8 +46,9 @@ public: > private: > SVGGlyphRefElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGlyphRefElement, SVGElement, SVGURIReference>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGlyphRefElement, SVGElement, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ > void parseAttribute(const QualifiedName&, const AtomicString&) final; > > bool rendererIsNeeded(const RenderStyle&) final { return false; } >@@ -56,7 +57,7 @@ private: > float m_y { 0 }; > float m_dx { 0 }; > float m_dy { 0 }; >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } >diff --git a/Source/WebCore/svg/SVGScriptElement.cpp b/Source/WebCore/svg/SVGScriptElement.cpp >index 9c333ed1906..11867139d67 100644 >--- a/Source/WebCore/svg/SVGScriptElement.cpp >+++ b/Source/WebCore/svg/SVGScriptElement.cpp >@@ -24,7 +24,6 @@ > > #include "Document.h" > #include "Event.h" >-#include "SVGAnimatedStaticPropertyTearOff.h" > #include <wtf/IsoMallocInlines.h> > > namespace WebCore { >@@ -58,7 +57,7 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > > if (SVGURIReference::isKnownAttribute(attrName)) { >- handleSourceAttribute(href()); >+ handleSourceAttribute(href()->currentValue()); > return; > } > >diff --git a/Source/WebCore/svg/SVGScriptElement.h b/Source/WebCore/svg/SVGScriptElement.h >index f8ced22a327..d7f66ec421e 100644 >--- a/Source/WebCore/svg/SVGScriptElement.h >+++ b/Source/WebCore/svg/SVGScriptElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGURIReference.h" >@@ -42,9 +40,9 @@ public: > private: > SVGScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGScriptElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGScriptElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -56,7 +54,7 @@ private: > void finishParsingChildren() final; > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > >- bool haveLoadedRequiredResources() final { return SVGExternalResourcesRequired::haveLoadedRequiredResources(); } >+ bool haveLoadedRequiredResources() const final { return SVGExternalResourcesRequired::haveLoadedRequiredResources(); } > > String sourceAttributeValue() const final { return href(); } > String charsetAttributeValue() const final { return String(); } >@@ -80,11 +78,7 @@ private: > bool haveFiredLoadEvent() const final { return ScriptElement::haveFiredLoadEvent(); } > Timer* svgLoadEventTimer() final { return &m_svgLoadEventTimer; } > >-#ifndef NDEBUG >- bool filterOutAnimatableAttribute(const QualifiedName& name) const final { return name == SVGNames::typeAttr; } >-#endif >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > Timer m_svgLoadEventTimer; > }; > >diff --git a/Source/WebCore/svg/SVGSwitchElement.h b/Source/WebCore/svg/SVGSwitchElement.h >index 1e44667db4e..4d6cec36bbe 100644 >--- a/Source/WebCore/svg/SVGSwitchElement.h >+++ b/Source/WebCore/svg/SVGSwitchElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > >@@ -35,15 +34,15 @@ public: > private: > SVGSwitchElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGSwitchElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSwitchElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > bool isValid() const final { return SVGTests::isValid(); } > > bool childShouldCreateRenderer(const Node&) const final; > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp >index b73f3cf878f..74df34562b0 100644 >--- a/Source/WebCore/svg/SVGTRefElement.cpp >+++ b/Source/WebCore/svg/SVGTRefElement.cpp >@@ -167,7 +167,8 @@ void SVGTRefElement::detachTarget() > return; > > // Mark the referenced ID as pending. >- auto target = SVGURIReference::targetElementFromIRIString(href(), document()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, document()); > if (!target.identifier.isEmpty()) > document().accessSVGExtensions().addPendingResource(target.identifier, this); > } >@@ -230,7 +231,8 @@ void SVGTRefElement::buildPendingResource() > if (!isConnected()) > return; > >- auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); > if (!target.element) { > if (target.identifier.isEmpty()) > return; >diff --git a/Source/WebCore/svg/SVGTRefElement.h b/Source/WebCore/svg/SVGTRefElement.h >index ba17ccaae7e..83d3220ad12 100644 >--- a/Source/WebCore/svg/SVGTRefElement.h >+++ b/Source/WebCore/svg/SVGTRefElement.h >@@ -39,9 +39,9 @@ private: > SVGTRefElement(const QualifiedName&, Document&); > virtual ~SVGTRefElement(); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTRefElement, SVGTextPositioningElement, SVGURIReference>; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTRefElement, SVGTextPositioningElement, SVGURIReference>; >+ 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; > >@@ -58,7 +58,7 @@ private: > void detachTarget(); > void buildPendingResource() override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > Ref<SVGTRefTargetEventListener> m_targetListener; > }; > >diff --git a/Source/WebCore/svg/SVGViewElement.cpp b/Source/WebCore/svg/SVGViewElement.cpp >index 53bf4a34ff1..1f6695382d1 100644 >--- a/Source/WebCore/svg/SVGViewElement.cpp >+++ b/Source/WebCore/svg/SVGViewElement.cpp >@@ -34,25 +34,26 @@ inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document& do > : SVGElement(tagName, document) > , SVGExternalResourcesRequired(this) > , SVGFitToViewBox(this) >- , m_viewTarget(SVGNames::viewTargetAttr) > { > ASSERT(hasTagName(SVGNames::viewTag)); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::viewTargetAttr, &SVGViewElement::m_viewTarget>(); >+ }); > } > > Ref<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Document& document) > { > return adoptRef(*new SVGViewElement(tagName, document)); > } >- >-Ref<SVGStringList> SVGViewElement::viewTarget() >-{ >- return SVGStringList::create(*this, m_viewTarget); >-} >- >+ > void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { >- if (name == SVGNames::viewTargetAttr) >- m_viewTarget.reset(value); >+ if (name == SVGNames::viewTargetAttr) { >+ m_viewTarget->reset(value); >+ return; >+ } > > SVGElement::parseAttribute(name, value); > SVGExternalResourcesRequired::parseAttribute(name, value); >diff --git a/Source/WebCore/svg/SVGViewElement.h b/Source/WebCore/svg/SVGViewElement.h >index a5773104dca..be40fdc34aa 100644 >--- a/Source/WebCore/svg/SVGViewElement.h >+++ b/Source/WebCore/svg/SVGViewElement.h >@@ -24,34 +24,31 @@ > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFitToViewBox.h" >+#include "SVGStringList.h" > #include "SVGZoomAndPan.h" > > namespace WebCore { > >-class SVGStringList; >- > class SVGViewElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGZoomAndPan { > WTF_MAKE_ISO_ALLOCATED(SVGViewElement); > public: > static Ref<SVGViewElement> create(const QualifiedName&, Document&); > >- using SVGElement::ref; >- using SVGElement::deref; >- >- Ref<SVGStringList> viewTarget(); >+ Ref<SVGStringList> viewTarget() { return m_viewTarget.copyRef(); } > > private: > SVGViewElement(const QualifiedName&, Document&); > >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ > // FIXME: svgAttributeChanged missing. >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGViewElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGStringListValues m_viewTarget; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGStringList> m_viewTarget { SVGStringList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGViewSpec.cpp b/Source/WebCore/svg/SVGViewSpec.cpp >index caea7cace28..1d4d47dfb3a 100644 >--- a/Source/WebCore/svg/SVGViewSpec.cpp >+++ b/Source/WebCore/svg/SVGViewSpec.cpp >@@ -22,7 +22,6 @@ > #include "SVGViewSpec.h" > > #include "Document.h" >-#include "SVGAnimatedTransformList.h" > #include "SVGElement.h" > #include "SVGFitToViewBox.h" > #include "SVGNames.h" >@@ -33,19 +32,14 @@ > namespace WebCore { > > SVGViewSpec::SVGViewSpec(SVGElement& contextElement) >- : SVGFitToViewBox(&contextElement, PropertyIsReadOnly) >+ : SVGFitToViewBox(&contextElement, SVGPropertyAccess::ReadOnly) > , m_contextElement(&contextElement) >- , m_attributeOwnerProxy(*this, contextElement) >+ , m_transform(SVGTransformList::create(&contextElement, SVGPropertyAccess::ReadOnly)) > { >- registerAttributes(); >-} >- >-void SVGViewSpec::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::transformAttr, &SVGViewSpec::m_transform>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::transformAttr, &SVGViewSpec::m_transform>(); >+ }); > } > > SVGElement* SVGViewSpec::viewTarget() const >@@ -58,18 +52,10 @@ SVGElement* SVGViewSpec::viewTarget() const > return downcast<SVGElement>(element); > } > >-RefPtr<SVGTransformList> SVGViewSpec::transform() >-{ >- if (!m_contextElement) >- return nullptr; >- // Return the animVal here, as its readonly by default - which is exactly what we want here. >- return m_transform.animatedProperty(m_attributeOwnerProxy)->animVal(); >-} >- > void SVGViewSpec::reset() > { > m_viewTargetString = emptyString(); >- m_transform.resetValue(); >+ m_transform->clearItems(); > SVGFitToViewBox::reset(); > SVGZoomAndPan::reset(); > } >@@ -152,7 +138,7 @@ bool SVGViewSpec::parseViewSpec(const String& viewSpec) > if (currViewSpec >= end || *currViewSpec != '(') > return false; > currViewSpec++; >- SVGTransformable::parseTransformAttribute(m_transform.value(), currViewSpec, end, SVGTransformable::DoNotClearList); >+ m_transform->parse(currViewSpec, end); > if (currViewSpec >= end || *currViewSpec != ')') > return false; > currViewSpec++; >diff --git a/Source/WebCore/svg/SVGViewSpec.h b/Source/WebCore/svg/SVGViewSpec.h >index b8849961893..f41fbf5c207 100644 >--- a/Source/WebCore/svg/SVGViewSpec.h >+++ b/Source/WebCore/svg/SVGViewSpec.h >@@ -20,10 +20,8 @@ > > #pragma once > >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedRect.h" > #include "SVGFitToViewBox.h" >-#include "SVGTransformListValues.h" >+#include "SVGTransformList.h" > #include "SVGZoomAndPan.h" > > namespace WebCore { >@@ -45,23 +43,19 @@ public: > SVGElement* viewTarget() const; > const String& viewTargetString() const { return m_viewTargetString; } > >- String transformString() const { return m_transform.toString(); } >- RefPtr<SVGTransformList> transform(); >- SVGTransformListValues transformValue() const { return m_transform.value(); } >+ String transformString() const { return m_transform->valueAsString(); } >+ Ref<SVGTransformList>& transform() { return m_transform; } > > private: > explicit SVGViewSpec(SVGElement&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGViewSpec, SVGFitToViewBox, SVGZoomAndPan>; >- static void registerAttributes(); >- >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>; >+ > SVGElement* m_contextElement; > String m_viewTargetString; >- AttributeOwnerProxy m_attributeOwnerProxy; >- SVGAnimatedTransformListAttribute m_transform; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGTransformList> m_transform; > }; > > } // 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