WebKit Bugzilla
Attachment 346322 Details for
Bug 186751
: Remove the SVG elements' attributes macros
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Remove SVG macros from SVGTextPositioningElement
186751-38.patch (text/plain), 9.44 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:44:25 PDT
(
hide
)
Description:
Remove SVG macros from SVGTextPositioningElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:44:25 PDT
Size:
9.44 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b8516fb5e61..efb98c300ef 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [38] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGTextPositioningElement. >+ >+ * svg/SVGTextPositioningElement.cpp: >+ (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): >+ (WebCore::SVGTextPositioningElement::registerAttributes): >+ (WebCore::SVGTextPositioningElement::parseAttribute): >+ (WebCore::SVGTextPositioningElement::svgAttributeChanged): >+ * svg/SVGTextPositioningElement.h: >+ (WebCore::SVGTextPositioningElement::attributeRegistry): >+ (WebCore::SVGTextPositioningElement::x const): >+ (WebCore::SVGTextPositioningElement::y const): >+ (WebCore::SVGTextPositioningElement::dx const): >+ (WebCore::SVGTextPositioningElement::dy const): >+ (WebCore::SVGTextPositioningElement::rotate const): >+ (WebCore::SVGTextPositioningElement::xAnimated): >+ (WebCore::SVGTextPositioningElement::yAnimated): >+ (WebCore::SVGTextPositioningElement::dxAnimated): >+ (WebCore::SVGTextPositioningElement::dyAnimated): >+ (WebCore::SVGTextPositioningElement::rotateAnimated): >+ (WebCore::SVGTextPositioningElement::isKnownAttribute): >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [37] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.cpp b/Source/WebCore/svg/SVGTextPositioningElement.cpp >index 48d2f65ca2c..7a1dc78ff0e 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.cpp >+++ b/Source/WebCore/svg/SVGTextPositioningElement.cpp >@@ -2,6 +2,7 @@ > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> > * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. >+ * Copyright (C) 2018 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -38,26 +39,22 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGTextPositioningElement); > >-// Animated property definitions >-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::xAttr, X, x) >-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::yAttr, Y, y) >-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::dxAttr, Dx, dx) >-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::dyAttr, Dy, dy) >-DEFINE_ANIMATED_NUMBER_LIST(SVGTextPositioningElement, SVGNames::rotateAttr, Rotate, rotate) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextPositioningElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(x) >- REGISTER_LOCAL_ANIMATED_PROPERTY(y) >- REGISTER_LOCAL_ANIMATED_PROPERTY(dx) >- REGISTER_LOCAL_ANIMATED_PROPERTY(dy) >- REGISTER_LOCAL_ANIMATED_PROPERTY(rotate) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextContentElement) >-END_REGISTER_ANIMATED_PROPERTIES >- > SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document& document) > : SVGTextContentElement(tagName, document) > { >- registerAnimatedPropertiesForSVGTextPositioningElement(); >+ registerAttributes(); >+} >+ >+void SVGTextPositioningElement::registerAttributes() >+{ >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::xAttr, &SVGTextPositioningElement::m_x>(); >+ registry.registerAttribute<SVGNames::yAttr, &SVGTextPositioningElement::m_y>(); >+ registry.registerAttribute<SVGNames::dxAttr, &SVGTextPositioningElement::m_dx>(); >+ registry.registerAttribute<SVGNames::dyAttr, &SVGTextPositioningElement::m_dy>(); >+ registry.registerAttribute<SVGNames::rotateAttr, &SVGTextPositioningElement::m_rotate>(); > } > > void SVGTextPositioningElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -65,40 +62,40 @@ void SVGTextPositioningElement::parseAttribute(const QualifiedName& name, const > if (name == SVGNames::xAttr) { > SVGLengthListValues newList; > newList.parse(value, LengthModeWidth); >- detachAnimatedXListWrappers(newList.size()); >- setXBaseValue(newList); >+ m_x.detachAnimatedListWrappers(newList.size()); >+ m_x.setValue(WTFMove(newList)); > return; > } > > if (name == SVGNames::yAttr) { > SVGLengthListValues newList; > newList.parse(value, LengthModeHeight); >- detachAnimatedYListWrappers(newList.size()); >- setYBaseValue(newList); >+ m_y.detachAnimatedListWrappers(newList.size()); >+ m_y.setValue(WTFMove(newList)); > return; > } > > if (name == SVGNames::dxAttr) { > SVGLengthListValues newList; > newList.parse(value, LengthModeWidth); >- detachAnimatedDxListWrappers(newList.size()); >- setDxBaseValue(newList); >+ m_dx.detachAnimatedListWrappers(newList.size()); >+ m_dx.setValue(WTFMove(newList)); > return; > } > > if (name == SVGNames::dyAttr) { > SVGLengthListValues newList; > newList.parse(value, LengthModeHeight); >- detachAnimatedDyListWrappers(newList.size()); >- setDyBaseValue(newList); >+ m_dy.detachAnimatedListWrappers(newList.size()); >+ m_dy.setValue(WTFMove(newList)); > return; > } > > if (name == SVGNames::rotateAttr) { > SVGNumberListValues newList; > newList.parse(value); >- detachAnimatedRotateListWrappers(newList.size()); >- setRotateBaseValue(newList); >+ m_rotate.detachAnimatedListWrappers(newList.size()); >+ m_rotate.setValue(WTFMove(newList)); > return; > } > >@@ -121,7 +118,7 @@ bool SVGTextPositioningElement::isPresentationAttribute(const QualifiedName& nam > > void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || attrName == SVGNames::dxAttr || attrName == SVGNames::dyAttr || attrName == SVGNames::rotateAttr) { >+ if (isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > > if (attrName != SVGNames::rotateAttr) >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.h b/Source/WebCore/svg/SVGTextPositioningElement.h >index 65a4a6dcaca..0329106d81a 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.h >+++ b/Source/WebCore/svg/SVGTextPositioningElement.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >+ * Copyright (C) 2018 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -31,6 +32,21 @@ class SVGTextPositioningElement : public SVGTextContentElement { > public: > static SVGTextPositioningElement* elementFromRenderer(RenderBoxModelObject&); > >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTextPositioningElement, SVGTextContentElement>; >+ static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ >+ const SVGLengthListValues& x() const { return m_x.currentValue(); } >+ const SVGLengthListValues& y() const { return m_y.currentValue(); } >+ const SVGLengthListValues& dx() const { return m_dx.currentValue(); } >+ const SVGLengthListValues& dy() const { return m_dy.currentValue(); } >+ const SVGNumberListValues& rotate() const { return m_rotate.currentValue(); } >+ >+ RefPtr<SVGAnimatedLengthList> xAnimated() { return m_x.animatedProperty(); } >+ RefPtr<SVGAnimatedLengthList> yAnimated() { return m_y.animatedProperty(); } >+ RefPtr<SVGAnimatedLengthList> dxAnimated() { return m_dx.animatedProperty(); } >+ RefPtr<SVGAnimatedLengthList> dyAnimated() { return m_dy.animatedProperty(); } >+ RefPtr<SVGAnimatedNumberList> rotateAnimated() { return m_rotate.animatedProperty(); } >+ > protected: > SVGTextPositioningElement(const QualifiedName&, Document&); > >@@ -41,13 +57,17 @@ private: > bool isPresentationAttribute(const QualifiedName&) const final; > void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final; > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextPositioningElement) >- DECLARE_ANIMATED_LENGTH_LIST(X, x) >- DECLARE_ANIMATED_LENGTH_LIST(Y, y) >- DECLARE_ANIMATED_LENGTH_LIST(Dx, dx) >- DECLARE_ANIMATED_LENGTH_LIST(Dy, dy) >- DECLARE_ANIMATED_NUMBER_LIST(Rotate, rotate) >- END_DECLARE_ANIMATED_PROPERTIES >+ const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >+ >+ static void registerAttributes(); >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedLengthListAttribute m_x { m_attributeOwnerProxy }; >+ SVGAnimatedLengthListAttribute m_y { m_attributeOwnerProxy }; >+ SVGAnimatedLengthListAttribute m_dx { m_attributeOwnerProxy }; >+ SVGAnimatedLengthListAttribute m_dy { m_attributeOwnerProxy }; >+ SVGAnimatedNumberListAttribute m_rotate { m_attributeOwnerProxy }; > }; > > } // 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 186751
:
342916
|
342917
|
342985
|
343001
|
343114
|
343123
|
343124
|
343127
|
343129
|
343162
|
343167
|
343169
|
343171
|
343174
|
343213
|
343217
|
343327
|
343335
|
343338
|
343339
|
343343
|
343415
|
343979
|
343989
|
344002
|
344513
|
344516
|
344523
|
344534
|
344536
|
344988
|
344990
|
346097
|
346103
|
346124
|
346129
|
346177
|
346179
|
346180
|
346182
|
346185
|
346188
|
346190
|
346192
|
346193
|
346197
|
346199
|
346201
|
346202
|
346203
|
346204
|
346205
|
346206
|
346207
|
346211
|
346212
|
346217
|
346224
|
346230
|
346233
|
346241
|
346244
|
346245
|
346315
|
346316
|
346317
|
346318
|
346319
|
346320
|
346322
|
346323
|
346324
|
346325
|
346326
|
346327
|
346328
|
346329
|
346330
|
346331
|
346332
|
346333
|
346334
|
346335
|
346336
|
346337
|
346338
|
346339
|
346340
|
346341
|
346342
|
346343
|
346344
|
346345
|
346346
|
346347
|
346348
|
346349
|
346350
|
346518
|
346519
|
346520
|
346521
|
346522
|
346524
|
346525
|
346526
|
346527
|
346528
|
346529
|
346530
|
346531
|
346532
|
346533
|
346534
|
346535
|
346536
|
346537
|
346538
|
346539
|
346540
|
346541
|
346545
|
346546
|
346549
|
346551
|
346552
|
346601
|
346602
|
346611
|
346636
|
346642