WebKit Bugzilla
Attachment 346333 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 SVGFEDropShadowElement
186751-49.patch (text/plain), 8.62 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:52:26 PDT
(
hide
)
Description:
Remove SVG macros from SVGFEDropShadowElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:52:26 PDT
Size:
8.62 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a3acebbb1a7..1d7fc2cee30 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [49] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGFEDropShadowElement. >+ >+ * svg/SVGFEDropShadowElement.cpp: >+ (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement): >+ (WebCore::SVGFEDropShadowElement::setStdDeviation): >+ (WebCore::SVGFEDropShadowElement::registerAttributes): >+ (WebCore::SVGFEDropShadowElement::parseAttribute): >+ (WebCore::SVGFEDropShadowElement::svgAttributeChanged): >+ * svg/SVGFEDropShadowElement.h: >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [48] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >index cc4bba11601..550f65e2743 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.cpp >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2011. 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 >@@ -31,31 +32,11 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFEDropShadowElement); > >-// Animated property definitions >-DEFINE_ANIMATED_STRING(SVGFEDropShadowElement, SVGNames::inAttr, In1, in1) >-DEFINE_ANIMATED_NUMBER(SVGFEDropShadowElement, SVGNames::dxAttr, Dx, dx) >-DEFINE_ANIMATED_NUMBER(SVGFEDropShadowElement, SVGNames::dyAttr, Dy, dy) >-DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDropShadowElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), StdDeviationX, stdDeviationX) >-DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDropShadowElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), StdDeviationY, stdDeviationY) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDropShadowElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(in1) >- REGISTER_LOCAL_ANIMATED_PROPERTY(dx) >- REGISTER_LOCAL_ANIMATED_PROPERTY(dy) >- REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationX) >- REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationY) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagName, Document& document) > : SVGFilterPrimitiveStandardAttributes(tagName, document) >- , m_dx(2) >- , m_dy(2) >- , m_stdDeviationX(2) >- , m_stdDeviationY(2) > { > ASSERT(hasTagName(SVGNames::feDropShadowTag)); >- registerAnimatedPropertiesForSVGFEDropShadowElement(); >+ registerAttributes(); > } > > Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& tagName, Document& document) >@@ -77,34 +58,47 @@ const AtomicString& SVGFEDropShadowElement::stdDeviationYIdentifier() > > void SVGFEDropShadowElement::setStdDeviation(float x, float y) > { >- setStdDeviationXBaseValue(x); >- setStdDeviationYBaseValue(y); >+ m_stdDeviationX.setValue(x); >+ m_stdDeviationY.setValue(y); > invalidate(); > } > >+void SVGFEDropShadowElement::registerAttributes() >+{ >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>(); >+ registry.registerAttribute<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>(); >+ registry.registerAttribute<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>(); >+ registry.registerAttribute<SVGNames::stdDeviationAttr, >+ &SVGFEDropShadowElement::stdDeviationXIdentifier, &SVGFEDropShadowElement::m_stdDeviationX, >+ &SVGFEDropShadowElement::stdDeviationYIdentifier, &SVGFEDropShadowElement::m_stdDeviationY>(); >+} >+ > void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::stdDeviationAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- setStdDeviationXBaseValue(x); >- setStdDeviationYBaseValue(y); >+ m_stdDeviationX.setValue(x); >+ m_stdDeviationY.setValue(y); > } > return; > } > > if (name == SVGNames::inAttr) { >- setIn1BaseValue(value); >+ m_in1.setValue(value); > return; > } > > if (name == SVGNames::dxAttr) { >- setDxBaseValue(value.toFloat()); >+ m_dx.setValue(value.toFloat()); > return; > } > > if (name == SVGNames::dyAttr) { >- setDyBaseValue(value.toFloat()); >+ m_dy.setValue(value.toFloat()); > return; > } > >@@ -113,7 +107,7 @@ void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const Ato > > void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::inAttr || attrName == SVGNames::stdDeviationAttr || attrName == SVGNames::dxAttr || attrName == SVGNames::dyAttr) { >+ if (isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.h b/Source/WebCore/svg/SVGFEDropShadowElement.h >index dc5302bcbc4..87dd6ab34e3 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.h >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2011. 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 >@@ -24,31 +25,49 @@ > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >- >+ > class SVGFEDropShadowElement final : public SVGFilterPrimitiveStandardAttributes { > WTF_MAKE_ISO_ALLOCATED(SVGFEDropShadowElement); > public: > static Ref<SVGFEDropShadowElement> create(const QualifiedName&, Document&); > > void setStdDeviation(float stdDeviationX, float stdDeviationY); >- >+ >+ String in1() const { return m_in1.currentValue(); } >+ float dx() const { return m_dx.currentValue(); } >+ float dy() const { return m_dy.currentValue(); } >+ float stdDeviationX() const { return m_stdDeviationX.currentValue(); } >+ float stdDeviationY() const { return m_stdDeviationY.currentValue(); } >+ >+ RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(); } >+ > private: > SVGFEDropShadowElement(const QualifiedName&, Document&); >- >+ >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; >+ static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ static void registerAttributes(); >+ >+ const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; >+ > RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- >+ > static const AtomicString& stdDeviationXIdentifier(); > static const AtomicString& stdDeviationYIdentifier(); >- >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDropShadowElement) >- DECLARE_ANIMATED_STRING(In1, in1) >- DECLARE_ANIMATED_NUMBER(Dx, dx) >- DECLARE_ANIMATED_NUMBER(Dy, dy) >- DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX) >- DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY) >- END_DECLARE_ANIMATED_PROPERTIES >+ >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedStringAttribute m_in1 { m_attributeOwnerProxy }; >+ SVGAnimatedNumberAttribute m_dx { m_attributeOwnerProxy, 2 }; >+ SVGAnimatedNumberAttribute m_dy { m_attributeOwnerProxy, 2 }; >+ SVGAnimatedNumberAttribute m_stdDeviationX { m_attributeOwnerProxy, 2 }; >+ SVGAnimatedNumberAttribute m_stdDeviationY { m_attributeOwnerProxy, 2 }; > }; > > } // 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